diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 399308336a9b..000000000000 --- a/.travis.yml +++ /dev/null @@ -1,44 +0,0 @@ -sudo: false - -language: go -go: - - 1.10.x - - 1.11.x - - 1.12.x - -branches: - only: - - master - - latest - -env: - global: - - DEP_RELEASE_TAG=v0.5.1 # so the script knows which version to use - - IGNORE_BREAKING_CHANGES=true - matrix: - - GOARCH="amd64" - - GOARCH="386" - -before_install: - - curl -sSL https://raw.githubusercontent.com/golang/dep/master/install.sh | sh - -install: - - dep ensure -v - -script: - - bash rungas.sh - - grep -L -r --include *.go --exclude-dir vendor -P "Copyright (\d{4}|\(c\)) Microsoft" ./ | tee /dev/stderr | test -z "$(< /dev/stdin)" - - echo -e "travis_fold:start:go.build\033[33;1mBuilding all packages\033[0m" - - go build -v $(go list ./... | grep -v vendor) - - echo -e "\ntravis_fold:end:go.build\r" - - if [[ $TRAVIS_GO_VERSION == 1.11* ]]; then test -z "$(go fmt $(go list ./... | grep -v vendor) | tee /dev/stderr)"; fi - - go vet $(go list ./... | grep -v vendor) - - go test $(sh ./findTestedPackages.sh) - - go run ./tools/apidiff/main.go packages ./services FETCH_HEAD~1 FETCH_HEAD --copyrepo --breakingchanges || $IGNORE_BREAKING_CHANGES - - go run ./tools/pkgchk/main.go ./services --exceptions ./tools/pkgchk/exceptions.txt - - git diff --exit-code - - if [[ "$TRAVIS_EVENT_TYPE" == "push" && "$TRAVIS_BRANCH" == "master" ]]; then go run ./tools/indexer/main.go ./services; fi - -cache: - directories: - - $GOPATH/pkg/dep diff --git a/CHANGELOG.md b/CHANGELOG.md index d81a4b296729..edb525c9748c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,69 @@ # CHANGELOG +## `v35.0.0` + +### New Packages + +| Package Name | API Version | +| -----------: | :---------: | +| appconfiguration | 2019-10-01 | +| authoring | luis | +| containerservice | 2019-09-30-preview
2019-10-01 | +| costmanagement | 2019-10-01
2019-10-01 | +| datashare | 2019-11-01 | +| hybridcompute | 2019-03-18-preview | +| peering | 2019-09-01-preview | +| policyinsights | 2019-10-01 | +| storagecache | 2019-11-01 | +| training | customvision | + +### Updated Packages + +| Package Name | API Version | +| -----------: | :---------: | +| advisor | 2017-03-31
2017-04-19 | +| apimanagement | 2019-01-01 | +| compute | 2018-10-01 | +| containerservice | 2019-08-01 | +| datafactory | 2017-09-01-preview | +| eventgrid | 2018-01-01 | +| eventhub | 2018-01-01-preview | +| maps | 2017-01-01-preview | +| mysql | 2017-12-01-preview | +| postgresql | 2017-12-01-preview | +| qnamakerruntime | v4.0 | +| sqlvirtualmachine | 2017-03-01-preview | +| web | 2018-02-01 | + +### BreakingChanges + +| Package Name | API Version | +| -----------: | :---------: | +| aad | 2017-01-01
2017-06-01 | +| appplatform | 2019-05-01-preview | +| backup | 2016-12-01
2017-07-01 | +| cdn | 2019-04-15 | +| cognitiveservices | 2017-04-18 | +| compute | 2019-03-01
2019-07-01 | +| containerregistry | 2017-10-01
2018-02-01
2018-09-01 | +| datafactory | 2018-06-01 | +| datashare | 2018-11-01-preview | +| hdinsight | 2015-03-01-preview
2018-06-01-preview | +| operationalinsights | 2015-03-20 | +| reservations | 2019-04-01 | +| security | v3.0 | +| servicebus | 2017-04-01 | +| sql | 2014-04-01 | +| storage | 2019-04-01 | +| vmwarecloudsimple | 2019-04-01 | +| web | 2019-08-01 | + +### Removed Packages + +| Package Name | API Version | +| -----------: | :---------: | +| sql | 2018-06-15-preview | + ## `v34.4.0` ### New Packages diff --git a/Gopkg.lock b/Gopkg.lock index d13b87336076..4cad81e6938d 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -2,14 +2,12 @@ [[projects]] - digest = "1:9e57e16a4e809da5d6280ab4e7cb9c3d8a9d5b1065226be2d71c11d070a60e7b" + digest = "1:f6be05c789de8d4fe490d1a7dab6fce033d51924873493be58091119d206170d" 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,8 +15,8 @@ "tracing", ] pruneopts = "UT" - revision = "d9a171ca366fd4acfaa99107cdc4f91877f3572e" - version = "v13.0.2" + revision = "3492b2aff5036c67228ab3c7dba3577c871db200" + version = "v13.3.0" [[projects]] digest = "1:d37f34e1e231ee4b8657d1b6153e2696b1d7341850f648f5d78151d3bc1f677b" @@ -36,38 +34,16 @@ 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" + digest = "1:463a37f152816d49cd4302edaf1f72944c3edade65ffd8b2ea25883755afa156" name = "github.com/dnaeon/go-vcr" packages = [ "cassette", "recorder", ] 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" + revision = "9384691f0462689770c3e930cd8aff05c7075a5b" [[projects]] digest = "1:870d441fe217b8e689d7949fef6e43efbc787e50f200cb1e70dbca9204a1d6be" @@ -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" @@ -143,18 +111,7 @@ [[projects]] branch = "master" - digest = "1:994c4915a59f821705d08ea77b117ec7a3e6a46cc867fd194d887500dac1c3c2" - name = "golang.org/x/crypto" - packages = [ - "pkcs12", - "pkcs12/internal/rc2", - ] - pruneopts = "UT" - revision = "34f69633bfdcf9db92f698f8487115767eebef81" - -[[projects]] - branch = "master" - digest = "1:18c7b936326b4919be6de0a20be857fdd3112036cdb3febfa9a5b332a4f54e27" + digest = "1:634f91b94015dfcb7fe2ab475ee7d6d05bffb0a8ada81839e07a3a3b43067802" name = "golang.org/x/tools" packages = [ "go/ast/astutil", @@ -169,9 +126,10 @@ "internal/imports", "internal/module", "internal/semver", + "internal/span", ] pruneopts = "UT" - revision = "e461004dd03ddc1b89596568ce4119c0e8152ce6" + revision = "80f3f9ca0853fa9dbf1ffdc81029677e3c23108b" [[projects]] branch = "v1" @@ -182,21 +140,19 @@ revision = "41f04d3bba152ddec2103e299fed053415705330" [[projects]] - digest = "1:4d2e5a73dc1500038e504a8d78b986630e3626dc027bc030ba5c75da257cdb96" + digest = "1:59f10c1537d2199d9115d946927fe31165959a95190849c82ff11e05803528b0" name = "gopkg.in/yaml.v2" packages = ["."] pruneopts = "UT" - revision = "51d6538a90f86fe93ac480b35f37b2be17fef232" - version = "v2.2.2" + revision = "f221b8435cfb71e54062f6c6e99e9ade30b124d5" + version = "v2.2.4" [solve-meta] analyzer-name = "dep" 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 +160,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/Gopkg.toml b/Gopkg.toml index b1b137e8b661..397fd11b923c 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -25,7 +25,7 @@ [[constraint]] name = "github.com/Azure/go-autorest" - version = "13.0.2" + version = "13.3.0" [[constraint]] branch = "master" diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d254313e0985..9dc7b82e01ab 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,58 +1,71 @@ -pool: - vmImage: 'Ubuntu 16.04' +jobs: + - job: Build_Test + strategy: + matrix: + Linux_Go112: + vm.image: 'ubuntu-18.04' + go.version: '1.12' + GOROOT: '/usr/local/go$(go.version)' + Linux_Go113: + vm.image: 'ubuntu-18.04' + go.version: '1.13' + GOROOT: '/usr/local/go$(go.version)' -variables: - GOROOT: '/usr/local/go1.12' - GOPATH: '$(system.defaultWorkingDirectory)/work' - sdkPath: '$(GOPATH)/src/github.com/$(build.repository.name)' - IGNORE_BREAKING_CHANGES: true + pool: + vmImage: $(vm.image) -steps: -- script: | - set -e - mkdir -p '$(GOPATH)/bin' - mkdir -p '$(sdkPath)' - shopt -s dotglob extglob - mv !(work) '$(sdkPath)' - echo '##vso[task.prependpath]$(GOROOT)/bin' - echo '##vso[task.prependpath]$(GOPATH)/bin' - displayName: 'Create Go Workspace' -- script: | - set -e - curl -sSL https://raw.githubusercontent.com/golang/dep/master/install.sh | sh - dep ensure -v - go get -u golang.org/x/lint/golint - workingDirectory: '$(sdkPath)' - displayName: 'Install Dependencies' -- script: go vet $(go list ./... | grep -v vendor) - workingDirectory: '$(sdkPath)' - displayName: 'Vet' -- script: go build -v $(go list ./... | grep -v vendor) - workingDirectory: '$(sdkPath)' - displayName: 'Build' -- script: go test $(dirname $(find . -path ./vendor -prune -o -name '*_test.go' -print) | sort -u) - workingDirectory: '$(sdkPath)' - displayName: 'Run Tests' -- script: go run ./tools/apidiff/main.go packages ./services FETCH_HEAD~1 FETCH_HEAD --copyrepo --breakingchanges || $IGNORE_BREAKING_CHANGES - workingDirectory: '$(sdkPath)' - displayName: 'Display Breaking Changes' -- script: go run ./tools/pkgchk/main.go ./services --exceptions ./tools/pkgchk/exceptions.txt - workingDirectory: '$(sdkPath)' - displayName: 'Verify Package Directory' -- script: grep -L -r --include *.go --exclude-dir vendor -P "Copyright (\d{4}|\(c\)) Microsoft" ./ | tee >&2 - workingDirectory: '$(sdkPath)' - displayName: 'Copyright Header Check' - failOnStderr: true - condition: succeededOrFailed() -- script: gofmt -s -l -w $(find . -path ./vendor -prune -o -name '*.go' -print) >&2 - workingDirectory: '$(sdkPath)' - displayName: 'Format Check' - failOnStderr: true - condition: succeededOrFailed() -- script: | - golint ./storage/... >&2 - golint ./tools/... >&2 - workingDirectory: '$(sdkPath)' - displayName: 'Linter Check' - failOnStderr: true - condition: succeededOrFailed() + variables: + GOPATH: '$(system.defaultWorkingDirectory)/work' + sdkPath: '$(GOPATH)/src/github.com/$(build.repository.name)' + IGNORE_BREAKING_CHANGES: true + + steps: + - script: | + set -e + mkdir -p '$(GOPATH)/bin' + mkdir -p '$(sdkPath)' + shopt -s dotglob extglob + mv !(work) '$(sdkPath)' + echo '##vso[task.prependpath]$(GOROOT)/bin' + echo '##vso[task.prependpath]$(GOPATH)/bin' + displayName: 'Create Go Workspace' + - script: | + set -e + go version + curl -sSL https://raw.githubusercontent.com/golang/dep/master/install.sh | sh + dep ensure -v + go get -u golang.org/x/lint/golint + workingDirectory: '$(sdkPath)' + displayName: 'Install Dependencies' + - script: go vet $(go list ./... | grep -v vendor) + workingDirectory: '$(sdkPath)' + displayName: 'Vet' + - script: go build -v $(go list ./... | grep -v vendor) + workingDirectory: '$(sdkPath)' + displayName: 'Build' + - script: go test $(dirname $(find . -path ./vendor -prune -o -name '*_test.go' -print) | sort -u) + workingDirectory: '$(sdkPath)' + displayName: 'Run Tests' + - script: go run ./tools/apidiff/main.go packages ./services FETCH_HEAD~1 FETCH_HEAD --copyrepo --breakingchanges || $IGNORE_BREAKING_CHANGES + workingDirectory: '$(sdkPath)' + displayName: 'Display Breaking Changes' + - script: go run ./tools/pkgchk/main.go ./services --exceptions ./tools/pkgchk/exceptions.txt + workingDirectory: '$(sdkPath)' + displayName: 'Verify Package Directory' + - script: grep -L -r --include *.go --exclude-dir vendor -P "Copyright (\d{4}|\(c\)) Microsoft" ./ | tee >&2 + workingDirectory: '$(sdkPath)' + displayName: 'Copyright Header Check' + failOnStderr: true + condition: succeededOrFailed() + - script: gofmt -s -l -w $(find . -path ./vendor -prune -o -name '*.go' -print) >&2 + workingDirectory: '$(sdkPath)' + displayName: 'Format Check' + failOnStderr: true + condition: succeededOrFailed() + - script: | + golint ./storage/... >&2 + golint ./tools/... >&2 + workingDirectory: '$(sdkPath)' + displayName: 'Linter Check' + failOnStderr: true + condition: succeededOrFailed() diff --git a/profiles/2019-03-01/web/mgmt/web/models.go b/profiles/2019-03-01/web/mgmt/web/models.go index 95b1192a9eb0..fd8978007c05 100644 --- a/profiles/2019-03-01/web/mgmt/web/models.go +++ b/profiles/2019-03-01/web/mgmt/web/models.go @@ -887,6 +887,7 @@ type GeoRegionProperties = original.GeoRegionProperties type GlobalCsmSkuDescription = original.GlobalCsmSkuDescription type HTTPLogsConfig = original.HTTPLogsConfig type HandlerMapping = original.HandlerMapping +type HostKeys = original.HostKeys type HostName = original.HostName type HostNameBinding = original.HostNameBinding type HostNameBindingCollection = original.HostNameBindingCollection @@ -921,6 +922,7 @@ type JobCollection = original.JobCollection type JobCollectionIterator = original.JobCollectionIterator type JobCollectionPage = original.JobCollectionPage type JobProperties = original.JobProperties +type KeyInfo = original.KeyInfo type ListCapability = original.ListCapability type ListCertificateEmail = original.ListCertificateEmail type ListCertificateOrderAction = original.ListCertificateOrderAction diff --git a/profiles/latest/advisor/mgmt/advisor/models.go b/profiles/latest/advisor/mgmt/advisor/models.go index ec1fa941c29e..68a8ce3dd966 100644 --- a/profiles/latest/advisor/mgmt/advisor/models.go +++ b/profiles/latest/advisor/mgmt/advisor/models.go @@ -32,10 +32,11 @@ const ( type Category = original.Category const ( - Cost Category = original.Cost - HighAvailability Category = original.HighAvailability - Performance Category = original.Performance - Security Category = original.Security + Cost Category = original.Cost + HighAvailability Category = original.HighAvailability + OperationalExcellence Category = original.OperationalExcellence + Performance Category = original.Performance + Security Category = original.Security ) type Impact = original.Impact diff --git a/profiles/latest/appconfiguration/mgmt/appconfiguration/appconfigurationapi/models.go b/profiles/latest/appconfiguration/mgmt/appconfiguration/appconfigurationapi/models.go new file mode 100644 index 000000000000..2cc70b8e585a --- /dev/null +++ b/profiles/latest/appconfiguration/mgmt/appconfiguration/appconfigurationapi/models.go @@ -0,0 +1,25 @@ +// +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 appconfigurationapi + +import original "github.com/Azure/azure-sdk-for-go/services/appconfiguration/mgmt/2019-10-01/appconfiguration/appconfigurationapi" + +type ConfigurationStoresClientAPI = original.ConfigurationStoresClientAPI +type OperationsClientAPI = original.OperationsClientAPI diff --git a/profiles/latest/appconfiguration/mgmt/appconfiguration/models.go b/profiles/latest/appconfiguration/mgmt/appconfiguration/models.go new file mode 100644 index 000000000000..1b7e13f25d5b --- /dev/null +++ b/profiles/latest/appconfiguration/mgmt/appconfiguration/models.go @@ -0,0 +1,131 @@ +// +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 appconfiguration + +import ( + "context" + + original "github.com/Azure/azure-sdk-for-go/services/appconfiguration/mgmt/2019-10-01/appconfiguration" +) + +const ( + DefaultBaseURI = original.DefaultBaseURI +) + +type IdentityType = original.IdentityType + +const ( + None IdentityType = original.None + SystemAssigned IdentityType = original.SystemAssigned + SystemAssignedUserAssigned IdentityType = original.SystemAssignedUserAssigned + UserAssigned IdentityType = original.UserAssigned +) + +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 + Updating ProvisioningState = original.Updating +) + +type APIKey = original.APIKey +type APIKeyListResult = original.APIKeyListResult +type APIKeyListResultIterator = original.APIKeyListResultIterator +type APIKeyListResultPage = original.APIKeyListResultPage +type BaseClient = original.BaseClient +type CheckNameAvailabilityParameters = original.CheckNameAvailabilityParameters +type ConfigurationStore = original.ConfigurationStore +type ConfigurationStoreListResult = original.ConfigurationStoreListResult +type ConfigurationStoreListResultIterator = original.ConfigurationStoreListResultIterator +type ConfigurationStoreListResultPage = original.ConfigurationStoreListResultPage +type ConfigurationStoreProperties = original.ConfigurationStoreProperties +type ConfigurationStoreUpdateParameters = original.ConfigurationStoreUpdateParameters +type ConfigurationStoresClient = original.ConfigurationStoresClient +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 +type OperationDefinitionListResult = original.OperationDefinitionListResult +type OperationDefinitionListResultIterator = original.OperationDefinitionListResultIterator +type OperationDefinitionListResultPage = original.OperationDefinitionListResultPage +type OperationsClient = original.OperationsClient +type RegenerateKeyParameters = original.RegenerateKeyParameters +type Resource = original.Resource +type ResourceIdentity = original.ResourceIdentity +type Sku = original.Sku +type UserIdentity = original.UserIdentity + +func New(subscriptionID string) BaseClient { + return original.New(subscriptionID) +} +func NewAPIKeyListResultIterator(page APIKeyListResultPage) APIKeyListResultIterator { + return original.NewAPIKeyListResultIterator(page) +} +func NewAPIKeyListResultPage(getNextPage func(context.Context, APIKeyListResult) (APIKeyListResult, error)) APIKeyListResultPage { + return original.NewAPIKeyListResultPage(getNextPage) +} +func NewConfigurationStoreListResultIterator(page ConfigurationStoreListResultPage) ConfigurationStoreListResultIterator { + return original.NewConfigurationStoreListResultIterator(page) +} +func NewConfigurationStoreListResultPage(getNextPage func(context.Context, ConfigurationStoreListResult) (ConfigurationStoreListResult, error)) ConfigurationStoreListResultPage { + return original.NewConfigurationStoreListResultPage(getNextPage) +} +func NewConfigurationStoresClient(subscriptionID string) ConfigurationStoresClient { + return original.NewConfigurationStoresClient(subscriptionID) +} +func NewConfigurationStoresClientWithBaseURI(baseURI string, subscriptionID string) ConfigurationStoresClient { + return original.NewConfigurationStoresClientWithBaseURI(baseURI, subscriptionID) +} +func NewOperationDefinitionListResultIterator(page OperationDefinitionListResultPage) OperationDefinitionListResultIterator { + return original.NewOperationDefinitionListResultIterator(page) +} +func NewOperationDefinitionListResultPage(getNextPage func(context.Context, OperationDefinitionListResult) (OperationDefinitionListResult, error)) OperationDefinitionListResultPage { + return original.NewOperationDefinitionListResultPage(getNextPage) +} +func NewOperationsClient(subscriptionID string) OperationsClient { + return original.NewOperationsClient(subscriptionID) +} +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) +} +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return original.NewWithBaseURI(baseURI, subscriptionID) +} +func PossibleIdentityTypeValues() []IdentityType { + return original.PossibleIdentityTypeValues() +} +func PossibleProvisioningStateValues() []ProvisioningState { + return original.PossibleProvisioningStateValues() +} +func UserAgent() string { + return original.UserAgent() + " profiles/latest" +} +func Version() string { + return original.Version() +} diff --git a/profiles/latest/cdn/mgmt/cdn/models.go b/profiles/latest/cdn/mgmt/cdn/models.go index 27689e718e1e..978bd80bbf83 100644 --- a/profiles/latest/cdn/mgmt/cdn/models.go +++ b/profiles/latest/cdn/mgmt/cdn/models.go @@ -52,6 +52,20 @@ const ( Shared CertificateType = original.Shared ) +type CookiesOperator = original.CookiesOperator + +const ( + Any CookiesOperator = original.Any + BeginsWith CookiesOperator = original.BeginsWith + Contains CookiesOperator = original.Contains + EndsWith CookiesOperator = original.EndsWith + Equal CookiesOperator = original.Equal + GreaterThan CookiesOperator = original.GreaterThan + GreaterThanOrEqual CookiesOperator = original.GreaterThanOrEqual + LessThan CookiesOperator = original.LessThan + LessThanOrEqual CookiesOperator = original.LessThanOrEqual +) + type CustomDomainResourceState = original.CustomDomainResourceState const ( @@ -119,10 +133,20 @@ const ( Overwrite HeaderAction = original.Overwrite ) +type MinimumTLSVersion = original.MinimumTLSVersion + +const ( + None MinimumTLSVersion = original.None + TLS10 MinimumTLSVersion = original.TLS10 + TLS12 MinimumTLSVersion = original.TLS12 +) + type Name = original.Name const ( + NameCookies Name = original.NameCookies NameDeliveryRuleCondition Name = original.NameDeliveryRuleCondition + NameHTTPVersion Name = original.NameHTTPVersion NameIsDevice Name = original.NameIsDevice NamePostArgs Name = original.NamePostArgs NameQueryString Name = original.NameQueryString @@ -170,15 +194,15 @@ const ( type PostArgsOperator = original.PostArgsOperator const ( - Any PostArgsOperator = original.Any - BeginsWith PostArgsOperator = original.BeginsWith - Contains PostArgsOperator = original.Contains - EndsWith PostArgsOperator = original.EndsWith - Equal PostArgsOperator = original.Equal - GreaterThan PostArgsOperator = original.GreaterThan - GreaterThanOrEqual PostArgsOperator = original.GreaterThanOrEqual - LessThan PostArgsOperator = original.LessThan - LessThanOrEqual PostArgsOperator = original.LessThanOrEqual + PostArgsOperatorAny PostArgsOperator = original.PostArgsOperatorAny + PostArgsOperatorBeginsWith PostArgsOperator = original.PostArgsOperatorBeginsWith + PostArgsOperatorContains PostArgsOperator = original.PostArgsOperatorContains + PostArgsOperatorEndsWith PostArgsOperator = original.PostArgsOperatorEndsWith + PostArgsOperatorEqual PostArgsOperator = original.PostArgsOperatorEqual + PostArgsOperatorGreaterThan PostArgsOperator = original.PostArgsOperatorGreaterThan + PostArgsOperatorGreaterThanOrEqual PostArgsOperator = original.PostArgsOperatorGreaterThanOrEqual + PostArgsOperatorLessThan PostArgsOperator = original.PostArgsOperatorLessThan + PostArgsOperatorLessThanOrEqual PostArgsOperator = original.PostArgsOperatorLessThanOrEqual ) type ProfileResourceState = original.ProfileResourceState @@ -366,6 +390,7 @@ type CertificateSourceParameters = original.CertificateSourceParameters type CheckNameAvailabilityInput = original.CheckNameAvailabilityInput type CheckNameAvailabilityOutput = original.CheckNameAvailabilityOutput type CidrIPAddress = original.CidrIPAddress +type CookiesMatchConditionParameters = original.CookiesMatchConditionParameters type CustomDomain = original.CustomDomain type CustomDomainHTTPSParameters = original.CustomDomainHTTPSParameters type CustomDomainListResult = original.CustomDomainListResult @@ -384,6 +409,8 @@ type DeliveryRuleAction = original.DeliveryRuleAction type DeliveryRuleCacheExpirationAction = original.DeliveryRuleCacheExpirationAction type DeliveryRuleCacheKeyQueryStringAction = original.DeliveryRuleCacheKeyQueryStringAction type DeliveryRuleCondition = original.DeliveryRuleCondition +type DeliveryRuleCookiesCondition = original.DeliveryRuleCookiesCondition +type DeliveryRuleHTTPVersionCondition = original.DeliveryRuleHTTPVersionCondition type DeliveryRuleIsDeviceCondition = original.DeliveryRuleIsDeviceCondition type DeliveryRulePostArgsCondition = original.DeliveryRulePostArgsCondition type DeliveryRuleQueryStringCondition = original.DeliveryRuleQueryStringCondition @@ -422,6 +449,7 @@ type EndpointsStopFuture = original.EndpointsStopFuture type EndpointsUpdateFuture = original.EndpointsUpdateFuture type ErrorResponse = original.ErrorResponse type GeoFilter = original.GeoFilter +type HTTPVersionMatchConditionParameters = original.HTTPVersionMatchConditionParameters type HeaderActionParameters = original.HeaderActionParameters type IPAddressGroup = original.IPAddressGroup type IsDeviceMatchConditionParameters = original.IsDeviceMatchConditionParameters @@ -585,6 +613,9 @@ func PossibleCertificateSourceValues() []CertificateSource { func PossibleCertificateTypeValues() []CertificateType { return original.PossibleCertificateTypeValues() } +func PossibleCookiesOperatorValues() []CookiesOperator { + return original.PossibleCookiesOperatorValues() +} func PossibleCustomDomainResourceStateValues() []CustomDomainResourceState { return original.PossibleCustomDomainResourceStateValues() } @@ -606,6 +637,9 @@ func PossibleGeoFilterActionsValues() []GeoFilterActions { func PossibleHeaderActionValues() []HeaderAction { return original.PossibleHeaderActionValues() } +func PossibleMinimumTLSVersionValues() []MinimumTLSVersion { + return original.PossibleMinimumTLSVersionValues() +} func PossibleNameBasicDeliveryRuleActionValues() []NameBasicDeliveryRuleAction { return original.PossibleNameBasicDeliveryRuleActionValues() } diff --git a/profiles/latest/cognitiveservices/customvision/training/models.go b/profiles/latest/cognitiveservices/customvision/training/models.go index a46cd6cb0b11..6ac391ccc004 100644 --- a/profiles/latest/cognitiveservices/customvision/training/models.go +++ b/profiles/latest/cognitiveservices/customvision/training/models.go @@ -19,7 +19,7 @@ package training -import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v3.0/customvision/training" +import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v3.1/customvision/training" type Classifier = original.Classifier @@ -78,6 +78,7 @@ const ( BadRequestPredictionResultsExceededCount CustomVisionErrorCodes = original.BadRequestPredictionResultsExceededCount BadRequestPredictionTagsExceededCount CustomVisionErrorCodes = original.BadRequestPredictionTagsExceededCount BadRequestProjectDescription CustomVisionErrorCodes = original.BadRequestProjectDescription + BadRequestProjectImagePreprocessingSettings CustomVisionErrorCodes = original.BadRequestProjectImagePreprocessingSettings BadRequestProjectName CustomVisionErrorCodes = original.BadRequestProjectName BadRequestProjectNameNotUnique CustomVisionErrorCodes = original.BadRequestProjectNameNotUnique BadRequestProjectUnknownClassification CustomVisionErrorCodes = original.BadRequestProjectUnknownClassification @@ -156,11 +157,13 @@ const ( type ExportFlavor = original.ExportFlavor const ( - ARM ExportFlavor = original.ARM - Linux ExportFlavor = original.Linux - ONNX10 ExportFlavor = original.ONNX10 - ONNX12 ExportFlavor = original.ONNX12 - Windows ExportFlavor = original.Windows + ARM ExportFlavor = original.ARM + Linux ExportFlavor = original.Linux + ONNX10 ExportFlavor = original.ONNX10 + ONNX12 ExportFlavor = original.ONNX12 + TensorFlowLite ExportFlavor = original.TensorFlowLite + TensorFlowNormal ExportFlavor = original.TensorFlowNormal + Windows ExportFlavor = original.Windows ) type ExportPlatform = original.ExportPlatform @@ -205,6 +208,13 @@ const ( Suggested OrderBy = original.Suggested ) +type SortBy = original.SortBy + +const ( + UncertaintyAscending SortBy = original.UncertaintyAscending + UncertaintyDescending SortBy = original.UncertaintyDescending +) + type TagType = original.TagType const ( @@ -234,6 +244,7 @@ type ImageIDCreateBatch = original.ImageIDCreateBatch type ImageIDCreateEntry = original.ImageIDCreateEntry type ImagePerformance = original.ImagePerformance type ImagePrediction = original.ImagePrediction +type ImageProcessingSettings = original.ImageProcessingSettings type ImageRegion = original.ImageRegion type ImageRegionCreateBatch = original.ImageRegionCreateBatch type ImageRegionCreateEntry = original.ImageRegionCreateEntry @@ -256,6 +267,7 @@ type ListImage = original.ListImage type ListImagePerformance = original.ListImagePerformance type ListIteration = original.ListIteration type ListProject = original.ListProject +type ListSuggestedTagAndRegion = original.ListSuggestedTagAndRegion type ListTag = original.ListTag type Prediction = original.Prediction type PredictionQueryResult = original.PredictionQueryResult @@ -265,8 +277,14 @@ type Project = original.Project type ProjectSettings = original.ProjectSettings type Region = original.Region type RegionProposal = original.RegionProposal +type SetInt32 = original.SetInt32 type StoredImagePrediction = original.StoredImagePrediction +type StoredSuggestedTagAndRegion = original.StoredSuggestedTagAndRegion +type SuggestedTagAndRegion = original.SuggestedTagAndRegion +type SuggestedTagAndRegionQuery = original.SuggestedTagAndRegionQuery +type SuggestedTagAndRegionQueryToken = original.SuggestedTagAndRegionQueryToken type Tag = original.Tag +type TagFilter = original.TagFilter type TagPerformance = original.TagPerformance func New(aPIKey string, endpoint string) BaseClient { @@ -299,6 +317,9 @@ func PossibleImageCreateStatusValues() []ImageCreateStatus { func PossibleOrderByValues() []OrderBy { return original.PossibleOrderByValues() } +func PossibleSortByValues() []SortBy { + return original.PossibleSortByValues() +} func PossibleTagTypeValues() []TagType { return original.PossibleTagTypeValues() } diff --git a/profiles/latest/cognitiveservices/customvision/training/trainingapi/models.go b/profiles/latest/cognitiveservices/customvision/training/trainingapi/models.go index 0444526d782d..58513bb4fcd7 100644 --- a/profiles/latest/cognitiveservices/customvision/training/trainingapi/models.go +++ b/profiles/latest/cognitiveservices/customvision/training/trainingapi/models.go @@ -19,6 +19,6 @@ package trainingapi -import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v3.0/customvision/training/trainingapi" +import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v3.1/customvision/training/trainingapi" type BaseClientAPI = original.BaseClientAPI 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/cognitiveservices/mgmt/cognitiveservices/cognitiveservicesapi/models.go b/profiles/latest/cognitiveservices/mgmt/cognitiveservices/cognitiveservicesapi/models.go index f580fe74d7bd..42eca8c78f11 100644 --- a/profiles/latest/cognitiveservices/mgmt/cognitiveservices/cognitiveservicesapi/models.go +++ b/profiles/latest/cognitiveservices/mgmt/cognitiveservices/cognitiveservicesapi/models.go @@ -23,6 +23,5 @@ import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/mg type AccountsClientAPI = original.AccountsClientAPI type BaseClientAPI = original.BaseClientAPI -type CheckSkuAvailabilityClientAPI = original.CheckSkuAvailabilityClientAPI type OperationsClientAPI = original.OperationsClientAPI type ResourceSkusClientAPI = original.ResourceSkusClientAPI diff --git a/profiles/latest/cognitiveservices/mgmt/cognitiveservices/models.go b/profiles/latest/cognitiveservices/mgmt/cognitiveservices/models.go index 19e381039db1..b771b01050f9 100644 --- a/profiles/latest/cognitiveservices/mgmt/cognitiveservices/models.go +++ b/profiles/latest/cognitiveservices/mgmt/cognitiveservices/models.go @@ -43,13 +43,6 @@ const ( Deny NetworkRuleAction = original.Deny ) -type NetworkRuleBypassOptions = original.NetworkRuleBypassOptions - -const ( - AzureServices NetworkRuleBypassOptions = original.AzureServices - None NetworkRuleBypassOptions = original.None -) - type ProvisioningState = original.ProvisioningState const ( @@ -105,19 +98,17 @@ const ( ) type Account = original.Account -type AccountCreateParameters = original.AccountCreateParameters +type AccountAPIProperties = original.AccountAPIProperties type AccountEnumerateSkusResult = original.AccountEnumerateSkusResult type AccountKeys = original.AccountKeys type AccountListResult = original.AccountListResult type AccountListResultIterator = original.AccountListResultIterator type AccountListResultPage = original.AccountListResultPage type AccountProperties = original.AccountProperties -type AccountUpdateParameters = original.AccountUpdateParameters type AccountsClient = original.AccountsClient type BaseClient = original.BaseClient type CheckDomainAvailabilityParameter = original.CheckDomainAvailabilityParameter type CheckDomainAvailabilityResult = original.CheckDomainAvailabilityResult -type CheckSkuAvailabilityClient = original.CheckSkuAvailabilityClient type CheckSkuAvailabilityParameter = original.CheckSkuAvailabilityParameter type CheckSkuAvailabilityResult = original.CheckSkuAvailabilityResult type CheckSkuAvailabilityResultList = original.CheckSkuAvailabilityResultList @@ -161,12 +152,6 @@ func NewAccountsClient(subscriptionID string) AccountsClient { func NewAccountsClientWithBaseURI(baseURI string, subscriptionID string) AccountsClient { return original.NewAccountsClientWithBaseURI(baseURI, subscriptionID) } -func NewCheckSkuAvailabilityClient(subscriptionID string) CheckSkuAvailabilityClient { - return original.NewCheckSkuAvailabilityClient(subscriptionID) -} -func NewCheckSkuAvailabilityClientWithBaseURI(baseURI string, subscriptionID string) CheckSkuAvailabilityClient { - return original.NewCheckSkuAvailabilityClientWithBaseURI(baseURI, subscriptionID) -} func NewOperationEntityListResultIterator(page OperationEntityListResultPage) OperationEntityListResultIterator { return original.NewOperationEntityListResultIterator(page) } @@ -200,9 +185,6 @@ func PossibleKeyNameValues() []KeyName { func PossibleNetworkRuleActionValues() []NetworkRuleAction { return original.PossibleNetworkRuleActionValues() } -func PossibleNetworkRuleBypassOptionsValues() []NetworkRuleBypassOptions { - return original.PossibleNetworkRuleBypassOptionsValues() -} func PossibleProvisioningStateValues() []ProvisioningState { return original.PossibleProvisioningStateValues() } diff --git a/profiles/latest/compute/mgmt/compute/computeapi/models.go b/profiles/latest/compute/mgmt/compute/computeapi/models.go index dcae23d3b907..680673b3d51e 100644 --- a/profiles/latest/compute/mgmt/compute/computeapi/models.go +++ b/profiles/latest/compute/mgmt/compute/computeapi/models.go @@ -25,6 +25,7 @@ type AvailabilitySetsClientAPI = original.AvailabilitySetsClientAPI type ContainerServicesClientAPI = original.ContainerServicesClientAPI type DedicatedHostGroupsClientAPI = original.DedicatedHostGroupsClientAPI type DedicatedHostsClientAPI = original.DedicatedHostsClientAPI +type DiskEncryptionSetsClientAPI = original.DiskEncryptionSetsClientAPI type DisksClientAPI = original.DisksClientAPI type GalleriesClientAPI = original.GalleriesClientAPI type GalleryApplicationVersionsClientAPI = original.GalleryApplicationVersionsClientAPI @@ -44,6 +45,7 @@ type VirtualMachineImagesClientAPI = original.VirtualMachineImagesClientAPI type VirtualMachineRunCommandsClientAPI = original.VirtualMachineRunCommandsClientAPI type VirtualMachineScaleSetExtensionsClientAPI = original.VirtualMachineScaleSetExtensionsClientAPI type VirtualMachineScaleSetRollingUpgradesClientAPI = original.VirtualMachineScaleSetRollingUpgradesClientAPI +type VirtualMachineScaleSetVMExtensionsClientAPI = original.VirtualMachineScaleSetVMExtensionsClientAPI type VirtualMachineScaleSetVMsClientAPI = original.VirtualMachineScaleSetVMsClientAPI type VirtualMachineScaleSetsClientAPI = original.VirtualMachineScaleSetsClientAPI type VirtualMachineSizesClientAPI = original.VirtualMachineSizesClientAPI diff --git a/profiles/latest/compute/mgmt/compute/models.go b/profiles/latest/compute/mgmt/compute/models.go index c0d6c7644bad..9fa6e9e831eb 100644 --- a/profiles/latest/compute/mgmt/compute/models.go +++ b/profiles/latest/compute/mgmt/compute/models.go @@ -162,6 +162,12 @@ const ( DiskCreateOptionTypesFromImage DiskCreateOptionTypes = original.DiskCreateOptionTypesFromImage ) +type DiskEncryptionSetIdentityType = original.DiskEncryptionSetIdentityType + +const ( + SystemAssigned DiskEncryptionSetIdentityType = original.SystemAssigned +) + type DiskState = original.DiskState const ( @@ -182,6 +188,13 @@ const ( UltraSSDLRS DiskStorageAccountTypes = original.UltraSSDLRS ) +type EncryptionType = original.EncryptionType + +const ( + EncryptionAtRestWithCustomerKey EncryptionType = original.EncryptionAtRestWithCustomerKey + EncryptionAtRestWithPlatformKey EncryptionType = original.EncryptionAtRestWithPlatformKey +) + type HostCaching = original.HostCaching const ( @@ -654,6 +667,7 @@ type AdditionalCapabilities = original.AdditionalCapabilities type AdditionalUnattendContent = original.AdditionalUnattendContent type AutomaticOSUpgradePolicy = original.AutomaticOSUpgradePolicy type AutomaticOSUpgradeProperties = original.AutomaticOSUpgradeProperties +type AutomaticRepairsPolicy = original.AutomaticRepairsPolicy type AvailabilitySet = original.AvailabilitySet type AvailabilitySetListResult = original.AvailabilitySetListResult type AvailabilitySetListResultIterator = original.AvailabilitySetListResultIterator @@ -712,6 +726,17 @@ type DiagnosticsProfile = original.DiagnosticsProfile type DiffDiskSettings = original.DiffDiskSettings type Disallowed = original.Disallowed type Disk = original.Disk +type DiskEncryptionSet = original.DiskEncryptionSet +type DiskEncryptionSetList = original.DiskEncryptionSetList +type DiskEncryptionSetListIterator = original.DiskEncryptionSetListIterator +type DiskEncryptionSetListPage = original.DiskEncryptionSetListPage +type DiskEncryptionSetParameters = original.DiskEncryptionSetParameters +type DiskEncryptionSetUpdate = original.DiskEncryptionSetUpdate +type DiskEncryptionSetUpdateProperties = original.DiskEncryptionSetUpdateProperties +type DiskEncryptionSetsClient = original.DiskEncryptionSetsClient +type DiskEncryptionSetsCreateOrUpdateFuture = original.DiskEncryptionSetsCreateOrUpdateFuture +type DiskEncryptionSetsDeleteFuture = original.DiskEncryptionSetsDeleteFuture +type DiskEncryptionSetsUpdateFuture = original.DiskEncryptionSetsUpdateFuture type DiskEncryptionSettings = original.DiskEncryptionSettings type DiskInstanceView = original.DiskInstanceView type DiskList = original.DiskList @@ -727,6 +752,9 @@ type DisksDeleteFuture = original.DisksDeleteFuture type DisksGrantAccessFuture = original.DisksGrantAccessFuture type DisksRevokeAccessFuture = original.DisksRevokeAccessFuture type DisksUpdateFuture = original.DisksUpdateFuture +type Encryption = original.Encryption +type EncryptionSetIdentity = original.EncryptionSetIdentity +type EncryptionSetProperties = original.EncryptionSetProperties type EncryptionSettingsCollection = original.EncryptionSettingsCollection type EncryptionSettingsElement = original.EncryptionSettingsElement type GalleriesClient = original.GalleriesClient @@ -784,6 +812,7 @@ type GrantAccessData = original.GrantAccessData type HardwareProfile = original.HardwareProfile type Image = original.Image type ImageDataDisk = original.ImageDataDisk +type ImageDisk = original.ImageDisk type ImageDiskReference = original.ImageDiskReference type ImageListResult = original.ImageListResult type ImageListResultIterator = original.ImageListResultIterator @@ -1006,7 +1035,11 @@ type VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties = origin type VirtualMachineScaleSetUpdateStorageProfile = original.VirtualMachineScaleSetUpdateStorageProfile type VirtualMachineScaleSetUpdateVMProfile = original.VirtualMachineScaleSetUpdateVMProfile type VirtualMachineScaleSetVM = original.VirtualMachineScaleSetVM +type VirtualMachineScaleSetVMExtensionsClient = original.VirtualMachineScaleSetVMExtensionsClient +type VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture = original.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture +type VirtualMachineScaleSetVMExtensionsDeleteFuture = original.VirtualMachineScaleSetVMExtensionsDeleteFuture type VirtualMachineScaleSetVMExtensionsSummary = original.VirtualMachineScaleSetVMExtensionsSummary +type VirtualMachineScaleSetVMExtensionsUpdateFuture = original.VirtualMachineScaleSetVMExtensionsUpdateFuture type VirtualMachineScaleSetVMInstanceIDs = original.VirtualMachineScaleSetVMInstanceIDs type VirtualMachineScaleSetVMInstanceRequiredIDs = original.VirtualMachineScaleSetVMInstanceRequiredIDs type VirtualMachineScaleSetVMInstanceView = original.VirtualMachineScaleSetVMInstanceView @@ -1057,6 +1090,7 @@ type VirtualMachinesDeallocateFuture = original.VirtualMachinesDeallocateFuture type VirtualMachinesDeleteFuture = original.VirtualMachinesDeleteFuture type VirtualMachinesPerformMaintenanceFuture = original.VirtualMachinesPerformMaintenanceFuture type VirtualMachinesPowerOffFuture = original.VirtualMachinesPowerOffFuture +type VirtualMachinesReapplyFuture = original.VirtualMachinesReapplyFuture type VirtualMachinesRedeployFuture = original.VirtualMachinesRedeployFuture type VirtualMachinesReimageFuture = original.VirtualMachinesReimageFuture type VirtualMachinesRestartFuture = original.VirtualMachinesRestartFuture @@ -1118,6 +1152,18 @@ func NewDedicatedHostsClient(subscriptionID string) DedicatedHostsClient { func NewDedicatedHostsClientWithBaseURI(baseURI string, subscriptionID string) DedicatedHostsClient { return original.NewDedicatedHostsClientWithBaseURI(baseURI, subscriptionID) } +func NewDiskEncryptionSetListIterator(page DiskEncryptionSetListPage) DiskEncryptionSetListIterator { + return original.NewDiskEncryptionSetListIterator(page) +} +func NewDiskEncryptionSetListPage(getNextPage func(context.Context, DiskEncryptionSetList) (DiskEncryptionSetList, error)) DiskEncryptionSetListPage { + return original.NewDiskEncryptionSetListPage(getNextPage) +} +func NewDiskEncryptionSetsClient(subscriptionID string) DiskEncryptionSetsClient { + return original.NewDiskEncryptionSetsClient(subscriptionID) +} +func NewDiskEncryptionSetsClientWithBaseURI(baseURI string, subscriptionID string) DiskEncryptionSetsClient { + return original.NewDiskEncryptionSetsClientWithBaseURI(baseURI, subscriptionID) +} func NewDiskListIterator(page DiskListPage) DiskListIterator { return original.NewDiskListIterator(page) } @@ -1340,6 +1386,12 @@ func NewVirtualMachineScaleSetRollingUpgradesClient(subscriptionID string) Virtu func NewVirtualMachineScaleSetRollingUpgradesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetRollingUpgradesClient { return original.NewVirtualMachineScaleSetRollingUpgradesClientWithBaseURI(baseURI, subscriptionID) } +func NewVirtualMachineScaleSetVMExtensionsClient(subscriptionID string) VirtualMachineScaleSetVMExtensionsClient { + return original.NewVirtualMachineScaleSetVMExtensionsClient(subscriptionID) +} +func NewVirtualMachineScaleSetVMExtensionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetVMExtensionsClient { + return original.NewVirtualMachineScaleSetVMExtensionsClientWithBaseURI(baseURI, subscriptionID) +} func NewVirtualMachineScaleSetVMListResultIterator(page VirtualMachineScaleSetVMListResultPage) VirtualMachineScaleSetVMListResultIterator { return original.NewVirtualMachineScaleSetVMListResultIterator(page) } @@ -1406,12 +1458,18 @@ func PossibleDiskCreateOptionTypesValues() []DiskCreateOptionTypes { func PossibleDiskCreateOptionValues() []DiskCreateOption { return original.PossibleDiskCreateOptionValues() } +func PossibleDiskEncryptionSetIdentityTypeValues() []DiskEncryptionSetIdentityType { + return original.PossibleDiskEncryptionSetIdentityTypeValues() +} func PossibleDiskStateValues() []DiskState { return original.PossibleDiskStateValues() } func PossibleDiskStorageAccountTypesValues() []DiskStorageAccountTypes { return original.PossibleDiskStorageAccountTypesValues() } +func PossibleEncryptionTypeValues() []EncryptionType { + return original.PossibleEncryptionTypeValues() +} func PossibleHostCachingValues() []HostCaching { return original.PossibleHostCachingValues() } diff --git a/profiles/latest/containerservice/mgmt/containerservice/containerserviceapi/models.go b/profiles/latest/containerservice/mgmt/containerservice/containerserviceapi/models.go index 2529a9c3888f..2d91c94f8fdd 100644 --- a/profiles/latest/containerservice/mgmt/containerservice/containerserviceapi/models.go +++ b/profiles/latest/containerservice/mgmt/containerservice/containerserviceapi/models.go @@ -19,7 +19,7 @@ package containerserviceapi -import original "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-08-01/containerservice/containerserviceapi" +import original "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-10-01/containerservice/containerserviceapi" type AgentPoolsClientAPI = original.AgentPoolsClientAPI type ContainerServicesClientAPI = original.ContainerServicesClientAPI diff --git a/profiles/latest/containerservice/mgmt/containerservice/models.go b/profiles/latest/containerservice/mgmt/containerservice/models.go index 2be679086fb2..891b9ddc31a4 100644 --- a/profiles/latest/containerservice/mgmt/containerservice/models.go +++ b/profiles/latest/containerservice/mgmt/containerservice/models.go @@ -22,7 +22,7 @@ package containerservice import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-08-01/containerservice" + original "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-10-01/containerservice" ) const ( @@ -392,6 +392,7 @@ type ManagedClustersCreateOrUpdateFuture = original.ManagedClustersCreateOrUpdat type ManagedClustersDeleteFuture = original.ManagedClustersDeleteFuture type ManagedClustersResetAADProfileFuture = original.ManagedClustersResetAADProfileFuture type ManagedClustersResetServicePrincipalProfileFuture = original.ManagedClustersResetServicePrincipalProfileFuture +type ManagedClustersRotateClusterCertificatesFuture = original.ManagedClustersRotateClusterCertificatesFuture type ManagedClustersUpdateTagsFuture = original.ManagedClustersUpdateTagsFuture type MasterProfile = original.MasterProfile type NetworkProfile = original.NetworkProfile diff --git a/profiles/latest/costmanagement/mgmt/costmanagement/costmanagementapi/models.go b/profiles/latest/costmanagement/mgmt/costmanagement/costmanagementapi/models.go index 9e5866aad71b..f8a485d17abf 100644 --- a/profiles/latest/costmanagement/mgmt/costmanagement/costmanagementapi/models.go +++ b/profiles/latest/costmanagement/mgmt/costmanagement/costmanagementapi/models.go @@ -19,7 +19,7 @@ package costmanagementapi -import original "github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2019-01-01/costmanagement/costmanagementapi" +import original "github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2019-10-01/costmanagement/costmanagementapi" type DimensionsClientAPI = original.DimensionsClientAPI type ExportsClientAPI = original.ExportsClientAPI diff --git a/profiles/latest/costmanagement/mgmt/costmanagement/models.go b/profiles/latest/costmanagement/mgmt/costmanagement/models.go index bfd8b4ec9613..ba9e40291e1d 100644 --- a/profiles/latest/costmanagement/mgmt/costmanagement/models.go +++ b/profiles/latest/costmanagement/mgmt/costmanagement/models.go @@ -22,7 +22,7 @@ package costmanagement import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2019-01-01/costmanagement" + original "github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2019-10-01/costmanagement" ) const ( @@ -94,15 +94,13 @@ const ( type TimeframeType = original.TimeframeType const ( - BillingMonthToDate TimeframeType = original.BillingMonthToDate - Custom TimeframeType = original.Custom - MonthToDate TimeframeType = original.MonthToDate - TheLastBillingMonth TimeframeType = original.TheLastBillingMonth - TheLastMonth TimeframeType = original.TheLastMonth - TheLastWeek TimeframeType = original.TheLastWeek - TheLastYear TimeframeType = original.TheLastYear - WeekToDate TimeframeType = original.WeekToDate - YearToDate TimeframeType = original.YearToDate + Custom TimeframeType = original.Custom + MonthToDate TimeframeType = original.MonthToDate + TheLastMonth TimeframeType = original.TheLastMonth + TheLastWeek TimeframeType = original.TheLastWeek + TheLastYear TimeframeType = original.TheLastYear + WeekToDate TimeframeType = original.WeekToDate + YearToDate TimeframeType = original.YearToDate ) type BaseClient = original.BaseClient @@ -130,7 +128,6 @@ type OperationListResult = original.OperationListResult type OperationListResultIterator = original.OperationListResultIterator type OperationListResultPage = original.OperationListResultPage type OperationsClient = original.OperationsClient -type Query = original.Query type QueryAggregation = original.QueryAggregation type QueryClient = original.QueryClient type QueryColumn = original.QueryColumn diff --git a/profiles/latest/datafactory/mgmt/datafactory/models.go b/profiles/latest/datafactory/mgmt/datafactory/models.go index 9f2331a40b3f..7d563468dc89 100644 --- a/profiles/latest/datafactory/mgmt/datafactory/models.go +++ b/profiles/latest/datafactory/mgmt/datafactory/models.go @@ -155,8 +155,9 @@ const ( type DynamicsAuthenticationType = original.DynamicsAuthenticationType const ( - Ifd DynamicsAuthenticationType = original.Ifd - Office365 DynamicsAuthenticationType = original.Office365 + AADServicePrincipal DynamicsAuthenticationType = original.AADServicePrincipal + Ifd DynamicsAuthenticationType = original.Ifd + Office365 DynamicsAuthenticationType = original.Office365 ) type DynamicsDeploymentType = original.DynamicsDeploymentType @@ -393,6 +394,14 @@ const ( OraclePartitionOptionPhysicalPartitionsOfTable OraclePartitionOption = original.OraclePartitionOptionPhysicalPartitionsOfTable ) +type OrcCompressionCodec = original.OrcCompressionCodec + +const ( + OrcCompressionCodecNone OrcCompressionCodec = original.OrcCompressionCodecNone + OrcCompressionCodecSnappy OrcCompressionCodec = original.OrcCompressionCodecSnappy + OrcCompressionCodecZlib OrcCompressionCodec = original.OrcCompressionCodecZlib +) + type ParameterType = original.ParameterType const ( @@ -674,6 +683,7 @@ const ( TypeAzureDataExplorerCommand TypeBasicActivity = original.TypeAzureDataExplorerCommand TypeAzureFunctionActivity TypeBasicActivity = original.TypeAzureFunctionActivity TypeAzureMLBatchExecution TypeBasicActivity = original.TypeAzureMLBatchExecution + TypeAzureMLExecutePipeline TypeBasicActivity = original.TypeAzureMLExecutePipeline TypeAzureMLUpdateResource TypeBasicActivity = original.TypeAzureMLUpdateResource TypeContainer TypeBasicActivity = original.TypeContainer TypeCopy TypeBasicActivity = original.TypeCopy @@ -699,6 +709,7 @@ const ( TypeLookup TypeBasicActivity = original.TypeLookup TypeSetVariable TypeBasicActivity = original.TypeSetVariable TypeSQLServerStoredProcedure TypeBasicActivity = original.TypeSQLServerStoredProcedure + TypeSwitch TypeBasicActivity = original.TypeSwitch TypeUntil TypeBasicActivity = original.TypeUntil TypeValidation TypeBasicActivity = original.TypeValidation TypeWait TypeBasicActivity = original.TypeWait @@ -1015,10 +1026,12 @@ const ( TypeAzureDataExplorer TypeBasicLinkedService = original.TypeAzureDataExplorer TypeAzureDataLakeAnalytics TypeBasicLinkedService = original.TypeAzureDataLakeAnalytics TypeAzureDataLakeStore TypeBasicLinkedService = original.TypeAzureDataLakeStore + TypeAzureFileStorage TypeBasicLinkedService = original.TypeAzureFileStorage TypeAzureFunction TypeBasicLinkedService = original.TypeAzureFunction TypeAzureKeyVault TypeBasicLinkedService = original.TypeAzureKeyVault TypeAzureMariaDB TypeBasicLinkedService = original.TypeAzureMariaDB TypeAzureML TypeBasicLinkedService = original.TypeAzureML + TypeAzureMLService TypeBasicLinkedService = original.TypeAzureMLService TypeAzureMySQL TypeBasicLinkedService = original.TypeAzureMySQL TypeAzurePostgreSQL TypeBasicLinkedService = original.TypeAzurePostgreSQL TypeAzureSearch TypeBasicLinkedService = original.TypeAzureSearch @@ -1044,6 +1057,7 @@ const ( TypeFtpServer TypeBasicLinkedService = original.TypeFtpServer TypeGoogleAdWords TypeBasicLinkedService = original.TypeGoogleAdWords TypeGoogleBigQuery TypeBasicLinkedService = original.TypeGoogleBigQuery + TypeGoogleCloudStorage TypeBasicLinkedService = original.TypeGoogleCloudStorage TypeGreenplum TypeBasicLinkedService = original.TypeGreenplum TypeHBase TypeBasicLinkedService = original.TypeHBase TypeHdfs TypeBasicLinkedService = original.TypeHdfs @@ -1225,6 +1239,10 @@ type AzureDataLakeStoreSource = original.AzureDataLakeStoreSource type AzureDataLakeStoreWriteSettings = original.AzureDataLakeStoreWriteSettings type AzureDatabricksLinkedService = original.AzureDatabricksLinkedService type AzureDatabricksLinkedServiceTypeProperties = original.AzureDatabricksLinkedServiceTypeProperties +type AzureFileStorageLinkedService = original.AzureFileStorageLinkedService +type AzureFileStorageLinkedServiceTypeProperties = original.AzureFileStorageLinkedServiceTypeProperties +type AzureFileStorageLocation = original.AzureFileStorageLocation +type AzureFileStorageReadSettings = original.AzureFileStorageReadSettings type AzureFunctionActivity = original.AzureFunctionActivity type AzureFunctionActivityTypeProperties = original.AzureFunctionActivityTypeProperties type AzureFunctionLinkedService = original.AzureFunctionLinkedService @@ -1234,8 +1252,12 @@ type AzureKeyVaultLinkedServiceTypeProperties = original.AzureKeyVaultLinkedServ type AzureKeyVaultSecretReference = original.AzureKeyVaultSecretReference type AzureMLBatchExecutionActivity = original.AzureMLBatchExecutionActivity type AzureMLBatchExecutionActivityTypeProperties = original.AzureMLBatchExecutionActivityTypeProperties +type AzureMLExecutePipelineActivity = original.AzureMLExecutePipelineActivity +type AzureMLExecutePipelineActivityTypeProperties = original.AzureMLExecutePipelineActivityTypeProperties type AzureMLLinkedService = original.AzureMLLinkedService type AzureMLLinkedServiceTypeProperties = original.AzureMLLinkedServiceTypeProperties +type AzureMLServiceLinkedService = original.AzureMLServiceLinkedService +type AzureMLServiceLinkedServiceTypeProperties = original.AzureMLServiceLinkedServiceTypeProperties type AzureMLUpdateResourceActivity = original.AzureMLUpdateResourceActivity type AzureMLUpdateResourceActivityTypeProperties = original.AzureMLUpdateResourceActivityTypeProperties type AzureMLWebServiceFile = original.AzureMLWebServiceFile @@ -1376,6 +1398,7 @@ type DataFlowDebugCommandRequest = original.DataFlowDebugCommandRequest type DataFlowDebugCommandResponse = original.DataFlowDebugCommandResponse type DataFlowDebugPackage = original.DataFlowDebugPackage type DataFlowDebugPackageDebugSettings = original.DataFlowDebugPackageDebugSettings +type DataFlowDebugResource = original.DataFlowDebugResource type DataFlowDebugSessionClient = original.DataFlowDebugSessionClient type DataFlowDebugSessionCreateFuture = original.DataFlowDebugSessionCreateFuture type DataFlowDebugSessionExecuteCommandFuture = original.DataFlowDebugSessionExecuteCommandFuture @@ -1402,6 +1425,7 @@ type DatabricksSparkPythonActivityTypeProperties = original.DatabricksSparkPytho type Dataset = original.Dataset type DatasetBZip2Compression = original.DatasetBZip2Compression type DatasetCompression = original.DatasetCompression +type DatasetDebugResource = original.DatasetDebugResource type DatasetDeflateCompression = original.DatasetDeflateCompression type DatasetFolder = original.DatasetFolder type DatasetGZipCompression = original.DatasetGZipCompression @@ -1521,6 +1545,10 @@ type GoogleBigQueryLinkedService = original.GoogleBigQueryLinkedService type GoogleBigQueryLinkedServiceTypeProperties = original.GoogleBigQueryLinkedServiceTypeProperties type GoogleBigQueryObjectDataset = original.GoogleBigQueryObjectDataset type GoogleBigQuerySource = original.GoogleBigQuerySource +type GoogleCloudStorageLinkedService = original.GoogleCloudStorageLinkedService +type GoogleCloudStorageLinkedServiceTypeProperties = original.GoogleCloudStorageLinkedServiceTypeProperties +type GoogleCloudStorageLocation = original.GoogleCloudStorageLocation +type GoogleCloudStorageReadSettings = original.GoogleCloudStorageReadSettings type GreenplumDatasetTypeProperties = original.GreenplumDatasetTypeProperties type GreenplumLinkedService = original.GreenplumLinkedService type GreenplumLinkedServiceTypeProperties = original.GreenplumLinkedServiceTypeProperties @@ -1585,6 +1613,7 @@ type IntegrationRuntimeConnectionInfo = original.IntegrationRuntimeConnectionInf type IntegrationRuntimeCustomSetupScriptProperties = original.IntegrationRuntimeCustomSetupScriptProperties type IntegrationRuntimeDataFlowProperties = original.IntegrationRuntimeDataFlowProperties type IntegrationRuntimeDataProxyProperties = original.IntegrationRuntimeDataProxyProperties +type IntegrationRuntimeDebugResource = original.IntegrationRuntimeDebugResource type IntegrationRuntimeListResponse = original.IntegrationRuntimeListResponse type IntegrationRuntimeListResponseIterator = original.IntegrationRuntimeListResponseIterator type IntegrationRuntimeListResponsePage = original.IntegrationRuntimeListResponsePage @@ -1623,6 +1652,7 @@ type LinkedIntegrationRuntimeRbacAuthorization = original.LinkedIntegrationRunti type LinkedIntegrationRuntimeRequest = original.LinkedIntegrationRuntimeRequest type LinkedIntegrationRuntimeType = original.LinkedIntegrationRuntimeType type LinkedService = original.LinkedService +type LinkedServiceDebugResource = original.LinkedServiceDebugResource type LinkedServiceListResponse = original.LinkedServiceListResponse type LinkedServiceListResponseIterator = original.LinkedServiceListResponseIterator type LinkedServiceListResponsePage = original.LinkedServiceListResponsePage @@ -1922,6 +1952,10 @@ type StoreReadSettings = original.StoreReadSettings type StoreWriteSettings = original.StoreWriteSettings type StoredProcedureParameter = original.StoredProcedureParameter type SubResource = original.SubResource +type SubResourceDebugResource = original.SubResourceDebugResource +type SwitchActivity = original.SwitchActivity +type SwitchActivityTypeProperties = original.SwitchActivityTypeProperties +type SwitchCase = original.SwitchCase type SybaseLinkedService = original.SybaseLinkedService type SybaseLinkedServiceTypeProperties = original.SybaseLinkedServiceTypeProperties type SybaseSource = original.SybaseSource @@ -2285,6 +2319,9 @@ func PossibleODataAuthenticationTypeValues() []ODataAuthenticationType { func PossibleOraclePartitionOptionValues() []OraclePartitionOption { return original.PossibleOraclePartitionOptionValues() } +func PossibleOrcCompressionCodecValues() []OrcCompressionCodec { + return original.PossibleOrcCompressionCodecValues() +} func PossibleParameterTypeValues() []ParameterType { return original.PossibleParameterTypeValues() } diff --git a/profiles/latest/datashare/mgmt/datashare/datashareapi/models.go b/profiles/latest/datashare/mgmt/datashare/datashareapi/models.go new file mode 100644 index 000000000000..9f24dd90d35d --- /dev/null +++ b/profiles/latest/datashare/mgmt/datashare/datashareapi/models.go @@ -0,0 +1,35 @@ +// +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 datashareapi + +import original "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/datashareapi" + +type AccountsClientAPI = original.AccountsClientAPI +type ConsumerInvitationsClientAPI = original.ConsumerInvitationsClientAPI +type ConsumerSourceDataSetsClientAPI = original.ConsumerSourceDataSetsClientAPI +type DataSetMappingsClientAPI = original.DataSetMappingsClientAPI +type DataSetsClientAPI = original.DataSetsClientAPI +type InvitationsClientAPI = original.InvitationsClientAPI +type OperationsClientAPI = original.OperationsClientAPI +type ProviderShareSubscriptionsClientAPI = original.ProviderShareSubscriptionsClientAPI +type ShareSubscriptionsClientAPI = original.ShareSubscriptionsClientAPI +type SharesClientAPI = original.SharesClientAPI +type SynchronizationSettingsClientAPI = original.SynchronizationSettingsClientAPI +type TriggersClientAPI = original.TriggersClientAPI diff --git a/profiles/latest/datashare/mgmt/datashare/models.go b/profiles/latest/datashare/mgmt/datashare/models.go new file mode 100644 index 000000000000..fb88cb82a7a1 --- /dev/null +++ b/profiles/latest/datashare/mgmt/datashare/models.go @@ -0,0 +1,591 @@ +// +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 datashare + +import ( + "context" + + original "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" +) + +const ( + DefaultBaseURI = original.DefaultBaseURI +) + +type DataSetMappingStatus = original.DataSetMappingStatus + +const ( + Broken DataSetMappingStatus = original.Broken + Ok DataSetMappingStatus = original.Ok +) + +type DataSetType = original.DataSetType + +const ( + AdlsGen1File DataSetType = original.AdlsGen1File + AdlsGen1Folder DataSetType = original.AdlsGen1Folder + AdlsGen2File DataSetType = original.AdlsGen2File + AdlsGen2FileSystem DataSetType = original.AdlsGen2FileSystem + AdlsGen2Folder DataSetType = original.AdlsGen2Folder + Blob DataSetType = original.Blob + BlobFolder DataSetType = original.BlobFolder + Container DataSetType = original.Container + KustoCluster DataSetType = original.KustoCluster + KustoDatabase DataSetType = original.KustoDatabase + SQLDBTable DataSetType = original.SQLDBTable + SQLDWTable DataSetType = original.SQLDWTable +) + +type InvitationStatus = original.InvitationStatus + +const ( + Accepted InvitationStatus = original.Accepted + Pending InvitationStatus = original.Pending + Rejected InvitationStatus = original.Rejected + Withdrawn InvitationStatus = original.Withdrawn +) + +type Kind = original.Kind + +const ( + KindAdlsGen1File Kind = original.KindAdlsGen1File + KindAdlsGen1Folder Kind = original.KindAdlsGen1Folder + KindAdlsGen2File Kind = original.KindAdlsGen2File + KindAdlsGen2FileSystem Kind = original.KindAdlsGen2FileSystem + KindAdlsGen2Folder Kind = original.KindAdlsGen2Folder + KindBlob Kind = original.KindBlob + KindBlobFolder Kind = original.KindBlobFolder + KindContainer Kind = original.KindContainer + KindDataSet Kind = original.KindDataSet + KindKustoCluster Kind = original.KindKustoCluster + KindKustoDatabase Kind = original.KindKustoDatabase + KindSQLDBTable Kind = original.KindSQLDBTable + KindSQLDWTable Kind = original.KindSQLDWTable +) + +type KindBasicDataSetMapping = original.KindBasicDataSetMapping + +const ( + KindBasicDataSetMappingKindAdlsGen2File KindBasicDataSetMapping = original.KindBasicDataSetMappingKindAdlsGen2File + KindBasicDataSetMappingKindAdlsGen2FileSystem KindBasicDataSetMapping = original.KindBasicDataSetMappingKindAdlsGen2FileSystem + KindBasicDataSetMappingKindAdlsGen2Folder KindBasicDataSetMapping = original.KindBasicDataSetMappingKindAdlsGen2Folder + KindBasicDataSetMappingKindBlob KindBasicDataSetMapping = original.KindBasicDataSetMappingKindBlob + KindBasicDataSetMappingKindBlobFolder KindBasicDataSetMapping = original.KindBasicDataSetMappingKindBlobFolder + KindBasicDataSetMappingKindContainer KindBasicDataSetMapping = original.KindBasicDataSetMappingKindContainer + KindBasicDataSetMappingKindDataSetMapping KindBasicDataSetMapping = original.KindBasicDataSetMappingKindDataSetMapping + KindBasicDataSetMappingKindKustoCluster KindBasicDataSetMapping = original.KindBasicDataSetMappingKindKustoCluster + KindBasicDataSetMappingKindKustoDatabase KindBasicDataSetMapping = original.KindBasicDataSetMappingKindKustoDatabase + KindBasicDataSetMappingKindSQLDBTable KindBasicDataSetMapping = original.KindBasicDataSetMappingKindSQLDBTable + KindBasicDataSetMappingKindSQLDWTable KindBasicDataSetMapping = original.KindBasicDataSetMappingKindSQLDWTable +) + +type KindBasicSourceShareSynchronizationSetting = original.KindBasicSourceShareSynchronizationSetting + +const ( + KindScheduleBased KindBasicSourceShareSynchronizationSetting = original.KindScheduleBased + KindSourceShareSynchronizationSetting KindBasicSourceShareSynchronizationSetting = original.KindSourceShareSynchronizationSetting +) + +type KindBasicSynchronizationSetting = original.KindBasicSynchronizationSetting + +const ( + KindBasicSynchronizationSettingKindScheduleBased KindBasicSynchronizationSetting = original.KindBasicSynchronizationSettingKindScheduleBased + KindBasicSynchronizationSettingKindSynchronizationSetting KindBasicSynchronizationSetting = original.KindBasicSynchronizationSettingKindSynchronizationSetting +) + +type KindBasicTrigger = original.KindBasicTrigger + +const ( + KindBasicTriggerKindScheduleBased KindBasicTrigger = original.KindBasicTriggerKindScheduleBased + KindBasicTriggerKindTrigger KindBasicTrigger = original.KindBasicTriggerKindTrigger +) + +type OutputType = original.OutputType + +const ( + Csv OutputType = original.Csv + Parquet OutputType = original.Parquet +) + +type ProvisioningState = original.ProvisioningState + +const ( + Creating ProvisioningState = original.Creating + Deleting ProvisioningState = original.Deleting + Failed ProvisioningState = original.Failed + Moving ProvisioningState = original.Moving + Succeeded ProvisioningState = original.Succeeded +) + +type RecurrenceInterval = original.RecurrenceInterval + +const ( + Day RecurrenceInterval = original.Day + Hour RecurrenceInterval = original.Hour +) + +type ShareKind = original.ShareKind + +const ( + CopyBased ShareKind = original.CopyBased + InPlace ShareKind = original.InPlace +) + +type ShareSubscriptionStatus = original.ShareSubscriptionStatus + +const ( + Active ShareSubscriptionStatus = original.Active + Revoked ShareSubscriptionStatus = original.Revoked + Revoking ShareSubscriptionStatus = original.Revoking + SourceDeleted ShareSubscriptionStatus = original.SourceDeleted +) + +type Status = original.Status + +const ( + StatusAccepted Status = original.StatusAccepted + StatusCanceled Status = original.StatusCanceled + StatusFailed Status = original.StatusFailed + StatusInProgress Status = original.StatusInProgress + StatusSucceeded Status = original.StatusSucceeded + StatusTransientFailure Status = original.StatusTransientFailure +) + +type SynchronizationMode = original.SynchronizationMode + +const ( + FullSync SynchronizationMode = original.FullSync + Incremental SynchronizationMode = original.Incremental +) + +type TriggerStatus = original.TriggerStatus + +const ( + TriggerStatusActive TriggerStatus = original.TriggerStatusActive + TriggerStatusInactive TriggerStatus = original.TriggerStatusInactive + TriggerStatusSourceSynchronizationSettingDeleted TriggerStatus = original.TriggerStatusSourceSynchronizationSettingDeleted +) + +type Type = original.Type + +const ( + SystemAssigned Type = original.SystemAssigned +) + +type ADLSGen1FileDataSet = original.ADLSGen1FileDataSet +type ADLSGen1FileProperties = original.ADLSGen1FileProperties +type ADLSGen1FolderDataSet = original.ADLSGen1FolderDataSet +type ADLSGen1FolderProperties = original.ADLSGen1FolderProperties +type ADLSGen2FileDataSet = original.ADLSGen2FileDataSet +type ADLSGen2FileDataSetMapping = original.ADLSGen2FileDataSetMapping +type ADLSGen2FileDataSetMappingProperties = original.ADLSGen2FileDataSetMappingProperties +type ADLSGen2FileProperties = original.ADLSGen2FileProperties +type ADLSGen2FileSystemDataSet = original.ADLSGen2FileSystemDataSet +type ADLSGen2FileSystemDataSetMapping = original.ADLSGen2FileSystemDataSetMapping +type ADLSGen2FileSystemDataSetMappingProperties = original.ADLSGen2FileSystemDataSetMappingProperties +type ADLSGen2FileSystemProperties = original.ADLSGen2FileSystemProperties +type ADLSGen2FolderDataSet = original.ADLSGen2FolderDataSet +type ADLSGen2FolderDataSetMapping = original.ADLSGen2FolderDataSetMapping +type ADLSGen2FolderDataSetMappingProperties = original.ADLSGen2FolderDataSetMappingProperties +type ADLSGen2FolderProperties = original.ADLSGen2FolderProperties +type Account = original.Account +type AccountList = original.AccountList +type AccountListIterator = original.AccountListIterator +type AccountListPage = original.AccountListPage +type AccountProperties = original.AccountProperties +type AccountUpdateParameters = original.AccountUpdateParameters +type AccountsClient = original.AccountsClient +type AccountsCreateFuture = original.AccountsCreateFuture +type AccountsDeleteFuture = original.AccountsDeleteFuture +type BaseClient = original.BaseClient +type BasicDataSet = original.BasicDataSet +type BasicDataSetMapping = original.BasicDataSetMapping +type BasicSourceShareSynchronizationSetting = original.BasicSourceShareSynchronizationSetting +type BasicSynchronizationSetting = original.BasicSynchronizationSetting +type BasicTrigger = original.BasicTrigger +type BlobContainerDataSet = original.BlobContainerDataSet +type BlobContainerDataSetMapping = original.BlobContainerDataSetMapping +type BlobContainerMappingProperties = original.BlobContainerMappingProperties +type BlobContainerProperties = original.BlobContainerProperties +type BlobDataSet = original.BlobDataSet +type BlobDataSetMapping = original.BlobDataSetMapping +type BlobFolderDataSet = original.BlobFolderDataSet +type BlobFolderDataSetMapping = original.BlobFolderDataSetMapping +type BlobFolderMappingProperties = original.BlobFolderMappingProperties +type BlobFolderProperties = original.BlobFolderProperties +type BlobMappingProperties = original.BlobMappingProperties +type BlobProperties = original.BlobProperties +type ConsumerInvitation = original.ConsumerInvitation +type ConsumerInvitationList = original.ConsumerInvitationList +type ConsumerInvitationListIterator = original.ConsumerInvitationListIterator +type ConsumerInvitationListPage = original.ConsumerInvitationListPage +type ConsumerInvitationProperties = original.ConsumerInvitationProperties +type ConsumerInvitationsClient = original.ConsumerInvitationsClient +type ConsumerSourceDataSet = original.ConsumerSourceDataSet +type ConsumerSourceDataSetList = original.ConsumerSourceDataSetList +type ConsumerSourceDataSetListIterator = original.ConsumerSourceDataSetListIterator +type ConsumerSourceDataSetListPage = original.ConsumerSourceDataSetListPage +type ConsumerSourceDataSetProperties = original.ConsumerSourceDataSetProperties +type ConsumerSourceDataSetsClient = original.ConsumerSourceDataSetsClient +type DataSet = original.DataSet +type DataSetList = original.DataSetList +type DataSetListIterator = original.DataSetListIterator +type DataSetListPage = original.DataSetListPage +type DataSetMapping = original.DataSetMapping +type DataSetMappingList = original.DataSetMappingList +type DataSetMappingListIterator = original.DataSetMappingListIterator +type DataSetMappingListPage = original.DataSetMappingListPage +type DataSetMappingModel = original.DataSetMappingModel +type DataSetMappingsClient = original.DataSetMappingsClient +type DataSetModel = original.DataSetModel +type DataSetsClient = original.DataSetsClient +type DataSetsDeleteFuture = original.DataSetsDeleteFuture +type DefaultDto = original.DefaultDto +type DimensionProperties = original.DimensionProperties +type Error = original.Error +type ErrorInfo = original.ErrorInfo +type Identity = original.Identity +type Invitation = original.Invitation +type InvitationList = original.InvitationList +type InvitationListIterator = original.InvitationListIterator +type InvitationListPage = original.InvitationListPage +type InvitationProperties = original.InvitationProperties +type InvitationsClient = original.InvitationsClient +type KustoClusterDataSet = original.KustoClusterDataSet +type KustoClusterDataSetMapping = original.KustoClusterDataSetMapping +type KustoClusterDataSetMappingProperties = original.KustoClusterDataSetMappingProperties +type KustoClusterDataSetProperties = original.KustoClusterDataSetProperties +type KustoDatabaseDataSet = original.KustoDatabaseDataSet +type KustoDatabaseDataSetMapping = original.KustoDatabaseDataSetMapping +type KustoDatabaseDataSetMappingProperties = original.KustoDatabaseDataSetMappingProperties +type KustoDatabaseDataSetProperties = original.KustoDatabaseDataSetProperties +type OperationList = original.OperationList +type OperationListIterator = original.OperationListIterator +type OperationListPage = original.OperationListPage +type OperationMetaLogSpecification = original.OperationMetaLogSpecification +type OperationMetaMetricSpecification = original.OperationMetaMetricSpecification +type OperationMetaPropertyInfo = original.OperationMetaPropertyInfo +type OperationMetaServiceSpecification = original.OperationMetaServiceSpecification +type OperationModel = original.OperationModel +type OperationModelProperties = original.OperationModelProperties +type OperationResponse = original.OperationResponse +type OperationsClient = original.OperationsClient +type ProviderShareSubscription = original.ProviderShareSubscription +type ProviderShareSubscriptionList = original.ProviderShareSubscriptionList +type ProviderShareSubscriptionListIterator = original.ProviderShareSubscriptionListIterator +type ProviderShareSubscriptionListPage = original.ProviderShareSubscriptionListPage +type ProviderShareSubscriptionProperties = original.ProviderShareSubscriptionProperties +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 +type ScheduledSynchronizationSettingProperties = original.ScheduledSynchronizationSettingProperties +type ScheduledTrigger = original.ScheduledTrigger +type ScheduledTriggerProperties = original.ScheduledTriggerProperties +type Share = original.Share +type ShareList = original.ShareList +type ShareListIterator = original.ShareListIterator +type ShareListPage = original.ShareListPage +type ShareProperties = original.ShareProperties +type ShareSubscription = original.ShareSubscription +type ShareSubscriptionList = original.ShareSubscriptionList +type ShareSubscriptionListIterator = original.ShareSubscriptionListIterator +type ShareSubscriptionListPage = original.ShareSubscriptionListPage +type ShareSubscriptionProperties = original.ShareSubscriptionProperties +type ShareSubscriptionSynchronization = original.ShareSubscriptionSynchronization +type ShareSubscriptionSynchronizationList = original.ShareSubscriptionSynchronizationList +type ShareSubscriptionSynchronizationListIterator = original.ShareSubscriptionSynchronizationListIterator +type ShareSubscriptionSynchronizationListPage = original.ShareSubscriptionSynchronizationListPage +type ShareSubscriptionsCancelSynchronizationFuture = original.ShareSubscriptionsCancelSynchronizationFuture +type ShareSubscriptionsClient = original.ShareSubscriptionsClient +type ShareSubscriptionsDeleteFuture = original.ShareSubscriptionsDeleteFuture +type ShareSubscriptionsSynchronizeMethodFuture = original.ShareSubscriptionsSynchronizeMethodFuture +type ShareSynchronization = original.ShareSynchronization +type ShareSynchronizationList = original.ShareSynchronizationList +type ShareSynchronizationListIterator = original.ShareSynchronizationListIterator +type ShareSynchronizationListPage = original.ShareSynchronizationListPage +type SharesClient = original.SharesClient +type SharesDeleteFuture = original.SharesDeleteFuture +type SourceShareSynchronizationSetting = original.SourceShareSynchronizationSetting +type SourceShareSynchronizationSettingList = original.SourceShareSynchronizationSettingList +type SourceShareSynchronizationSettingListIterator = original.SourceShareSynchronizationSettingListIterator +type SourceShareSynchronizationSettingListPage = original.SourceShareSynchronizationSettingListPage +type SynchronizationDetails = original.SynchronizationDetails +type SynchronizationDetailsList = original.SynchronizationDetailsList +type SynchronizationDetailsListIterator = original.SynchronizationDetailsListIterator +type SynchronizationDetailsListPage = original.SynchronizationDetailsListPage +type SynchronizationSetting = original.SynchronizationSetting +type SynchronizationSettingList = original.SynchronizationSettingList +type SynchronizationSettingListIterator = original.SynchronizationSettingListIterator +type SynchronizationSettingListPage = original.SynchronizationSettingListPage +type SynchronizationSettingModel = original.SynchronizationSettingModel +type SynchronizationSettingsClient = original.SynchronizationSettingsClient +type SynchronizationSettingsDeleteFuture = original.SynchronizationSettingsDeleteFuture +type Synchronize = original.Synchronize +type Trigger = original.Trigger +type TriggerList = original.TriggerList +type TriggerListIterator = original.TriggerListIterator +type TriggerListPage = original.TriggerListPage +type TriggerModel = original.TriggerModel +type TriggersClient = original.TriggersClient +type TriggersCreateFuture = original.TriggersCreateFuture +type TriggersDeleteFuture = original.TriggersDeleteFuture + +func New(subscriptionID string) BaseClient { + return original.New(subscriptionID) +} +func NewAccountListIterator(page AccountListPage) AccountListIterator { + return original.NewAccountListIterator(page) +} +func NewAccountListPage(getNextPage func(context.Context, AccountList) (AccountList, error)) AccountListPage { + return original.NewAccountListPage(getNextPage) +} +func NewAccountsClient(subscriptionID string) AccountsClient { + return original.NewAccountsClient(subscriptionID) +} +func NewAccountsClientWithBaseURI(baseURI string, subscriptionID string) AccountsClient { + return original.NewAccountsClientWithBaseURI(baseURI, subscriptionID) +} +func NewConsumerInvitationListIterator(page ConsumerInvitationListPage) ConsumerInvitationListIterator { + return original.NewConsumerInvitationListIterator(page) +} +func NewConsumerInvitationListPage(getNextPage func(context.Context, ConsumerInvitationList) (ConsumerInvitationList, error)) ConsumerInvitationListPage { + return original.NewConsumerInvitationListPage(getNextPage) +} +func NewConsumerInvitationsClient(subscriptionID string) ConsumerInvitationsClient { + return original.NewConsumerInvitationsClient(subscriptionID) +} +func NewConsumerInvitationsClientWithBaseURI(baseURI string, subscriptionID string) ConsumerInvitationsClient { + return original.NewConsumerInvitationsClientWithBaseURI(baseURI, subscriptionID) +} +func NewConsumerSourceDataSetListIterator(page ConsumerSourceDataSetListPage) ConsumerSourceDataSetListIterator { + return original.NewConsumerSourceDataSetListIterator(page) +} +func NewConsumerSourceDataSetListPage(getNextPage func(context.Context, ConsumerSourceDataSetList) (ConsumerSourceDataSetList, error)) ConsumerSourceDataSetListPage { + return original.NewConsumerSourceDataSetListPage(getNextPage) +} +func NewConsumerSourceDataSetsClient(subscriptionID string) ConsumerSourceDataSetsClient { + return original.NewConsumerSourceDataSetsClient(subscriptionID) +} +func NewConsumerSourceDataSetsClientWithBaseURI(baseURI string, subscriptionID string) ConsumerSourceDataSetsClient { + return original.NewConsumerSourceDataSetsClientWithBaseURI(baseURI, subscriptionID) +} +func NewDataSetListIterator(page DataSetListPage) DataSetListIterator { + return original.NewDataSetListIterator(page) +} +func NewDataSetListPage(getNextPage func(context.Context, DataSetList) (DataSetList, error)) DataSetListPage { + return original.NewDataSetListPage(getNextPage) +} +func NewDataSetMappingListIterator(page DataSetMappingListPage) DataSetMappingListIterator { + return original.NewDataSetMappingListIterator(page) +} +func NewDataSetMappingListPage(getNextPage func(context.Context, DataSetMappingList) (DataSetMappingList, error)) DataSetMappingListPage { + return original.NewDataSetMappingListPage(getNextPage) +} +func NewDataSetMappingsClient(subscriptionID string) DataSetMappingsClient { + return original.NewDataSetMappingsClient(subscriptionID) +} +func NewDataSetMappingsClientWithBaseURI(baseURI string, subscriptionID string) DataSetMappingsClient { + return original.NewDataSetMappingsClientWithBaseURI(baseURI, subscriptionID) +} +func NewDataSetsClient(subscriptionID string) DataSetsClient { + return original.NewDataSetsClient(subscriptionID) +} +func NewDataSetsClientWithBaseURI(baseURI string, subscriptionID string) DataSetsClient { + return original.NewDataSetsClientWithBaseURI(baseURI, subscriptionID) +} +func NewInvitationListIterator(page InvitationListPage) InvitationListIterator { + return original.NewInvitationListIterator(page) +} +func NewInvitationListPage(getNextPage func(context.Context, InvitationList) (InvitationList, error)) InvitationListPage { + return original.NewInvitationListPage(getNextPage) +} +func NewInvitationsClient(subscriptionID string) InvitationsClient { + return original.NewInvitationsClient(subscriptionID) +} +func NewInvitationsClientWithBaseURI(baseURI string, subscriptionID string) InvitationsClient { + return original.NewInvitationsClientWithBaseURI(baseURI, subscriptionID) +} +func NewOperationListIterator(page OperationListPage) OperationListIterator { + return original.NewOperationListIterator(page) +} +func NewOperationListPage(getNextPage func(context.Context, OperationList) (OperationList, error)) OperationListPage { + return original.NewOperationListPage(getNextPage) +} +func NewOperationsClient(subscriptionID string) OperationsClient { + return original.NewOperationsClient(subscriptionID) +} +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) +} +func NewProviderShareSubscriptionListIterator(page ProviderShareSubscriptionListPage) ProviderShareSubscriptionListIterator { + return original.NewProviderShareSubscriptionListIterator(page) +} +func NewProviderShareSubscriptionListPage(getNextPage func(context.Context, ProviderShareSubscriptionList) (ProviderShareSubscriptionList, error)) ProviderShareSubscriptionListPage { + return original.NewProviderShareSubscriptionListPage(getNextPage) +} +func NewProviderShareSubscriptionsClient(subscriptionID string) ProviderShareSubscriptionsClient { + return original.NewProviderShareSubscriptionsClient(subscriptionID) +} +func NewProviderShareSubscriptionsClientWithBaseURI(baseURI string, subscriptionID string) ProviderShareSubscriptionsClient { + return original.NewProviderShareSubscriptionsClientWithBaseURI(baseURI, subscriptionID) +} +func NewShareListIterator(page ShareListPage) ShareListIterator { + return original.NewShareListIterator(page) +} +func NewShareListPage(getNextPage func(context.Context, ShareList) (ShareList, error)) ShareListPage { + return original.NewShareListPage(getNextPage) +} +func NewShareSubscriptionListIterator(page ShareSubscriptionListPage) ShareSubscriptionListIterator { + return original.NewShareSubscriptionListIterator(page) +} +func NewShareSubscriptionListPage(getNextPage func(context.Context, ShareSubscriptionList) (ShareSubscriptionList, error)) ShareSubscriptionListPage { + return original.NewShareSubscriptionListPage(getNextPage) +} +func NewShareSubscriptionSynchronizationListIterator(page ShareSubscriptionSynchronizationListPage) ShareSubscriptionSynchronizationListIterator { + return original.NewShareSubscriptionSynchronizationListIterator(page) +} +func NewShareSubscriptionSynchronizationListPage(getNextPage func(context.Context, ShareSubscriptionSynchronizationList) (ShareSubscriptionSynchronizationList, error)) ShareSubscriptionSynchronizationListPage { + return original.NewShareSubscriptionSynchronizationListPage(getNextPage) +} +func NewShareSubscriptionsClient(subscriptionID string) ShareSubscriptionsClient { + return original.NewShareSubscriptionsClient(subscriptionID) +} +func NewShareSubscriptionsClientWithBaseURI(baseURI string, subscriptionID string) ShareSubscriptionsClient { + return original.NewShareSubscriptionsClientWithBaseURI(baseURI, subscriptionID) +} +func NewShareSynchronizationListIterator(page ShareSynchronizationListPage) ShareSynchronizationListIterator { + return original.NewShareSynchronizationListIterator(page) +} +func NewShareSynchronizationListPage(getNextPage func(context.Context, ShareSynchronizationList) (ShareSynchronizationList, error)) ShareSynchronizationListPage { + return original.NewShareSynchronizationListPage(getNextPage) +} +func NewSharesClient(subscriptionID string) SharesClient { + return original.NewSharesClient(subscriptionID) +} +func NewSharesClientWithBaseURI(baseURI string, subscriptionID string) SharesClient { + return original.NewSharesClientWithBaseURI(baseURI, subscriptionID) +} +func NewSourceShareSynchronizationSettingListIterator(page SourceShareSynchronizationSettingListPage) SourceShareSynchronizationSettingListIterator { + return original.NewSourceShareSynchronizationSettingListIterator(page) +} +func NewSourceShareSynchronizationSettingListPage(getNextPage func(context.Context, SourceShareSynchronizationSettingList) (SourceShareSynchronizationSettingList, error)) SourceShareSynchronizationSettingListPage { + return original.NewSourceShareSynchronizationSettingListPage(getNextPage) +} +func NewSynchronizationDetailsListIterator(page SynchronizationDetailsListPage) SynchronizationDetailsListIterator { + return original.NewSynchronizationDetailsListIterator(page) +} +func NewSynchronizationDetailsListPage(getNextPage func(context.Context, SynchronizationDetailsList) (SynchronizationDetailsList, error)) SynchronizationDetailsListPage { + return original.NewSynchronizationDetailsListPage(getNextPage) +} +func NewSynchronizationSettingListIterator(page SynchronizationSettingListPage) SynchronizationSettingListIterator { + return original.NewSynchronizationSettingListIterator(page) +} +func NewSynchronizationSettingListPage(getNextPage func(context.Context, SynchronizationSettingList) (SynchronizationSettingList, error)) SynchronizationSettingListPage { + return original.NewSynchronizationSettingListPage(getNextPage) +} +func NewSynchronizationSettingsClient(subscriptionID string) SynchronizationSettingsClient { + return original.NewSynchronizationSettingsClient(subscriptionID) +} +func NewSynchronizationSettingsClientWithBaseURI(baseURI string, subscriptionID string) SynchronizationSettingsClient { + return original.NewSynchronizationSettingsClientWithBaseURI(baseURI, subscriptionID) +} +func NewTriggerListIterator(page TriggerListPage) TriggerListIterator { + return original.NewTriggerListIterator(page) +} +func NewTriggerListPage(getNextPage func(context.Context, TriggerList) (TriggerList, error)) TriggerListPage { + return original.NewTriggerListPage(getNextPage) +} +func NewTriggersClient(subscriptionID string) TriggersClient { + return original.NewTriggersClient(subscriptionID) +} +func NewTriggersClientWithBaseURI(baseURI string, subscriptionID string) TriggersClient { + return original.NewTriggersClientWithBaseURI(baseURI, subscriptionID) +} +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return original.NewWithBaseURI(baseURI, subscriptionID) +} +func PossibleDataSetMappingStatusValues() []DataSetMappingStatus { + return original.PossibleDataSetMappingStatusValues() +} +func PossibleDataSetTypeValues() []DataSetType { + return original.PossibleDataSetTypeValues() +} +func PossibleInvitationStatusValues() []InvitationStatus { + return original.PossibleInvitationStatusValues() +} +func PossibleKindBasicDataSetMappingValues() []KindBasicDataSetMapping { + return original.PossibleKindBasicDataSetMappingValues() +} +func PossibleKindBasicSourceShareSynchronizationSettingValues() []KindBasicSourceShareSynchronizationSetting { + return original.PossibleKindBasicSourceShareSynchronizationSettingValues() +} +func PossibleKindBasicSynchronizationSettingValues() []KindBasicSynchronizationSetting { + return original.PossibleKindBasicSynchronizationSettingValues() +} +func PossibleKindBasicTriggerValues() []KindBasicTrigger { + return original.PossibleKindBasicTriggerValues() +} +func PossibleKindValues() []Kind { + return original.PossibleKindValues() +} +func PossibleOutputTypeValues() []OutputType { + return original.PossibleOutputTypeValues() +} +func PossibleProvisioningStateValues() []ProvisioningState { + return original.PossibleProvisioningStateValues() +} +func PossibleRecurrenceIntervalValues() []RecurrenceInterval { + return original.PossibleRecurrenceIntervalValues() +} +func PossibleShareKindValues() []ShareKind { + return original.PossibleShareKindValues() +} +func PossibleShareSubscriptionStatusValues() []ShareSubscriptionStatus { + return original.PossibleShareSubscriptionStatusValues() +} +func PossibleStatusValues() []Status { + return original.PossibleStatusValues() +} +func PossibleSynchronizationModeValues() []SynchronizationMode { + return original.PossibleSynchronizationModeValues() +} +func PossibleTriggerStatusValues() []TriggerStatus { + return original.PossibleTriggerStatusValues() +} +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/domainservices/mgmt/aad/aadapi/models.go b/profiles/latest/domainservices/mgmt/aad/aadapi/models.go index 57ce54cbf838..9f299cf3ee98 100644 --- a/profiles/latest/domainservices/mgmt/aad/aadapi/models.go +++ b/profiles/latest/domainservices/mgmt/aad/aadapi/models.go @@ -23,4 +23,3 @@ import original "github.com/Azure/azure-sdk-for-go/services/domainservices/mgmt/ type DomainServiceOperationsClientAPI = original.DomainServiceOperationsClientAPI type DomainServicesClientAPI = original.DomainServicesClientAPI -type ReplicaSetsClientAPI = original.ReplicaSetsClientAPI diff --git a/profiles/latest/domainservices/mgmt/aad/models.go b/profiles/latest/domainservices/mgmt/aad/models.go index 0f420e987f44..d204eceb8de3 100644 --- a/profiles/latest/domainservices/mgmt/aad/models.go +++ b/profiles/latest/domainservices/mgmt/aad/models.go @@ -106,15 +106,6 @@ type OperationEntity = original.OperationEntity type OperationEntityListResult = original.OperationEntityListResult type OperationEntityListResultIterator = original.OperationEntityListResultIterator type OperationEntityListResultPage = original.OperationEntityListResultPage -type ReplicaSet = original.ReplicaSet -type ReplicaSetListResult = original.ReplicaSetListResult -type ReplicaSetListResultIterator = original.ReplicaSetListResultIterator -type ReplicaSetListResultPage = original.ReplicaSetListResultPage -type ReplicaSetProperties = original.ReplicaSetProperties -type ReplicaSetsClient = original.ReplicaSetsClient -type ReplicaSetsCreateOrUpdateFuture = original.ReplicaSetsCreateOrUpdateFuture -type ReplicaSetsDeleteFuture = original.ReplicaSetsDeleteFuture -type ReplicaSetsUpdateFuture = original.ReplicaSetsUpdateFuture type Resource = original.Resource func New(subscriptionID string) BaseClient { @@ -144,18 +135,6 @@ func NewOperationEntityListResultIterator(page OperationEntityListResultPage) Op func NewOperationEntityListResultPage(getNextPage func(context.Context, OperationEntityListResult) (OperationEntityListResult, error)) OperationEntityListResultPage { return original.NewOperationEntityListResultPage(getNextPage) } -func NewReplicaSetListResultIterator(page ReplicaSetListResultPage) ReplicaSetListResultIterator { - return original.NewReplicaSetListResultIterator(page) -} -func NewReplicaSetListResultPage(getNextPage func(context.Context, ReplicaSetListResult) (ReplicaSetListResult, error)) ReplicaSetListResultPage { - return original.NewReplicaSetListResultPage(getNextPage) -} -func NewReplicaSetsClient(subscriptionID string) ReplicaSetsClient { - return original.NewReplicaSetsClient(subscriptionID) -} -func NewReplicaSetsClientWithBaseURI(baseURI string, subscriptionID string) ReplicaSetsClient { - return original.NewReplicaSetsClientWithBaseURI(baseURI, subscriptionID) -} func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { return original.NewWithBaseURI(baseURI, subscriptionID) } diff --git a/profiles/latest/eventgrid/eventgrid/models.go b/profiles/latest/eventgrid/eventgrid/models.go index bbc94e13941c..9ee7818f21d7 100644 --- a/profiles/latest/eventgrid/eventgrid/models.go +++ b/profiles/latest/eventgrid/eventgrid/models.go @@ -111,6 +111,10 @@ type KeyVaultKeyNewVersionCreatedEventData = original.KeyVaultKeyNewVersionCreat type KeyVaultSecretExpiredEventData = original.KeyVaultSecretExpiredEventData type KeyVaultSecretNearExpiryEventData = original.KeyVaultSecretNearExpiryEventData type KeyVaultSecretNewVersionCreatedEventData = original.KeyVaultSecretNewVersionCreatedEventData +type MachineLearningServicesDatasetDriftDetectedEventData = original.MachineLearningServicesDatasetDriftDetectedEventData +type MachineLearningServicesModelDeployedEventData = original.MachineLearningServicesModelDeployedEventData +type MachineLearningServicesModelRegisteredEventData = original.MachineLearningServicesModelRegisteredEventData +type MachineLearningServicesRunCompletedEventData = original.MachineLearningServicesRunCompletedEventData type MapsGeofenceEnteredEventData = original.MapsGeofenceEnteredEventData type MapsGeofenceEventProperties = original.MapsGeofenceEventProperties type MapsGeofenceExitedEventData = original.MapsGeofenceExitedEventData @@ -159,6 +163,10 @@ type SignalRServiceClientConnectionConnectedEventData = original.SignalRServiceC type SignalRServiceClientConnectionDisconnectedEventData = original.SignalRServiceClientConnectionDisconnectedEventData type StorageBlobCreatedEventData = original.StorageBlobCreatedEventData type StorageBlobDeletedEventData = original.StorageBlobDeletedEventData +type StorageBlobRenamedEventData = original.StorageBlobRenamedEventData +type StorageDirectoryCreatedEventData = original.StorageDirectoryCreatedEventData +type StorageDirectoryDeletedEventData = original.StorageDirectoryDeletedEventData +type StorageDirectoryRenamedEventData = original.StorageDirectoryRenamedEventData type SubscriptionDeletedEventData = original.SubscriptionDeletedEventData type SubscriptionValidationEventData = original.SubscriptionValidationEventData type SubscriptionValidationResponse = original.SubscriptionValidationResponse diff --git a/profiles/latest/operationalinsights/mgmt/operationalinsights/models.go b/profiles/latest/operationalinsights/mgmt/operationalinsights/models.go index d0a4679c911f..38e9078107cf 100644 --- a/profiles/latest/operationalinsights/mgmt/operationalinsights/models.go +++ b/profiles/latest/operationalinsights/mgmt/operationalinsights/models.go @@ -64,13 +64,9 @@ type SavedSearch = original.SavedSearch type SavedSearchProperties = original.SavedSearchProperties type SavedSearchesClient = original.SavedSearchesClient type SavedSearchesListResult = original.SavedSearchesListResult -type SearchError = original.SearchError type SearchGetSchemaResponse = original.SearchGetSchemaResponse -type SearchHighlight = original.SearchHighlight type SearchMetadata = original.SearchMetadata type SearchMetadataSchema = original.SearchMetadataSchema -type SearchParameters = original.SearchParameters -type SearchResultsResponse = original.SearchResultsResponse type SearchSchemaValue = original.SearchSchemaValue type SearchSort = original.SearchSort type SharedKeys = original.SharedKeys @@ -88,7 +84,6 @@ type WorkspacePurgeBodyFilters = original.WorkspacePurgeBodyFilters type WorkspacePurgeResponse = original.WorkspacePurgeResponse type WorkspacePurgeStatusResponse = original.WorkspacePurgeStatusResponse type WorkspacesClient = original.WorkspacesClient -type WorkspacesGetSearchResultsFuture = original.WorkspacesGetSearchResultsFuture func New(subscriptionID string, purgeID string) BaseClient { return original.New(subscriptionID, purgeID) diff --git a/profiles/latest/policyinsights/mgmt/policyinsights/models.go b/profiles/latest/policyinsights/mgmt/policyinsights/models.go index 86baa6dc324f..792fa9b13ca8 100644 --- a/profiles/latest/policyinsights/mgmt/policyinsights/models.go +++ b/profiles/latest/policyinsights/mgmt/policyinsights/models.go @@ -19,7 +19,11 @@ package policyinsights -import original "github.com/Azure/azure-sdk-for-go/services/policyinsights/mgmt/2018-04-04/policyinsights" +import ( + "context" + + original "github.com/Azure/azure-sdk-for-go/services/policyinsights/mgmt/2019-10-01/policyinsights" +) const ( DefaultBaseURI = original.DefaultBaseURI @@ -33,24 +37,51 @@ const ( ) type BaseClient = original.BaseClient +type ComplianceDetail = original.ComplianceDetail +type ErrorDefinition = original.ErrorDefinition +type ErrorResponse = original.ErrorResponse +type ExpressionEvaluationDetails = original.ExpressionEvaluationDetails +type IfNotExistsEvaluationDetails = original.IfNotExistsEvaluationDetails type Operation = original.Operation type OperationDisplay = original.OperationDisplay type OperationsClient = original.OperationsClient type OperationsListResults = original.OperationsListResults type PolicyAssignmentSummary = original.PolicyAssignmentSummary type PolicyDefinitionSummary = original.PolicyDefinitionSummary +type PolicyDetails = original.PolicyDetails +type PolicyEvaluationDetails = original.PolicyEvaluationDetails type PolicyEvent = original.PolicyEvent type PolicyEventsClient = original.PolicyEventsClient type PolicyEventsQueryResults = original.PolicyEventsQueryResults +type PolicyGroupSummary = original.PolicyGroupSummary type PolicyState = original.PolicyState type PolicyStatesClient = original.PolicyStatesClient type PolicyStatesQueryResults = original.PolicyStatesQueryResults +type PolicyTrackedResource = original.PolicyTrackedResource +type PolicyTrackedResourcesClient = original.PolicyTrackedResourcesClient +type PolicyTrackedResourcesQueryResults = original.PolicyTrackedResourcesQueryResults +type PolicyTrackedResourcesQueryResultsIterator = original.PolicyTrackedResourcesQueryResultsIterator +type PolicyTrackedResourcesQueryResultsPage = original.PolicyTrackedResourcesQueryResultsPage type QueryFailure = original.QueryFailure type QueryFailureError = original.QueryFailureError +type Remediation = original.Remediation +type RemediationDeployment = original.RemediationDeployment +type RemediationDeploymentSummary = original.RemediationDeploymentSummary +type RemediationDeploymentsListResult = original.RemediationDeploymentsListResult +type RemediationDeploymentsListResultIterator = original.RemediationDeploymentsListResultIterator +type RemediationDeploymentsListResultPage = original.RemediationDeploymentsListResultPage +type RemediationFilters = original.RemediationFilters +type RemediationListResult = original.RemediationListResult +type RemediationListResultIterator = original.RemediationListResultIterator +type RemediationListResultPage = original.RemediationListResultPage +type RemediationProperties = original.RemediationProperties +type RemediationsClient = original.RemediationsClient type String = original.String type SummarizeResults = original.SummarizeResults type Summary = original.Summary type SummaryResults = original.SummaryResults +type TrackedResourceModificationDetails = original.TrackedResourceModificationDetails +type TypedErrorInfo = original.TypedErrorInfo func New() BaseClient { return original.New() @@ -73,6 +104,36 @@ func NewPolicyStatesClient() PolicyStatesClient { func NewPolicyStatesClientWithBaseURI(baseURI string) PolicyStatesClient { return original.NewPolicyStatesClientWithBaseURI(baseURI) } +func NewPolicyTrackedResourcesClient() PolicyTrackedResourcesClient { + return original.NewPolicyTrackedResourcesClient() +} +func NewPolicyTrackedResourcesClientWithBaseURI(baseURI string) PolicyTrackedResourcesClient { + return original.NewPolicyTrackedResourcesClientWithBaseURI(baseURI) +} +func NewPolicyTrackedResourcesQueryResultsIterator(page PolicyTrackedResourcesQueryResultsPage) PolicyTrackedResourcesQueryResultsIterator { + return original.NewPolicyTrackedResourcesQueryResultsIterator(page) +} +func NewPolicyTrackedResourcesQueryResultsPage(getNextPage func(context.Context, PolicyTrackedResourcesQueryResults) (PolicyTrackedResourcesQueryResults, error)) PolicyTrackedResourcesQueryResultsPage { + return original.NewPolicyTrackedResourcesQueryResultsPage(getNextPage) +} +func NewRemediationDeploymentsListResultIterator(page RemediationDeploymentsListResultPage) RemediationDeploymentsListResultIterator { + return original.NewRemediationDeploymentsListResultIterator(page) +} +func NewRemediationDeploymentsListResultPage(getNextPage func(context.Context, RemediationDeploymentsListResult) (RemediationDeploymentsListResult, error)) RemediationDeploymentsListResultPage { + return original.NewRemediationDeploymentsListResultPage(getNextPage) +} +func NewRemediationListResultIterator(page RemediationListResultPage) RemediationListResultIterator { + return original.NewRemediationListResultIterator(page) +} +func NewRemediationListResultPage(getNextPage func(context.Context, RemediationListResult) (RemediationListResult, error)) RemediationListResultPage { + return original.NewRemediationListResultPage(getNextPage) +} +func NewRemediationsClient() RemediationsClient { + return original.NewRemediationsClient() +} +func NewRemediationsClientWithBaseURI(baseURI string) RemediationsClient { + return original.NewRemediationsClientWithBaseURI(baseURI) +} func NewWithBaseURI(baseURI string) BaseClient { return original.NewWithBaseURI(baseURI) } diff --git a/profiles/latest/policyinsights/mgmt/policyinsights/policyinsightsapi/models.go b/profiles/latest/policyinsights/mgmt/policyinsights/policyinsightsapi/models.go index 68f64baaefe8..3f4601162208 100644 --- a/profiles/latest/policyinsights/mgmt/policyinsights/policyinsightsapi/models.go +++ b/profiles/latest/policyinsights/mgmt/policyinsights/policyinsightsapi/models.go @@ -19,8 +19,10 @@ package policyinsightsapi -import original "github.com/Azure/azure-sdk-for-go/services/policyinsights/mgmt/2018-04-04/policyinsights/policyinsightsapi" +import original "github.com/Azure/azure-sdk-for-go/services/policyinsights/mgmt/2019-10-01/policyinsights/policyinsightsapi" type OperationsClientAPI = original.OperationsClientAPI type PolicyEventsClientAPI = original.PolicyEventsClientAPI type PolicyStatesClientAPI = original.PolicyStatesClientAPI +type PolicyTrackedResourcesClientAPI = original.PolicyTrackedResourcesClientAPI +type RemediationsClientAPI = original.RemediationsClientAPI diff --git a/profiles/latest/recoveryservices/mgmt/backup/models.go b/profiles/latest/recoveryservices/mgmt/backup/models.go index 64707fed9555..989bb6b87a7b 100644 --- a/profiles/latest/recoveryservices/mgmt/backup/models.go +++ b/profiles/latest/recoveryservices/mgmt/backup/models.go @@ -265,14 +265,16 @@ const ( type JobOperationType = original.JobOperationType const ( - JobOperationTypeBackup JobOperationType = original.JobOperationTypeBackup - JobOperationTypeConfigureBackup JobOperationType = original.JobOperationTypeConfigureBackup - JobOperationTypeDeleteBackupData JobOperationType = original.JobOperationTypeDeleteBackupData - JobOperationTypeDisableBackup JobOperationType = original.JobOperationTypeDisableBackup - JobOperationTypeInvalid JobOperationType = original.JobOperationTypeInvalid - JobOperationTypeRegister JobOperationType = original.JobOperationTypeRegister - JobOperationTypeRestore JobOperationType = original.JobOperationTypeRestore - JobOperationTypeUnRegister JobOperationType = original.JobOperationTypeUnRegister + JobOperationTypeBackup JobOperationType = original.JobOperationTypeBackup + JobOperationTypeConfigureBackup JobOperationType = original.JobOperationTypeConfigureBackup + JobOperationTypeCrossRegionRestore JobOperationType = original.JobOperationTypeCrossRegionRestore + JobOperationTypeDeleteBackupData JobOperationType = original.JobOperationTypeDeleteBackupData + JobOperationTypeDisableBackup JobOperationType = original.JobOperationTypeDisableBackup + JobOperationTypeInvalid JobOperationType = original.JobOperationTypeInvalid + JobOperationTypeRegister JobOperationType = original.JobOperationTypeRegister + JobOperationTypeRestore JobOperationType = original.JobOperationTypeRestore + JobOperationTypeUndelete JobOperationType = original.JobOperationTypeUndelete + JobOperationTypeUnRegister JobOperationType = original.JobOperationTypeUnRegister ) type JobStatus = original.JobStatus @@ -390,8 +392,9 @@ const ( type ObjectTypeBasicILRRequest = original.ObjectTypeBasicILRRequest const ( - ObjectTypeIaasVMILRRegistrationRequest ObjectTypeBasicILRRequest = original.ObjectTypeIaasVMILRRegistrationRequest - ObjectTypeILRRequest ObjectTypeBasicILRRequest = original.ObjectTypeILRRequest + ObjectTypeAzureFileShareProvisionILRRequest ObjectTypeBasicILRRequest = original.ObjectTypeAzureFileShareProvisionILRRequest + ObjectTypeIaasVMILRRegistrationRequest ObjectTypeBasicILRRequest = original.ObjectTypeIaasVMILRRegistrationRequest + ObjectTypeILRRequest ObjectTypeBasicILRRequest = original.ObjectTypeILRRequest ) type ObjectTypeBasicOperationStatusExtendedInfo = original.ObjectTypeBasicOperationStatusExtendedInfo @@ -501,7 +504,6 @@ const ( ProtectableItemTypeIaaSVMProtectableItem ProtectableItemType = original.ProtectableItemTypeIaaSVMProtectableItem ProtectableItemTypeMicrosoftClassicComputevirtualMachines ProtectableItemType = original.ProtectableItemTypeMicrosoftClassicComputevirtualMachines ProtectableItemTypeMicrosoftComputevirtualMachines ProtectableItemType = original.ProtectableItemTypeMicrosoftComputevirtualMachines - ProtectableItemTypeSAPAseDatabase ProtectableItemType = original.ProtectableItemTypeSAPAseDatabase ProtectableItemTypeSAPAseSystem ProtectableItemType = original.ProtectableItemTypeSAPAseSystem ProtectableItemTypeSAPHanaDatabase ProtectableItemType = original.ProtectableItemTypeSAPHanaDatabase ProtectableItemTypeSAPHanaSystem ProtectableItemType = original.ProtectableItemTypeSAPHanaSystem @@ -581,6 +583,14 @@ const ( ProtectionStatusProtectionFailed ProtectionStatus = original.ProtectionStatusProtectionFailed ) +type RecoveryMode = original.RecoveryMode + +const ( + RecoveryModeFileRecovery RecoveryMode = original.RecoveryModeFileRecovery + RecoveryModeInvalid RecoveryMode = original.RecoveryModeInvalid + RecoveryModeWorkloadRecovery RecoveryMode = original.RecoveryModeWorkloadRecovery +) + type RecoveryPointTierStatus = original.RecoveryPointTierStatus const ( @@ -603,6 +613,7 @@ type RecoveryType = original.RecoveryType const ( RecoveryTypeAlternateLocation RecoveryType = original.RecoveryTypeAlternateLocation RecoveryTypeInvalid RecoveryType = original.RecoveryTypeInvalid + RecoveryTypeOffline RecoveryType = original.RecoveryTypeOffline RecoveryTypeOriginalLocation RecoveryType = original.RecoveryTypeOriginalLocation RecoveryTypeRestoreDisks RecoveryType = original.RecoveryTypeRestoreDisks ) @@ -686,6 +697,14 @@ const ( ScheduleRunTypeWeekly ScheduleRunType = original.ScheduleRunTypeWeekly ) +type SoftDeleteFeatureState = original.SoftDeleteFeatureState + +const ( + SoftDeleteFeatureStateDisabled SoftDeleteFeatureState = original.SoftDeleteFeatureStateDisabled + SoftDeleteFeatureStateEnabled SoftDeleteFeatureState = original.SoftDeleteFeatureStateEnabled + SoftDeleteFeatureStateInvalid SoftDeleteFeatureState = original.SoftDeleteFeatureStateInvalid +) + type StorageType = original.StorageType const ( @@ -811,6 +830,7 @@ type AzureBackupServerEngine = original.AzureBackupServerEngine type AzureFileShareBackupRequest = original.AzureFileShareBackupRequest type AzureFileShareProtectableItem = original.AzureFileShareProtectableItem type AzureFileShareProtectionPolicy = original.AzureFileShareProtectionPolicy +type AzureFileShareProvisionILRRequest = original.AzureFileShareProvisionILRRequest type AzureFileShareRecoveryPoint = original.AzureFileShareRecoveryPoint type AzureFileShareRestoreRequest = original.AzureFileShareRestoreRequest type AzureFileshareProtectedItem = original.AzureFileshareProtectedItem @@ -851,7 +871,6 @@ type AzureVMWorkloadProtectableItem = original.AzureVMWorkloadProtectableItem type AzureVMWorkloadProtectedItem = original.AzureVMWorkloadProtectedItem type AzureVMWorkloadProtectedItemExtendedInfo = original.AzureVMWorkloadProtectedItemExtendedInfo type AzureVMWorkloadProtectionPolicy = original.AzureVMWorkloadProtectionPolicy -type AzureVMWorkloadSAPAseDatabaseProtectableItem = original.AzureVMWorkloadSAPAseDatabaseProtectableItem type AzureVMWorkloadSAPAseDatabaseProtectedItem = original.AzureVMWorkloadSAPAseDatabaseProtectedItem type AzureVMWorkloadSAPAseDatabaseWorkloadItem = original.AzureVMWorkloadSAPAseDatabaseWorkloadItem type AzureVMWorkloadSAPAseSystemProtectableItem = original.AzureVMWorkloadSAPAseSystemProtectableItem @@ -953,6 +972,8 @@ type DPMProtectedItemExtendedInfo = original.DPMProtectedItemExtendedInfo type DailyRetentionFormat = original.DailyRetentionFormat type DailyRetentionSchedule = original.DailyRetentionSchedule type Day = original.Day +type DiskExclusionProperties = original.DiskExclusionProperties +type DiskInformation = original.DiskInformation type DistributedNodesInfo = original.DistributedNodesInfo type DpmBackupEngine = original.DpmBackupEngine type DpmContainer = original.DpmContainer @@ -971,6 +992,7 @@ type EnginesClient = original.EnginesClient type ErrorDetail = original.ErrorDetail type ExportJobsOperationResultInfo = original.ExportJobsOperationResultInfo type ExportJobsOperationResultsClient = original.ExportJobsOperationResultsClient +type ExtendedProperties = original.ExtendedProperties type FeatureSupportClient = original.FeatureSupportClient type FeatureSupportRequest = original.FeatureSupportRequest type GenericContainer = original.GenericContainer @@ -990,6 +1012,7 @@ type IaasVMRestoreRequest = original.IaasVMRestoreRequest type InquiryInfo = original.InquiryInfo type InquiryValidation = original.InquiryValidation type InstantItemRecoveryTarget = original.InstantItemRecoveryTarget +type InstantRPAdditionalDetails = original.InstantRPAdditionalDetails type ItemLevelRecoveryConnectionsClient = original.ItemLevelRecoveryConnectionsClient type Job = original.Job type JobCancellationsClient = original.JobCancellationsClient @@ -1084,6 +1107,7 @@ type ProtectionPolicyResourceList = original.ProtectionPolicyResourceList type ProtectionPolicyResourceListIterator = original.ProtectionPolicyResourceListIterator type ProtectionPolicyResourceListPage = original.ProtectionPolicyResourceListPage type RecoveryPoint = original.RecoveryPoint +type RecoveryPointDiskConfiguration = original.RecoveryPointDiskConfiguration type RecoveryPointResource = original.RecoveryPointResource type RecoveryPointResourceList = original.RecoveryPointResourceList type RecoveryPointResourceListIterator = original.RecoveryPointResourceListIterator @@ -1577,6 +1601,9 @@ func PossibleProtectionStateValues() []ProtectionState { func PossibleProtectionStatusValues() []ProtectionStatus { return original.PossibleProtectionStatusValues() } +func PossibleRecoveryModeValues() []RecoveryMode { + return original.PossibleRecoveryModeValues() +} func PossibleRecoveryPointTierStatusValues() []RecoveryPointTierStatus { return original.PossibleRecoveryPointTierStatusValues() } @@ -1613,6 +1640,9 @@ func PossibleSchedulePolicyTypeValues() []SchedulePolicyType { func PossibleScheduleRunTypeValues() []ScheduleRunType { return original.PossibleScheduleRunTypeValues() } +func PossibleSoftDeleteFeatureStateValues() []SoftDeleteFeatureState { + return original.PossibleSoftDeleteFeatureStateValues() +} func PossibleStorageTypeStateValues() []StorageTypeState { return original.PossibleStorageTypeStateValues() } diff --git a/profiles/latest/servicebus/mgmt/servicebus/models.go b/profiles/latest/servicebus/mgmt/servicebus/models.go index a2bf7db2ca77..fba494f170aa 100644 --- a/profiles/latest/servicebus/mgmt/servicebus/models.go +++ b/profiles/latest/servicebus/mgmt/servicebus/models.go @@ -72,13 +72,6 @@ const ( FilterTypeSQLFilter FilterType = original.FilterTypeSQLFilter ) -type IPAction = original.IPAction - -const ( - Accept IPAction = original.Accept - Reject IPAction = original.Reject -) - type KeyType = original.KeyType const ( @@ -168,11 +161,6 @@ type EventHubListResultPage = original.EventHubListResultPage type EventHubsClient = original.EventHubsClient type Eventhub = original.Eventhub type EventhubProperties = original.EventhubProperties -type IPFilterRule = original.IPFilterRule -type IPFilterRuleListResult = original.IPFilterRuleListResult -type IPFilterRuleListResultIterator = original.IPFilterRuleListResultIterator -type IPFilterRuleListResultPage = original.IPFilterRuleListResultPage -type IPFilterRuleProperties = original.IPFilterRuleProperties type MessageCountDetails = original.MessageCountDetails type MigrationConfigListResult = original.MigrationConfigListResult type MigrationConfigListResultIterator = original.MigrationConfigListResultIterator @@ -248,11 +236,6 @@ type Subnet = original.Subnet type SubscriptionsClient = original.SubscriptionsClient type TopicsClient = original.TopicsClient type TrackedResource = original.TrackedResource -type VirtualNetworkRule = original.VirtualNetworkRule -type VirtualNetworkRuleListResult = original.VirtualNetworkRuleListResult -type VirtualNetworkRuleListResultIterator = original.VirtualNetworkRuleListResultIterator -type VirtualNetworkRuleListResultPage = original.VirtualNetworkRuleListResultPage -type VirtualNetworkRuleProperties = original.VirtualNetworkRuleProperties func New(subscriptionID string) BaseClient { return original.New(subscriptionID) @@ -413,9 +396,6 @@ func PossibleEntityStatusValues() []EntityStatus { func PossibleFilterTypeValues() []FilterType { return original.PossibleFilterTypeValues() } -func PossibleIPActionValues() []IPAction { - return original.PossibleIPActionValues() -} func PossibleKeyTypeValues() []KeyType { return original.PossibleKeyTypeValues() } diff --git a/profiles/latest/sql/mgmt/sql/models.go b/profiles/latest/sql/mgmt/sql/models.go index 21281d393c61..250d9c622dff 100644 --- a/profiles/latest/sql/mgmt/sql/models.go +++ b/profiles/latest/sql/mgmt/sql/models.go @@ -25,6 +25,15 @@ const ( DefaultBaseURI = original.DefaultBaseURI ) +type AdvisorStatus = original.AdvisorStatus + +const ( + GA AdvisorStatus = original.GA + LimitedPublicPreview AdvisorStatus = original.LimitedPublicPreview + PrivatePreview AdvisorStatus = original.PrivatePreview + PublicPreview AdvisorStatus = original.PublicPreview +) + type AuthenticationType = original.AuthenticationType const ( @@ -32,6 +41,30 @@ const ( SQL AuthenticationType = original.SQL ) +type AutoExecuteStatus = original.AutoExecuteStatus + +const ( + Default AutoExecuteStatus = original.Default + Disabled AutoExecuteStatus = original.Disabled + Enabled AutoExecuteStatus = original.Enabled +) + +type BackupLongTermRetentionPolicyState = original.BackupLongTermRetentionPolicyState + +const ( + BackupLongTermRetentionPolicyStateDisabled BackupLongTermRetentionPolicyState = original.BackupLongTermRetentionPolicyStateDisabled + BackupLongTermRetentionPolicyStateEnabled BackupLongTermRetentionPolicyState = original.BackupLongTermRetentionPolicyStateEnabled +) + +type CapabilityStatus = original.CapabilityStatus + +const ( + CapabilityStatusAvailable CapabilityStatus = original.CapabilityStatusAvailable + CapabilityStatusDefault CapabilityStatus = original.CapabilityStatusDefault + CapabilityStatusDisabled CapabilityStatus = original.CapabilityStatusDisabled + CapabilityStatusVisible CapabilityStatus = original.CapabilityStatusVisible +) + type CheckNameAvailabilityReason = original.CheckNameAvailabilityReason const ( @@ -42,14 +75,39 @@ const ( type CreateMode = original.CreateMode const ( - Copy CreateMode = original.Copy - Default CreateMode = original.Default - NonReadableSecondary CreateMode = original.NonReadableSecondary - OnlineSecondary CreateMode = original.OnlineSecondary - PointInTimeRestore CreateMode = original.PointInTimeRestore - Recovery CreateMode = original.Recovery - Restore CreateMode = original.Restore - RestoreLongTermRetentionBackup CreateMode = original.RestoreLongTermRetentionBackup + CreateModeCopy CreateMode = original.CreateModeCopy + CreateModeDefault CreateMode = original.CreateModeDefault + CreateModeNonReadableSecondary CreateMode = original.CreateModeNonReadableSecondary + CreateModeOnlineSecondary CreateMode = original.CreateModeOnlineSecondary + CreateModePointInTimeRestore CreateMode = original.CreateModePointInTimeRestore + CreateModeRecovery CreateMode = original.CreateModeRecovery + CreateModeRestore CreateMode = original.CreateModeRestore + CreateModeRestoreLongTermRetentionBackup CreateMode = original.CreateModeRestoreLongTermRetentionBackup +) + +type DataMaskingFunction = original.DataMaskingFunction + +const ( + DataMaskingFunctionCCN DataMaskingFunction = original.DataMaskingFunctionCCN + DataMaskingFunctionDefault DataMaskingFunction = original.DataMaskingFunctionDefault + DataMaskingFunctionEmail DataMaskingFunction = original.DataMaskingFunctionEmail + DataMaskingFunctionNumber DataMaskingFunction = original.DataMaskingFunctionNumber + DataMaskingFunctionSSN DataMaskingFunction = original.DataMaskingFunctionSSN + DataMaskingFunctionText DataMaskingFunction = original.DataMaskingFunctionText +) + +type DataMaskingRuleState = original.DataMaskingRuleState + +const ( + DataMaskingRuleStateDisabled DataMaskingRuleState = original.DataMaskingRuleStateDisabled + DataMaskingRuleStateEnabled DataMaskingRuleState = original.DataMaskingRuleStateEnabled +) + +type DataMaskingState = original.DataMaskingState + +const ( + DataMaskingStateDisabled DataMaskingState = original.DataMaskingStateDisabled + DataMaskingStateEnabled DataMaskingState = original.DataMaskingStateEnabled ) type DatabaseEdition = original.DatabaseEdition @@ -71,6 +129,37 @@ const ( Web DatabaseEdition = original.Web ) +type DisasterRecoveryConfigurationAutoFailover = original.DisasterRecoveryConfigurationAutoFailover + +const ( + Off DisasterRecoveryConfigurationAutoFailover = original.Off + On DisasterRecoveryConfigurationAutoFailover = original.On +) + +type DisasterRecoveryConfigurationFailoverPolicy = original.DisasterRecoveryConfigurationFailoverPolicy + +const ( + Automatic DisasterRecoveryConfigurationFailoverPolicy = original.Automatic + Manual DisasterRecoveryConfigurationFailoverPolicy = original.Manual +) + +type DisasterRecoveryConfigurationRole = original.DisasterRecoveryConfigurationRole + +const ( + None DisasterRecoveryConfigurationRole = original.None + Primary DisasterRecoveryConfigurationRole = original.Primary + Secondary DisasterRecoveryConfigurationRole = original.Secondary +) + +type DisasterRecoveryConfigurationStatus = original.DisasterRecoveryConfigurationStatus + +const ( + Creating DisasterRecoveryConfigurationStatus = original.Creating + Dropping DisasterRecoveryConfigurationStatus = original.Dropping + FailingOver DisasterRecoveryConfigurationStatus = original.FailingOver + Ready DisasterRecoveryConfigurationStatus = original.Ready +) + type ElasticPoolEdition = original.ElasticPoolEdition const ( @@ -84,9 +173,79 @@ const ( type ElasticPoolState = original.ElasticPoolState const ( - Creating ElasticPoolState = original.Creating - Disabled ElasticPoolState = original.Disabled - Ready ElasticPoolState = original.Ready + ElasticPoolStateCreating ElasticPoolState = original.ElasticPoolStateCreating + ElasticPoolStateDisabled ElasticPoolState = original.ElasticPoolStateDisabled + ElasticPoolStateReady ElasticPoolState = original.ElasticPoolStateReady +) + +type GeoBackupPolicyState = original.GeoBackupPolicyState + +const ( + GeoBackupPolicyStateDisabled GeoBackupPolicyState = original.GeoBackupPolicyStateDisabled + GeoBackupPolicyStateEnabled GeoBackupPolicyState = original.GeoBackupPolicyStateEnabled +) + +type MaxSizeUnits = original.MaxSizeUnits + +const ( + Gigabytes MaxSizeUnits = original.Gigabytes + Megabytes MaxSizeUnits = original.Megabytes + Petabytes MaxSizeUnits = original.Petabytes + Terabytes MaxSizeUnits = original.Terabytes +) + +type PerformanceLevelUnit = original.PerformanceLevelUnit + +const ( + DTU PerformanceLevelUnit = original.DTU +) + +type PrimaryAggregationType = original.PrimaryAggregationType + +const ( + PrimaryAggregationTypeAverage PrimaryAggregationType = original.PrimaryAggregationTypeAverage + PrimaryAggregationTypeCount PrimaryAggregationType = original.PrimaryAggregationTypeCount + PrimaryAggregationTypeMaximum PrimaryAggregationType = original.PrimaryAggregationTypeMaximum + PrimaryAggregationTypeMinimum PrimaryAggregationType = original.PrimaryAggregationTypeMinimum + PrimaryAggregationTypeNone PrimaryAggregationType = original.PrimaryAggregationTypeNone + PrimaryAggregationTypeTotal PrimaryAggregationType = original.PrimaryAggregationTypeTotal +) + +type QueryAggregationFunction = original.QueryAggregationFunction + +const ( + Avg QueryAggregationFunction = original.Avg + Max QueryAggregationFunction = original.Max + Min QueryAggregationFunction = original.Min + Sum QueryAggregationFunction = original.Sum +) + +type QueryExecutionType = original.QueryExecutionType + +const ( + Aborted QueryExecutionType = original.Aborted + Any QueryExecutionType = original.Any + Exception QueryExecutionType = original.Exception + Irregular QueryExecutionType = original.Irregular + Regular QueryExecutionType = original.Regular +) + +type QueryMetricUnit = original.QueryMetricUnit + +const ( + KB QueryMetricUnit = original.KB + Microseconds QueryMetricUnit = original.Microseconds + Percentage QueryMetricUnit = original.Percentage +) + +type QueryObservedMetricType = original.QueryObservedMetricType + +const ( + CPU QueryObservedMetricType = original.CPU + Duration QueryObservedMetricType = original.Duration + ExecutionCount QueryObservedMetricType = original.ExecutionCount + Io QueryObservedMetricType = original.Io + Logio QueryObservedMetricType = original.Logio ) type ReadScale = original.ReadScale @@ -148,6 +307,13 @@ const ( SUSPENDED ReplicationState = original.SUSPENDED ) +type RestorePointType = original.RestorePointType + +const ( + CONTINUOUS RestorePointType = original.CONTINUOUS + DISCRETE RestorePointType = original.DISCRETE +) + type SampleName = original.SampleName const ( @@ -176,6 +342,28 @@ const ( SecurityAlertPolicyUseServerDefaultEnabled SecurityAlertPolicyUseServerDefault = original.SecurityAlertPolicyUseServerDefaultEnabled ) +type ServerConnectionType = original.ServerConnectionType + +const ( + ServerConnectionTypeDefault ServerConnectionType = original.ServerConnectionTypeDefault + ServerConnectionTypeProxy ServerConnectionType = original.ServerConnectionTypeProxy + ServerConnectionTypeRedirect ServerConnectionType = original.ServerConnectionTypeRedirect +) + +type ServerState = original.ServerState + +const ( + ServerStateDisabled ServerState = original.ServerStateDisabled + ServerStateReady ServerState = original.ServerStateReady +) + +type ServerVersion = original.ServerVersion + +const ( + OneTwoFullStopZero ServerVersion = original.OneTwoFullStopZero + TwoFullStopZero ServerVersion = original.TwoFullStopZero +) + type ServiceObjectiveName = original.ServiceObjectiveName const ( @@ -267,16 +455,70 @@ const ( TransparentDataEncryptionStatusEnabled TransparentDataEncryptionStatus = original.TransparentDataEncryptionStatusEnabled ) +type UnitDefinitionType = original.UnitDefinitionType + +const ( + Bytes UnitDefinitionType = original.Bytes + BytesPerSecond UnitDefinitionType = original.BytesPerSecond + Count UnitDefinitionType = original.Count + CountPerSecond UnitDefinitionType = original.CountPerSecond + Percent UnitDefinitionType = original.Percent + Seconds UnitDefinitionType = original.Seconds +) + +type UnitType = original.UnitType + +const ( + UnitTypeBytes UnitType = original.UnitTypeBytes + UnitTypeBytesPerSecond UnitType = original.UnitTypeBytesPerSecond + UnitTypeCount UnitType = original.UnitTypeCount + UnitTypeCountPerSecond UnitType = original.UnitTypeCountPerSecond + UnitTypePercent UnitType = original.UnitTypePercent + UnitTypeSeconds UnitType = original.UnitTypeSeconds +) + +type Advisor = original.Advisor +type AdvisorListResult = original.AdvisorListResult +type AdvisorProperties = original.AdvisorProperties +type BackupLongTermRetentionPoliciesClient = original.BackupLongTermRetentionPoliciesClient +type BackupLongTermRetentionPoliciesCreateOrUpdateFuture = original.BackupLongTermRetentionPoliciesCreateOrUpdateFuture +type BackupLongTermRetentionPolicy = original.BackupLongTermRetentionPolicy +type BackupLongTermRetentionPolicyListResult = original.BackupLongTermRetentionPolicyListResult +type BackupLongTermRetentionPolicyProperties = original.BackupLongTermRetentionPolicyProperties +type BackupLongTermRetentionVault = original.BackupLongTermRetentionVault +type BackupLongTermRetentionVaultListResult = original.BackupLongTermRetentionVaultListResult +type BackupLongTermRetentionVaultProperties = original.BackupLongTermRetentionVaultProperties +type BackupLongTermRetentionVaultsClient = original.BackupLongTermRetentionVaultsClient +type BackupLongTermRetentionVaultsCreateOrUpdateFuture = original.BackupLongTermRetentionVaultsCreateOrUpdateFuture type BaseClient = original.BaseClient +type CapabilitiesClient = original.CapabilitiesClient type CheckNameAvailabilityRequest = original.CheckNameAvailabilityRequest type CheckNameAvailabilityResponse = original.CheckNameAvailabilityResponse +type DataMaskingPoliciesClient = original.DataMaskingPoliciesClient +type DataMaskingPolicy = original.DataMaskingPolicy +type DataMaskingPolicyProperties = original.DataMaskingPolicyProperties +type DataMaskingRule = original.DataMaskingRule +type DataMaskingRuleListResult = original.DataMaskingRuleListResult +type DataMaskingRuleProperties = original.DataMaskingRuleProperties +type DataMaskingRulesClient = original.DataMaskingRulesClient type Database = original.Database +type DatabaseAdvisorsClient = original.DatabaseAdvisorsClient +type DatabaseConnectionPoliciesClient = original.DatabaseConnectionPoliciesClient +type DatabaseConnectionPolicy = original.DatabaseConnectionPolicy +type DatabaseConnectionPolicyProperties = original.DatabaseConnectionPolicyProperties type DatabaseListResult = original.DatabaseListResult type DatabaseProperties = original.DatabaseProperties type DatabaseSecurityAlertPolicy = original.DatabaseSecurityAlertPolicy type DatabaseSecurityAlertPolicyProperties = original.DatabaseSecurityAlertPolicyProperties +type DatabaseTableAuditingPoliciesClient = original.DatabaseTableAuditingPoliciesClient +type DatabaseTableAuditingPolicy = original.DatabaseTableAuditingPolicy +type DatabaseTableAuditingPolicyListResult = original.DatabaseTableAuditingPolicyListResult +type DatabaseTableAuditingPolicyProperties = original.DatabaseTableAuditingPolicyProperties type DatabaseThreatDetectionPoliciesClient = original.DatabaseThreatDetectionPoliciesClient type DatabaseUpdate = original.DatabaseUpdate +type DatabaseUsage = original.DatabaseUsage +type DatabaseUsageListResult = original.DatabaseUsageListResult +type DatabaseUsagesClient = original.DatabaseUsagesClient type DatabasesClient = original.DatabasesClient type DatabasesCreateImportOperationFuture = original.DatabasesCreateImportOperationFuture type DatabasesCreateOrUpdateFuture = original.DatabasesCreateOrUpdateFuture @@ -285,6 +527,15 @@ type DatabasesImportFuture = original.DatabasesImportFuture type DatabasesPauseFuture = original.DatabasesPauseFuture type DatabasesResumeFuture = original.DatabasesResumeFuture type DatabasesUpdateFuture = original.DatabasesUpdateFuture +type DisasterRecoveryConfiguration = original.DisasterRecoveryConfiguration +type DisasterRecoveryConfigurationListResult = original.DisasterRecoveryConfigurationListResult +type DisasterRecoveryConfigurationProperties = original.DisasterRecoveryConfigurationProperties +type DisasterRecoveryConfigurationsClient = original.DisasterRecoveryConfigurationsClient +type DisasterRecoveryConfigurationsCreateOrUpdateFuture = original.DisasterRecoveryConfigurationsCreateOrUpdateFuture +type DisasterRecoveryConfigurationsDeleteFuture = original.DisasterRecoveryConfigurationsDeleteFuture +type DisasterRecoveryConfigurationsFailoverAllowDataLossFuture = original.DisasterRecoveryConfigurationsFailoverAllowDataLossFuture +type DisasterRecoveryConfigurationsFailoverFuture = original.DisasterRecoveryConfigurationsFailoverFuture +type EditionCapability = original.EditionCapability type ElasticPool = original.ElasticPool type ElasticPoolActivitiesClient = original.ElasticPoolActivitiesClient type ElasticPoolActivity = original.ElasticPoolActivity @@ -294,24 +545,57 @@ type ElasticPoolDatabaseActivitiesClient = original.ElasticPoolDatabaseActivitie type ElasticPoolDatabaseActivity = original.ElasticPoolDatabaseActivity type ElasticPoolDatabaseActivityListResult = original.ElasticPoolDatabaseActivityListResult type ElasticPoolDatabaseActivityProperties = original.ElasticPoolDatabaseActivityProperties +type ElasticPoolDtuCapability = original.ElasticPoolDtuCapability +type ElasticPoolEditionCapability = original.ElasticPoolEditionCapability type ElasticPoolListResult = original.ElasticPoolListResult +type ElasticPoolPerDatabaseMaxDtuCapability = original.ElasticPoolPerDatabaseMaxDtuCapability +type ElasticPoolPerDatabaseMinDtuCapability = original.ElasticPoolPerDatabaseMinDtuCapability type ElasticPoolProperties = original.ElasticPoolProperties type ElasticPoolUpdate = original.ElasticPoolUpdate type ElasticPoolsClient = original.ElasticPoolsClient type ElasticPoolsCreateOrUpdateFuture = original.ElasticPoolsCreateOrUpdateFuture type ElasticPoolsUpdateFuture = original.ElasticPoolsUpdateFuture type ExportRequest = original.ExportRequest +type ExtensionListResult = original.ExtensionListResult +type ExtensionsClient = original.ExtensionsClient type FirewallRule = original.FirewallRule type FirewallRuleListResult = original.FirewallRuleListResult type FirewallRuleProperties = original.FirewallRuleProperties type FirewallRulesClient = original.FirewallRulesClient +type GeoBackupPoliciesClient = original.GeoBackupPoliciesClient +type GeoBackupPolicy = original.GeoBackupPolicy +type GeoBackupPolicyListResult = original.GeoBackupPolicyListResult +type GeoBackupPolicyProperties = original.GeoBackupPolicyProperties type ImportExportResponse = original.ImportExportResponse type ImportExportResponseProperties = original.ImportExportResponseProperties type ImportExtensionProperties = original.ImportExtensionProperties type ImportExtensionRequest = original.ImportExtensionRequest type ImportRequest = original.ImportRequest +type LocationCapabilities = original.LocationCapabilities +type MaxSizeCapability = original.MaxSizeCapability +type Metric = original.Metric +type MetricAvailability = original.MetricAvailability +type MetricDefinition = original.MetricDefinition +type MetricDefinitionListResult = original.MetricDefinitionListResult +type MetricListResult = original.MetricListResult +type MetricName = original.MetricName +type MetricValue = original.MetricValue +type Operation = original.Operation +type OperationDisplay = original.OperationDisplay type OperationImpact = original.OperationImpact +type OperationListResult = original.OperationListResult +type OperationsClient = original.OperationsClient +type PerformanceLevel = original.PerformanceLevel type ProxyResource = original.ProxyResource +type QueriesClient = original.QueriesClient +type QueryInterval = original.QueryInterval +type QueryMetric = original.QueryMetric +type QueryStatistic = original.QueryStatistic +type QueryStatisticListResult = original.QueryStatisticListResult +type QueryStatisticsClient = original.QueryStatisticsClient +type QueryText = original.QueryText +type QueryTextListResult = original.QueryTextListResult +type QueryTextsClient = original.QueryTextsClient type RecommendedElasticPool = original.RecommendedElasticPool type RecommendedElasticPoolListMetricsResult = original.RecommendedElasticPoolListMetricsResult type RecommendedElasticPoolListResult = original.RecommendedElasticPoolListResult @@ -320,6 +604,10 @@ type RecommendedElasticPoolProperties = original.RecommendedElasticPoolPropertie type RecommendedElasticPoolsClient = original.RecommendedElasticPoolsClient type RecommendedIndex = original.RecommendedIndex type RecommendedIndexProperties = original.RecommendedIndexProperties +type RecoverableDatabase = original.RecoverableDatabase +type RecoverableDatabaseListResult = original.RecoverableDatabaseListResult +type RecoverableDatabaseProperties = original.RecoverableDatabaseProperties +type RecoverableDatabasesClient = original.RecoverableDatabasesClient type ReplicationLink = original.ReplicationLink type ReplicationLinkListResult = original.ReplicationLinkListResult type ReplicationLinkProperties = original.ReplicationLinkProperties @@ -327,36 +615,141 @@ type ReplicationLinksClient = original.ReplicationLinksClient type ReplicationLinksFailoverAllowDataLossFuture = original.ReplicationLinksFailoverAllowDataLossFuture type ReplicationLinksFailoverFuture = original.ReplicationLinksFailoverFuture type Resource = original.Resource +type RestorableDroppedDatabase = original.RestorableDroppedDatabase +type RestorableDroppedDatabaseListResult = original.RestorableDroppedDatabaseListResult +type RestorableDroppedDatabaseProperties = original.RestorableDroppedDatabaseProperties +type RestorableDroppedDatabasesClient = original.RestorableDroppedDatabasesClient +type RestorePoint = original.RestorePoint +type RestorePointListResult = original.RestorePointListResult +type RestorePointProperties = original.RestorePointProperties +type RestorePointsClient = original.RestorePointsClient +type Server = original.Server +type ServerAdministratorListResult = original.ServerAdministratorListResult +type ServerAdministratorProperties = original.ServerAdministratorProperties +type ServerAdvisorsClient = original.ServerAdvisorsClient +type ServerAzureADAdministrator = original.ServerAzureADAdministrator +type ServerAzureADAdministratorsClient = original.ServerAzureADAdministratorsClient +type ServerAzureADAdministratorsCreateOrUpdateFuture = original.ServerAzureADAdministratorsCreateOrUpdateFuture +type ServerAzureADAdministratorsDeleteFuture = original.ServerAzureADAdministratorsDeleteFuture +type ServerCommunicationLink = original.ServerCommunicationLink +type ServerCommunicationLinkListResult = original.ServerCommunicationLinkListResult +type ServerCommunicationLinkProperties = original.ServerCommunicationLinkProperties +type ServerCommunicationLinksClient = original.ServerCommunicationLinksClient +type ServerCommunicationLinksCreateOrUpdateFuture = original.ServerCommunicationLinksCreateOrUpdateFuture +type ServerConnectionPoliciesClient = original.ServerConnectionPoliciesClient +type ServerConnectionPolicy = original.ServerConnectionPolicy +type ServerConnectionPolicyProperties = original.ServerConnectionPolicyProperties +type ServerListResult = original.ServerListResult +type ServerProperties = original.ServerProperties +type ServerTableAuditingPoliciesClient = original.ServerTableAuditingPoliciesClient +type ServerTableAuditingPolicy = original.ServerTableAuditingPolicy +type ServerTableAuditingPolicyListResult = original.ServerTableAuditingPolicyListResult +type ServerTableAuditingPolicyProperties = original.ServerTableAuditingPolicyProperties +type ServerUpdate = original.ServerUpdate +type ServerUsage = original.ServerUsage +type ServerUsageListResult = original.ServerUsageListResult +type ServerUsagesClient = original.ServerUsagesClient +type ServerVersionCapability = original.ServerVersionCapability type ServersClient = original.ServersClient +type ServiceObjective = original.ServiceObjective +type ServiceObjectiveCapability = original.ServiceObjectiveCapability +type ServiceObjectiveListResult = original.ServiceObjectiveListResult +type ServiceObjectiveProperties = original.ServiceObjectiveProperties +type ServiceObjectivesClient = original.ServiceObjectivesClient type ServiceTierAdvisor = original.ServiceTierAdvisor type ServiceTierAdvisorListResult = original.ServiceTierAdvisorListResult type ServiceTierAdvisorProperties = original.ServiceTierAdvisorProperties type ServiceTierAdvisorsClient = original.ServiceTierAdvisorsClient type SloUsageMetric = original.SloUsageMetric +type TableAuditingPolicyProperties = original.TableAuditingPolicyProperties +type TopQueries = original.TopQueries +type TopQueriesListResult = original.TopQueriesListResult type TrackedResource = original.TrackedResource type TransparentDataEncryption = original.TransparentDataEncryption type TransparentDataEncryptionActivitiesClient = original.TransparentDataEncryptionActivitiesClient type TransparentDataEncryptionActivity = original.TransparentDataEncryptionActivity type TransparentDataEncryptionActivityListResult = original.TransparentDataEncryptionActivityListResult type TransparentDataEncryptionActivityProperties = original.TransparentDataEncryptionActivityProperties +type TransparentDataEncryptionConfigurationsClient = original.TransparentDataEncryptionConfigurationsClient +type TransparentDataEncryptionListResult = original.TransparentDataEncryptionListResult type TransparentDataEncryptionProperties = original.TransparentDataEncryptionProperties type TransparentDataEncryptionsClient = original.TransparentDataEncryptionsClient func New(subscriptionID string) BaseClient { return original.New(subscriptionID) } +func NewBackupLongTermRetentionPoliciesClient(subscriptionID string) BackupLongTermRetentionPoliciesClient { + return original.NewBackupLongTermRetentionPoliciesClient(subscriptionID) +} +func NewBackupLongTermRetentionPoliciesClientWithBaseURI(baseURI string, subscriptionID string) BackupLongTermRetentionPoliciesClient { + return original.NewBackupLongTermRetentionPoliciesClientWithBaseURI(baseURI, subscriptionID) +} +func NewBackupLongTermRetentionVaultsClient(subscriptionID string) BackupLongTermRetentionVaultsClient { + return original.NewBackupLongTermRetentionVaultsClient(subscriptionID) +} +func NewBackupLongTermRetentionVaultsClientWithBaseURI(baseURI string, subscriptionID string) BackupLongTermRetentionVaultsClient { + return original.NewBackupLongTermRetentionVaultsClientWithBaseURI(baseURI, subscriptionID) +} +func NewCapabilitiesClient(subscriptionID string) CapabilitiesClient { + return original.NewCapabilitiesClient(subscriptionID) +} +func NewCapabilitiesClientWithBaseURI(baseURI string, subscriptionID string) CapabilitiesClient { + return original.NewCapabilitiesClientWithBaseURI(baseURI, subscriptionID) +} +func NewDataMaskingPoliciesClient(subscriptionID string) DataMaskingPoliciesClient { + return original.NewDataMaskingPoliciesClient(subscriptionID) +} +func NewDataMaskingPoliciesClientWithBaseURI(baseURI string, subscriptionID string) DataMaskingPoliciesClient { + return original.NewDataMaskingPoliciesClientWithBaseURI(baseURI, subscriptionID) +} +func NewDataMaskingRulesClient(subscriptionID string) DataMaskingRulesClient { + return original.NewDataMaskingRulesClient(subscriptionID) +} +func NewDataMaskingRulesClientWithBaseURI(baseURI string, subscriptionID string) DataMaskingRulesClient { + return original.NewDataMaskingRulesClientWithBaseURI(baseURI, subscriptionID) +} +func NewDatabaseAdvisorsClient(subscriptionID string) DatabaseAdvisorsClient { + return original.NewDatabaseAdvisorsClient(subscriptionID) +} +func NewDatabaseAdvisorsClientWithBaseURI(baseURI string, subscriptionID string) DatabaseAdvisorsClient { + return original.NewDatabaseAdvisorsClientWithBaseURI(baseURI, subscriptionID) +} +func NewDatabaseConnectionPoliciesClient(subscriptionID string) DatabaseConnectionPoliciesClient { + return original.NewDatabaseConnectionPoliciesClient(subscriptionID) +} +func NewDatabaseConnectionPoliciesClientWithBaseURI(baseURI string, subscriptionID string) DatabaseConnectionPoliciesClient { + return original.NewDatabaseConnectionPoliciesClientWithBaseURI(baseURI, subscriptionID) +} +func NewDatabaseTableAuditingPoliciesClient(subscriptionID string) DatabaseTableAuditingPoliciesClient { + return original.NewDatabaseTableAuditingPoliciesClient(subscriptionID) +} +func NewDatabaseTableAuditingPoliciesClientWithBaseURI(baseURI string, subscriptionID string) DatabaseTableAuditingPoliciesClient { + return original.NewDatabaseTableAuditingPoliciesClientWithBaseURI(baseURI, subscriptionID) +} func NewDatabaseThreatDetectionPoliciesClient(subscriptionID string) DatabaseThreatDetectionPoliciesClient { return original.NewDatabaseThreatDetectionPoliciesClient(subscriptionID) } func NewDatabaseThreatDetectionPoliciesClientWithBaseURI(baseURI string, subscriptionID string) DatabaseThreatDetectionPoliciesClient { return original.NewDatabaseThreatDetectionPoliciesClientWithBaseURI(baseURI, subscriptionID) } +func NewDatabaseUsagesClient(subscriptionID string) DatabaseUsagesClient { + return original.NewDatabaseUsagesClient(subscriptionID) +} +func NewDatabaseUsagesClientWithBaseURI(baseURI string, subscriptionID string) DatabaseUsagesClient { + return original.NewDatabaseUsagesClientWithBaseURI(baseURI, subscriptionID) +} func NewDatabasesClient(subscriptionID string) DatabasesClient { return original.NewDatabasesClient(subscriptionID) } func NewDatabasesClientWithBaseURI(baseURI string, subscriptionID string) DatabasesClient { return original.NewDatabasesClientWithBaseURI(baseURI, subscriptionID) } +func NewDisasterRecoveryConfigurationsClient(subscriptionID string) DisasterRecoveryConfigurationsClient { + return original.NewDisasterRecoveryConfigurationsClient(subscriptionID) +} +func NewDisasterRecoveryConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) DisasterRecoveryConfigurationsClient { + return original.NewDisasterRecoveryConfigurationsClientWithBaseURI(baseURI, subscriptionID) +} func NewElasticPoolActivitiesClient(subscriptionID string) ElasticPoolActivitiesClient { return original.NewElasticPoolActivitiesClient(subscriptionID) } @@ -375,30 +768,126 @@ func NewElasticPoolsClient(subscriptionID string) ElasticPoolsClient { func NewElasticPoolsClientWithBaseURI(baseURI string, subscriptionID string) ElasticPoolsClient { return original.NewElasticPoolsClientWithBaseURI(baseURI, subscriptionID) } +func NewExtensionsClient(subscriptionID string) ExtensionsClient { + return original.NewExtensionsClient(subscriptionID) +} +func NewExtensionsClientWithBaseURI(baseURI string, subscriptionID string) ExtensionsClient { + return original.NewExtensionsClientWithBaseURI(baseURI, subscriptionID) +} func NewFirewallRulesClient(subscriptionID string) FirewallRulesClient { return original.NewFirewallRulesClient(subscriptionID) } func NewFirewallRulesClientWithBaseURI(baseURI string, subscriptionID string) FirewallRulesClient { return original.NewFirewallRulesClientWithBaseURI(baseURI, subscriptionID) } +func NewGeoBackupPoliciesClient(subscriptionID string) GeoBackupPoliciesClient { + return original.NewGeoBackupPoliciesClient(subscriptionID) +} +func NewGeoBackupPoliciesClientWithBaseURI(baseURI string, subscriptionID string) GeoBackupPoliciesClient { + return original.NewGeoBackupPoliciesClientWithBaseURI(baseURI, subscriptionID) +} +func NewOperationsClient(subscriptionID string) OperationsClient { + return original.NewOperationsClient(subscriptionID) +} +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) +} +func NewQueriesClient(subscriptionID string) QueriesClient { + return original.NewQueriesClient(subscriptionID) +} +func NewQueriesClientWithBaseURI(baseURI string, subscriptionID string) QueriesClient { + return original.NewQueriesClientWithBaseURI(baseURI, subscriptionID) +} +func NewQueryStatisticsClient(subscriptionID string) QueryStatisticsClient { + return original.NewQueryStatisticsClient(subscriptionID) +} +func NewQueryStatisticsClientWithBaseURI(baseURI string, subscriptionID string) QueryStatisticsClient { + return original.NewQueryStatisticsClientWithBaseURI(baseURI, subscriptionID) +} +func NewQueryTextsClient(subscriptionID string) QueryTextsClient { + return original.NewQueryTextsClient(subscriptionID) +} +func NewQueryTextsClientWithBaseURI(baseURI string, subscriptionID string) QueryTextsClient { + return original.NewQueryTextsClientWithBaseURI(baseURI, subscriptionID) +} func NewRecommendedElasticPoolsClient(subscriptionID string) RecommendedElasticPoolsClient { return original.NewRecommendedElasticPoolsClient(subscriptionID) } func NewRecommendedElasticPoolsClientWithBaseURI(baseURI string, subscriptionID string) RecommendedElasticPoolsClient { return original.NewRecommendedElasticPoolsClientWithBaseURI(baseURI, subscriptionID) } +func NewRecoverableDatabasesClient(subscriptionID string) RecoverableDatabasesClient { + return original.NewRecoverableDatabasesClient(subscriptionID) +} +func NewRecoverableDatabasesClientWithBaseURI(baseURI string, subscriptionID string) RecoverableDatabasesClient { + return original.NewRecoverableDatabasesClientWithBaseURI(baseURI, subscriptionID) +} func NewReplicationLinksClient(subscriptionID string) ReplicationLinksClient { return original.NewReplicationLinksClient(subscriptionID) } func NewReplicationLinksClientWithBaseURI(baseURI string, subscriptionID string) ReplicationLinksClient { return original.NewReplicationLinksClientWithBaseURI(baseURI, subscriptionID) } +func NewRestorableDroppedDatabasesClient(subscriptionID string) RestorableDroppedDatabasesClient { + return original.NewRestorableDroppedDatabasesClient(subscriptionID) +} +func NewRestorableDroppedDatabasesClientWithBaseURI(baseURI string, subscriptionID string) RestorableDroppedDatabasesClient { + return original.NewRestorableDroppedDatabasesClientWithBaseURI(baseURI, subscriptionID) +} +func NewRestorePointsClient(subscriptionID string) RestorePointsClient { + return original.NewRestorePointsClient(subscriptionID) +} +func NewRestorePointsClientWithBaseURI(baseURI string, subscriptionID string) RestorePointsClient { + return original.NewRestorePointsClientWithBaseURI(baseURI, subscriptionID) +} +func NewServerAdvisorsClient(subscriptionID string) ServerAdvisorsClient { + return original.NewServerAdvisorsClient(subscriptionID) +} +func NewServerAdvisorsClientWithBaseURI(baseURI string, subscriptionID string) ServerAdvisorsClient { + return original.NewServerAdvisorsClientWithBaseURI(baseURI, subscriptionID) +} +func NewServerAzureADAdministratorsClient(subscriptionID string) ServerAzureADAdministratorsClient { + return original.NewServerAzureADAdministratorsClient(subscriptionID) +} +func NewServerAzureADAdministratorsClientWithBaseURI(baseURI string, subscriptionID string) ServerAzureADAdministratorsClient { + return original.NewServerAzureADAdministratorsClientWithBaseURI(baseURI, subscriptionID) +} +func NewServerCommunicationLinksClient(subscriptionID string) ServerCommunicationLinksClient { + return original.NewServerCommunicationLinksClient(subscriptionID) +} +func NewServerCommunicationLinksClientWithBaseURI(baseURI string, subscriptionID string) ServerCommunicationLinksClient { + return original.NewServerCommunicationLinksClientWithBaseURI(baseURI, subscriptionID) +} +func NewServerConnectionPoliciesClient(subscriptionID string) ServerConnectionPoliciesClient { + return original.NewServerConnectionPoliciesClient(subscriptionID) +} +func NewServerConnectionPoliciesClientWithBaseURI(baseURI string, subscriptionID string) ServerConnectionPoliciesClient { + return original.NewServerConnectionPoliciesClientWithBaseURI(baseURI, subscriptionID) +} +func NewServerTableAuditingPoliciesClient(subscriptionID string) ServerTableAuditingPoliciesClient { + return original.NewServerTableAuditingPoliciesClient(subscriptionID) +} +func NewServerTableAuditingPoliciesClientWithBaseURI(baseURI string, subscriptionID string) ServerTableAuditingPoliciesClient { + return original.NewServerTableAuditingPoliciesClientWithBaseURI(baseURI, subscriptionID) +} +func NewServerUsagesClient(subscriptionID string) ServerUsagesClient { + return original.NewServerUsagesClient(subscriptionID) +} +func NewServerUsagesClientWithBaseURI(baseURI string, subscriptionID string) ServerUsagesClient { + return original.NewServerUsagesClientWithBaseURI(baseURI, subscriptionID) +} func NewServersClient(subscriptionID string) ServersClient { return original.NewServersClient(subscriptionID) } func NewServersClientWithBaseURI(baseURI string, subscriptionID string) ServersClient { return original.NewServersClientWithBaseURI(baseURI, subscriptionID) } +func NewServiceObjectivesClient(subscriptionID string) ServiceObjectivesClient { + return original.NewServiceObjectivesClient(subscriptionID) +} +func NewServiceObjectivesClientWithBaseURI(baseURI string, subscriptionID string) ServiceObjectivesClient { + return original.NewServiceObjectivesClientWithBaseURI(baseURI, subscriptionID) +} func NewServiceTierAdvisorsClient(subscriptionID string) ServiceTierAdvisorsClient { return original.NewServiceTierAdvisorsClient(subscriptionID) } @@ -411,6 +900,12 @@ func NewTransparentDataEncryptionActivitiesClient(subscriptionID string) Transpa func NewTransparentDataEncryptionActivitiesClientWithBaseURI(baseURI string, subscriptionID string) TransparentDataEncryptionActivitiesClient { return original.NewTransparentDataEncryptionActivitiesClientWithBaseURI(baseURI, subscriptionID) } +func NewTransparentDataEncryptionConfigurationsClient(subscriptionID string) TransparentDataEncryptionConfigurationsClient { + return original.NewTransparentDataEncryptionConfigurationsClient(subscriptionID) +} +func NewTransparentDataEncryptionConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) TransparentDataEncryptionConfigurationsClient { + return original.NewTransparentDataEncryptionConfigurationsClientWithBaseURI(baseURI, subscriptionID) +} func NewTransparentDataEncryptionsClient(subscriptionID string) TransparentDataEncryptionsClient { return original.NewTransparentDataEncryptionsClient(subscriptionID) } @@ -420,24 +915,81 @@ func NewTransparentDataEncryptionsClientWithBaseURI(baseURI string, subscription func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { return original.NewWithBaseURI(baseURI, subscriptionID) } +func PossibleAdvisorStatusValues() []AdvisorStatus { + return original.PossibleAdvisorStatusValues() +} func PossibleAuthenticationTypeValues() []AuthenticationType { return original.PossibleAuthenticationTypeValues() } +func PossibleAutoExecuteStatusValues() []AutoExecuteStatus { + return original.PossibleAutoExecuteStatusValues() +} +func PossibleBackupLongTermRetentionPolicyStateValues() []BackupLongTermRetentionPolicyState { + return original.PossibleBackupLongTermRetentionPolicyStateValues() +} +func PossibleCapabilityStatusValues() []CapabilityStatus { + return original.PossibleCapabilityStatusValues() +} func PossibleCheckNameAvailabilityReasonValues() []CheckNameAvailabilityReason { return original.PossibleCheckNameAvailabilityReasonValues() } func PossibleCreateModeValues() []CreateMode { return original.PossibleCreateModeValues() } +func PossibleDataMaskingFunctionValues() []DataMaskingFunction { + return original.PossibleDataMaskingFunctionValues() +} +func PossibleDataMaskingRuleStateValues() []DataMaskingRuleState { + return original.PossibleDataMaskingRuleStateValues() +} +func PossibleDataMaskingStateValues() []DataMaskingState { + return original.PossibleDataMaskingStateValues() +} func PossibleDatabaseEditionValues() []DatabaseEdition { return original.PossibleDatabaseEditionValues() } +func PossibleDisasterRecoveryConfigurationAutoFailoverValues() []DisasterRecoveryConfigurationAutoFailover { + return original.PossibleDisasterRecoveryConfigurationAutoFailoverValues() +} +func PossibleDisasterRecoveryConfigurationFailoverPolicyValues() []DisasterRecoveryConfigurationFailoverPolicy { + return original.PossibleDisasterRecoveryConfigurationFailoverPolicyValues() +} +func PossibleDisasterRecoveryConfigurationRoleValues() []DisasterRecoveryConfigurationRole { + return original.PossibleDisasterRecoveryConfigurationRoleValues() +} +func PossibleDisasterRecoveryConfigurationStatusValues() []DisasterRecoveryConfigurationStatus { + return original.PossibleDisasterRecoveryConfigurationStatusValues() +} func PossibleElasticPoolEditionValues() []ElasticPoolEdition { return original.PossibleElasticPoolEditionValues() } func PossibleElasticPoolStateValues() []ElasticPoolState { return original.PossibleElasticPoolStateValues() } +func PossibleGeoBackupPolicyStateValues() []GeoBackupPolicyState { + return original.PossibleGeoBackupPolicyStateValues() +} +func PossibleMaxSizeUnitsValues() []MaxSizeUnits { + return original.PossibleMaxSizeUnitsValues() +} +func PossiblePerformanceLevelUnitValues() []PerformanceLevelUnit { + return original.PossiblePerformanceLevelUnitValues() +} +func PossiblePrimaryAggregationTypeValues() []PrimaryAggregationType { + return original.PossiblePrimaryAggregationTypeValues() +} +func PossibleQueryAggregationFunctionValues() []QueryAggregationFunction { + return original.PossibleQueryAggregationFunctionValues() +} +func PossibleQueryExecutionTypeValues() []QueryExecutionType { + return original.PossibleQueryExecutionTypeValues() +} +func PossibleQueryMetricUnitValues() []QueryMetricUnit { + return original.PossibleQueryMetricUnitValues() +} +func PossibleQueryObservedMetricTypeValues() []QueryObservedMetricType { + return original.PossibleQueryObservedMetricTypeValues() +} func PossibleReadScaleValues() []ReadScale { return original.PossibleReadScaleValues() } @@ -456,6 +1008,9 @@ func PossibleReplicationRoleValues() []ReplicationRole { func PossibleReplicationStateValues() []ReplicationState { return original.PossibleReplicationStateValues() } +func PossibleRestorePointTypeValues() []RestorePointType { + return original.PossibleRestorePointTypeValues() +} func PossibleSampleNameValues() []SampleName { return original.PossibleSampleNameValues() } @@ -468,6 +1023,15 @@ func PossibleSecurityAlertPolicyStateValues() []SecurityAlertPolicyState { func PossibleSecurityAlertPolicyUseServerDefaultValues() []SecurityAlertPolicyUseServerDefault { return original.PossibleSecurityAlertPolicyUseServerDefaultValues() } +func PossibleServerConnectionTypeValues() []ServerConnectionType { + return original.PossibleServerConnectionTypeValues() +} +func PossibleServerStateValues() []ServerState { + return original.PossibleServerStateValues() +} +func PossibleServerVersionValues() []ServerVersion { + return original.PossibleServerVersionValues() +} func PossibleServiceObjectiveNameValues() []ServiceObjectiveName { return original.PossibleServiceObjectiveNameValues() } @@ -480,6 +1044,12 @@ func PossibleTransparentDataEncryptionActivityStatusValues() []TransparentDataEn func PossibleTransparentDataEncryptionStatusValues() []TransparentDataEncryptionStatus { return original.PossibleTransparentDataEncryptionStatusValues() } +func PossibleUnitDefinitionTypeValues() []UnitDefinitionType { + return original.PossibleUnitDefinitionTypeValues() +} +func PossibleUnitTypeValues() []UnitType { + return original.PossibleUnitTypeValues() +} func UserAgent() string { return original.UserAgent() + " profiles/latest" } diff --git a/profiles/latest/sql/mgmt/sql/sqlapi/models.go b/profiles/latest/sql/mgmt/sql/sqlapi/models.go index 8a1a24d93635..d641097b6ea9 100644 --- a/profiles/latest/sql/mgmt/sql/sqlapi/models.go +++ b/profiles/latest/sql/mgmt/sql/sqlapi/models.go @@ -21,15 +21,42 @@ package sqlapi import original "github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2014-04-01/sql/sqlapi" +type BackupLongTermRetentionPoliciesClientAPI = original.BackupLongTermRetentionPoliciesClientAPI +type BackupLongTermRetentionVaultsClientAPI = original.BackupLongTermRetentionVaultsClientAPI +type CapabilitiesClientAPI = original.CapabilitiesClientAPI +type DataMaskingPoliciesClientAPI = original.DataMaskingPoliciesClientAPI +type DataMaskingRulesClientAPI = original.DataMaskingRulesClientAPI +type DatabaseAdvisorsClientAPI = original.DatabaseAdvisorsClientAPI +type DatabaseConnectionPoliciesClientAPI = original.DatabaseConnectionPoliciesClientAPI +type DatabaseTableAuditingPoliciesClientAPI = original.DatabaseTableAuditingPoliciesClientAPI type DatabaseThreatDetectionPoliciesClientAPI = original.DatabaseThreatDetectionPoliciesClientAPI +type DatabaseUsagesClientAPI = original.DatabaseUsagesClientAPI type DatabasesClientAPI = original.DatabasesClientAPI +type DisasterRecoveryConfigurationsClientAPI = original.DisasterRecoveryConfigurationsClientAPI type ElasticPoolActivitiesClientAPI = original.ElasticPoolActivitiesClientAPI type ElasticPoolDatabaseActivitiesClientAPI = original.ElasticPoolDatabaseActivitiesClientAPI type ElasticPoolsClientAPI = original.ElasticPoolsClientAPI +type ExtensionsClientAPI = original.ExtensionsClientAPI type FirewallRulesClientAPI = original.FirewallRulesClientAPI +type GeoBackupPoliciesClientAPI = original.GeoBackupPoliciesClientAPI +type OperationsClientAPI = original.OperationsClientAPI +type QueriesClientAPI = original.QueriesClientAPI +type QueryStatisticsClientAPI = original.QueryStatisticsClientAPI +type QueryTextsClientAPI = original.QueryTextsClientAPI type RecommendedElasticPoolsClientAPI = original.RecommendedElasticPoolsClientAPI +type RecoverableDatabasesClientAPI = original.RecoverableDatabasesClientAPI type ReplicationLinksClientAPI = original.ReplicationLinksClientAPI +type RestorableDroppedDatabasesClientAPI = original.RestorableDroppedDatabasesClientAPI +type RestorePointsClientAPI = original.RestorePointsClientAPI +type ServerAdvisorsClientAPI = original.ServerAdvisorsClientAPI +type ServerAzureADAdministratorsClientAPI = original.ServerAzureADAdministratorsClientAPI +type ServerCommunicationLinksClientAPI = original.ServerCommunicationLinksClientAPI +type ServerConnectionPoliciesClientAPI = original.ServerConnectionPoliciesClientAPI +type ServerTableAuditingPoliciesClientAPI = original.ServerTableAuditingPoliciesClientAPI +type ServerUsagesClientAPI = original.ServerUsagesClientAPI type ServersClientAPI = original.ServersClientAPI +type ServiceObjectivesClientAPI = original.ServiceObjectivesClientAPI type ServiceTierAdvisorsClientAPI = original.ServiceTierAdvisorsClientAPI type TransparentDataEncryptionActivitiesClientAPI = original.TransparentDataEncryptionActivitiesClientAPI +type TransparentDataEncryptionConfigurationsClientAPI = original.TransparentDataEncryptionConfigurationsClientAPI type TransparentDataEncryptionsClientAPI = original.TransparentDataEncryptionsClientAPI diff --git a/profiles/latest/storagecache/mgmt/storagecache/models.go b/profiles/latest/storagecache/mgmt/storagecache/models.go new file mode 100644 index 000000000000..c7027d13d7da --- /dev/null +++ b/profiles/latest/storagecache/mgmt/storagecache/models.go @@ -0,0 +1,217 @@ +// +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 storagecache + +import ( + "context" + + original "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2019-11-01/storagecache" +) + +const ( + DefaultBaseURI = original.DefaultBaseURI +) + +type FirmwareStatusType = original.FirmwareStatusType + +const ( + Available FirmwareStatusType = original.Available + Unavailable FirmwareStatusType = original.Unavailable +) + +type HealthStateType = original.HealthStateType + +const ( + Degraded HealthStateType = original.Degraded + Down HealthStateType = original.Down + Flushing HealthStateType = original.Flushing + Healthy HealthStateType = original.Healthy + Stopped HealthStateType = original.Stopped + Stopping HealthStateType = original.Stopping + Transitioning HealthStateType = original.Transitioning + Unknown HealthStateType = original.Unknown + Upgrading HealthStateType = original.Upgrading +) + +type ProvisioningStateType = original.ProvisioningStateType + +const ( + Cancelled ProvisioningStateType = original.Cancelled + Creating ProvisioningStateType = original.Creating + Deleting ProvisioningStateType = original.Deleting + Failed ProvisioningStateType = original.Failed + Succeeded ProvisioningStateType = original.Succeeded + Updating ProvisioningStateType = original.Updating +) + +type ReasonCode = original.ReasonCode + +const ( + NotAvailableForSubscription ReasonCode = original.NotAvailableForSubscription + QuotaID ReasonCode = original.QuotaID +) + +type StorageTargetType = original.StorageTargetType + +const ( + StorageTargetTypeClfs StorageTargetType = original.StorageTargetTypeClfs + StorageTargetTypeNfs3 StorageTargetType = original.StorageTargetTypeNfs3 + StorageTargetTypeUnknown StorageTargetType = original.StorageTargetTypeUnknown +) + +type APIOperation = original.APIOperation +type APIOperationDisplay = original.APIOperationDisplay +type APIOperationListResult = original.APIOperationListResult +type APIOperationListResultIterator = original.APIOperationListResultIterator +type APIOperationListResultPage = original.APIOperationListResultPage +type BaseClient = original.BaseClient +type Cache = original.Cache +type CacheHealth = original.CacheHealth +type CacheProperties = original.CacheProperties +type CacheSku = original.CacheSku +type CacheUpgradeStatus = original.CacheUpgradeStatus +type CachesClient = original.CachesClient +type CachesCreateOrUpdateFuture = original.CachesCreateOrUpdateFuture +type CachesDeleteFuture = original.CachesDeleteFuture +type CachesFlushFuture = original.CachesFlushFuture +type CachesListResult = original.CachesListResult +type CachesListResultIterator = original.CachesListResultIterator +type CachesListResultPage = original.CachesListResultPage +type CachesStartFuture = original.CachesStartFuture +type CachesStopFuture = original.CachesStopFuture +type CachesUpgradeFirmwareFuture = original.CachesUpgradeFirmwareFuture +type ClfsTarget = original.ClfsTarget +type CloudError = original.CloudError +type CloudErrorBody = original.CloudErrorBody +type NamespaceJunction = original.NamespaceJunction +type Nfs3Target = original.Nfs3Target +type OperationsClient = original.OperationsClient +type ResourceSku = original.ResourceSku +type ResourceSkuCapabilities = original.ResourceSkuCapabilities +type ResourceSkuLocationInfo = original.ResourceSkuLocationInfo +type ResourceSkusResult = original.ResourceSkusResult +type ResourceSkusResultIterator = original.ResourceSkusResultIterator +type ResourceSkusResultPage = original.ResourceSkusResultPage +type Restriction = original.Restriction +type SetObject = original.SetObject +type SkusClient = original.SkusClient +type StorageTarget = original.StorageTarget +type StorageTargetProperties = original.StorageTargetProperties +type StorageTargetsClient = original.StorageTargetsClient +type StorageTargetsCreateOrUpdateFuture = original.StorageTargetsCreateOrUpdateFuture +type StorageTargetsDeleteFuture = original.StorageTargetsDeleteFuture +type StorageTargetsResult = original.StorageTargetsResult +type StorageTargetsResultIterator = original.StorageTargetsResultIterator +type StorageTargetsResultPage = original.StorageTargetsResultPage +type UnknownTarget = original.UnknownTarget +type UsageModel = original.UsageModel +type UsageModelDisplay = original.UsageModelDisplay +type UsageModelsClient = original.UsageModelsClient +type UsageModelsResult = original.UsageModelsResult +type UsageModelsResultIterator = original.UsageModelsResultIterator +type UsageModelsResultPage = original.UsageModelsResultPage + +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 NewCachesClient(subscriptionID string) CachesClient { + return original.NewCachesClient(subscriptionID) +} +func NewCachesClientWithBaseURI(baseURI string, subscriptionID string) CachesClient { + return original.NewCachesClientWithBaseURI(baseURI, subscriptionID) +} +func NewCachesListResultIterator(page CachesListResultPage) CachesListResultIterator { + return original.NewCachesListResultIterator(page) +} +func NewCachesListResultPage(getNextPage func(context.Context, CachesListResult) (CachesListResult, error)) CachesListResultPage { + return original.NewCachesListResultPage(getNextPage) +} +func NewOperationsClient(subscriptionID string) OperationsClient { + return original.NewOperationsClient(subscriptionID) +} +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) +} +func NewResourceSkusResultIterator(page ResourceSkusResultPage) ResourceSkusResultIterator { + return original.NewResourceSkusResultIterator(page) +} +func NewResourceSkusResultPage(getNextPage func(context.Context, ResourceSkusResult) (ResourceSkusResult, error)) ResourceSkusResultPage { + return original.NewResourceSkusResultPage(getNextPage) +} +func NewSkusClient(subscriptionID string) SkusClient { + return original.NewSkusClient(subscriptionID) +} +func NewSkusClientWithBaseURI(baseURI string, subscriptionID string) SkusClient { + return original.NewSkusClientWithBaseURI(baseURI, subscriptionID) +} +func NewStorageTargetsClient(subscriptionID string) StorageTargetsClient { + return original.NewStorageTargetsClient(subscriptionID) +} +func NewStorageTargetsClientWithBaseURI(baseURI string, subscriptionID string) StorageTargetsClient { + return original.NewStorageTargetsClientWithBaseURI(baseURI, subscriptionID) +} +func NewStorageTargetsResultIterator(page StorageTargetsResultPage) StorageTargetsResultIterator { + return original.NewStorageTargetsResultIterator(page) +} +func NewStorageTargetsResultPage(getNextPage func(context.Context, StorageTargetsResult) (StorageTargetsResult, error)) StorageTargetsResultPage { + return original.NewStorageTargetsResultPage(getNextPage) +} +func NewUsageModelsClient(subscriptionID string) UsageModelsClient { + return original.NewUsageModelsClient(subscriptionID) +} +func NewUsageModelsClientWithBaseURI(baseURI string, subscriptionID string) UsageModelsClient { + return original.NewUsageModelsClientWithBaseURI(baseURI, subscriptionID) +} +func NewUsageModelsResultIterator(page UsageModelsResultPage) UsageModelsResultIterator { + return original.NewUsageModelsResultIterator(page) +} +func NewUsageModelsResultPage(getNextPage func(context.Context, UsageModelsResult) (UsageModelsResult, error)) UsageModelsResultPage { + return original.NewUsageModelsResultPage(getNextPage) +} +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return original.NewWithBaseURI(baseURI, subscriptionID) +} +func PossibleFirmwareStatusTypeValues() []FirmwareStatusType { + return original.PossibleFirmwareStatusTypeValues() +} +func PossibleHealthStateTypeValues() []HealthStateType { + return original.PossibleHealthStateTypeValues() +} +func PossibleProvisioningStateTypeValues() []ProvisioningStateType { + return original.PossibleProvisioningStateTypeValues() +} +func PossibleReasonCodeValues() []ReasonCode { + return original.PossibleReasonCodeValues() +} +func PossibleStorageTargetTypeValues() []StorageTargetType { + return original.PossibleStorageTargetTypeValues() +} +func UserAgent() string { + return original.UserAgent() + " profiles/latest" +} +func Version() string { + return original.Version() +} diff --git a/profiles/latest/storagecache/mgmt/storagecache/storagecacheapi/models.go b/profiles/latest/storagecache/mgmt/storagecache/storagecacheapi/models.go new file mode 100644 index 000000000000..77b8ab88ba0b --- /dev/null +++ b/profiles/latest/storagecache/mgmt/storagecache/storagecacheapi/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 storagecacheapi + +import original "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2019-11-01/storagecache/storagecacheapi" + +type CachesClientAPI = original.CachesClientAPI +type OperationsClientAPI = original.OperationsClientAPI +type SkusClientAPI = original.SkusClientAPI +type StorageTargetsClientAPI = original.StorageTargetsClientAPI +type UsageModelsClientAPI = original.UsageModelsClientAPI diff --git a/profiles/latest/vmwarecloudsimple/mgmt/vmwarecloudsimple/models.go b/profiles/latest/vmwarecloudsimple/mgmt/vmwarecloudsimple/models.go index fa31c226b6f0..f00824d7308d 100644 --- a/profiles/latest/vmwarecloudsimple/mgmt/vmwarecloudsimple/models.go +++ b/profiles/latest/vmwarecloudsimple/mgmt/vmwarecloudsimple/models.go @@ -36,6 +36,13 @@ const ( Total AggregationType = original.Total ) +type Allocation = original.Allocation + +const ( + Dynamic Allocation = original.Dynamic + Static Allocation = original.Static +) + type DiskIndependenceMode = original.DiskIndependenceMode const ( @@ -102,6 +109,40 @@ const ( Suspend StopMode = original.Suspend ) +type Type = original.Type + +const ( + CUSTOMNAME Type = original.CUSTOMNAME + FIXED Type = original.FIXED + PREFIXBASED Type = original.PREFIXBASED + USERDEFINED Type = original.USERDEFINED + VIRTUALMACHINENAME Type = original.VIRTUALMACHINENAME +) + +type Type1 = original.Type1 + +const ( + Type1CUSTOM Type1 = original.Type1CUSTOM + Type1DHCPIP Type1 = original.Type1DHCPIP + Type1FIXEDIP Type1 = original.Type1FIXEDIP + Type1USERDEFINED Type1 = original.Type1USERDEFINED +) + +type Type2 = original.Type2 + +const ( + LINUX Type2 = original.LINUX + WINDOWS Type2 = original.WINDOWS + WINDOWSTEXT Type2 = original.WINDOWSTEXT +) + +type Type3 = original.Type3 + +const ( + Type3LINUX Type3 = original.Type3LINUX + Type3WINDOWS Type3 = original.Type3WINDOWS +) + type UsageCount = original.UsageCount const ( @@ -129,40 +170,54 @@ type AvailableOperationDisplay = original.AvailableOperationDisplay type AvailableOperationDisplayPropertyServiceSpecification = original.AvailableOperationDisplayPropertyServiceSpecification type AvailableOperationDisplayPropertyServiceSpecificationMetricsItem = original.AvailableOperationDisplayPropertyServiceSpecificationMetricsItem type AvailableOperationDisplayPropertyServiceSpecificationMetricsList = original.AvailableOperationDisplayPropertyServiceSpecificationMetricsList -type AvailableOperationsClient = original.AvailableOperationsClient type AvailableOperationsListResponse = original.AvailableOperationsListResponse type AvailableOperationsListResponseIterator = original.AvailableOperationsListResponseIterator type AvailableOperationsListResponsePage = original.AvailableOperationsListResponsePage type BaseClient = original.BaseClient type CSRPError = original.CSRPError type CSRPErrorBody = original.CSRPErrorBody +type CustomizationHostName = original.CustomizationHostName +type CustomizationIPAddress = original.CustomizationIPAddress +type CustomizationIPSettings = original.CustomizationIPSettings +type CustomizationIdentity = original.CustomizationIdentity +type CustomizationIdentityUserData = original.CustomizationIdentityUserData +type CustomizationNicSetting = original.CustomizationNicSetting +type CustomizationPoliciesClient = original.CustomizationPoliciesClient +type CustomizationPoliciesListResponse = original.CustomizationPoliciesListResponse +type CustomizationPoliciesListResponseIterator = original.CustomizationPoliciesListResponseIterator +type CustomizationPoliciesListResponsePage = original.CustomizationPoliciesListResponsePage +type CustomizationPolicy = original.CustomizationPolicy +type CustomizationPolicyProperties = original.CustomizationPolicyProperties +type CustomizationSpecification = original.CustomizationSpecification type DedicatedCloudNode = original.DedicatedCloudNode -type DedicatedCloudNodeClient = original.DedicatedCloudNodeClient -type DedicatedCloudNodeCreateOrUpdateFuture = original.DedicatedCloudNodeCreateOrUpdateFuture type DedicatedCloudNodeListResponse = original.DedicatedCloudNodeListResponse type DedicatedCloudNodeListResponseIterator = original.DedicatedCloudNodeListResponseIterator type DedicatedCloudNodeListResponsePage = original.DedicatedCloudNodeListResponsePage type DedicatedCloudNodeProperties = original.DedicatedCloudNodeProperties +type DedicatedCloudNodesClient = original.DedicatedCloudNodesClient +type DedicatedCloudNodesCreateOrUpdateFuture = original.DedicatedCloudNodesCreateOrUpdateFuture type DedicatedCloudService = original.DedicatedCloudService -type DedicatedCloudServiceClient = original.DedicatedCloudServiceClient -type DedicatedCloudServiceDeleteFuture = original.DedicatedCloudServiceDeleteFuture type DedicatedCloudServiceListResponse = original.DedicatedCloudServiceListResponse type DedicatedCloudServiceListResponseIterator = original.DedicatedCloudServiceListResponseIterator type DedicatedCloudServiceListResponsePage = original.DedicatedCloudServiceListResponsePage type DedicatedCloudServiceProperties = original.DedicatedCloudServiceProperties +type DedicatedCloudServicesClient = original.DedicatedCloudServicesClient +type DedicatedCloudServicesDeleteFuture = original.DedicatedCloudServicesDeleteFuture +type GuestOSCustomization = original.GuestOSCustomization +type GuestOSNICCustomization = original.GuestOSNICCustomization type OperationError = original.OperationError type OperationResource = original.OperationResource +type OperationsClient = original.OperationsClient type PatchPayload = original.PatchPayload type PrivateCloud = original.PrivateCloud -type PrivateCloudByRegionClient = original.PrivateCloudByRegionClient type PrivateCloudList = original.PrivateCloudList type PrivateCloudListIterator = original.PrivateCloudListIterator type PrivateCloudListPage = original.PrivateCloudListPage type PrivateCloudProperties = original.PrivateCloudProperties +type PrivateCloudsClient = original.PrivateCloudsClient type ResourcePool = original.ResourcePool -type ResourcePoolByPCClient = original.ResourcePoolByPCClient type ResourcePoolProperties = original.ResourcePoolProperties -type ResourcePoolsByPCClient = original.ResourcePoolsByPCClient +type ResourcePoolsClient = original.ResourcePoolsClient type ResourcePoolsListResponse = original.ResourcePoolsListResponse type ResourcePoolsListResponseIterator = original.ResourcePoolsListResponseIterator type ResourcePoolsListResponsePage = original.ResourcePoolsListResponsePage @@ -172,51 +227,43 @@ type SkuAvailabilityListResponse = original.SkuAvailabilityListResponse type SkuAvailabilityListResponseIterator = original.SkuAvailabilityListResponseIterator type SkuAvailabilityListResponsePage = original.SkuAvailabilityListResponsePage type SkuDescription = original.SkuDescription -type SkusAvailabilityWithinRegionClient = original.SkusAvailabilityWithinRegionClient +type SkusAvailabilityClient = original.SkusAvailabilityClient type Usage = original.Usage type UsageListResponse = original.UsageListResponse type UsageListResponseIterator = original.UsageListResponseIterator type UsageListResponsePage = original.UsageListResponsePage type UsageName = original.UsageName -type UsagesWithinRegionClient = original.UsagesWithinRegionClient +type UsagesClient = original.UsagesClient type VirtualDisk = original.VirtualDisk type VirtualDiskController = original.VirtualDiskController type VirtualMachine = original.VirtualMachine -type VirtualMachineClient = original.VirtualMachineClient -type VirtualMachineCreateOrUpdateFuture = original.VirtualMachineCreateOrUpdateFuture -type VirtualMachineDeleteFuture = original.VirtualMachineDeleteFuture type VirtualMachineListResponse = original.VirtualMachineListResponse type VirtualMachineListResponseIterator = original.VirtualMachineListResponseIterator type VirtualMachineListResponsePage = original.VirtualMachineListResponsePage type VirtualMachineProperties = original.VirtualMachineProperties -type VirtualMachineStartFuture = original.VirtualMachineStartFuture -type VirtualMachineStopFuture = original.VirtualMachineStopFuture type VirtualMachineStopMode = original.VirtualMachineStopMode type VirtualMachineTemplate = original.VirtualMachineTemplate -type VirtualMachineTemplateByPCClient = original.VirtualMachineTemplateByPCClient type VirtualMachineTemplateListResponse = original.VirtualMachineTemplateListResponse type VirtualMachineTemplateListResponseIterator = original.VirtualMachineTemplateListResponseIterator type VirtualMachineTemplateListResponsePage = original.VirtualMachineTemplateListResponsePage type VirtualMachineTemplateProperties = original.VirtualMachineTemplateProperties -type VirtualMachineTemplatesByPCClient = original.VirtualMachineTemplatesByPCClient -type VirtualMachineUpdateFuture = original.VirtualMachineUpdateFuture +type VirtualMachineTemplatesClient = original.VirtualMachineTemplatesClient +type VirtualMachinesClient = original.VirtualMachinesClient +type VirtualMachinesCreateOrUpdateFuture = original.VirtualMachinesCreateOrUpdateFuture +type VirtualMachinesDeleteFuture = original.VirtualMachinesDeleteFuture +type VirtualMachinesStartFuture = original.VirtualMachinesStartFuture +type VirtualMachinesStopFuture = original.VirtualMachinesStopFuture +type VirtualMachinesUpdateFuture = original.VirtualMachinesUpdateFuture type VirtualNetwork = original.VirtualNetwork -type VirtualNetworkByPCClient = original.VirtualNetworkByPCClient type VirtualNetworkListResponse = original.VirtualNetworkListResponse type VirtualNetworkListResponseIterator = original.VirtualNetworkListResponseIterator type VirtualNetworkListResponsePage = original.VirtualNetworkListResponsePage type VirtualNetworkProperties = original.VirtualNetworkProperties -type VirtualNetworksByPCClient = original.VirtualNetworksByPCClient +type VirtualNetworksClient = original.VirtualNetworksClient type VirtualNic = original.VirtualNic -func New(referer string, regionID string, subscriptionID string) BaseClient { - return original.New(referer, regionID, subscriptionID) -} -func NewAvailableOperationsClient(referer string, regionID string, subscriptionID string) AvailableOperationsClient { - return original.NewAvailableOperationsClient(referer, regionID, subscriptionID) -} -func NewAvailableOperationsClientWithBaseURI(baseURI string, referer string, regionID string, subscriptionID string) AvailableOperationsClient { - return original.NewAvailableOperationsClientWithBaseURI(baseURI, referer, regionID, subscriptionID) +func New(subscriptionID string, referer string) BaseClient { + return original.New(subscriptionID, referer) } func NewAvailableOperationsListResponseIterator(page AvailableOperationsListResponsePage) AvailableOperationsListResponseIterator { return original.NewAvailableOperationsListResponseIterator(page) @@ -224,11 +271,17 @@ func NewAvailableOperationsListResponseIterator(page AvailableOperationsListResp func NewAvailableOperationsListResponsePage(getNextPage func(context.Context, AvailableOperationsListResponse) (AvailableOperationsListResponse, error)) AvailableOperationsListResponsePage { return original.NewAvailableOperationsListResponsePage(getNextPage) } -func NewDedicatedCloudNodeClient(referer string, regionID string, subscriptionID string) DedicatedCloudNodeClient { - return original.NewDedicatedCloudNodeClient(referer, regionID, subscriptionID) +func NewCustomizationPoliciesClient(subscriptionID string, referer string) CustomizationPoliciesClient { + return original.NewCustomizationPoliciesClient(subscriptionID, referer) +} +func NewCustomizationPoliciesClientWithBaseURI(baseURI string, subscriptionID string, referer string) CustomizationPoliciesClient { + return original.NewCustomizationPoliciesClientWithBaseURI(baseURI, subscriptionID, referer) } -func NewDedicatedCloudNodeClientWithBaseURI(baseURI string, referer string, regionID string, subscriptionID string) DedicatedCloudNodeClient { - return original.NewDedicatedCloudNodeClientWithBaseURI(baseURI, referer, regionID, subscriptionID) +func NewCustomizationPoliciesListResponseIterator(page CustomizationPoliciesListResponsePage) CustomizationPoliciesListResponseIterator { + return original.NewCustomizationPoliciesListResponseIterator(page) +} +func NewCustomizationPoliciesListResponsePage(getNextPage func(context.Context, CustomizationPoliciesListResponse) (CustomizationPoliciesListResponse, error)) CustomizationPoliciesListResponsePage { + return original.NewCustomizationPoliciesListResponsePage(getNextPage) } func NewDedicatedCloudNodeListResponseIterator(page DedicatedCloudNodeListResponsePage) DedicatedCloudNodeListResponseIterator { return original.NewDedicatedCloudNodeListResponseIterator(page) @@ -236,11 +289,11 @@ func NewDedicatedCloudNodeListResponseIterator(page DedicatedCloudNodeListRespon func NewDedicatedCloudNodeListResponsePage(getNextPage func(context.Context, DedicatedCloudNodeListResponse) (DedicatedCloudNodeListResponse, error)) DedicatedCloudNodeListResponsePage { return original.NewDedicatedCloudNodeListResponsePage(getNextPage) } -func NewDedicatedCloudServiceClient(referer string, regionID string, subscriptionID string) DedicatedCloudServiceClient { - return original.NewDedicatedCloudServiceClient(referer, regionID, subscriptionID) +func NewDedicatedCloudNodesClient(subscriptionID string, referer string) DedicatedCloudNodesClient { + return original.NewDedicatedCloudNodesClient(subscriptionID, referer) } -func NewDedicatedCloudServiceClientWithBaseURI(baseURI string, referer string, regionID string, subscriptionID string) DedicatedCloudServiceClient { - return original.NewDedicatedCloudServiceClientWithBaseURI(baseURI, referer, regionID, subscriptionID) +func NewDedicatedCloudNodesClientWithBaseURI(baseURI string, subscriptionID string, referer string) DedicatedCloudNodesClient { + return original.NewDedicatedCloudNodesClientWithBaseURI(baseURI, subscriptionID, referer) } func NewDedicatedCloudServiceListResponseIterator(page DedicatedCloudServiceListResponsePage) DedicatedCloudServiceListResponseIterator { return original.NewDedicatedCloudServiceListResponseIterator(page) @@ -248,11 +301,17 @@ func NewDedicatedCloudServiceListResponseIterator(page DedicatedCloudServiceList func NewDedicatedCloudServiceListResponsePage(getNextPage func(context.Context, DedicatedCloudServiceListResponse) (DedicatedCloudServiceListResponse, error)) DedicatedCloudServiceListResponsePage { return original.NewDedicatedCloudServiceListResponsePage(getNextPage) } -func NewPrivateCloudByRegionClient(referer string, regionID string, subscriptionID string) PrivateCloudByRegionClient { - return original.NewPrivateCloudByRegionClient(referer, regionID, subscriptionID) +func NewDedicatedCloudServicesClient(subscriptionID string, referer string) DedicatedCloudServicesClient { + return original.NewDedicatedCloudServicesClient(subscriptionID, referer) +} +func NewDedicatedCloudServicesClientWithBaseURI(baseURI string, subscriptionID string, referer string) DedicatedCloudServicesClient { + return original.NewDedicatedCloudServicesClientWithBaseURI(baseURI, subscriptionID, referer) } -func NewPrivateCloudByRegionClientWithBaseURI(baseURI string, referer string, regionID string, subscriptionID string) PrivateCloudByRegionClient { - return original.NewPrivateCloudByRegionClientWithBaseURI(baseURI, referer, regionID, subscriptionID) +func NewOperationsClient(subscriptionID string, referer string) OperationsClient { + return original.NewOperationsClient(subscriptionID, referer) +} +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string, referer string) OperationsClient { + return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID, referer) } func NewPrivateCloudListIterator(page PrivateCloudListPage) PrivateCloudListIterator { return original.NewPrivateCloudListIterator(page) @@ -260,17 +319,17 @@ func NewPrivateCloudListIterator(page PrivateCloudListPage) PrivateCloudListIter func NewPrivateCloudListPage(getNextPage func(context.Context, PrivateCloudList) (PrivateCloudList, error)) PrivateCloudListPage { return original.NewPrivateCloudListPage(getNextPage) } -func NewResourcePoolByPCClient(referer string, regionID string, subscriptionID string) ResourcePoolByPCClient { - return original.NewResourcePoolByPCClient(referer, regionID, subscriptionID) +func NewPrivateCloudsClient(subscriptionID string, referer string) PrivateCloudsClient { + return original.NewPrivateCloudsClient(subscriptionID, referer) } -func NewResourcePoolByPCClientWithBaseURI(baseURI string, referer string, regionID string, subscriptionID string) ResourcePoolByPCClient { - return original.NewResourcePoolByPCClientWithBaseURI(baseURI, referer, regionID, subscriptionID) +func NewPrivateCloudsClientWithBaseURI(baseURI string, subscriptionID string, referer string) PrivateCloudsClient { + return original.NewPrivateCloudsClientWithBaseURI(baseURI, subscriptionID, referer) } -func NewResourcePoolsByPCClient(referer string, regionID string, subscriptionID string) ResourcePoolsByPCClient { - return original.NewResourcePoolsByPCClient(referer, regionID, subscriptionID) +func NewResourcePoolsClient(subscriptionID string, referer string) ResourcePoolsClient { + return original.NewResourcePoolsClient(subscriptionID, referer) } -func NewResourcePoolsByPCClientWithBaseURI(baseURI string, referer string, regionID string, subscriptionID string) ResourcePoolsByPCClient { - return original.NewResourcePoolsByPCClientWithBaseURI(baseURI, referer, regionID, subscriptionID) +func NewResourcePoolsClientWithBaseURI(baseURI string, subscriptionID string, referer string) ResourcePoolsClient { + return original.NewResourcePoolsClientWithBaseURI(baseURI, subscriptionID, referer) } func NewResourcePoolsListResponseIterator(page ResourcePoolsListResponsePage) ResourcePoolsListResponseIterator { return original.NewResourcePoolsListResponseIterator(page) @@ -284,11 +343,11 @@ func NewSkuAvailabilityListResponseIterator(page SkuAvailabilityListResponsePage func NewSkuAvailabilityListResponsePage(getNextPage func(context.Context, SkuAvailabilityListResponse) (SkuAvailabilityListResponse, error)) SkuAvailabilityListResponsePage { return original.NewSkuAvailabilityListResponsePage(getNextPage) } -func NewSkusAvailabilityWithinRegionClient(referer string, regionID string, subscriptionID string) SkusAvailabilityWithinRegionClient { - return original.NewSkusAvailabilityWithinRegionClient(referer, regionID, subscriptionID) +func NewSkusAvailabilityClient(subscriptionID string, referer string) SkusAvailabilityClient { + return original.NewSkusAvailabilityClient(subscriptionID, referer) } -func NewSkusAvailabilityWithinRegionClientWithBaseURI(baseURI string, referer string, regionID string, subscriptionID string) SkusAvailabilityWithinRegionClient { - return original.NewSkusAvailabilityWithinRegionClientWithBaseURI(baseURI, referer, regionID, subscriptionID) +func NewSkusAvailabilityClientWithBaseURI(baseURI string, subscriptionID string, referer string) SkusAvailabilityClient { + return original.NewSkusAvailabilityClientWithBaseURI(baseURI, subscriptionID, referer) } func NewUsageListResponseIterator(page UsageListResponsePage) UsageListResponseIterator { return original.NewUsageListResponseIterator(page) @@ -296,17 +355,11 @@ func NewUsageListResponseIterator(page UsageListResponsePage) UsageListResponseI func NewUsageListResponsePage(getNextPage func(context.Context, UsageListResponse) (UsageListResponse, error)) UsageListResponsePage { return original.NewUsageListResponsePage(getNextPage) } -func NewUsagesWithinRegionClient(referer string, regionID string, subscriptionID string) UsagesWithinRegionClient { - return original.NewUsagesWithinRegionClient(referer, regionID, subscriptionID) -} -func NewUsagesWithinRegionClientWithBaseURI(baseURI string, referer string, regionID string, subscriptionID string) UsagesWithinRegionClient { - return original.NewUsagesWithinRegionClientWithBaseURI(baseURI, referer, regionID, subscriptionID) +func NewUsagesClient(subscriptionID string, referer string) UsagesClient { + return original.NewUsagesClient(subscriptionID, referer) } -func NewVirtualMachineClient(referer string, regionID string, subscriptionID string) VirtualMachineClient { - return original.NewVirtualMachineClient(referer, regionID, subscriptionID) -} -func NewVirtualMachineClientWithBaseURI(baseURI string, referer string, regionID string, subscriptionID string) VirtualMachineClient { - return original.NewVirtualMachineClientWithBaseURI(baseURI, referer, regionID, subscriptionID) +func NewUsagesClientWithBaseURI(baseURI string, subscriptionID string, referer string) UsagesClient { + return original.NewUsagesClientWithBaseURI(baseURI, subscriptionID, referer) } func NewVirtualMachineListResponseIterator(page VirtualMachineListResponsePage) VirtualMachineListResponseIterator { return original.NewVirtualMachineListResponseIterator(page) @@ -314,29 +367,23 @@ func NewVirtualMachineListResponseIterator(page VirtualMachineListResponsePage) func NewVirtualMachineListResponsePage(getNextPage func(context.Context, VirtualMachineListResponse) (VirtualMachineListResponse, error)) VirtualMachineListResponsePage { return original.NewVirtualMachineListResponsePage(getNextPage) } -func NewVirtualMachineTemplateByPCClient(referer string, regionID string, subscriptionID string) VirtualMachineTemplateByPCClient { - return original.NewVirtualMachineTemplateByPCClient(referer, regionID, subscriptionID) -} -func NewVirtualMachineTemplateByPCClientWithBaseURI(baseURI string, referer string, regionID string, subscriptionID string) VirtualMachineTemplateByPCClient { - return original.NewVirtualMachineTemplateByPCClientWithBaseURI(baseURI, referer, regionID, subscriptionID) -} func NewVirtualMachineTemplateListResponseIterator(page VirtualMachineTemplateListResponsePage) VirtualMachineTemplateListResponseIterator { return original.NewVirtualMachineTemplateListResponseIterator(page) } func NewVirtualMachineTemplateListResponsePage(getNextPage func(context.Context, VirtualMachineTemplateListResponse) (VirtualMachineTemplateListResponse, error)) VirtualMachineTemplateListResponsePage { return original.NewVirtualMachineTemplateListResponsePage(getNextPage) } -func NewVirtualMachineTemplatesByPCClient(referer string, regionID string, subscriptionID string) VirtualMachineTemplatesByPCClient { - return original.NewVirtualMachineTemplatesByPCClient(referer, regionID, subscriptionID) +func NewVirtualMachineTemplatesClient(subscriptionID string, referer string) VirtualMachineTemplatesClient { + return original.NewVirtualMachineTemplatesClient(subscriptionID, referer) } -func NewVirtualMachineTemplatesByPCClientWithBaseURI(baseURI string, referer string, regionID string, subscriptionID string) VirtualMachineTemplatesByPCClient { - return original.NewVirtualMachineTemplatesByPCClientWithBaseURI(baseURI, referer, regionID, subscriptionID) +func NewVirtualMachineTemplatesClientWithBaseURI(baseURI string, subscriptionID string, referer string) VirtualMachineTemplatesClient { + return original.NewVirtualMachineTemplatesClientWithBaseURI(baseURI, subscriptionID, referer) } -func NewVirtualNetworkByPCClient(referer string, regionID string, subscriptionID string) VirtualNetworkByPCClient { - return original.NewVirtualNetworkByPCClient(referer, regionID, subscriptionID) +func NewVirtualMachinesClient(subscriptionID string, referer string) VirtualMachinesClient { + return original.NewVirtualMachinesClient(subscriptionID, referer) } -func NewVirtualNetworkByPCClientWithBaseURI(baseURI string, referer string, regionID string, subscriptionID string) VirtualNetworkByPCClient { - return original.NewVirtualNetworkByPCClientWithBaseURI(baseURI, referer, regionID, subscriptionID) +func NewVirtualMachinesClientWithBaseURI(baseURI string, subscriptionID string, referer string) VirtualMachinesClient { + return original.NewVirtualMachinesClientWithBaseURI(baseURI, subscriptionID, referer) } func NewVirtualNetworkListResponseIterator(page VirtualNetworkListResponsePage) VirtualNetworkListResponseIterator { return original.NewVirtualNetworkListResponseIterator(page) @@ -344,18 +391,21 @@ func NewVirtualNetworkListResponseIterator(page VirtualNetworkListResponsePage) func NewVirtualNetworkListResponsePage(getNextPage func(context.Context, VirtualNetworkListResponse) (VirtualNetworkListResponse, error)) VirtualNetworkListResponsePage { return original.NewVirtualNetworkListResponsePage(getNextPage) } -func NewVirtualNetworksByPCClient(referer string, regionID string, subscriptionID string) VirtualNetworksByPCClient { - return original.NewVirtualNetworksByPCClient(referer, regionID, subscriptionID) +func NewVirtualNetworksClient(subscriptionID string, referer string) VirtualNetworksClient { + return original.NewVirtualNetworksClient(subscriptionID, referer) } -func NewVirtualNetworksByPCClientWithBaseURI(baseURI string, referer string, regionID string, subscriptionID string) VirtualNetworksByPCClient { - return original.NewVirtualNetworksByPCClientWithBaseURI(baseURI, referer, regionID, subscriptionID) +func NewVirtualNetworksClientWithBaseURI(baseURI string, subscriptionID string, referer string) VirtualNetworksClient { + return original.NewVirtualNetworksClientWithBaseURI(baseURI, subscriptionID, referer) } -func NewWithBaseURI(baseURI string, referer string, regionID string, subscriptionID string) BaseClient { - return original.NewWithBaseURI(baseURI, referer, regionID, subscriptionID) +func NewWithBaseURI(baseURI string, subscriptionID string, referer string) BaseClient { + return original.NewWithBaseURI(baseURI, subscriptionID, referer) } func PossibleAggregationTypeValues() []AggregationType { return original.PossibleAggregationTypeValues() } +func PossibleAllocationValues() []Allocation { + return original.PossibleAllocationValues() +} func PossibleDiskIndependenceModeValues() []DiskIndependenceMode { return original.PossibleDiskIndependenceModeValues() } @@ -380,6 +430,18 @@ func PossiblePrivateCloudResourceTypeValues() []PrivateCloudResourceType { func PossibleStopModeValues() []StopMode { return original.PossibleStopModeValues() } +func PossibleType1Values() []Type1 { + return original.PossibleType1Values() +} +func PossibleType2Values() []Type2 { + return original.PossibleType2Values() +} +func PossibleType3Values() []Type3 { + return original.PossibleType3Values() +} +func PossibleTypeValues() []Type { + return original.PossibleTypeValues() +} func PossibleUsageCountValues() []UsageCount { return original.PossibleUsageCountValues() } diff --git a/profiles/latest/vmwarecloudsimple/mgmt/vmwarecloudsimple/vmwarecloudsimpleapi/models.go b/profiles/latest/vmwarecloudsimple/mgmt/vmwarecloudsimple/vmwarecloudsimpleapi/models.go index 30246cb7a73b..ed837345e317 100644 --- a/profiles/latest/vmwarecloudsimple/mgmt/vmwarecloudsimple/vmwarecloudsimpleapi/models.go +++ b/profiles/latest/vmwarecloudsimple/mgmt/vmwarecloudsimple/vmwarecloudsimpleapi/models.go @@ -21,17 +21,14 @@ package vmwarecloudsimpleapi import original "github.com/Azure/azure-sdk-for-go/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/vmwarecloudsimpleapi" -type AvailableOperationsClientAPI = original.AvailableOperationsClientAPI -type BaseClientAPI = original.BaseClientAPI -type DedicatedCloudNodeClientAPI = original.DedicatedCloudNodeClientAPI -type DedicatedCloudServiceClientAPI = original.DedicatedCloudServiceClientAPI -type PrivateCloudByRegionClientAPI = original.PrivateCloudByRegionClientAPI -type ResourcePoolByPCClientAPI = original.ResourcePoolByPCClientAPI -type ResourcePoolsByPCClientAPI = original.ResourcePoolsByPCClientAPI -type SkusAvailabilityWithinRegionClientAPI = original.SkusAvailabilityWithinRegionClientAPI -type UsagesWithinRegionClientAPI = original.UsagesWithinRegionClientAPI -type VirtualMachineClientAPI = original.VirtualMachineClientAPI -type VirtualMachineTemplateByPCClientAPI = original.VirtualMachineTemplateByPCClientAPI -type VirtualMachineTemplatesByPCClientAPI = original.VirtualMachineTemplatesByPCClientAPI -type VirtualNetworkByPCClientAPI = original.VirtualNetworkByPCClientAPI -type VirtualNetworksByPCClientAPI = original.VirtualNetworksByPCClientAPI +type CustomizationPoliciesClientAPI = original.CustomizationPoliciesClientAPI +type DedicatedCloudNodesClientAPI = original.DedicatedCloudNodesClientAPI +type DedicatedCloudServicesClientAPI = original.DedicatedCloudServicesClientAPI +type OperationsClientAPI = original.OperationsClientAPI +type PrivateCloudsClientAPI = original.PrivateCloudsClientAPI +type ResourcePoolsClientAPI = original.ResourcePoolsClientAPI +type SkusAvailabilityClientAPI = original.SkusAvailabilityClientAPI +type UsagesClientAPI = original.UsagesClientAPI +type VirtualMachineTemplatesClientAPI = original.VirtualMachineTemplatesClientAPI +type VirtualMachinesClientAPI = original.VirtualMachinesClientAPI +type VirtualNetworksClientAPI = original.VirtualNetworksClientAPI diff --git a/profiles/latest/web/mgmt/web/models.go b/profiles/latest/web/mgmt/web/models.go index 1e47d1d9f4e6..efded70f081c 100644 --- a/profiles/latest/web/mgmt/web/models.go +++ b/profiles/latest/web/mgmt/web/models.go @@ -192,6 +192,18 @@ const ( ComputeModeOptionsShared ComputeModeOptions = original.ComputeModeOptionsShared ) +type ConfigReferenceLocation = original.ConfigReferenceLocation + +const ( + ApplicationSetting ConfigReferenceLocation = original.ApplicationSetting +) + +type ConfigReferenceSource = original.ConfigReferenceSource + +const ( + KeyVault ConfigReferenceSource = original.KeyVault +) + type ConnectionStringType = original.ConnectionStringType const ( @@ -416,10 +428,9 @@ const ( type ManagedServiceIdentityType = original.ManagedServiceIdentityType const ( - ManagedServiceIdentityTypeNone ManagedServiceIdentityType = original.ManagedServiceIdentityTypeNone - ManagedServiceIdentityTypeSystemAssigned ManagedServiceIdentityType = original.ManagedServiceIdentityTypeSystemAssigned - ManagedServiceIdentityTypeSystemAssignedUserAssigned ManagedServiceIdentityType = original.ManagedServiceIdentityTypeSystemAssignedUserAssigned - ManagedServiceIdentityTypeUserAssigned ManagedServiceIdentityType = original.ManagedServiceIdentityTypeUserAssigned + ManagedServiceIdentityTypeNone ManagedServiceIdentityType = original.ManagedServiceIdentityTypeNone + ManagedServiceIdentityTypeSystemAssigned ManagedServiceIdentityType = original.ManagedServiceIdentityTypeSystemAssigned + ManagedServiceIdentityTypeUserAssigned ManagedServiceIdentityType = original.ManagedServiceIdentityTypeUserAssigned ) type MySQLMigrationType = original.MySQLMigrationType @@ -493,6 +504,20 @@ const ( TimeSeriesPerInstance RenderingType = original.TimeSeriesPerInstance ) +type ResolveStatus = original.ResolveStatus + +const ( + AccessToKeyVaultDenied ResolveStatus = original.AccessToKeyVaultDenied + Initialized ResolveStatus = original.Initialized + InvalidSyntax ResolveStatus = original.InvalidSyntax + MSINotEnabled ResolveStatus = original.MSINotEnabled + OtherReasons ResolveStatus = original.OtherReasons + Resolved ResolveStatus = original.Resolved + SecretNotFound ResolveStatus = original.SecretNotFound + SecretVersionNotFound ResolveStatus = original.SecretVersionNotFound + VaultNotFound ResolveStatus = original.VaultNotFound +) + type ResourceScopeType = original.ResourceScopeType const ( @@ -525,6 +550,7 @@ const ( ScmTypeOneDrive ScmType = original.ScmTypeOneDrive ScmTypeTfs ScmType = original.ScmTypeTfs ScmTypeVSO ScmType = original.ScmTypeVSO + ScmTypeVSTSRM ScmType = original.ScmTypeVSTSRM ) type SiteAvailabilityState = original.SiteAvailabilityState @@ -552,6 +578,14 @@ const ( WeightedTotalTraffic SiteLoadBalancing = original.WeightedTotalTraffic ) +type SiteRuntimeState = original.SiteRuntimeState + +const ( + READY SiteRuntimeState = original.READY + STOPPED SiteRuntimeState = original.STOPPED + UNKNOWN SiteRuntimeState = original.UNKNOWN +) + type SkuName = original.SkuName const ( @@ -631,19 +665,23 @@ const ( type WorkerSizeOptions = original.WorkerSizeOptions const ( - WorkerSizeOptionsD1 WorkerSizeOptions = original.WorkerSizeOptionsD1 - WorkerSizeOptionsD2 WorkerSizeOptions = original.WorkerSizeOptionsD2 - WorkerSizeOptionsD3 WorkerSizeOptions = original.WorkerSizeOptionsD3 - WorkerSizeOptionsDefault WorkerSizeOptions = original.WorkerSizeOptionsDefault - WorkerSizeOptionsLarge WorkerSizeOptions = original.WorkerSizeOptionsLarge - WorkerSizeOptionsMedium WorkerSizeOptions = original.WorkerSizeOptionsMedium - WorkerSizeOptionsSmall WorkerSizeOptions = original.WorkerSizeOptionsSmall + WorkerSizeOptionsD1 WorkerSizeOptions = original.WorkerSizeOptionsD1 + WorkerSizeOptionsD2 WorkerSizeOptions = original.WorkerSizeOptionsD2 + WorkerSizeOptionsD3 WorkerSizeOptions = original.WorkerSizeOptionsD3 + WorkerSizeOptionsDefault WorkerSizeOptions = original.WorkerSizeOptionsDefault + WorkerSizeOptionsLarge WorkerSizeOptions = original.WorkerSizeOptionsLarge + WorkerSizeOptionsMedium WorkerSizeOptions = original.WorkerSizeOptionsMedium + WorkerSizeOptionsNestedSmall WorkerSizeOptions = original.WorkerSizeOptionsNestedSmall + WorkerSizeOptionsSmall WorkerSizeOptions = original.WorkerSizeOptionsSmall ) type APIDefinitionInfo = original.APIDefinitionInfo +type APIKVReference = original.APIKVReference +type APIManagementConfig = original.APIManagementConfig type AbnormalTimePeriod = original.AbnormalTimePeriod type Address = original.Address type AddressResponse = original.AddressResponse +type AddressResponseProperties = original.AddressResponseProperties type AnalysisData = original.AnalysisData type AnalysisDefinition = original.AnalysisDefinition type AnalysisDefinitionProperties = original.AnalysisDefinitionProperties @@ -700,7 +738,10 @@ type ApplicationStack = original.ApplicationStack type ApplicationStackCollection = original.ApplicationStackCollection type ApplicationStackCollectionIterator = original.ApplicationStackCollectionIterator type ApplicationStackCollectionPage = original.ApplicationStackCollectionPage +type ApplicationStackResource = original.ApplicationStackResource type AppsClient = original.AppsClient +type AppsCopyProductionSlotFuture = original.AppsCopyProductionSlotFuture +type AppsCopySlotSlotFuture = original.AppsCopySlotSlotFuture type AppsCreateFunctionFuture = original.AppsCreateFunctionFuture type AppsCreateInstanceFunctionSlotFuture = original.AppsCreateInstanceFunctionSlotFuture type AppsCreateInstanceMSDeployOperationFuture = original.AppsCreateInstanceMSDeployOperationFuture @@ -774,12 +815,19 @@ type ConnStringInfo = original.ConnStringInfo type ConnStringValueTypePair = original.ConnStringValueTypePair type ConnectionStringDictionary = original.ConnectionStringDictionary type Contact = original.Contact +type ContainerCPUStatistics = original.ContainerCPUStatistics +type ContainerCPUUsage = original.ContainerCPUUsage +type ContainerInfo = original.ContainerInfo +type ContainerMemoryStatistics = original.ContainerMemoryStatistics +type ContainerNetworkInterfaceStatistics = original.ContainerNetworkInterfaceStatistics +type ContainerThrottlingData = original.ContainerThrottlingData type ContinuousWebJob = original.ContinuousWebJob type ContinuousWebJobCollection = original.ContinuousWebJobCollection type ContinuousWebJobCollectionIterator = original.ContinuousWebJobCollectionIterator type ContinuousWebJobCollectionPage = original.ContinuousWebJobCollectionPage type ContinuousWebJobProperties = original.ContinuousWebJobProperties type CorsSettings = original.CorsSettings +type CsmCopySlotEntity = original.CsmCopySlotEntity type CsmMoveResourceEnvelope = original.CsmMoveResourceEnvelope type CsmOperationCollection = original.CsmOperationCollection type CsmOperationCollectionIterator = original.CsmOperationCollectionIterator @@ -846,7 +894,7 @@ type DiagnosticMetricSet = original.DiagnosticMetricSet type DiagnosticsClient = original.DiagnosticsClient type Dimension = original.Dimension type Domain = original.Domain -type DomainAvailablilityCheckResult = original.DomainAvailablilityCheckResult +type DomainAvailabilityCheckResult = original.DomainAvailabilityCheckResult type DomainCollection = original.DomainCollection type DomainCollectionIterator = original.DomainCollectionIterator type DomainCollectionPage = original.DomainCollectionPage @@ -878,7 +926,6 @@ type FunctionEnvelopeCollectionPage = original.FunctionEnvelopeCollectionPage type FunctionEnvelopeProperties = original.FunctionEnvelopeProperties type FunctionSecrets = original.FunctionSecrets type FunctionSecretsProperties = original.FunctionSecretsProperties -type GeoDistribution = original.GeoDistribution type GeoRegion = original.GeoRegion type GeoRegionCollection = original.GeoRegionCollection type GeoRegionCollectionIterator = original.GeoRegionCollectionIterator @@ -921,6 +968,9 @@ type JobCollection = original.JobCollection type JobCollectionIterator = original.JobCollectionIterator type JobCollectionPage = original.JobCollectionPage type JobProperties = original.JobProperties +type KeyVaultReferenceCollection = original.KeyVaultReferenceCollection +type KeyVaultReferenceCollectionProperties = original.KeyVaultReferenceCollectionProperties +type KeyVaultReferenceResource = original.KeyVaultReferenceResource type ListCapability = original.ListCapability type ListCertificateEmail = original.ListCertificateEmail type ListCertificateOrderAction = original.ListCertificateOrderAction @@ -940,10 +990,7 @@ type MSDeployStatus = original.MSDeployStatus type MSDeployStatusProperties = original.MSDeployStatusProperties type ManagedServiceIdentity = original.ManagedServiceIdentity type ManagedServiceIdentityUserAssignedIdentitiesValue = original.ManagedServiceIdentityUserAssignedIdentitiesValue -type MetricAvailabilily = original.MetricAvailabilily type MetricAvailability = original.MetricAvailability -type MetricDefinition = original.MetricDefinition -type MetricDefinitionProperties = original.MetricDefinitionProperties type MetricSpecification = original.MetricSpecification type MigrateMySQLRequest = original.MigrateMySQLRequest type MigrateMySQLRequestProperties = original.MigrateMySQLRequestProperties @@ -1034,19 +1081,12 @@ type ResourceHealthMetadataCollection = original.ResourceHealthMetadataCollectio type ResourceHealthMetadataCollectionIterator = original.ResourceHealthMetadataCollectionIterator type ResourceHealthMetadataCollectionPage = original.ResourceHealthMetadataCollectionPage type ResourceHealthMetadataProperties = original.ResourceHealthMetadataProperties -type ResourceMetric = original.ResourceMetric type ResourceMetricAvailability = original.ResourceMetricAvailability -type ResourceMetricCollection = original.ResourceMetricCollection -type ResourceMetricCollectionIterator = original.ResourceMetricCollectionIterator -type ResourceMetricCollectionPage = original.ResourceMetricCollectionPage type ResourceMetricDefinition = original.ResourceMetricDefinition type ResourceMetricDefinitionCollection = original.ResourceMetricDefinitionCollection type ResourceMetricDefinitionCollectionIterator = original.ResourceMetricDefinitionCollectionIterator type ResourceMetricDefinitionCollectionPage = original.ResourceMetricDefinitionCollectionPage type ResourceMetricDefinitionProperties = original.ResourceMetricDefinitionProperties -type ResourceMetricName = original.ResourceMetricName -type ResourceMetricProperty = original.ResourceMetricProperty -type ResourceMetricValue = original.ResourceMetricValue type ResourceNameAvailability = original.ResourceNameAvailability type ResourceNameAvailabilityRequest = original.ResourceNameAvailabilityRequest type ResponseMetaData = original.ResponseMetaData @@ -1076,6 +1116,8 @@ type SiteExtensionInfoCollectionPage = original.SiteExtensionInfoCollectionPage type SiteExtensionInfoProperties = original.SiteExtensionInfoProperties type SiteInstance = original.SiteInstance type SiteInstanceProperties = original.SiteInstanceProperties +type SiteInstanceStatus = original.SiteInstanceStatus +type SiteInstanceStatusProperties = original.SiteInstanceStatusProperties type SiteLimits = original.SiteLimits type SiteLogsConfig = original.SiteLogsConfig type SiteLogsConfigProperties = original.SiteLogsConfigProperties @@ -1164,7 +1206,6 @@ type UsageCollectionPage = original.UsageCollectionPage type UsageProperties = original.UsageProperties type User = original.User type UserProperties = original.UserProperties -type ValidateContainerSettingsRequest = original.ValidateContainerSettingsRequest type ValidateProperties = original.ValidateProperties type ValidateRequest = original.ValidateRequest type ValidateResponse = original.ValidateResponse @@ -1506,12 +1547,6 @@ func NewResourceHealthMetadataCollectionIterator(page ResourceHealthMetadataColl func NewResourceHealthMetadataCollectionPage(getNextPage func(context.Context, ResourceHealthMetadataCollection) (ResourceHealthMetadataCollection, error)) ResourceHealthMetadataCollectionPage { return original.NewResourceHealthMetadataCollectionPage(getNextPage) } -func NewResourceMetricCollectionIterator(page ResourceMetricCollectionPage) ResourceMetricCollectionIterator { - return original.NewResourceMetricCollectionIterator(page) -} -func NewResourceMetricCollectionPage(getNextPage func(context.Context, ResourceMetricCollection) (ResourceMetricCollection, error)) ResourceMetricCollectionPage { - return original.NewResourceMetricCollectionPage(getNextPage) -} func NewResourceMetricDefinitionCollectionIterator(page ResourceMetricDefinitionCollectionPage) ResourceMetricDefinitionCollectionIterator { return original.NewResourceMetricDefinitionCollectionIterator(page) } @@ -1659,6 +1694,12 @@ func PossibleCloneAbilityResultValues() []CloneAbilityResult { func PossibleComputeModeOptionsValues() []ComputeModeOptions { return original.PossibleComputeModeOptionsValues() } +func PossibleConfigReferenceLocationValues() []ConfigReferenceLocation { + return original.PossibleConfigReferenceLocationValues() +} +func PossibleConfigReferenceSourceValues() []ConfigReferenceSource { + return original.PossibleConfigReferenceSourceValues() +} func PossibleConnectionStringTypeValues() []ConnectionStringType { return original.PossibleConnectionStringTypeValues() } @@ -1755,6 +1796,9 @@ func PossibleRedundancyModeValues() []RedundancyMode { func PossibleRenderingTypeValues() []RenderingType { return original.PossibleRenderingTypeValues() } +func PossibleResolveStatusValues() []ResolveStatus { + return original.PossibleResolveStatusValues() +} func PossibleResourceScopeTypeValues() []ResourceScopeType { return original.PossibleResourceScopeTypeValues() } @@ -1773,6 +1817,9 @@ func PossibleSiteExtensionTypeValues() []SiteExtensionType { func PossibleSiteLoadBalancingValues() []SiteLoadBalancing { return original.PossibleSiteLoadBalancingValues() } +func PossibleSiteRuntimeStateValues() []SiteRuntimeState { + return original.PossibleSiteRuntimeStateValues() +} func PossibleSkuNameValues() []SkuName { return original.PossibleSkuNameValues() } diff --git a/profiles/preview/advisor/mgmt/advisor/models.go b/profiles/preview/advisor/mgmt/advisor/models.go index 12185f185d4b..89c05f9f48c1 100644 --- a/profiles/preview/advisor/mgmt/advisor/models.go +++ b/profiles/preview/advisor/mgmt/advisor/models.go @@ -32,10 +32,11 @@ const ( type Category = original.Category const ( - Cost Category = original.Cost - HighAvailability Category = original.HighAvailability - Performance Category = original.Performance - Security Category = original.Security + Cost Category = original.Cost + HighAvailability Category = original.HighAvailability + OperationalExcellence Category = original.OperationalExcellence + Performance Category = original.Performance + Security Category = original.Security ) type Impact = original.Impact diff --git a/profiles/preview/appconfiguration/mgmt/appconfiguration/appconfigurationapi/models.go b/profiles/preview/appconfiguration/mgmt/appconfiguration/appconfigurationapi/models.go new file mode 100644 index 000000000000..2cc70b8e585a --- /dev/null +++ b/profiles/preview/appconfiguration/mgmt/appconfiguration/appconfigurationapi/models.go @@ -0,0 +1,25 @@ +// +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 appconfigurationapi + +import original "github.com/Azure/azure-sdk-for-go/services/appconfiguration/mgmt/2019-10-01/appconfiguration/appconfigurationapi" + +type ConfigurationStoresClientAPI = original.ConfigurationStoresClientAPI +type OperationsClientAPI = original.OperationsClientAPI diff --git a/profiles/preview/appconfiguration/mgmt/appconfiguration/models.go b/profiles/preview/appconfiguration/mgmt/appconfiguration/models.go new file mode 100644 index 000000000000..f95ea208e937 --- /dev/null +++ b/profiles/preview/appconfiguration/mgmt/appconfiguration/models.go @@ -0,0 +1,131 @@ +// +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 appconfiguration + +import ( + "context" + + original "github.com/Azure/azure-sdk-for-go/services/appconfiguration/mgmt/2019-10-01/appconfiguration" +) + +const ( + DefaultBaseURI = original.DefaultBaseURI +) + +type IdentityType = original.IdentityType + +const ( + None IdentityType = original.None + SystemAssigned IdentityType = original.SystemAssigned + SystemAssignedUserAssigned IdentityType = original.SystemAssignedUserAssigned + UserAssigned IdentityType = original.UserAssigned +) + +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 + Updating ProvisioningState = original.Updating +) + +type APIKey = original.APIKey +type APIKeyListResult = original.APIKeyListResult +type APIKeyListResultIterator = original.APIKeyListResultIterator +type APIKeyListResultPage = original.APIKeyListResultPage +type BaseClient = original.BaseClient +type CheckNameAvailabilityParameters = original.CheckNameAvailabilityParameters +type ConfigurationStore = original.ConfigurationStore +type ConfigurationStoreListResult = original.ConfigurationStoreListResult +type ConfigurationStoreListResultIterator = original.ConfigurationStoreListResultIterator +type ConfigurationStoreListResultPage = original.ConfigurationStoreListResultPage +type ConfigurationStoreProperties = original.ConfigurationStoreProperties +type ConfigurationStoreUpdateParameters = original.ConfigurationStoreUpdateParameters +type ConfigurationStoresClient = original.ConfigurationStoresClient +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 +type OperationDefinitionListResult = original.OperationDefinitionListResult +type OperationDefinitionListResultIterator = original.OperationDefinitionListResultIterator +type OperationDefinitionListResultPage = original.OperationDefinitionListResultPage +type OperationsClient = original.OperationsClient +type RegenerateKeyParameters = original.RegenerateKeyParameters +type Resource = original.Resource +type ResourceIdentity = original.ResourceIdentity +type Sku = original.Sku +type UserIdentity = original.UserIdentity + +func New(subscriptionID string) BaseClient { + return original.New(subscriptionID) +} +func NewAPIKeyListResultIterator(page APIKeyListResultPage) APIKeyListResultIterator { + return original.NewAPIKeyListResultIterator(page) +} +func NewAPIKeyListResultPage(getNextPage func(context.Context, APIKeyListResult) (APIKeyListResult, error)) APIKeyListResultPage { + return original.NewAPIKeyListResultPage(getNextPage) +} +func NewConfigurationStoreListResultIterator(page ConfigurationStoreListResultPage) ConfigurationStoreListResultIterator { + return original.NewConfigurationStoreListResultIterator(page) +} +func NewConfigurationStoreListResultPage(getNextPage func(context.Context, ConfigurationStoreListResult) (ConfigurationStoreListResult, error)) ConfigurationStoreListResultPage { + return original.NewConfigurationStoreListResultPage(getNextPage) +} +func NewConfigurationStoresClient(subscriptionID string) ConfigurationStoresClient { + return original.NewConfigurationStoresClient(subscriptionID) +} +func NewConfigurationStoresClientWithBaseURI(baseURI string, subscriptionID string) ConfigurationStoresClient { + return original.NewConfigurationStoresClientWithBaseURI(baseURI, subscriptionID) +} +func NewOperationDefinitionListResultIterator(page OperationDefinitionListResultPage) OperationDefinitionListResultIterator { + return original.NewOperationDefinitionListResultIterator(page) +} +func NewOperationDefinitionListResultPage(getNextPage func(context.Context, OperationDefinitionListResult) (OperationDefinitionListResult, error)) OperationDefinitionListResultPage { + return original.NewOperationDefinitionListResultPage(getNextPage) +} +func NewOperationsClient(subscriptionID string) OperationsClient { + return original.NewOperationsClient(subscriptionID) +} +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) +} +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return original.NewWithBaseURI(baseURI, subscriptionID) +} +func PossibleIdentityTypeValues() []IdentityType { + return original.PossibleIdentityTypeValues() +} +func PossibleProvisioningStateValues() []ProvisioningState { + return original.PossibleProvisioningStateValues() +} +func UserAgent() string { + return original.UserAgent() + " profiles/preview" +} +func Version() string { + return original.Version() +} diff --git a/profiles/preview/cdn/mgmt/cdn/models.go b/profiles/preview/cdn/mgmt/cdn/models.go index e191eb867583..fc8fc506a58a 100644 --- a/profiles/preview/cdn/mgmt/cdn/models.go +++ b/profiles/preview/cdn/mgmt/cdn/models.go @@ -52,6 +52,20 @@ const ( Shared CertificateType = original.Shared ) +type CookiesOperator = original.CookiesOperator + +const ( + Any CookiesOperator = original.Any + BeginsWith CookiesOperator = original.BeginsWith + Contains CookiesOperator = original.Contains + EndsWith CookiesOperator = original.EndsWith + Equal CookiesOperator = original.Equal + GreaterThan CookiesOperator = original.GreaterThan + GreaterThanOrEqual CookiesOperator = original.GreaterThanOrEqual + LessThan CookiesOperator = original.LessThan + LessThanOrEqual CookiesOperator = original.LessThanOrEqual +) + type CustomDomainResourceState = original.CustomDomainResourceState const ( @@ -119,10 +133,20 @@ const ( Overwrite HeaderAction = original.Overwrite ) +type MinimumTLSVersion = original.MinimumTLSVersion + +const ( + None MinimumTLSVersion = original.None + TLS10 MinimumTLSVersion = original.TLS10 + TLS12 MinimumTLSVersion = original.TLS12 +) + type Name = original.Name const ( + NameCookies Name = original.NameCookies NameDeliveryRuleCondition Name = original.NameDeliveryRuleCondition + NameHTTPVersion Name = original.NameHTTPVersion NameIsDevice Name = original.NameIsDevice NamePostArgs Name = original.NamePostArgs NameQueryString Name = original.NameQueryString @@ -170,15 +194,15 @@ const ( type PostArgsOperator = original.PostArgsOperator const ( - Any PostArgsOperator = original.Any - BeginsWith PostArgsOperator = original.BeginsWith - Contains PostArgsOperator = original.Contains - EndsWith PostArgsOperator = original.EndsWith - Equal PostArgsOperator = original.Equal - GreaterThan PostArgsOperator = original.GreaterThan - GreaterThanOrEqual PostArgsOperator = original.GreaterThanOrEqual - LessThan PostArgsOperator = original.LessThan - LessThanOrEqual PostArgsOperator = original.LessThanOrEqual + PostArgsOperatorAny PostArgsOperator = original.PostArgsOperatorAny + PostArgsOperatorBeginsWith PostArgsOperator = original.PostArgsOperatorBeginsWith + PostArgsOperatorContains PostArgsOperator = original.PostArgsOperatorContains + PostArgsOperatorEndsWith PostArgsOperator = original.PostArgsOperatorEndsWith + PostArgsOperatorEqual PostArgsOperator = original.PostArgsOperatorEqual + PostArgsOperatorGreaterThan PostArgsOperator = original.PostArgsOperatorGreaterThan + PostArgsOperatorGreaterThanOrEqual PostArgsOperator = original.PostArgsOperatorGreaterThanOrEqual + PostArgsOperatorLessThan PostArgsOperator = original.PostArgsOperatorLessThan + PostArgsOperatorLessThanOrEqual PostArgsOperator = original.PostArgsOperatorLessThanOrEqual ) type ProfileResourceState = original.ProfileResourceState @@ -366,6 +390,7 @@ type CertificateSourceParameters = original.CertificateSourceParameters type CheckNameAvailabilityInput = original.CheckNameAvailabilityInput type CheckNameAvailabilityOutput = original.CheckNameAvailabilityOutput type CidrIPAddress = original.CidrIPAddress +type CookiesMatchConditionParameters = original.CookiesMatchConditionParameters type CustomDomain = original.CustomDomain type CustomDomainHTTPSParameters = original.CustomDomainHTTPSParameters type CustomDomainListResult = original.CustomDomainListResult @@ -384,6 +409,8 @@ type DeliveryRuleAction = original.DeliveryRuleAction type DeliveryRuleCacheExpirationAction = original.DeliveryRuleCacheExpirationAction type DeliveryRuleCacheKeyQueryStringAction = original.DeliveryRuleCacheKeyQueryStringAction type DeliveryRuleCondition = original.DeliveryRuleCondition +type DeliveryRuleCookiesCondition = original.DeliveryRuleCookiesCondition +type DeliveryRuleHTTPVersionCondition = original.DeliveryRuleHTTPVersionCondition type DeliveryRuleIsDeviceCondition = original.DeliveryRuleIsDeviceCondition type DeliveryRulePostArgsCondition = original.DeliveryRulePostArgsCondition type DeliveryRuleQueryStringCondition = original.DeliveryRuleQueryStringCondition @@ -422,6 +449,7 @@ type EndpointsStopFuture = original.EndpointsStopFuture type EndpointsUpdateFuture = original.EndpointsUpdateFuture type ErrorResponse = original.ErrorResponse type GeoFilter = original.GeoFilter +type HTTPVersionMatchConditionParameters = original.HTTPVersionMatchConditionParameters type HeaderActionParameters = original.HeaderActionParameters type IPAddressGroup = original.IPAddressGroup type IsDeviceMatchConditionParameters = original.IsDeviceMatchConditionParameters @@ -585,6 +613,9 @@ func PossibleCertificateSourceValues() []CertificateSource { func PossibleCertificateTypeValues() []CertificateType { return original.PossibleCertificateTypeValues() } +func PossibleCookiesOperatorValues() []CookiesOperator { + return original.PossibleCookiesOperatorValues() +} func PossibleCustomDomainResourceStateValues() []CustomDomainResourceState { return original.PossibleCustomDomainResourceStateValues() } @@ -606,6 +637,9 @@ func PossibleGeoFilterActionsValues() []GeoFilterActions { func PossibleHeaderActionValues() []HeaderAction { return original.PossibleHeaderActionValues() } +func PossibleMinimumTLSVersionValues() []MinimumTLSVersion { + return original.PossibleMinimumTLSVersionValues() +} func PossibleNameBasicDeliveryRuleActionValues() []NameBasicDeliveryRuleAction { return original.PossibleNameBasicDeliveryRuleActionValues() } diff --git a/profiles/preview/cognitiveservices/customvision/training/models.go b/profiles/preview/cognitiveservices/customvision/training/models.go index 0a946d6d605e..70ecd6121043 100644 --- a/profiles/preview/cognitiveservices/customvision/training/models.go +++ b/profiles/preview/cognitiveservices/customvision/training/models.go @@ -19,7 +19,7 @@ package training -import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v3.0/customvision/training" +import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v3.1/customvision/training" type Classifier = original.Classifier @@ -78,6 +78,7 @@ const ( BadRequestPredictionResultsExceededCount CustomVisionErrorCodes = original.BadRequestPredictionResultsExceededCount BadRequestPredictionTagsExceededCount CustomVisionErrorCodes = original.BadRequestPredictionTagsExceededCount BadRequestProjectDescription CustomVisionErrorCodes = original.BadRequestProjectDescription + BadRequestProjectImagePreprocessingSettings CustomVisionErrorCodes = original.BadRequestProjectImagePreprocessingSettings BadRequestProjectName CustomVisionErrorCodes = original.BadRequestProjectName BadRequestProjectNameNotUnique CustomVisionErrorCodes = original.BadRequestProjectNameNotUnique BadRequestProjectUnknownClassification CustomVisionErrorCodes = original.BadRequestProjectUnknownClassification @@ -156,11 +157,13 @@ const ( type ExportFlavor = original.ExportFlavor const ( - ARM ExportFlavor = original.ARM - Linux ExportFlavor = original.Linux - ONNX10 ExportFlavor = original.ONNX10 - ONNX12 ExportFlavor = original.ONNX12 - Windows ExportFlavor = original.Windows + ARM ExportFlavor = original.ARM + Linux ExportFlavor = original.Linux + ONNX10 ExportFlavor = original.ONNX10 + ONNX12 ExportFlavor = original.ONNX12 + TensorFlowLite ExportFlavor = original.TensorFlowLite + TensorFlowNormal ExportFlavor = original.TensorFlowNormal + Windows ExportFlavor = original.Windows ) type ExportPlatform = original.ExportPlatform @@ -205,6 +208,13 @@ const ( Suggested OrderBy = original.Suggested ) +type SortBy = original.SortBy + +const ( + UncertaintyAscending SortBy = original.UncertaintyAscending + UncertaintyDescending SortBy = original.UncertaintyDescending +) + type TagType = original.TagType const ( @@ -234,6 +244,7 @@ type ImageIDCreateBatch = original.ImageIDCreateBatch type ImageIDCreateEntry = original.ImageIDCreateEntry type ImagePerformance = original.ImagePerformance type ImagePrediction = original.ImagePrediction +type ImageProcessingSettings = original.ImageProcessingSettings type ImageRegion = original.ImageRegion type ImageRegionCreateBatch = original.ImageRegionCreateBatch type ImageRegionCreateEntry = original.ImageRegionCreateEntry @@ -256,6 +267,7 @@ type ListImage = original.ListImage type ListImagePerformance = original.ListImagePerformance type ListIteration = original.ListIteration type ListProject = original.ListProject +type ListSuggestedTagAndRegion = original.ListSuggestedTagAndRegion type ListTag = original.ListTag type Prediction = original.Prediction type PredictionQueryResult = original.PredictionQueryResult @@ -265,8 +277,14 @@ type Project = original.Project type ProjectSettings = original.ProjectSettings type Region = original.Region type RegionProposal = original.RegionProposal +type SetInt32 = original.SetInt32 type StoredImagePrediction = original.StoredImagePrediction +type StoredSuggestedTagAndRegion = original.StoredSuggestedTagAndRegion +type SuggestedTagAndRegion = original.SuggestedTagAndRegion +type SuggestedTagAndRegionQuery = original.SuggestedTagAndRegionQuery +type SuggestedTagAndRegionQueryToken = original.SuggestedTagAndRegionQueryToken type Tag = original.Tag +type TagFilter = original.TagFilter type TagPerformance = original.TagPerformance func New(aPIKey string, endpoint string) BaseClient { @@ -299,6 +317,9 @@ func PossibleImageCreateStatusValues() []ImageCreateStatus { func PossibleOrderByValues() []OrderBy { return original.PossibleOrderByValues() } +func PossibleSortByValues() []SortBy { + return original.PossibleSortByValues() +} func PossibleTagTypeValues() []TagType { return original.PossibleTagTypeValues() } diff --git a/profiles/preview/cognitiveservices/customvision/training/trainingapi/models.go b/profiles/preview/cognitiveservices/customvision/training/trainingapi/models.go index 0444526d782d..58513bb4fcd7 100644 --- a/profiles/preview/cognitiveservices/customvision/training/trainingapi/models.go +++ b/profiles/preview/cognitiveservices/customvision/training/trainingapi/models.go @@ -19,6 +19,6 @@ package trainingapi -import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v3.0/customvision/training/trainingapi" +import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v3.1/customvision/training/trainingapi" type BaseClientAPI = original.BaseClientAPI diff --git a/profiles/preview/cognitiveservices/mgmt/cognitiveservices/cognitiveservicesapi/models.go b/profiles/preview/cognitiveservices/mgmt/cognitiveservices/cognitiveservicesapi/models.go index f580fe74d7bd..42eca8c78f11 100644 --- a/profiles/preview/cognitiveservices/mgmt/cognitiveservices/cognitiveservicesapi/models.go +++ b/profiles/preview/cognitiveservices/mgmt/cognitiveservices/cognitiveservicesapi/models.go @@ -23,6 +23,5 @@ import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/mg type AccountsClientAPI = original.AccountsClientAPI type BaseClientAPI = original.BaseClientAPI -type CheckSkuAvailabilityClientAPI = original.CheckSkuAvailabilityClientAPI type OperationsClientAPI = original.OperationsClientAPI type ResourceSkusClientAPI = original.ResourceSkusClientAPI diff --git a/profiles/preview/cognitiveservices/mgmt/cognitiveservices/models.go b/profiles/preview/cognitiveservices/mgmt/cognitiveservices/models.go index 31482a83c503..14ca297ee24f 100644 --- a/profiles/preview/cognitiveservices/mgmt/cognitiveservices/models.go +++ b/profiles/preview/cognitiveservices/mgmt/cognitiveservices/models.go @@ -43,13 +43,6 @@ const ( Deny NetworkRuleAction = original.Deny ) -type NetworkRuleBypassOptions = original.NetworkRuleBypassOptions - -const ( - AzureServices NetworkRuleBypassOptions = original.AzureServices - None NetworkRuleBypassOptions = original.None -) - type ProvisioningState = original.ProvisioningState const ( @@ -105,19 +98,17 @@ const ( ) type Account = original.Account -type AccountCreateParameters = original.AccountCreateParameters +type AccountAPIProperties = original.AccountAPIProperties type AccountEnumerateSkusResult = original.AccountEnumerateSkusResult type AccountKeys = original.AccountKeys type AccountListResult = original.AccountListResult type AccountListResultIterator = original.AccountListResultIterator type AccountListResultPage = original.AccountListResultPage type AccountProperties = original.AccountProperties -type AccountUpdateParameters = original.AccountUpdateParameters type AccountsClient = original.AccountsClient type BaseClient = original.BaseClient type CheckDomainAvailabilityParameter = original.CheckDomainAvailabilityParameter type CheckDomainAvailabilityResult = original.CheckDomainAvailabilityResult -type CheckSkuAvailabilityClient = original.CheckSkuAvailabilityClient type CheckSkuAvailabilityParameter = original.CheckSkuAvailabilityParameter type CheckSkuAvailabilityResult = original.CheckSkuAvailabilityResult type CheckSkuAvailabilityResultList = original.CheckSkuAvailabilityResultList @@ -161,12 +152,6 @@ func NewAccountsClient(subscriptionID string) AccountsClient { func NewAccountsClientWithBaseURI(baseURI string, subscriptionID string) AccountsClient { return original.NewAccountsClientWithBaseURI(baseURI, subscriptionID) } -func NewCheckSkuAvailabilityClient(subscriptionID string) CheckSkuAvailabilityClient { - return original.NewCheckSkuAvailabilityClient(subscriptionID) -} -func NewCheckSkuAvailabilityClientWithBaseURI(baseURI string, subscriptionID string) CheckSkuAvailabilityClient { - return original.NewCheckSkuAvailabilityClientWithBaseURI(baseURI, subscriptionID) -} func NewOperationEntityListResultIterator(page OperationEntityListResultPage) OperationEntityListResultIterator { return original.NewOperationEntityListResultIterator(page) } @@ -200,9 +185,6 @@ func PossibleKeyNameValues() []KeyName { func PossibleNetworkRuleActionValues() []NetworkRuleAction { return original.PossibleNetworkRuleActionValues() } -func PossibleNetworkRuleBypassOptionsValues() []NetworkRuleBypassOptions { - return original.PossibleNetworkRuleBypassOptionsValues() -} func PossibleProvisioningStateValues() []ProvisioningState { return original.PossibleProvisioningStateValues() } diff --git a/profiles/preview/compute/mgmt/compute/computeapi/models.go b/profiles/preview/compute/mgmt/compute/computeapi/models.go index dcae23d3b907..680673b3d51e 100644 --- a/profiles/preview/compute/mgmt/compute/computeapi/models.go +++ b/profiles/preview/compute/mgmt/compute/computeapi/models.go @@ -25,6 +25,7 @@ type AvailabilitySetsClientAPI = original.AvailabilitySetsClientAPI type ContainerServicesClientAPI = original.ContainerServicesClientAPI type DedicatedHostGroupsClientAPI = original.DedicatedHostGroupsClientAPI type DedicatedHostsClientAPI = original.DedicatedHostsClientAPI +type DiskEncryptionSetsClientAPI = original.DiskEncryptionSetsClientAPI type DisksClientAPI = original.DisksClientAPI type GalleriesClientAPI = original.GalleriesClientAPI type GalleryApplicationVersionsClientAPI = original.GalleryApplicationVersionsClientAPI @@ -44,6 +45,7 @@ type VirtualMachineImagesClientAPI = original.VirtualMachineImagesClientAPI type VirtualMachineRunCommandsClientAPI = original.VirtualMachineRunCommandsClientAPI type VirtualMachineScaleSetExtensionsClientAPI = original.VirtualMachineScaleSetExtensionsClientAPI type VirtualMachineScaleSetRollingUpgradesClientAPI = original.VirtualMachineScaleSetRollingUpgradesClientAPI +type VirtualMachineScaleSetVMExtensionsClientAPI = original.VirtualMachineScaleSetVMExtensionsClientAPI type VirtualMachineScaleSetVMsClientAPI = original.VirtualMachineScaleSetVMsClientAPI type VirtualMachineScaleSetsClientAPI = original.VirtualMachineScaleSetsClientAPI type VirtualMachineSizesClientAPI = original.VirtualMachineSizesClientAPI diff --git a/profiles/preview/compute/mgmt/compute/models.go b/profiles/preview/compute/mgmt/compute/models.go index 0eb12de56c1f..5c8d68562042 100644 --- a/profiles/preview/compute/mgmt/compute/models.go +++ b/profiles/preview/compute/mgmt/compute/models.go @@ -162,6 +162,12 @@ const ( DiskCreateOptionTypesFromImage DiskCreateOptionTypes = original.DiskCreateOptionTypesFromImage ) +type DiskEncryptionSetIdentityType = original.DiskEncryptionSetIdentityType + +const ( + SystemAssigned DiskEncryptionSetIdentityType = original.SystemAssigned +) + type DiskState = original.DiskState const ( @@ -182,6 +188,13 @@ const ( UltraSSDLRS DiskStorageAccountTypes = original.UltraSSDLRS ) +type EncryptionType = original.EncryptionType + +const ( + EncryptionAtRestWithCustomerKey EncryptionType = original.EncryptionAtRestWithCustomerKey + EncryptionAtRestWithPlatformKey EncryptionType = original.EncryptionAtRestWithPlatformKey +) + type HostCaching = original.HostCaching const ( @@ -654,6 +667,7 @@ type AdditionalCapabilities = original.AdditionalCapabilities type AdditionalUnattendContent = original.AdditionalUnattendContent type AutomaticOSUpgradePolicy = original.AutomaticOSUpgradePolicy type AutomaticOSUpgradeProperties = original.AutomaticOSUpgradeProperties +type AutomaticRepairsPolicy = original.AutomaticRepairsPolicy type AvailabilitySet = original.AvailabilitySet type AvailabilitySetListResult = original.AvailabilitySetListResult type AvailabilitySetListResultIterator = original.AvailabilitySetListResultIterator @@ -712,6 +726,17 @@ type DiagnosticsProfile = original.DiagnosticsProfile type DiffDiskSettings = original.DiffDiskSettings type Disallowed = original.Disallowed type Disk = original.Disk +type DiskEncryptionSet = original.DiskEncryptionSet +type DiskEncryptionSetList = original.DiskEncryptionSetList +type DiskEncryptionSetListIterator = original.DiskEncryptionSetListIterator +type DiskEncryptionSetListPage = original.DiskEncryptionSetListPage +type DiskEncryptionSetParameters = original.DiskEncryptionSetParameters +type DiskEncryptionSetUpdate = original.DiskEncryptionSetUpdate +type DiskEncryptionSetUpdateProperties = original.DiskEncryptionSetUpdateProperties +type DiskEncryptionSetsClient = original.DiskEncryptionSetsClient +type DiskEncryptionSetsCreateOrUpdateFuture = original.DiskEncryptionSetsCreateOrUpdateFuture +type DiskEncryptionSetsDeleteFuture = original.DiskEncryptionSetsDeleteFuture +type DiskEncryptionSetsUpdateFuture = original.DiskEncryptionSetsUpdateFuture type DiskEncryptionSettings = original.DiskEncryptionSettings type DiskInstanceView = original.DiskInstanceView type DiskList = original.DiskList @@ -727,6 +752,9 @@ type DisksDeleteFuture = original.DisksDeleteFuture type DisksGrantAccessFuture = original.DisksGrantAccessFuture type DisksRevokeAccessFuture = original.DisksRevokeAccessFuture type DisksUpdateFuture = original.DisksUpdateFuture +type Encryption = original.Encryption +type EncryptionSetIdentity = original.EncryptionSetIdentity +type EncryptionSetProperties = original.EncryptionSetProperties type EncryptionSettingsCollection = original.EncryptionSettingsCollection type EncryptionSettingsElement = original.EncryptionSettingsElement type GalleriesClient = original.GalleriesClient @@ -784,6 +812,7 @@ type GrantAccessData = original.GrantAccessData type HardwareProfile = original.HardwareProfile type Image = original.Image type ImageDataDisk = original.ImageDataDisk +type ImageDisk = original.ImageDisk type ImageDiskReference = original.ImageDiskReference type ImageListResult = original.ImageListResult type ImageListResultIterator = original.ImageListResultIterator @@ -1006,7 +1035,11 @@ type VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties = origin type VirtualMachineScaleSetUpdateStorageProfile = original.VirtualMachineScaleSetUpdateStorageProfile type VirtualMachineScaleSetUpdateVMProfile = original.VirtualMachineScaleSetUpdateVMProfile type VirtualMachineScaleSetVM = original.VirtualMachineScaleSetVM +type VirtualMachineScaleSetVMExtensionsClient = original.VirtualMachineScaleSetVMExtensionsClient +type VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture = original.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture +type VirtualMachineScaleSetVMExtensionsDeleteFuture = original.VirtualMachineScaleSetVMExtensionsDeleteFuture type VirtualMachineScaleSetVMExtensionsSummary = original.VirtualMachineScaleSetVMExtensionsSummary +type VirtualMachineScaleSetVMExtensionsUpdateFuture = original.VirtualMachineScaleSetVMExtensionsUpdateFuture type VirtualMachineScaleSetVMInstanceIDs = original.VirtualMachineScaleSetVMInstanceIDs type VirtualMachineScaleSetVMInstanceRequiredIDs = original.VirtualMachineScaleSetVMInstanceRequiredIDs type VirtualMachineScaleSetVMInstanceView = original.VirtualMachineScaleSetVMInstanceView @@ -1057,6 +1090,7 @@ type VirtualMachinesDeallocateFuture = original.VirtualMachinesDeallocateFuture type VirtualMachinesDeleteFuture = original.VirtualMachinesDeleteFuture type VirtualMachinesPerformMaintenanceFuture = original.VirtualMachinesPerformMaintenanceFuture type VirtualMachinesPowerOffFuture = original.VirtualMachinesPowerOffFuture +type VirtualMachinesReapplyFuture = original.VirtualMachinesReapplyFuture type VirtualMachinesRedeployFuture = original.VirtualMachinesRedeployFuture type VirtualMachinesReimageFuture = original.VirtualMachinesReimageFuture type VirtualMachinesRestartFuture = original.VirtualMachinesRestartFuture @@ -1118,6 +1152,18 @@ func NewDedicatedHostsClient(subscriptionID string) DedicatedHostsClient { func NewDedicatedHostsClientWithBaseURI(baseURI string, subscriptionID string) DedicatedHostsClient { return original.NewDedicatedHostsClientWithBaseURI(baseURI, subscriptionID) } +func NewDiskEncryptionSetListIterator(page DiskEncryptionSetListPage) DiskEncryptionSetListIterator { + return original.NewDiskEncryptionSetListIterator(page) +} +func NewDiskEncryptionSetListPage(getNextPage func(context.Context, DiskEncryptionSetList) (DiskEncryptionSetList, error)) DiskEncryptionSetListPage { + return original.NewDiskEncryptionSetListPage(getNextPage) +} +func NewDiskEncryptionSetsClient(subscriptionID string) DiskEncryptionSetsClient { + return original.NewDiskEncryptionSetsClient(subscriptionID) +} +func NewDiskEncryptionSetsClientWithBaseURI(baseURI string, subscriptionID string) DiskEncryptionSetsClient { + return original.NewDiskEncryptionSetsClientWithBaseURI(baseURI, subscriptionID) +} func NewDiskListIterator(page DiskListPage) DiskListIterator { return original.NewDiskListIterator(page) } @@ -1340,6 +1386,12 @@ func NewVirtualMachineScaleSetRollingUpgradesClient(subscriptionID string) Virtu func NewVirtualMachineScaleSetRollingUpgradesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetRollingUpgradesClient { return original.NewVirtualMachineScaleSetRollingUpgradesClientWithBaseURI(baseURI, subscriptionID) } +func NewVirtualMachineScaleSetVMExtensionsClient(subscriptionID string) VirtualMachineScaleSetVMExtensionsClient { + return original.NewVirtualMachineScaleSetVMExtensionsClient(subscriptionID) +} +func NewVirtualMachineScaleSetVMExtensionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetVMExtensionsClient { + return original.NewVirtualMachineScaleSetVMExtensionsClientWithBaseURI(baseURI, subscriptionID) +} func NewVirtualMachineScaleSetVMListResultIterator(page VirtualMachineScaleSetVMListResultPage) VirtualMachineScaleSetVMListResultIterator { return original.NewVirtualMachineScaleSetVMListResultIterator(page) } @@ -1406,12 +1458,18 @@ func PossibleDiskCreateOptionTypesValues() []DiskCreateOptionTypes { func PossibleDiskCreateOptionValues() []DiskCreateOption { return original.PossibleDiskCreateOptionValues() } +func PossibleDiskEncryptionSetIdentityTypeValues() []DiskEncryptionSetIdentityType { + return original.PossibleDiskEncryptionSetIdentityTypeValues() +} func PossibleDiskStateValues() []DiskState { return original.PossibleDiskStateValues() } func PossibleDiskStorageAccountTypesValues() []DiskStorageAccountTypes { return original.PossibleDiskStorageAccountTypesValues() } +func PossibleEncryptionTypeValues() []EncryptionType { + return original.PossibleEncryptionTypeValues() +} func PossibleHostCachingValues() []HostCaching { return original.PossibleHostCachingValues() } diff --git a/profiles/preview/containerservice/mgmt/containerservice/containerserviceapi/models.go b/profiles/preview/containerservice/mgmt/containerservice/containerserviceapi/models.go index 2529a9c3888f..2d91c94f8fdd 100644 --- a/profiles/preview/containerservice/mgmt/containerservice/containerserviceapi/models.go +++ b/profiles/preview/containerservice/mgmt/containerservice/containerserviceapi/models.go @@ -19,7 +19,7 @@ package containerserviceapi -import original "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-08-01/containerservice/containerserviceapi" +import original "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-10-01/containerservice/containerserviceapi" type AgentPoolsClientAPI = original.AgentPoolsClientAPI type ContainerServicesClientAPI = original.ContainerServicesClientAPI diff --git a/profiles/preview/containerservice/mgmt/containerservice/models.go b/profiles/preview/containerservice/mgmt/containerservice/models.go index eb51fbccee19..c5f30d22039d 100644 --- a/profiles/preview/containerservice/mgmt/containerservice/models.go +++ b/profiles/preview/containerservice/mgmt/containerservice/models.go @@ -22,7 +22,7 @@ package containerservice import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-08-01/containerservice" + original "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-10-01/containerservice" ) const ( @@ -392,6 +392,7 @@ type ManagedClustersCreateOrUpdateFuture = original.ManagedClustersCreateOrUpdat type ManagedClustersDeleteFuture = original.ManagedClustersDeleteFuture type ManagedClustersResetAADProfileFuture = original.ManagedClustersResetAADProfileFuture type ManagedClustersResetServicePrincipalProfileFuture = original.ManagedClustersResetServicePrincipalProfileFuture +type ManagedClustersRotateClusterCertificatesFuture = original.ManagedClustersRotateClusterCertificatesFuture type ManagedClustersUpdateTagsFuture = original.ManagedClustersUpdateTagsFuture type MasterProfile = original.MasterProfile type NetworkProfile = original.NetworkProfile diff --git a/profiles/preview/costmanagement/mgmt/costmanagement/costmanagementapi/models.go b/profiles/preview/costmanagement/mgmt/costmanagement/costmanagementapi/models.go index 9e5866aad71b..f8a485d17abf 100644 --- a/profiles/preview/costmanagement/mgmt/costmanagement/costmanagementapi/models.go +++ b/profiles/preview/costmanagement/mgmt/costmanagement/costmanagementapi/models.go @@ -19,7 +19,7 @@ package costmanagementapi -import original "github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2019-01-01/costmanagement/costmanagementapi" +import original "github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2019-10-01/costmanagement/costmanagementapi" type DimensionsClientAPI = original.DimensionsClientAPI type ExportsClientAPI = original.ExportsClientAPI diff --git a/profiles/preview/costmanagement/mgmt/costmanagement/models.go b/profiles/preview/costmanagement/mgmt/costmanagement/models.go index 0d0356654726..9c34b91e1c1d 100644 --- a/profiles/preview/costmanagement/mgmt/costmanagement/models.go +++ b/profiles/preview/costmanagement/mgmt/costmanagement/models.go @@ -22,7 +22,7 @@ package costmanagement import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2019-01-01/costmanagement" + original "github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2019-10-01/costmanagement" ) const ( @@ -94,15 +94,13 @@ const ( type TimeframeType = original.TimeframeType const ( - BillingMonthToDate TimeframeType = original.BillingMonthToDate - Custom TimeframeType = original.Custom - MonthToDate TimeframeType = original.MonthToDate - TheLastBillingMonth TimeframeType = original.TheLastBillingMonth - TheLastMonth TimeframeType = original.TheLastMonth - TheLastWeek TimeframeType = original.TheLastWeek - TheLastYear TimeframeType = original.TheLastYear - WeekToDate TimeframeType = original.WeekToDate - YearToDate TimeframeType = original.YearToDate + Custom TimeframeType = original.Custom + MonthToDate TimeframeType = original.MonthToDate + TheLastMonth TimeframeType = original.TheLastMonth + TheLastWeek TimeframeType = original.TheLastWeek + TheLastYear TimeframeType = original.TheLastYear + WeekToDate TimeframeType = original.WeekToDate + YearToDate TimeframeType = original.YearToDate ) type BaseClient = original.BaseClient @@ -130,7 +128,6 @@ type OperationListResult = original.OperationListResult type OperationListResultIterator = original.OperationListResultIterator type OperationListResultPage = original.OperationListResultPage type OperationsClient = original.OperationsClient -type Query = original.Query type QueryAggregation = original.QueryAggregation type QueryClient = original.QueryClient type QueryColumn = original.QueryColumn diff --git a/profiles/preview/datafactory/mgmt/datafactory/models.go b/profiles/preview/datafactory/mgmt/datafactory/models.go index fd2334ff249f..49ed031c0d23 100644 --- a/profiles/preview/datafactory/mgmt/datafactory/models.go +++ b/profiles/preview/datafactory/mgmt/datafactory/models.go @@ -155,8 +155,9 @@ const ( type DynamicsAuthenticationType = original.DynamicsAuthenticationType const ( - Ifd DynamicsAuthenticationType = original.Ifd - Office365 DynamicsAuthenticationType = original.Office365 + AADServicePrincipal DynamicsAuthenticationType = original.AADServicePrincipal + Ifd DynamicsAuthenticationType = original.Ifd + Office365 DynamicsAuthenticationType = original.Office365 ) type DynamicsDeploymentType = original.DynamicsDeploymentType @@ -393,6 +394,14 @@ const ( OraclePartitionOptionPhysicalPartitionsOfTable OraclePartitionOption = original.OraclePartitionOptionPhysicalPartitionsOfTable ) +type OrcCompressionCodec = original.OrcCompressionCodec + +const ( + OrcCompressionCodecNone OrcCompressionCodec = original.OrcCompressionCodecNone + OrcCompressionCodecSnappy OrcCompressionCodec = original.OrcCompressionCodecSnappy + OrcCompressionCodecZlib OrcCompressionCodec = original.OrcCompressionCodecZlib +) + type ParameterType = original.ParameterType const ( @@ -674,6 +683,7 @@ const ( TypeAzureDataExplorerCommand TypeBasicActivity = original.TypeAzureDataExplorerCommand TypeAzureFunctionActivity TypeBasicActivity = original.TypeAzureFunctionActivity TypeAzureMLBatchExecution TypeBasicActivity = original.TypeAzureMLBatchExecution + TypeAzureMLExecutePipeline TypeBasicActivity = original.TypeAzureMLExecutePipeline TypeAzureMLUpdateResource TypeBasicActivity = original.TypeAzureMLUpdateResource TypeContainer TypeBasicActivity = original.TypeContainer TypeCopy TypeBasicActivity = original.TypeCopy @@ -699,6 +709,7 @@ const ( TypeLookup TypeBasicActivity = original.TypeLookup TypeSetVariable TypeBasicActivity = original.TypeSetVariable TypeSQLServerStoredProcedure TypeBasicActivity = original.TypeSQLServerStoredProcedure + TypeSwitch TypeBasicActivity = original.TypeSwitch TypeUntil TypeBasicActivity = original.TypeUntil TypeValidation TypeBasicActivity = original.TypeValidation TypeWait TypeBasicActivity = original.TypeWait @@ -1015,10 +1026,12 @@ const ( TypeAzureDataExplorer TypeBasicLinkedService = original.TypeAzureDataExplorer TypeAzureDataLakeAnalytics TypeBasicLinkedService = original.TypeAzureDataLakeAnalytics TypeAzureDataLakeStore TypeBasicLinkedService = original.TypeAzureDataLakeStore + TypeAzureFileStorage TypeBasicLinkedService = original.TypeAzureFileStorage TypeAzureFunction TypeBasicLinkedService = original.TypeAzureFunction TypeAzureKeyVault TypeBasicLinkedService = original.TypeAzureKeyVault TypeAzureMariaDB TypeBasicLinkedService = original.TypeAzureMariaDB TypeAzureML TypeBasicLinkedService = original.TypeAzureML + TypeAzureMLService TypeBasicLinkedService = original.TypeAzureMLService TypeAzureMySQL TypeBasicLinkedService = original.TypeAzureMySQL TypeAzurePostgreSQL TypeBasicLinkedService = original.TypeAzurePostgreSQL TypeAzureSearch TypeBasicLinkedService = original.TypeAzureSearch @@ -1044,6 +1057,7 @@ const ( TypeFtpServer TypeBasicLinkedService = original.TypeFtpServer TypeGoogleAdWords TypeBasicLinkedService = original.TypeGoogleAdWords TypeGoogleBigQuery TypeBasicLinkedService = original.TypeGoogleBigQuery + TypeGoogleCloudStorage TypeBasicLinkedService = original.TypeGoogleCloudStorage TypeGreenplum TypeBasicLinkedService = original.TypeGreenplum TypeHBase TypeBasicLinkedService = original.TypeHBase TypeHdfs TypeBasicLinkedService = original.TypeHdfs @@ -1225,6 +1239,10 @@ type AzureDataLakeStoreSource = original.AzureDataLakeStoreSource type AzureDataLakeStoreWriteSettings = original.AzureDataLakeStoreWriteSettings type AzureDatabricksLinkedService = original.AzureDatabricksLinkedService type AzureDatabricksLinkedServiceTypeProperties = original.AzureDatabricksLinkedServiceTypeProperties +type AzureFileStorageLinkedService = original.AzureFileStorageLinkedService +type AzureFileStorageLinkedServiceTypeProperties = original.AzureFileStorageLinkedServiceTypeProperties +type AzureFileStorageLocation = original.AzureFileStorageLocation +type AzureFileStorageReadSettings = original.AzureFileStorageReadSettings type AzureFunctionActivity = original.AzureFunctionActivity type AzureFunctionActivityTypeProperties = original.AzureFunctionActivityTypeProperties type AzureFunctionLinkedService = original.AzureFunctionLinkedService @@ -1234,8 +1252,12 @@ type AzureKeyVaultLinkedServiceTypeProperties = original.AzureKeyVaultLinkedServ type AzureKeyVaultSecretReference = original.AzureKeyVaultSecretReference type AzureMLBatchExecutionActivity = original.AzureMLBatchExecutionActivity type AzureMLBatchExecutionActivityTypeProperties = original.AzureMLBatchExecutionActivityTypeProperties +type AzureMLExecutePipelineActivity = original.AzureMLExecutePipelineActivity +type AzureMLExecutePipelineActivityTypeProperties = original.AzureMLExecutePipelineActivityTypeProperties type AzureMLLinkedService = original.AzureMLLinkedService type AzureMLLinkedServiceTypeProperties = original.AzureMLLinkedServiceTypeProperties +type AzureMLServiceLinkedService = original.AzureMLServiceLinkedService +type AzureMLServiceLinkedServiceTypeProperties = original.AzureMLServiceLinkedServiceTypeProperties type AzureMLUpdateResourceActivity = original.AzureMLUpdateResourceActivity type AzureMLUpdateResourceActivityTypeProperties = original.AzureMLUpdateResourceActivityTypeProperties type AzureMLWebServiceFile = original.AzureMLWebServiceFile @@ -1376,6 +1398,7 @@ type DataFlowDebugCommandRequest = original.DataFlowDebugCommandRequest type DataFlowDebugCommandResponse = original.DataFlowDebugCommandResponse type DataFlowDebugPackage = original.DataFlowDebugPackage type DataFlowDebugPackageDebugSettings = original.DataFlowDebugPackageDebugSettings +type DataFlowDebugResource = original.DataFlowDebugResource type DataFlowDebugSessionClient = original.DataFlowDebugSessionClient type DataFlowDebugSessionCreateFuture = original.DataFlowDebugSessionCreateFuture type DataFlowDebugSessionExecuteCommandFuture = original.DataFlowDebugSessionExecuteCommandFuture @@ -1402,6 +1425,7 @@ type DatabricksSparkPythonActivityTypeProperties = original.DatabricksSparkPytho type Dataset = original.Dataset type DatasetBZip2Compression = original.DatasetBZip2Compression type DatasetCompression = original.DatasetCompression +type DatasetDebugResource = original.DatasetDebugResource type DatasetDeflateCompression = original.DatasetDeflateCompression type DatasetFolder = original.DatasetFolder type DatasetGZipCompression = original.DatasetGZipCompression @@ -1521,6 +1545,10 @@ type GoogleBigQueryLinkedService = original.GoogleBigQueryLinkedService type GoogleBigQueryLinkedServiceTypeProperties = original.GoogleBigQueryLinkedServiceTypeProperties type GoogleBigQueryObjectDataset = original.GoogleBigQueryObjectDataset type GoogleBigQuerySource = original.GoogleBigQuerySource +type GoogleCloudStorageLinkedService = original.GoogleCloudStorageLinkedService +type GoogleCloudStorageLinkedServiceTypeProperties = original.GoogleCloudStorageLinkedServiceTypeProperties +type GoogleCloudStorageLocation = original.GoogleCloudStorageLocation +type GoogleCloudStorageReadSettings = original.GoogleCloudStorageReadSettings type GreenplumDatasetTypeProperties = original.GreenplumDatasetTypeProperties type GreenplumLinkedService = original.GreenplumLinkedService type GreenplumLinkedServiceTypeProperties = original.GreenplumLinkedServiceTypeProperties @@ -1585,6 +1613,7 @@ type IntegrationRuntimeConnectionInfo = original.IntegrationRuntimeConnectionInf type IntegrationRuntimeCustomSetupScriptProperties = original.IntegrationRuntimeCustomSetupScriptProperties type IntegrationRuntimeDataFlowProperties = original.IntegrationRuntimeDataFlowProperties type IntegrationRuntimeDataProxyProperties = original.IntegrationRuntimeDataProxyProperties +type IntegrationRuntimeDebugResource = original.IntegrationRuntimeDebugResource type IntegrationRuntimeListResponse = original.IntegrationRuntimeListResponse type IntegrationRuntimeListResponseIterator = original.IntegrationRuntimeListResponseIterator type IntegrationRuntimeListResponsePage = original.IntegrationRuntimeListResponsePage @@ -1623,6 +1652,7 @@ type LinkedIntegrationRuntimeRbacAuthorization = original.LinkedIntegrationRunti type LinkedIntegrationRuntimeRequest = original.LinkedIntegrationRuntimeRequest type LinkedIntegrationRuntimeType = original.LinkedIntegrationRuntimeType type LinkedService = original.LinkedService +type LinkedServiceDebugResource = original.LinkedServiceDebugResource type LinkedServiceListResponse = original.LinkedServiceListResponse type LinkedServiceListResponseIterator = original.LinkedServiceListResponseIterator type LinkedServiceListResponsePage = original.LinkedServiceListResponsePage @@ -1922,6 +1952,10 @@ type StoreReadSettings = original.StoreReadSettings type StoreWriteSettings = original.StoreWriteSettings type StoredProcedureParameter = original.StoredProcedureParameter type SubResource = original.SubResource +type SubResourceDebugResource = original.SubResourceDebugResource +type SwitchActivity = original.SwitchActivity +type SwitchActivityTypeProperties = original.SwitchActivityTypeProperties +type SwitchCase = original.SwitchCase type SybaseLinkedService = original.SybaseLinkedService type SybaseLinkedServiceTypeProperties = original.SybaseLinkedServiceTypeProperties type SybaseSource = original.SybaseSource @@ -2285,6 +2319,9 @@ func PossibleODataAuthenticationTypeValues() []ODataAuthenticationType { func PossibleOraclePartitionOptionValues() []OraclePartitionOption { return original.PossibleOraclePartitionOptionValues() } +func PossibleOrcCompressionCodecValues() []OrcCompressionCodec { + return original.PossibleOrcCompressionCodecValues() +} func PossibleParameterTypeValues() []ParameterType { return original.PossibleParameterTypeValues() } diff --git a/profiles/preview/datashare/mgmt/datashare/datashareapi/models.go b/profiles/preview/datashare/mgmt/datashare/datashareapi/models.go new file mode 100644 index 000000000000..9f24dd90d35d --- /dev/null +++ b/profiles/preview/datashare/mgmt/datashare/datashareapi/models.go @@ -0,0 +1,35 @@ +// +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 datashareapi + +import original "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/datashareapi" + +type AccountsClientAPI = original.AccountsClientAPI +type ConsumerInvitationsClientAPI = original.ConsumerInvitationsClientAPI +type ConsumerSourceDataSetsClientAPI = original.ConsumerSourceDataSetsClientAPI +type DataSetMappingsClientAPI = original.DataSetMappingsClientAPI +type DataSetsClientAPI = original.DataSetsClientAPI +type InvitationsClientAPI = original.InvitationsClientAPI +type OperationsClientAPI = original.OperationsClientAPI +type ProviderShareSubscriptionsClientAPI = original.ProviderShareSubscriptionsClientAPI +type ShareSubscriptionsClientAPI = original.ShareSubscriptionsClientAPI +type SharesClientAPI = original.SharesClientAPI +type SynchronizationSettingsClientAPI = original.SynchronizationSettingsClientAPI +type TriggersClientAPI = original.TriggersClientAPI diff --git a/profiles/preview/datashare/mgmt/datashare/models.go b/profiles/preview/datashare/mgmt/datashare/models.go new file mode 100644 index 000000000000..77a3c148668d --- /dev/null +++ b/profiles/preview/datashare/mgmt/datashare/models.go @@ -0,0 +1,591 @@ +// +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 datashare + +import ( + "context" + + original "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" +) + +const ( + DefaultBaseURI = original.DefaultBaseURI +) + +type DataSetMappingStatus = original.DataSetMappingStatus + +const ( + Broken DataSetMappingStatus = original.Broken + Ok DataSetMappingStatus = original.Ok +) + +type DataSetType = original.DataSetType + +const ( + AdlsGen1File DataSetType = original.AdlsGen1File + AdlsGen1Folder DataSetType = original.AdlsGen1Folder + AdlsGen2File DataSetType = original.AdlsGen2File + AdlsGen2FileSystem DataSetType = original.AdlsGen2FileSystem + AdlsGen2Folder DataSetType = original.AdlsGen2Folder + Blob DataSetType = original.Blob + BlobFolder DataSetType = original.BlobFolder + Container DataSetType = original.Container + KustoCluster DataSetType = original.KustoCluster + KustoDatabase DataSetType = original.KustoDatabase + SQLDBTable DataSetType = original.SQLDBTable + SQLDWTable DataSetType = original.SQLDWTable +) + +type InvitationStatus = original.InvitationStatus + +const ( + Accepted InvitationStatus = original.Accepted + Pending InvitationStatus = original.Pending + Rejected InvitationStatus = original.Rejected + Withdrawn InvitationStatus = original.Withdrawn +) + +type Kind = original.Kind + +const ( + KindAdlsGen1File Kind = original.KindAdlsGen1File + KindAdlsGen1Folder Kind = original.KindAdlsGen1Folder + KindAdlsGen2File Kind = original.KindAdlsGen2File + KindAdlsGen2FileSystem Kind = original.KindAdlsGen2FileSystem + KindAdlsGen2Folder Kind = original.KindAdlsGen2Folder + KindBlob Kind = original.KindBlob + KindBlobFolder Kind = original.KindBlobFolder + KindContainer Kind = original.KindContainer + KindDataSet Kind = original.KindDataSet + KindKustoCluster Kind = original.KindKustoCluster + KindKustoDatabase Kind = original.KindKustoDatabase + KindSQLDBTable Kind = original.KindSQLDBTable + KindSQLDWTable Kind = original.KindSQLDWTable +) + +type KindBasicDataSetMapping = original.KindBasicDataSetMapping + +const ( + KindBasicDataSetMappingKindAdlsGen2File KindBasicDataSetMapping = original.KindBasicDataSetMappingKindAdlsGen2File + KindBasicDataSetMappingKindAdlsGen2FileSystem KindBasicDataSetMapping = original.KindBasicDataSetMappingKindAdlsGen2FileSystem + KindBasicDataSetMappingKindAdlsGen2Folder KindBasicDataSetMapping = original.KindBasicDataSetMappingKindAdlsGen2Folder + KindBasicDataSetMappingKindBlob KindBasicDataSetMapping = original.KindBasicDataSetMappingKindBlob + KindBasicDataSetMappingKindBlobFolder KindBasicDataSetMapping = original.KindBasicDataSetMappingKindBlobFolder + KindBasicDataSetMappingKindContainer KindBasicDataSetMapping = original.KindBasicDataSetMappingKindContainer + KindBasicDataSetMappingKindDataSetMapping KindBasicDataSetMapping = original.KindBasicDataSetMappingKindDataSetMapping + KindBasicDataSetMappingKindKustoCluster KindBasicDataSetMapping = original.KindBasicDataSetMappingKindKustoCluster + KindBasicDataSetMappingKindKustoDatabase KindBasicDataSetMapping = original.KindBasicDataSetMappingKindKustoDatabase + KindBasicDataSetMappingKindSQLDBTable KindBasicDataSetMapping = original.KindBasicDataSetMappingKindSQLDBTable + KindBasicDataSetMappingKindSQLDWTable KindBasicDataSetMapping = original.KindBasicDataSetMappingKindSQLDWTable +) + +type KindBasicSourceShareSynchronizationSetting = original.KindBasicSourceShareSynchronizationSetting + +const ( + KindScheduleBased KindBasicSourceShareSynchronizationSetting = original.KindScheduleBased + KindSourceShareSynchronizationSetting KindBasicSourceShareSynchronizationSetting = original.KindSourceShareSynchronizationSetting +) + +type KindBasicSynchronizationSetting = original.KindBasicSynchronizationSetting + +const ( + KindBasicSynchronizationSettingKindScheduleBased KindBasicSynchronizationSetting = original.KindBasicSynchronizationSettingKindScheduleBased + KindBasicSynchronizationSettingKindSynchronizationSetting KindBasicSynchronizationSetting = original.KindBasicSynchronizationSettingKindSynchronizationSetting +) + +type KindBasicTrigger = original.KindBasicTrigger + +const ( + KindBasicTriggerKindScheduleBased KindBasicTrigger = original.KindBasicTriggerKindScheduleBased + KindBasicTriggerKindTrigger KindBasicTrigger = original.KindBasicTriggerKindTrigger +) + +type OutputType = original.OutputType + +const ( + Csv OutputType = original.Csv + Parquet OutputType = original.Parquet +) + +type ProvisioningState = original.ProvisioningState + +const ( + Creating ProvisioningState = original.Creating + Deleting ProvisioningState = original.Deleting + Failed ProvisioningState = original.Failed + Moving ProvisioningState = original.Moving + Succeeded ProvisioningState = original.Succeeded +) + +type RecurrenceInterval = original.RecurrenceInterval + +const ( + Day RecurrenceInterval = original.Day + Hour RecurrenceInterval = original.Hour +) + +type ShareKind = original.ShareKind + +const ( + CopyBased ShareKind = original.CopyBased + InPlace ShareKind = original.InPlace +) + +type ShareSubscriptionStatus = original.ShareSubscriptionStatus + +const ( + Active ShareSubscriptionStatus = original.Active + Revoked ShareSubscriptionStatus = original.Revoked + Revoking ShareSubscriptionStatus = original.Revoking + SourceDeleted ShareSubscriptionStatus = original.SourceDeleted +) + +type Status = original.Status + +const ( + StatusAccepted Status = original.StatusAccepted + StatusCanceled Status = original.StatusCanceled + StatusFailed Status = original.StatusFailed + StatusInProgress Status = original.StatusInProgress + StatusSucceeded Status = original.StatusSucceeded + StatusTransientFailure Status = original.StatusTransientFailure +) + +type SynchronizationMode = original.SynchronizationMode + +const ( + FullSync SynchronizationMode = original.FullSync + Incremental SynchronizationMode = original.Incremental +) + +type TriggerStatus = original.TriggerStatus + +const ( + TriggerStatusActive TriggerStatus = original.TriggerStatusActive + TriggerStatusInactive TriggerStatus = original.TriggerStatusInactive + TriggerStatusSourceSynchronizationSettingDeleted TriggerStatus = original.TriggerStatusSourceSynchronizationSettingDeleted +) + +type Type = original.Type + +const ( + SystemAssigned Type = original.SystemAssigned +) + +type ADLSGen1FileDataSet = original.ADLSGen1FileDataSet +type ADLSGen1FileProperties = original.ADLSGen1FileProperties +type ADLSGen1FolderDataSet = original.ADLSGen1FolderDataSet +type ADLSGen1FolderProperties = original.ADLSGen1FolderProperties +type ADLSGen2FileDataSet = original.ADLSGen2FileDataSet +type ADLSGen2FileDataSetMapping = original.ADLSGen2FileDataSetMapping +type ADLSGen2FileDataSetMappingProperties = original.ADLSGen2FileDataSetMappingProperties +type ADLSGen2FileProperties = original.ADLSGen2FileProperties +type ADLSGen2FileSystemDataSet = original.ADLSGen2FileSystemDataSet +type ADLSGen2FileSystemDataSetMapping = original.ADLSGen2FileSystemDataSetMapping +type ADLSGen2FileSystemDataSetMappingProperties = original.ADLSGen2FileSystemDataSetMappingProperties +type ADLSGen2FileSystemProperties = original.ADLSGen2FileSystemProperties +type ADLSGen2FolderDataSet = original.ADLSGen2FolderDataSet +type ADLSGen2FolderDataSetMapping = original.ADLSGen2FolderDataSetMapping +type ADLSGen2FolderDataSetMappingProperties = original.ADLSGen2FolderDataSetMappingProperties +type ADLSGen2FolderProperties = original.ADLSGen2FolderProperties +type Account = original.Account +type AccountList = original.AccountList +type AccountListIterator = original.AccountListIterator +type AccountListPage = original.AccountListPage +type AccountProperties = original.AccountProperties +type AccountUpdateParameters = original.AccountUpdateParameters +type AccountsClient = original.AccountsClient +type AccountsCreateFuture = original.AccountsCreateFuture +type AccountsDeleteFuture = original.AccountsDeleteFuture +type BaseClient = original.BaseClient +type BasicDataSet = original.BasicDataSet +type BasicDataSetMapping = original.BasicDataSetMapping +type BasicSourceShareSynchronizationSetting = original.BasicSourceShareSynchronizationSetting +type BasicSynchronizationSetting = original.BasicSynchronizationSetting +type BasicTrigger = original.BasicTrigger +type BlobContainerDataSet = original.BlobContainerDataSet +type BlobContainerDataSetMapping = original.BlobContainerDataSetMapping +type BlobContainerMappingProperties = original.BlobContainerMappingProperties +type BlobContainerProperties = original.BlobContainerProperties +type BlobDataSet = original.BlobDataSet +type BlobDataSetMapping = original.BlobDataSetMapping +type BlobFolderDataSet = original.BlobFolderDataSet +type BlobFolderDataSetMapping = original.BlobFolderDataSetMapping +type BlobFolderMappingProperties = original.BlobFolderMappingProperties +type BlobFolderProperties = original.BlobFolderProperties +type BlobMappingProperties = original.BlobMappingProperties +type BlobProperties = original.BlobProperties +type ConsumerInvitation = original.ConsumerInvitation +type ConsumerInvitationList = original.ConsumerInvitationList +type ConsumerInvitationListIterator = original.ConsumerInvitationListIterator +type ConsumerInvitationListPage = original.ConsumerInvitationListPage +type ConsumerInvitationProperties = original.ConsumerInvitationProperties +type ConsumerInvitationsClient = original.ConsumerInvitationsClient +type ConsumerSourceDataSet = original.ConsumerSourceDataSet +type ConsumerSourceDataSetList = original.ConsumerSourceDataSetList +type ConsumerSourceDataSetListIterator = original.ConsumerSourceDataSetListIterator +type ConsumerSourceDataSetListPage = original.ConsumerSourceDataSetListPage +type ConsumerSourceDataSetProperties = original.ConsumerSourceDataSetProperties +type ConsumerSourceDataSetsClient = original.ConsumerSourceDataSetsClient +type DataSet = original.DataSet +type DataSetList = original.DataSetList +type DataSetListIterator = original.DataSetListIterator +type DataSetListPage = original.DataSetListPage +type DataSetMapping = original.DataSetMapping +type DataSetMappingList = original.DataSetMappingList +type DataSetMappingListIterator = original.DataSetMappingListIterator +type DataSetMappingListPage = original.DataSetMappingListPage +type DataSetMappingModel = original.DataSetMappingModel +type DataSetMappingsClient = original.DataSetMappingsClient +type DataSetModel = original.DataSetModel +type DataSetsClient = original.DataSetsClient +type DataSetsDeleteFuture = original.DataSetsDeleteFuture +type DefaultDto = original.DefaultDto +type DimensionProperties = original.DimensionProperties +type Error = original.Error +type ErrorInfo = original.ErrorInfo +type Identity = original.Identity +type Invitation = original.Invitation +type InvitationList = original.InvitationList +type InvitationListIterator = original.InvitationListIterator +type InvitationListPage = original.InvitationListPage +type InvitationProperties = original.InvitationProperties +type InvitationsClient = original.InvitationsClient +type KustoClusterDataSet = original.KustoClusterDataSet +type KustoClusterDataSetMapping = original.KustoClusterDataSetMapping +type KustoClusterDataSetMappingProperties = original.KustoClusterDataSetMappingProperties +type KustoClusterDataSetProperties = original.KustoClusterDataSetProperties +type KustoDatabaseDataSet = original.KustoDatabaseDataSet +type KustoDatabaseDataSetMapping = original.KustoDatabaseDataSetMapping +type KustoDatabaseDataSetMappingProperties = original.KustoDatabaseDataSetMappingProperties +type KustoDatabaseDataSetProperties = original.KustoDatabaseDataSetProperties +type OperationList = original.OperationList +type OperationListIterator = original.OperationListIterator +type OperationListPage = original.OperationListPage +type OperationMetaLogSpecification = original.OperationMetaLogSpecification +type OperationMetaMetricSpecification = original.OperationMetaMetricSpecification +type OperationMetaPropertyInfo = original.OperationMetaPropertyInfo +type OperationMetaServiceSpecification = original.OperationMetaServiceSpecification +type OperationModel = original.OperationModel +type OperationModelProperties = original.OperationModelProperties +type OperationResponse = original.OperationResponse +type OperationsClient = original.OperationsClient +type ProviderShareSubscription = original.ProviderShareSubscription +type ProviderShareSubscriptionList = original.ProviderShareSubscriptionList +type ProviderShareSubscriptionListIterator = original.ProviderShareSubscriptionListIterator +type ProviderShareSubscriptionListPage = original.ProviderShareSubscriptionListPage +type ProviderShareSubscriptionProperties = original.ProviderShareSubscriptionProperties +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 +type ScheduledSynchronizationSettingProperties = original.ScheduledSynchronizationSettingProperties +type ScheduledTrigger = original.ScheduledTrigger +type ScheduledTriggerProperties = original.ScheduledTriggerProperties +type Share = original.Share +type ShareList = original.ShareList +type ShareListIterator = original.ShareListIterator +type ShareListPage = original.ShareListPage +type ShareProperties = original.ShareProperties +type ShareSubscription = original.ShareSubscription +type ShareSubscriptionList = original.ShareSubscriptionList +type ShareSubscriptionListIterator = original.ShareSubscriptionListIterator +type ShareSubscriptionListPage = original.ShareSubscriptionListPage +type ShareSubscriptionProperties = original.ShareSubscriptionProperties +type ShareSubscriptionSynchronization = original.ShareSubscriptionSynchronization +type ShareSubscriptionSynchronizationList = original.ShareSubscriptionSynchronizationList +type ShareSubscriptionSynchronizationListIterator = original.ShareSubscriptionSynchronizationListIterator +type ShareSubscriptionSynchronizationListPage = original.ShareSubscriptionSynchronizationListPage +type ShareSubscriptionsCancelSynchronizationFuture = original.ShareSubscriptionsCancelSynchronizationFuture +type ShareSubscriptionsClient = original.ShareSubscriptionsClient +type ShareSubscriptionsDeleteFuture = original.ShareSubscriptionsDeleteFuture +type ShareSubscriptionsSynchronizeMethodFuture = original.ShareSubscriptionsSynchronizeMethodFuture +type ShareSynchronization = original.ShareSynchronization +type ShareSynchronizationList = original.ShareSynchronizationList +type ShareSynchronizationListIterator = original.ShareSynchronizationListIterator +type ShareSynchronizationListPage = original.ShareSynchronizationListPage +type SharesClient = original.SharesClient +type SharesDeleteFuture = original.SharesDeleteFuture +type SourceShareSynchronizationSetting = original.SourceShareSynchronizationSetting +type SourceShareSynchronizationSettingList = original.SourceShareSynchronizationSettingList +type SourceShareSynchronizationSettingListIterator = original.SourceShareSynchronizationSettingListIterator +type SourceShareSynchronizationSettingListPage = original.SourceShareSynchronizationSettingListPage +type SynchronizationDetails = original.SynchronizationDetails +type SynchronizationDetailsList = original.SynchronizationDetailsList +type SynchronizationDetailsListIterator = original.SynchronizationDetailsListIterator +type SynchronizationDetailsListPage = original.SynchronizationDetailsListPage +type SynchronizationSetting = original.SynchronizationSetting +type SynchronizationSettingList = original.SynchronizationSettingList +type SynchronizationSettingListIterator = original.SynchronizationSettingListIterator +type SynchronizationSettingListPage = original.SynchronizationSettingListPage +type SynchronizationSettingModel = original.SynchronizationSettingModel +type SynchronizationSettingsClient = original.SynchronizationSettingsClient +type SynchronizationSettingsDeleteFuture = original.SynchronizationSettingsDeleteFuture +type Synchronize = original.Synchronize +type Trigger = original.Trigger +type TriggerList = original.TriggerList +type TriggerListIterator = original.TriggerListIterator +type TriggerListPage = original.TriggerListPage +type TriggerModel = original.TriggerModel +type TriggersClient = original.TriggersClient +type TriggersCreateFuture = original.TriggersCreateFuture +type TriggersDeleteFuture = original.TriggersDeleteFuture + +func New(subscriptionID string) BaseClient { + return original.New(subscriptionID) +} +func NewAccountListIterator(page AccountListPage) AccountListIterator { + return original.NewAccountListIterator(page) +} +func NewAccountListPage(getNextPage func(context.Context, AccountList) (AccountList, error)) AccountListPage { + return original.NewAccountListPage(getNextPage) +} +func NewAccountsClient(subscriptionID string) AccountsClient { + return original.NewAccountsClient(subscriptionID) +} +func NewAccountsClientWithBaseURI(baseURI string, subscriptionID string) AccountsClient { + return original.NewAccountsClientWithBaseURI(baseURI, subscriptionID) +} +func NewConsumerInvitationListIterator(page ConsumerInvitationListPage) ConsumerInvitationListIterator { + return original.NewConsumerInvitationListIterator(page) +} +func NewConsumerInvitationListPage(getNextPage func(context.Context, ConsumerInvitationList) (ConsumerInvitationList, error)) ConsumerInvitationListPage { + return original.NewConsumerInvitationListPage(getNextPage) +} +func NewConsumerInvitationsClient(subscriptionID string) ConsumerInvitationsClient { + return original.NewConsumerInvitationsClient(subscriptionID) +} +func NewConsumerInvitationsClientWithBaseURI(baseURI string, subscriptionID string) ConsumerInvitationsClient { + return original.NewConsumerInvitationsClientWithBaseURI(baseURI, subscriptionID) +} +func NewConsumerSourceDataSetListIterator(page ConsumerSourceDataSetListPage) ConsumerSourceDataSetListIterator { + return original.NewConsumerSourceDataSetListIterator(page) +} +func NewConsumerSourceDataSetListPage(getNextPage func(context.Context, ConsumerSourceDataSetList) (ConsumerSourceDataSetList, error)) ConsumerSourceDataSetListPage { + return original.NewConsumerSourceDataSetListPage(getNextPage) +} +func NewConsumerSourceDataSetsClient(subscriptionID string) ConsumerSourceDataSetsClient { + return original.NewConsumerSourceDataSetsClient(subscriptionID) +} +func NewConsumerSourceDataSetsClientWithBaseURI(baseURI string, subscriptionID string) ConsumerSourceDataSetsClient { + return original.NewConsumerSourceDataSetsClientWithBaseURI(baseURI, subscriptionID) +} +func NewDataSetListIterator(page DataSetListPage) DataSetListIterator { + return original.NewDataSetListIterator(page) +} +func NewDataSetListPage(getNextPage func(context.Context, DataSetList) (DataSetList, error)) DataSetListPage { + return original.NewDataSetListPage(getNextPage) +} +func NewDataSetMappingListIterator(page DataSetMappingListPage) DataSetMappingListIterator { + return original.NewDataSetMappingListIterator(page) +} +func NewDataSetMappingListPage(getNextPage func(context.Context, DataSetMappingList) (DataSetMappingList, error)) DataSetMappingListPage { + return original.NewDataSetMappingListPage(getNextPage) +} +func NewDataSetMappingsClient(subscriptionID string) DataSetMappingsClient { + return original.NewDataSetMappingsClient(subscriptionID) +} +func NewDataSetMappingsClientWithBaseURI(baseURI string, subscriptionID string) DataSetMappingsClient { + return original.NewDataSetMappingsClientWithBaseURI(baseURI, subscriptionID) +} +func NewDataSetsClient(subscriptionID string) DataSetsClient { + return original.NewDataSetsClient(subscriptionID) +} +func NewDataSetsClientWithBaseURI(baseURI string, subscriptionID string) DataSetsClient { + return original.NewDataSetsClientWithBaseURI(baseURI, subscriptionID) +} +func NewInvitationListIterator(page InvitationListPage) InvitationListIterator { + return original.NewInvitationListIterator(page) +} +func NewInvitationListPage(getNextPage func(context.Context, InvitationList) (InvitationList, error)) InvitationListPage { + return original.NewInvitationListPage(getNextPage) +} +func NewInvitationsClient(subscriptionID string) InvitationsClient { + return original.NewInvitationsClient(subscriptionID) +} +func NewInvitationsClientWithBaseURI(baseURI string, subscriptionID string) InvitationsClient { + return original.NewInvitationsClientWithBaseURI(baseURI, subscriptionID) +} +func NewOperationListIterator(page OperationListPage) OperationListIterator { + return original.NewOperationListIterator(page) +} +func NewOperationListPage(getNextPage func(context.Context, OperationList) (OperationList, error)) OperationListPage { + return original.NewOperationListPage(getNextPage) +} +func NewOperationsClient(subscriptionID string) OperationsClient { + return original.NewOperationsClient(subscriptionID) +} +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) +} +func NewProviderShareSubscriptionListIterator(page ProviderShareSubscriptionListPage) ProviderShareSubscriptionListIterator { + return original.NewProviderShareSubscriptionListIterator(page) +} +func NewProviderShareSubscriptionListPage(getNextPage func(context.Context, ProviderShareSubscriptionList) (ProviderShareSubscriptionList, error)) ProviderShareSubscriptionListPage { + return original.NewProviderShareSubscriptionListPage(getNextPage) +} +func NewProviderShareSubscriptionsClient(subscriptionID string) ProviderShareSubscriptionsClient { + return original.NewProviderShareSubscriptionsClient(subscriptionID) +} +func NewProviderShareSubscriptionsClientWithBaseURI(baseURI string, subscriptionID string) ProviderShareSubscriptionsClient { + return original.NewProviderShareSubscriptionsClientWithBaseURI(baseURI, subscriptionID) +} +func NewShareListIterator(page ShareListPage) ShareListIterator { + return original.NewShareListIterator(page) +} +func NewShareListPage(getNextPage func(context.Context, ShareList) (ShareList, error)) ShareListPage { + return original.NewShareListPage(getNextPage) +} +func NewShareSubscriptionListIterator(page ShareSubscriptionListPage) ShareSubscriptionListIterator { + return original.NewShareSubscriptionListIterator(page) +} +func NewShareSubscriptionListPage(getNextPage func(context.Context, ShareSubscriptionList) (ShareSubscriptionList, error)) ShareSubscriptionListPage { + return original.NewShareSubscriptionListPage(getNextPage) +} +func NewShareSubscriptionSynchronizationListIterator(page ShareSubscriptionSynchronizationListPage) ShareSubscriptionSynchronizationListIterator { + return original.NewShareSubscriptionSynchronizationListIterator(page) +} +func NewShareSubscriptionSynchronizationListPage(getNextPage func(context.Context, ShareSubscriptionSynchronizationList) (ShareSubscriptionSynchronizationList, error)) ShareSubscriptionSynchronizationListPage { + return original.NewShareSubscriptionSynchronizationListPage(getNextPage) +} +func NewShareSubscriptionsClient(subscriptionID string) ShareSubscriptionsClient { + return original.NewShareSubscriptionsClient(subscriptionID) +} +func NewShareSubscriptionsClientWithBaseURI(baseURI string, subscriptionID string) ShareSubscriptionsClient { + return original.NewShareSubscriptionsClientWithBaseURI(baseURI, subscriptionID) +} +func NewShareSynchronizationListIterator(page ShareSynchronizationListPage) ShareSynchronizationListIterator { + return original.NewShareSynchronizationListIterator(page) +} +func NewShareSynchronizationListPage(getNextPage func(context.Context, ShareSynchronizationList) (ShareSynchronizationList, error)) ShareSynchronizationListPage { + return original.NewShareSynchronizationListPage(getNextPage) +} +func NewSharesClient(subscriptionID string) SharesClient { + return original.NewSharesClient(subscriptionID) +} +func NewSharesClientWithBaseURI(baseURI string, subscriptionID string) SharesClient { + return original.NewSharesClientWithBaseURI(baseURI, subscriptionID) +} +func NewSourceShareSynchronizationSettingListIterator(page SourceShareSynchronizationSettingListPage) SourceShareSynchronizationSettingListIterator { + return original.NewSourceShareSynchronizationSettingListIterator(page) +} +func NewSourceShareSynchronizationSettingListPage(getNextPage func(context.Context, SourceShareSynchronizationSettingList) (SourceShareSynchronizationSettingList, error)) SourceShareSynchronizationSettingListPage { + return original.NewSourceShareSynchronizationSettingListPage(getNextPage) +} +func NewSynchronizationDetailsListIterator(page SynchronizationDetailsListPage) SynchronizationDetailsListIterator { + return original.NewSynchronizationDetailsListIterator(page) +} +func NewSynchronizationDetailsListPage(getNextPage func(context.Context, SynchronizationDetailsList) (SynchronizationDetailsList, error)) SynchronizationDetailsListPage { + return original.NewSynchronizationDetailsListPage(getNextPage) +} +func NewSynchronizationSettingListIterator(page SynchronizationSettingListPage) SynchronizationSettingListIterator { + return original.NewSynchronizationSettingListIterator(page) +} +func NewSynchronizationSettingListPage(getNextPage func(context.Context, SynchronizationSettingList) (SynchronizationSettingList, error)) SynchronizationSettingListPage { + return original.NewSynchronizationSettingListPage(getNextPage) +} +func NewSynchronizationSettingsClient(subscriptionID string) SynchronizationSettingsClient { + return original.NewSynchronizationSettingsClient(subscriptionID) +} +func NewSynchronizationSettingsClientWithBaseURI(baseURI string, subscriptionID string) SynchronizationSettingsClient { + return original.NewSynchronizationSettingsClientWithBaseURI(baseURI, subscriptionID) +} +func NewTriggerListIterator(page TriggerListPage) TriggerListIterator { + return original.NewTriggerListIterator(page) +} +func NewTriggerListPage(getNextPage func(context.Context, TriggerList) (TriggerList, error)) TriggerListPage { + return original.NewTriggerListPage(getNextPage) +} +func NewTriggersClient(subscriptionID string) TriggersClient { + return original.NewTriggersClient(subscriptionID) +} +func NewTriggersClientWithBaseURI(baseURI string, subscriptionID string) TriggersClient { + return original.NewTriggersClientWithBaseURI(baseURI, subscriptionID) +} +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return original.NewWithBaseURI(baseURI, subscriptionID) +} +func PossibleDataSetMappingStatusValues() []DataSetMappingStatus { + return original.PossibleDataSetMappingStatusValues() +} +func PossibleDataSetTypeValues() []DataSetType { + return original.PossibleDataSetTypeValues() +} +func PossibleInvitationStatusValues() []InvitationStatus { + return original.PossibleInvitationStatusValues() +} +func PossibleKindBasicDataSetMappingValues() []KindBasicDataSetMapping { + return original.PossibleKindBasicDataSetMappingValues() +} +func PossibleKindBasicSourceShareSynchronizationSettingValues() []KindBasicSourceShareSynchronizationSetting { + return original.PossibleKindBasicSourceShareSynchronizationSettingValues() +} +func PossibleKindBasicSynchronizationSettingValues() []KindBasicSynchronizationSetting { + return original.PossibleKindBasicSynchronizationSettingValues() +} +func PossibleKindBasicTriggerValues() []KindBasicTrigger { + return original.PossibleKindBasicTriggerValues() +} +func PossibleKindValues() []Kind { + return original.PossibleKindValues() +} +func PossibleOutputTypeValues() []OutputType { + return original.PossibleOutputTypeValues() +} +func PossibleProvisioningStateValues() []ProvisioningState { + return original.PossibleProvisioningStateValues() +} +func PossibleRecurrenceIntervalValues() []RecurrenceInterval { + return original.PossibleRecurrenceIntervalValues() +} +func PossibleShareKindValues() []ShareKind { + return original.PossibleShareKindValues() +} +func PossibleShareSubscriptionStatusValues() []ShareSubscriptionStatus { + return original.PossibleShareSubscriptionStatusValues() +} +func PossibleStatusValues() []Status { + return original.PossibleStatusValues() +} +func PossibleSynchronizationModeValues() []SynchronizationMode { + return original.PossibleSynchronizationModeValues() +} +func PossibleTriggerStatusValues() []TriggerStatus { + return original.PossibleTriggerStatusValues() +} +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/domainservices/mgmt/aad/aadapi/models.go b/profiles/preview/domainservices/mgmt/aad/aadapi/models.go index 57ce54cbf838..9f299cf3ee98 100644 --- a/profiles/preview/domainservices/mgmt/aad/aadapi/models.go +++ b/profiles/preview/domainservices/mgmt/aad/aadapi/models.go @@ -23,4 +23,3 @@ import original "github.com/Azure/azure-sdk-for-go/services/domainservices/mgmt/ type DomainServiceOperationsClientAPI = original.DomainServiceOperationsClientAPI type DomainServicesClientAPI = original.DomainServicesClientAPI -type ReplicaSetsClientAPI = original.ReplicaSetsClientAPI diff --git a/profiles/preview/domainservices/mgmt/aad/models.go b/profiles/preview/domainservices/mgmt/aad/models.go index f44817d14213..1988a4bf6b03 100644 --- a/profiles/preview/domainservices/mgmt/aad/models.go +++ b/profiles/preview/domainservices/mgmt/aad/models.go @@ -106,15 +106,6 @@ type OperationEntity = original.OperationEntity type OperationEntityListResult = original.OperationEntityListResult type OperationEntityListResultIterator = original.OperationEntityListResultIterator type OperationEntityListResultPage = original.OperationEntityListResultPage -type ReplicaSet = original.ReplicaSet -type ReplicaSetListResult = original.ReplicaSetListResult -type ReplicaSetListResultIterator = original.ReplicaSetListResultIterator -type ReplicaSetListResultPage = original.ReplicaSetListResultPage -type ReplicaSetProperties = original.ReplicaSetProperties -type ReplicaSetsClient = original.ReplicaSetsClient -type ReplicaSetsCreateOrUpdateFuture = original.ReplicaSetsCreateOrUpdateFuture -type ReplicaSetsDeleteFuture = original.ReplicaSetsDeleteFuture -type ReplicaSetsUpdateFuture = original.ReplicaSetsUpdateFuture type Resource = original.Resource func New(subscriptionID string) BaseClient { @@ -144,18 +135,6 @@ func NewOperationEntityListResultIterator(page OperationEntityListResultPage) Op func NewOperationEntityListResultPage(getNextPage func(context.Context, OperationEntityListResult) (OperationEntityListResult, error)) OperationEntityListResultPage { return original.NewOperationEntityListResultPage(getNextPage) } -func NewReplicaSetListResultIterator(page ReplicaSetListResultPage) ReplicaSetListResultIterator { - return original.NewReplicaSetListResultIterator(page) -} -func NewReplicaSetListResultPage(getNextPage func(context.Context, ReplicaSetListResult) (ReplicaSetListResult, error)) ReplicaSetListResultPage { - return original.NewReplicaSetListResultPage(getNextPage) -} -func NewReplicaSetsClient(subscriptionID string) ReplicaSetsClient { - return original.NewReplicaSetsClient(subscriptionID) -} -func NewReplicaSetsClientWithBaseURI(baseURI string, subscriptionID string) ReplicaSetsClient { - return original.NewReplicaSetsClientWithBaseURI(baseURI, subscriptionID) -} func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { return original.NewWithBaseURI(baseURI, subscriptionID) } diff --git a/profiles/preview/eventgrid/eventgrid/models.go b/profiles/preview/eventgrid/eventgrid/models.go index 74269b8b100a..f2da17491fc7 100644 --- a/profiles/preview/eventgrid/eventgrid/models.go +++ b/profiles/preview/eventgrid/eventgrid/models.go @@ -111,6 +111,10 @@ type KeyVaultKeyNewVersionCreatedEventData = original.KeyVaultKeyNewVersionCreat type KeyVaultSecretExpiredEventData = original.KeyVaultSecretExpiredEventData type KeyVaultSecretNearExpiryEventData = original.KeyVaultSecretNearExpiryEventData type KeyVaultSecretNewVersionCreatedEventData = original.KeyVaultSecretNewVersionCreatedEventData +type MachineLearningServicesDatasetDriftDetectedEventData = original.MachineLearningServicesDatasetDriftDetectedEventData +type MachineLearningServicesModelDeployedEventData = original.MachineLearningServicesModelDeployedEventData +type MachineLearningServicesModelRegisteredEventData = original.MachineLearningServicesModelRegisteredEventData +type MachineLearningServicesRunCompletedEventData = original.MachineLearningServicesRunCompletedEventData type MapsGeofenceEnteredEventData = original.MapsGeofenceEnteredEventData type MapsGeofenceEventProperties = original.MapsGeofenceEventProperties type MapsGeofenceExitedEventData = original.MapsGeofenceExitedEventData @@ -159,6 +163,10 @@ type SignalRServiceClientConnectionConnectedEventData = original.SignalRServiceC type SignalRServiceClientConnectionDisconnectedEventData = original.SignalRServiceClientConnectionDisconnectedEventData type StorageBlobCreatedEventData = original.StorageBlobCreatedEventData type StorageBlobDeletedEventData = original.StorageBlobDeletedEventData +type StorageBlobRenamedEventData = original.StorageBlobRenamedEventData +type StorageDirectoryCreatedEventData = original.StorageDirectoryCreatedEventData +type StorageDirectoryDeletedEventData = original.StorageDirectoryDeletedEventData +type StorageDirectoryRenamedEventData = original.StorageDirectoryRenamedEventData type SubscriptionDeletedEventData = original.SubscriptionDeletedEventData type SubscriptionValidationEventData = original.SubscriptionValidationEventData type SubscriptionValidationResponse = original.SubscriptionValidationResponse diff --git a/profiles/preview/operationalinsights/mgmt/operationalinsights/models.go b/profiles/preview/operationalinsights/mgmt/operationalinsights/models.go index d77d183fbf2c..072914563365 100644 --- a/profiles/preview/operationalinsights/mgmt/operationalinsights/models.go +++ b/profiles/preview/operationalinsights/mgmt/operationalinsights/models.go @@ -64,13 +64,9 @@ type SavedSearch = original.SavedSearch type SavedSearchProperties = original.SavedSearchProperties type SavedSearchesClient = original.SavedSearchesClient type SavedSearchesListResult = original.SavedSearchesListResult -type SearchError = original.SearchError type SearchGetSchemaResponse = original.SearchGetSchemaResponse -type SearchHighlight = original.SearchHighlight type SearchMetadata = original.SearchMetadata type SearchMetadataSchema = original.SearchMetadataSchema -type SearchParameters = original.SearchParameters -type SearchResultsResponse = original.SearchResultsResponse type SearchSchemaValue = original.SearchSchemaValue type SearchSort = original.SearchSort type SharedKeys = original.SharedKeys @@ -88,7 +84,6 @@ type WorkspacePurgeBodyFilters = original.WorkspacePurgeBodyFilters type WorkspacePurgeResponse = original.WorkspacePurgeResponse type WorkspacePurgeStatusResponse = original.WorkspacePurgeStatusResponse type WorkspacesClient = original.WorkspacesClient -type WorkspacesGetSearchResultsFuture = original.WorkspacesGetSearchResultsFuture func New(subscriptionID string, purgeID string) BaseClient { return original.New(subscriptionID, purgeID) diff --git a/profiles/preview/policyinsights/mgmt/policyinsights/models.go b/profiles/preview/policyinsights/mgmt/policyinsights/models.go index d6643c95eceb..b615e657622b 100644 --- a/profiles/preview/policyinsights/mgmt/policyinsights/models.go +++ b/profiles/preview/policyinsights/mgmt/policyinsights/models.go @@ -19,7 +19,11 @@ package policyinsights -import original "github.com/Azure/azure-sdk-for-go/services/policyinsights/mgmt/2018-04-04/policyinsights" +import ( + "context" + + original "github.com/Azure/azure-sdk-for-go/services/policyinsights/mgmt/2019-10-01/policyinsights" +) const ( DefaultBaseURI = original.DefaultBaseURI @@ -33,24 +37,51 @@ const ( ) type BaseClient = original.BaseClient +type ComplianceDetail = original.ComplianceDetail +type ErrorDefinition = original.ErrorDefinition +type ErrorResponse = original.ErrorResponse +type ExpressionEvaluationDetails = original.ExpressionEvaluationDetails +type IfNotExistsEvaluationDetails = original.IfNotExistsEvaluationDetails type Operation = original.Operation type OperationDisplay = original.OperationDisplay type OperationsClient = original.OperationsClient type OperationsListResults = original.OperationsListResults type PolicyAssignmentSummary = original.PolicyAssignmentSummary type PolicyDefinitionSummary = original.PolicyDefinitionSummary +type PolicyDetails = original.PolicyDetails +type PolicyEvaluationDetails = original.PolicyEvaluationDetails type PolicyEvent = original.PolicyEvent type PolicyEventsClient = original.PolicyEventsClient type PolicyEventsQueryResults = original.PolicyEventsQueryResults +type PolicyGroupSummary = original.PolicyGroupSummary type PolicyState = original.PolicyState type PolicyStatesClient = original.PolicyStatesClient type PolicyStatesQueryResults = original.PolicyStatesQueryResults +type PolicyTrackedResource = original.PolicyTrackedResource +type PolicyTrackedResourcesClient = original.PolicyTrackedResourcesClient +type PolicyTrackedResourcesQueryResults = original.PolicyTrackedResourcesQueryResults +type PolicyTrackedResourcesQueryResultsIterator = original.PolicyTrackedResourcesQueryResultsIterator +type PolicyTrackedResourcesQueryResultsPage = original.PolicyTrackedResourcesQueryResultsPage type QueryFailure = original.QueryFailure type QueryFailureError = original.QueryFailureError +type Remediation = original.Remediation +type RemediationDeployment = original.RemediationDeployment +type RemediationDeploymentSummary = original.RemediationDeploymentSummary +type RemediationDeploymentsListResult = original.RemediationDeploymentsListResult +type RemediationDeploymentsListResultIterator = original.RemediationDeploymentsListResultIterator +type RemediationDeploymentsListResultPage = original.RemediationDeploymentsListResultPage +type RemediationFilters = original.RemediationFilters +type RemediationListResult = original.RemediationListResult +type RemediationListResultIterator = original.RemediationListResultIterator +type RemediationListResultPage = original.RemediationListResultPage +type RemediationProperties = original.RemediationProperties +type RemediationsClient = original.RemediationsClient type String = original.String type SummarizeResults = original.SummarizeResults type Summary = original.Summary type SummaryResults = original.SummaryResults +type TrackedResourceModificationDetails = original.TrackedResourceModificationDetails +type TypedErrorInfo = original.TypedErrorInfo func New() BaseClient { return original.New() @@ -73,6 +104,36 @@ func NewPolicyStatesClient() PolicyStatesClient { func NewPolicyStatesClientWithBaseURI(baseURI string) PolicyStatesClient { return original.NewPolicyStatesClientWithBaseURI(baseURI) } +func NewPolicyTrackedResourcesClient() PolicyTrackedResourcesClient { + return original.NewPolicyTrackedResourcesClient() +} +func NewPolicyTrackedResourcesClientWithBaseURI(baseURI string) PolicyTrackedResourcesClient { + return original.NewPolicyTrackedResourcesClientWithBaseURI(baseURI) +} +func NewPolicyTrackedResourcesQueryResultsIterator(page PolicyTrackedResourcesQueryResultsPage) PolicyTrackedResourcesQueryResultsIterator { + return original.NewPolicyTrackedResourcesQueryResultsIterator(page) +} +func NewPolicyTrackedResourcesQueryResultsPage(getNextPage func(context.Context, PolicyTrackedResourcesQueryResults) (PolicyTrackedResourcesQueryResults, error)) PolicyTrackedResourcesQueryResultsPage { + return original.NewPolicyTrackedResourcesQueryResultsPage(getNextPage) +} +func NewRemediationDeploymentsListResultIterator(page RemediationDeploymentsListResultPage) RemediationDeploymentsListResultIterator { + return original.NewRemediationDeploymentsListResultIterator(page) +} +func NewRemediationDeploymentsListResultPage(getNextPage func(context.Context, RemediationDeploymentsListResult) (RemediationDeploymentsListResult, error)) RemediationDeploymentsListResultPage { + return original.NewRemediationDeploymentsListResultPage(getNextPage) +} +func NewRemediationListResultIterator(page RemediationListResultPage) RemediationListResultIterator { + return original.NewRemediationListResultIterator(page) +} +func NewRemediationListResultPage(getNextPage func(context.Context, RemediationListResult) (RemediationListResult, error)) RemediationListResultPage { + return original.NewRemediationListResultPage(getNextPage) +} +func NewRemediationsClient() RemediationsClient { + return original.NewRemediationsClient() +} +func NewRemediationsClientWithBaseURI(baseURI string) RemediationsClient { + return original.NewRemediationsClientWithBaseURI(baseURI) +} func NewWithBaseURI(baseURI string) BaseClient { return original.NewWithBaseURI(baseURI) } diff --git a/profiles/preview/policyinsights/mgmt/policyinsights/policyinsightsapi/models.go b/profiles/preview/policyinsights/mgmt/policyinsights/policyinsightsapi/models.go index 68f64baaefe8..3f4601162208 100644 --- a/profiles/preview/policyinsights/mgmt/policyinsights/policyinsightsapi/models.go +++ b/profiles/preview/policyinsights/mgmt/policyinsights/policyinsightsapi/models.go @@ -19,8 +19,10 @@ package policyinsightsapi -import original "github.com/Azure/azure-sdk-for-go/services/policyinsights/mgmt/2018-04-04/policyinsights/policyinsightsapi" +import original "github.com/Azure/azure-sdk-for-go/services/policyinsights/mgmt/2019-10-01/policyinsights/policyinsightsapi" type OperationsClientAPI = original.OperationsClientAPI type PolicyEventsClientAPI = original.PolicyEventsClientAPI type PolicyStatesClientAPI = original.PolicyStatesClientAPI +type PolicyTrackedResourcesClientAPI = original.PolicyTrackedResourcesClientAPI +type RemediationsClientAPI = original.RemediationsClientAPI diff --git a/profiles/preview/preview/appplatform/mgmt/appplatform/models.go b/profiles/preview/preview/appplatform/mgmt/appplatform/models.go index 00b3137c3d1c..099e9fa16a92 100644 --- a/profiles/preview/preview/appplatform/mgmt/appplatform/models.go +++ b/profiles/preview/preview/appplatform/mgmt/appplatform/models.go @@ -32,8 +32,10 @@ const ( type AppResourceProvisioningState = original.AppResourceProvisioningState const ( + Creating AppResourceProvisioningState = original.Creating Failed AppResourceProvisioningState = original.Failed Succeeded AppResourceProvisioningState = original.Succeeded + Updating AppResourceProvisioningState = original.Updating ) type ConfigServerState = original.ConfigServerState @@ -49,10 +51,10 @@ const ( type DeploymentResourceProvisioningState = original.DeploymentResourceProvisioningState const ( - DeploymentResourceProvisioningStateCreating DeploymentResourceProvisioningState = original.DeploymentResourceProvisioningStateCreating - DeploymentResourceProvisioningStateFailed DeploymentResourceProvisioningState = original.DeploymentResourceProvisioningStateFailed - DeploymentResourceProvisioningStateProcessing DeploymentResourceProvisioningState = original.DeploymentResourceProvisioningStateProcessing - DeploymentResourceProvisioningStateSucceeded DeploymentResourceProvisioningState = original.DeploymentResourceProvisioningStateSucceeded + DeploymentResourceProvisioningStateCreating DeploymentResourceProvisioningState = original.DeploymentResourceProvisioningStateCreating + DeploymentResourceProvisioningStateFailed DeploymentResourceProvisioningState = original.DeploymentResourceProvisioningStateFailed + DeploymentResourceProvisioningStateSucceeded DeploymentResourceProvisioningState = original.DeploymentResourceProvisioningStateSucceeded + DeploymentResourceProvisioningStateUpdating DeploymentResourceProvisioningState = original.DeploymentResourceProvisioningStateUpdating ) type DeploymentResourceStatus = original.DeploymentResourceStatus @@ -61,7 +63,6 @@ const ( DeploymentResourceStatusAllocating DeploymentResourceStatus = original.DeploymentResourceStatusAllocating DeploymentResourceStatusCompiling DeploymentResourceStatus = original.DeploymentResourceStatusCompiling DeploymentResourceStatusFailed DeploymentResourceStatus = original.DeploymentResourceStatusFailed - DeploymentResourceStatusProcessing DeploymentResourceStatus = original.DeploymentResourceStatusProcessing DeploymentResourceStatusRunning DeploymentResourceStatus = original.DeploymentResourceStatusRunning DeploymentResourceStatusStopped DeploymentResourceStatus = original.DeploymentResourceStatusStopped DeploymentResourceStatusUnknown DeploymentResourceStatus = original.DeploymentResourceStatusUnknown @@ -118,6 +119,8 @@ type AppResourceCollectionIterator = original.AppResourceCollectionIterator type AppResourceCollectionPage = original.AppResourceCollectionPage type AppResourceProperties = original.AppResourceProperties type AppsClient = original.AppsClient +type AppsCreateOrUpdateFuture = original.AppsCreateOrUpdateFuture +type AppsUpdateFuture = original.AppsUpdateFuture type AvailableOperations = original.AvailableOperations type AvailableOperationsIterator = original.AvailableOperationsIterator type AvailableOperationsPage = original.AvailableOperationsPage diff --git a/profiles/preview/preview/cognitiveservices/luis/authoring/authoringapi/models.go b/profiles/preview/preview/cognitiveservices/luis/authoring/authoringapi/models.go new file mode 100644 index 000000000000..a7c3942ad949 --- /dev/null +++ b/profiles/preview/preview/cognitiveservices/luis/authoring/authoringapi/models.go @@ -0,0 +1,33 @@ +// +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 authoringapi + +import original "github.com/Azure/azure-sdk-for-go/services/preview/cognitiveservices/v3.0/luis/authoring/authoringapi" + +type AppsClientAPI = original.AppsClientAPI +type AzureAccountsClientAPI = original.AzureAccountsClientAPI +type ExamplesClientAPI = original.ExamplesClientAPI +type FeaturesClientAPI = original.FeaturesClientAPI +type ModelClientAPI = original.ModelClientAPI +type PatternClientAPI = original.PatternClientAPI +type PermissionsClientAPI = original.PermissionsClientAPI +type SettingsClientAPI = original.SettingsClientAPI +type TrainClientAPI = original.TrainClientAPI +type VersionsClientAPI = original.VersionsClientAPI diff --git a/profiles/preview/cognitiveservices/luis/programmatic/models.go b/profiles/preview/preview/cognitiveservices/luis/authoring/models.go similarity index 78% rename from profiles/preview/cognitiveservices/luis/programmatic/models.go rename to profiles/preview/preview/cognitiveservices/luis/authoring/models.go index bb1528ceddbc..cec1f7e12769 100644 --- a/profiles/preview/cognitiveservices/luis/programmatic/models.go +++ b/profiles/preview/preview/cognitiveservices/luis/authoring/models.go @@ -17,26 +17,9 @@ // This code was auto-generated by: // github.com/Azure/azure-sdk-for-go/tools/profileBuilder -package programmatic +package authoring -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 -) +import original "github.com/Azure/azure-sdk-for-go/services/preview/cognitiveservices/v3.0/luis/authoring" type OperationStatusType = original.OperationStatusType @@ -49,12 +32,14 @@ const ( type ReadableType = original.ReadableType const ( + ReadableTypeChildEntityExtractor ReadableType = original.ReadableTypeChildEntityExtractor ReadableTypeClosedListEntityExtractor ReadableType = original.ReadableTypeClosedListEntityExtractor ReadableTypeCompositeEntityExtractor ReadableType = original.ReadableTypeCompositeEntityExtractor ReadableTypeEntityExtractor ReadableType = original.ReadableTypeEntityExtractor ReadableTypeHierarchicalChildEntityExtractor ReadableType = original.ReadableTypeHierarchicalChildEntityExtractor ReadableTypeHierarchicalEntityExtractor ReadableType = original.ReadableTypeHierarchicalEntityExtractor ReadableTypeIntentClassifier ReadableType = original.ReadableTypeIntentClassifier + ReadableTypeListEntityExtractor ReadableType = original.ReadableTypeListEntityExtractor ReadableTypePatternAnyEntityExtractor ReadableType = original.ReadableTypePatternAnyEntityExtractor ReadableTypePrebuiltEntityExtractor ReadableType = original.ReadableTypePrebuiltEntityExtractor ReadableTypeRegexEntityExtractor ReadableType = original.ReadableTypeRegexEntityExtractor @@ -63,12 +48,14 @@ const ( type ReadableType1 = original.ReadableType1 const ( + ReadableType1ChildEntityExtractor ReadableType1 = original.ReadableType1ChildEntityExtractor ReadableType1ClosedListEntityExtractor ReadableType1 = original.ReadableType1ClosedListEntityExtractor ReadableType1CompositeEntityExtractor ReadableType1 = original.ReadableType1CompositeEntityExtractor ReadableType1EntityExtractor ReadableType1 = original.ReadableType1EntityExtractor ReadableType1HierarchicalChildEntityExtractor ReadableType1 = original.ReadableType1HierarchicalChildEntityExtractor ReadableType1HierarchicalEntityExtractor ReadableType1 = original.ReadableType1HierarchicalEntityExtractor ReadableType1IntentClassifier ReadableType1 = original.ReadableType1IntentClassifier + ReadableType1ListEntityExtractor ReadableType1 = original.ReadableType1ListEntityExtractor ReadableType1PatternAnyEntityExtractor ReadableType1 = original.ReadableType1PatternAnyEntityExtractor ReadableType1PrebuiltEntityExtractor ReadableType1 = original.ReadableType1PrebuiltEntityExtractor ReadableType1RegexEntityExtractor ReadableType1 = original.ReadableType1RegexEntityExtractor @@ -77,26 +64,46 @@ const ( type ReadableType10 = original.ReadableType10 const ( + ReadableType10ChildEntityExtractor ReadableType10 = original.ReadableType10ChildEntityExtractor ReadableType10ClosedListEntityExtractor ReadableType10 = original.ReadableType10ClosedListEntityExtractor ReadableType10CompositeEntityExtractor ReadableType10 = original.ReadableType10CompositeEntityExtractor ReadableType10EntityExtractor ReadableType10 = original.ReadableType10EntityExtractor ReadableType10HierarchicalChildEntityExtractor ReadableType10 = original.ReadableType10HierarchicalChildEntityExtractor ReadableType10HierarchicalEntityExtractor ReadableType10 = original.ReadableType10HierarchicalEntityExtractor ReadableType10IntentClassifier ReadableType10 = original.ReadableType10IntentClassifier + ReadableType10ListEntityExtractor ReadableType10 = original.ReadableType10ListEntityExtractor ReadableType10PatternAnyEntityExtractor ReadableType10 = original.ReadableType10PatternAnyEntityExtractor ReadableType10PrebuiltEntityExtractor ReadableType10 = original.ReadableType10PrebuiltEntityExtractor ReadableType10RegexEntityExtractor ReadableType10 = original.ReadableType10RegexEntityExtractor ) +type ReadableType11 = original.ReadableType11 + +const ( + ReadableType11ChildEntityExtractor ReadableType11 = original.ReadableType11ChildEntityExtractor + ReadableType11ClosedListEntityExtractor ReadableType11 = original.ReadableType11ClosedListEntityExtractor + ReadableType11CompositeEntityExtractor ReadableType11 = original.ReadableType11CompositeEntityExtractor + ReadableType11EntityExtractor ReadableType11 = original.ReadableType11EntityExtractor + ReadableType11HierarchicalChildEntityExtractor ReadableType11 = original.ReadableType11HierarchicalChildEntityExtractor + ReadableType11HierarchicalEntityExtractor ReadableType11 = original.ReadableType11HierarchicalEntityExtractor + ReadableType11IntentClassifier ReadableType11 = original.ReadableType11IntentClassifier + ReadableType11ListEntityExtractor ReadableType11 = original.ReadableType11ListEntityExtractor + ReadableType11PatternAnyEntityExtractor ReadableType11 = original.ReadableType11PatternAnyEntityExtractor + ReadableType11PrebuiltEntityExtractor ReadableType11 = original.ReadableType11PrebuiltEntityExtractor + ReadableType11RegexEntityExtractor ReadableType11 = original.ReadableType11RegexEntityExtractor +) + type ReadableType2 = original.ReadableType2 const ( + ReadableType2ChildEntityExtractor ReadableType2 = original.ReadableType2ChildEntityExtractor ReadableType2ClosedListEntityExtractor ReadableType2 = original.ReadableType2ClosedListEntityExtractor ReadableType2CompositeEntityExtractor ReadableType2 = original.ReadableType2CompositeEntityExtractor ReadableType2EntityExtractor ReadableType2 = original.ReadableType2EntityExtractor ReadableType2HierarchicalChildEntityExtractor ReadableType2 = original.ReadableType2HierarchicalChildEntityExtractor ReadableType2HierarchicalEntityExtractor ReadableType2 = original.ReadableType2HierarchicalEntityExtractor ReadableType2IntentClassifier ReadableType2 = original.ReadableType2IntentClassifier + ReadableType2ListEntityExtractor ReadableType2 = original.ReadableType2ListEntityExtractor ReadableType2PatternAnyEntityExtractor ReadableType2 = original.ReadableType2PatternAnyEntityExtractor ReadableType2PrebuiltEntityExtractor ReadableType2 = original.ReadableType2PrebuiltEntityExtractor ReadableType2RegexEntityExtractor ReadableType2 = original.ReadableType2RegexEntityExtractor @@ -105,12 +112,14 @@ const ( type ReadableType3 = original.ReadableType3 const ( + ReadableType3ChildEntityExtractor ReadableType3 = original.ReadableType3ChildEntityExtractor ReadableType3ClosedListEntityExtractor ReadableType3 = original.ReadableType3ClosedListEntityExtractor ReadableType3CompositeEntityExtractor ReadableType3 = original.ReadableType3CompositeEntityExtractor ReadableType3EntityExtractor ReadableType3 = original.ReadableType3EntityExtractor ReadableType3HierarchicalChildEntityExtractor ReadableType3 = original.ReadableType3HierarchicalChildEntityExtractor ReadableType3HierarchicalEntityExtractor ReadableType3 = original.ReadableType3HierarchicalEntityExtractor ReadableType3IntentClassifier ReadableType3 = original.ReadableType3IntentClassifier + ReadableType3ListEntityExtractor ReadableType3 = original.ReadableType3ListEntityExtractor ReadableType3PatternAnyEntityExtractor ReadableType3 = original.ReadableType3PatternAnyEntityExtractor ReadableType3PrebuiltEntityExtractor ReadableType3 = original.ReadableType3PrebuiltEntityExtractor ReadableType3RegexEntityExtractor ReadableType3 = original.ReadableType3RegexEntityExtractor @@ -119,12 +128,14 @@ const ( type ReadableType4 = original.ReadableType4 const ( + ReadableType4ChildEntityExtractor ReadableType4 = original.ReadableType4ChildEntityExtractor ReadableType4ClosedListEntityExtractor ReadableType4 = original.ReadableType4ClosedListEntityExtractor ReadableType4CompositeEntityExtractor ReadableType4 = original.ReadableType4CompositeEntityExtractor ReadableType4EntityExtractor ReadableType4 = original.ReadableType4EntityExtractor ReadableType4HierarchicalChildEntityExtractor ReadableType4 = original.ReadableType4HierarchicalChildEntityExtractor ReadableType4HierarchicalEntityExtractor ReadableType4 = original.ReadableType4HierarchicalEntityExtractor ReadableType4IntentClassifier ReadableType4 = original.ReadableType4IntentClassifier + ReadableType4ListEntityExtractor ReadableType4 = original.ReadableType4ListEntityExtractor ReadableType4PatternAnyEntityExtractor ReadableType4 = original.ReadableType4PatternAnyEntityExtractor ReadableType4PrebuiltEntityExtractor ReadableType4 = original.ReadableType4PrebuiltEntityExtractor ReadableType4RegexEntityExtractor ReadableType4 = original.ReadableType4RegexEntityExtractor @@ -133,12 +144,14 @@ const ( type ReadableType5 = original.ReadableType5 const ( + ReadableType5ChildEntityExtractor ReadableType5 = original.ReadableType5ChildEntityExtractor ReadableType5ClosedListEntityExtractor ReadableType5 = original.ReadableType5ClosedListEntityExtractor ReadableType5CompositeEntityExtractor ReadableType5 = original.ReadableType5CompositeEntityExtractor ReadableType5EntityExtractor ReadableType5 = original.ReadableType5EntityExtractor ReadableType5HierarchicalChildEntityExtractor ReadableType5 = original.ReadableType5HierarchicalChildEntityExtractor ReadableType5HierarchicalEntityExtractor ReadableType5 = original.ReadableType5HierarchicalEntityExtractor ReadableType5IntentClassifier ReadableType5 = original.ReadableType5IntentClassifier + ReadableType5ListEntityExtractor ReadableType5 = original.ReadableType5ListEntityExtractor ReadableType5PatternAnyEntityExtractor ReadableType5 = original.ReadableType5PatternAnyEntityExtractor ReadableType5PrebuiltEntityExtractor ReadableType5 = original.ReadableType5PrebuiltEntityExtractor ReadableType5RegexEntityExtractor ReadableType5 = original.ReadableType5RegexEntityExtractor @@ -147,12 +160,14 @@ const ( type ReadableType6 = original.ReadableType6 const ( + ReadableType6ChildEntityExtractor ReadableType6 = original.ReadableType6ChildEntityExtractor ReadableType6ClosedListEntityExtractor ReadableType6 = original.ReadableType6ClosedListEntityExtractor ReadableType6CompositeEntityExtractor ReadableType6 = original.ReadableType6CompositeEntityExtractor ReadableType6EntityExtractor ReadableType6 = original.ReadableType6EntityExtractor ReadableType6HierarchicalChildEntityExtractor ReadableType6 = original.ReadableType6HierarchicalChildEntityExtractor ReadableType6HierarchicalEntityExtractor ReadableType6 = original.ReadableType6HierarchicalEntityExtractor ReadableType6IntentClassifier ReadableType6 = original.ReadableType6IntentClassifier + ReadableType6ListEntityExtractor ReadableType6 = original.ReadableType6ListEntityExtractor ReadableType6PatternAnyEntityExtractor ReadableType6 = original.ReadableType6PatternAnyEntityExtractor ReadableType6PrebuiltEntityExtractor ReadableType6 = original.ReadableType6PrebuiltEntityExtractor ReadableType6RegexEntityExtractor ReadableType6 = original.ReadableType6RegexEntityExtractor @@ -161,12 +176,14 @@ const ( type ReadableType7 = original.ReadableType7 const ( + ReadableType7ChildEntityExtractor ReadableType7 = original.ReadableType7ChildEntityExtractor ReadableType7ClosedListEntityExtractor ReadableType7 = original.ReadableType7ClosedListEntityExtractor ReadableType7CompositeEntityExtractor ReadableType7 = original.ReadableType7CompositeEntityExtractor ReadableType7EntityExtractor ReadableType7 = original.ReadableType7EntityExtractor ReadableType7HierarchicalChildEntityExtractor ReadableType7 = original.ReadableType7HierarchicalChildEntityExtractor ReadableType7HierarchicalEntityExtractor ReadableType7 = original.ReadableType7HierarchicalEntityExtractor ReadableType7IntentClassifier ReadableType7 = original.ReadableType7IntentClassifier + ReadableType7ListEntityExtractor ReadableType7 = original.ReadableType7ListEntityExtractor ReadableType7PatternAnyEntityExtractor ReadableType7 = original.ReadableType7PatternAnyEntityExtractor ReadableType7PrebuiltEntityExtractor ReadableType7 = original.ReadableType7PrebuiltEntityExtractor ReadableType7RegexEntityExtractor ReadableType7 = original.ReadableType7RegexEntityExtractor @@ -175,12 +192,14 @@ const ( type ReadableType8 = original.ReadableType8 const ( + ReadableType8ChildEntityExtractor ReadableType8 = original.ReadableType8ChildEntityExtractor ReadableType8ClosedListEntityExtractor ReadableType8 = original.ReadableType8ClosedListEntityExtractor ReadableType8CompositeEntityExtractor ReadableType8 = original.ReadableType8CompositeEntityExtractor ReadableType8EntityExtractor ReadableType8 = original.ReadableType8EntityExtractor ReadableType8HierarchicalChildEntityExtractor ReadableType8 = original.ReadableType8HierarchicalChildEntityExtractor ReadableType8HierarchicalEntityExtractor ReadableType8 = original.ReadableType8HierarchicalEntityExtractor ReadableType8IntentClassifier ReadableType8 = original.ReadableType8IntentClassifier + ReadableType8ListEntityExtractor ReadableType8 = original.ReadableType8ListEntityExtractor ReadableType8PatternAnyEntityExtractor ReadableType8 = original.ReadableType8PatternAnyEntityExtractor ReadableType8PrebuiltEntityExtractor ReadableType8 = original.ReadableType8PrebuiltEntityExtractor ReadableType8RegexEntityExtractor ReadableType8 = original.ReadableType8RegexEntityExtractor @@ -189,12 +208,14 @@ const ( type ReadableType9 = original.ReadableType9 const ( + ReadableType9ChildEntityExtractor ReadableType9 = original.ReadableType9ChildEntityExtractor ReadableType9ClosedListEntityExtractor ReadableType9 = original.ReadableType9ClosedListEntityExtractor ReadableType9CompositeEntityExtractor ReadableType9 = original.ReadableType9CompositeEntityExtractor ReadableType9EntityExtractor ReadableType9 = original.ReadableType9EntityExtractor ReadableType9HierarchicalChildEntityExtractor ReadableType9 = original.ReadableType9HierarchicalChildEntityExtractor ReadableType9HierarchicalEntityExtractor ReadableType9 = original.ReadableType9HierarchicalEntityExtractor ReadableType9IntentClassifier ReadableType9 = original.ReadableType9IntentClassifier + ReadableType9ListEntityExtractor ReadableType9 = original.ReadableType9ListEntityExtractor ReadableType9PatternAnyEntityExtractor ReadableType9 = original.ReadableType9PatternAnyEntityExtractor ReadableType9PrebuiltEntityExtractor ReadableType9 = original.ReadableType9PrebuiltEntityExtractor ReadableType9RegexEntityExtractor ReadableType9 = original.ReadableType9RegexEntityExtractor @@ -228,6 +249,7 @@ const ( Trained TrainingStatus = original.Trained ) +type AppVersionSettingObject = original.AppVersionSettingObject type ApplicationCreateObject = original.ApplicationCreateObject type ApplicationInfoResponse = original.ApplicationInfoResponse type ApplicationPublishObject = original.ApplicationPublishObject @@ -237,9 +259,12 @@ type ApplicationUpdateObject = original.ApplicationUpdateObject type AppsClient = original.AppsClient type AvailableCulture = original.AvailableCulture type AvailablePrebuiltEntityModel = original.AvailablePrebuiltEntityModel +type AzureAccountInfoObject = original.AzureAccountInfoObject +type AzureAccountsClient = original.AzureAccountsClient type BaseClient = original.BaseClient type BatchLabelExample = original.BatchLabelExample type ChildEntity = original.ChildEntity +type ChildEntityModelCreateObject = original.ChildEntityModelCreateObject type ClosedList = original.ClosedList type ClosedListEntityExtractor = original.ClosedListEntityExtractor type ClosedListModelCreateObject = original.ClosedListModelCreateObject @@ -256,7 +281,9 @@ type EntitiesSuggestionExample = original.EntitiesSuggestionExample type EntityExtractor = original.EntityExtractor type EntityLabel = original.EntityLabel type EntityLabelObject = original.EntityLabelObject +type EntityModelCreateObject = original.EntityModelCreateObject type EntityModelInfo = original.EntityModelInfo +type EntityModelUpdateObject = original.EntityModelUpdateObject type EntityPrediction = original.EntityPrediction type EntityRole = original.EntityRole type EntityRoleCreateObject = original.EntityRoleCreateObject @@ -271,12 +298,11 @@ 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 Int64 = original.Int64 type IntentClassifier = original.IntentClassifier type IntentPrediction = original.IntentPrediction type IntentsSuggestionExample = original.IntentsSuggestionExample @@ -285,10 +311,13 @@ type JSONModelFeature = original.JSONModelFeature type JSONRegexFeature = original.JSONRegexFeature type JSONUtterance = original.JSONUtterance type LabelExampleResponse = original.LabelExampleResponse +type LabelTextObject = original.LabelTextObject type LabeledUtterance = original.LabeledUtterance +type ListAppVersionSettingObject = original.ListAppVersionSettingObject type ListApplicationInfoResponse = original.ListApplicationInfoResponse type ListAvailableCulture = original.ListAvailableCulture type ListAvailablePrebuiltEntityModel = original.ListAvailablePrebuiltEntityModel +type ListAzureAccountInfoObject = original.ListAzureAccountInfoObject type ListBatchLabelExample = original.ListBatchLabelExample type ListClosedListEntityExtractor = original.ListClosedListEntityExtractor type ListCompositeEntityExtractor = original.ListCompositeEntityExtractor @@ -300,9 +329,12 @@ type ListExplicitListItem = original.ListExplicitListItem type ListHierarchicalEntityExtractor = original.ListHierarchicalEntityExtractor type ListIntentClassifier = original.ListIntentClassifier type ListIntentsSuggestionExample = original.ListIntentsSuggestionExample +type ListLabelTextObject = original.ListLabelTextObject type ListLabeledUtterance = original.ListLabeledUtterance +type ListModelFeatureInformation = original.ListModelFeatureInformation type ListModelInfoResponse = original.ListModelInfoResponse type ListModelTrainingInfo = original.ListModelTrainingInfo +type ListNDepthEntityExtractor = original.ListNDepthEntityExtractor type ListPatternAnyEntityExtractor = original.ListPatternAnyEntityExtractor type ListPatternRuleInfo = original.ListPatternRuleInfo type ListPhraseListFeatureInfo = original.ListPhraseListFeatureInfo @@ -315,11 +347,13 @@ type ListVersionInfo = original.ListVersionInfo type LuisApp = original.LuisApp type ModelClient = original.ModelClient type ModelCreateObject = original.ModelCreateObject +type ModelFeatureInformation = original.ModelFeatureInformation type ModelInfo = original.ModelInfo type ModelInfoResponse = original.ModelInfoResponse type ModelTrainingDetails = original.ModelTrainingDetails type ModelTrainingInfo = original.ModelTrainingInfo type ModelUpdateObject = original.ModelUpdateObject +type NDepthEntityExtractor = original.NDepthEntityExtractor type OperationError = original.OperationError type OperationStatus = original.OperationStatus type PatternAny = original.PatternAny @@ -327,13 +361,11 @@ 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 @@ -348,12 +380,15 @@ type PrebuiltDomainObject = original.PrebuiltDomainObject type PrebuiltEntity = original.PrebuiltEntity type PrebuiltEntityExtractor = original.PrebuiltEntityExtractor type ProductionOrStagingEndpointInfo = original.ProductionOrStagingEndpointInfo +type PublishSettingUpdateObject = original.PublishSettingUpdateObject +type PublishSettings = original.PublishSettings 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 SettingsClient = original.SettingsClient type String = original.String type SubClosedList = original.SubClosedList type SubClosedListResponse = original.SubClosedListResponse @@ -367,38 +402,41 @@ type VersionsClient = original.VersionsClient type WordListBaseUpdateObject = original.WordListBaseUpdateObject type WordListObject = original.WordListObject -func New(azureRegion AzureRegions) BaseClient { - return original.New(azureRegion) +func New(endpoint string) BaseClient { + return original.New(endpoint) } -func NewAppsClient(azureRegion AzureRegions) AppsClient { - return original.NewAppsClient(azureRegion) +func NewAppsClient(endpoint string) AppsClient { + return original.NewAppsClient(endpoint) } -func NewExamplesClient(azureRegion AzureRegions) ExamplesClient { - return original.NewExamplesClient(azureRegion) +func NewAzureAccountsClient(endpoint string) AzureAccountsClient { + return original.NewAzureAccountsClient(endpoint) } -func NewFeaturesClient(azureRegion AzureRegions) FeaturesClient { - return original.NewFeaturesClient(azureRegion) +func NewExamplesClient(endpoint string) ExamplesClient { + return original.NewExamplesClient(endpoint) } -func NewModelClient(azureRegion AzureRegions) ModelClient { - return original.NewModelClient(azureRegion) +func NewFeaturesClient(endpoint string) FeaturesClient { + return original.NewFeaturesClient(endpoint) } -func NewPatternClient(azureRegion AzureRegions) PatternClient { - return original.NewPatternClient(azureRegion) +func NewModelClient(endpoint string) ModelClient { + return original.NewModelClient(endpoint) } -func NewPermissionsClient(azureRegion AzureRegions) PermissionsClient { - return original.NewPermissionsClient(azureRegion) +func NewPatternClient(endpoint string) PatternClient { + return original.NewPatternClient(endpoint) } -func NewTrainClient(azureRegion AzureRegions) TrainClient { - return original.NewTrainClient(azureRegion) +func NewPermissionsClient(endpoint string) PermissionsClient { + return original.NewPermissionsClient(endpoint) } -func NewVersionsClient(azureRegion AzureRegions) VersionsClient { - return original.NewVersionsClient(azureRegion) +func NewSettingsClient(endpoint string) SettingsClient { + return original.NewSettingsClient(endpoint) } -func NewWithoutDefaults(azureRegion AzureRegions) BaseClient { - return original.NewWithoutDefaults(azureRegion) +func NewTrainClient(endpoint string) TrainClient { + return original.NewTrainClient(endpoint) } -func PossibleAzureRegionsValues() []AzureRegions { - return original.PossibleAzureRegionsValues() +func NewVersionsClient(endpoint string) VersionsClient { + return original.NewVersionsClient(endpoint) +} +func NewWithoutDefaults(endpoint string) BaseClient { + return original.NewWithoutDefaults(endpoint) } func PossibleOperationStatusTypeValues() []OperationStatusType { return original.PossibleOperationStatusTypeValues() @@ -406,6 +444,9 @@ func PossibleOperationStatusTypeValues() []OperationStatusType { func PossibleReadableType10Values() []ReadableType10 { return original.PossibleReadableType10Values() } +func PossibleReadableType11Values() []ReadableType11 { + return original.PossibleReadableType11Values() +} func PossibleReadableType1Values() []ReadableType1 { return original.PossibleReadableType1Values() } diff --git a/profiles/preview/preview/containerregistry/mgmt/containerregistry/models.go b/profiles/preview/preview/containerregistry/mgmt/containerregistry/models.go index a87a8b908614..e3a0d14f2a62 100644 --- a/profiles/preview/preview/containerregistry/mgmt/containerregistry/models.go +++ b/profiles/preview/preview/containerregistry/mgmt/containerregistry/models.go @@ -294,7 +294,6 @@ type RegistriesQueueBuildFuture = original.RegistriesQueueBuildFuture type RegistriesUpdateFuture = original.RegistriesUpdateFuture type RegistriesUpdatePoliciesFuture = original.RegistriesUpdatePoliciesFuture type Registry = original.Registry -type RegistryIdentity = original.RegistryIdentity type RegistryListCredentialsResult = original.RegistryListCredentialsResult type RegistryListResult = original.RegistryListResult type RegistryListResultIterator = original.RegistryListResultIterator diff --git a/profiles/preview/preview/containerservice/mgmt/containerservice/containerserviceapi/models.go b/profiles/preview/preview/containerservice/mgmt/containerservice/containerserviceapi/models.go index 3a3037bed8f7..a0f27d9e1c42 100644 --- a/profiles/preview/preview/containerservice/mgmt/containerservice/containerserviceapi/models.go +++ b/profiles/preview/preview/containerservice/mgmt/containerservice/containerserviceapi/models.go @@ -19,8 +19,9 @@ package containerserviceapi -import original "github.com/Azure/azure-sdk-for-go/services/preview/containerservice/mgmt/2018-09-30-preview/containerservice/containerserviceapi" +import original "github.com/Azure/azure-sdk-for-go/services/preview/containerservice/mgmt/2019-09-30-preview/containerservice/containerserviceapi" +type AgentPoolsClientAPI = original.AgentPoolsClientAPI type ContainerServicesClientAPI = original.ContainerServicesClientAPI type ManagedClustersClientAPI = original.ManagedClustersClientAPI type OpenShiftManagedClustersClientAPI = original.OpenShiftManagedClustersClientAPI diff --git a/profiles/preview/preview/containerservice/mgmt/containerservice/models.go b/profiles/preview/preview/containerservice/mgmt/containerservice/models.go index 12cc847e27ab..28fdc64e189c 100644 --- a/profiles/preview/preview/containerservice/mgmt/containerservice/models.go +++ b/profiles/preview/preview/containerservice/mgmt/containerservice/models.go @@ -22,13 +22,20 @@ package containerservice import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/preview/containerservice/mgmt/2018-09-30-preview/containerservice" + original "github.com/Azure/azure-sdk-for-go/services/preview/containerservice/mgmt/2019-09-30-preview/containerservice" ) const ( DefaultBaseURI = original.DefaultBaseURI ) +type AgentPoolType = original.AgentPoolType + +const ( + AvailabilitySet AgentPoolType = original.AvailabilitySet + VirtualMachineScaleSets AgentPoolType = original.VirtualMachineScaleSets +) + type Kind = original.Kind const ( @@ -36,6 +43,13 @@ const ( KindOpenShiftManagedClusterBaseIdentityProvider Kind = original.KindOpenShiftManagedClusterBaseIdentityProvider ) +type LoadBalancerSku = original.LoadBalancerSku + +const ( + Basic LoadBalancerSku = original.Basic + Standard LoadBalancerSku = original.Standard +) + type NetworkPlugin = original.NetworkPlugin const ( @@ -46,7 +60,8 @@ const ( type NetworkPolicy = original.NetworkPolicy const ( - Calico NetworkPolicy = original.Calico + NetworkPolicyAzure NetworkPolicy = original.NetworkPolicyAzure + NetworkPolicyCalico NetworkPolicy = original.NetworkPolicyCalico ) type OSType = original.OSType @@ -111,6 +126,27 @@ const ( Swarm OrchestratorTypes = original.Swarm ) +type ResourceIdentityType = original.ResourceIdentityType + +const ( + None ResourceIdentityType = original.None + SystemAssigned ResourceIdentityType = original.SystemAssigned +) + +type ScaleSetEvictionPolicy = original.ScaleSetEvictionPolicy + +const ( + Deallocate ScaleSetEvictionPolicy = original.Deallocate + Delete ScaleSetEvictionPolicy = original.Delete +) + +type ScaleSetPriority = original.ScaleSetPriority + +const ( + Low ScaleSetPriority = original.Low + Regular ScaleSetPriority = original.Regular +) + type StorageProfileTypes = original.StorageProfileTypes const ( @@ -298,7 +334,20 @@ const ( ) type AccessProfile = original.AccessProfile +type AgentPool = original.AgentPool +type AgentPoolAvailableVersions = original.AgentPoolAvailableVersions +type AgentPoolAvailableVersionsProperties = original.AgentPoolAvailableVersionsProperties +type AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem = original.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem +type AgentPoolListResult = original.AgentPoolListResult +type AgentPoolListResultIterator = original.AgentPoolListResultIterator +type AgentPoolListResultPage = original.AgentPoolListResultPage type AgentPoolProfile = original.AgentPoolProfile +type AgentPoolUpgradeProfile = original.AgentPoolUpgradeProfile +type AgentPoolUpgradeProfileProperties = original.AgentPoolUpgradeProfileProperties +type AgentPoolUpgradeProfilePropertiesUpgradesItem = original.AgentPoolUpgradeProfilePropertiesUpgradesItem +type AgentPoolsClient = original.AgentPoolsClient +type AgentPoolsCreateOrUpdateFuture = original.AgentPoolsCreateOrUpdateFuture +type AgentPoolsDeleteFuture = original.AgentPoolsDeleteFuture type BaseClient = original.BaseClient type BasicOpenShiftManagedClusterBaseIdentityProvider = original.BasicOpenShiftManagedClusterBaseIdentityProvider type CloudError = original.CloudError @@ -318,22 +367,32 @@ type ListResultIterator = original.ListResultIterator type ListResultPage = original.ListResultPage type ManagedCluster = original.ManagedCluster type ManagedClusterAADProfile = original.ManagedClusterAADProfile +type ManagedClusterAPIServerAccessProfile = original.ManagedClusterAPIServerAccessProfile type ManagedClusterAccessProfile = original.ManagedClusterAccessProfile type ManagedClusterAddonProfile = original.ManagedClusterAddonProfile type ManagedClusterAgentPoolProfile = original.ManagedClusterAgentPoolProfile +type ManagedClusterAgentPoolProfileProperties = original.ManagedClusterAgentPoolProfileProperties +type ManagedClusterIdentity = original.ManagedClusterIdentity type ManagedClusterListResult = original.ManagedClusterListResult type ManagedClusterListResultIterator = original.ManagedClusterListResultIterator type ManagedClusterListResultPage = original.ManagedClusterListResultPage +type ManagedClusterLoadBalancerProfile = original.ManagedClusterLoadBalancerProfile +type ManagedClusterLoadBalancerProfileManagedOutboundIPs = original.ManagedClusterLoadBalancerProfileManagedOutboundIPs +type ManagedClusterLoadBalancerProfileOutboundIPPrefixes = original.ManagedClusterLoadBalancerProfileOutboundIPPrefixes +type ManagedClusterLoadBalancerProfileOutboundIPs = original.ManagedClusterLoadBalancerProfileOutboundIPs type ManagedClusterPoolUpgradeProfile = original.ManagedClusterPoolUpgradeProfile +type ManagedClusterPoolUpgradeProfileUpgradesItem = original.ManagedClusterPoolUpgradeProfileUpgradesItem type ManagedClusterProperties = original.ManagedClusterProperties type ManagedClusterServicePrincipalProfile = original.ManagedClusterServicePrincipalProfile type ManagedClusterUpgradeProfile = original.ManagedClusterUpgradeProfile type ManagedClusterUpgradeProfileProperties = original.ManagedClusterUpgradeProfileProperties +type ManagedClusterWindowsProfile = original.ManagedClusterWindowsProfile type ManagedClustersClient = original.ManagedClustersClient type ManagedClustersCreateOrUpdateFuture = original.ManagedClustersCreateOrUpdateFuture type ManagedClustersDeleteFuture = original.ManagedClustersDeleteFuture type ManagedClustersResetAADProfileFuture = original.ManagedClustersResetAADProfileFuture type ManagedClustersResetServicePrincipalProfileFuture = original.ManagedClustersResetServicePrincipalProfileFuture +type ManagedClustersRotateClusterCertificatesFuture = original.ManagedClustersRotateClusterCertificatesFuture type ManagedClustersUpdateTagsFuture = original.ManagedClustersUpdateTagsFuture type MasterProfile = original.MasterProfile type NetworkProfile = original.NetworkProfile @@ -348,6 +407,7 @@ type OpenShiftManagedClusterListResult = original.OpenShiftManagedClusterListRes type OpenShiftManagedClusterListResultIterator = original.OpenShiftManagedClusterListResultIterator type OpenShiftManagedClusterListResultPage = original.OpenShiftManagedClusterListResultPage type OpenShiftManagedClusterMasterPoolProfile = original.OpenShiftManagedClusterMasterPoolProfile +type OpenShiftManagedClusterMonitorProfile = original.OpenShiftManagedClusterMonitorProfile type OpenShiftManagedClusterProperties = original.OpenShiftManagedClusterProperties type OpenShiftManagedClustersClient = original.OpenShiftManagedClustersClient type OpenShiftManagedClustersCreateOrUpdateFuture = original.OpenShiftManagedClustersCreateOrUpdateFuture @@ -366,9 +426,11 @@ type OrchestratorVersionProfileProperties = original.OrchestratorVersionProfileP type Properties = original.Properties type PurchasePlan = original.PurchasePlan type Resource = original.Resource +type ResourceReference = original.ResourceReference type SSHConfiguration = original.SSHConfiguration type SSHPublicKey = original.SSHPublicKey type ServicePrincipalProfile = original.ServicePrincipalProfile +type SubResource = original.SubResource type TagsObject = original.TagsObject type VMDiagnostics = original.VMDiagnostics type WindowsProfile = original.WindowsProfile @@ -376,6 +438,18 @@ type WindowsProfile = original.WindowsProfile func New(subscriptionID string) BaseClient { return original.New(subscriptionID) } +func NewAgentPoolListResultIterator(page AgentPoolListResultPage) AgentPoolListResultIterator { + return original.NewAgentPoolListResultIterator(page) +} +func NewAgentPoolListResultPage(getNextPage func(context.Context, AgentPoolListResult) (AgentPoolListResult, error)) AgentPoolListResultPage { + return original.NewAgentPoolListResultPage(getNextPage) +} +func NewAgentPoolsClient(subscriptionID string) AgentPoolsClient { + return original.NewAgentPoolsClient(subscriptionID) +} +func NewAgentPoolsClientWithBaseURI(baseURI string, subscriptionID string) AgentPoolsClient { + return original.NewAgentPoolsClientWithBaseURI(baseURI, subscriptionID) +} func NewContainerServicesClient(subscriptionID string) ContainerServicesClient { return original.NewContainerServicesClient(subscriptionID) } @@ -421,9 +495,15 @@ func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) Opera func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { return original.NewWithBaseURI(baseURI, subscriptionID) } +func PossibleAgentPoolTypeValues() []AgentPoolType { + return original.PossibleAgentPoolTypeValues() +} func PossibleKindValues() []Kind { return original.PossibleKindValues() } +func PossibleLoadBalancerSkuValues() []LoadBalancerSku { + return original.PossibleLoadBalancerSkuValues() +} func PossibleNetworkPluginValues() []NetworkPlugin { return original.PossibleNetworkPluginValues() } @@ -442,6 +522,15 @@ func PossibleOpenShiftContainerServiceVMSizeValues() []OpenShiftContainerService func PossibleOrchestratorTypesValues() []OrchestratorTypes { return original.PossibleOrchestratorTypesValues() } +func PossibleResourceIdentityTypeValues() []ResourceIdentityType { + return original.PossibleResourceIdentityTypeValues() +} +func PossibleScaleSetEvictionPolicyValues() []ScaleSetEvictionPolicy { + return original.PossibleScaleSetEvictionPolicyValues() +} +func PossibleScaleSetPriorityValues() []ScaleSetPriority { + return original.PossibleScaleSetPriorityValues() +} func PossibleStorageProfileTypesValues() []StorageProfileTypes { return original.PossibleStorageProfileTypesValues() } diff --git a/profiles/preview/preview/costmanagement/mgmt/costmanagement/costmanagementapi/models.go b/profiles/preview/preview/costmanagement/mgmt/costmanagement/costmanagementapi/models.go index 30692e98e72f..65d2217016c3 100644 --- a/profiles/preview/preview/costmanagement/mgmt/costmanagement/costmanagementapi/models.go +++ b/profiles/preview/preview/costmanagement/mgmt/costmanagement/costmanagementapi/models.go @@ -19,14 +19,9 @@ package costmanagementapi -import original "github.com/Azure/azure-sdk-for-go/services/preview/costmanagement/mgmt/2019-03-01/costmanagement/costmanagementapi" +import original "github.com/Azure/azure-sdk-for-go/services/preview/costmanagement/mgmt/2019-10-01/costmanagement/costmanagementapi" -type CloudConnectorClientAPI = original.CloudConnectorClientAPI type DimensionsClientAPI = original.DimensionsClientAPI -type ExternalBillingAccountClientAPI = original.ExternalBillingAccountClientAPI -type ExternalSubscriptionClientAPI = original.ExternalSubscriptionClientAPI -type ForecastClientAPI = original.ForecastClientAPI +type ExportsClientAPI = original.ExportsClientAPI type OperationsClientAPI = original.OperationsClientAPI type QueryClientAPI = original.QueryClientAPI -type ShowbackRuleClientAPI = original.ShowbackRuleClientAPI -type ShowbackRulesClientAPI = original.ShowbackRulesClientAPI diff --git a/profiles/preview/preview/costmanagement/mgmt/costmanagement/models.go b/profiles/preview/preview/costmanagement/mgmt/costmanagement/models.go index b494b6bf547f..2cf56f16ec73 100644 --- a/profiles/preview/preview/costmanagement/mgmt/costmanagement/models.go +++ b/profiles/preview/preview/costmanagement/mgmt/costmanagement/models.go @@ -22,190 +22,141 @@ package costmanagement import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/preview/costmanagement/mgmt/2019-03-01/costmanagement" + original "github.com/Azure/azure-sdk-for-go/services/preview/costmanagement/mgmt/2019-10-01/costmanagement" ) const ( DefaultBaseURI = original.DefaultBaseURI ) -type ConnectorBillingModel = original.ConnectorBillingModel +type ExecutionStatus = original.ExecutionStatus const ( - AutoUpgrade ConnectorBillingModel = original.AutoUpgrade - Expired ConnectorBillingModel = original.Expired - Premium ConnectorBillingModel = original.Premium - Trial ConnectorBillingModel = original.Trial + Completed ExecutionStatus = original.Completed + DataNotAvailable ExecutionStatus = original.DataNotAvailable + Failed ExecutionStatus = original.Failed + InProgress ExecutionStatus = original.InProgress + NewDataNotAvailable ExecutionStatus = original.NewDataNotAvailable + Queued ExecutionStatus = original.Queued + Timeout ExecutionStatus = original.Timeout ) -type ConnectorStatus = original.ConnectorStatus +type ExecutionType = original.ExecutionType const ( - ConnectorStatusActive ConnectorStatus = original.ConnectorStatusActive - ConnectorStatusError ConnectorStatus = original.ConnectorStatusError - ConnectorStatusExpired ConnectorStatus = original.ConnectorStatusExpired - ConnectorStatusWarning ConnectorStatus = original.ConnectorStatusWarning + OnDemand ExecutionType = original.OnDemand + Scheduled ExecutionType = original.Scheduled ) -type CostAllocationPolicy = original.CostAllocationPolicy +type FormatType = original.FormatType const ( - Evenly CostAllocationPolicy = original.Evenly - Fixed CostAllocationPolicy = original.Fixed - Proportional CostAllocationPolicy = original.Proportional -) - -type Direction = original.Direction - -const ( - Ascending Direction = original.Ascending - Descending Direction = original.Descending -) - -type FunctionType = original.FunctionType - -const ( - AHUB FunctionType = original.AHUB - All FunctionType = original.All - None FunctionType = original.None - Reservations FunctionType = original.Reservations + Csv FormatType = original.Csv ) type GranularityType = original.GranularityType const ( - Daily GranularityType = original.Daily - Monthly GranularityType = original.Monthly + Daily GranularityType = original.Daily + Hourly GranularityType = original.Hourly ) -type OperatorType = original.OperatorType +type QueryColumnType = original.QueryColumnType const ( - Contains OperatorType = original.Contains - In OperatorType = original.In + QueryColumnTypeDimension QueryColumnType = original.QueryColumnTypeDimension + QueryColumnTypeTag QueryColumnType = original.QueryColumnTypeTag ) -type ReportConfigColumnType = original.ReportConfigColumnType +type RecurrenceType = original.RecurrenceType const ( - ReportConfigColumnTypeDimension ReportConfigColumnType = original.ReportConfigColumnTypeDimension - ReportConfigColumnTypeTag ReportConfigColumnType = original.ReportConfigColumnTypeTag + RecurrenceTypeAnnually RecurrenceType = original.RecurrenceTypeAnnually + RecurrenceTypeDaily RecurrenceType = original.RecurrenceTypeDaily + RecurrenceTypeMonthly RecurrenceType = original.RecurrenceTypeMonthly + RecurrenceTypeWeekly RecurrenceType = original.RecurrenceTypeWeekly ) -type RuleType = original.RuleType +type SortDirection = original.SortDirection const ( - RuleTypeCostAllocation RuleType = original.RuleTypeCostAllocation - RuleTypeCustomPrice RuleType = original.RuleTypeCustomPrice - RuleTypeShowbackRuleProperties RuleType = original.RuleTypeShowbackRuleProperties + Ascending SortDirection = original.Ascending + Descending SortDirection = original.Descending ) -type ShowbackRuleStatus = original.ShowbackRuleStatus +type StatusType = original.StatusType const ( - Active ShowbackRuleStatus = original.Active - NotActive ShowbackRuleStatus = original.NotActive + Active StatusType = original.Active + Inactive StatusType = original.Inactive ) type TimeframeType = original.TimeframeType const ( - Custom TimeframeType = original.Custom - MonthToDate TimeframeType = original.MonthToDate - WeekToDate TimeframeType = original.WeekToDate - YearToDate TimeframeType = original.YearToDate + Custom TimeframeType = original.Custom + MonthToDate TimeframeType = original.MonthToDate + TheLastMonth TimeframeType = original.TheLastMonth + TheLastWeek TimeframeType = original.TheLastWeek + TheLastYear TimeframeType = original.TheLastYear + WeekToDate TimeframeType = original.WeekToDate + YearToDate TimeframeType = original.YearToDate ) type BaseClient = original.BaseClient -type BasicShowbackRuleProperties = original.BasicShowbackRuleProperties -type CloudConnectorClient = original.CloudConnectorClient -type ConnectorCollectionErrorInfo = original.ConnectorCollectionErrorInfo -type ConnectorCollectionInfo = original.ConnectorCollectionInfo -type ConnectorDefinition = original.ConnectorDefinition -type ConnectorDefinitionListResult = original.ConnectorDefinitionListResult -type ConnectorProperties = original.ConnectorProperties -type CostAllocationDetails = original.CostAllocationDetails -type CostAllocationDetailsKind = original.CostAllocationDetailsKind -type CustomPriceDetails = original.CustomPriceDetails -type CustomPriceDetailsKind = original.CustomPriceDetailsKind +type CommonExportProperties = original.CommonExportProperties type Dimension = original.Dimension type DimensionProperties = original.DimensionProperties type DimensionsClient = original.DimensionsClient type DimensionsListResult = original.DimensionsListResult -type ErrorBase = original.ErrorBase type ErrorDetails = original.ErrorDetails type ErrorResponse = original.ErrorResponse -type ExternalBillingAccountClient = original.ExternalBillingAccountClient -type ExternalBillingAccountDefinition = original.ExternalBillingAccountDefinition -type ExternalBillingAccountDefinitionListResult = original.ExternalBillingAccountDefinitionListResult -type ExternalBillingAccountProperties = original.ExternalBillingAccountProperties -type ExternalSubscriptionClient = original.ExternalSubscriptionClient -type ExternalSubscriptionDefinition = original.ExternalSubscriptionDefinition -type ExternalSubscriptionDefinitionListResult = original.ExternalSubscriptionDefinitionListResult -type ExternalSubscriptionIDListRequest = original.ExternalSubscriptionIDListRequest -type ExternalSubscriptionProperties = original.ExternalSubscriptionProperties -type ForecastClient = original.ForecastClient -type Markup = original.Markup +type Export = original.Export +type ExportDeliveryDestination = original.ExportDeliveryDestination +type ExportDeliveryInfo = original.ExportDeliveryInfo +type ExportExecution = original.ExportExecution +type ExportExecutionListResult = original.ExportExecutionListResult +type ExportExecutionProperties = original.ExportExecutionProperties +type ExportListResult = original.ExportListResult +type ExportProperties = original.ExportProperties +type ExportRecurrencePeriod = original.ExportRecurrencePeriod +type ExportSchedule = original.ExportSchedule +type ExportsClient = original.ExportsClient type Operation = original.Operation type OperationDisplay = original.OperationDisplay type OperationListResult = original.OperationListResult type OperationListResultIterator = original.OperationListResultIterator type OperationListResultPage = original.OperationListResultPage type OperationsClient = original.OperationsClient -type Query = original.Query +type QueryAggregation = original.QueryAggregation type QueryClient = original.QueryClient type QueryColumn = original.QueryColumn +type QueryComparisonExpression = original.QueryComparisonExpression +type QueryDataset = original.QueryDataset +type QueryDatasetConfiguration = original.QueryDatasetConfiguration +type QueryDefinition = original.QueryDefinition +type QueryFilter = original.QueryFilter +type QueryGrouping = original.QueryGrouping type QueryProperties = original.QueryProperties type QueryResult = original.QueryResult -type ReportConfigAggregation = original.ReportConfigAggregation -type ReportConfigComparisonExpression = original.ReportConfigComparisonExpression -type ReportConfigDataset = original.ReportConfigDataset -type ReportConfigDatasetConfiguration = original.ReportConfigDatasetConfiguration -type ReportConfigDefinition = original.ReportConfigDefinition -type ReportConfigFilter = original.ReportConfigFilter -type ReportConfigGrouping = original.ReportConfigGrouping -type ReportConfigSorting = original.ReportConfigSorting -type ReportConfigTimePeriod = original.ReportConfigTimePeriod +type QuerySortingConfiguration = original.QuerySortingConfiguration +type QueryTimePeriod = original.QueryTimePeriod type Resource = original.Resource -type Scope = original.Scope -type ShowbackRule = original.ShowbackRule -type ShowbackRuleClient = original.ShowbackRuleClient -type ShowbackRuleListResult = original.ShowbackRuleListResult -type ShowbackRuleProperties = original.ShowbackRuleProperties -type ShowbackRulesClient = original.ShowbackRulesClient func New(subscriptionID string) BaseClient { return original.New(subscriptionID) } -func NewCloudConnectorClient(subscriptionID string) CloudConnectorClient { - return original.NewCloudConnectorClient(subscriptionID) -} -func NewCloudConnectorClientWithBaseURI(baseURI string, subscriptionID string) CloudConnectorClient { - return original.NewCloudConnectorClientWithBaseURI(baseURI, subscriptionID) -} func NewDimensionsClient(subscriptionID string) DimensionsClient { return original.NewDimensionsClient(subscriptionID) } func NewDimensionsClientWithBaseURI(baseURI string, subscriptionID string) DimensionsClient { return original.NewDimensionsClientWithBaseURI(baseURI, subscriptionID) } -func NewExternalBillingAccountClient(subscriptionID string) ExternalBillingAccountClient { - return original.NewExternalBillingAccountClient(subscriptionID) +func NewExportsClient(subscriptionID string) ExportsClient { + return original.NewExportsClient(subscriptionID) } -func NewExternalBillingAccountClientWithBaseURI(baseURI string, subscriptionID string) ExternalBillingAccountClient { - return original.NewExternalBillingAccountClientWithBaseURI(baseURI, subscriptionID) -} -func NewExternalSubscriptionClient(subscriptionID string) ExternalSubscriptionClient { - return original.NewExternalSubscriptionClient(subscriptionID) -} -func NewExternalSubscriptionClientWithBaseURI(baseURI string, subscriptionID string) ExternalSubscriptionClient { - return original.NewExternalSubscriptionClientWithBaseURI(baseURI, subscriptionID) -} -func NewForecastClient(subscriptionID string) ForecastClient { - return original.NewForecastClient(subscriptionID) -} -func NewForecastClientWithBaseURI(baseURI string, subscriptionID string) ForecastClient { - return original.NewForecastClientWithBaseURI(baseURI, subscriptionID) +func NewExportsClientWithBaseURI(baseURI string, subscriptionID string) ExportsClient { + return original.NewExportsClientWithBaseURI(baseURI, subscriptionID) } func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { return original.NewOperationListResultIterator(page) @@ -225,50 +176,32 @@ func NewQueryClient(subscriptionID string) QueryClient { func NewQueryClientWithBaseURI(baseURI string, subscriptionID string) QueryClient { return original.NewQueryClientWithBaseURI(baseURI, subscriptionID) } -func NewShowbackRuleClient(subscriptionID string) ShowbackRuleClient { - return original.NewShowbackRuleClient(subscriptionID) -} -func NewShowbackRuleClientWithBaseURI(baseURI string, subscriptionID string) ShowbackRuleClient { - return original.NewShowbackRuleClientWithBaseURI(baseURI, subscriptionID) -} -func NewShowbackRulesClient(subscriptionID string) ShowbackRulesClient { - return original.NewShowbackRulesClient(subscriptionID) -} -func NewShowbackRulesClientWithBaseURI(baseURI string, subscriptionID string) ShowbackRulesClient { - return original.NewShowbackRulesClientWithBaseURI(baseURI, subscriptionID) -} func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { return original.NewWithBaseURI(baseURI, subscriptionID) } -func PossibleConnectorBillingModelValues() []ConnectorBillingModel { - return original.PossibleConnectorBillingModelValues() -} -func PossibleConnectorStatusValues() []ConnectorStatus { - return original.PossibleConnectorStatusValues() -} -func PossibleCostAllocationPolicyValues() []CostAllocationPolicy { - return original.PossibleCostAllocationPolicyValues() +func PossibleExecutionStatusValues() []ExecutionStatus { + return original.PossibleExecutionStatusValues() } -func PossibleDirectionValues() []Direction { - return original.PossibleDirectionValues() +func PossibleExecutionTypeValues() []ExecutionType { + return original.PossibleExecutionTypeValues() } -func PossibleFunctionTypeValues() []FunctionType { - return original.PossibleFunctionTypeValues() +func PossibleFormatTypeValues() []FormatType { + return original.PossibleFormatTypeValues() } func PossibleGranularityTypeValues() []GranularityType { return original.PossibleGranularityTypeValues() } -func PossibleOperatorTypeValues() []OperatorType { - return original.PossibleOperatorTypeValues() +func PossibleQueryColumnTypeValues() []QueryColumnType { + return original.PossibleQueryColumnTypeValues() } -func PossibleReportConfigColumnTypeValues() []ReportConfigColumnType { - return original.PossibleReportConfigColumnTypeValues() +func PossibleRecurrenceTypeValues() []RecurrenceType { + return original.PossibleRecurrenceTypeValues() } -func PossibleRuleTypeValues() []RuleType { - return original.PossibleRuleTypeValues() +func PossibleSortDirectionValues() []SortDirection { + return original.PossibleSortDirectionValues() } -func PossibleShowbackRuleStatusValues() []ShowbackRuleStatus { - return original.PossibleShowbackRuleStatusValues() +func PossibleStatusTypeValues() []StatusType { + return original.PossibleStatusTypeValues() } func PossibleTimeframeTypeValues() []TimeframeType { return original.PossibleTimeframeTypeValues() diff --git a/profiles/preview/preview/datashare/mgmt/datashare/models.go b/profiles/preview/preview/datashare/mgmt/datashare/models.go index a2f529f07097..35130fe8a3eb 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 + KustoCluster DataSetType = original.KustoCluster + KustoDatabase DataSetType = original.KustoDatabase SQLDBTable DataSetType = original.SQLDBTable SQLDWTable DataSetType = original.SQLDWTable ) @@ -72,6 +74,8 @@ const ( KindBlobFolder Kind = original.KindBlobFolder KindContainer Kind = original.KindContainer KindDataSet Kind = original.KindDataSet + KindKustoCluster Kind = original.KindKustoCluster + KindKustoDatabase Kind = original.KindKustoDatabase KindSQLDBTable Kind = original.KindSQLDBTable KindSQLDWTable Kind = original.KindSQLDWTable ) @@ -86,6 +90,8 @@ const ( KindBasicDataSetMappingKindBlobFolder KindBasicDataSetMapping = original.KindBasicDataSetMappingKindBlobFolder KindBasicDataSetMappingKindContainer KindBasicDataSetMapping = original.KindBasicDataSetMappingKindContainer KindBasicDataSetMappingKindDataSetMapping KindBasicDataSetMapping = original.KindBasicDataSetMappingKindDataSetMapping + KindBasicDataSetMappingKindKustoCluster KindBasicDataSetMapping = original.KindBasicDataSetMappingKindKustoCluster + KindBasicDataSetMappingKindKustoDatabase KindBasicDataSetMapping = original.KindBasicDataSetMappingKindKustoDatabase KindBasicDataSetMappingKindSQLDBTable KindBasicDataSetMapping = original.KindBasicDataSetMappingKindSQLDBTable KindBasicDataSetMappingKindSQLDWTable KindBasicDataSetMapping = original.KindBasicDataSetMappingKindSQLDWTable ) @@ -139,6 +145,7 @@ type ShareKind = original.ShareKind const ( CopyBased ShareKind = original.CopyBased + InPlace ShareKind = original.InPlace ) type ShareSubscriptionStatus = original.ShareSubscriptionStatus @@ -249,6 +256,7 @@ type DataSetMappingModel = original.DataSetMappingModel type DataSetMappingsClient = original.DataSetMappingsClient type DataSetModel = original.DataSetModel type DataSetsClient = original.DataSetsClient +type DataSetsDeleteFuture = original.DataSetsDeleteFuture type DefaultDto = original.DefaultDto type DimensionProperties = original.DimensionProperties type Error = original.Error @@ -260,6 +268,14 @@ type InvitationListIterator = original.InvitationListIterator type InvitationListPage = original.InvitationListPage type InvitationProperties = original.InvitationProperties type InvitationsClient = original.InvitationsClient +type KustoClusterDataSet = original.KustoClusterDataSet +type KustoClusterDataSetMapping = original.KustoClusterDataSetMapping +type KustoClusterDataSetMappingProperties = original.KustoClusterDataSetMappingProperties +type KustoClusterDataSetProperties = original.KustoClusterDataSetProperties +type KustoDatabaseDataSet = original.KustoDatabaseDataSet +type KustoDatabaseDataSetMapping = original.KustoDatabaseDataSetMapping +type KustoDatabaseDataSetMappingProperties = original.KustoDatabaseDataSetMappingProperties +type KustoDatabaseDataSetProperties = original.KustoDatabaseDataSetProperties type OperationList = original.OperationList type OperationListIterator = original.OperationListIterator type OperationListPage = original.OperationListPage diff --git a/profiles/preview/preview/eventhub/mgmt/eventhub/models.go b/profiles/preview/preview/eventhub/mgmt/eventhub/models.go index 752727ce092e..f4cc4662efc8 100644 --- a/profiles/preview/preview/eventhub/mgmt/eventhub/models.go +++ b/profiles/preview/preview/eventhub/mgmt/eventhub/models.go @@ -43,6 +43,18 @@ const ( Reject IPAction = original.Reject ) +type IdentityType = original.IdentityType + +const ( + SystemAssigned IdentityType = original.SystemAssigned +) + +type KeySource = original.KeySource + +const ( + MicrosoftKeyVault KeySource = original.MicrosoftKeyVault +) + type NetworkRuleIPAction = original.NetworkRuleIPAction const ( @@ -85,12 +97,15 @@ type EHNamespaceListResult = original.EHNamespaceListResult type EHNamespaceListResultIterator = original.EHNamespaceListResultIterator type EHNamespaceListResultPage = original.EHNamespaceListResultPage type EHNamespaceProperties = original.EHNamespaceProperties +type Encryption = original.Encryption type ErrorResponse = original.ErrorResponse type IPFilterRule = original.IPFilterRule type IPFilterRuleListResult = original.IPFilterRuleListResult type IPFilterRuleListResultIterator = original.IPFilterRuleListResultIterator type IPFilterRuleListResultPage = original.IPFilterRuleListResultPage type IPFilterRuleProperties = original.IPFilterRuleProperties +type Identity = original.Identity +type KeyVaultProperties = original.KeyVaultProperties type NWRuleSetIPRules = original.NWRuleSetIPRules type NWRuleSetVirtualNetworkRules = original.NWRuleSetVirtualNetworkRules type NamespacesClient = original.NamespacesClient @@ -180,6 +195,12 @@ func PossibleDefaultActionValues() []DefaultAction { func PossibleIPActionValues() []IPAction { return original.PossibleIPActionValues() } +func PossibleIdentityTypeValues() []IdentityType { + return original.PossibleIdentityTypeValues() +} +func PossibleKeySourceValues() []KeySource { + return original.PossibleKeySourceValues() +} func PossibleNetworkRuleIPActionValues() []NetworkRuleIPAction { return original.PossibleNetworkRuleIPActionValues() } diff --git a/profiles/preview/preview/hdinsight/mgmt/hdinsight/models.go b/profiles/preview/preview/hdinsight/mgmt/hdinsight/models.go index 506072d9bc3e..88db56d34baf 100644 --- a/profiles/preview/preview/hdinsight/mgmt/hdinsight/models.go +++ b/profiles/preview/preview/hdinsight/mgmt/hdinsight/models.go @@ -29,19 +29,6 @@ const ( DefaultBaseURI = original.DefaultBaseURI ) -type ApplicationHTTPSEndpointAccessMode = original.ApplicationHTTPSEndpointAccessMode - -const ( - WebPage ApplicationHTTPSEndpointAccessMode = original.WebPage -) - -type ApplicationType = original.ApplicationType - -const ( - CustomApplication ApplicationType = original.CustomApplication - RServer ApplicationType = original.RServer -) - type AsyncOperationState = original.AsyncOperationState const ( @@ -311,12 +298,6 @@ func NewScriptExecutionHistoryClientWithBaseURI(baseURI string, subscriptionID s func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { return original.NewWithBaseURI(baseURI, subscriptionID) } -func PossibleApplicationHTTPSEndpointAccessModeValues() []ApplicationHTTPSEndpointAccessMode { - return original.PossibleApplicationHTTPSEndpointAccessModeValues() -} -func PossibleApplicationTypeValues() []ApplicationType { - return original.PossibleApplicationTypeValues() -} func PossibleAsyncOperationStateValues() []AsyncOperationState { return original.PossibleAsyncOperationStateValues() } diff --git a/profiles/preview/preview/hybridcompute/mgmt/hybridcompute/hybridcomputeapi/models.go b/profiles/preview/preview/hybridcompute/mgmt/hybridcompute/hybridcomputeapi/models.go new file mode 100644 index 000000000000..cd8991e3187d --- /dev/null +++ b/profiles/preview/preview/hybridcompute/mgmt/hybridcompute/hybridcomputeapi/models.go @@ -0,0 +1,25 @@ +// +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 hybridcomputeapi + +import original "github.com/Azure/azure-sdk-for-go/services/preview/hybridcompute/mgmt/2019-03-18-preview/hybridcompute/hybridcomputeapi" + +type MachinesClientAPI = original.MachinesClientAPI +type OperationsClientAPI = original.OperationsClientAPI diff --git a/profiles/preview/preview/hybridcompute/mgmt/hybridcompute/models.go b/profiles/preview/preview/hybridcompute/mgmt/hybridcompute/models.go new file mode 100644 index 000000000000..7f28840ce6a8 --- /dev/null +++ b/profiles/preview/preview/hybridcompute/mgmt/hybridcompute/models.go @@ -0,0 +1,103 @@ +// +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 hybridcompute + +import ( + "context" + + original "github.com/Azure/azure-sdk-for-go/services/preview/hybridcompute/mgmt/2019-03-18-preview/hybridcompute" +) + +const ( + DefaultBaseURI = original.DefaultBaseURI +) + +type InstanceViewTypes = original.InstanceViewTypes + +const ( + InstanceView InstanceViewTypes = original.InstanceView +) + +type StatusTypes = original.StatusTypes + +const ( + Connected StatusTypes = original.Connected + Disconnected StatusTypes = original.Disconnected + Error StatusTypes = original.Error +) + +type BaseClient = original.BaseClient +type ErrorDetail = original.ErrorDetail +type ErrorResponse = original.ErrorResponse +type Identity = original.Identity +type Machine = original.Machine +type MachineListResult = original.MachineListResult +type MachineListResultIterator = original.MachineListResultIterator +type MachineListResultPage = original.MachineListResultPage +type MachineProperties = original.MachineProperties +type MachineReconnect = original.MachineReconnect +type MachineReconnectProperties = original.MachineReconnectProperties +type MachineUpdate = original.MachineUpdate +type MachineUpdateProperties = original.MachineUpdateProperties +type MachinesClient = original.MachinesClient +type OSProfile = original.OSProfile +type OperationListResult = original.OperationListResult +type OperationValue = original.OperationValue +type OperationValueDisplay = original.OperationValueDisplay +type OperationsClient = original.OperationsClient +type Resource = original.Resource +type UpdateResource = original.UpdateResource + +func New(subscriptionID string) BaseClient { + return original.New(subscriptionID) +} +func NewMachineListResultIterator(page MachineListResultPage) MachineListResultIterator { + return original.NewMachineListResultIterator(page) +} +func NewMachineListResultPage(getNextPage func(context.Context, MachineListResult) (MachineListResult, error)) MachineListResultPage { + return original.NewMachineListResultPage(getNextPage) +} +func NewMachinesClient(subscriptionID string) MachinesClient { + return original.NewMachinesClient(subscriptionID) +} +func NewMachinesClientWithBaseURI(baseURI string, subscriptionID string) MachinesClient { + return original.NewMachinesClientWithBaseURI(baseURI, subscriptionID) +} +func NewOperationsClient(subscriptionID string) OperationsClient { + return original.NewOperationsClient(subscriptionID) +} +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) +} +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return original.NewWithBaseURI(baseURI, subscriptionID) +} +func PossibleInstanceViewTypesValues() []InstanceViewTypes { + return original.PossibleInstanceViewTypesValues() +} +func PossibleStatusTypesValues() []StatusTypes { + return original.PossibleStatusTypesValues() +} +func UserAgent() string { + return original.UserAgent() + " profiles/preview" +} +func Version() string { + return original.Version() +} diff --git a/profiles/preview/preview/mysql/mgmt/mysql/models.go b/profiles/preview/preview/mysql/mgmt/mysql/models.go index 1b22f81ab506..6ed8532aef8c 100644 --- a/profiles/preview/preview/mysql/mgmt/mysql/models.go +++ b/profiles/preview/preview/mysql/mgmt/mysql/models.go @@ -148,6 +148,12 @@ type ProxyResource = original.ProxyResource type ReplicasClient = original.ReplicasClient type SecurityAlertPolicyProperties = original.SecurityAlertPolicyProperties type Server = original.Server +type ServerAdministratorProperties = original.ServerAdministratorProperties +type ServerAdministratorResource = original.ServerAdministratorResource +type ServerAdministratorResourceListResult = original.ServerAdministratorResourceListResult +type ServerAdministratorsClient = original.ServerAdministratorsClient +type ServerAdministratorsCreateOrUpdateFuture = original.ServerAdministratorsCreateOrUpdateFuture +type ServerAdministratorsDeleteFuture = original.ServerAdministratorsDeleteFuture type ServerForCreate = original.ServerForCreate type ServerListResult = original.ServerListResult type ServerProperties = original.ServerProperties @@ -229,6 +235,12 @@ func NewReplicasClient(subscriptionID string) ReplicasClient { func NewReplicasClientWithBaseURI(baseURI string, subscriptionID string) ReplicasClient { return original.NewReplicasClientWithBaseURI(baseURI, subscriptionID) } +func NewServerAdministratorsClient(subscriptionID string) ServerAdministratorsClient { + return original.NewServerAdministratorsClient(subscriptionID) +} +func NewServerAdministratorsClientWithBaseURI(baseURI string, subscriptionID string) ServerAdministratorsClient { + return original.NewServerAdministratorsClientWithBaseURI(baseURI, subscriptionID) +} func NewServerSecurityAlertPoliciesClient(subscriptionID string) ServerSecurityAlertPoliciesClient { return original.NewServerSecurityAlertPoliciesClient(subscriptionID) } diff --git a/profiles/preview/preview/mysql/mgmt/mysql/mysqlapi/models.go b/profiles/preview/preview/mysql/mgmt/mysql/mysqlapi/models.go index 175d2fd4fd60..d2d2d155946f 100644 --- a/profiles/preview/preview/mysql/mgmt/mysql/mysqlapi/models.go +++ b/profiles/preview/preview/mysql/mgmt/mysql/mysqlapi/models.go @@ -29,6 +29,7 @@ type LocationBasedPerformanceTierClientAPI = original.LocationBasedPerformanceTi type LogFilesClientAPI = original.LogFilesClientAPI type OperationsClientAPI = original.OperationsClientAPI type ReplicasClientAPI = original.ReplicasClientAPI +type ServerAdministratorsClientAPI = original.ServerAdministratorsClientAPI type ServerSecurityAlertPoliciesClientAPI = original.ServerSecurityAlertPoliciesClientAPI type ServersClientAPI = original.ServersClientAPI type VirtualNetworkRulesClientAPI = original.VirtualNetworkRulesClientAPI diff --git a/profiles/preview/preview/peering/mgmt/peering/models.go b/profiles/preview/preview/peering/mgmt/peering/models.go index cabe32ebf48e..80000056b1b1 100644 --- a/profiles/preview/preview/peering/mgmt/peering/models.go +++ b/profiles/preview/preview/peering/mgmt/peering/models.go @@ -22,7 +22,7 @@ package peering import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/preview/peering/mgmt/2019-08-01-preview/peering" + original "github.com/Azure/azure-sdk-for-go/services/preview/peering/mgmt/2019-09-01-preview/peering" ) const ( @@ -68,9 +68,9 @@ const ( type LearnedType = original.LearnedType const ( - LearnedTypeNone LearnedType = original.LearnedTypeNone - LearnedTypeViaPartner LearnedType = original.LearnedTypeViaPartner - LearnedTypeViaSession LearnedType = original.LearnedTypeViaSession + LearnedTypeNone LearnedType = original.LearnedTypeNone + LearnedTypeViaServiceProvider LearnedType = original.LearnedTypeViaServiceProvider + LearnedTypeViaSession LearnedType = original.LearnedTypeViaSession ) type Name = original.Name @@ -93,6 +93,7 @@ const ( PrefixValidationStatePending PrefixValidationState = original.PrefixValidationStatePending PrefixValidationStateUnknown PrefixValidationState = original.PrefixValidationStateUnknown PrefixValidationStateVerified PrefixValidationState = original.PrefixValidationStateVerified + PrefixValidationStateWarning PrefixValidationState = original.PrefixValidationStateWarning ) type ProvisioningState = original.ProvisioningState @@ -220,11 +221,11 @@ type ServiceLocationListResultPage = original.ServiceLocationListResultPage type ServiceLocationProperties = original.ServiceLocationProperties type ServiceLocationsClient = original.ServiceLocationsClient type ServicePrefix = original.ServicePrefix +type ServicePrefixEvent = original.ServicePrefixEvent type ServicePrefixListResult = original.ServicePrefixListResult type ServicePrefixListResultIterator = original.ServicePrefixListResultIterator type ServicePrefixListResultPage = original.ServicePrefixListResultPage type ServicePrefixProperties = original.ServicePrefixProperties -type ServicePrefixesClient = original.ServicePrefixesClient type ServiceProperties = original.ServiceProperties type ServiceProvider = original.ServiceProvider type ServiceProviderListResult = original.ServiceProviderListResult @@ -324,12 +325,6 @@ func NewServicePrefixListResultIterator(page ServicePrefixListResultPage) Servic func NewServicePrefixListResultPage(getNextPage func(context.Context, ServicePrefixListResult) (ServicePrefixListResult, error)) ServicePrefixListResultPage { return original.NewServicePrefixListResultPage(getNextPage) } -func NewServicePrefixesClient(subscriptionID string) ServicePrefixesClient { - return original.NewServicePrefixesClient(subscriptionID) -} -func NewServicePrefixesClientWithBaseURI(baseURI string, subscriptionID string) ServicePrefixesClient { - return original.NewServicePrefixesClientWithBaseURI(baseURI, subscriptionID) -} func NewServiceProviderListResultIterator(page ServiceProviderListResultPage) ServiceProviderListResultIterator { return original.NewServiceProviderListResultIterator(page) } diff --git a/profiles/preview/preview/peering/mgmt/peering/peeringapi/models.go b/profiles/preview/preview/peering/mgmt/peering/peeringapi/models.go index d3fea5f8eafa..d6b774c37b95 100644 --- a/profiles/preview/preview/peering/mgmt/peering/peeringapi/models.go +++ b/profiles/preview/preview/peering/mgmt/peering/peeringapi/models.go @@ -19,7 +19,7 @@ package peeringapi -import original "github.com/Azure/azure-sdk-for-go/services/preview/peering/mgmt/2019-08-01-preview/peering/peeringapi" +import original "github.com/Azure/azure-sdk-for-go/services/preview/peering/mgmt/2019-09-01-preview/peering/peeringapi" type BaseClientAPI = original.BaseClientAPI type LegacyPeeringsClientAPI = original.LegacyPeeringsClientAPI @@ -29,6 +29,5 @@ type PeerAsnsClientAPI = original.PeerAsnsClientAPI type PeeringsClientAPI = original.PeeringsClientAPI type PrefixesClientAPI = original.PrefixesClientAPI type ServiceLocationsClientAPI = original.ServiceLocationsClientAPI -type ServicePrefixesClientAPI = original.ServicePrefixesClientAPI type ServiceProvidersClientAPI = original.ServiceProvidersClientAPI type ServicesClientAPI = original.ServicesClientAPI diff --git a/profiles/preview/preview/postgresql/mgmt/postgresql/models.go b/profiles/preview/preview/postgresql/mgmt/postgresql/models.go index 4bb162d2499e..bff224032dcd 100644 --- a/profiles/preview/preview/postgresql/mgmt/postgresql/models.go +++ b/profiles/preview/preview/postgresql/mgmt/postgresql/models.go @@ -152,6 +152,12 @@ type ProxyResource = original.ProxyResource type ReplicasClient = original.ReplicasClient type SecurityAlertPolicyProperties = original.SecurityAlertPolicyProperties type Server = original.Server +type ServerAdministratorProperties = original.ServerAdministratorProperties +type ServerAdministratorResource = original.ServerAdministratorResource +type ServerAdministratorResourceListResult = original.ServerAdministratorResourceListResult +type ServerAdministratorsClient = original.ServerAdministratorsClient +type ServerAdministratorsCreateOrUpdateFuture = original.ServerAdministratorsCreateOrUpdateFuture +type ServerAdministratorsDeleteFuture = original.ServerAdministratorsDeleteFuture type ServerForCreate = original.ServerForCreate type ServerListResult = original.ServerListResult type ServerProperties = original.ServerProperties @@ -233,6 +239,12 @@ func NewReplicasClient(subscriptionID string) ReplicasClient { func NewReplicasClientWithBaseURI(baseURI string, subscriptionID string) ReplicasClient { return original.NewReplicasClientWithBaseURI(baseURI, subscriptionID) } +func NewServerAdministratorsClient(subscriptionID string) ServerAdministratorsClient { + return original.NewServerAdministratorsClient(subscriptionID) +} +func NewServerAdministratorsClientWithBaseURI(baseURI string, subscriptionID string) ServerAdministratorsClient { + return original.NewServerAdministratorsClientWithBaseURI(baseURI, subscriptionID) +} func NewServerSecurityAlertPoliciesClient(subscriptionID string) ServerSecurityAlertPoliciesClient { return original.NewServerSecurityAlertPoliciesClient(subscriptionID) } diff --git a/profiles/preview/preview/postgresql/mgmt/postgresql/postgresqlapi/models.go b/profiles/preview/preview/postgresql/mgmt/postgresql/postgresqlapi/models.go index bc9ef850e1c0..a50964de6acb 100644 --- a/profiles/preview/preview/postgresql/mgmt/postgresql/postgresqlapi/models.go +++ b/profiles/preview/preview/postgresql/mgmt/postgresql/postgresqlapi/models.go @@ -29,6 +29,7 @@ type LocationBasedPerformanceTierClientAPI = original.LocationBasedPerformanceTi type LogFilesClientAPI = original.LogFilesClientAPI type OperationsClientAPI = original.OperationsClientAPI type ReplicasClientAPI = original.ReplicasClientAPI +type ServerAdministratorsClientAPI = original.ServerAdministratorsClientAPI type ServerSecurityAlertPoliciesClientAPI = original.ServerSecurityAlertPoliciesClientAPI type ServersClientAPI = original.ServersClientAPI type VirtualNetworkRulesClientAPI = original.VirtualNetworkRulesClientAPI diff --git a/profiles/preview/preview/reservations/mgmt/reservations/models.go b/profiles/preview/preview/reservations/mgmt/reservations/models.go index 93e8b2bf8b0f..8a48e611bb76 100644 --- a/profiles/preview/preview/reservations/mgmt/reservations/models.go +++ b/profiles/preview/preview/reservations/mgmt/reservations/models.go @@ -162,7 +162,6 @@ 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 diff --git a/profiles/preview/preview/security/mgmt/security/models.go b/profiles/preview/preview/security/mgmt/security/models.go index df35b6096df1..cf99cd57bc4e 100644 --- a/profiles/preview/preview/security/mgmt/security/models.go +++ b/profiles/preview/preview/security/mgmt/security/models.go @@ -518,6 +518,7 @@ type IoTSecurityAggregatedAlertList = original.IoTSecurityAggregatedAlertList type IoTSecurityAggregatedAlertListIterator = original.IoTSecurityAggregatedAlertListIterator type IoTSecurityAggregatedAlertListPage = original.IoTSecurityAggregatedAlertListPage type IoTSecurityAggregatedAlertProperties = original.IoTSecurityAggregatedAlertProperties +type IoTSecurityAggregatedAlertPropertiesTopDevicesListItem = original.IoTSecurityAggregatedAlertPropertiesTopDevicesListItem type IoTSecurityAggregatedRecommendation = original.IoTSecurityAggregatedRecommendation type IoTSecurityAggregatedRecommendationList = original.IoTSecurityAggregatedRecommendationList type IoTSecurityAggregatedRecommendationListIterator = original.IoTSecurityAggregatedRecommendationListIterator @@ -532,14 +533,9 @@ type IoTSecuritySolutionAnalyticsModelProperties = original.IoTSecuritySolutionA type IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem = original.IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem type IoTSecuritySolutionModel = original.IoTSecuritySolutionModel type IoTSecuritySolutionProperties = original.IoTSecuritySolutionProperties -type IoTSecuritySolutionsAnalyticsAggregatedAlertsClient = original.IoTSecuritySolutionsAnalyticsAggregatedAlertsClient -type IoTSecuritySolutionsAnalyticsClient = original.IoTSecuritySolutionsAnalyticsClient -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 @@ -802,42 +798,12 @@ func NewIoTSecurityAggregatedRecommendationListIterator(page IoTSecurityAggregat func NewIoTSecurityAggregatedRecommendationListPage(getNextPage func(context.Context, IoTSecurityAggregatedRecommendationList) (IoTSecurityAggregatedRecommendationList, error)) IoTSecurityAggregatedRecommendationListPage { return original.NewIoTSecurityAggregatedRecommendationListPage(getNextPage) } -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 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 NewIoTSecuritySolutionsResourceGroupClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IoTSecuritySolutionsResourceGroupClient { - return original.NewIoTSecuritySolutionsResourceGroupClientWithBaseURI(baseURI, subscriptionID, ascLocation) -} func NewIotSecuritySolutionAnalyticsClient(subscriptionID string, ascLocation string) IotSecuritySolutionAnalyticsClient { return original.NewIotSecuritySolutionAnalyticsClient(subscriptionID, ascLocation) } diff --git a/profiles/preview/preview/sql/mgmt/sql/models.go b/profiles/preview/preview/sql/mgmt/sql/models.go index 116fa93df32b..06ea636d3fe2 100644 --- a/profiles/preview/preview/sql/mgmt/sql/models.go +++ b/profiles/preview/preview/sql/mgmt/sql/models.go @@ -22,96 +22,13 @@ package sql import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2018-06-15-preview/sql" + original "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2018-06-01-preview/sql" ) const ( DefaultBaseURI = original.DefaultBaseURI ) -type AuthenticationType = original.AuthenticationType - -const ( - ADPassword AuthenticationType = original.ADPassword - SQL AuthenticationType = original.SQL -) - -type AutomaticTuningDisabledReason = original.AutomaticTuningDisabledReason - -const ( - AutoConfigured AutomaticTuningDisabledReason = original.AutoConfigured - Default AutomaticTuningDisabledReason = original.Default - Disabled AutomaticTuningDisabledReason = original.Disabled - InheritedFromServer AutomaticTuningDisabledReason = original.InheritedFromServer - NotSupported AutomaticTuningDisabledReason = original.NotSupported - QueryStoreOff AutomaticTuningDisabledReason = original.QueryStoreOff - QueryStoreReadOnly AutomaticTuningDisabledReason = original.QueryStoreReadOnly -) - -type AutomaticTuningMode = original.AutomaticTuningMode - -const ( - Auto AutomaticTuningMode = original.Auto - Custom AutomaticTuningMode = original.Custom - Inherit AutomaticTuningMode = original.Inherit - Unspecified AutomaticTuningMode = original.Unspecified -) - -type AutomaticTuningOptionModeActual = original.AutomaticTuningOptionModeActual - -const ( - Off AutomaticTuningOptionModeActual = original.Off - On AutomaticTuningOptionModeActual = original.On -) - -type AutomaticTuningOptionModeDesired = original.AutomaticTuningOptionModeDesired - -const ( - AutomaticTuningOptionModeDesiredDefault AutomaticTuningOptionModeDesired = original.AutomaticTuningOptionModeDesiredDefault - AutomaticTuningOptionModeDesiredOff AutomaticTuningOptionModeDesired = original.AutomaticTuningOptionModeDesiredOff - AutomaticTuningOptionModeDesiredOn AutomaticTuningOptionModeDesired = original.AutomaticTuningOptionModeDesiredOn -) - -type AutomaticTuningServerMode = original.AutomaticTuningServerMode - -const ( - AutomaticTuningServerModeAuto AutomaticTuningServerMode = original.AutomaticTuningServerModeAuto - AutomaticTuningServerModeCustom AutomaticTuningServerMode = original.AutomaticTuningServerModeCustom - AutomaticTuningServerModeUnspecified AutomaticTuningServerMode = original.AutomaticTuningServerModeUnspecified -) - -type AutomaticTuningServerReason = original.AutomaticTuningServerReason - -const ( - AutomaticTuningServerReasonAutoConfigured AutomaticTuningServerReason = original.AutomaticTuningServerReasonAutoConfigured - AutomaticTuningServerReasonDefault AutomaticTuningServerReason = original.AutomaticTuningServerReasonDefault - AutomaticTuningServerReasonDisabled AutomaticTuningServerReason = original.AutomaticTuningServerReasonDisabled -) - -type BlobAuditingPolicyState = original.BlobAuditingPolicyState - -const ( - BlobAuditingPolicyStateDisabled BlobAuditingPolicyState = original.BlobAuditingPolicyStateDisabled - BlobAuditingPolicyStateEnabled BlobAuditingPolicyState = original.BlobAuditingPolicyStateEnabled -) - -type CapabilityGroup = original.CapabilityGroup - -const ( - SupportedEditions CapabilityGroup = original.SupportedEditions - SupportedElasticPoolEditions CapabilityGroup = original.SupportedElasticPoolEditions - SupportedManagedInstanceVersions CapabilityGroup = original.SupportedManagedInstanceVersions -) - -type CapabilityStatus = original.CapabilityStatus - -const ( - CapabilityStatusAvailable CapabilityStatus = original.CapabilityStatusAvailable - CapabilityStatusDefault CapabilityStatus = original.CapabilityStatusDefault - CapabilityStatusDisabled CapabilityStatus = original.CapabilityStatusDisabled - CapabilityStatusVisible CapabilityStatus = original.CapabilityStatusVisible -) - type CatalogCollationType = original.CatalogCollationType const ( @@ -119,263 +36,26 @@ const ( SQLLatin1GeneralCP1CIAS CatalogCollationType = original.SQLLatin1GeneralCP1CIAS ) -type CheckNameAvailabilityReason = original.CheckNameAvailabilityReason - -const ( - AlreadyExists CheckNameAvailabilityReason = original.AlreadyExists - Invalid CheckNameAvailabilityReason = original.Invalid -) - -type CreateMode = original.CreateMode - -const ( - CreateModeCopy CreateMode = original.CreateModeCopy - CreateModeDefault CreateMode = original.CreateModeDefault - CreateModeOnlineSecondary CreateMode = original.CreateModeOnlineSecondary - CreateModePointInTimeRestore CreateMode = original.CreateModePointInTimeRestore - CreateModeRecovery CreateMode = original.CreateModeRecovery - CreateModeRestore CreateMode = original.CreateModeRestore - CreateModeRestoreExternalBackup CreateMode = original.CreateModeRestoreExternalBackup - CreateModeRestoreExternalBackupSecondary CreateMode = original.CreateModeRestoreExternalBackupSecondary - CreateModeRestoreLongTermRetentionBackup CreateMode = original.CreateModeRestoreLongTermRetentionBackup - CreateModeSecondary CreateMode = original.CreateModeSecondary -) - -type DataMaskingFunction = original.DataMaskingFunction - -const ( - DataMaskingFunctionCCN DataMaskingFunction = original.DataMaskingFunctionCCN - DataMaskingFunctionDefault DataMaskingFunction = original.DataMaskingFunctionDefault - DataMaskingFunctionEmail DataMaskingFunction = original.DataMaskingFunctionEmail - DataMaskingFunctionNumber DataMaskingFunction = original.DataMaskingFunctionNumber - DataMaskingFunctionSSN DataMaskingFunction = original.DataMaskingFunctionSSN - DataMaskingFunctionText DataMaskingFunction = original.DataMaskingFunctionText -) - -type DataMaskingRuleState = original.DataMaskingRuleState - -const ( - DataMaskingRuleStateDisabled DataMaskingRuleState = original.DataMaskingRuleStateDisabled - DataMaskingRuleStateEnabled DataMaskingRuleState = original.DataMaskingRuleStateEnabled -) - -type DataMaskingState = original.DataMaskingState - -const ( - DataMaskingStateDisabled DataMaskingState = original.DataMaskingStateDisabled - DataMaskingStateEnabled DataMaskingState = original.DataMaskingStateEnabled -) - -type DatabaseEdition = original.DatabaseEdition - -const ( - Basic DatabaseEdition = original.Basic - Business DatabaseEdition = original.Business - BusinessCritical DatabaseEdition = original.BusinessCritical - DataWarehouse DatabaseEdition = original.DataWarehouse - Free DatabaseEdition = original.Free - GeneralPurpose DatabaseEdition = original.GeneralPurpose - Hyperscale DatabaseEdition = original.Hyperscale - Premium DatabaseEdition = original.Premium - PremiumRS DatabaseEdition = original.PremiumRS - Standard DatabaseEdition = original.Standard - Stretch DatabaseEdition = original.Stretch - System DatabaseEdition = original.System - System2 DatabaseEdition = original.System2 - Web DatabaseEdition = original.Web -) - -type DatabaseLicenseType = original.DatabaseLicenseType - -const ( - BasePrice DatabaseLicenseType = original.BasePrice - LicenseIncluded DatabaseLicenseType = original.LicenseIncluded -) - -type DatabaseReadScale = original.DatabaseReadScale - -const ( - DatabaseReadScaleDisabled DatabaseReadScale = original.DatabaseReadScaleDisabled - DatabaseReadScaleEnabled DatabaseReadScale = original.DatabaseReadScaleEnabled -) - -type DatabaseStatus = original.DatabaseStatus - -const ( - DatabaseStatusAutoClosed DatabaseStatus = original.DatabaseStatusAutoClosed - DatabaseStatusCopying DatabaseStatus = original.DatabaseStatusCopying - DatabaseStatusCreating DatabaseStatus = original.DatabaseStatusCreating - DatabaseStatusDisabled DatabaseStatus = original.DatabaseStatusDisabled - DatabaseStatusEmergencyMode DatabaseStatus = original.DatabaseStatusEmergencyMode - DatabaseStatusInaccessible DatabaseStatus = original.DatabaseStatusInaccessible - DatabaseStatusOffline DatabaseStatus = original.DatabaseStatusOffline - DatabaseStatusOfflineChangingDwPerformanceTiers DatabaseStatus = original.DatabaseStatusOfflineChangingDwPerformanceTiers - DatabaseStatusOfflineSecondary DatabaseStatus = original.DatabaseStatusOfflineSecondary - DatabaseStatusOnline DatabaseStatus = original.DatabaseStatusOnline - DatabaseStatusOnlineChangingDwPerformanceTiers DatabaseStatus = original.DatabaseStatusOnlineChangingDwPerformanceTiers - DatabaseStatusPaused DatabaseStatus = original.DatabaseStatusPaused - DatabaseStatusPausing DatabaseStatus = original.DatabaseStatusPausing - DatabaseStatusRecovering DatabaseStatus = original.DatabaseStatusRecovering - DatabaseStatusRecoveryPending DatabaseStatus = original.DatabaseStatusRecoveryPending - DatabaseStatusRestoring DatabaseStatus = original.DatabaseStatusRestoring - DatabaseStatusResuming DatabaseStatus = original.DatabaseStatusResuming - DatabaseStatusScaling DatabaseStatus = original.DatabaseStatusScaling - DatabaseStatusShutdown DatabaseStatus = original.DatabaseStatusShutdown - DatabaseStatusStandby DatabaseStatus = original.DatabaseStatusStandby - DatabaseStatusSuspect DatabaseStatus = original.DatabaseStatusSuspect -) - -type ElasticPoolEdition = original.ElasticPoolEdition - -const ( - ElasticPoolEditionBasic ElasticPoolEdition = original.ElasticPoolEditionBasic - ElasticPoolEditionBusinessCritical ElasticPoolEdition = original.ElasticPoolEditionBusinessCritical - ElasticPoolEditionGeneralPurpose ElasticPoolEdition = original.ElasticPoolEditionGeneralPurpose - ElasticPoolEditionPremium ElasticPoolEdition = original.ElasticPoolEditionPremium - ElasticPoolEditionStandard ElasticPoolEdition = original.ElasticPoolEditionStandard -) - -type ElasticPoolLicenseType = original.ElasticPoolLicenseType - -const ( - ElasticPoolLicenseTypeBasePrice ElasticPoolLicenseType = original.ElasticPoolLicenseTypeBasePrice - ElasticPoolLicenseTypeLicenseIncluded ElasticPoolLicenseType = original.ElasticPoolLicenseTypeLicenseIncluded -) - -type ElasticPoolState = original.ElasticPoolState - -const ( - ElasticPoolStateCreating ElasticPoolState = original.ElasticPoolStateCreating - ElasticPoolStateDisabled ElasticPoolState = original.ElasticPoolStateDisabled - ElasticPoolStateReady ElasticPoolState = original.ElasticPoolStateReady -) - -type FailoverGroupReplicationRole = original.FailoverGroupReplicationRole - -const ( - Primary FailoverGroupReplicationRole = original.Primary - Secondary FailoverGroupReplicationRole = original.Secondary -) - -type GeoBackupPolicyState = original.GeoBackupPolicyState - -const ( - GeoBackupPolicyStateDisabled GeoBackupPolicyState = original.GeoBackupPolicyStateDisabled - GeoBackupPolicyStateEnabled GeoBackupPolicyState = original.GeoBackupPolicyStateEnabled -) - type IdentityType = original.IdentityType const ( SystemAssigned IdentityType = original.SystemAssigned ) -type InstanceFailoverGroupReplicationRole = original.InstanceFailoverGroupReplicationRole - -const ( - InstanceFailoverGroupReplicationRolePrimary InstanceFailoverGroupReplicationRole = original.InstanceFailoverGroupReplicationRolePrimary - InstanceFailoverGroupReplicationRoleSecondary InstanceFailoverGroupReplicationRole = original.InstanceFailoverGroupReplicationRoleSecondary -) - type InstancePoolLicenseType = original.InstancePoolLicenseType const ( - InstancePoolLicenseTypeBasePrice InstancePoolLicenseType = original.InstancePoolLicenseTypeBasePrice - InstancePoolLicenseTypeLicenseIncluded InstancePoolLicenseType = original.InstancePoolLicenseTypeLicenseIncluded -) - -type JobAgentState = original.JobAgentState - -const ( - JobAgentStateCreating JobAgentState = original.JobAgentStateCreating - JobAgentStateDeleting JobAgentState = original.JobAgentStateDeleting - JobAgentStateDisabled JobAgentState = original.JobAgentStateDisabled - JobAgentStateReady JobAgentState = original.JobAgentStateReady - JobAgentStateUpdating JobAgentState = original.JobAgentStateUpdating -) - -type JobExecutionLifecycle = original.JobExecutionLifecycle - -const ( - Canceled JobExecutionLifecycle = original.Canceled - Created JobExecutionLifecycle = original.Created - Failed JobExecutionLifecycle = original.Failed - InProgress JobExecutionLifecycle = original.InProgress - Skipped JobExecutionLifecycle = original.Skipped - Succeeded JobExecutionLifecycle = original.Succeeded - SucceededWithSkipped JobExecutionLifecycle = original.SucceededWithSkipped - TimedOut JobExecutionLifecycle = original.TimedOut - WaitingForChildJobExecutions JobExecutionLifecycle = original.WaitingForChildJobExecutions - WaitingForRetry JobExecutionLifecycle = original.WaitingForRetry -) - -type JobScheduleType = original.JobScheduleType - -const ( - Once JobScheduleType = original.Once - Recurring JobScheduleType = original.Recurring -) - -type JobStepActionSource = original.JobStepActionSource - -const ( - Inline JobStepActionSource = original.Inline -) - -type JobStepActionType = original.JobStepActionType - -const ( - TSQL JobStepActionType = original.TSQL -) - -type JobStepOutputType = original.JobStepOutputType - -const ( - SQLDatabase JobStepOutputType = original.SQLDatabase -) - -type JobTargetGroupMembershipType = original.JobTargetGroupMembershipType - -const ( - Exclude JobTargetGroupMembershipType = original.Exclude - Include JobTargetGroupMembershipType = original.Include -) - -type JobTargetType = original.JobTargetType - -const ( - JobTargetTypeSQLDatabase JobTargetType = original.JobTargetTypeSQLDatabase - JobTargetTypeSQLElasticPool JobTargetType = original.JobTargetTypeSQLElasticPool - JobTargetTypeSQLServer JobTargetType = original.JobTargetTypeSQLServer - JobTargetTypeSQLShardMap JobTargetType = original.JobTargetTypeSQLShardMap - JobTargetTypeTargetGroup JobTargetType = original.JobTargetTypeTargetGroup -) - -type LogSizeUnit = original.LogSizeUnit - -const ( - Gigabytes LogSizeUnit = original.Gigabytes - Megabytes LogSizeUnit = original.Megabytes - Percent LogSizeUnit = original.Percent - Petabytes LogSizeUnit = original.Petabytes - Terabytes LogSizeUnit = original.Terabytes -) - -type LongTermRetentionDatabaseState = original.LongTermRetentionDatabaseState - -const ( - All LongTermRetentionDatabaseState = original.All - Deleted LongTermRetentionDatabaseState = original.Deleted - Live LongTermRetentionDatabaseState = original.Live + BasePrice InstancePoolLicenseType = original.BasePrice + LicenseIncluded InstancePoolLicenseType = original.LicenseIncluded ) type ManagedDatabaseCreateMode = original.ManagedDatabaseCreateMode const ( - ManagedDatabaseCreateModeDefault ManagedDatabaseCreateMode = original.ManagedDatabaseCreateModeDefault - ManagedDatabaseCreateModePointInTimeRestore ManagedDatabaseCreateMode = original.ManagedDatabaseCreateModePointInTimeRestore - ManagedDatabaseCreateModeRecovery ManagedDatabaseCreateMode = original.ManagedDatabaseCreateModeRecovery - ManagedDatabaseCreateModeRestoreExternalBackup ManagedDatabaseCreateMode = original.ManagedDatabaseCreateModeRestoreExternalBackup + Default ManagedDatabaseCreateMode = original.Default + PointInTimeRestore ManagedDatabaseCreateMode = original.PointInTimeRestore + Recovery ManagedDatabaseCreateMode = original.Recovery + RestoreExternalBackup ManagedDatabaseCreateMode = original.RestoreExternalBackup ) type ManagedDatabaseStatus = original.ManagedDatabaseStatus @@ -412,149 +92,6 @@ const ( ManagedServerCreateModePointInTimeRestore ManagedServerCreateMode = original.ManagedServerCreateModePointInTimeRestore ) -type ManagementOperationState = original.ManagementOperationState - -const ( - ManagementOperationStateCancelInProgress ManagementOperationState = original.ManagementOperationStateCancelInProgress - ManagementOperationStateCancelled ManagementOperationState = original.ManagementOperationStateCancelled - ManagementOperationStateFailed ManagementOperationState = original.ManagementOperationStateFailed - ManagementOperationStateInProgress ManagementOperationState = original.ManagementOperationStateInProgress - ManagementOperationStatePending ManagementOperationState = original.ManagementOperationStatePending - ManagementOperationStateSucceeded ManagementOperationState = original.ManagementOperationStateSucceeded -) - -type MaxSizeUnit = original.MaxSizeUnit - -const ( - MaxSizeUnitGigabytes MaxSizeUnit = original.MaxSizeUnitGigabytes - MaxSizeUnitMegabytes MaxSizeUnit = original.MaxSizeUnitMegabytes - MaxSizeUnitPetabytes MaxSizeUnit = original.MaxSizeUnitPetabytes - MaxSizeUnitTerabytes MaxSizeUnit = original.MaxSizeUnitTerabytes -) - -type OperationOrigin = original.OperationOrigin - -const ( - OperationOriginSystem OperationOrigin = original.OperationOriginSystem - OperationOriginUser OperationOrigin = original.OperationOriginUser -) - -type PerformanceLevelUnit = original.PerformanceLevelUnit - -const ( - DTU PerformanceLevelUnit = original.DTU - VCores PerformanceLevelUnit = original.VCores -) - -type PrimaryAggregationType = original.PrimaryAggregationType - -const ( - Average PrimaryAggregationType = original.Average - Count PrimaryAggregationType = original.Count - Maximum PrimaryAggregationType = original.Maximum - Minimum PrimaryAggregationType = original.Minimum - None PrimaryAggregationType = original.None - Total PrimaryAggregationType = original.Total -) - -type ProvisioningState = original.ProvisioningState - -const ( - ProvisioningStateCanceled ProvisioningState = original.ProvisioningStateCanceled - ProvisioningStateCreated ProvisioningState = original.ProvisioningStateCreated - ProvisioningStateFailed ProvisioningState = original.ProvisioningStateFailed - ProvisioningStateInProgress ProvisioningState = original.ProvisioningStateInProgress - ProvisioningStateSucceeded ProvisioningState = original.ProvisioningStateSucceeded -) - -type ReadOnlyEndpointFailoverPolicy = original.ReadOnlyEndpointFailoverPolicy - -const ( - ReadOnlyEndpointFailoverPolicyDisabled ReadOnlyEndpointFailoverPolicy = original.ReadOnlyEndpointFailoverPolicyDisabled - ReadOnlyEndpointFailoverPolicyEnabled ReadOnlyEndpointFailoverPolicy = original.ReadOnlyEndpointFailoverPolicyEnabled -) - -type ReadWriteEndpointFailoverPolicy = original.ReadWriteEndpointFailoverPolicy - -const ( - Automatic ReadWriteEndpointFailoverPolicy = original.Automatic - Manual ReadWriteEndpointFailoverPolicy = original.Manual -) - -type RecommendedIndexAction = original.RecommendedIndexAction - -const ( - Create RecommendedIndexAction = original.Create - Drop RecommendedIndexAction = original.Drop - Rebuild RecommendedIndexAction = original.Rebuild -) - -type RecommendedIndexState = original.RecommendedIndexState - -const ( - Active RecommendedIndexState = original.Active - Blocked RecommendedIndexState = original.Blocked - Executing RecommendedIndexState = original.Executing - Expired RecommendedIndexState = original.Expired - Ignored RecommendedIndexState = original.Ignored - Pending RecommendedIndexState = original.Pending - PendingRevert RecommendedIndexState = original.PendingRevert - Reverted RecommendedIndexState = original.Reverted - Reverting RecommendedIndexState = original.Reverting - Success RecommendedIndexState = original.Success - Verifying RecommendedIndexState = original.Verifying -) - -type RecommendedIndexType = original.RecommendedIndexType - -const ( - CLUSTERED RecommendedIndexType = original.CLUSTERED - CLUSTEREDCOLUMNSTORE RecommendedIndexType = original.CLUSTEREDCOLUMNSTORE - COLUMNSTORE RecommendedIndexType = original.COLUMNSTORE - NONCLUSTERED RecommendedIndexType = original.NONCLUSTERED -) - -type ReplicationRole = original.ReplicationRole - -const ( - ReplicationRoleCopy ReplicationRole = original.ReplicationRoleCopy - ReplicationRoleNonReadableSecondary ReplicationRole = original.ReplicationRoleNonReadableSecondary - ReplicationRolePrimary ReplicationRole = original.ReplicationRolePrimary - ReplicationRoleSecondary ReplicationRole = original.ReplicationRoleSecondary - ReplicationRoleSource ReplicationRole = original.ReplicationRoleSource -) - -type ReplicationState = original.ReplicationState - -const ( - CATCHUP ReplicationState = original.CATCHUP - PENDING ReplicationState = original.PENDING - SEEDING ReplicationState = original.SEEDING - SUSPENDED ReplicationState = original.SUSPENDED -) - -type RestorePointType = original.RestorePointType - -const ( - CONTINUOUS RestorePointType = original.CONTINUOUS - DISCRETE RestorePointType = original.DISCRETE -) - -type SampleName = original.SampleName - -const ( - AdventureWorksLT SampleName = original.AdventureWorksLT - WideWorldImportersFull SampleName = original.WideWorldImportersFull - WideWorldImportersStd SampleName = original.WideWorldImportersStd -) - -type SecurityAlertPolicyEmailAccountAdmins = original.SecurityAlertPolicyEmailAccountAdmins - -const ( - SecurityAlertPolicyEmailAccountAdminsDisabled SecurityAlertPolicyEmailAccountAdmins = original.SecurityAlertPolicyEmailAccountAdminsDisabled - SecurityAlertPolicyEmailAccountAdminsEnabled SecurityAlertPolicyEmailAccountAdmins = original.SecurityAlertPolicyEmailAccountAdminsEnabled -) - type SecurityAlertPolicyState = original.SecurityAlertPolicyState const ( @@ -563,13 +100,6 @@ const ( SecurityAlertPolicyStateNew SecurityAlertPolicyState = original.SecurityAlertPolicyStateNew ) -type SecurityAlertPolicyUseServerDefault = original.SecurityAlertPolicyUseServerDefault - -const ( - SecurityAlertPolicyUseServerDefaultDisabled SecurityAlertPolicyUseServerDefault = original.SecurityAlertPolicyUseServerDefaultDisabled - SecurityAlertPolicyUseServerDefaultEnabled SecurityAlertPolicyUseServerDefault = original.SecurityAlertPolicyUseServerDefaultEnabled -) - type SensitivityLabelSource = original.SensitivityLabelSource const ( @@ -577,406 +107,17 @@ const ( Recommended SensitivityLabelSource = original.Recommended ) -type ServerConnectionType = original.ServerConnectionType - -const ( - ServerConnectionTypeDefault ServerConnectionType = original.ServerConnectionTypeDefault - ServerConnectionTypeProxy ServerConnectionType = original.ServerConnectionTypeProxy - ServerConnectionTypeRedirect ServerConnectionType = original.ServerConnectionTypeRedirect -) - -type ServerKeyType = original.ServerKeyType - -const ( - AzureKeyVault ServerKeyType = original.AzureKeyVault - ServiceManaged ServerKeyType = original.ServiceManaged -) - -type ServiceObjectiveName = original.ServiceObjectiveName - -const ( - ServiceObjectiveNameBasic ServiceObjectiveName = original.ServiceObjectiveNameBasic - ServiceObjectiveNameDS100 ServiceObjectiveName = original.ServiceObjectiveNameDS100 - ServiceObjectiveNameDS1000 ServiceObjectiveName = original.ServiceObjectiveNameDS1000 - ServiceObjectiveNameDS1200 ServiceObjectiveName = original.ServiceObjectiveNameDS1200 - ServiceObjectiveNameDS1500 ServiceObjectiveName = original.ServiceObjectiveNameDS1500 - ServiceObjectiveNameDS200 ServiceObjectiveName = original.ServiceObjectiveNameDS200 - ServiceObjectiveNameDS2000 ServiceObjectiveName = original.ServiceObjectiveNameDS2000 - ServiceObjectiveNameDS300 ServiceObjectiveName = original.ServiceObjectiveNameDS300 - ServiceObjectiveNameDS400 ServiceObjectiveName = original.ServiceObjectiveNameDS400 - ServiceObjectiveNameDS500 ServiceObjectiveName = original.ServiceObjectiveNameDS500 - ServiceObjectiveNameDS600 ServiceObjectiveName = original.ServiceObjectiveNameDS600 - ServiceObjectiveNameDW100 ServiceObjectiveName = original.ServiceObjectiveNameDW100 - ServiceObjectiveNameDW1000 ServiceObjectiveName = original.ServiceObjectiveNameDW1000 - ServiceObjectiveNameDW10000c ServiceObjectiveName = original.ServiceObjectiveNameDW10000c - ServiceObjectiveNameDW1000c ServiceObjectiveName = original.ServiceObjectiveNameDW1000c - ServiceObjectiveNameDW1200 ServiceObjectiveName = original.ServiceObjectiveNameDW1200 - ServiceObjectiveNameDW1500 ServiceObjectiveName = original.ServiceObjectiveNameDW1500 - ServiceObjectiveNameDW15000c ServiceObjectiveName = original.ServiceObjectiveNameDW15000c - ServiceObjectiveNameDW1500c ServiceObjectiveName = original.ServiceObjectiveNameDW1500c - ServiceObjectiveNameDW200 ServiceObjectiveName = original.ServiceObjectiveNameDW200 - ServiceObjectiveNameDW2000 ServiceObjectiveName = original.ServiceObjectiveNameDW2000 - ServiceObjectiveNameDW2000c ServiceObjectiveName = original.ServiceObjectiveNameDW2000c - ServiceObjectiveNameDW2500c ServiceObjectiveName = original.ServiceObjectiveNameDW2500c - ServiceObjectiveNameDW300 ServiceObjectiveName = original.ServiceObjectiveNameDW300 - ServiceObjectiveNameDW3000 ServiceObjectiveName = original.ServiceObjectiveNameDW3000 - ServiceObjectiveNameDW30000c ServiceObjectiveName = original.ServiceObjectiveNameDW30000c - ServiceObjectiveNameDW3000c ServiceObjectiveName = original.ServiceObjectiveNameDW3000c - ServiceObjectiveNameDW400 ServiceObjectiveName = original.ServiceObjectiveNameDW400 - ServiceObjectiveNameDW500 ServiceObjectiveName = original.ServiceObjectiveNameDW500 - ServiceObjectiveNameDW5000c ServiceObjectiveName = original.ServiceObjectiveNameDW5000c - ServiceObjectiveNameDW600 ServiceObjectiveName = original.ServiceObjectiveNameDW600 - ServiceObjectiveNameDW6000 ServiceObjectiveName = original.ServiceObjectiveNameDW6000 - ServiceObjectiveNameDW6000c ServiceObjectiveName = original.ServiceObjectiveNameDW6000c - ServiceObjectiveNameDW7500c ServiceObjectiveName = original.ServiceObjectiveNameDW7500c - ServiceObjectiveNameElasticPool ServiceObjectiveName = original.ServiceObjectiveNameElasticPool - ServiceObjectiveNameFree ServiceObjectiveName = original.ServiceObjectiveNameFree - ServiceObjectiveNameP1 ServiceObjectiveName = original.ServiceObjectiveNameP1 - ServiceObjectiveNameP11 ServiceObjectiveName = original.ServiceObjectiveNameP11 - ServiceObjectiveNameP15 ServiceObjectiveName = original.ServiceObjectiveNameP15 - ServiceObjectiveNameP2 ServiceObjectiveName = original.ServiceObjectiveNameP2 - ServiceObjectiveNameP3 ServiceObjectiveName = original.ServiceObjectiveNameP3 - ServiceObjectiveNameP4 ServiceObjectiveName = original.ServiceObjectiveNameP4 - ServiceObjectiveNameP6 ServiceObjectiveName = original.ServiceObjectiveNameP6 - ServiceObjectiveNamePRS1 ServiceObjectiveName = original.ServiceObjectiveNamePRS1 - ServiceObjectiveNamePRS2 ServiceObjectiveName = original.ServiceObjectiveNamePRS2 - ServiceObjectiveNamePRS4 ServiceObjectiveName = original.ServiceObjectiveNamePRS4 - ServiceObjectiveNamePRS6 ServiceObjectiveName = original.ServiceObjectiveNamePRS6 - ServiceObjectiveNameS0 ServiceObjectiveName = original.ServiceObjectiveNameS0 - ServiceObjectiveNameS1 ServiceObjectiveName = original.ServiceObjectiveNameS1 - ServiceObjectiveNameS12 ServiceObjectiveName = original.ServiceObjectiveNameS12 - ServiceObjectiveNameS2 ServiceObjectiveName = original.ServiceObjectiveNameS2 - ServiceObjectiveNameS3 ServiceObjectiveName = original.ServiceObjectiveNameS3 - ServiceObjectiveNameS4 ServiceObjectiveName = original.ServiceObjectiveNameS4 - ServiceObjectiveNameS6 ServiceObjectiveName = original.ServiceObjectiveNameS6 - ServiceObjectiveNameS7 ServiceObjectiveName = original.ServiceObjectiveNameS7 - ServiceObjectiveNameS9 ServiceObjectiveName = original.ServiceObjectiveNameS9 - ServiceObjectiveNameSystem ServiceObjectiveName = original.ServiceObjectiveNameSystem - ServiceObjectiveNameSystem0 ServiceObjectiveName = original.ServiceObjectiveNameSystem0 - ServiceObjectiveNameSystem1 ServiceObjectiveName = original.ServiceObjectiveNameSystem1 - ServiceObjectiveNameSystem2 ServiceObjectiveName = original.ServiceObjectiveNameSystem2 - ServiceObjectiveNameSystem2L ServiceObjectiveName = original.ServiceObjectiveNameSystem2L - ServiceObjectiveNameSystem3 ServiceObjectiveName = original.ServiceObjectiveNameSystem3 - ServiceObjectiveNameSystem3L ServiceObjectiveName = original.ServiceObjectiveNameSystem3L - ServiceObjectiveNameSystem4 ServiceObjectiveName = original.ServiceObjectiveNameSystem4 - ServiceObjectiveNameSystem4L ServiceObjectiveName = original.ServiceObjectiveNameSystem4L -) - -type StorageKeyType = original.StorageKeyType - -const ( - SharedAccessKey StorageKeyType = original.SharedAccessKey - StorageAccessKey StorageKeyType = original.StorageAccessKey -) - -type SyncAgentState = original.SyncAgentState - -const ( - SyncAgentStateNeverConnected SyncAgentState = original.SyncAgentStateNeverConnected - SyncAgentStateOffline SyncAgentState = original.SyncAgentStateOffline - SyncAgentStateOnline SyncAgentState = original.SyncAgentStateOnline -) - -type SyncConflictResolutionPolicy = original.SyncConflictResolutionPolicy - -const ( - HubWin SyncConflictResolutionPolicy = original.HubWin - MemberWin SyncConflictResolutionPolicy = original.MemberWin -) - -type SyncDirection = original.SyncDirection - -const ( - Bidirectional SyncDirection = original.Bidirectional - OneWayHubToMember SyncDirection = original.OneWayHubToMember - OneWayMemberToHub SyncDirection = original.OneWayMemberToHub -) - -type SyncGroupLogType = original.SyncGroupLogType - -const ( - SyncGroupLogTypeAll SyncGroupLogType = original.SyncGroupLogTypeAll - SyncGroupLogTypeError SyncGroupLogType = original.SyncGroupLogTypeError - SyncGroupLogTypeSuccess SyncGroupLogType = original.SyncGroupLogTypeSuccess - SyncGroupLogTypeWarning SyncGroupLogType = original.SyncGroupLogTypeWarning -) - -type SyncGroupState = original.SyncGroupState - -const ( - Error SyncGroupState = original.Error - Good SyncGroupState = original.Good - NotReady SyncGroupState = original.NotReady - Progressing SyncGroupState = original.Progressing - Warning SyncGroupState = original.Warning -) - -type SyncMemberDbType = original.SyncMemberDbType - -const ( - AzureSQLDatabase SyncMemberDbType = original.AzureSQLDatabase - SQLServerDatabase SyncMemberDbType = original.SQLServerDatabase -) - -type SyncMemberState = original.SyncMemberState - -const ( - DeProvisioned SyncMemberState = original.DeProvisioned - DeProvisionFailed SyncMemberState = original.DeProvisionFailed - DeProvisioning SyncMemberState = original.DeProvisioning - DisabledBackupRestore SyncMemberState = original.DisabledBackupRestore - DisabledTombstoneCleanup SyncMemberState = original.DisabledTombstoneCleanup - Provisioned SyncMemberState = original.Provisioned - ProvisionFailed SyncMemberState = original.ProvisionFailed - Provisioning SyncMemberState = original.Provisioning - ReprovisionFailed SyncMemberState = original.ReprovisionFailed - Reprovisioning SyncMemberState = original.Reprovisioning - SyncCancelled SyncMemberState = original.SyncCancelled - SyncCancelling SyncMemberState = original.SyncCancelling - SyncFailed SyncMemberState = original.SyncFailed - SyncInProgress SyncMemberState = original.SyncInProgress - SyncSucceeded SyncMemberState = original.SyncSucceeded - SyncSucceededWithWarnings SyncMemberState = original.SyncSucceededWithWarnings - UnProvisioned SyncMemberState = original.UnProvisioned - UnReprovisioned SyncMemberState = original.UnReprovisioned -) - -type TransparentDataEncryptionActivityStatus = original.TransparentDataEncryptionActivityStatus - -const ( - Decrypting TransparentDataEncryptionActivityStatus = original.Decrypting - Encrypting TransparentDataEncryptionActivityStatus = original.Encrypting -) - -type TransparentDataEncryptionStatus = original.TransparentDataEncryptionStatus - -const ( - TransparentDataEncryptionStatusDisabled TransparentDataEncryptionStatus = original.TransparentDataEncryptionStatusDisabled - TransparentDataEncryptionStatusEnabled TransparentDataEncryptionStatus = original.TransparentDataEncryptionStatusEnabled -) - -type UnitDefinitionType = original.UnitDefinitionType - -const ( - UnitDefinitionTypeBytes UnitDefinitionType = original.UnitDefinitionTypeBytes - UnitDefinitionTypeBytesPerSecond UnitDefinitionType = original.UnitDefinitionTypeBytesPerSecond - UnitDefinitionTypeCount UnitDefinitionType = original.UnitDefinitionTypeCount - UnitDefinitionTypeCountPerSecond UnitDefinitionType = original.UnitDefinitionTypeCountPerSecond - UnitDefinitionTypePercent UnitDefinitionType = original.UnitDefinitionTypePercent - UnitDefinitionTypeSeconds UnitDefinitionType = original.UnitDefinitionTypeSeconds -) - -type UnitType = original.UnitType - -const ( - UnitTypeBytes UnitType = original.UnitTypeBytes - UnitTypeBytesPerSecond UnitType = original.UnitTypeBytesPerSecond - UnitTypeCount UnitType = original.UnitTypeCount - UnitTypeCountPerSecond UnitType = original.UnitTypeCountPerSecond - UnitTypePercent UnitType = original.UnitTypePercent - UnitTypeSeconds UnitType = original.UnitTypeSeconds -) - -type VirtualNetworkRuleState = original.VirtualNetworkRuleState - -const ( - VirtualNetworkRuleStateDeleting VirtualNetworkRuleState = original.VirtualNetworkRuleStateDeleting - VirtualNetworkRuleStateInitializing VirtualNetworkRuleState = original.VirtualNetworkRuleStateInitializing - VirtualNetworkRuleStateInProgress VirtualNetworkRuleState = original.VirtualNetworkRuleStateInProgress - VirtualNetworkRuleStateReady VirtualNetworkRuleState = original.VirtualNetworkRuleStateReady - VirtualNetworkRuleStateUnknown VirtualNetworkRuleState = original.VirtualNetworkRuleStateUnknown -) - -type VulnerabilityAssessmentPolicyBaselineName = original.VulnerabilityAssessmentPolicyBaselineName - -const ( - VulnerabilityAssessmentPolicyBaselineNameDefault VulnerabilityAssessmentPolicyBaselineName = original.VulnerabilityAssessmentPolicyBaselineNameDefault - VulnerabilityAssessmentPolicyBaselineNameMaster VulnerabilityAssessmentPolicyBaselineName = original.VulnerabilityAssessmentPolicyBaselineNameMaster -) - -type VulnerabilityAssessmentScanState = original.VulnerabilityAssessmentScanState - -const ( - VulnerabilityAssessmentScanStateFailed VulnerabilityAssessmentScanState = original.VulnerabilityAssessmentScanStateFailed - VulnerabilityAssessmentScanStateFailedToRun VulnerabilityAssessmentScanState = original.VulnerabilityAssessmentScanStateFailedToRun - VulnerabilityAssessmentScanStateInProgress VulnerabilityAssessmentScanState = original.VulnerabilityAssessmentScanStateInProgress - VulnerabilityAssessmentScanStatePassed VulnerabilityAssessmentScanState = original.VulnerabilityAssessmentScanStatePassed -) - -type VulnerabilityAssessmentScanTriggerType = original.VulnerabilityAssessmentScanTriggerType - -const ( - VulnerabilityAssessmentScanTriggerTypeOnDemand VulnerabilityAssessmentScanTriggerType = original.VulnerabilityAssessmentScanTriggerTypeOnDemand - VulnerabilityAssessmentScanTriggerTypeRecurring VulnerabilityAssessmentScanTriggerType = original.VulnerabilityAssessmentScanTriggerTypeRecurring -) - -type AutomaticTuningOptions = original.AutomaticTuningOptions -type AutomaticTuningServerOptions = original.AutomaticTuningServerOptions -type AutomaticTuningServerProperties = original.AutomaticTuningServerProperties -type BackupLongTermRetentionPoliciesClient = original.BackupLongTermRetentionPoliciesClient -type BackupLongTermRetentionPoliciesCreateOrUpdateFuture = original.BackupLongTermRetentionPoliciesCreateOrUpdateFuture -type BackupLongTermRetentionPolicy = original.BackupLongTermRetentionPolicy -type BackupShortTermRetentionPoliciesClient = original.BackupShortTermRetentionPoliciesClient -type BackupShortTermRetentionPoliciesCreateOrUpdateFuture = original.BackupShortTermRetentionPoliciesCreateOrUpdateFuture -type BackupShortTermRetentionPoliciesUpdateFuture = original.BackupShortTermRetentionPoliciesUpdateFuture -type BackupShortTermRetentionPolicy = original.BackupShortTermRetentionPolicy -type BackupShortTermRetentionPolicyListResult = original.BackupShortTermRetentionPolicyListResult -type BackupShortTermRetentionPolicyListResultIterator = original.BackupShortTermRetentionPolicyListResultIterator -type BackupShortTermRetentionPolicyListResultPage = original.BackupShortTermRetentionPolicyListResultPage -type BackupShortTermRetentionPolicyProperties = original.BackupShortTermRetentionPolicyProperties type BaseClient = original.BaseClient -type CapabilitiesClient = original.CapabilitiesClient -type CheckNameAvailabilityRequest = original.CheckNameAvailabilityRequest -type CheckNameAvailabilityResponse = original.CheckNameAvailabilityResponse type CompleteDatabaseRestoreDefinition = original.CompleteDatabaseRestoreDefinition -type CreateDatabaseRestorePointDefinition = original.CreateDatabaseRestorePointDefinition -type DataMaskingPoliciesClient = original.DataMaskingPoliciesClient -type DataMaskingPolicy = original.DataMaskingPolicy -type DataMaskingPolicyProperties = original.DataMaskingPolicyProperties -type DataMaskingRule = original.DataMaskingRule -type DataMaskingRuleListResult = original.DataMaskingRuleListResult -type DataMaskingRuleProperties = original.DataMaskingRuleProperties -type DataMaskingRulesClient = original.DataMaskingRulesClient -type Database = original.Database -type DatabaseAutomaticTuning = original.DatabaseAutomaticTuning -type DatabaseAutomaticTuningClient = original.DatabaseAutomaticTuningClient -type DatabaseAutomaticTuningProperties = original.DatabaseAutomaticTuningProperties -type DatabaseBlobAuditingPoliciesClient = original.DatabaseBlobAuditingPoliciesClient -type DatabaseBlobAuditingPolicy = original.DatabaseBlobAuditingPolicy -type DatabaseBlobAuditingPolicyListResult = original.DatabaseBlobAuditingPolicyListResult -type DatabaseBlobAuditingPolicyListResultIterator = original.DatabaseBlobAuditingPolicyListResultIterator -type DatabaseBlobAuditingPolicyListResultPage = original.DatabaseBlobAuditingPolicyListResultPage -type DatabaseBlobAuditingPolicyProperties = original.DatabaseBlobAuditingPolicyProperties -type DatabaseListResult = original.DatabaseListResult -type DatabaseListResultIterator = original.DatabaseListResultIterator -type DatabaseListResultPage = original.DatabaseListResultPage -type DatabaseOperation = original.DatabaseOperation -type DatabaseOperationListResult = original.DatabaseOperationListResult -type DatabaseOperationListResultIterator = original.DatabaseOperationListResultIterator -type DatabaseOperationListResultPage = original.DatabaseOperationListResultPage -type DatabaseOperationProperties = original.DatabaseOperationProperties -type DatabaseOperationsClient = original.DatabaseOperationsClient -type DatabaseProperties = original.DatabaseProperties +type DatabaseSecurityAlertListResult = original.DatabaseSecurityAlertListResult +type DatabaseSecurityAlertListResultIterator = original.DatabaseSecurityAlertListResultIterator +type DatabaseSecurityAlertListResultPage = original.DatabaseSecurityAlertListResultPage +type DatabaseSecurityAlertPoliciesClient = original.DatabaseSecurityAlertPoliciesClient type DatabaseSecurityAlertPolicy = original.DatabaseSecurityAlertPolicy -type DatabaseSecurityAlertPolicyProperties = original.DatabaseSecurityAlertPolicyProperties -type DatabaseThreatDetectionPoliciesClient = original.DatabaseThreatDetectionPoliciesClient -type DatabaseUpdate = original.DatabaseUpdate -type DatabaseUsage = original.DatabaseUsage -type DatabaseUsageListResult = original.DatabaseUsageListResult -type DatabaseUsagesClient = original.DatabaseUsagesClient -type DatabaseVulnerabilityAssessment = original.DatabaseVulnerabilityAssessment -type DatabaseVulnerabilityAssessmentListResult = original.DatabaseVulnerabilityAssessmentListResult -type DatabaseVulnerabilityAssessmentListResultIterator = original.DatabaseVulnerabilityAssessmentListResultIterator -type DatabaseVulnerabilityAssessmentListResultPage = original.DatabaseVulnerabilityAssessmentListResultPage -type DatabaseVulnerabilityAssessmentProperties = original.DatabaseVulnerabilityAssessmentProperties -type DatabaseVulnerabilityAssessmentRuleBaseline = original.DatabaseVulnerabilityAssessmentRuleBaseline -type DatabaseVulnerabilityAssessmentRuleBaselineItem = original.DatabaseVulnerabilityAssessmentRuleBaselineItem -type DatabaseVulnerabilityAssessmentRuleBaselineProperties = original.DatabaseVulnerabilityAssessmentRuleBaselineProperties -type DatabaseVulnerabilityAssessmentRuleBaselinesClient = original.DatabaseVulnerabilityAssessmentRuleBaselinesClient -type DatabaseVulnerabilityAssessmentScanExportProperties = original.DatabaseVulnerabilityAssessmentScanExportProperties -type DatabaseVulnerabilityAssessmentScansClient = original.DatabaseVulnerabilityAssessmentScansClient -type DatabaseVulnerabilityAssessmentScansExport = original.DatabaseVulnerabilityAssessmentScansExport -type DatabaseVulnerabilityAssessmentScansInitiateScanFuture = original.DatabaseVulnerabilityAssessmentScansInitiateScanFuture -type DatabaseVulnerabilityAssessmentsClient = original.DatabaseVulnerabilityAssessmentsClient type DatabasesClient = original.DatabasesClient -type DatabasesCreateImportOperationFuture = original.DatabasesCreateImportOperationFuture -type DatabasesCreateOrUpdateFuture = original.DatabasesCreateOrUpdateFuture -type DatabasesDeleteFuture = original.DatabasesDeleteFuture -type DatabasesExportFuture = original.DatabasesExportFuture type DatabasesFailoverFuture = original.DatabasesFailoverFuture -type DatabasesImportFuture = original.DatabasesImportFuture -type DatabasesPauseFuture = original.DatabasesPauseFuture -type DatabasesResumeFuture = original.DatabasesResumeFuture -type DatabasesUpdateFuture = original.DatabasesUpdateFuture -type DatabasesUpgradeDataWarehouseFuture = original.DatabasesUpgradeDataWarehouseFuture -type EditionCapability = original.EditionCapability -type ElasticPool = original.ElasticPool -type ElasticPoolActivitiesClient = original.ElasticPoolActivitiesClient -type ElasticPoolActivity = original.ElasticPoolActivity -type ElasticPoolActivityListResult = original.ElasticPoolActivityListResult -type ElasticPoolActivityProperties = original.ElasticPoolActivityProperties -type ElasticPoolDatabaseActivitiesClient = original.ElasticPoolDatabaseActivitiesClient -type ElasticPoolDatabaseActivity = original.ElasticPoolDatabaseActivity -type ElasticPoolDatabaseActivityListResult = original.ElasticPoolDatabaseActivityListResult -type ElasticPoolDatabaseActivityProperties = original.ElasticPoolDatabaseActivityProperties -type ElasticPoolEditionCapability = original.ElasticPoolEditionCapability -type ElasticPoolListResult = original.ElasticPoolListResult -type ElasticPoolListResultIterator = original.ElasticPoolListResultIterator -type ElasticPoolListResultPage = original.ElasticPoolListResultPage -type ElasticPoolOperation = original.ElasticPoolOperation -type ElasticPoolOperationListResult = original.ElasticPoolOperationListResult -type ElasticPoolOperationListResultIterator = original.ElasticPoolOperationListResultIterator -type ElasticPoolOperationListResultPage = original.ElasticPoolOperationListResultPage -type ElasticPoolOperationProperties = original.ElasticPoolOperationProperties -type ElasticPoolOperationsClient = original.ElasticPoolOperationsClient -type ElasticPoolPerDatabaseMaxPerformanceLevelCapability = original.ElasticPoolPerDatabaseMaxPerformanceLevelCapability -type ElasticPoolPerDatabaseMinPerformanceLevelCapability = original.ElasticPoolPerDatabaseMinPerformanceLevelCapability -type ElasticPoolPerDatabaseSettings = original.ElasticPoolPerDatabaseSettings -type ElasticPoolPerformanceLevelCapability = original.ElasticPoolPerformanceLevelCapability -type ElasticPoolProperties = original.ElasticPoolProperties -type ElasticPoolUpdate = original.ElasticPoolUpdate -type ElasticPoolUpdateProperties = original.ElasticPoolUpdateProperties type ElasticPoolsClient = original.ElasticPoolsClient -type ElasticPoolsCreateOrUpdateFuture = original.ElasticPoolsCreateOrUpdateFuture -type ElasticPoolsDeleteFuture = original.ElasticPoolsDeleteFuture type ElasticPoolsFailoverFuture = original.ElasticPoolsFailoverFuture -type ElasticPoolsUpdateFuture = original.ElasticPoolsUpdateFuture -type EncryptionProtector = original.EncryptionProtector -type EncryptionProtectorListResult = original.EncryptionProtectorListResult -type EncryptionProtectorListResultIterator = original.EncryptionProtectorListResultIterator -type EncryptionProtectorListResultPage = original.EncryptionProtectorListResultPage -type EncryptionProtectorProperties = original.EncryptionProtectorProperties -type EncryptionProtectorsClient = original.EncryptionProtectorsClient -type EncryptionProtectorsCreateOrUpdateFuture = original.EncryptionProtectorsCreateOrUpdateFuture -type EncryptionProtectorsRevalidateFuture = original.EncryptionProtectorsRevalidateFuture -type ExportRequest = original.ExportRequest -type ExtendedDatabaseBlobAuditingPoliciesClient = original.ExtendedDatabaseBlobAuditingPoliciesClient -type ExtendedDatabaseBlobAuditingPolicy = original.ExtendedDatabaseBlobAuditingPolicy -type ExtendedDatabaseBlobAuditingPolicyProperties = original.ExtendedDatabaseBlobAuditingPolicyProperties -type ExtendedServerBlobAuditingPoliciesClient = original.ExtendedServerBlobAuditingPoliciesClient -type ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture = original.ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture -type ExtendedServerBlobAuditingPolicy = original.ExtendedServerBlobAuditingPolicy -type ExtendedServerBlobAuditingPolicyProperties = original.ExtendedServerBlobAuditingPolicyProperties -type FailoverGroup = original.FailoverGroup -type FailoverGroupListResult = original.FailoverGroupListResult -type FailoverGroupListResultIterator = original.FailoverGroupListResultIterator -type FailoverGroupListResultPage = original.FailoverGroupListResultPage -type FailoverGroupProperties = original.FailoverGroupProperties -type FailoverGroupReadOnlyEndpoint = original.FailoverGroupReadOnlyEndpoint -type FailoverGroupReadWriteEndpoint = original.FailoverGroupReadWriteEndpoint -type FailoverGroupUpdate = original.FailoverGroupUpdate -type FailoverGroupUpdateProperties = original.FailoverGroupUpdateProperties -type FailoverGroupsClient = original.FailoverGroupsClient -type FailoverGroupsCreateOrUpdateFuture = original.FailoverGroupsCreateOrUpdateFuture -type FailoverGroupsDeleteFuture = original.FailoverGroupsDeleteFuture -type FailoverGroupsFailoverFuture = original.FailoverGroupsFailoverFuture -type FailoverGroupsForceFailoverAllowDataLossFuture = original.FailoverGroupsForceFailoverAllowDataLossFuture -type FailoverGroupsUpdateFuture = original.FailoverGroupsUpdateFuture -type FirewallRule = original.FirewallRule -type FirewallRuleListResult = original.FirewallRuleListResult -type FirewallRuleProperties = original.FirewallRuleProperties -type FirewallRulesClient = original.FirewallRulesClient -type GeoBackupPoliciesClient = original.GeoBackupPoliciesClient -type GeoBackupPolicy = original.GeoBackupPolicy -type GeoBackupPolicyListResult = original.GeoBackupPolicyListResult -type GeoBackupPolicyProperties = original.GeoBackupPolicyProperties -type ImportExportResponse = original.ImportExportResponse -type ImportExportResponseProperties = original.ImportExportResponseProperties -type ImportExtensionProperties = original.ImportExtensionProperties -type ImportExtensionRequest = original.ImportExtensionRequest -type ImportRequest = original.ImportRequest -type InstanceFailoverGroup = original.InstanceFailoverGroup -type InstanceFailoverGroupListResult = original.InstanceFailoverGroupListResult -type InstanceFailoverGroupListResultIterator = original.InstanceFailoverGroupListResultIterator -type InstanceFailoverGroupListResultPage = original.InstanceFailoverGroupListResultPage -type InstanceFailoverGroupProperties = original.InstanceFailoverGroupProperties -type InstanceFailoverGroupReadOnlyEndpoint = original.InstanceFailoverGroupReadOnlyEndpoint -type InstanceFailoverGroupReadWriteEndpoint = original.InstanceFailoverGroupReadWriteEndpoint -type InstanceFailoverGroupsClient = original.InstanceFailoverGroupsClient -type InstanceFailoverGroupsCreateOrUpdateFuture = original.InstanceFailoverGroupsCreateOrUpdateFuture -type InstanceFailoverGroupsDeleteFuture = original.InstanceFailoverGroupsDeleteFuture -type InstanceFailoverGroupsFailoverFuture = original.InstanceFailoverGroupsFailoverFuture -type InstanceFailoverGroupsForceFailoverAllowDataLossFuture = original.InstanceFailoverGroupsForceFailoverAllowDataLossFuture type InstancePool = original.InstancePool type InstancePoolListResult = original.InstancePoolListResult type InstancePoolListResultIterator = original.InstancePoolListResultIterator @@ -987,84 +128,6 @@ type InstancePoolsClient = original.InstancePoolsClient type InstancePoolsCreateOrUpdateFuture = original.InstancePoolsCreateOrUpdateFuture type InstancePoolsDeleteFuture = original.InstancePoolsDeleteFuture type InstancePoolsUpdateFuture = original.InstancePoolsUpdateFuture -type Job = original.Job -type JobAgent = original.JobAgent -type JobAgentListResult = original.JobAgentListResult -type JobAgentListResultIterator = original.JobAgentListResultIterator -type JobAgentListResultPage = original.JobAgentListResultPage -type JobAgentProperties = original.JobAgentProperties -type JobAgentUpdate = original.JobAgentUpdate -type JobAgentsClient = original.JobAgentsClient -type JobAgentsCreateOrUpdateFuture = original.JobAgentsCreateOrUpdateFuture -type JobAgentsDeleteFuture = original.JobAgentsDeleteFuture -type JobAgentsUpdateFuture = original.JobAgentsUpdateFuture -type JobCredential = original.JobCredential -type JobCredentialListResult = original.JobCredentialListResult -type JobCredentialListResultIterator = original.JobCredentialListResultIterator -type JobCredentialListResultPage = original.JobCredentialListResultPage -type JobCredentialProperties = original.JobCredentialProperties -type JobCredentialsClient = original.JobCredentialsClient -type JobExecution = original.JobExecution -type JobExecutionListResult = original.JobExecutionListResult -type JobExecutionListResultIterator = original.JobExecutionListResultIterator -type JobExecutionListResultPage = original.JobExecutionListResultPage -type JobExecutionProperties = original.JobExecutionProperties -type JobExecutionTarget = original.JobExecutionTarget -type JobExecutionsClient = original.JobExecutionsClient -type JobExecutionsCreateFuture = original.JobExecutionsCreateFuture -type JobExecutionsCreateOrUpdateFuture = original.JobExecutionsCreateOrUpdateFuture -type JobListResult = original.JobListResult -type JobListResultIterator = original.JobListResultIterator -type JobListResultPage = original.JobListResultPage -type JobProperties = original.JobProperties -type JobSchedule = original.JobSchedule -type JobStep = original.JobStep -type JobStepAction = original.JobStepAction -type JobStepExecutionOptions = original.JobStepExecutionOptions -type JobStepExecutionsClient = original.JobStepExecutionsClient -type JobStepListResult = original.JobStepListResult -type JobStepListResultIterator = original.JobStepListResultIterator -type JobStepListResultPage = original.JobStepListResultPage -type JobStepOutput = original.JobStepOutput -type JobStepProperties = original.JobStepProperties -type JobStepsClient = original.JobStepsClient -type JobTarget = original.JobTarget -type JobTargetExecutionsClient = original.JobTargetExecutionsClient -type JobTargetGroup = original.JobTargetGroup -type JobTargetGroupListResult = original.JobTargetGroupListResult -type JobTargetGroupListResultIterator = original.JobTargetGroupListResultIterator -type JobTargetGroupListResultPage = original.JobTargetGroupListResultPage -type JobTargetGroupProperties = original.JobTargetGroupProperties -type JobTargetGroupsClient = original.JobTargetGroupsClient -type JobVersion = original.JobVersion -type JobVersionListResult = original.JobVersionListResult -type JobVersionListResultIterator = original.JobVersionListResultIterator -type JobVersionListResultPage = original.JobVersionListResultPage -type JobVersionsClient = original.JobVersionsClient -type JobsClient = original.JobsClient -type LicenseTypeCapability = original.LicenseTypeCapability -type LocationCapabilities = original.LocationCapabilities -type LogSizeCapability = original.LogSizeCapability -type LogicalServerSecurityAlertPolicyListResult = original.LogicalServerSecurityAlertPolicyListResult -type LogicalServerSecurityAlertPolicyListResultIterator = original.LogicalServerSecurityAlertPolicyListResultIterator -type LogicalServerSecurityAlertPolicyListResultPage = original.LogicalServerSecurityAlertPolicyListResultPage -type LongTermRetentionBackup = original.LongTermRetentionBackup -type LongTermRetentionBackupListResult = original.LongTermRetentionBackupListResult -type LongTermRetentionBackupListResultIterator = original.LongTermRetentionBackupListResultIterator -type LongTermRetentionBackupListResultPage = original.LongTermRetentionBackupListResultPage -type LongTermRetentionBackupProperties = original.LongTermRetentionBackupProperties -type LongTermRetentionBackupsClient = original.LongTermRetentionBackupsClient -type LongTermRetentionBackupsDeleteByResourceGroupFuture = original.LongTermRetentionBackupsDeleteByResourceGroupFuture -type LongTermRetentionBackupsDeleteFuture = original.LongTermRetentionBackupsDeleteFuture -type LongTermRetentionPolicyProperties = original.LongTermRetentionPolicyProperties -type ManagedBackupShortTermRetentionPoliciesClient = original.ManagedBackupShortTermRetentionPoliciesClient -type ManagedBackupShortTermRetentionPoliciesCreateOrUpdateFuture = original.ManagedBackupShortTermRetentionPoliciesCreateOrUpdateFuture -type ManagedBackupShortTermRetentionPoliciesUpdateFuture = original.ManagedBackupShortTermRetentionPoliciesUpdateFuture -type ManagedBackupShortTermRetentionPolicy = original.ManagedBackupShortTermRetentionPolicy -type ManagedBackupShortTermRetentionPolicyListResult = original.ManagedBackupShortTermRetentionPolicyListResult -type ManagedBackupShortTermRetentionPolicyListResultIterator = original.ManagedBackupShortTermRetentionPolicyListResultIterator -type ManagedBackupShortTermRetentionPolicyListResultPage = original.ManagedBackupShortTermRetentionPolicyListResultPage -type ManagedBackupShortTermRetentionPolicyProperties = original.ManagedBackupShortTermRetentionPolicyProperties type ManagedDatabase = original.ManagedDatabase type ManagedDatabaseListResult = original.ManagedDatabaseListResult type ManagedDatabaseListResultIterator = original.ManagedDatabaseListResultIterator @@ -1073,59 +136,19 @@ type ManagedDatabaseProperties = original.ManagedDatabaseProperties type ManagedDatabaseRestoreDetailsClient = original.ManagedDatabaseRestoreDetailsClient type ManagedDatabaseRestoreDetailsProperties = original.ManagedDatabaseRestoreDetailsProperties type ManagedDatabaseRestoreDetailsResult = original.ManagedDatabaseRestoreDetailsResult -type ManagedDatabaseSecurityAlertPoliciesClient = original.ManagedDatabaseSecurityAlertPoliciesClient -type ManagedDatabaseSecurityAlertPolicy = original.ManagedDatabaseSecurityAlertPolicy -type ManagedDatabaseSecurityAlertPolicyListResult = original.ManagedDatabaseSecurityAlertPolicyListResult -type ManagedDatabaseSecurityAlertPolicyListResultIterator = original.ManagedDatabaseSecurityAlertPolicyListResultIterator -type ManagedDatabaseSecurityAlertPolicyListResultPage = original.ManagedDatabaseSecurityAlertPolicyListResultPage type ManagedDatabaseSensitivityLabelsClient = original.ManagedDatabaseSensitivityLabelsClient type ManagedDatabaseUpdate = original.ManagedDatabaseUpdate -type ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient = original.ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient -type ManagedDatabaseVulnerabilityAssessmentScansClient = original.ManagedDatabaseVulnerabilityAssessmentScansClient -type ManagedDatabaseVulnerabilityAssessmentScansInitiateScanFuture = original.ManagedDatabaseVulnerabilityAssessmentScansInitiateScanFuture -type ManagedDatabaseVulnerabilityAssessmentsClient = original.ManagedDatabaseVulnerabilityAssessmentsClient type ManagedDatabasesClient = original.ManagedDatabasesClient type ManagedDatabasesCompleteRestoreFuture = original.ManagedDatabasesCompleteRestoreFuture type ManagedDatabasesCreateOrUpdateFuture = original.ManagedDatabasesCreateOrUpdateFuture type ManagedDatabasesDeleteFuture = original.ManagedDatabasesDeleteFuture type ManagedDatabasesUpdateFuture = original.ManagedDatabasesUpdateFuture type ManagedInstance = original.ManagedInstance -type ManagedInstanceAdministrator = original.ManagedInstanceAdministrator -type ManagedInstanceAdministratorListResult = original.ManagedInstanceAdministratorListResult -type ManagedInstanceAdministratorListResultIterator = original.ManagedInstanceAdministratorListResultIterator -type ManagedInstanceAdministratorListResultPage = original.ManagedInstanceAdministratorListResultPage -type ManagedInstanceAdministratorProperties = original.ManagedInstanceAdministratorProperties -type ManagedInstanceAdministratorsClient = original.ManagedInstanceAdministratorsClient -type ManagedInstanceAdministratorsCreateOrUpdateFuture = original.ManagedInstanceAdministratorsCreateOrUpdateFuture -type ManagedInstanceAdministratorsDeleteFuture = original.ManagedInstanceAdministratorsDeleteFuture -type ManagedInstanceEditionCapability = original.ManagedInstanceEditionCapability -type ManagedInstanceEncryptionProtector = original.ManagedInstanceEncryptionProtector -type ManagedInstanceEncryptionProtectorListResult = original.ManagedInstanceEncryptionProtectorListResult -type ManagedInstanceEncryptionProtectorListResultIterator = original.ManagedInstanceEncryptionProtectorListResultIterator -type ManagedInstanceEncryptionProtectorListResultPage = original.ManagedInstanceEncryptionProtectorListResultPage -type ManagedInstanceEncryptionProtectorProperties = original.ManagedInstanceEncryptionProtectorProperties -type ManagedInstanceEncryptionProtectorsClient = original.ManagedInstanceEncryptionProtectorsClient -type ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture = original.ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture -type ManagedInstanceEncryptionProtectorsRevalidateFuture = original.ManagedInstanceEncryptionProtectorsRevalidateFuture -type ManagedInstanceFamilyCapability = original.ManagedInstanceFamilyCapability -type ManagedInstanceKey = original.ManagedInstanceKey -type ManagedInstanceKeyListResult = original.ManagedInstanceKeyListResult -type ManagedInstanceKeyListResultIterator = original.ManagedInstanceKeyListResultIterator -type ManagedInstanceKeyListResultPage = original.ManagedInstanceKeyListResultPage -type ManagedInstanceKeyProperties = original.ManagedInstanceKeyProperties -type ManagedInstanceKeysClient = original.ManagedInstanceKeysClient -type ManagedInstanceKeysCreateOrUpdateFuture = original.ManagedInstanceKeysCreateOrUpdateFuture -type ManagedInstanceKeysDeleteFuture = original.ManagedInstanceKeysDeleteFuture type ManagedInstanceListResult = original.ManagedInstanceListResult type ManagedInstanceListResultIterator = original.ManagedInstanceListResultIterator type ManagedInstanceListResultPage = original.ManagedInstanceListResultPage -type ManagedInstancePairInfo = original.ManagedInstancePairInfo type ManagedInstanceProperties = original.ManagedInstanceProperties -type ManagedInstanceTdeCertificatesClient = original.ManagedInstanceTdeCertificatesClient -type ManagedInstanceTdeCertificatesCreateFuture = original.ManagedInstanceTdeCertificatesCreateFuture type ManagedInstanceUpdate = original.ManagedInstanceUpdate -type ManagedInstanceVcoresCapability = original.ManagedInstanceVcoresCapability -type ManagedInstanceVersionCapability = original.ManagedInstanceVersionCapability type ManagedInstanceVulnerabilityAssessment = original.ManagedInstanceVulnerabilityAssessment type ManagedInstanceVulnerabilityAssessmentListResult = original.ManagedInstanceVulnerabilityAssessmentListResult type ManagedInstanceVulnerabilityAssessmentListResultIterator = original.ManagedInstanceVulnerabilityAssessmentListResultIterator @@ -1136,35 +159,7 @@ type ManagedInstancesClient = original.ManagedInstancesClient type ManagedInstancesCreateOrUpdateFuture = original.ManagedInstancesCreateOrUpdateFuture type ManagedInstancesDeleteFuture = original.ManagedInstancesDeleteFuture type ManagedInstancesUpdateFuture = original.ManagedInstancesUpdateFuture -type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient = original.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient -type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCreateOrUpdateFuture = original.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCreateOrUpdateFuture -type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesUpdateFuture = original.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesUpdateFuture -type ManagedServerSecurityAlertPoliciesClient = original.ManagedServerSecurityAlertPoliciesClient -type ManagedServerSecurityAlertPoliciesCreateOrUpdateFuture = original.ManagedServerSecurityAlertPoliciesCreateOrUpdateFuture -type ManagedServerSecurityAlertPolicy = original.ManagedServerSecurityAlertPolicy -type ManagedServerSecurityAlertPolicyListResult = original.ManagedServerSecurityAlertPolicyListResult -type ManagedServerSecurityAlertPolicyListResultIterator = original.ManagedServerSecurityAlertPolicyListResultIterator -type ManagedServerSecurityAlertPolicyListResultPage = original.ManagedServerSecurityAlertPolicyListResultPage -type MaxSizeCapability = original.MaxSizeCapability -type MaxSizeRangeCapability = original.MaxSizeRangeCapability -type Metric = original.Metric -type MetricAvailability = original.MetricAvailability -type MetricDefinition = original.MetricDefinition -type MetricDefinitionListResult = original.MetricDefinitionListResult -type MetricListResult = original.MetricListResult -type MetricName = original.MetricName -type MetricValue = original.MetricValue type Name = original.Name -type Operation = original.Operation -type OperationDisplay = original.OperationDisplay -type OperationImpact = original.OperationImpact -type OperationListResult = original.OperationListResult -type OperationListResultIterator = original.OperationListResultIterator -type OperationListResultPage = original.OperationListResultPage -type OperationsClient = original.OperationsClient -type PartnerInfo = original.PartnerInfo -type PartnerRegionInfo = original.PartnerRegionInfo -type PerformanceLevelCapability = original.PerformanceLevelCapability type PrivateEndpointConnection = original.PrivateEndpointConnection type PrivateEndpointConnectionListResult = original.PrivateEndpointConnectionListResult type PrivateEndpointConnectionListResultIterator = original.PrivateEndpointConnectionListResultIterator @@ -1174,449 +169,57 @@ type PrivateEndpointConnectionsClient = original.PrivateEndpointConnectionsClien type PrivateEndpointConnectionsCreateOrUpdateFuture = original.PrivateEndpointConnectionsCreateOrUpdateFuture type PrivateEndpointConnectionsDeleteFuture = original.PrivateEndpointConnectionsDeleteFuture type PrivateEndpointProperty = original.PrivateEndpointProperty -type PrivateLinkResource = original.PrivateLinkResource -type PrivateLinkResourceListResult = original.PrivateLinkResourceListResult -type PrivateLinkResourceListResultIterator = original.PrivateLinkResourceListResultIterator -type PrivateLinkResourceListResultPage = original.PrivateLinkResourceListResultPage -type PrivateLinkResourceProperties = original.PrivateLinkResourceProperties -type PrivateLinkResourcesClient = original.PrivateLinkResourcesClient type PrivateLinkServiceConnectionStateProperty = original.PrivateLinkServiceConnectionStateProperty type ProxyResource = original.ProxyResource -type RecommendedElasticPool = original.RecommendedElasticPool -type RecommendedElasticPoolListMetricsResult = original.RecommendedElasticPoolListMetricsResult -type RecommendedElasticPoolListResult = original.RecommendedElasticPoolListResult -type RecommendedElasticPoolMetric = original.RecommendedElasticPoolMetric -type RecommendedElasticPoolProperties = original.RecommendedElasticPoolProperties -type RecommendedElasticPoolsClient = original.RecommendedElasticPoolsClient -type RecommendedIndex = original.RecommendedIndex -type RecommendedIndexProperties = original.RecommendedIndexProperties -type RecoverableDatabase = original.RecoverableDatabase -type RecoverableDatabaseListResult = original.RecoverableDatabaseListResult -type RecoverableDatabaseProperties = original.RecoverableDatabaseProperties -type RecoverableDatabasesClient = original.RecoverableDatabasesClient -type RecoverableManagedDatabase = original.RecoverableManagedDatabase -type RecoverableManagedDatabaseListResult = original.RecoverableManagedDatabaseListResult -type RecoverableManagedDatabaseListResultIterator = original.RecoverableManagedDatabaseListResultIterator -type RecoverableManagedDatabaseListResultPage = original.RecoverableManagedDatabaseListResultPage -type RecoverableManagedDatabaseProperties = original.RecoverableManagedDatabaseProperties -type RecoverableManagedDatabasesClient = original.RecoverableManagedDatabasesClient -type ReplicationLink = original.ReplicationLink -type ReplicationLinkListResult = original.ReplicationLinkListResult -type ReplicationLinkProperties = original.ReplicationLinkProperties -type ReplicationLinksClient = original.ReplicationLinksClient -type ReplicationLinksFailoverAllowDataLossFuture = original.ReplicationLinksFailoverAllowDataLossFuture -type ReplicationLinksFailoverFuture = original.ReplicationLinksFailoverFuture type Resource = original.Resource type ResourceIdentity = original.ResourceIdentity -type ResourceMoveDefinition = original.ResourceMoveDefinition -type RestorableDroppedDatabase = original.RestorableDroppedDatabase -type RestorableDroppedDatabaseListResult = original.RestorableDroppedDatabaseListResult -type RestorableDroppedDatabaseProperties = original.RestorableDroppedDatabaseProperties -type RestorableDroppedDatabasesClient = original.RestorableDroppedDatabasesClient -type RestorableDroppedManagedDatabase = original.RestorableDroppedManagedDatabase -type RestorableDroppedManagedDatabaseListResult = original.RestorableDroppedManagedDatabaseListResult -type RestorableDroppedManagedDatabaseListResultIterator = original.RestorableDroppedManagedDatabaseListResultIterator -type RestorableDroppedManagedDatabaseListResultPage = original.RestorableDroppedManagedDatabaseListResultPage -type RestorableDroppedManagedDatabaseProperties = original.RestorableDroppedManagedDatabaseProperties -type RestorableDroppedManagedDatabasesClient = original.RestorableDroppedManagedDatabasesClient -type RestorePoint = original.RestorePoint -type RestorePointListResult = original.RestorePointListResult -type RestorePointProperties = original.RestorePointProperties -type RestorePointsClient = original.RestorePointsClient -type RestorePointsCreateFuture = original.RestorePointsCreateFuture type SecurityAlertPolicyProperties = original.SecurityAlertPolicyProperties type SensitivityLabel = original.SensitivityLabel type SensitivityLabelListResult = original.SensitivityLabelListResult type SensitivityLabelListResultIterator = original.SensitivityLabelListResultIterator type SensitivityLabelListResultPage = original.SensitivityLabelListResultPage type SensitivityLabelProperties = original.SensitivityLabelProperties -type SensitivityLabelsClient = original.SensitivityLabelsClient -type Server = original.Server -type ServerAdministratorListResult = original.ServerAdministratorListResult -type ServerAdministratorProperties = original.ServerAdministratorProperties -type ServerAutomaticTuning = original.ServerAutomaticTuning -type ServerAutomaticTuningClient = original.ServerAutomaticTuningClient -type ServerAzureADAdministrator = original.ServerAzureADAdministrator -type ServerAzureADAdministratorsClient = original.ServerAzureADAdministratorsClient -type ServerAzureADAdministratorsCreateOrUpdateFuture = original.ServerAzureADAdministratorsCreateOrUpdateFuture -type ServerAzureADAdministratorsDeleteFuture = original.ServerAzureADAdministratorsDeleteFuture -type ServerBlobAuditingPoliciesClient = original.ServerBlobAuditingPoliciesClient -type ServerBlobAuditingPoliciesCreateOrUpdateFuture = original.ServerBlobAuditingPoliciesCreateOrUpdateFuture -type ServerBlobAuditingPolicy = original.ServerBlobAuditingPolicy -type ServerBlobAuditingPolicyListResult = original.ServerBlobAuditingPolicyListResult -type ServerBlobAuditingPolicyListResultIterator = original.ServerBlobAuditingPolicyListResultIterator -type ServerBlobAuditingPolicyListResultPage = original.ServerBlobAuditingPolicyListResultPage -type ServerBlobAuditingPolicyProperties = original.ServerBlobAuditingPolicyProperties -type ServerCommunicationLink = original.ServerCommunicationLink -type ServerCommunicationLinkListResult = original.ServerCommunicationLinkListResult -type ServerCommunicationLinkProperties = original.ServerCommunicationLinkProperties -type ServerCommunicationLinksClient = original.ServerCommunicationLinksClient -type ServerCommunicationLinksCreateOrUpdateFuture = original.ServerCommunicationLinksCreateOrUpdateFuture -type ServerConnectionPoliciesClient = original.ServerConnectionPoliciesClient -type ServerConnectionPolicy = original.ServerConnectionPolicy -type ServerConnectionPolicyProperties = original.ServerConnectionPolicyProperties -type ServerDNSAlias = original.ServerDNSAlias -type ServerDNSAliasAcquisition = original.ServerDNSAliasAcquisition -type ServerDNSAliasListResult = original.ServerDNSAliasListResult -type ServerDNSAliasListResultIterator = original.ServerDNSAliasListResultIterator -type ServerDNSAliasListResultPage = original.ServerDNSAliasListResultPage -type ServerDNSAliasProperties = original.ServerDNSAliasProperties -type ServerDNSAliasesAcquireFuture = original.ServerDNSAliasesAcquireFuture -type ServerDNSAliasesClient = original.ServerDNSAliasesClient -type ServerDNSAliasesCreateOrUpdateFuture = original.ServerDNSAliasesCreateOrUpdateFuture -type ServerDNSAliasesDeleteFuture = original.ServerDNSAliasesDeleteFuture -type ServerKey = original.ServerKey -type ServerKeyListResult = original.ServerKeyListResult -type ServerKeyListResultIterator = original.ServerKeyListResultIterator -type ServerKeyListResultPage = original.ServerKeyListResultPage -type ServerKeyProperties = original.ServerKeyProperties -type ServerKeysClient = original.ServerKeysClient -type ServerKeysCreateOrUpdateFuture = original.ServerKeysCreateOrUpdateFuture -type ServerKeysDeleteFuture = original.ServerKeysDeleteFuture -type ServerListResult = original.ServerListResult -type ServerListResultIterator = original.ServerListResultIterator -type ServerListResultPage = original.ServerListResultPage -type ServerProperties = original.ServerProperties -type ServerSecurityAlertPoliciesClient = original.ServerSecurityAlertPoliciesClient -type ServerSecurityAlertPoliciesCreateOrUpdateFuture = original.ServerSecurityAlertPoliciesCreateOrUpdateFuture -type ServerSecurityAlertPolicy = original.ServerSecurityAlertPolicy -type ServerUpdate = original.ServerUpdate -type ServerUsage = original.ServerUsage -type ServerUsageListResult = original.ServerUsageListResult -type ServerUsagesClient = original.ServerUsagesClient -type ServerVersionCapability = original.ServerVersionCapability type ServerVulnerabilityAssessment = original.ServerVulnerabilityAssessment type ServerVulnerabilityAssessmentListResult = original.ServerVulnerabilityAssessmentListResult type ServerVulnerabilityAssessmentListResultIterator = original.ServerVulnerabilityAssessmentListResultIterator type ServerVulnerabilityAssessmentListResultPage = original.ServerVulnerabilityAssessmentListResultPage type ServerVulnerabilityAssessmentProperties = original.ServerVulnerabilityAssessmentProperties type ServerVulnerabilityAssessmentsClient = original.ServerVulnerabilityAssessmentsClient -type ServersClient = original.ServersClient -type ServersCreateOrUpdateFuture = original.ServersCreateOrUpdateFuture -type ServersDeleteFuture = original.ServersDeleteFuture -type ServersUpdateFuture = original.ServersUpdateFuture -type ServiceObjective = original.ServiceObjective -type ServiceObjectiveCapability = original.ServiceObjectiveCapability -type ServiceObjectiveListResult = original.ServiceObjectiveListResult -type ServiceObjectiveProperties = original.ServiceObjectiveProperties -type ServiceObjectivesClient = original.ServiceObjectivesClient -type ServiceTierAdvisor = original.ServiceTierAdvisor -type ServiceTierAdvisorListResult = original.ServiceTierAdvisorListResult -type ServiceTierAdvisorProperties = original.ServiceTierAdvisorProperties -type ServiceTierAdvisorsClient = original.ServiceTierAdvisorsClient type Sku = original.Sku -type SloUsageMetric = original.SloUsageMetric -type SubscriptionUsage = original.SubscriptionUsage -type SubscriptionUsageListResult = original.SubscriptionUsageListResult -type SubscriptionUsageListResultIterator = original.SubscriptionUsageListResultIterator -type SubscriptionUsageListResultPage = original.SubscriptionUsageListResultPage -type SubscriptionUsageProperties = original.SubscriptionUsageProperties -type SubscriptionUsagesClient = original.SubscriptionUsagesClient -type SyncAgent = original.SyncAgent -type SyncAgentKeyProperties = original.SyncAgentKeyProperties -type SyncAgentLinkedDatabase = original.SyncAgentLinkedDatabase -type SyncAgentLinkedDatabaseListResult = original.SyncAgentLinkedDatabaseListResult -type SyncAgentLinkedDatabaseListResultIterator = original.SyncAgentLinkedDatabaseListResultIterator -type SyncAgentLinkedDatabaseListResultPage = original.SyncAgentLinkedDatabaseListResultPage -type SyncAgentLinkedDatabaseProperties = original.SyncAgentLinkedDatabaseProperties -type SyncAgentListResult = original.SyncAgentListResult -type SyncAgentListResultIterator = original.SyncAgentListResultIterator -type SyncAgentListResultPage = original.SyncAgentListResultPage -type SyncAgentProperties = original.SyncAgentProperties -type SyncAgentsClient = original.SyncAgentsClient -type SyncAgentsCreateOrUpdateFuture = original.SyncAgentsCreateOrUpdateFuture -type SyncAgentsDeleteFuture = original.SyncAgentsDeleteFuture -type SyncDatabaseIDListResult = original.SyncDatabaseIDListResult -type SyncDatabaseIDListResultIterator = original.SyncDatabaseIDListResultIterator -type SyncDatabaseIDListResultPage = original.SyncDatabaseIDListResultPage -type SyncDatabaseIDProperties = original.SyncDatabaseIDProperties -type SyncFullSchemaProperties = original.SyncFullSchemaProperties -type SyncFullSchemaPropertiesListResult = original.SyncFullSchemaPropertiesListResult -type SyncFullSchemaPropertiesListResultIterator = original.SyncFullSchemaPropertiesListResultIterator -type SyncFullSchemaPropertiesListResultPage = original.SyncFullSchemaPropertiesListResultPage -type SyncFullSchemaTable = original.SyncFullSchemaTable -type SyncFullSchemaTableColumn = original.SyncFullSchemaTableColumn -type SyncGroup = original.SyncGroup -type SyncGroupListResult = original.SyncGroupListResult -type SyncGroupListResultIterator = original.SyncGroupListResultIterator -type SyncGroupListResultPage = original.SyncGroupListResultPage -type SyncGroupLogListResult = original.SyncGroupLogListResult -type SyncGroupLogListResultIterator = original.SyncGroupLogListResultIterator -type SyncGroupLogListResultPage = original.SyncGroupLogListResultPage -type SyncGroupLogProperties = original.SyncGroupLogProperties -type SyncGroupProperties = original.SyncGroupProperties -type SyncGroupSchema = original.SyncGroupSchema -type SyncGroupSchemaTable = original.SyncGroupSchemaTable -type SyncGroupSchemaTableColumn = original.SyncGroupSchemaTableColumn -type SyncGroupsClient = original.SyncGroupsClient -type SyncGroupsCreateOrUpdateFuture = original.SyncGroupsCreateOrUpdateFuture -type SyncGroupsDeleteFuture = original.SyncGroupsDeleteFuture -type SyncGroupsRefreshHubSchemaFuture = original.SyncGroupsRefreshHubSchemaFuture -type SyncGroupsUpdateFuture = original.SyncGroupsUpdateFuture -type SyncMember = original.SyncMember -type SyncMemberListResult = original.SyncMemberListResult -type SyncMemberListResultIterator = original.SyncMemberListResultIterator -type SyncMemberListResultPage = original.SyncMemberListResultPage -type SyncMemberProperties = original.SyncMemberProperties -type SyncMembersClient = original.SyncMembersClient -type SyncMembersCreateOrUpdateFuture = original.SyncMembersCreateOrUpdateFuture -type SyncMembersDeleteFuture = original.SyncMembersDeleteFuture -type SyncMembersRefreshMemberSchemaFuture = original.SyncMembersRefreshMemberSchemaFuture -type SyncMembersUpdateFuture = original.SyncMembersUpdateFuture -type TdeCertificate = original.TdeCertificate -type TdeCertificateProperties = original.TdeCertificateProperties -type TdeCertificatesClient = original.TdeCertificatesClient -type TdeCertificatesCreateFuture = original.TdeCertificatesCreateFuture type TrackedResource = original.TrackedResource -type TransparentDataEncryption = original.TransparentDataEncryption -type TransparentDataEncryptionActivitiesClient = original.TransparentDataEncryptionActivitiesClient -type TransparentDataEncryptionActivity = original.TransparentDataEncryptionActivity -type TransparentDataEncryptionActivityListResult = original.TransparentDataEncryptionActivityListResult -type TransparentDataEncryptionActivityProperties = original.TransparentDataEncryptionActivityProperties -type TransparentDataEncryptionProperties = original.TransparentDataEncryptionProperties -type TransparentDataEncryptionsClient = original.TransparentDataEncryptionsClient type Usage = original.Usage type UsageListResult = original.UsageListResult type UsageListResultIterator = original.UsageListResultIterator type UsageListResultPage = original.UsageListResultPage -type UsagesClient = original.UsagesClient -type VirtualCluster = original.VirtualCluster -type VirtualClusterListResult = original.VirtualClusterListResult -type VirtualClusterListResultIterator = original.VirtualClusterListResultIterator -type VirtualClusterListResultPage = original.VirtualClusterListResultPage -type VirtualClusterProperties = original.VirtualClusterProperties -type VirtualClusterUpdate = original.VirtualClusterUpdate -type VirtualClustersClient = original.VirtualClustersClient -type VirtualClustersDeleteFuture = original.VirtualClustersDeleteFuture -type VirtualClustersUpdateFuture = original.VirtualClustersUpdateFuture -type VirtualNetworkRule = original.VirtualNetworkRule -type VirtualNetworkRuleListResult = original.VirtualNetworkRuleListResult -type VirtualNetworkRuleListResultIterator = original.VirtualNetworkRuleListResultIterator -type VirtualNetworkRuleListResultPage = original.VirtualNetworkRuleListResultPage -type VirtualNetworkRuleProperties = original.VirtualNetworkRuleProperties -type VirtualNetworkRulesClient = original.VirtualNetworkRulesClient -type VirtualNetworkRulesCreateOrUpdateFuture = original.VirtualNetworkRulesCreateOrUpdateFuture -type VirtualNetworkRulesDeleteFuture = original.VirtualNetworkRulesDeleteFuture -type VulnerabilityAssessmentRecurringScansProperties = original.VulnerabilityAssessmentRecurringScansProperties -type VulnerabilityAssessmentScanError = original.VulnerabilityAssessmentScanError -type VulnerabilityAssessmentScanRecord = original.VulnerabilityAssessmentScanRecord -type VulnerabilityAssessmentScanRecordListResult = original.VulnerabilityAssessmentScanRecordListResult -type VulnerabilityAssessmentScanRecordListResultIterator = original.VulnerabilityAssessmentScanRecordListResultIterator -type VulnerabilityAssessmentScanRecordListResultPage = original.VulnerabilityAssessmentScanRecordListResultPage -type VulnerabilityAssessmentScanRecordProperties = original.VulnerabilityAssessmentScanRecordProperties - -func New(subscriptionID string) BaseClient { - return original.New(subscriptionID) -} -func NewBackupLongTermRetentionPoliciesClient(subscriptionID string) BackupLongTermRetentionPoliciesClient { - return original.NewBackupLongTermRetentionPoliciesClient(subscriptionID) -} -func NewBackupLongTermRetentionPoliciesClientWithBaseURI(baseURI string, subscriptionID string) BackupLongTermRetentionPoliciesClient { - return original.NewBackupLongTermRetentionPoliciesClientWithBaseURI(baseURI, subscriptionID) -} -func NewBackupShortTermRetentionPoliciesClient(subscriptionID string) BackupShortTermRetentionPoliciesClient { - return original.NewBackupShortTermRetentionPoliciesClient(subscriptionID) -} -func NewBackupShortTermRetentionPoliciesClientWithBaseURI(baseURI string, subscriptionID string) BackupShortTermRetentionPoliciesClient { - return original.NewBackupShortTermRetentionPoliciesClientWithBaseURI(baseURI, subscriptionID) -} -func NewBackupShortTermRetentionPolicyListResultIterator(page BackupShortTermRetentionPolicyListResultPage) BackupShortTermRetentionPolicyListResultIterator { - return original.NewBackupShortTermRetentionPolicyListResultIterator(page) -} -func NewBackupShortTermRetentionPolicyListResultPage(getNextPage func(context.Context, BackupShortTermRetentionPolicyListResult) (BackupShortTermRetentionPolicyListResult, error)) BackupShortTermRetentionPolicyListResultPage { - return original.NewBackupShortTermRetentionPolicyListResultPage(getNextPage) -} -func NewCapabilitiesClient(subscriptionID string) CapabilitiesClient { - return original.NewCapabilitiesClient(subscriptionID) -} -func NewCapabilitiesClientWithBaseURI(baseURI string, subscriptionID string) CapabilitiesClient { - return original.NewCapabilitiesClientWithBaseURI(baseURI, subscriptionID) -} -func NewDataMaskingPoliciesClient(subscriptionID string) DataMaskingPoliciesClient { - return original.NewDataMaskingPoliciesClient(subscriptionID) -} -func NewDataMaskingPoliciesClientWithBaseURI(baseURI string, subscriptionID string) DataMaskingPoliciesClient { - return original.NewDataMaskingPoliciesClientWithBaseURI(baseURI, subscriptionID) -} -func NewDataMaskingRulesClient(subscriptionID string) DataMaskingRulesClient { - return original.NewDataMaskingRulesClient(subscriptionID) -} -func NewDataMaskingRulesClientWithBaseURI(baseURI string, subscriptionID string) DataMaskingRulesClient { - return original.NewDataMaskingRulesClientWithBaseURI(baseURI, subscriptionID) -} -func NewDatabaseAutomaticTuningClient(subscriptionID string) DatabaseAutomaticTuningClient { - return original.NewDatabaseAutomaticTuningClient(subscriptionID) -} -func NewDatabaseAutomaticTuningClientWithBaseURI(baseURI string, subscriptionID string) DatabaseAutomaticTuningClient { - return original.NewDatabaseAutomaticTuningClientWithBaseURI(baseURI, subscriptionID) -} -func NewDatabaseBlobAuditingPoliciesClient(subscriptionID string) DatabaseBlobAuditingPoliciesClient { - return original.NewDatabaseBlobAuditingPoliciesClient(subscriptionID) -} -func NewDatabaseBlobAuditingPoliciesClientWithBaseURI(baseURI string, subscriptionID string) DatabaseBlobAuditingPoliciesClient { - return original.NewDatabaseBlobAuditingPoliciesClientWithBaseURI(baseURI, subscriptionID) -} -func NewDatabaseBlobAuditingPolicyListResultIterator(page DatabaseBlobAuditingPolicyListResultPage) DatabaseBlobAuditingPolicyListResultIterator { - return original.NewDatabaseBlobAuditingPolicyListResultIterator(page) -} -func NewDatabaseBlobAuditingPolicyListResultPage(getNextPage func(context.Context, DatabaseBlobAuditingPolicyListResult) (DatabaseBlobAuditingPolicyListResult, error)) DatabaseBlobAuditingPolicyListResultPage { - return original.NewDatabaseBlobAuditingPolicyListResultPage(getNextPage) -} -func NewDatabaseListResultIterator(page DatabaseListResultPage) DatabaseListResultIterator { - return original.NewDatabaseListResultIterator(page) -} -func NewDatabaseListResultPage(getNextPage func(context.Context, DatabaseListResult) (DatabaseListResult, error)) DatabaseListResultPage { - return original.NewDatabaseListResultPage(getNextPage) -} -func NewDatabaseOperationListResultIterator(page DatabaseOperationListResultPage) DatabaseOperationListResultIterator { - return original.NewDatabaseOperationListResultIterator(page) -} -func NewDatabaseOperationListResultPage(getNextPage func(context.Context, DatabaseOperationListResult) (DatabaseOperationListResult, error)) DatabaseOperationListResultPage { - return original.NewDatabaseOperationListResultPage(getNextPage) -} -func NewDatabaseOperationsClient(subscriptionID string) DatabaseOperationsClient { - return original.NewDatabaseOperationsClient(subscriptionID) -} -func NewDatabaseOperationsClientWithBaseURI(baseURI string, subscriptionID string) DatabaseOperationsClient { - return original.NewDatabaseOperationsClientWithBaseURI(baseURI, subscriptionID) -} -func NewDatabaseThreatDetectionPoliciesClient(subscriptionID string) DatabaseThreatDetectionPoliciesClient { - return original.NewDatabaseThreatDetectionPoliciesClient(subscriptionID) -} -func NewDatabaseThreatDetectionPoliciesClientWithBaseURI(baseURI string, subscriptionID string) DatabaseThreatDetectionPoliciesClient { - return original.NewDatabaseThreatDetectionPoliciesClientWithBaseURI(baseURI, subscriptionID) -} -func NewDatabaseUsagesClient(subscriptionID string) DatabaseUsagesClient { - return original.NewDatabaseUsagesClient(subscriptionID) -} -func NewDatabaseUsagesClientWithBaseURI(baseURI string, subscriptionID string) DatabaseUsagesClient { - return original.NewDatabaseUsagesClientWithBaseURI(baseURI, subscriptionID) -} -func NewDatabaseVulnerabilityAssessmentListResultIterator(page DatabaseVulnerabilityAssessmentListResultPage) DatabaseVulnerabilityAssessmentListResultIterator { - return original.NewDatabaseVulnerabilityAssessmentListResultIterator(page) -} -func NewDatabaseVulnerabilityAssessmentListResultPage(getNextPage func(context.Context, DatabaseVulnerabilityAssessmentListResult) (DatabaseVulnerabilityAssessmentListResult, error)) DatabaseVulnerabilityAssessmentListResultPage { - return original.NewDatabaseVulnerabilityAssessmentListResultPage(getNextPage) -} -func NewDatabaseVulnerabilityAssessmentRuleBaselinesClient(subscriptionID string) DatabaseVulnerabilityAssessmentRuleBaselinesClient { - return original.NewDatabaseVulnerabilityAssessmentRuleBaselinesClient(subscriptionID) -} -func NewDatabaseVulnerabilityAssessmentRuleBaselinesClientWithBaseURI(baseURI string, subscriptionID string) DatabaseVulnerabilityAssessmentRuleBaselinesClient { - return original.NewDatabaseVulnerabilityAssessmentRuleBaselinesClientWithBaseURI(baseURI, subscriptionID) -} -func NewDatabaseVulnerabilityAssessmentScansClient(subscriptionID string) DatabaseVulnerabilityAssessmentScansClient { - return original.NewDatabaseVulnerabilityAssessmentScansClient(subscriptionID) -} -func NewDatabaseVulnerabilityAssessmentScansClientWithBaseURI(baseURI string, subscriptionID string) DatabaseVulnerabilityAssessmentScansClient { - return original.NewDatabaseVulnerabilityAssessmentScansClientWithBaseURI(baseURI, subscriptionID) -} -func NewDatabaseVulnerabilityAssessmentsClient(subscriptionID string) DatabaseVulnerabilityAssessmentsClient { - return original.NewDatabaseVulnerabilityAssessmentsClient(subscriptionID) -} -func NewDatabaseVulnerabilityAssessmentsClientWithBaseURI(baseURI string, subscriptionID string) DatabaseVulnerabilityAssessmentsClient { - return original.NewDatabaseVulnerabilityAssessmentsClientWithBaseURI(baseURI, subscriptionID) -} -func NewDatabasesClient(subscriptionID string) DatabasesClient { - return original.NewDatabasesClient(subscriptionID) -} -func NewDatabasesClientWithBaseURI(baseURI string, subscriptionID string) DatabasesClient { - return original.NewDatabasesClientWithBaseURI(baseURI, subscriptionID) -} -func NewElasticPoolActivitiesClient(subscriptionID string) ElasticPoolActivitiesClient { - return original.NewElasticPoolActivitiesClient(subscriptionID) -} -func NewElasticPoolActivitiesClientWithBaseURI(baseURI string, subscriptionID string) ElasticPoolActivitiesClient { - return original.NewElasticPoolActivitiesClientWithBaseURI(baseURI, subscriptionID) -} -func NewElasticPoolDatabaseActivitiesClient(subscriptionID string) ElasticPoolDatabaseActivitiesClient { - return original.NewElasticPoolDatabaseActivitiesClient(subscriptionID) -} -func NewElasticPoolDatabaseActivitiesClientWithBaseURI(baseURI string, subscriptionID string) ElasticPoolDatabaseActivitiesClient { - return original.NewElasticPoolDatabaseActivitiesClientWithBaseURI(baseURI, subscriptionID) -} -func NewElasticPoolListResultIterator(page ElasticPoolListResultPage) ElasticPoolListResultIterator { - return original.NewElasticPoolListResultIterator(page) -} -func NewElasticPoolListResultPage(getNextPage func(context.Context, ElasticPoolListResult) (ElasticPoolListResult, error)) ElasticPoolListResultPage { - return original.NewElasticPoolListResultPage(getNextPage) -} -func NewElasticPoolOperationListResultIterator(page ElasticPoolOperationListResultPage) ElasticPoolOperationListResultIterator { - return original.NewElasticPoolOperationListResultIterator(page) -} -func NewElasticPoolOperationListResultPage(getNextPage func(context.Context, ElasticPoolOperationListResult) (ElasticPoolOperationListResult, error)) ElasticPoolOperationListResultPage { - return original.NewElasticPoolOperationListResultPage(getNextPage) -} -func NewElasticPoolOperationsClient(subscriptionID string) ElasticPoolOperationsClient { - return original.NewElasticPoolOperationsClient(subscriptionID) -} -func NewElasticPoolOperationsClientWithBaseURI(baseURI string, subscriptionID string) ElasticPoolOperationsClient { - return original.NewElasticPoolOperationsClientWithBaseURI(baseURI, subscriptionID) -} -func NewElasticPoolsClient(subscriptionID string) ElasticPoolsClient { - return original.NewElasticPoolsClient(subscriptionID) -} -func NewElasticPoolsClientWithBaseURI(baseURI string, subscriptionID string) ElasticPoolsClient { - return original.NewElasticPoolsClientWithBaseURI(baseURI, subscriptionID) -} -func NewEncryptionProtectorListResultIterator(page EncryptionProtectorListResultPage) EncryptionProtectorListResultIterator { - return original.NewEncryptionProtectorListResultIterator(page) -} -func NewEncryptionProtectorListResultPage(getNextPage func(context.Context, EncryptionProtectorListResult) (EncryptionProtectorListResult, error)) EncryptionProtectorListResultPage { - return original.NewEncryptionProtectorListResultPage(getNextPage) -} -func NewEncryptionProtectorsClient(subscriptionID string) EncryptionProtectorsClient { - return original.NewEncryptionProtectorsClient(subscriptionID) -} -func NewEncryptionProtectorsClientWithBaseURI(baseURI string, subscriptionID string) EncryptionProtectorsClient { - return original.NewEncryptionProtectorsClientWithBaseURI(baseURI, subscriptionID) -} -func NewExtendedDatabaseBlobAuditingPoliciesClient(subscriptionID string) ExtendedDatabaseBlobAuditingPoliciesClient { - return original.NewExtendedDatabaseBlobAuditingPoliciesClient(subscriptionID) -} -func NewExtendedDatabaseBlobAuditingPoliciesClientWithBaseURI(baseURI string, subscriptionID string) ExtendedDatabaseBlobAuditingPoliciesClient { - return original.NewExtendedDatabaseBlobAuditingPoliciesClientWithBaseURI(baseURI, subscriptionID) -} -func NewExtendedServerBlobAuditingPoliciesClient(subscriptionID string) ExtendedServerBlobAuditingPoliciesClient { - return original.NewExtendedServerBlobAuditingPoliciesClient(subscriptionID) -} -func NewExtendedServerBlobAuditingPoliciesClientWithBaseURI(baseURI string, subscriptionID string) ExtendedServerBlobAuditingPoliciesClient { - return original.NewExtendedServerBlobAuditingPoliciesClientWithBaseURI(baseURI, subscriptionID) -} -func NewFailoverGroupListResultIterator(page FailoverGroupListResultPage) FailoverGroupListResultIterator { - return original.NewFailoverGroupListResultIterator(page) -} -func NewFailoverGroupListResultPage(getNextPage func(context.Context, FailoverGroupListResult) (FailoverGroupListResult, error)) FailoverGroupListResultPage { - return original.NewFailoverGroupListResultPage(getNextPage) -} -func NewFailoverGroupsClient(subscriptionID string) FailoverGroupsClient { - return original.NewFailoverGroupsClient(subscriptionID) -} -func NewFailoverGroupsClientWithBaseURI(baseURI string, subscriptionID string) FailoverGroupsClient { - return original.NewFailoverGroupsClientWithBaseURI(baseURI, subscriptionID) +type UsagesClient = original.UsagesClient +type VulnerabilityAssessmentRecurringScansProperties = original.VulnerabilityAssessmentRecurringScansProperties + +func New(subscriptionID string) BaseClient { + return original.New(subscriptionID) } -func NewFirewallRulesClient(subscriptionID string) FirewallRulesClient { - return original.NewFirewallRulesClient(subscriptionID) +func NewDatabaseSecurityAlertListResultIterator(page DatabaseSecurityAlertListResultPage) DatabaseSecurityAlertListResultIterator { + return original.NewDatabaseSecurityAlertListResultIterator(page) } -func NewFirewallRulesClientWithBaseURI(baseURI string, subscriptionID string) FirewallRulesClient { - return original.NewFirewallRulesClientWithBaseURI(baseURI, subscriptionID) +func NewDatabaseSecurityAlertListResultPage(getNextPage func(context.Context, DatabaseSecurityAlertListResult) (DatabaseSecurityAlertListResult, error)) DatabaseSecurityAlertListResultPage { + return original.NewDatabaseSecurityAlertListResultPage(getNextPage) } -func NewGeoBackupPoliciesClient(subscriptionID string) GeoBackupPoliciesClient { - return original.NewGeoBackupPoliciesClient(subscriptionID) +func NewDatabaseSecurityAlertPoliciesClient(subscriptionID string) DatabaseSecurityAlertPoliciesClient { + return original.NewDatabaseSecurityAlertPoliciesClient(subscriptionID) } -func NewGeoBackupPoliciesClientWithBaseURI(baseURI string, subscriptionID string) GeoBackupPoliciesClient { - return original.NewGeoBackupPoliciesClientWithBaseURI(baseURI, subscriptionID) +func NewDatabaseSecurityAlertPoliciesClientWithBaseURI(baseURI string, subscriptionID string) DatabaseSecurityAlertPoliciesClient { + return original.NewDatabaseSecurityAlertPoliciesClientWithBaseURI(baseURI, subscriptionID) } -func NewInstanceFailoverGroupListResultIterator(page InstanceFailoverGroupListResultPage) InstanceFailoverGroupListResultIterator { - return original.NewInstanceFailoverGroupListResultIterator(page) +func NewDatabasesClient(subscriptionID string) DatabasesClient { + return original.NewDatabasesClient(subscriptionID) } -func NewInstanceFailoverGroupListResultPage(getNextPage func(context.Context, InstanceFailoverGroupListResult) (InstanceFailoverGroupListResult, error)) InstanceFailoverGroupListResultPage { - return original.NewInstanceFailoverGroupListResultPage(getNextPage) +func NewDatabasesClientWithBaseURI(baseURI string, subscriptionID string) DatabasesClient { + return original.NewDatabasesClientWithBaseURI(baseURI, subscriptionID) } -func NewInstanceFailoverGroupsClient(subscriptionID string) InstanceFailoverGroupsClient { - return original.NewInstanceFailoverGroupsClient(subscriptionID) +func NewElasticPoolsClient(subscriptionID string) ElasticPoolsClient { + return original.NewElasticPoolsClient(subscriptionID) } -func NewInstanceFailoverGroupsClientWithBaseURI(baseURI string, subscriptionID string) InstanceFailoverGroupsClient { - return original.NewInstanceFailoverGroupsClientWithBaseURI(baseURI, subscriptionID) +func NewElasticPoolsClientWithBaseURI(baseURI string, subscriptionID string) ElasticPoolsClient { + return original.NewElasticPoolsClientWithBaseURI(baseURI, subscriptionID) } func NewInstancePoolListResultIterator(page InstancePoolListResultPage) InstancePoolListResultIterator { return original.NewInstancePoolListResultIterator(page) @@ -1630,132 +233,6 @@ func NewInstancePoolsClient(subscriptionID string) InstancePoolsClient { func NewInstancePoolsClientWithBaseURI(baseURI string, subscriptionID string) InstancePoolsClient { return original.NewInstancePoolsClientWithBaseURI(baseURI, subscriptionID) } -func NewJobAgentListResultIterator(page JobAgentListResultPage) JobAgentListResultIterator { - return original.NewJobAgentListResultIterator(page) -} -func NewJobAgentListResultPage(getNextPage func(context.Context, JobAgentListResult) (JobAgentListResult, error)) JobAgentListResultPage { - return original.NewJobAgentListResultPage(getNextPage) -} -func NewJobAgentsClient(subscriptionID string) JobAgentsClient { - return original.NewJobAgentsClient(subscriptionID) -} -func NewJobAgentsClientWithBaseURI(baseURI string, subscriptionID string) JobAgentsClient { - return original.NewJobAgentsClientWithBaseURI(baseURI, subscriptionID) -} -func NewJobCredentialListResultIterator(page JobCredentialListResultPage) JobCredentialListResultIterator { - return original.NewJobCredentialListResultIterator(page) -} -func NewJobCredentialListResultPage(getNextPage func(context.Context, JobCredentialListResult) (JobCredentialListResult, error)) JobCredentialListResultPage { - return original.NewJobCredentialListResultPage(getNextPage) -} -func NewJobCredentialsClient(subscriptionID string) JobCredentialsClient { - return original.NewJobCredentialsClient(subscriptionID) -} -func NewJobCredentialsClientWithBaseURI(baseURI string, subscriptionID string) JobCredentialsClient { - return original.NewJobCredentialsClientWithBaseURI(baseURI, subscriptionID) -} -func NewJobExecutionListResultIterator(page JobExecutionListResultPage) JobExecutionListResultIterator { - return original.NewJobExecutionListResultIterator(page) -} -func NewJobExecutionListResultPage(getNextPage func(context.Context, JobExecutionListResult) (JobExecutionListResult, error)) JobExecutionListResultPage { - return original.NewJobExecutionListResultPage(getNextPage) -} -func NewJobExecutionsClient(subscriptionID string) JobExecutionsClient { - return original.NewJobExecutionsClient(subscriptionID) -} -func NewJobExecutionsClientWithBaseURI(baseURI string, subscriptionID string) JobExecutionsClient { - return original.NewJobExecutionsClientWithBaseURI(baseURI, subscriptionID) -} -func NewJobListResultIterator(page JobListResultPage) JobListResultIterator { - return original.NewJobListResultIterator(page) -} -func NewJobListResultPage(getNextPage func(context.Context, JobListResult) (JobListResult, error)) JobListResultPage { - return original.NewJobListResultPage(getNextPage) -} -func NewJobStepExecutionsClient(subscriptionID string) JobStepExecutionsClient { - return original.NewJobStepExecutionsClient(subscriptionID) -} -func NewJobStepExecutionsClientWithBaseURI(baseURI string, subscriptionID string) JobStepExecutionsClient { - return original.NewJobStepExecutionsClientWithBaseURI(baseURI, subscriptionID) -} -func NewJobStepListResultIterator(page JobStepListResultPage) JobStepListResultIterator { - return original.NewJobStepListResultIterator(page) -} -func NewJobStepListResultPage(getNextPage func(context.Context, JobStepListResult) (JobStepListResult, error)) JobStepListResultPage { - return original.NewJobStepListResultPage(getNextPage) -} -func NewJobStepsClient(subscriptionID string) JobStepsClient { - return original.NewJobStepsClient(subscriptionID) -} -func NewJobStepsClientWithBaseURI(baseURI string, subscriptionID string) JobStepsClient { - return original.NewJobStepsClientWithBaseURI(baseURI, subscriptionID) -} -func NewJobTargetExecutionsClient(subscriptionID string) JobTargetExecutionsClient { - return original.NewJobTargetExecutionsClient(subscriptionID) -} -func NewJobTargetExecutionsClientWithBaseURI(baseURI string, subscriptionID string) JobTargetExecutionsClient { - return original.NewJobTargetExecutionsClientWithBaseURI(baseURI, subscriptionID) -} -func NewJobTargetGroupListResultIterator(page JobTargetGroupListResultPage) JobTargetGroupListResultIterator { - return original.NewJobTargetGroupListResultIterator(page) -} -func NewJobTargetGroupListResultPage(getNextPage func(context.Context, JobTargetGroupListResult) (JobTargetGroupListResult, error)) JobTargetGroupListResultPage { - return original.NewJobTargetGroupListResultPage(getNextPage) -} -func NewJobTargetGroupsClient(subscriptionID string) JobTargetGroupsClient { - return original.NewJobTargetGroupsClient(subscriptionID) -} -func NewJobTargetGroupsClientWithBaseURI(baseURI string, subscriptionID string) JobTargetGroupsClient { - return original.NewJobTargetGroupsClientWithBaseURI(baseURI, subscriptionID) -} -func NewJobVersionListResultIterator(page JobVersionListResultPage) JobVersionListResultIterator { - return original.NewJobVersionListResultIterator(page) -} -func NewJobVersionListResultPage(getNextPage func(context.Context, JobVersionListResult) (JobVersionListResult, error)) JobVersionListResultPage { - return original.NewJobVersionListResultPage(getNextPage) -} -func NewJobVersionsClient(subscriptionID string) JobVersionsClient { - return original.NewJobVersionsClient(subscriptionID) -} -func NewJobVersionsClientWithBaseURI(baseURI string, subscriptionID string) JobVersionsClient { - return original.NewJobVersionsClientWithBaseURI(baseURI, subscriptionID) -} -func NewJobsClient(subscriptionID string) JobsClient { - return original.NewJobsClient(subscriptionID) -} -func NewJobsClientWithBaseURI(baseURI string, subscriptionID string) JobsClient { - return original.NewJobsClientWithBaseURI(baseURI, subscriptionID) -} -func NewLogicalServerSecurityAlertPolicyListResultIterator(page LogicalServerSecurityAlertPolicyListResultPage) LogicalServerSecurityAlertPolicyListResultIterator { - return original.NewLogicalServerSecurityAlertPolicyListResultIterator(page) -} -func NewLogicalServerSecurityAlertPolicyListResultPage(getNextPage func(context.Context, LogicalServerSecurityAlertPolicyListResult) (LogicalServerSecurityAlertPolicyListResult, error)) LogicalServerSecurityAlertPolicyListResultPage { - return original.NewLogicalServerSecurityAlertPolicyListResultPage(getNextPage) -} -func NewLongTermRetentionBackupListResultIterator(page LongTermRetentionBackupListResultPage) LongTermRetentionBackupListResultIterator { - return original.NewLongTermRetentionBackupListResultIterator(page) -} -func NewLongTermRetentionBackupListResultPage(getNextPage func(context.Context, LongTermRetentionBackupListResult) (LongTermRetentionBackupListResult, error)) LongTermRetentionBackupListResultPage { - return original.NewLongTermRetentionBackupListResultPage(getNextPage) -} -func NewLongTermRetentionBackupsClient(subscriptionID string) LongTermRetentionBackupsClient { - return original.NewLongTermRetentionBackupsClient(subscriptionID) -} -func NewLongTermRetentionBackupsClientWithBaseURI(baseURI string, subscriptionID string) LongTermRetentionBackupsClient { - return original.NewLongTermRetentionBackupsClientWithBaseURI(baseURI, subscriptionID) -} -func NewManagedBackupShortTermRetentionPoliciesClient(subscriptionID string) ManagedBackupShortTermRetentionPoliciesClient { - return original.NewManagedBackupShortTermRetentionPoliciesClient(subscriptionID) -} -func NewManagedBackupShortTermRetentionPoliciesClientWithBaseURI(baseURI string, subscriptionID string) ManagedBackupShortTermRetentionPoliciesClient { - return original.NewManagedBackupShortTermRetentionPoliciesClientWithBaseURI(baseURI, subscriptionID) -} -func NewManagedBackupShortTermRetentionPolicyListResultIterator(page ManagedBackupShortTermRetentionPolicyListResultPage) ManagedBackupShortTermRetentionPolicyListResultIterator { - return original.NewManagedBackupShortTermRetentionPolicyListResultIterator(page) -} -func NewManagedBackupShortTermRetentionPolicyListResultPage(getNextPage func(context.Context, ManagedBackupShortTermRetentionPolicyListResult) (ManagedBackupShortTermRetentionPolicyListResult, error)) ManagedBackupShortTermRetentionPolicyListResultPage { - return original.NewManagedBackupShortTermRetentionPolicyListResultPage(getNextPage) -} func NewManagedDatabaseListResultIterator(page ManagedDatabaseListResultPage) ManagedDatabaseListResultIterator { return original.NewManagedDatabaseListResultIterator(page) } @@ -1768,96 +245,24 @@ func NewManagedDatabaseRestoreDetailsClient(subscriptionID string) ManagedDataba func NewManagedDatabaseRestoreDetailsClientWithBaseURI(baseURI string, subscriptionID string) ManagedDatabaseRestoreDetailsClient { return original.NewManagedDatabaseRestoreDetailsClientWithBaseURI(baseURI, subscriptionID) } -func NewManagedDatabaseSecurityAlertPoliciesClient(subscriptionID string) ManagedDatabaseSecurityAlertPoliciesClient { - return original.NewManagedDatabaseSecurityAlertPoliciesClient(subscriptionID) -} -func NewManagedDatabaseSecurityAlertPoliciesClientWithBaseURI(baseURI string, subscriptionID string) ManagedDatabaseSecurityAlertPoliciesClient { - return original.NewManagedDatabaseSecurityAlertPoliciesClientWithBaseURI(baseURI, subscriptionID) -} -func NewManagedDatabaseSecurityAlertPolicyListResultIterator(page ManagedDatabaseSecurityAlertPolicyListResultPage) ManagedDatabaseSecurityAlertPolicyListResultIterator { - return original.NewManagedDatabaseSecurityAlertPolicyListResultIterator(page) -} -func NewManagedDatabaseSecurityAlertPolicyListResultPage(getNextPage func(context.Context, ManagedDatabaseSecurityAlertPolicyListResult) (ManagedDatabaseSecurityAlertPolicyListResult, error)) ManagedDatabaseSecurityAlertPolicyListResultPage { - return original.NewManagedDatabaseSecurityAlertPolicyListResultPage(getNextPage) -} func NewManagedDatabaseSensitivityLabelsClient(subscriptionID string) ManagedDatabaseSensitivityLabelsClient { return original.NewManagedDatabaseSensitivityLabelsClient(subscriptionID) } func NewManagedDatabaseSensitivityLabelsClientWithBaseURI(baseURI string, subscriptionID string) ManagedDatabaseSensitivityLabelsClient { return original.NewManagedDatabaseSensitivityLabelsClientWithBaseURI(baseURI, subscriptionID) } -func NewManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient(subscriptionID string) ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient { - return original.NewManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient(subscriptionID) -} -func NewManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientWithBaseURI(baseURI string, subscriptionID string) ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient { - return original.NewManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientWithBaseURI(baseURI, subscriptionID) -} -func NewManagedDatabaseVulnerabilityAssessmentScansClient(subscriptionID string) ManagedDatabaseVulnerabilityAssessmentScansClient { - return original.NewManagedDatabaseVulnerabilityAssessmentScansClient(subscriptionID) -} -func NewManagedDatabaseVulnerabilityAssessmentScansClientWithBaseURI(baseURI string, subscriptionID string) ManagedDatabaseVulnerabilityAssessmentScansClient { - return original.NewManagedDatabaseVulnerabilityAssessmentScansClientWithBaseURI(baseURI, subscriptionID) -} -func NewManagedDatabaseVulnerabilityAssessmentsClient(subscriptionID string) ManagedDatabaseVulnerabilityAssessmentsClient { - return original.NewManagedDatabaseVulnerabilityAssessmentsClient(subscriptionID) -} -func NewManagedDatabaseVulnerabilityAssessmentsClientWithBaseURI(baseURI string, subscriptionID string) ManagedDatabaseVulnerabilityAssessmentsClient { - return original.NewManagedDatabaseVulnerabilityAssessmentsClientWithBaseURI(baseURI, subscriptionID) -} func NewManagedDatabasesClient(subscriptionID string) ManagedDatabasesClient { return original.NewManagedDatabasesClient(subscriptionID) } func NewManagedDatabasesClientWithBaseURI(baseURI string, subscriptionID string) ManagedDatabasesClient { return original.NewManagedDatabasesClientWithBaseURI(baseURI, subscriptionID) } -func NewManagedInstanceAdministratorListResultIterator(page ManagedInstanceAdministratorListResultPage) ManagedInstanceAdministratorListResultIterator { - return original.NewManagedInstanceAdministratorListResultIterator(page) -} -func NewManagedInstanceAdministratorListResultPage(getNextPage func(context.Context, ManagedInstanceAdministratorListResult) (ManagedInstanceAdministratorListResult, error)) ManagedInstanceAdministratorListResultPage { - return original.NewManagedInstanceAdministratorListResultPage(getNextPage) -} -func NewManagedInstanceAdministratorsClient(subscriptionID string) ManagedInstanceAdministratorsClient { - return original.NewManagedInstanceAdministratorsClient(subscriptionID) -} -func NewManagedInstanceAdministratorsClientWithBaseURI(baseURI string, subscriptionID string) ManagedInstanceAdministratorsClient { - return original.NewManagedInstanceAdministratorsClientWithBaseURI(baseURI, subscriptionID) -} -func NewManagedInstanceEncryptionProtectorListResultIterator(page ManagedInstanceEncryptionProtectorListResultPage) ManagedInstanceEncryptionProtectorListResultIterator { - return original.NewManagedInstanceEncryptionProtectorListResultIterator(page) -} -func NewManagedInstanceEncryptionProtectorListResultPage(getNextPage func(context.Context, ManagedInstanceEncryptionProtectorListResult) (ManagedInstanceEncryptionProtectorListResult, error)) ManagedInstanceEncryptionProtectorListResultPage { - return original.NewManagedInstanceEncryptionProtectorListResultPage(getNextPage) -} -func NewManagedInstanceEncryptionProtectorsClient(subscriptionID string) ManagedInstanceEncryptionProtectorsClient { - return original.NewManagedInstanceEncryptionProtectorsClient(subscriptionID) -} -func NewManagedInstanceEncryptionProtectorsClientWithBaseURI(baseURI string, subscriptionID string) ManagedInstanceEncryptionProtectorsClient { - return original.NewManagedInstanceEncryptionProtectorsClientWithBaseURI(baseURI, subscriptionID) -} -func NewManagedInstanceKeyListResultIterator(page ManagedInstanceKeyListResultPage) ManagedInstanceKeyListResultIterator { - return original.NewManagedInstanceKeyListResultIterator(page) -} -func NewManagedInstanceKeyListResultPage(getNextPage func(context.Context, ManagedInstanceKeyListResult) (ManagedInstanceKeyListResult, error)) ManagedInstanceKeyListResultPage { - return original.NewManagedInstanceKeyListResultPage(getNextPage) -} -func NewManagedInstanceKeysClient(subscriptionID string) ManagedInstanceKeysClient { - return original.NewManagedInstanceKeysClient(subscriptionID) -} -func NewManagedInstanceKeysClientWithBaseURI(baseURI string, subscriptionID string) ManagedInstanceKeysClient { - return original.NewManagedInstanceKeysClientWithBaseURI(baseURI, subscriptionID) -} func NewManagedInstanceListResultIterator(page ManagedInstanceListResultPage) ManagedInstanceListResultIterator { return original.NewManagedInstanceListResultIterator(page) } func NewManagedInstanceListResultPage(getNextPage func(context.Context, ManagedInstanceListResult) (ManagedInstanceListResult, error)) ManagedInstanceListResultPage { return original.NewManagedInstanceListResultPage(getNextPage) } -func NewManagedInstanceTdeCertificatesClient(subscriptionID string) ManagedInstanceTdeCertificatesClient { - return original.NewManagedInstanceTdeCertificatesClient(subscriptionID) -} -func NewManagedInstanceTdeCertificatesClientWithBaseURI(baseURI string, subscriptionID string) ManagedInstanceTdeCertificatesClient { - return original.NewManagedInstanceTdeCertificatesClientWithBaseURI(baseURI, subscriptionID) -} func NewManagedInstanceVulnerabilityAssessmentListResultIterator(page ManagedInstanceVulnerabilityAssessmentListResultPage) ManagedInstanceVulnerabilityAssessmentListResultIterator { return original.NewManagedInstanceVulnerabilityAssessmentListResultIterator(page) } @@ -1876,36 +281,6 @@ func NewManagedInstancesClient(subscriptionID string) ManagedInstancesClient { func NewManagedInstancesClientWithBaseURI(baseURI string, subscriptionID string) ManagedInstancesClient { return original.NewManagedInstancesClientWithBaseURI(baseURI, subscriptionID) } -func NewManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient(subscriptionID string) ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient { - return original.NewManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient(subscriptionID) -} -func NewManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientWithBaseURI(baseURI string, subscriptionID string) ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient { - return original.NewManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientWithBaseURI(baseURI, subscriptionID) -} -func NewManagedServerSecurityAlertPoliciesClient(subscriptionID string) ManagedServerSecurityAlertPoliciesClient { - return original.NewManagedServerSecurityAlertPoliciesClient(subscriptionID) -} -func NewManagedServerSecurityAlertPoliciesClientWithBaseURI(baseURI string, subscriptionID string) ManagedServerSecurityAlertPoliciesClient { - return original.NewManagedServerSecurityAlertPoliciesClientWithBaseURI(baseURI, subscriptionID) -} -func NewManagedServerSecurityAlertPolicyListResultIterator(page ManagedServerSecurityAlertPolicyListResultPage) ManagedServerSecurityAlertPolicyListResultIterator { - return original.NewManagedServerSecurityAlertPolicyListResultIterator(page) -} -func NewManagedServerSecurityAlertPolicyListResultPage(getNextPage func(context.Context, ManagedServerSecurityAlertPolicyListResult) (ManagedServerSecurityAlertPolicyListResult, error)) ManagedServerSecurityAlertPolicyListResultPage { - return original.NewManagedServerSecurityAlertPolicyListResultPage(getNextPage) -} -func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { - return original.NewOperationListResultIterator(page) -} -func NewOperationListResultPage(getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { - return original.NewOperationListResultPage(getNextPage) -} -func NewOperationsClient(subscriptionID string) OperationsClient { - return original.NewOperationsClient(subscriptionID) -} -func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { - return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) -} func NewPrivateEndpointConnectionListResultIterator(page PrivateEndpointConnectionListResultPage) PrivateEndpointConnectionListResultIterator { return original.NewPrivateEndpointConnectionListResultIterator(page) } @@ -1918,162 +293,12 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string) PrivateEndpointC func NewPrivateEndpointConnectionsClientWithBaseURI(baseURI string, subscriptionID string) PrivateEndpointConnectionsClient { return original.NewPrivateEndpointConnectionsClientWithBaseURI(baseURI, subscriptionID) } -func NewPrivateLinkResourceListResultIterator(page PrivateLinkResourceListResultPage) PrivateLinkResourceListResultIterator { - return original.NewPrivateLinkResourceListResultIterator(page) -} -func NewPrivateLinkResourceListResultPage(getNextPage func(context.Context, PrivateLinkResourceListResult) (PrivateLinkResourceListResult, error)) PrivateLinkResourceListResultPage { - return original.NewPrivateLinkResourceListResultPage(getNextPage) -} -func NewPrivateLinkResourcesClient(subscriptionID string) PrivateLinkResourcesClient { - return original.NewPrivateLinkResourcesClient(subscriptionID) -} -func NewPrivateLinkResourcesClientWithBaseURI(baseURI string, subscriptionID string) PrivateLinkResourcesClient { - return original.NewPrivateLinkResourcesClientWithBaseURI(baseURI, subscriptionID) -} -func NewRecommendedElasticPoolsClient(subscriptionID string) RecommendedElasticPoolsClient { - return original.NewRecommendedElasticPoolsClient(subscriptionID) -} -func NewRecommendedElasticPoolsClientWithBaseURI(baseURI string, subscriptionID string) RecommendedElasticPoolsClient { - return original.NewRecommendedElasticPoolsClientWithBaseURI(baseURI, subscriptionID) -} -func NewRecoverableDatabasesClient(subscriptionID string) RecoverableDatabasesClient { - return original.NewRecoverableDatabasesClient(subscriptionID) -} -func NewRecoverableDatabasesClientWithBaseURI(baseURI string, subscriptionID string) RecoverableDatabasesClient { - return original.NewRecoverableDatabasesClientWithBaseURI(baseURI, subscriptionID) -} -func NewRecoverableManagedDatabaseListResultIterator(page RecoverableManagedDatabaseListResultPage) RecoverableManagedDatabaseListResultIterator { - return original.NewRecoverableManagedDatabaseListResultIterator(page) -} -func NewRecoverableManagedDatabaseListResultPage(getNextPage func(context.Context, RecoverableManagedDatabaseListResult) (RecoverableManagedDatabaseListResult, error)) RecoverableManagedDatabaseListResultPage { - return original.NewRecoverableManagedDatabaseListResultPage(getNextPage) -} -func NewRecoverableManagedDatabasesClient(subscriptionID string) RecoverableManagedDatabasesClient { - return original.NewRecoverableManagedDatabasesClient(subscriptionID) -} -func NewRecoverableManagedDatabasesClientWithBaseURI(baseURI string, subscriptionID string) RecoverableManagedDatabasesClient { - return original.NewRecoverableManagedDatabasesClientWithBaseURI(baseURI, subscriptionID) -} -func NewReplicationLinksClient(subscriptionID string) ReplicationLinksClient { - return original.NewReplicationLinksClient(subscriptionID) -} -func NewReplicationLinksClientWithBaseURI(baseURI string, subscriptionID string) ReplicationLinksClient { - return original.NewReplicationLinksClientWithBaseURI(baseURI, subscriptionID) -} -func NewRestorableDroppedDatabasesClient(subscriptionID string) RestorableDroppedDatabasesClient { - return original.NewRestorableDroppedDatabasesClient(subscriptionID) -} -func NewRestorableDroppedDatabasesClientWithBaseURI(baseURI string, subscriptionID string) RestorableDroppedDatabasesClient { - return original.NewRestorableDroppedDatabasesClientWithBaseURI(baseURI, subscriptionID) -} -func NewRestorableDroppedManagedDatabaseListResultIterator(page RestorableDroppedManagedDatabaseListResultPage) RestorableDroppedManagedDatabaseListResultIterator { - return original.NewRestorableDroppedManagedDatabaseListResultIterator(page) -} -func NewRestorableDroppedManagedDatabaseListResultPage(getNextPage func(context.Context, RestorableDroppedManagedDatabaseListResult) (RestorableDroppedManagedDatabaseListResult, error)) RestorableDroppedManagedDatabaseListResultPage { - return original.NewRestorableDroppedManagedDatabaseListResultPage(getNextPage) -} -func NewRestorableDroppedManagedDatabasesClient(subscriptionID string) RestorableDroppedManagedDatabasesClient { - return original.NewRestorableDroppedManagedDatabasesClient(subscriptionID) -} -func NewRestorableDroppedManagedDatabasesClientWithBaseURI(baseURI string, subscriptionID string) RestorableDroppedManagedDatabasesClient { - return original.NewRestorableDroppedManagedDatabasesClientWithBaseURI(baseURI, subscriptionID) -} -func NewRestorePointsClient(subscriptionID string) RestorePointsClient { - return original.NewRestorePointsClient(subscriptionID) -} -func NewRestorePointsClientWithBaseURI(baseURI string, subscriptionID string) RestorePointsClient { - return original.NewRestorePointsClientWithBaseURI(baseURI, subscriptionID) -} func NewSensitivityLabelListResultIterator(page SensitivityLabelListResultPage) SensitivityLabelListResultIterator { return original.NewSensitivityLabelListResultIterator(page) } func NewSensitivityLabelListResultPage(getNextPage func(context.Context, SensitivityLabelListResult) (SensitivityLabelListResult, error)) SensitivityLabelListResultPage { return original.NewSensitivityLabelListResultPage(getNextPage) } -func NewSensitivityLabelsClient(subscriptionID string) SensitivityLabelsClient { - return original.NewSensitivityLabelsClient(subscriptionID) -} -func NewSensitivityLabelsClientWithBaseURI(baseURI string, subscriptionID string) SensitivityLabelsClient { - return original.NewSensitivityLabelsClientWithBaseURI(baseURI, subscriptionID) -} -func NewServerAutomaticTuningClient(subscriptionID string) ServerAutomaticTuningClient { - return original.NewServerAutomaticTuningClient(subscriptionID) -} -func NewServerAutomaticTuningClientWithBaseURI(baseURI string, subscriptionID string) ServerAutomaticTuningClient { - return original.NewServerAutomaticTuningClientWithBaseURI(baseURI, subscriptionID) -} -func NewServerAzureADAdministratorsClient(subscriptionID string) ServerAzureADAdministratorsClient { - return original.NewServerAzureADAdministratorsClient(subscriptionID) -} -func NewServerAzureADAdministratorsClientWithBaseURI(baseURI string, subscriptionID string) ServerAzureADAdministratorsClient { - return original.NewServerAzureADAdministratorsClientWithBaseURI(baseURI, subscriptionID) -} -func NewServerBlobAuditingPoliciesClient(subscriptionID string) ServerBlobAuditingPoliciesClient { - return original.NewServerBlobAuditingPoliciesClient(subscriptionID) -} -func NewServerBlobAuditingPoliciesClientWithBaseURI(baseURI string, subscriptionID string) ServerBlobAuditingPoliciesClient { - return original.NewServerBlobAuditingPoliciesClientWithBaseURI(baseURI, subscriptionID) -} -func NewServerBlobAuditingPolicyListResultIterator(page ServerBlobAuditingPolicyListResultPage) ServerBlobAuditingPolicyListResultIterator { - return original.NewServerBlobAuditingPolicyListResultIterator(page) -} -func NewServerBlobAuditingPolicyListResultPage(getNextPage func(context.Context, ServerBlobAuditingPolicyListResult) (ServerBlobAuditingPolicyListResult, error)) ServerBlobAuditingPolicyListResultPage { - return original.NewServerBlobAuditingPolicyListResultPage(getNextPage) -} -func NewServerCommunicationLinksClient(subscriptionID string) ServerCommunicationLinksClient { - return original.NewServerCommunicationLinksClient(subscriptionID) -} -func NewServerCommunicationLinksClientWithBaseURI(baseURI string, subscriptionID string) ServerCommunicationLinksClient { - return original.NewServerCommunicationLinksClientWithBaseURI(baseURI, subscriptionID) -} -func NewServerConnectionPoliciesClient(subscriptionID string) ServerConnectionPoliciesClient { - return original.NewServerConnectionPoliciesClient(subscriptionID) -} -func NewServerConnectionPoliciesClientWithBaseURI(baseURI string, subscriptionID string) ServerConnectionPoliciesClient { - return original.NewServerConnectionPoliciesClientWithBaseURI(baseURI, subscriptionID) -} -func NewServerDNSAliasListResultIterator(page ServerDNSAliasListResultPage) ServerDNSAliasListResultIterator { - return original.NewServerDNSAliasListResultIterator(page) -} -func NewServerDNSAliasListResultPage(getNextPage func(context.Context, ServerDNSAliasListResult) (ServerDNSAliasListResult, error)) ServerDNSAliasListResultPage { - return original.NewServerDNSAliasListResultPage(getNextPage) -} -func NewServerDNSAliasesClient(subscriptionID string) ServerDNSAliasesClient { - return original.NewServerDNSAliasesClient(subscriptionID) -} -func NewServerDNSAliasesClientWithBaseURI(baseURI string, subscriptionID string) ServerDNSAliasesClient { - return original.NewServerDNSAliasesClientWithBaseURI(baseURI, subscriptionID) -} -func NewServerKeyListResultIterator(page ServerKeyListResultPage) ServerKeyListResultIterator { - return original.NewServerKeyListResultIterator(page) -} -func NewServerKeyListResultPage(getNextPage func(context.Context, ServerKeyListResult) (ServerKeyListResult, error)) ServerKeyListResultPage { - return original.NewServerKeyListResultPage(getNextPage) -} -func NewServerKeysClient(subscriptionID string) ServerKeysClient { - return original.NewServerKeysClient(subscriptionID) -} -func NewServerKeysClientWithBaseURI(baseURI string, subscriptionID string) ServerKeysClient { - return original.NewServerKeysClientWithBaseURI(baseURI, subscriptionID) -} -func NewServerListResultIterator(page ServerListResultPage) ServerListResultIterator { - return original.NewServerListResultIterator(page) -} -func NewServerListResultPage(getNextPage func(context.Context, ServerListResult) (ServerListResult, error)) ServerListResultPage { - return original.NewServerListResultPage(getNextPage) -} -func NewServerSecurityAlertPoliciesClient(subscriptionID string) ServerSecurityAlertPoliciesClient { - return original.NewServerSecurityAlertPoliciesClient(subscriptionID) -} -func NewServerSecurityAlertPoliciesClientWithBaseURI(baseURI string, subscriptionID string) ServerSecurityAlertPoliciesClient { - return original.NewServerSecurityAlertPoliciesClientWithBaseURI(baseURI, subscriptionID) -} -func NewServerUsagesClient(subscriptionID string) ServerUsagesClient { - return original.NewServerUsagesClient(subscriptionID) -} -func NewServerUsagesClientWithBaseURI(baseURI string, subscriptionID string) ServerUsagesClient { - return original.NewServerUsagesClientWithBaseURI(baseURI, subscriptionID) -} func NewServerVulnerabilityAssessmentListResultIterator(page ServerVulnerabilityAssessmentListResultPage) ServerVulnerabilityAssessmentListResultIterator { return original.NewServerVulnerabilityAssessmentListResultIterator(page) } @@ -2086,114 +311,6 @@ func NewServerVulnerabilityAssessmentsClient(subscriptionID string) ServerVulner func NewServerVulnerabilityAssessmentsClientWithBaseURI(baseURI string, subscriptionID string) ServerVulnerabilityAssessmentsClient { return original.NewServerVulnerabilityAssessmentsClientWithBaseURI(baseURI, subscriptionID) } -func NewServersClient(subscriptionID string) ServersClient { - return original.NewServersClient(subscriptionID) -} -func NewServersClientWithBaseURI(baseURI string, subscriptionID string) ServersClient { - return original.NewServersClientWithBaseURI(baseURI, subscriptionID) -} -func NewServiceObjectivesClient(subscriptionID string) ServiceObjectivesClient { - return original.NewServiceObjectivesClient(subscriptionID) -} -func NewServiceObjectivesClientWithBaseURI(baseURI string, subscriptionID string) ServiceObjectivesClient { - return original.NewServiceObjectivesClientWithBaseURI(baseURI, subscriptionID) -} -func NewServiceTierAdvisorsClient(subscriptionID string) ServiceTierAdvisorsClient { - return original.NewServiceTierAdvisorsClient(subscriptionID) -} -func NewServiceTierAdvisorsClientWithBaseURI(baseURI string, subscriptionID string) ServiceTierAdvisorsClient { - return original.NewServiceTierAdvisorsClientWithBaseURI(baseURI, subscriptionID) -} -func NewSubscriptionUsageListResultIterator(page SubscriptionUsageListResultPage) SubscriptionUsageListResultIterator { - return original.NewSubscriptionUsageListResultIterator(page) -} -func NewSubscriptionUsageListResultPage(getNextPage func(context.Context, SubscriptionUsageListResult) (SubscriptionUsageListResult, error)) SubscriptionUsageListResultPage { - return original.NewSubscriptionUsageListResultPage(getNextPage) -} -func NewSubscriptionUsagesClient(subscriptionID string) SubscriptionUsagesClient { - return original.NewSubscriptionUsagesClient(subscriptionID) -} -func NewSubscriptionUsagesClientWithBaseURI(baseURI string, subscriptionID string) SubscriptionUsagesClient { - return original.NewSubscriptionUsagesClientWithBaseURI(baseURI, subscriptionID) -} -func NewSyncAgentLinkedDatabaseListResultIterator(page SyncAgentLinkedDatabaseListResultPage) SyncAgentLinkedDatabaseListResultIterator { - return original.NewSyncAgentLinkedDatabaseListResultIterator(page) -} -func NewSyncAgentLinkedDatabaseListResultPage(getNextPage func(context.Context, SyncAgentLinkedDatabaseListResult) (SyncAgentLinkedDatabaseListResult, error)) SyncAgentLinkedDatabaseListResultPage { - return original.NewSyncAgentLinkedDatabaseListResultPage(getNextPage) -} -func NewSyncAgentListResultIterator(page SyncAgentListResultPage) SyncAgentListResultIterator { - return original.NewSyncAgentListResultIterator(page) -} -func NewSyncAgentListResultPage(getNextPage func(context.Context, SyncAgentListResult) (SyncAgentListResult, error)) SyncAgentListResultPage { - return original.NewSyncAgentListResultPage(getNextPage) -} -func NewSyncAgentsClient(subscriptionID string) SyncAgentsClient { - return original.NewSyncAgentsClient(subscriptionID) -} -func NewSyncAgentsClientWithBaseURI(baseURI string, subscriptionID string) SyncAgentsClient { - return original.NewSyncAgentsClientWithBaseURI(baseURI, subscriptionID) -} -func NewSyncDatabaseIDListResultIterator(page SyncDatabaseIDListResultPage) SyncDatabaseIDListResultIterator { - return original.NewSyncDatabaseIDListResultIterator(page) -} -func NewSyncDatabaseIDListResultPage(getNextPage func(context.Context, SyncDatabaseIDListResult) (SyncDatabaseIDListResult, error)) SyncDatabaseIDListResultPage { - return original.NewSyncDatabaseIDListResultPage(getNextPage) -} -func NewSyncFullSchemaPropertiesListResultIterator(page SyncFullSchemaPropertiesListResultPage) SyncFullSchemaPropertiesListResultIterator { - return original.NewSyncFullSchemaPropertiesListResultIterator(page) -} -func NewSyncFullSchemaPropertiesListResultPage(getNextPage func(context.Context, SyncFullSchemaPropertiesListResult) (SyncFullSchemaPropertiesListResult, error)) SyncFullSchemaPropertiesListResultPage { - return original.NewSyncFullSchemaPropertiesListResultPage(getNextPage) -} -func NewSyncGroupListResultIterator(page SyncGroupListResultPage) SyncGroupListResultIterator { - return original.NewSyncGroupListResultIterator(page) -} -func NewSyncGroupListResultPage(getNextPage func(context.Context, SyncGroupListResult) (SyncGroupListResult, error)) SyncGroupListResultPage { - return original.NewSyncGroupListResultPage(getNextPage) -} -func NewSyncGroupLogListResultIterator(page SyncGroupLogListResultPage) SyncGroupLogListResultIterator { - return original.NewSyncGroupLogListResultIterator(page) -} -func NewSyncGroupLogListResultPage(getNextPage func(context.Context, SyncGroupLogListResult) (SyncGroupLogListResult, error)) SyncGroupLogListResultPage { - return original.NewSyncGroupLogListResultPage(getNextPage) -} -func NewSyncGroupsClient(subscriptionID string) SyncGroupsClient { - return original.NewSyncGroupsClient(subscriptionID) -} -func NewSyncGroupsClientWithBaseURI(baseURI string, subscriptionID string) SyncGroupsClient { - return original.NewSyncGroupsClientWithBaseURI(baseURI, subscriptionID) -} -func NewSyncMemberListResultIterator(page SyncMemberListResultPage) SyncMemberListResultIterator { - return original.NewSyncMemberListResultIterator(page) -} -func NewSyncMemberListResultPage(getNextPage func(context.Context, SyncMemberListResult) (SyncMemberListResult, error)) SyncMemberListResultPage { - return original.NewSyncMemberListResultPage(getNextPage) -} -func NewSyncMembersClient(subscriptionID string) SyncMembersClient { - return original.NewSyncMembersClient(subscriptionID) -} -func NewSyncMembersClientWithBaseURI(baseURI string, subscriptionID string) SyncMembersClient { - return original.NewSyncMembersClientWithBaseURI(baseURI, subscriptionID) -} -func NewTdeCertificatesClient(subscriptionID string) TdeCertificatesClient { - return original.NewTdeCertificatesClient(subscriptionID) -} -func NewTdeCertificatesClientWithBaseURI(baseURI string, subscriptionID string) TdeCertificatesClient { - return original.NewTdeCertificatesClientWithBaseURI(baseURI, subscriptionID) -} -func NewTransparentDataEncryptionActivitiesClient(subscriptionID string) TransparentDataEncryptionActivitiesClient { - return original.NewTransparentDataEncryptionActivitiesClient(subscriptionID) -} -func NewTransparentDataEncryptionActivitiesClientWithBaseURI(baseURI string, subscriptionID string) TransparentDataEncryptionActivitiesClient { - return original.NewTransparentDataEncryptionActivitiesClientWithBaseURI(baseURI, subscriptionID) -} -func NewTransparentDataEncryptionsClient(subscriptionID string) TransparentDataEncryptionsClient { - return original.NewTransparentDataEncryptionsClient(subscriptionID) -} -func NewTransparentDataEncryptionsClientWithBaseURI(baseURI string, subscriptionID string) TransparentDataEncryptionsClient { - return original.NewTransparentDataEncryptionsClientWithBaseURI(baseURI, subscriptionID) -} func NewUsageListResultIterator(page UsageListResultPage) UsageListResultIterator { return original.NewUsageListResultIterator(page) } @@ -2206,153 +323,18 @@ func NewUsagesClient(subscriptionID string) UsagesClient { func NewUsagesClientWithBaseURI(baseURI string, subscriptionID string) UsagesClient { return original.NewUsagesClientWithBaseURI(baseURI, subscriptionID) } -func NewVirtualClusterListResultIterator(page VirtualClusterListResultPage) VirtualClusterListResultIterator { - return original.NewVirtualClusterListResultIterator(page) -} -func NewVirtualClusterListResultPage(getNextPage func(context.Context, VirtualClusterListResult) (VirtualClusterListResult, error)) VirtualClusterListResultPage { - return original.NewVirtualClusterListResultPage(getNextPage) -} -func NewVirtualClustersClient(subscriptionID string) VirtualClustersClient { - return original.NewVirtualClustersClient(subscriptionID) -} -func NewVirtualClustersClientWithBaseURI(baseURI string, subscriptionID string) VirtualClustersClient { - return original.NewVirtualClustersClientWithBaseURI(baseURI, subscriptionID) -} -func NewVirtualNetworkRuleListResultIterator(page VirtualNetworkRuleListResultPage) VirtualNetworkRuleListResultIterator { - return original.NewVirtualNetworkRuleListResultIterator(page) -} -func NewVirtualNetworkRuleListResultPage(getNextPage func(context.Context, VirtualNetworkRuleListResult) (VirtualNetworkRuleListResult, error)) VirtualNetworkRuleListResultPage { - return original.NewVirtualNetworkRuleListResultPage(getNextPage) -} -func NewVirtualNetworkRulesClient(subscriptionID string) VirtualNetworkRulesClient { - return original.NewVirtualNetworkRulesClient(subscriptionID) -} -func NewVirtualNetworkRulesClientWithBaseURI(baseURI string, subscriptionID string) VirtualNetworkRulesClient { - return original.NewVirtualNetworkRulesClientWithBaseURI(baseURI, subscriptionID) -} -func NewVulnerabilityAssessmentScanRecordListResultIterator(page VulnerabilityAssessmentScanRecordListResultPage) VulnerabilityAssessmentScanRecordListResultIterator { - return original.NewVulnerabilityAssessmentScanRecordListResultIterator(page) -} -func NewVulnerabilityAssessmentScanRecordListResultPage(getNextPage func(context.Context, VulnerabilityAssessmentScanRecordListResult) (VulnerabilityAssessmentScanRecordListResult, error)) VulnerabilityAssessmentScanRecordListResultPage { - return original.NewVulnerabilityAssessmentScanRecordListResultPage(getNextPage) -} func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { return original.NewWithBaseURI(baseURI, subscriptionID) } -func PossibleAuthenticationTypeValues() []AuthenticationType { - return original.PossibleAuthenticationTypeValues() -} -func PossibleAutomaticTuningDisabledReasonValues() []AutomaticTuningDisabledReason { - return original.PossibleAutomaticTuningDisabledReasonValues() -} -func PossibleAutomaticTuningModeValues() []AutomaticTuningMode { - return original.PossibleAutomaticTuningModeValues() -} -func PossibleAutomaticTuningOptionModeActualValues() []AutomaticTuningOptionModeActual { - return original.PossibleAutomaticTuningOptionModeActualValues() -} -func PossibleAutomaticTuningOptionModeDesiredValues() []AutomaticTuningOptionModeDesired { - return original.PossibleAutomaticTuningOptionModeDesiredValues() -} -func PossibleAutomaticTuningServerModeValues() []AutomaticTuningServerMode { - return original.PossibleAutomaticTuningServerModeValues() -} -func PossibleAutomaticTuningServerReasonValues() []AutomaticTuningServerReason { - return original.PossibleAutomaticTuningServerReasonValues() -} -func PossibleBlobAuditingPolicyStateValues() []BlobAuditingPolicyState { - return original.PossibleBlobAuditingPolicyStateValues() -} -func PossibleCapabilityGroupValues() []CapabilityGroup { - return original.PossibleCapabilityGroupValues() -} -func PossibleCapabilityStatusValues() []CapabilityStatus { - return original.PossibleCapabilityStatusValues() -} func PossibleCatalogCollationTypeValues() []CatalogCollationType { return original.PossibleCatalogCollationTypeValues() } -func PossibleCheckNameAvailabilityReasonValues() []CheckNameAvailabilityReason { - return original.PossibleCheckNameAvailabilityReasonValues() -} -func PossibleCreateModeValues() []CreateMode { - return original.PossibleCreateModeValues() -} -func PossibleDataMaskingFunctionValues() []DataMaskingFunction { - return original.PossibleDataMaskingFunctionValues() -} -func PossibleDataMaskingRuleStateValues() []DataMaskingRuleState { - return original.PossibleDataMaskingRuleStateValues() -} -func PossibleDataMaskingStateValues() []DataMaskingState { - return original.PossibleDataMaskingStateValues() -} -func PossibleDatabaseEditionValues() []DatabaseEdition { - return original.PossibleDatabaseEditionValues() -} -func PossibleDatabaseLicenseTypeValues() []DatabaseLicenseType { - return original.PossibleDatabaseLicenseTypeValues() -} -func PossibleDatabaseReadScaleValues() []DatabaseReadScale { - return original.PossibleDatabaseReadScaleValues() -} -func PossibleDatabaseStatusValues() []DatabaseStatus { - return original.PossibleDatabaseStatusValues() -} -func PossibleElasticPoolEditionValues() []ElasticPoolEdition { - return original.PossibleElasticPoolEditionValues() -} -func PossibleElasticPoolLicenseTypeValues() []ElasticPoolLicenseType { - return original.PossibleElasticPoolLicenseTypeValues() -} -func PossibleElasticPoolStateValues() []ElasticPoolState { - return original.PossibleElasticPoolStateValues() -} -func PossibleFailoverGroupReplicationRoleValues() []FailoverGroupReplicationRole { - return original.PossibleFailoverGroupReplicationRoleValues() -} -func PossibleGeoBackupPolicyStateValues() []GeoBackupPolicyState { - return original.PossibleGeoBackupPolicyStateValues() -} func PossibleIdentityTypeValues() []IdentityType { return original.PossibleIdentityTypeValues() } -func PossibleInstanceFailoverGroupReplicationRoleValues() []InstanceFailoverGroupReplicationRole { - return original.PossibleInstanceFailoverGroupReplicationRoleValues() -} func PossibleInstancePoolLicenseTypeValues() []InstancePoolLicenseType { return original.PossibleInstancePoolLicenseTypeValues() } -func PossibleJobAgentStateValues() []JobAgentState { - return original.PossibleJobAgentStateValues() -} -func PossibleJobExecutionLifecycleValues() []JobExecutionLifecycle { - return original.PossibleJobExecutionLifecycleValues() -} -func PossibleJobScheduleTypeValues() []JobScheduleType { - return original.PossibleJobScheduleTypeValues() -} -func PossibleJobStepActionSourceValues() []JobStepActionSource { - return original.PossibleJobStepActionSourceValues() -} -func PossibleJobStepActionTypeValues() []JobStepActionType { - return original.PossibleJobStepActionTypeValues() -} -func PossibleJobStepOutputTypeValues() []JobStepOutputType { - return original.PossibleJobStepOutputTypeValues() -} -func PossibleJobTargetGroupMembershipTypeValues() []JobTargetGroupMembershipType { - return original.PossibleJobTargetGroupMembershipTypeValues() -} -func PossibleJobTargetTypeValues() []JobTargetType { - return original.PossibleJobTargetTypeValues() -} -func PossibleLogSizeUnitValues() []LogSizeUnit { - return original.PossibleLogSizeUnitValues() -} -func PossibleLongTermRetentionDatabaseStateValues() []LongTermRetentionDatabaseState { - return original.PossibleLongTermRetentionDatabaseStateValues() -} func PossibleManagedDatabaseCreateModeValues() []ManagedDatabaseCreateMode { return original.PossibleManagedDatabaseCreateModeValues() } @@ -2368,120 +350,12 @@ func PossibleManagedInstanceProxyOverrideValues() []ManagedInstanceProxyOverride func PossibleManagedServerCreateModeValues() []ManagedServerCreateMode { return original.PossibleManagedServerCreateModeValues() } -func PossibleManagementOperationStateValues() []ManagementOperationState { - return original.PossibleManagementOperationStateValues() -} -func PossibleMaxSizeUnitValues() []MaxSizeUnit { - return original.PossibleMaxSizeUnitValues() -} -func PossibleOperationOriginValues() []OperationOrigin { - return original.PossibleOperationOriginValues() -} -func PossiblePerformanceLevelUnitValues() []PerformanceLevelUnit { - return original.PossiblePerformanceLevelUnitValues() -} -func PossiblePrimaryAggregationTypeValues() []PrimaryAggregationType { - return original.PossiblePrimaryAggregationTypeValues() -} -func PossibleProvisioningStateValues() []ProvisioningState { - return original.PossibleProvisioningStateValues() -} -func PossibleReadOnlyEndpointFailoverPolicyValues() []ReadOnlyEndpointFailoverPolicy { - return original.PossibleReadOnlyEndpointFailoverPolicyValues() -} -func PossibleReadWriteEndpointFailoverPolicyValues() []ReadWriteEndpointFailoverPolicy { - return original.PossibleReadWriteEndpointFailoverPolicyValues() -} -func PossibleRecommendedIndexActionValues() []RecommendedIndexAction { - return original.PossibleRecommendedIndexActionValues() -} -func PossibleRecommendedIndexStateValues() []RecommendedIndexState { - return original.PossibleRecommendedIndexStateValues() -} -func PossibleRecommendedIndexTypeValues() []RecommendedIndexType { - return original.PossibleRecommendedIndexTypeValues() -} -func PossibleReplicationRoleValues() []ReplicationRole { - return original.PossibleReplicationRoleValues() -} -func PossibleReplicationStateValues() []ReplicationState { - return original.PossibleReplicationStateValues() -} -func PossibleRestorePointTypeValues() []RestorePointType { - return original.PossibleRestorePointTypeValues() -} -func PossibleSampleNameValues() []SampleName { - return original.PossibleSampleNameValues() -} -func PossibleSecurityAlertPolicyEmailAccountAdminsValues() []SecurityAlertPolicyEmailAccountAdmins { - return original.PossibleSecurityAlertPolicyEmailAccountAdminsValues() -} func PossibleSecurityAlertPolicyStateValues() []SecurityAlertPolicyState { return original.PossibleSecurityAlertPolicyStateValues() } -func PossibleSecurityAlertPolicyUseServerDefaultValues() []SecurityAlertPolicyUseServerDefault { - return original.PossibleSecurityAlertPolicyUseServerDefaultValues() -} func PossibleSensitivityLabelSourceValues() []SensitivityLabelSource { return original.PossibleSensitivityLabelSourceValues() } -func PossibleServerConnectionTypeValues() []ServerConnectionType { - return original.PossibleServerConnectionTypeValues() -} -func PossibleServerKeyTypeValues() []ServerKeyType { - return original.PossibleServerKeyTypeValues() -} -func PossibleServiceObjectiveNameValues() []ServiceObjectiveName { - return original.PossibleServiceObjectiveNameValues() -} -func PossibleStorageKeyTypeValues() []StorageKeyType { - return original.PossibleStorageKeyTypeValues() -} -func PossibleSyncAgentStateValues() []SyncAgentState { - return original.PossibleSyncAgentStateValues() -} -func PossibleSyncConflictResolutionPolicyValues() []SyncConflictResolutionPolicy { - return original.PossibleSyncConflictResolutionPolicyValues() -} -func PossibleSyncDirectionValues() []SyncDirection { - return original.PossibleSyncDirectionValues() -} -func PossibleSyncGroupLogTypeValues() []SyncGroupLogType { - return original.PossibleSyncGroupLogTypeValues() -} -func PossibleSyncGroupStateValues() []SyncGroupState { - return original.PossibleSyncGroupStateValues() -} -func PossibleSyncMemberDbTypeValues() []SyncMemberDbType { - return original.PossibleSyncMemberDbTypeValues() -} -func PossibleSyncMemberStateValues() []SyncMemberState { - return original.PossibleSyncMemberStateValues() -} -func PossibleTransparentDataEncryptionActivityStatusValues() []TransparentDataEncryptionActivityStatus { - return original.PossibleTransparentDataEncryptionActivityStatusValues() -} -func PossibleTransparentDataEncryptionStatusValues() []TransparentDataEncryptionStatus { - return original.PossibleTransparentDataEncryptionStatusValues() -} -func PossibleUnitDefinitionTypeValues() []UnitDefinitionType { - return original.PossibleUnitDefinitionTypeValues() -} -func PossibleUnitTypeValues() []UnitType { - return original.PossibleUnitTypeValues() -} -func PossibleVirtualNetworkRuleStateValues() []VirtualNetworkRuleState { - return original.PossibleVirtualNetworkRuleStateValues() -} -func PossibleVulnerabilityAssessmentPolicyBaselineNameValues() []VulnerabilityAssessmentPolicyBaselineName { - return original.PossibleVulnerabilityAssessmentPolicyBaselineNameValues() -} -func PossibleVulnerabilityAssessmentScanStateValues() []VulnerabilityAssessmentScanState { - return original.PossibleVulnerabilityAssessmentScanStateValues() -} -func PossibleVulnerabilityAssessmentScanTriggerTypeValues() []VulnerabilityAssessmentScanTriggerType { - return original.PossibleVulnerabilityAssessmentScanTriggerTypeValues() -} func UserAgent() string { return original.UserAgent() + " profiles/preview" } diff --git a/profiles/preview/preview/sql/mgmt/sql/sqlapi/models.go b/profiles/preview/preview/sql/mgmt/sql/sqlapi/models.go index 7692ddf3961e..46419e0025a9 100644 --- a/profiles/preview/preview/sql/mgmt/sql/sqlapi/models.go +++ b/profiles/preview/preview/sql/mgmt/sql/sqlapi/models.go @@ -19,91 +19,17 @@ package sqlapi -import original "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2018-06-15-preview/sql/sqlapi" +import original "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2018-06-01-preview/sql/sqlapi" -type BackupLongTermRetentionPoliciesClientAPI = original.BackupLongTermRetentionPoliciesClientAPI -type BackupShortTermRetentionPoliciesClientAPI = original.BackupShortTermRetentionPoliciesClientAPI -type CapabilitiesClientAPI = original.CapabilitiesClientAPI -type DataMaskingPoliciesClientAPI = original.DataMaskingPoliciesClientAPI -type DataMaskingRulesClientAPI = original.DataMaskingRulesClientAPI -type DatabaseAutomaticTuningClientAPI = original.DatabaseAutomaticTuningClientAPI -type DatabaseBlobAuditingPoliciesClientAPI = original.DatabaseBlobAuditingPoliciesClientAPI -type DatabaseOperationsClientAPI = original.DatabaseOperationsClientAPI -type DatabaseThreatDetectionPoliciesClientAPI = original.DatabaseThreatDetectionPoliciesClientAPI -type DatabaseUsagesClientAPI = original.DatabaseUsagesClientAPI -type DatabaseVulnerabilityAssessmentRuleBaselinesClientAPI = original.DatabaseVulnerabilityAssessmentRuleBaselinesClientAPI -type DatabaseVulnerabilityAssessmentScansClientAPI = original.DatabaseVulnerabilityAssessmentScansClientAPI -type DatabaseVulnerabilityAssessmentsClientAPI = original.DatabaseVulnerabilityAssessmentsClientAPI +type DatabaseSecurityAlertPoliciesClientAPI = original.DatabaseSecurityAlertPoliciesClientAPI type DatabasesClientAPI = original.DatabasesClientAPI -type ElasticPoolActivitiesClientAPI = original.ElasticPoolActivitiesClientAPI -type ElasticPoolDatabaseActivitiesClientAPI = original.ElasticPoolDatabaseActivitiesClientAPI -type ElasticPoolOperationsClientAPI = original.ElasticPoolOperationsClientAPI type ElasticPoolsClientAPI = original.ElasticPoolsClientAPI -type EncryptionProtectorsClientAPI = original.EncryptionProtectorsClientAPI -type ExtendedDatabaseBlobAuditingPoliciesClientAPI = original.ExtendedDatabaseBlobAuditingPoliciesClientAPI -type ExtendedServerBlobAuditingPoliciesClientAPI = original.ExtendedServerBlobAuditingPoliciesClientAPI -type FailoverGroupsClientAPI = original.FailoverGroupsClientAPI -type FirewallRulesClientAPI = original.FirewallRulesClientAPI -type GeoBackupPoliciesClientAPI = original.GeoBackupPoliciesClientAPI -type InstanceFailoverGroupsClientAPI = original.InstanceFailoverGroupsClientAPI type InstancePoolsClientAPI = original.InstancePoolsClientAPI -type JobAgentsClientAPI = original.JobAgentsClientAPI -type JobCredentialsClientAPI = original.JobCredentialsClientAPI -type JobExecutionsClientAPI = original.JobExecutionsClientAPI -type JobStepExecutionsClientAPI = original.JobStepExecutionsClientAPI -type JobStepsClientAPI = original.JobStepsClientAPI -type JobTargetExecutionsClientAPI = original.JobTargetExecutionsClientAPI -type JobTargetGroupsClientAPI = original.JobTargetGroupsClientAPI -type JobVersionsClientAPI = original.JobVersionsClientAPI -type JobsClientAPI = original.JobsClientAPI -type LongTermRetentionBackupsClientAPI = original.LongTermRetentionBackupsClientAPI -type ManagedBackupShortTermRetentionPoliciesClientAPI = original.ManagedBackupShortTermRetentionPoliciesClientAPI type ManagedDatabaseRestoreDetailsClientAPI = original.ManagedDatabaseRestoreDetailsClientAPI -type ManagedDatabaseSecurityAlertPoliciesClientAPI = original.ManagedDatabaseSecurityAlertPoliciesClientAPI type ManagedDatabaseSensitivityLabelsClientAPI = original.ManagedDatabaseSensitivityLabelsClientAPI -type ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientAPI = original.ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientAPI -type ManagedDatabaseVulnerabilityAssessmentScansClientAPI = original.ManagedDatabaseVulnerabilityAssessmentScansClientAPI -type ManagedDatabaseVulnerabilityAssessmentsClientAPI = original.ManagedDatabaseVulnerabilityAssessmentsClientAPI type ManagedDatabasesClientAPI = original.ManagedDatabasesClientAPI -type ManagedInstanceAdministratorsClientAPI = original.ManagedInstanceAdministratorsClientAPI -type ManagedInstanceEncryptionProtectorsClientAPI = original.ManagedInstanceEncryptionProtectorsClientAPI -type ManagedInstanceKeysClientAPI = original.ManagedInstanceKeysClientAPI -type ManagedInstanceTdeCertificatesClientAPI = original.ManagedInstanceTdeCertificatesClientAPI type ManagedInstanceVulnerabilityAssessmentsClientAPI = original.ManagedInstanceVulnerabilityAssessmentsClientAPI type ManagedInstancesClientAPI = original.ManagedInstancesClientAPI -type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientAPI = original.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientAPI -type ManagedServerSecurityAlertPoliciesClientAPI = original.ManagedServerSecurityAlertPoliciesClientAPI -type OperationsClientAPI = original.OperationsClientAPI type PrivateEndpointConnectionsClientAPI = original.PrivateEndpointConnectionsClientAPI -type PrivateLinkResourcesClientAPI = original.PrivateLinkResourcesClientAPI -type RecommendedElasticPoolsClientAPI = original.RecommendedElasticPoolsClientAPI -type RecoverableDatabasesClientAPI = original.RecoverableDatabasesClientAPI -type RecoverableManagedDatabasesClientAPI = original.RecoverableManagedDatabasesClientAPI -type ReplicationLinksClientAPI = original.ReplicationLinksClientAPI -type RestorableDroppedDatabasesClientAPI = original.RestorableDroppedDatabasesClientAPI -type RestorableDroppedManagedDatabasesClientAPI = original.RestorableDroppedManagedDatabasesClientAPI -type RestorePointsClientAPI = original.RestorePointsClientAPI -type SensitivityLabelsClientAPI = original.SensitivityLabelsClientAPI -type ServerAutomaticTuningClientAPI = original.ServerAutomaticTuningClientAPI -type ServerAzureADAdministratorsClientAPI = original.ServerAzureADAdministratorsClientAPI -type ServerBlobAuditingPoliciesClientAPI = original.ServerBlobAuditingPoliciesClientAPI -type ServerCommunicationLinksClientAPI = original.ServerCommunicationLinksClientAPI -type ServerConnectionPoliciesClientAPI = original.ServerConnectionPoliciesClientAPI -type ServerDNSAliasesClientAPI = original.ServerDNSAliasesClientAPI -type ServerKeysClientAPI = original.ServerKeysClientAPI -type ServerSecurityAlertPoliciesClientAPI = original.ServerSecurityAlertPoliciesClientAPI -type ServerUsagesClientAPI = original.ServerUsagesClientAPI type ServerVulnerabilityAssessmentsClientAPI = original.ServerVulnerabilityAssessmentsClientAPI -type ServersClientAPI = original.ServersClientAPI -type ServiceObjectivesClientAPI = original.ServiceObjectivesClientAPI -type ServiceTierAdvisorsClientAPI = original.ServiceTierAdvisorsClientAPI -type SubscriptionUsagesClientAPI = original.SubscriptionUsagesClientAPI -type SyncAgentsClientAPI = original.SyncAgentsClientAPI -type SyncGroupsClientAPI = original.SyncGroupsClientAPI -type SyncMembersClientAPI = original.SyncMembersClientAPI -type TdeCertificatesClientAPI = original.TdeCertificatesClientAPI -type TransparentDataEncryptionActivitiesClientAPI = original.TransparentDataEncryptionActivitiesClientAPI -type TransparentDataEncryptionsClientAPI = original.TransparentDataEncryptionsClientAPI type UsagesClientAPI = original.UsagesClientAPI -type VirtualClustersClientAPI = original.VirtualClustersClientAPI -type VirtualNetworkRulesClientAPI = original.VirtualNetworkRulesClientAPI diff --git a/profiles/preview/preview/sqlvirtualmachine/mgmt/sqlvirtualmachine/models.go b/profiles/preview/preview/sqlvirtualmachine/mgmt/sqlvirtualmachine/models.go index 389ad50698f3..a3fb9d42db63 100644 --- a/profiles/preview/preview/sqlvirtualmachine/mgmt/sqlvirtualmachine/models.go +++ b/profiles/preview/preview/sqlvirtualmachine/mgmt/sqlvirtualmachine/models.go @@ -142,6 +142,14 @@ const ( HA ScaleType = original.HA ) +type StorageWorkloadType = original.StorageWorkloadType + +const ( + StorageWorkloadTypeDW StorageWorkloadType = original.StorageWorkloadTypeDW + StorageWorkloadTypeGENERAL StorageWorkloadType = original.StorageWorkloadTypeGENERAL + StorageWorkloadTypeOLTP StorageWorkloadType = original.StorageWorkloadTypeOLTP +) + type AdditionalFeaturesServerConfigurations = original.AdditionalFeaturesServerConfigurations type AutoBackupSettings = original.AutoBackupSettings type AutoPatchingSettings = original.AutoPatchingSettings @@ -181,6 +189,7 @@ type ProxyResource = original.ProxyResource type Resource = original.Resource type ResourceIdentity = original.ResourceIdentity type SQLConnectivityUpdateSettings = original.SQLConnectivityUpdateSettings +type SQLStorageSettings = original.SQLStorageSettings type SQLStorageUpdateSettings = original.SQLStorageUpdateSettings type SQLVirtualMachine = original.SQLVirtualMachine type SQLVirtualMachinesClient = original.SQLVirtualMachinesClient @@ -189,6 +198,7 @@ type SQLVirtualMachinesDeleteFutureType = original.SQLVirtualMachinesDeleteFutur type SQLVirtualMachinesUpdateFutureType = original.SQLVirtualMachinesUpdateFutureType type SQLWorkloadTypeUpdateSettings = original.SQLWorkloadTypeUpdateSettings type ServerConfigurationsManagementSettings = original.ServerConfigurationsManagementSettings +type StorageConfigurationSettings = original.StorageConfigurationSettings type TrackedResource = original.TrackedResource type Update = original.Update type WsfcDomainCredentials = original.WsfcDomainCredentials @@ -293,6 +303,9 @@ func PossibleSQLWorkloadTypeValues() []SQLWorkloadType { func PossibleScaleTypeValues() []ScaleType { return original.PossibleScaleTypeValues() } +func PossibleStorageWorkloadTypeValues() []StorageWorkloadType { + return original.PossibleStorageWorkloadTypeValues() +} func UserAgent() string { return original.UserAgent() + " profiles/preview" } diff --git a/profiles/preview/recoveryservices/mgmt/backup/models.go b/profiles/preview/recoveryservices/mgmt/backup/models.go index f78dac9391a6..230dba59d36a 100644 --- a/profiles/preview/recoveryservices/mgmt/backup/models.go +++ b/profiles/preview/recoveryservices/mgmt/backup/models.go @@ -265,14 +265,16 @@ const ( type JobOperationType = original.JobOperationType const ( - JobOperationTypeBackup JobOperationType = original.JobOperationTypeBackup - JobOperationTypeConfigureBackup JobOperationType = original.JobOperationTypeConfigureBackup - JobOperationTypeDeleteBackupData JobOperationType = original.JobOperationTypeDeleteBackupData - JobOperationTypeDisableBackup JobOperationType = original.JobOperationTypeDisableBackup - JobOperationTypeInvalid JobOperationType = original.JobOperationTypeInvalid - JobOperationTypeRegister JobOperationType = original.JobOperationTypeRegister - JobOperationTypeRestore JobOperationType = original.JobOperationTypeRestore - JobOperationTypeUnRegister JobOperationType = original.JobOperationTypeUnRegister + JobOperationTypeBackup JobOperationType = original.JobOperationTypeBackup + JobOperationTypeConfigureBackup JobOperationType = original.JobOperationTypeConfigureBackup + JobOperationTypeCrossRegionRestore JobOperationType = original.JobOperationTypeCrossRegionRestore + JobOperationTypeDeleteBackupData JobOperationType = original.JobOperationTypeDeleteBackupData + JobOperationTypeDisableBackup JobOperationType = original.JobOperationTypeDisableBackup + JobOperationTypeInvalid JobOperationType = original.JobOperationTypeInvalid + JobOperationTypeRegister JobOperationType = original.JobOperationTypeRegister + JobOperationTypeRestore JobOperationType = original.JobOperationTypeRestore + JobOperationTypeUndelete JobOperationType = original.JobOperationTypeUndelete + JobOperationTypeUnRegister JobOperationType = original.JobOperationTypeUnRegister ) type JobStatus = original.JobStatus @@ -390,8 +392,9 @@ const ( type ObjectTypeBasicILRRequest = original.ObjectTypeBasicILRRequest const ( - ObjectTypeIaasVMILRRegistrationRequest ObjectTypeBasicILRRequest = original.ObjectTypeIaasVMILRRegistrationRequest - ObjectTypeILRRequest ObjectTypeBasicILRRequest = original.ObjectTypeILRRequest + ObjectTypeAzureFileShareProvisionILRRequest ObjectTypeBasicILRRequest = original.ObjectTypeAzureFileShareProvisionILRRequest + ObjectTypeIaasVMILRRegistrationRequest ObjectTypeBasicILRRequest = original.ObjectTypeIaasVMILRRegistrationRequest + ObjectTypeILRRequest ObjectTypeBasicILRRequest = original.ObjectTypeILRRequest ) type ObjectTypeBasicOperationStatusExtendedInfo = original.ObjectTypeBasicOperationStatusExtendedInfo @@ -501,7 +504,6 @@ const ( ProtectableItemTypeIaaSVMProtectableItem ProtectableItemType = original.ProtectableItemTypeIaaSVMProtectableItem ProtectableItemTypeMicrosoftClassicComputevirtualMachines ProtectableItemType = original.ProtectableItemTypeMicrosoftClassicComputevirtualMachines ProtectableItemTypeMicrosoftComputevirtualMachines ProtectableItemType = original.ProtectableItemTypeMicrosoftComputevirtualMachines - ProtectableItemTypeSAPAseDatabase ProtectableItemType = original.ProtectableItemTypeSAPAseDatabase ProtectableItemTypeSAPAseSystem ProtectableItemType = original.ProtectableItemTypeSAPAseSystem ProtectableItemTypeSAPHanaDatabase ProtectableItemType = original.ProtectableItemTypeSAPHanaDatabase ProtectableItemTypeSAPHanaSystem ProtectableItemType = original.ProtectableItemTypeSAPHanaSystem @@ -581,6 +583,14 @@ const ( ProtectionStatusProtectionFailed ProtectionStatus = original.ProtectionStatusProtectionFailed ) +type RecoveryMode = original.RecoveryMode + +const ( + RecoveryModeFileRecovery RecoveryMode = original.RecoveryModeFileRecovery + RecoveryModeInvalid RecoveryMode = original.RecoveryModeInvalid + RecoveryModeWorkloadRecovery RecoveryMode = original.RecoveryModeWorkloadRecovery +) + type RecoveryPointTierStatus = original.RecoveryPointTierStatus const ( @@ -603,6 +613,7 @@ type RecoveryType = original.RecoveryType const ( RecoveryTypeAlternateLocation RecoveryType = original.RecoveryTypeAlternateLocation RecoveryTypeInvalid RecoveryType = original.RecoveryTypeInvalid + RecoveryTypeOffline RecoveryType = original.RecoveryTypeOffline RecoveryTypeOriginalLocation RecoveryType = original.RecoveryTypeOriginalLocation RecoveryTypeRestoreDisks RecoveryType = original.RecoveryTypeRestoreDisks ) @@ -686,6 +697,14 @@ const ( ScheduleRunTypeWeekly ScheduleRunType = original.ScheduleRunTypeWeekly ) +type SoftDeleteFeatureState = original.SoftDeleteFeatureState + +const ( + SoftDeleteFeatureStateDisabled SoftDeleteFeatureState = original.SoftDeleteFeatureStateDisabled + SoftDeleteFeatureStateEnabled SoftDeleteFeatureState = original.SoftDeleteFeatureStateEnabled + SoftDeleteFeatureStateInvalid SoftDeleteFeatureState = original.SoftDeleteFeatureStateInvalid +) + type StorageType = original.StorageType const ( @@ -811,6 +830,7 @@ type AzureBackupServerEngine = original.AzureBackupServerEngine type AzureFileShareBackupRequest = original.AzureFileShareBackupRequest type AzureFileShareProtectableItem = original.AzureFileShareProtectableItem type AzureFileShareProtectionPolicy = original.AzureFileShareProtectionPolicy +type AzureFileShareProvisionILRRequest = original.AzureFileShareProvisionILRRequest type AzureFileShareRecoveryPoint = original.AzureFileShareRecoveryPoint type AzureFileShareRestoreRequest = original.AzureFileShareRestoreRequest type AzureFileshareProtectedItem = original.AzureFileshareProtectedItem @@ -851,7 +871,6 @@ type AzureVMWorkloadProtectableItem = original.AzureVMWorkloadProtectableItem type AzureVMWorkloadProtectedItem = original.AzureVMWorkloadProtectedItem type AzureVMWorkloadProtectedItemExtendedInfo = original.AzureVMWorkloadProtectedItemExtendedInfo type AzureVMWorkloadProtectionPolicy = original.AzureVMWorkloadProtectionPolicy -type AzureVMWorkloadSAPAseDatabaseProtectableItem = original.AzureVMWorkloadSAPAseDatabaseProtectableItem type AzureVMWorkloadSAPAseDatabaseProtectedItem = original.AzureVMWorkloadSAPAseDatabaseProtectedItem type AzureVMWorkloadSAPAseDatabaseWorkloadItem = original.AzureVMWorkloadSAPAseDatabaseWorkloadItem type AzureVMWorkloadSAPAseSystemProtectableItem = original.AzureVMWorkloadSAPAseSystemProtectableItem @@ -953,6 +972,8 @@ type DPMProtectedItemExtendedInfo = original.DPMProtectedItemExtendedInfo type DailyRetentionFormat = original.DailyRetentionFormat type DailyRetentionSchedule = original.DailyRetentionSchedule type Day = original.Day +type DiskExclusionProperties = original.DiskExclusionProperties +type DiskInformation = original.DiskInformation type DistributedNodesInfo = original.DistributedNodesInfo type DpmBackupEngine = original.DpmBackupEngine type DpmContainer = original.DpmContainer @@ -971,6 +992,7 @@ type EnginesClient = original.EnginesClient type ErrorDetail = original.ErrorDetail type ExportJobsOperationResultInfo = original.ExportJobsOperationResultInfo type ExportJobsOperationResultsClient = original.ExportJobsOperationResultsClient +type ExtendedProperties = original.ExtendedProperties type FeatureSupportClient = original.FeatureSupportClient type FeatureSupportRequest = original.FeatureSupportRequest type GenericContainer = original.GenericContainer @@ -990,6 +1012,7 @@ type IaasVMRestoreRequest = original.IaasVMRestoreRequest type InquiryInfo = original.InquiryInfo type InquiryValidation = original.InquiryValidation type InstantItemRecoveryTarget = original.InstantItemRecoveryTarget +type InstantRPAdditionalDetails = original.InstantRPAdditionalDetails type ItemLevelRecoveryConnectionsClient = original.ItemLevelRecoveryConnectionsClient type Job = original.Job type JobCancellationsClient = original.JobCancellationsClient @@ -1084,6 +1107,7 @@ type ProtectionPolicyResourceList = original.ProtectionPolicyResourceList type ProtectionPolicyResourceListIterator = original.ProtectionPolicyResourceListIterator type ProtectionPolicyResourceListPage = original.ProtectionPolicyResourceListPage type RecoveryPoint = original.RecoveryPoint +type RecoveryPointDiskConfiguration = original.RecoveryPointDiskConfiguration type RecoveryPointResource = original.RecoveryPointResource type RecoveryPointResourceList = original.RecoveryPointResourceList type RecoveryPointResourceListIterator = original.RecoveryPointResourceListIterator @@ -1577,6 +1601,9 @@ func PossibleProtectionStateValues() []ProtectionState { func PossibleProtectionStatusValues() []ProtectionStatus { return original.PossibleProtectionStatusValues() } +func PossibleRecoveryModeValues() []RecoveryMode { + return original.PossibleRecoveryModeValues() +} func PossibleRecoveryPointTierStatusValues() []RecoveryPointTierStatus { return original.PossibleRecoveryPointTierStatusValues() } @@ -1613,6 +1640,9 @@ func PossibleSchedulePolicyTypeValues() []SchedulePolicyType { func PossibleScheduleRunTypeValues() []ScheduleRunType { return original.PossibleScheduleRunTypeValues() } +func PossibleSoftDeleteFeatureStateValues() []SoftDeleteFeatureState { + return original.PossibleSoftDeleteFeatureStateValues() +} func PossibleStorageTypeStateValues() []StorageTypeState { return original.PossibleStorageTypeStateValues() } diff --git a/profiles/preview/servicebus/mgmt/servicebus/models.go b/profiles/preview/servicebus/mgmt/servicebus/models.go index be8dcde4933b..e92dd03050c6 100644 --- a/profiles/preview/servicebus/mgmt/servicebus/models.go +++ b/profiles/preview/servicebus/mgmt/servicebus/models.go @@ -72,13 +72,6 @@ const ( FilterTypeSQLFilter FilterType = original.FilterTypeSQLFilter ) -type IPAction = original.IPAction - -const ( - Accept IPAction = original.Accept - Reject IPAction = original.Reject -) - type KeyType = original.KeyType const ( @@ -168,11 +161,6 @@ type EventHubListResultPage = original.EventHubListResultPage type EventHubsClient = original.EventHubsClient type Eventhub = original.Eventhub type EventhubProperties = original.EventhubProperties -type IPFilterRule = original.IPFilterRule -type IPFilterRuleListResult = original.IPFilterRuleListResult -type IPFilterRuleListResultIterator = original.IPFilterRuleListResultIterator -type IPFilterRuleListResultPage = original.IPFilterRuleListResultPage -type IPFilterRuleProperties = original.IPFilterRuleProperties type MessageCountDetails = original.MessageCountDetails type MigrationConfigListResult = original.MigrationConfigListResult type MigrationConfigListResultIterator = original.MigrationConfigListResultIterator @@ -248,11 +236,6 @@ type Subnet = original.Subnet type SubscriptionsClient = original.SubscriptionsClient type TopicsClient = original.TopicsClient type TrackedResource = original.TrackedResource -type VirtualNetworkRule = original.VirtualNetworkRule -type VirtualNetworkRuleListResult = original.VirtualNetworkRuleListResult -type VirtualNetworkRuleListResultIterator = original.VirtualNetworkRuleListResultIterator -type VirtualNetworkRuleListResultPage = original.VirtualNetworkRuleListResultPage -type VirtualNetworkRuleProperties = original.VirtualNetworkRuleProperties func New(subscriptionID string) BaseClient { return original.New(subscriptionID) @@ -413,9 +396,6 @@ func PossibleEntityStatusValues() []EntityStatus { func PossibleFilterTypeValues() []FilterType { return original.PossibleFilterTypeValues() } -func PossibleIPActionValues() []IPAction { - return original.PossibleIPActionValues() -} func PossibleKeyTypeValues() []KeyType { return original.PossibleKeyTypeValues() } diff --git a/profiles/preview/sql/mgmt/sql/models.go b/profiles/preview/sql/mgmt/sql/models.go index c236e3c00709..1ef18e61db29 100644 --- a/profiles/preview/sql/mgmt/sql/models.go +++ b/profiles/preview/sql/mgmt/sql/models.go @@ -25,6 +25,15 @@ const ( DefaultBaseURI = original.DefaultBaseURI ) +type AdvisorStatus = original.AdvisorStatus + +const ( + GA AdvisorStatus = original.GA + LimitedPublicPreview AdvisorStatus = original.LimitedPublicPreview + PrivatePreview AdvisorStatus = original.PrivatePreview + PublicPreview AdvisorStatus = original.PublicPreview +) + type AuthenticationType = original.AuthenticationType const ( @@ -32,6 +41,30 @@ const ( SQL AuthenticationType = original.SQL ) +type AutoExecuteStatus = original.AutoExecuteStatus + +const ( + Default AutoExecuteStatus = original.Default + Disabled AutoExecuteStatus = original.Disabled + Enabled AutoExecuteStatus = original.Enabled +) + +type BackupLongTermRetentionPolicyState = original.BackupLongTermRetentionPolicyState + +const ( + BackupLongTermRetentionPolicyStateDisabled BackupLongTermRetentionPolicyState = original.BackupLongTermRetentionPolicyStateDisabled + BackupLongTermRetentionPolicyStateEnabled BackupLongTermRetentionPolicyState = original.BackupLongTermRetentionPolicyStateEnabled +) + +type CapabilityStatus = original.CapabilityStatus + +const ( + CapabilityStatusAvailable CapabilityStatus = original.CapabilityStatusAvailable + CapabilityStatusDefault CapabilityStatus = original.CapabilityStatusDefault + CapabilityStatusDisabled CapabilityStatus = original.CapabilityStatusDisabled + CapabilityStatusVisible CapabilityStatus = original.CapabilityStatusVisible +) + type CheckNameAvailabilityReason = original.CheckNameAvailabilityReason const ( @@ -42,14 +75,39 @@ const ( type CreateMode = original.CreateMode const ( - Copy CreateMode = original.Copy - Default CreateMode = original.Default - NonReadableSecondary CreateMode = original.NonReadableSecondary - OnlineSecondary CreateMode = original.OnlineSecondary - PointInTimeRestore CreateMode = original.PointInTimeRestore - Recovery CreateMode = original.Recovery - Restore CreateMode = original.Restore - RestoreLongTermRetentionBackup CreateMode = original.RestoreLongTermRetentionBackup + CreateModeCopy CreateMode = original.CreateModeCopy + CreateModeDefault CreateMode = original.CreateModeDefault + CreateModeNonReadableSecondary CreateMode = original.CreateModeNonReadableSecondary + CreateModeOnlineSecondary CreateMode = original.CreateModeOnlineSecondary + CreateModePointInTimeRestore CreateMode = original.CreateModePointInTimeRestore + CreateModeRecovery CreateMode = original.CreateModeRecovery + CreateModeRestore CreateMode = original.CreateModeRestore + CreateModeRestoreLongTermRetentionBackup CreateMode = original.CreateModeRestoreLongTermRetentionBackup +) + +type DataMaskingFunction = original.DataMaskingFunction + +const ( + DataMaskingFunctionCCN DataMaskingFunction = original.DataMaskingFunctionCCN + DataMaskingFunctionDefault DataMaskingFunction = original.DataMaskingFunctionDefault + DataMaskingFunctionEmail DataMaskingFunction = original.DataMaskingFunctionEmail + DataMaskingFunctionNumber DataMaskingFunction = original.DataMaskingFunctionNumber + DataMaskingFunctionSSN DataMaskingFunction = original.DataMaskingFunctionSSN + DataMaskingFunctionText DataMaskingFunction = original.DataMaskingFunctionText +) + +type DataMaskingRuleState = original.DataMaskingRuleState + +const ( + DataMaskingRuleStateDisabled DataMaskingRuleState = original.DataMaskingRuleStateDisabled + DataMaskingRuleStateEnabled DataMaskingRuleState = original.DataMaskingRuleStateEnabled +) + +type DataMaskingState = original.DataMaskingState + +const ( + DataMaskingStateDisabled DataMaskingState = original.DataMaskingStateDisabled + DataMaskingStateEnabled DataMaskingState = original.DataMaskingStateEnabled ) type DatabaseEdition = original.DatabaseEdition @@ -71,6 +129,37 @@ const ( Web DatabaseEdition = original.Web ) +type DisasterRecoveryConfigurationAutoFailover = original.DisasterRecoveryConfigurationAutoFailover + +const ( + Off DisasterRecoveryConfigurationAutoFailover = original.Off + On DisasterRecoveryConfigurationAutoFailover = original.On +) + +type DisasterRecoveryConfigurationFailoverPolicy = original.DisasterRecoveryConfigurationFailoverPolicy + +const ( + Automatic DisasterRecoveryConfigurationFailoverPolicy = original.Automatic + Manual DisasterRecoveryConfigurationFailoverPolicy = original.Manual +) + +type DisasterRecoveryConfigurationRole = original.DisasterRecoveryConfigurationRole + +const ( + None DisasterRecoveryConfigurationRole = original.None + Primary DisasterRecoveryConfigurationRole = original.Primary + Secondary DisasterRecoveryConfigurationRole = original.Secondary +) + +type DisasterRecoveryConfigurationStatus = original.DisasterRecoveryConfigurationStatus + +const ( + Creating DisasterRecoveryConfigurationStatus = original.Creating + Dropping DisasterRecoveryConfigurationStatus = original.Dropping + FailingOver DisasterRecoveryConfigurationStatus = original.FailingOver + Ready DisasterRecoveryConfigurationStatus = original.Ready +) + type ElasticPoolEdition = original.ElasticPoolEdition const ( @@ -84,9 +173,79 @@ const ( type ElasticPoolState = original.ElasticPoolState const ( - Creating ElasticPoolState = original.Creating - Disabled ElasticPoolState = original.Disabled - Ready ElasticPoolState = original.Ready + ElasticPoolStateCreating ElasticPoolState = original.ElasticPoolStateCreating + ElasticPoolStateDisabled ElasticPoolState = original.ElasticPoolStateDisabled + ElasticPoolStateReady ElasticPoolState = original.ElasticPoolStateReady +) + +type GeoBackupPolicyState = original.GeoBackupPolicyState + +const ( + GeoBackupPolicyStateDisabled GeoBackupPolicyState = original.GeoBackupPolicyStateDisabled + GeoBackupPolicyStateEnabled GeoBackupPolicyState = original.GeoBackupPolicyStateEnabled +) + +type MaxSizeUnits = original.MaxSizeUnits + +const ( + Gigabytes MaxSizeUnits = original.Gigabytes + Megabytes MaxSizeUnits = original.Megabytes + Petabytes MaxSizeUnits = original.Petabytes + Terabytes MaxSizeUnits = original.Terabytes +) + +type PerformanceLevelUnit = original.PerformanceLevelUnit + +const ( + DTU PerformanceLevelUnit = original.DTU +) + +type PrimaryAggregationType = original.PrimaryAggregationType + +const ( + PrimaryAggregationTypeAverage PrimaryAggregationType = original.PrimaryAggregationTypeAverage + PrimaryAggregationTypeCount PrimaryAggregationType = original.PrimaryAggregationTypeCount + PrimaryAggregationTypeMaximum PrimaryAggregationType = original.PrimaryAggregationTypeMaximum + PrimaryAggregationTypeMinimum PrimaryAggregationType = original.PrimaryAggregationTypeMinimum + PrimaryAggregationTypeNone PrimaryAggregationType = original.PrimaryAggregationTypeNone + PrimaryAggregationTypeTotal PrimaryAggregationType = original.PrimaryAggregationTypeTotal +) + +type QueryAggregationFunction = original.QueryAggregationFunction + +const ( + Avg QueryAggregationFunction = original.Avg + Max QueryAggregationFunction = original.Max + Min QueryAggregationFunction = original.Min + Sum QueryAggregationFunction = original.Sum +) + +type QueryExecutionType = original.QueryExecutionType + +const ( + Aborted QueryExecutionType = original.Aborted + Any QueryExecutionType = original.Any + Exception QueryExecutionType = original.Exception + Irregular QueryExecutionType = original.Irregular + Regular QueryExecutionType = original.Regular +) + +type QueryMetricUnit = original.QueryMetricUnit + +const ( + KB QueryMetricUnit = original.KB + Microseconds QueryMetricUnit = original.Microseconds + Percentage QueryMetricUnit = original.Percentage +) + +type QueryObservedMetricType = original.QueryObservedMetricType + +const ( + CPU QueryObservedMetricType = original.CPU + Duration QueryObservedMetricType = original.Duration + ExecutionCount QueryObservedMetricType = original.ExecutionCount + Io QueryObservedMetricType = original.Io + Logio QueryObservedMetricType = original.Logio ) type ReadScale = original.ReadScale @@ -148,6 +307,13 @@ const ( SUSPENDED ReplicationState = original.SUSPENDED ) +type RestorePointType = original.RestorePointType + +const ( + CONTINUOUS RestorePointType = original.CONTINUOUS + DISCRETE RestorePointType = original.DISCRETE +) + type SampleName = original.SampleName const ( @@ -176,6 +342,28 @@ const ( SecurityAlertPolicyUseServerDefaultEnabled SecurityAlertPolicyUseServerDefault = original.SecurityAlertPolicyUseServerDefaultEnabled ) +type ServerConnectionType = original.ServerConnectionType + +const ( + ServerConnectionTypeDefault ServerConnectionType = original.ServerConnectionTypeDefault + ServerConnectionTypeProxy ServerConnectionType = original.ServerConnectionTypeProxy + ServerConnectionTypeRedirect ServerConnectionType = original.ServerConnectionTypeRedirect +) + +type ServerState = original.ServerState + +const ( + ServerStateDisabled ServerState = original.ServerStateDisabled + ServerStateReady ServerState = original.ServerStateReady +) + +type ServerVersion = original.ServerVersion + +const ( + OneTwoFullStopZero ServerVersion = original.OneTwoFullStopZero + TwoFullStopZero ServerVersion = original.TwoFullStopZero +) + type ServiceObjectiveName = original.ServiceObjectiveName const ( @@ -267,16 +455,70 @@ const ( TransparentDataEncryptionStatusEnabled TransparentDataEncryptionStatus = original.TransparentDataEncryptionStatusEnabled ) +type UnitDefinitionType = original.UnitDefinitionType + +const ( + Bytes UnitDefinitionType = original.Bytes + BytesPerSecond UnitDefinitionType = original.BytesPerSecond + Count UnitDefinitionType = original.Count + CountPerSecond UnitDefinitionType = original.CountPerSecond + Percent UnitDefinitionType = original.Percent + Seconds UnitDefinitionType = original.Seconds +) + +type UnitType = original.UnitType + +const ( + UnitTypeBytes UnitType = original.UnitTypeBytes + UnitTypeBytesPerSecond UnitType = original.UnitTypeBytesPerSecond + UnitTypeCount UnitType = original.UnitTypeCount + UnitTypeCountPerSecond UnitType = original.UnitTypeCountPerSecond + UnitTypePercent UnitType = original.UnitTypePercent + UnitTypeSeconds UnitType = original.UnitTypeSeconds +) + +type Advisor = original.Advisor +type AdvisorListResult = original.AdvisorListResult +type AdvisorProperties = original.AdvisorProperties +type BackupLongTermRetentionPoliciesClient = original.BackupLongTermRetentionPoliciesClient +type BackupLongTermRetentionPoliciesCreateOrUpdateFuture = original.BackupLongTermRetentionPoliciesCreateOrUpdateFuture +type BackupLongTermRetentionPolicy = original.BackupLongTermRetentionPolicy +type BackupLongTermRetentionPolicyListResult = original.BackupLongTermRetentionPolicyListResult +type BackupLongTermRetentionPolicyProperties = original.BackupLongTermRetentionPolicyProperties +type BackupLongTermRetentionVault = original.BackupLongTermRetentionVault +type BackupLongTermRetentionVaultListResult = original.BackupLongTermRetentionVaultListResult +type BackupLongTermRetentionVaultProperties = original.BackupLongTermRetentionVaultProperties +type BackupLongTermRetentionVaultsClient = original.BackupLongTermRetentionVaultsClient +type BackupLongTermRetentionVaultsCreateOrUpdateFuture = original.BackupLongTermRetentionVaultsCreateOrUpdateFuture type BaseClient = original.BaseClient +type CapabilitiesClient = original.CapabilitiesClient type CheckNameAvailabilityRequest = original.CheckNameAvailabilityRequest type CheckNameAvailabilityResponse = original.CheckNameAvailabilityResponse +type DataMaskingPoliciesClient = original.DataMaskingPoliciesClient +type DataMaskingPolicy = original.DataMaskingPolicy +type DataMaskingPolicyProperties = original.DataMaskingPolicyProperties +type DataMaskingRule = original.DataMaskingRule +type DataMaskingRuleListResult = original.DataMaskingRuleListResult +type DataMaskingRuleProperties = original.DataMaskingRuleProperties +type DataMaskingRulesClient = original.DataMaskingRulesClient type Database = original.Database +type DatabaseAdvisorsClient = original.DatabaseAdvisorsClient +type DatabaseConnectionPoliciesClient = original.DatabaseConnectionPoliciesClient +type DatabaseConnectionPolicy = original.DatabaseConnectionPolicy +type DatabaseConnectionPolicyProperties = original.DatabaseConnectionPolicyProperties type DatabaseListResult = original.DatabaseListResult type DatabaseProperties = original.DatabaseProperties type DatabaseSecurityAlertPolicy = original.DatabaseSecurityAlertPolicy type DatabaseSecurityAlertPolicyProperties = original.DatabaseSecurityAlertPolicyProperties +type DatabaseTableAuditingPoliciesClient = original.DatabaseTableAuditingPoliciesClient +type DatabaseTableAuditingPolicy = original.DatabaseTableAuditingPolicy +type DatabaseTableAuditingPolicyListResult = original.DatabaseTableAuditingPolicyListResult +type DatabaseTableAuditingPolicyProperties = original.DatabaseTableAuditingPolicyProperties type DatabaseThreatDetectionPoliciesClient = original.DatabaseThreatDetectionPoliciesClient type DatabaseUpdate = original.DatabaseUpdate +type DatabaseUsage = original.DatabaseUsage +type DatabaseUsageListResult = original.DatabaseUsageListResult +type DatabaseUsagesClient = original.DatabaseUsagesClient type DatabasesClient = original.DatabasesClient type DatabasesCreateImportOperationFuture = original.DatabasesCreateImportOperationFuture type DatabasesCreateOrUpdateFuture = original.DatabasesCreateOrUpdateFuture @@ -285,6 +527,15 @@ type DatabasesImportFuture = original.DatabasesImportFuture type DatabasesPauseFuture = original.DatabasesPauseFuture type DatabasesResumeFuture = original.DatabasesResumeFuture type DatabasesUpdateFuture = original.DatabasesUpdateFuture +type DisasterRecoveryConfiguration = original.DisasterRecoveryConfiguration +type DisasterRecoveryConfigurationListResult = original.DisasterRecoveryConfigurationListResult +type DisasterRecoveryConfigurationProperties = original.DisasterRecoveryConfigurationProperties +type DisasterRecoveryConfigurationsClient = original.DisasterRecoveryConfigurationsClient +type DisasterRecoveryConfigurationsCreateOrUpdateFuture = original.DisasterRecoveryConfigurationsCreateOrUpdateFuture +type DisasterRecoveryConfigurationsDeleteFuture = original.DisasterRecoveryConfigurationsDeleteFuture +type DisasterRecoveryConfigurationsFailoverAllowDataLossFuture = original.DisasterRecoveryConfigurationsFailoverAllowDataLossFuture +type DisasterRecoveryConfigurationsFailoverFuture = original.DisasterRecoveryConfigurationsFailoverFuture +type EditionCapability = original.EditionCapability type ElasticPool = original.ElasticPool type ElasticPoolActivitiesClient = original.ElasticPoolActivitiesClient type ElasticPoolActivity = original.ElasticPoolActivity @@ -294,24 +545,57 @@ type ElasticPoolDatabaseActivitiesClient = original.ElasticPoolDatabaseActivitie type ElasticPoolDatabaseActivity = original.ElasticPoolDatabaseActivity type ElasticPoolDatabaseActivityListResult = original.ElasticPoolDatabaseActivityListResult type ElasticPoolDatabaseActivityProperties = original.ElasticPoolDatabaseActivityProperties +type ElasticPoolDtuCapability = original.ElasticPoolDtuCapability +type ElasticPoolEditionCapability = original.ElasticPoolEditionCapability type ElasticPoolListResult = original.ElasticPoolListResult +type ElasticPoolPerDatabaseMaxDtuCapability = original.ElasticPoolPerDatabaseMaxDtuCapability +type ElasticPoolPerDatabaseMinDtuCapability = original.ElasticPoolPerDatabaseMinDtuCapability type ElasticPoolProperties = original.ElasticPoolProperties type ElasticPoolUpdate = original.ElasticPoolUpdate type ElasticPoolsClient = original.ElasticPoolsClient type ElasticPoolsCreateOrUpdateFuture = original.ElasticPoolsCreateOrUpdateFuture type ElasticPoolsUpdateFuture = original.ElasticPoolsUpdateFuture type ExportRequest = original.ExportRequest +type ExtensionListResult = original.ExtensionListResult +type ExtensionsClient = original.ExtensionsClient type FirewallRule = original.FirewallRule type FirewallRuleListResult = original.FirewallRuleListResult type FirewallRuleProperties = original.FirewallRuleProperties type FirewallRulesClient = original.FirewallRulesClient +type GeoBackupPoliciesClient = original.GeoBackupPoliciesClient +type GeoBackupPolicy = original.GeoBackupPolicy +type GeoBackupPolicyListResult = original.GeoBackupPolicyListResult +type GeoBackupPolicyProperties = original.GeoBackupPolicyProperties type ImportExportResponse = original.ImportExportResponse type ImportExportResponseProperties = original.ImportExportResponseProperties type ImportExtensionProperties = original.ImportExtensionProperties type ImportExtensionRequest = original.ImportExtensionRequest type ImportRequest = original.ImportRequest +type LocationCapabilities = original.LocationCapabilities +type MaxSizeCapability = original.MaxSizeCapability +type Metric = original.Metric +type MetricAvailability = original.MetricAvailability +type MetricDefinition = original.MetricDefinition +type MetricDefinitionListResult = original.MetricDefinitionListResult +type MetricListResult = original.MetricListResult +type MetricName = original.MetricName +type MetricValue = original.MetricValue +type Operation = original.Operation +type OperationDisplay = original.OperationDisplay type OperationImpact = original.OperationImpact +type OperationListResult = original.OperationListResult +type OperationsClient = original.OperationsClient +type PerformanceLevel = original.PerformanceLevel type ProxyResource = original.ProxyResource +type QueriesClient = original.QueriesClient +type QueryInterval = original.QueryInterval +type QueryMetric = original.QueryMetric +type QueryStatistic = original.QueryStatistic +type QueryStatisticListResult = original.QueryStatisticListResult +type QueryStatisticsClient = original.QueryStatisticsClient +type QueryText = original.QueryText +type QueryTextListResult = original.QueryTextListResult +type QueryTextsClient = original.QueryTextsClient type RecommendedElasticPool = original.RecommendedElasticPool type RecommendedElasticPoolListMetricsResult = original.RecommendedElasticPoolListMetricsResult type RecommendedElasticPoolListResult = original.RecommendedElasticPoolListResult @@ -320,6 +604,10 @@ type RecommendedElasticPoolProperties = original.RecommendedElasticPoolPropertie type RecommendedElasticPoolsClient = original.RecommendedElasticPoolsClient type RecommendedIndex = original.RecommendedIndex type RecommendedIndexProperties = original.RecommendedIndexProperties +type RecoverableDatabase = original.RecoverableDatabase +type RecoverableDatabaseListResult = original.RecoverableDatabaseListResult +type RecoverableDatabaseProperties = original.RecoverableDatabaseProperties +type RecoverableDatabasesClient = original.RecoverableDatabasesClient type ReplicationLink = original.ReplicationLink type ReplicationLinkListResult = original.ReplicationLinkListResult type ReplicationLinkProperties = original.ReplicationLinkProperties @@ -327,36 +615,141 @@ type ReplicationLinksClient = original.ReplicationLinksClient type ReplicationLinksFailoverAllowDataLossFuture = original.ReplicationLinksFailoverAllowDataLossFuture type ReplicationLinksFailoverFuture = original.ReplicationLinksFailoverFuture type Resource = original.Resource +type RestorableDroppedDatabase = original.RestorableDroppedDatabase +type RestorableDroppedDatabaseListResult = original.RestorableDroppedDatabaseListResult +type RestorableDroppedDatabaseProperties = original.RestorableDroppedDatabaseProperties +type RestorableDroppedDatabasesClient = original.RestorableDroppedDatabasesClient +type RestorePoint = original.RestorePoint +type RestorePointListResult = original.RestorePointListResult +type RestorePointProperties = original.RestorePointProperties +type RestorePointsClient = original.RestorePointsClient +type Server = original.Server +type ServerAdministratorListResult = original.ServerAdministratorListResult +type ServerAdministratorProperties = original.ServerAdministratorProperties +type ServerAdvisorsClient = original.ServerAdvisorsClient +type ServerAzureADAdministrator = original.ServerAzureADAdministrator +type ServerAzureADAdministratorsClient = original.ServerAzureADAdministratorsClient +type ServerAzureADAdministratorsCreateOrUpdateFuture = original.ServerAzureADAdministratorsCreateOrUpdateFuture +type ServerAzureADAdministratorsDeleteFuture = original.ServerAzureADAdministratorsDeleteFuture +type ServerCommunicationLink = original.ServerCommunicationLink +type ServerCommunicationLinkListResult = original.ServerCommunicationLinkListResult +type ServerCommunicationLinkProperties = original.ServerCommunicationLinkProperties +type ServerCommunicationLinksClient = original.ServerCommunicationLinksClient +type ServerCommunicationLinksCreateOrUpdateFuture = original.ServerCommunicationLinksCreateOrUpdateFuture +type ServerConnectionPoliciesClient = original.ServerConnectionPoliciesClient +type ServerConnectionPolicy = original.ServerConnectionPolicy +type ServerConnectionPolicyProperties = original.ServerConnectionPolicyProperties +type ServerListResult = original.ServerListResult +type ServerProperties = original.ServerProperties +type ServerTableAuditingPoliciesClient = original.ServerTableAuditingPoliciesClient +type ServerTableAuditingPolicy = original.ServerTableAuditingPolicy +type ServerTableAuditingPolicyListResult = original.ServerTableAuditingPolicyListResult +type ServerTableAuditingPolicyProperties = original.ServerTableAuditingPolicyProperties +type ServerUpdate = original.ServerUpdate +type ServerUsage = original.ServerUsage +type ServerUsageListResult = original.ServerUsageListResult +type ServerUsagesClient = original.ServerUsagesClient +type ServerVersionCapability = original.ServerVersionCapability type ServersClient = original.ServersClient +type ServiceObjective = original.ServiceObjective +type ServiceObjectiveCapability = original.ServiceObjectiveCapability +type ServiceObjectiveListResult = original.ServiceObjectiveListResult +type ServiceObjectiveProperties = original.ServiceObjectiveProperties +type ServiceObjectivesClient = original.ServiceObjectivesClient type ServiceTierAdvisor = original.ServiceTierAdvisor type ServiceTierAdvisorListResult = original.ServiceTierAdvisorListResult type ServiceTierAdvisorProperties = original.ServiceTierAdvisorProperties type ServiceTierAdvisorsClient = original.ServiceTierAdvisorsClient type SloUsageMetric = original.SloUsageMetric +type TableAuditingPolicyProperties = original.TableAuditingPolicyProperties +type TopQueries = original.TopQueries +type TopQueriesListResult = original.TopQueriesListResult type TrackedResource = original.TrackedResource type TransparentDataEncryption = original.TransparentDataEncryption type TransparentDataEncryptionActivitiesClient = original.TransparentDataEncryptionActivitiesClient type TransparentDataEncryptionActivity = original.TransparentDataEncryptionActivity type TransparentDataEncryptionActivityListResult = original.TransparentDataEncryptionActivityListResult type TransparentDataEncryptionActivityProperties = original.TransparentDataEncryptionActivityProperties +type TransparentDataEncryptionConfigurationsClient = original.TransparentDataEncryptionConfigurationsClient +type TransparentDataEncryptionListResult = original.TransparentDataEncryptionListResult type TransparentDataEncryptionProperties = original.TransparentDataEncryptionProperties type TransparentDataEncryptionsClient = original.TransparentDataEncryptionsClient func New(subscriptionID string) BaseClient { return original.New(subscriptionID) } +func NewBackupLongTermRetentionPoliciesClient(subscriptionID string) BackupLongTermRetentionPoliciesClient { + return original.NewBackupLongTermRetentionPoliciesClient(subscriptionID) +} +func NewBackupLongTermRetentionPoliciesClientWithBaseURI(baseURI string, subscriptionID string) BackupLongTermRetentionPoliciesClient { + return original.NewBackupLongTermRetentionPoliciesClientWithBaseURI(baseURI, subscriptionID) +} +func NewBackupLongTermRetentionVaultsClient(subscriptionID string) BackupLongTermRetentionVaultsClient { + return original.NewBackupLongTermRetentionVaultsClient(subscriptionID) +} +func NewBackupLongTermRetentionVaultsClientWithBaseURI(baseURI string, subscriptionID string) BackupLongTermRetentionVaultsClient { + return original.NewBackupLongTermRetentionVaultsClientWithBaseURI(baseURI, subscriptionID) +} +func NewCapabilitiesClient(subscriptionID string) CapabilitiesClient { + return original.NewCapabilitiesClient(subscriptionID) +} +func NewCapabilitiesClientWithBaseURI(baseURI string, subscriptionID string) CapabilitiesClient { + return original.NewCapabilitiesClientWithBaseURI(baseURI, subscriptionID) +} +func NewDataMaskingPoliciesClient(subscriptionID string) DataMaskingPoliciesClient { + return original.NewDataMaskingPoliciesClient(subscriptionID) +} +func NewDataMaskingPoliciesClientWithBaseURI(baseURI string, subscriptionID string) DataMaskingPoliciesClient { + return original.NewDataMaskingPoliciesClientWithBaseURI(baseURI, subscriptionID) +} +func NewDataMaskingRulesClient(subscriptionID string) DataMaskingRulesClient { + return original.NewDataMaskingRulesClient(subscriptionID) +} +func NewDataMaskingRulesClientWithBaseURI(baseURI string, subscriptionID string) DataMaskingRulesClient { + return original.NewDataMaskingRulesClientWithBaseURI(baseURI, subscriptionID) +} +func NewDatabaseAdvisorsClient(subscriptionID string) DatabaseAdvisorsClient { + return original.NewDatabaseAdvisorsClient(subscriptionID) +} +func NewDatabaseAdvisorsClientWithBaseURI(baseURI string, subscriptionID string) DatabaseAdvisorsClient { + return original.NewDatabaseAdvisorsClientWithBaseURI(baseURI, subscriptionID) +} +func NewDatabaseConnectionPoliciesClient(subscriptionID string) DatabaseConnectionPoliciesClient { + return original.NewDatabaseConnectionPoliciesClient(subscriptionID) +} +func NewDatabaseConnectionPoliciesClientWithBaseURI(baseURI string, subscriptionID string) DatabaseConnectionPoliciesClient { + return original.NewDatabaseConnectionPoliciesClientWithBaseURI(baseURI, subscriptionID) +} +func NewDatabaseTableAuditingPoliciesClient(subscriptionID string) DatabaseTableAuditingPoliciesClient { + return original.NewDatabaseTableAuditingPoliciesClient(subscriptionID) +} +func NewDatabaseTableAuditingPoliciesClientWithBaseURI(baseURI string, subscriptionID string) DatabaseTableAuditingPoliciesClient { + return original.NewDatabaseTableAuditingPoliciesClientWithBaseURI(baseURI, subscriptionID) +} func NewDatabaseThreatDetectionPoliciesClient(subscriptionID string) DatabaseThreatDetectionPoliciesClient { return original.NewDatabaseThreatDetectionPoliciesClient(subscriptionID) } func NewDatabaseThreatDetectionPoliciesClientWithBaseURI(baseURI string, subscriptionID string) DatabaseThreatDetectionPoliciesClient { return original.NewDatabaseThreatDetectionPoliciesClientWithBaseURI(baseURI, subscriptionID) } +func NewDatabaseUsagesClient(subscriptionID string) DatabaseUsagesClient { + return original.NewDatabaseUsagesClient(subscriptionID) +} +func NewDatabaseUsagesClientWithBaseURI(baseURI string, subscriptionID string) DatabaseUsagesClient { + return original.NewDatabaseUsagesClientWithBaseURI(baseURI, subscriptionID) +} func NewDatabasesClient(subscriptionID string) DatabasesClient { return original.NewDatabasesClient(subscriptionID) } func NewDatabasesClientWithBaseURI(baseURI string, subscriptionID string) DatabasesClient { return original.NewDatabasesClientWithBaseURI(baseURI, subscriptionID) } +func NewDisasterRecoveryConfigurationsClient(subscriptionID string) DisasterRecoveryConfigurationsClient { + return original.NewDisasterRecoveryConfigurationsClient(subscriptionID) +} +func NewDisasterRecoveryConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) DisasterRecoveryConfigurationsClient { + return original.NewDisasterRecoveryConfigurationsClientWithBaseURI(baseURI, subscriptionID) +} func NewElasticPoolActivitiesClient(subscriptionID string) ElasticPoolActivitiesClient { return original.NewElasticPoolActivitiesClient(subscriptionID) } @@ -375,30 +768,126 @@ func NewElasticPoolsClient(subscriptionID string) ElasticPoolsClient { func NewElasticPoolsClientWithBaseURI(baseURI string, subscriptionID string) ElasticPoolsClient { return original.NewElasticPoolsClientWithBaseURI(baseURI, subscriptionID) } +func NewExtensionsClient(subscriptionID string) ExtensionsClient { + return original.NewExtensionsClient(subscriptionID) +} +func NewExtensionsClientWithBaseURI(baseURI string, subscriptionID string) ExtensionsClient { + return original.NewExtensionsClientWithBaseURI(baseURI, subscriptionID) +} func NewFirewallRulesClient(subscriptionID string) FirewallRulesClient { return original.NewFirewallRulesClient(subscriptionID) } func NewFirewallRulesClientWithBaseURI(baseURI string, subscriptionID string) FirewallRulesClient { return original.NewFirewallRulesClientWithBaseURI(baseURI, subscriptionID) } +func NewGeoBackupPoliciesClient(subscriptionID string) GeoBackupPoliciesClient { + return original.NewGeoBackupPoliciesClient(subscriptionID) +} +func NewGeoBackupPoliciesClientWithBaseURI(baseURI string, subscriptionID string) GeoBackupPoliciesClient { + return original.NewGeoBackupPoliciesClientWithBaseURI(baseURI, subscriptionID) +} +func NewOperationsClient(subscriptionID string) OperationsClient { + return original.NewOperationsClient(subscriptionID) +} +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) +} +func NewQueriesClient(subscriptionID string) QueriesClient { + return original.NewQueriesClient(subscriptionID) +} +func NewQueriesClientWithBaseURI(baseURI string, subscriptionID string) QueriesClient { + return original.NewQueriesClientWithBaseURI(baseURI, subscriptionID) +} +func NewQueryStatisticsClient(subscriptionID string) QueryStatisticsClient { + return original.NewQueryStatisticsClient(subscriptionID) +} +func NewQueryStatisticsClientWithBaseURI(baseURI string, subscriptionID string) QueryStatisticsClient { + return original.NewQueryStatisticsClientWithBaseURI(baseURI, subscriptionID) +} +func NewQueryTextsClient(subscriptionID string) QueryTextsClient { + return original.NewQueryTextsClient(subscriptionID) +} +func NewQueryTextsClientWithBaseURI(baseURI string, subscriptionID string) QueryTextsClient { + return original.NewQueryTextsClientWithBaseURI(baseURI, subscriptionID) +} func NewRecommendedElasticPoolsClient(subscriptionID string) RecommendedElasticPoolsClient { return original.NewRecommendedElasticPoolsClient(subscriptionID) } func NewRecommendedElasticPoolsClientWithBaseURI(baseURI string, subscriptionID string) RecommendedElasticPoolsClient { return original.NewRecommendedElasticPoolsClientWithBaseURI(baseURI, subscriptionID) } +func NewRecoverableDatabasesClient(subscriptionID string) RecoverableDatabasesClient { + return original.NewRecoverableDatabasesClient(subscriptionID) +} +func NewRecoverableDatabasesClientWithBaseURI(baseURI string, subscriptionID string) RecoverableDatabasesClient { + return original.NewRecoverableDatabasesClientWithBaseURI(baseURI, subscriptionID) +} func NewReplicationLinksClient(subscriptionID string) ReplicationLinksClient { return original.NewReplicationLinksClient(subscriptionID) } func NewReplicationLinksClientWithBaseURI(baseURI string, subscriptionID string) ReplicationLinksClient { return original.NewReplicationLinksClientWithBaseURI(baseURI, subscriptionID) } +func NewRestorableDroppedDatabasesClient(subscriptionID string) RestorableDroppedDatabasesClient { + return original.NewRestorableDroppedDatabasesClient(subscriptionID) +} +func NewRestorableDroppedDatabasesClientWithBaseURI(baseURI string, subscriptionID string) RestorableDroppedDatabasesClient { + return original.NewRestorableDroppedDatabasesClientWithBaseURI(baseURI, subscriptionID) +} +func NewRestorePointsClient(subscriptionID string) RestorePointsClient { + return original.NewRestorePointsClient(subscriptionID) +} +func NewRestorePointsClientWithBaseURI(baseURI string, subscriptionID string) RestorePointsClient { + return original.NewRestorePointsClientWithBaseURI(baseURI, subscriptionID) +} +func NewServerAdvisorsClient(subscriptionID string) ServerAdvisorsClient { + return original.NewServerAdvisorsClient(subscriptionID) +} +func NewServerAdvisorsClientWithBaseURI(baseURI string, subscriptionID string) ServerAdvisorsClient { + return original.NewServerAdvisorsClientWithBaseURI(baseURI, subscriptionID) +} +func NewServerAzureADAdministratorsClient(subscriptionID string) ServerAzureADAdministratorsClient { + return original.NewServerAzureADAdministratorsClient(subscriptionID) +} +func NewServerAzureADAdministratorsClientWithBaseURI(baseURI string, subscriptionID string) ServerAzureADAdministratorsClient { + return original.NewServerAzureADAdministratorsClientWithBaseURI(baseURI, subscriptionID) +} +func NewServerCommunicationLinksClient(subscriptionID string) ServerCommunicationLinksClient { + return original.NewServerCommunicationLinksClient(subscriptionID) +} +func NewServerCommunicationLinksClientWithBaseURI(baseURI string, subscriptionID string) ServerCommunicationLinksClient { + return original.NewServerCommunicationLinksClientWithBaseURI(baseURI, subscriptionID) +} +func NewServerConnectionPoliciesClient(subscriptionID string) ServerConnectionPoliciesClient { + return original.NewServerConnectionPoliciesClient(subscriptionID) +} +func NewServerConnectionPoliciesClientWithBaseURI(baseURI string, subscriptionID string) ServerConnectionPoliciesClient { + return original.NewServerConnectionPoliciesClientWithBaseURI(baseURI, subscriptionID) +} +func NewServerTableAuditingPoliciesClient(subscriptionID string) ServerTableAuditingPoliciesClient { + return original.NewServerTableAuditingPoliciesClient(subscriptionID) +} +func NewServerTableAuditingPoliciesClientWithBaseURI(baseURI string, subscriptionID string) ServerTableAuditingPoliciesClient { + return original.NewServerTableAuditingPoliciesClientWithBaseURI(baseURI, subscriptionID) +} +func NewServerUsagesClient(subscriptionID string) ServerUsagesClient { + return original.NewServerUsagesClient(subscriptionID) +} +func NewServerUsagesClientWithBaseURI(baseURI string, subscriptionID string) ServerUsagesClient { + return original.NewServerUsagesClientWithBaseURI(baseURI, subscriptionID) +} func NewServersClient(subscriptionID string) ServersClient { return original.NewServersClient(subscriptionID) } func NewServersClientWithBaseURI(baseURI string, subscriptionID string) ServersClient { return original.NewServersClientWithBaseURI(baseURI, subscriptionID) } +func NewServiceObjectivesClient(subscriptionID string) ServiceObjectivesClient { + return original.NewServiceObjectivesClient(subscriptionID) +} +func NewServiceObjectivesClientWithBaseURI(baseURI string, subscriptionID string) ServiceObjectivesClient { + return original.NewServiceObjectivesClientWithBaseURI(baseURI, subscriptionID) +} func NewServiceTierAdvisorsClient(subscriptionID string) ServiceTierAdvisorsClient { return original.NewServiceTierAdvisorsClient(subscriptionID) } @@ -411,6 +900,12 @@ func NewTransparentDataEncryptionActivitiesClient(subscriptionID string) Transpa func NewTransparentDataEncryptionActivitiesClientWithBaseURI(baseURI string, subscriptionID string) TransparentDataEncryptionActivitiesClient { return original.NewTransparentDataEncryptionActivitiesClientWithBaseURI(baseURI, subscriptionID) } +func NewTransparentDataEncryptionConfigurationsClient(subscriptionID string) TransparentDataEncryptionConfigurationsClient { + return original.NewTransparentDataEncryptionConfigurationsClient(subscriptionID) +} +func NewTransparentDataEncryptionConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) TransparentDataEncryptionConfigurationsClient { + return original.NewTransparentDataEncryptionConfigurationsClientWithBaseURI(baseURI, subscriptionID) +} func NewTransparentDataEncryptionsClient(subscriptionID string) TransparentDataEncryptionsClient { return original.NewTransparentDataEncryptionsClient(subscriptionID) } @@ -420,24 +915,81 @@ func NewTransparentDataEncryptionsClientWithBaseURI(baseURI string, subscription func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { return original.NewWithBaseURI(baseURI, subscriptionID) } +func PossibleAdvisorStatusValues() []AdvisorStatus { + return original.PossibleAdvisorStatusValues() +} func PossibleAuthenticationTypeValues() []AuthenticationType { return original.PossibleAuthenticationTypeValues() } +func PossibleAutoExecuteStatusValues() []AutoExecuteStatus { + return original.PossibleAutoExecuteStatusValues() +} +func PossibleBackupLongTermRetentionPolicyStateValues() []BackupLongTermRetentionPolicyState { + return original.PossibleBackupLongTermRetentionPolicyStateValues() +} +func PossibleCapabilityStatusValues() []CapabilityStatus { + return original.PossibleCapabilityStatusValues() +} func PossibleCheckNameAvailabilityReasonValues() []CheckNameAvailabilityReason { return original.PossibleCheckNameAvailabilityReasonValues() } func PossibleCreateModeValues() []CreateMode { return original.PossibleCreateModeValues() } +func PossibleDataMaskingFunctionValues() []DataMaskingFunction { + return original.PossibleDataMaskingFunctionValues() +} +func PossibleDataMaskingRuleStateValues() []DataMaskingRuleState { + return original.PossibleDataMaskingRuleStateValues() +} +func PossibleDataMaskingStateValues() []DataMaskingState { + return original.PossibleDataMaskingStateValues() +} func PossibleDatabaseEditionValues() []DatabaseEdition { return original.PossibleDatabaseEditionValues() } +func PossibleDisasterRecoveryConfigurationAutoFailoverValues() []DisasterRecoveryConfigurationAutoFailover { + return original.PossibleDisasterRecoveryConfigurationAutoFailoverValues() +} +func PossibleDisasterRecoveryConfigurationFailoverPolicyValues() []DisasterRecoveryConfigurationFailoverPolicy { + return original.PossibleDisasterRecoveryConfigurationFailoverPolicyValues() +} +func PossibleDisasterRecoveryConfigurationRoleValues() []DisasterRecoveryConfigurationRole { + return original.PossibleDisasterRecoveryConfigurationRoleValues() +} +func PossibleDisasterRecoveryConfigurationStatusValues() []DisasterRecoveryConfigurationStatus { + return original.PossibleDisasterRecoveryConfigurationStatusValues() +} func PossibleElasticPoolEditionValues() []ElasticPoolEdition { return original.PossibleElasticPoolEditionValues() } func PossibleElasticPoolStateValues() []ElasticPoolState { return original.PossibleElasticPoolStateValues() } +func PossibleGeoBackupPolicyStateValues() []GeoBackupPolicyState { + return original.PossibleGeoBackupPolicyStateValues() +} +func PossibleMaxSizeUnitsValues() []MaxSizeUnits { + return original.PossibleMaxSizeUnitsValues() +} +func PossiblePerformanceLevelUnitValues() []PerformanceLevelUnit { + return original.PossiblePerformanceLevelUnitValues() +} +func PossiblePrimaryAggregationTypeValues() []PrimaryAggregationType { + return original.PossiblePrimaryAggregationTypeValues() +} +func PossibleQueryAggregationFunctionValues() []QueryAggregationFunction { + return original.PossibleQueryAggregationFunctionValues() +} +func PossibleQueryExecutionTypeValues() []QueryExecutionType { + return original.PossibleQueryExecutionTypeValues() +} +func PossibleQueryMetricUnitValues() []QueryMetricUnit { + return original.PossibleQueryMetricUnitValues() +} +func PossibleQueryObservedMetricTypeValues() []QueryObservedMetricType { + return original.PossibleQueryObservedMetricTypeValues() +} func PossibleReadScaleValues() []ReadScale { return original.PossibleReadScaleValues() } @@ -456,6 +1008,9 @@ func PossibleReplicationRoleValues() []ReplicationRole { func PossibleReplicationStateValues() []ReplicationState { return original.PossibleReplicationStateValues() } +func PossibleRestorePointTypeValues() []RestorePointType { + return original.PossibleRestorePointTypeValues() +} func PossibleSampleNameValues() []SampleName { return original.PossibleSampleNameValues() } @@ -468,6 +1023,15 @@ func PossibleSecurityAlertPolicyStateValues() []SecurityAlertPolicyState { func PossibleSecurityAlertPolicyUseServerDefaultValues() []SecurityAlertPolicyUseServerDefault { return original.PossibleSecurityAlertPolicyUseServerDefaultValues() } +func PossibleServerConnectionTypeValues() []ServerConnectionType { + return original.PossibleServerConnectionTypeValues() +} +func PossibleServerStateValues() []ServerState { + return original.PossibleServerStateValues() +} +func PossibleServerVersionValues() []ServerVersion { + return original.PossibleServerVersionValues() +} func PossibleServiceObjectiveNameValues() []ServiceObjectiveName { return original.PossibleServiceObjectiveNameValues() } @@ -480,6 +1044,12 @@ func PossibleTransparentDataEncryptionActivityStatusValues() []TransparentDataEn func PossibleTransparentDataEncryptionStatusValues() []TransparentDataEncryptionStatus { return original.PossibleTransparentDataEncryptionStatusValues() } +func PossibleUnitDefinitionTypeValues() []UnitDefinitionType { + return original.PossibleUnitDefinitionTypeValues() +} +func PossibleUnitTypeValues() []UnitType { + return original.PossibleUnitTypeValues() +} func UserAgent() string { return original.UserAgent() + " profiles/preview" } diff --git a/profiles/preview/sql/mgmt/sql/sqlapi/models.go b/profiles/preview/sql/mgmt/sql/sqlapi/models.go index 8a1a24d93635..d641097b6ea9 100644 --- a/profiles/preview/sql/mgmt/sql/sqlapi/models.go +++ b/profiles/preview/sql/mgmt/sql/sqlapi/models.go @@ -21,15 +21,42 @@ package sqlapi import original "github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2014-04-01/sql/sqlapi" +type BackupLongTermRetentionPoliciesClientAPI = original.BackupLongTermRetentionPoliciesClientAPI +type BackupLongTermRetentionVaultsClientAPI = original.BackupLongTermRetentionVaultsClientAPI +type CapabilitiesClientAPI = original.CapabilitiesClientAPI +type DataMaskingPoliciesClientAPI = original.DataMaskingPoliciesClientAPI +type DataMaskingRulesClientAPI = original.DataMaskingRulesClientAPI +type DatabaseAdvisorsClientAPI = original.DatabaseAdvisorsClientAPI +type DatabaseConnectionPoliciesClientAPI = original.DatabaseConnectionPoliciesClientAPI +type DatabaseTableAuditingPoliciesClientAPI = original.DatabaseTableAuditingPoliciesClientAPI type DatabaseThreatDetectionPoliciesClientAPI = original.DatabaseThreatDetectionPoliciesClientAPI +type DatabaseUsagesClientAPI = original.DatabaseUsagesClientAPI type DatabasesClientAPI = original.DatabasesClientAPI +type DisasterRecoveryConfigurationsClientAPI = original.DisasterRecoveryConfigurationsClientAPI type ElasticPoolActivitiesClientAPI = original.ElasticPoolActivitiesClientAPI type ElasticPoolDatabaseActivitiesClientAPI = original.ElasticPoolDatabaseActivitiesClientAPI type ElasticPoolsClientAPI = original.ElasticPoolsClientAPI +type ExtensionsClientAPI = original.ExtensionsClientAPI type FirewallRulesClientAPI = original.FirewallRulesClientAPI +type GeoBackupPoliciesClientAPI = original.GeoBackupPoliciesClientAPI +type OperationsClientAPI = original.OperationsClientAPI +type QueriesClientAPI = original.QueriesClientAPI +type QueryStatisticsClientAPI = original.QueryStatisticsClientAPI +type QueryTextsClientAPI = original.QueryTextsClientAPI type RecommendedElasticPoolsClientAPI = original.RecommendedElasticPoolsClientAPI +type RecoverableDatabasesClientAPI = original.RecoverableDatabasesClientAPI type ReplicationLinksClientAPI = original.ReplicationLinksClientAPI +type RestorableDroppedDatabasesClientAPI = original.RestorableDroppedDatabasesClientAPI +type RestorePointsClientAPI = original.RestorePointsClientAPI +type ServerAdvisorsClientAPI = original.ServerAdvisorsClientAPI +type ServerAzureADAdministratorsClientAPI = original.ServerAzureADAdministratorsClientAPI +type ServerCommunicationLinksClientAPI = original.ServerCommunicationLinksClientAPI +type ServerConnectionPoliciesClientAPI = original.ServerConnectionPoliciesClientAPI +type ServerTableAuditingPoliciesClientAPI = original.ServerTableAuditingPoliciesClientAPI +type ServerUsagesClientAPI = original.ServerUsagesClientAPI type ServersClientAPI = original.ServersClientAPI +type ServiceObjectivesClientAPI = original.ServiceObjectivesClientAPI type ServiceTierAdvisorsClientAPI = original.ServiceTierAdvisorsClientAPI type TransparentDataEncryptionActivitiesClientAPI = original.TransparentDataEncryptionActivitiesClientAPI +type TransparentDataEncryptionConfigurationsClientAPI = original.TransparentDataEncryptionConfigurationsClientAPI type TransparentDataEncryptionsClientAPI = original.TransparentDataEncryptionsClientAPI diff --git a/profiles/preview/storagecache/mgmt/storagecache/models.go b/profiles/preview/storagecache/mgmt/storagecache/models.go new file mode 100644 index 000000000000..cbedb328a65a --- /dev/null +++ b/profiles/preview/storagecache/mgmt/storagecache/models.go @@ -0,0 +1,217 @@ +// +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 storagecache + +import ( + "context" + + original "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2019-11-01/storagecache" +) + +const ( + DefaultBaseURI = original.DefaultBaseURI +) + +type FirmwareStatusType = original.FirmwareStatusType + +const ( + Available FirmwareStatusType = original.Available + Unavailable FirmwareStatusType = original.Unavailable +) + +type HealthStateType = original.HealthStateType + +const ( + Degraded HealthStateType = original.Degraded + Down HealthStateType = original.Down + Flushing HealthStateType = original.Flushing + Healthy HealthStateType = original.Healthy + Stopped HealthStateType = original.Stopped + Stopping HealthStateType = original.Stopping + Transitioning HealthStateType = original.Transitioning + Unknown HealthStateType = original.Unknown + Upgrading HealthStateType = original.Upgrading +) + +type ProvisioningStateType = original.ProvisioningStateType + +const ( + Cancelled ProvisioningStateType = original.Cancelled + Creating ProvisioningStateType = original.Creating + Deleting ProvisioningStateType = original.Deleting + Failed ProvisioningStateType = original.Failed + Succeeded ProvisioningStateType = original.Succeeded + Updating ProvisioningStateType = original.Updating +) + +type ReasonCode = original.ReasonCode + +const ( + NotAvailableForSubscription ReasonCode = original.NotAvailableForSubscription + QuotaID ReasonCode = original.QuotaID +) + +type StorageTargetType = original.StorageTargetType + +const ( + StorageTargetTypeClfs StorageTargetType = original.StorageTargetTypeClfs + StorageTargetTypeNfs3 StorageTargetType = original.StorageTargetTypeNfs3 + StorageTargetTypeUnknown StorageTargetType = original.StorageTargetTypeUnknown +) + +type APIOperation = original.APIOperation +type APIOperationDisplay = original.APIOperationDisplay +type APIOperationListResult = original.APIOperationListResult +type APIOperationListResultIterator = original.APIOperationListResultIterator +type APIOperationListResultPage = original.APIOperationListResultPage +type BaseClient = original.BaseClient +type Cache = original.Cache +type CacheHealth = original.CacheHealth +type CacheProperties = original.CacheProperties +type CacheSku = original.CacheSku +type CacheUpgradeStatus = original.CacheUpgradeStatus +type CachesClient = original.CachesClient +type CachesCreateOrUpdateFuture = original.CachesCreateOrUpdateFuture +type CachesDeleteFuture = original.CachesDeleteFuture +type CachesFlushFuture = original.CachesFlushFuture +type CachesListResult = original.CachesListResult +type CachesListResultIterator = original.CachesListResultIterator +type CachesListResultPage = original.CachesListResultPage +type CachesStartFuture = original.CachesStartFuture +type CachesStopFuture = original.CachesStopFuture +type CachesUpgradeFirmwareFuture = original.CachesUpgradeFirmwareFuture +type ClfsTarget = original.ClfsTarget +type CloudError = original.CloudError +type CloudErrorBody = original.CloudErrorBody +type NamespaceJunction = original.NamespaceJunction +type Nfs3Target = original.Nfs3Target +type OperationsClient = original.OperationsClient +type ResourceSku = original.ResourceSku +type ResourceSkuCapabilities = original.ResourceSkuCapabilities +type ResourceSkuLocationInfo = original.ResourceSkuLocationInfo +type ResourceSkusResult = original.ResourceSkusResult +type ResourceSkusResultIterator = original.ResourceSkusResultIterator +type ResourceSkusResultPage = original.ResourceSkusResultPage +type Restriction = original.Restriction +type SetObject = original.SetObject +type SkusClient = original.SkusClient +type StorageTarget = original.StorageTarget +type StorageTargetProperties = original.StorageTargetProperties +type StorageTargetsClient = original.StorageTargetsClient +type StorageTargetsCreateOrUpdateFuture = original.StorageTargetsCreateOrUpdateFuture +type StorageTargetsDeleteFuture = original.StorageTargetsDeleteFuture +type StorageTargetsResult = original.StorageTargetsResult +type StorageTargetsResultIterator = original.StorageTargetsResultIterator +type StorageTargetsResultPage = original.StorageTargetsResultPage +type UnknownTarget = original.UnknownTarget +type UsageModel = original.UsageModel +type UsageModelDisplay = original.UsageModelDisplay +type UsageModelsClient = original.UsageModelsClient +type UsageModelsResult = original.UsageModelsResult +type UsageModelsResultIterator = original.UsageModelsResultIterator +type UsageModelsResultPage = original.UsageModelsResultPage + +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 NewCachesClient(subscriptionID string) CachesClient { + return original.NewCachesClient(subscriptionID) +} +func NewCachesClientWithBaseURI(baseURI string, subscriptionID string) CachesClient { + return original.NewCachesClientWithBaseURI(baseURI, subscriptionID) +} +func NewCachesListResultIterator(page CachesListResultPage) CachesListResultIterator { + return original.NewCachesListResultIterator(page) +} +func NewCachesListResultPage(getNextPage func(context.Context, CachesListResult) (CachesListResult, error)) CachesListResultPage { + return original.NewCachesListResultPage(getNextPage) +} +func NewOperationsClient(subscriptionID string) OperationsClient { + return original.NewOperationsClient(subscriptionID) +} +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) +} +func NewResourceSkusResultIterator(page ResourceSkusResultPage) ResourceSkusResultIterator { + return original.NewResourceSkusResultIterator(page) +} +func NewResourceSkusResultPage(getNextPage func(context.Context, ResourceSkusResult) (ResourceSkusResult, error)) ResourceSkusResultPage { + return original.NewResourceSkusResultPage(getNextPage) +} +func NewSkusClient(subscriptionID string) SkusClient { + return original.NewSkusClient(subscriptionID) +} +func NewSkusClientWithBaseURI(baseURI string, subscriptionID string) SkusClient { + return original.NewSkusClientWithBaseURI(baseURI, subscriptionID) +} +func NewStorageTargetsClient(subscriptionID string) StorageTargetsClient { + return original.NewStorageTargetsClient(subscriptionID) +} +func NewStorageTargetsClientWithBaseURI(baseURI string, subscriptionID string) StorageTargetsClient { + return original.NewStorageTargetsClientWithBaseURI(baseURI, subscriptionID) +} +func NewStorageTargetsResultIterator(page StorageTargetsResultPage) StorageTargetsResultIterator { + return original.NewStorageTargetsResultIterator(page) +} +func NewStorageTargetsResultPage(getNextPage func(context.Context, StorageTargetsResult) (StorageTargetsResult, error)) StorageTargetsResultPage { + return original.NewStorageTargetsResultPage(getNextPage) +} +func NewUsageModelsClient(subscriptionID string) UsageModelsClient { + return original.NewUsageModelsClient(subscriptionID) +} +func NewUsageModelsClientWithBaseURI(baseURI string, subscriptionID string) UsageModelsClient { + return original.NewUsageModelsClientWithBaseURI(baseURI, subscriptionID) +} +func NewUsageModelsResultIterator(page UsageModelsResultPage) UsageModelsResultIterator { + return original.NewUsageModelsResultIterator(page) +} +func NewUsageModelsResultPage(getNextPage func(context.Context, UsageModelsResult) (UsageModelsResult, error)) UsageModelsResultPage { + return original.NewUsageModelsResultPage(getNextPage) +} +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return original.NewWithBaseURI(baseURI, subscriptionID) +} +func PossibleFirmwareStatusTypeValues() []FirmwareStatusType { + return original.PossibleFirmwareStatusTypeValues() +} +func PossibleHealthStateTypeValues() []HealthStateType { + return original.PossibleHealthStateTypeValues() +} +func PossibleProvisioningStateTypeValues() []ProvisioningStateType { + return original.PossibleProvisioningStateTypeValues() +} +func PossibleReasonCodeValues() []ReasonCode { + return original.PossibleReasonCodeValues() +} +func PossibleStorageTargetTypeValues() []StorageTargetType { + return original.PossibleStorageTargetTypeValues() +} +func UserAgent() string { + return original.UserAgent() + " profiles/preview" +} +func Version() string { + return original.Version() +} diff --git a/profiles/preview/storagecache/mgmt/storagecache/storagecacheapi/models.go b/profiles/preview/storagecache/mgmt/storagecache/storagecacheapi/models.go new file mode 100644 index 000000000000..77b8ab88ba0b --- /dev/null +++ b/profiles/preview/storagecache/mgmt/storagecache/storagecacheapi/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 storagecacheapi + +import original "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2019-11-01/storagecache/storagecacheapi" + +type CachesClientAPI = original.CachesClientAPI +type OperationsClientAPI = original.OperationsClientAPI +type SkusClientAPI = original.SkusClientAPI +type StorageTargetsClientAPI = original.StorageTargetsClientAPI +type UsageModelsClientAPI = original.UsageModelsClientAPI diff --git a/profiles/preview/vmwarecloudsimple/mgmt/vmwarecloudsimple/models.go b/profiles/preview/vmwarecloudsimple/mgmt/vmwarecloudsimple/models.go index 16b467810cc4..e89218f20d0e 100644 --- a/profiles/preview/vmwarecloudsimple/mgmt/vmwarecloudsimple/models.go +++ b/profiles/preview/vmwarecloudsimple/mgmt/vmwarecloudsimple/models.go @@ -36,6 +36,13 @@ const ( Total AggregationType = original.Total ) +type Allocation = original.Allocation + +const ( + Dynamic Allocation = original.Dynamic + Static Allocation = original.Static +) + type DiskIndependenceMode = original.DiskIndependenceMode const ( @@ -102,6 +109,40 @@ const ( Suspend StopMode = original.Suspend ) +type Type = original.Type + +const ( + CUSTOMNAME Type = original.CUSTOMNAME + FIXED Type = original.FIXED + PREFIXBASED Type = original.PREFIXBASED + USERDEFINED Type = original.USERDEFINED + VIRTUALMACHINENAME Type = original.VIRTUALMACHINENAME +) + +type Type1 = original.Type1 + +const ( + Type1CUSTOM Type1 = original.Type1CUSTOM + Type1DHCPIP Type1 = original.Type1DHCPIP + Type1FIXEDIP Type1 = original.Type1FIXEDIP + Type1USERDEFINED Type1 = original.Type1USERDEFINED +) + +type Type2 = original.Type2 + +const ( + LINUX Type2 = original.LINUX + WINDOWS Type2 = original.WINDOWS + WINDOWSTEXT Type2 = original.WINDOWSTEXT +) + +type Type3 = original.Type3 + +const ( + Type3LINUX Type3 = original.Type3LINUX + Type3WINDOWS Type3 = original.Type3WINDOWS +) + type UsageCount = original.UsageCount const ( @@ -129,40 +170,54 @@ type AvailableOperationDisplay = original.AvailableOperationDisplay type AvailableOperationDisplayPropertyServiceSpecification = original.AvailableOperationDisplayPropertyServiceSpecification type AvailableOperationDisplayPropertyServiceSpecificationMetricsItem = original.AvailableOperationDisplayPropertyServiceSpecificationMetricsItem type AvailableOperationDisplayPropertyServiceSpecificationMetricsList = original.AvailableOperationDisplayPropertyServiceSpecificationMetricsList -type AvailableOperationsClient = original.AvailableOperationsClient type AvailableOperationsListResponse = original.AvailableOperationsListResponse type AvailableOperationsListResponseIterator = original.AvailableOperationsListResponseIterator type AvailableOperationsListResponsePage = original.AvailableOperationsListResponsePage type BaseClient = original.BaseClient type CSRPError = original.CSRPError type CSRPErrorBody = original.CSRPErrorBody +type CustomizationHostName = original.CustomizationHostName +type CustomizationIPAddress = original.CustomizationIPAddress +type CustomizationIPSettings = original.CustomizationIPSettings +type CustomizationIdentity = original.CustomizationIdentity +type CustomizationIdentityUserData = original.CustomizationIdentityUserData +type CustomizationNicSetting = original.CustomizationNicSetting +type CustomizationPoliciesClient = original.CustomizationPoliciesClient +type CustomizationPoliciesListResponse = original.CustomizationPoliciesListResponse +type CustomizationPoliciesListResponseIterator = original.CustomizationPoliciesListResponseIterator +type CustomizationPoliciesListResponsePage = original.CustomizationPoliciesListResponsePage +type CustomizationPolicy = original.CustomizationPolicy +type CustomizationPolicyProperties = original.CustomizationPolicyProperties +type CustomizationSpecification = original.CustomizationSpecification type DedicatedCloudNode = original.DedicatedCloudNode -type DedicatedCloudNodeClient = original.DedicatedCloudNodeClient -type DedicatedCloudNodeCreateOrUpdateFuture = original.DedicatedCloudNodeCreateOrUpdateFuture type DedicatedCloudNodeListResponse = original.DedicatedCloudNodeListResponse type DedicatedCloudNodeListResponseIterator = original.DedicatedCloudNodeListResponseIterator type DedicatedCloudNodeListResponsePage = original.DedicatedCloudNodeListResponsePage type DedicatedCloudNodeProperties = original.DedicatedCloudNodeProperties +type DedicatedCloudNodesClient = original.DedicatedCloudNodesClient +type DedicatedCloudNodesCreateOrUpdateFuture = original.DedicatedCloudNodesCreateOrUpdateFuture type DedicatedCloudService = original.DedicatedCloudService -type DedicatedCloudServiceClient = original.DedicatedCloudServiceClient -type DedicatedCloudServiceDeleteFuture = original.DedicatedCloudServiceDeleteFuture type DedicatedCloudServiceListResponse = original.DedicatedCloudServiceListResponse type DedicatedCloudServiceListResponseIterator = original.DedicatedCloudServiceListResponseIterator type DedicatedCloudServiceListResponsePage = original.DedicatedCloudServiceListResponsePage type DedicatedCloudServiceProperties = original.DedicatedCloudServiceProperties +type DedicatedCloudServicesClient = original.DedicatedCloudServicesClient +type DedicatedCloudServicesDeleteFuture = original.DedicatedCloudServicesDeleteFuture +type GuestOSCustomization = original.GuestOSCustomization +type GuestOSNICCustomization = original.GuestOSNICCustomization type OperationError = original.OperationError type OperationResource = original.OperationResource +type OperationsClient = original.OperationsClient type PatchPayload = original.PatchPayload type PrivateCloud = original.PrivateCloud -type PrivateCloudByRegionClient = original.PrivateCloudByRegionClient type PrivateCloudList = original.PrivateCloudList type PrivateCloudListIterator = original.PrivateCloudListIterator type PrivateCloudListPage = original.PrivateCloudListPage type PrivateCloudProperties = original.PrivateCloudProperties +type PrivateCloudsClient = original.PrivateCloudsClient type ResourcePool = original.ResourcePool -type ResourcePoolByPCClient = original.ResourcePoolByPCClient type ResourcePoolProperties = original.ResourcePoolProperties -type ResourcePoolsByPCClient = original.ResourcePoolsByPCClient +type ResourcePoolsClient = original.ResourcePoolsClient type ResourcePoolsListResponse = original.ResourcePoolsListResponse type ResourcePoolsListResponseIterator = original.ResourcePoolsListResponseIterator type ResourcePoolsListResponsePage = original.ResourcePoolsListResponsePage @@ -172,51 +227,43 @@ type SkuAvailabilityListResponse = original.SkuAvailabilityListResponse type SkuAvailabilityListResponseIterator = original.SkuAvailabilityListResponseIterator type SkuAvailabilityListResponsePage = original.SkuAvailabilityListResponsePage type SkuDescription = original.SkuDescription -type SkusAvailabilityWithinRegionClient = original.SkusAvailabilityWithinRegionClient +type SkusAvailabilityClient = original.SkusAvailabilityClient type Usage = original.Usage type UsageListResponse = original.UsageListResponse type UsageListResponseIterator = original.UsageListResponseIterator type UsageListResponsePage = original.UsageListResponsePage type UsageName = original.UsageName -type UsagesWithinRegionClient = original.UsagesWithinRegionClient +type UsagesClient = original.UsagesClient type VirtualDisk = original.VirtualDisk type VirtualDiskController = original.VirtualDiskController type VirtualMachine = original.VirtualMachine -type VirtualMachineClient = original.VirtualMachineClient -type VirtualMachineCreateOrUpdateFuture = original.VirtualMachineCreateOrUpdateFuture -type VirtualMachineDeleteFuture = original.VirtualMachineDeleteFuture type VirtualMachineListResponse = original.VirtualMachineListResponse type VirtualMachineListResponseIterator = original.VirtualMachineListResponseIterator type VirtualMachineListResponsePage = original.VirtualMachineListResponsePage type VirtualMachineProperties = original.VirtualMachineProperties -type VirtualMachineStartFuture = original.VirtualMachineStartFuture -type VirtualMachineStopFuture = original.VirtualMachineStopFuture type VirtualMachineStopMode = original.VirtualMachineStopMode type VirtualMachineTemplate = original.VirtualMachineTemplate -type VirtualMachineTemplateByPCClient = original.VirtualMachineTemplateByPCClient type VirtualMachineTemplateListResponse = original.VirtualMachineTemplateListResponse type VirtualMachineTemplateListResponseIterator = original.VirtualMachineTemplateListResponseIterator type VirtualMachineTemplateListResponsePage = original.VirtualMachineTemplateListResponsePage type VirtualMachineTemplateProperties = original.VirtualMachineTemplateProperties -type VirtualMachineTemplatesByPCClient = original.VirtualMachineTemplatesByPCClient -type VirtualMachineUpdateFuture = original.VirtualMachineUpdateFuture +type VirtualMachineTemplatesClient = original.VirtualMachineTemplatesClient +type VirtualMachinesClient = original.VirtualMachinesClient +type VirtualMachinesCreateOrUpdateFuture = original.VirtualMachinesCreateOrUpdateFuture +type VirtualMachinesDeleteFuture = original.VirtualMachinesDeleteFuture +type VirtualMachinesStartFuture = original.VirtualMachinesStartFuture +type VirtualMachinesStopFuture = original.VirtualMachinesStopFuture +type VirtualMachinesUpdateFuture = original.VirtualMachinesUpdateFuture type VirtualNetwork = original.VirtualNetwork -type VirtualNetworkByPCClient = original.VirtualNetworkByPCClient type VirtualNetworkListResponse = original.VirtualNetworkListResponse type VirtualNetworkListResponseIterator = original.VirtualNetworkListResponseIterator type VirtualNetworkListResponsePage = original.VirtualNetworkListResponsePage type VirtualNetworkProperties = original.VirtualNetworkProperties -type VirtualNetworksByPCClient = original.VirtualNetworksByPCClient +type VirtualNetworksClient = original.VirtualNetworksClient type VirtualNic = original.VirtualNic -func New(referer string, regionID string, subscriptionID string) BaseClient { - return original.New(referer, regionID, subscriptionID) -} -func NewAvailableOperationsClient(referer string, regionID string, subscriptionID string) AvailableOperationsClient { - return original.NewAvailableOperationsClient(referer, regionID, subscriptionID) -} -func NewAvailableOperationsClientWithBaseURI(baseURI string, referer string, regionID string, subscriptionID string) AvailableOperationsClient { - return original.NewAvailableOperationsClientWithBaseURI(baseURI, referer, regionID, subscriptionID) +func New(subscriptionID string, referer string) BaseClient { + return original.New(subscriptionID, referer) } func NewAvailableOperationsListResponseIterator(page AvailableOperationsListResponsePage) AvailableOperationsListResponseIterator { return original.NewAvailableOperationsListResponseIterator(page) @@ -224,11 +271,17 @@ func NewAvailableOperationsListResponseIterator(page AvailableOperationsListResp func NewAvailableOperationsListResponsePage(getNextPage func(context.Context, AvailableOperationsListResponse) (AvailableOperationsListResponse, error)) AvailableOperationsListResponsePage { return original.NewAvailableOperationsListResponsePage(getNextPage) } -func NewDedicatedCloudNodeClient(referer string, regionID string, subscriptionID string) DedicatedCloudNodeClient { - return original.NewDedicatedCloudNodeClient(referer, regionID, subscriptionID) +func NewCustomizationPoliciesClient(subscriptionID string, referer string) CustomizationPoliciesClient { + return original.NewCustomizationPoliciesClient(subscriptionID, referer) +} +func NewCustomizationPoliciesClientWithBaseURI(baseURI string, subscriptionID string, referer string) CustomizationPoliciesClient { + return original.NewCustomizationPoliciesClientWithBaseURI(baseURI, subscriptionID, referer) } -func NewDedicatedCloudNodeClientWithBaseURI(baseURI string, referer string, regionID string, subscriptionID string) DedicatedCloudNodeClient { - return original.NewDedicatedCloudNodeClientWithBaseURI(baseURI, referer, regionID, subscriptionID) +func NewCustomizationPoliciesListResponseIterator(page CustomizationPoliciesListResponsePage) CustomizationPoliciesListResponseIterator { + return original.NewCustomizationPoliciesListResponseIterator(page) +} +func NewCustomizationPoliciesListResponsePage(getNextPage func(context.Context, CustomizationPoliciesListResponse) (CustomizationPoliciesListResponse, error)) CustomizationPoliciesListResponsePage { + return original.NewCustomizationPoliciesListResponsePage(getNextPage) } func NewDedicatedCloudNodeListResponseIterator(page DedicatedCloudNodeListResponsePage) DedicatedCloudNodeListResponseIterator { return original.NewDedicatedCloudNodeListResponseIterator(page) @@ -236,11 +289,11 @@ func NewDedicatedCloudNodeListResponseIterator(page DedicatedCloudNodeListRespon func NewDedicatedCloudNodeListResponsePage(getNextPage func(context.Context, DedicatedCloudNodeListResponse) (DedicatedCloudNodeListResponse, error)) DedicatedCloudNodeListResponsePage { return original.NewDedicatedCloudNodeListResponsePage(getNextPage) } -func NewDedicatedCloudServiceClient(referer string, regionID string, subscriptionID string) DedicatedCloudServiceClient { - return original.NewDedicatedCloudServiceClient(referer, regionID, subscriptionID) +func NewDedicatedCloudNodesClient(subscriptionID string, referer string) DedicatedCloudNodesClient { + return original.NewDedicatedCloudNodesClient(subscriptionID, referer) } -func NewDedicatedCloudServiceClientWithBaseURI(baseURI string, referer string, regionID string, subscriptionID string) DedicatedCloudServiceClient { - return original.NewDedicatedCloudServiceClientWithBaseURI(baseURI, referer, regionID, subscriptionID) +func NewDedicatedCloudNodesClientWithBaseURI(baseURI string, subscriptionID string, referer string) DedicatedCloudNodesClient { + return original.NewDedicatedCloudNodesClientWithBaseURI(baseURI, subscriptionID, referer) } func NewDedicatedCloudServiceListResponseIterator(page DedicatedCloudServiceListResponsePage) DedicatedCloudServiceListResponseIterator { return original.NewDedicatedCloudServiceListResponseIterator(page) @@ -248,11 +301,17 @@ func NewDedicatedCloudServiceListResponseIterator(page DedicatedCloudServiceList func NewDedicatedCloudServiceListResponsePage(getNextPage func(context.Context, DedicatedCloudServiceListResponse) (DedicatedCloudServiceListResponse, error)) DedicatedCloudServiceListResponsePage { return original.NewDedicatedCloudServiceListResponsePage(getNextPage) } -func NewPrivateCloudByRegionClient(referer string, regionID string, subscriptionID string) PrivateCloudByRegionClient { - return original.NewPrivateCloudByRegionClient(referer, regionID, subscriptionID) +func NewDedicatedCloudServicesClient(subscriptionID string, referer string) DedicatedCloudServicesClient { + return original.NewDedicatedCloudServicesClient(subscriptionID, referer) +} +func NewDedicatedCloudServicesClientWithBaseURI(baseURI string, subscriptionID string, referer string) DedicatedCloudServicesClient { + return original.NewDedicatedCloudServicesClientWithBaseURI(baseURI, subscriptionID, referer) } -func NewPrivateCloudByRegionClientWithBaseURI(baseURI string, referer string, regionID string, subscriptionID string) PrivateCloudByRegionClient { - return original.NewPrivateCloudByRegionClientWithBaseURI(baseURI, referer, regionID, subscriptionID) +func NewOperationsClient(subscriptionID string, referer string) OperationsClient { + return original.NewOperationsClient(subscriptionID, referer) +} +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string, referer string) OperationsClient { + return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID, referer) } func NewPrivateCloudListIterator(page PrivateCloudListPage) PrivateCloudListIterator { return original.NewPrivateCloudListIterator(page) @@ -260,17 +319,17 @@ func NewPrivateCloudListIterator(page PrivateCloudListPage) PrivateCloudListIter func NewPrivateCloudListPage(getNextPage func(context.Context, PrivateCloudList) (PrivateCloudList, error)) PrivateCloudListPage { return original.NewPrivateCloudListPage(getNextPage) } -func NewResourcePoolByPCClient(referer string, regionID string, subscriptionID string) ResourcePoolByPCClient { - return original.NewResourcePoolByPCClient(referer, regionID, subscriptionID) +func NewPrivateCloudsClient(subscriptionID string, referer string) PrivateCloudsClient { + return original.NewPrivateCloudsClient(subscriptionID, referer) } -func NewResourcePoolByPCClientWithBaseURI(baseURI string, referer string, regionID string, subscriptionID string) ResourcePoolByPCClient { - return original.NewResourcePoolByPCClientWithBaseURI(baseURI, referer, regionID, subscriptionID) +func NewPrivateCloudsClientWithBaseURI(baseURI string, subscriptionID string, referer string) PrivateCloudsClient { + return original.NewPrivateCloudsClientWithBaseURI(baseURI, subscriptionID, referer) } -func NewResourcePoolsByPCClient(referer string, regionID string, subscriptionID string) ResourcePoolsByPCClient { - return original.NewResourcePoolsByPCClient(referer, regionID, subscriptionID) +func NewResourcePoolsClient(subscriptionID string, referer string) ResourcePoolsClient { + return original.NewResourcePoolsClient(subscriptionID, referer) } -func NewResourcePoolsByPCClientWithBaseURI(baseURI string, referer string, regionID string, subscriptionID string) ResourcePoolsByPCClient { - return original.NewResourcePoolsByPCClientWithBaseURI(baseURI, referer, regionID, subscriptionID) +func NewResourcePoolsClientWithBaseURI(baseURI string, subscriptionID string, referer string) ResourcePoolsClient { + return original.NewResourcePoolsClientWithBaseURI(baseURI, subscriptionID, referer) } func NewResourcePoolsListResponseIterator(page ResourcePoolsListResponsePage) ResourcePoolsListResponseIterator { return original.NewResourcePoolsListResponseIterator(page) @@ -284,11 +343,11 @@ func NewSkuAvailabilityListResponseIterator(page SkuAvailabilityListResponsePage func NewSkuAvailabilityListResponsePage(getNextPage func(context.Context, SkuAvailabilityListResponse) (SkuAvailabilityListResponse, error)) SkuAvailabilityListResponsePage { return original.NewSkuAvailabilityListResponsePage(getNextPage) } -func NewSkusAvailabilityWithinRegionClient(referer string, regionID string, subscriptionID string) SkusAvailabilityWithinRegionClient { - return original.NewSkusAvailabilityWithinRegionClient(referer, regionID, subscriptionID) +func NewSkusAvailabilityClient(subscriptionID string, referer string) SkusAvailabilityClient { + return original.NewSkusAvailabilityClient(subscriptionID, referer) } -func NewSkusAvailabilityWithinRegionClientWithBaseURI(baseURI string, referer string, regionID string, subscriptionID string) SkusAvailabilityWithinRegionClient { - return original.NewSkusAvailabilityWithinRegionClientWithBaseURI(baseURI, referer, regionID, subscriptionID) +func NewSkusAvailabilityClientWithBaseURI(baseURI string, subscriptionID string, referer string) SkusAvailabilityClient { + return original.NewSkusAvailabilityClientWithBaseURI(baseURI, subscriptionID, referer) } func NewUsageListResponseIterator(page UsageListResponsePage) UsageListResponseIterator { return original.NewUsageListResponseIterator(page) @@ -296,17 +355,11 @@ func NewUsageListResponseIterator(page UsageListResponsePage) UsageListResponseI func NewUsageListResponsePage(getNextPage func(context.Context, UsageListResponse) (UsageListResponse, error)) UsageListResponsePage { return original.NewUsageListResponsePage(getNextPage) } -func NewUsagesWithinRegionClient(referer string, regionID string, subscriptionID string) UsagesWithinRegionClient { - return original.NewUsagesWithinRegionClient(referer, regionID, subscriptionID) -} -func NewUsagesWithinRegionClientWithBaseURI(baseURI string, referer string, regionID string, subscriptionID string) UsagesWithinRegionClient { - return original.NewUsagesWithinRegionClientWithBaseURI(baseURI, referer, regionID, subscriptionID) +func NewUsagesClient(subscriptionID string, referer string) UsagesClient { + return original.NewUsagesClient(subscriptionID, referer) } -func NewVirtualMachineClient(referer string, regionID string, subscriptionID string) VirtualMachineClient { - return original.NewVirtualMachineClient(referer, regionID, subscriptionID) -} -func NewVirtualMachineClientWithBaseURI(baseURI string, referer string, regionID string, subscriptionID string) VirtualMachineClient { - return original.NewVirtualMachineClientWithBaseURI(baseURI, referer, regionID, subscriptionID) +func NewUsagesClientWithBaseURI(baseURI string, subscriptionID string, referer string) UsagesClient { + return original.NewUsagesClientWithBaseURI(baseURI, subscriptionID, referer) } func NewVirtualMachineListResponseIterator(page VirtualMachineListResponsePage) VirtualMachineListResponseIterator { return original.NewVirtualMachineListResponseIterator(page) @@ -314,29 +367,23 @@ func NewVirtualMachineListResponseIterator(page VirtualMachineListResponsePage) func NewVirtualMachineListResponsePage(getNextPage func(context.Context, VirtualMachineListResponse) (VirtualMachineListResponse, error)) VirtualMachineListResponsePage { return original.NewVirtualMachineListResponsePage(getNextPage) } -func NewVirtualMachineTemplateByPCClient(referer string, regionID string, subscriptionID string) VirtualMachineTemplateByPCClient { - return original.NewVirtualMachineTemplateByPCClient(referer, regionID, subscriptionID) -} -func NewVirtualMachineTemplateByPCClientWithBaseURI(baseURI string, referer string, regionID string, subscriptionID string) VirtualMachineTemplateByPCClient { - return original.NewVirtualMachineTemplateByPCClientWithBaseURI(baseURI, referer, regionID, subscriptionID) -} func NewVirtualMachineTemplateListResponseIterator(page VirtualMachineTemplateListResponsePage) VirtualMachineTemplateListResponseIterator { return original.NewVirtualMachineTemplateListResponseIterator(page) } func NewVirtualMachineTemplateListResponsePage(getNextPage func(context.Context, VirtualMachineTemplateListResponse) (VirtualMachineTemplateListResponse, error)) VirtualMachineTemplateListResponsePage { return original.NewVirtualMachineTemplateListResponsePage(getNextPage) } -func NewVirtualMachineTemplatesByPCClient(referer string, regionID string, subscriptionID string) VirtualMachineTemplatesByPCClient { - return original.NewVirtualMachineTemplatesByPCClient(referer, regionID, subscriptionID) +func NewVirtualMachineTemplatesClient(subscriptionID string, referer string) VirtualMachineTemplatesClient { + return original.NewVirtualMachineTemplatesClient(subscriptionID, referer) } -func NewVirtualMachineTemplatesByPCClientWithBaseURI(baseURI string, referer string, regionID string, subscriptionID string) VirtualMachineTemplatesByPCClient { - return original.NewVirtualMachineTemplatesByPCClientWithBaseURI(baseURI, referer, regionID, subscriptionID) +func NewVirtualMachineTemplatesClientWithBaseURI(baseURI string, subscriptionID string, referer string) VirtualMachineTemplatesClient { + return original.NewVirtualMachineTemplatesClientWithBaseURI(baseURI, subscriptionID, referer) } -func NewVirtualNetworkByPCClient(referer string, regionID string, subscriptionID string) VirtualNetworkByPCClient { - return original.NewVirtualNetworkByPCClient(referer, regionID, subscriptionID) +func NewVirtualMachinesClient(subscriptionID string, referer string) VirtualMachinesClient { + return original.NewVirtualMachinesClient(subscriptionID, referer) } -func NewVirtualNetworkByPCClientWithBaseURI(baseURI string, referer string, regionID string, subscriptionID string) VirtualNetworkByPCClient { - return original.NewVirtualNetworkByPCClientWithBaseURI(baseURI, referer, regionID, subscriptionID) +func NewVirtualMachinesClientWithBaseURI(baseURI string, subscriptionID string, referer string) VirtualMachinesClient { + return original.NewVirtualMachinesClientWithBaseURI(baseURI, subscriptionID, referer) } func NewVirtualNetworkListResponseIterator(page VirtualNetworkListResponsePage) VirtualNetworkListResponseIterator { return original.NewVirtualNetworkListResponseIterator(page) @@ -344,18 +391,21 @@ func NewVirtualNetworkListResponseIterator(page VirtualNetworkListResponsePage) func NewVirtualNetworkListResponsePage(getNextPage func(context.Context, VirtualNetworkListResponse) (VirtualNetworkListResponse, error)) VirtualNetworkListResponsePage { return original.NewVirtualNetworkListResponsePage(getNextPage) } -func NewVirtualNetworksByPCClient(referer string, regionID string, subscriptionID string) VirtualNetworksByPCClient { - return original.NewVirtualNetworksByPCClient(referer, regionID, subscriptionID) +func NewVirtualNetworksClient(subscriptionID string, referer string) VirtualNetworksClient { + return original.NewVirtualNetworksClient(subscriptionID, referer) } -func NewVirtualNetworksByPCClientWithBaseURI(baseURI string, referer string, regionID string, subscriptionID string) VirtualNetworksByPCClient { - return original.NewVirtualNetworksByPCClientWithBaseURI(baseURI, referer, regionID, subscriptionID) +func NewVirtualNetworksClientWithBaseURI(baseURI string, subscriptionID string, referer string) VirtualNetworksClient { + return original.NewVirtualNetworksClientWithBaseURI(baseURI, subscriptionID, referer) } -func NewWithBaseURI(baseURI string, referer string, regionID string, subscriptionID string) BaseClient { - return original.NewWithBaseURI(baseURI, referer, regionID, subscriptionID) +func NewWithBaseURI(baseURI string, subscriptionID string, referer string) BaseClient { + return original.NewWithBaseURI(baseURI, subscriptionID, referer) } func PossibleAggregationTypeValues() []AggregationType { return original.PossibleAggregationTypeValues() } +func PossibleAllocationValues() []Allocation { + return original.PossibleAllocationValues() +} func PossibleDiskIndependenceModeValues() []DiskIndependenceMode { return original.PossibleDiskIndependenceModeValues() } @@ -380,6 +430,18 @@ func PossiblePrivateCloudResourceTypeValues() []PrivateCloudResourceType { func PossibleStopModeValues() []StopMode { return original.PossibleStopModeValues() } +func PossibleType1Values() []Type1 { + return original.PossibleType1Values() +} +func PossibleType2Values() []Type2 { + return original.PossibleType2Values() +} +func PossibleType3Values() []Type3 { + return original.PossibleType3Values() +} +func PossibleTypeValues() []Type { + return original.PossibleTypeValues() +} func PossibleUsageCountValues() []UsageCount { return original.PossibleUsageCountValues() } diff --git a/profiles/preview/vmwarecloudsimple/mgmt/vmwarecloudsimple/vmwarecloudsimpleapi/models.go b/profiles/preview/vmwarecloudsimple/mgmt/vmwarecloudsimple/vmwarecloudsimpleapi/models.go index 30246cb7a73b..ed837345e317 100644 --- a/profiles/preview/vmwarecloudsimple/mgmt/vmwarecloudsimple/vmwarecloudsimpleapi/models.go +++ b/profiles/preview/vmwarecloudsimple/mgmt/vmwarecloudsimple/vmwarecloudsimpleapi/models.go @@ -21,17 +21,14 @@ package vmwarecloudsimpleapi import original "github.com/Azure/azure-sdk-for-go/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/vmwarecloudsimpleapi" -type AvailableOperationsClientAPI = original.AvailableOperationsClientAPI -type BaseClientAPI = original.BaseClientAPI -type DedicatedCloudNodeClientAPI = original.DedicatedCloudNodeClientAPI -type DedicatedCloudServiceClientAPI = original.DedicatedCloudServiceClientAPI -type PrivateCloudByRegionClientAPI = original.PrivateCloudByRegionClientAPI -type ResourcePoolByPCClientAPI = original.ResourcePoolByPCClientAPI -type ResourcePoolsByPCClientAPI = original.ResourcePoolsByPCClientAPI -type SkusAvailabilityWithinRegionClientAPI = original.SkusAvailabilityWithinRegionClientAPI -type UsagesWithinRegionClientAPI = original.UsagesWithinRegionClientAPI -type VirtualMachineClientAPI = original.VirtualMachineClientAPI -type VirtualMachineTemplateByPCClientAPI = original.VirtualMachineTemplateByPCClientAPI -type VirtualMachineTemplatesByPCClientAPI = original.VirtualMachineTemplatesByPCClientAPI -type VirtualNetworkByPCClientAPI = original.VirtualNetworkByPCClientAPI -type VirtualNetworksByPCClientAPI = original.VirtualNetworksByPCClientAPI +type CustomizationPoliciesClientAPI = original.CustomizationPoliciesClientAPI +type DedicatedCloudNodesClientAPI = original.DedicatedCloudNodesClientAPI +type DedicatedCloudServicesClientAPI = original.DedicatedCloudServicesClientAPI +type OperationsClientAPI = original.OperationsClientAPI +type PrivateCloudsClientAPI = original.PrivateCloudsClientAPI +type ResourcePoolsClientAPI = original.ResourcePoolsClientAPI +type SkusAvailabilityClientAPI = original.SkusAvailabilityClientAPI +type UsagesClientAPI = original.UsagesClientAPI +type VirtualMachineTemplatesClientAPI = original.VirtualMachineTemplatesClientAPI +type VirtualMachinesClientAPI = original.VirtualMachinesClientAPI +type VirtualNetworksClientAPI = original.VirtualNetworksClientAPI diff --git a/profiles/preview/web/mgmt/web/models.go b/profiles/preview/web/mgmt/web/models.go index 327ea975f9f7..09d21472b55a 100644 --- a/profiles/preview/web/mgmt/web/models.go +++ b/profiles/preview/web/mgmt/web/models.go @@ -192,6 +192,18 @@ const ( ComputeModeOptionsShared ComputeModeOptions = original.ComputeModeOptionsShared ) +type ConfigReferenceLocation = original.ConfigReferenceLocation + +const ( + ApplicationSetting ConfigReferenceLocation = original.ApplicationSetting +) + +type ConfigReferenceSource = original.ConfigReferenceSource + +const ( + KeyVault ConfigReferenceSource = original.KeyVault +) + type ConnectionStringType = original.ConnectionStringType const ( @@ -416,10 +428,9 @@ const ( type ManagedServiceIdentityType = original.ManagedServiceIdentityType const ( - ManagedServiceIdentityTypeNone ManagedServiceIdentityType = original.ManagedServiceIdentityTypeNone - ManagedServiceIdentityTypeSystemAssigned ManagedServiceIdentityType = original.ManagedServiceIdentityTypeSystemAssigned - ManagedServiceIdentityTypeSystemAssignedUserAssigned ManagedServiceIdentityType = original.ManagedServiceIdentityTypeSystemAssignedUserAssigned - ManagedServiceIdentityTypeUserAssigned ManagedServiceIdentityType = original.ManagedServiceIdentityTypeUserAssigned + ManagedServiceIdentityTypeNone ManagedServiceIdentityType = original.ManagedServiceIdentityTypeNone + ManagedServiceIdentityTypeSystemAssigned ManagedServiceIdentityType = original.ManagedServiceIdentityTypeSystemAssigned + ManagedServiceIdentityTypeUserAssigned ManagedServiceIdentityType = original.ManagedServiceIdentityTypeUserAssigned ) type MySQLMigrationType = original.MySQLMigrationType @@ -493,6 +504,20 @@ const ( TimeSeriesPerInstance RenderingType = original.TimeSeriesPerInstance ) +type ResolveStatus = original.ResolveStatus + +const ( + AccessToKeyVaultDenied ResolveStatus = original.AccessToKeyVaultDenied + Initialized ResolveStatus = original.Initialized + InvalidSyntax ResolveStatus = original.InvalidSyntax + MSINotEnabled ResolveStatus = original.MSINotEnabled + OtherReasons ResolveStatus = original.OtherReasons + Resolved ResolveStatus = original.Resolved + SecretNotFound ResolveStatus = original.SecretNotFound + SecretVersionNotFound ResolveStatus = original.SecretVersionNotFound + VaultNotFound ResolveStatus = original.VaultNotFound +) + type ResourceScopeType = original.ResourceScopeType const ( @@ -525,6 +550,7 @@ const ( ScmTypeOneDrive ScmType = original.ScmTypeOneDrive ScmTypeTfs ScmType = original.ScmTypeTfs ScmTypeVSO ScmType = original.ScmTypeVSO + ScmTypeVSTSRM ScmType = original.ScmTypeVSTSRM ) type SiteAvailabilityState = original.SiteAvailabilityState @@ -552,6 +578,14 @@ const ( WeightedTotalTraffic SiteLoadBalancing = original.WeightedTotalTraffic ) +type SiteRuntimeState = original.SiteRuntimeState + +const ( + READY SiteRuntimeState = original.READY + STOPPED SiteRuntimeState = original.STOPPED + UNKNOWN SiteRuntimeState = original.UNKNOWN +) + type SkuName = original.SkuName const ( @@ -631,19 +665,23 @@ const ( type WorkerSizeOptions = original.WorkerSizeOptions const ( - WorkerSizeOptionsD1 WorkerSizeOptions = original.WorkerSizeOptionsD1 - WorkerSizeOptionsD2 WorkerSizeOptions = original.WorkerSizeOptionsD2 - WorkerSizeOptionsD3 WorkerSizeOptions = original.WorkerSizeOptionsD3 - WorkerSizeOptionsDefault WorkerSizeOptions = original.WorkerSizeOptionsDefault - WorkerSizeOptionsLarge WorkerSizeOptions = original.WorkerSizeOptionsLarge - WorkerSizeOptionsMedium WorkerSizeOptions = original.WorkerSizeOptionsMedium - WorkerSizeOptionsSmall WorkerSizeOptions = original.WorkerSizeOptionsSmall + WorkerSizeOptionsD1 WorkerSizeOptions = original.WorkerSizeOptionsD1 + WorkerSizeOptionsD2 WorkerSizeOptions = original.WorkerSizeOptionsD2 + WorkerSizeOptionsD3 WorkerSizeOptions = original.WorkerSizeOptionsD3 + WorkerSizeOptionsDefault WorkerSizeOptions = original.WorkerSizeOptionsDefault + WorkerSizeOptionsLarge WorkerSizeOptions = original.WorkerSizeOptionsLarge + WorkerSizeOptionsMedium WorkerSizeOptions = original.WorkerSizeOptionsMedium + WorkerSizeOptionsNestedSmall WorkerSizeOptions = original.WorkerSizeOptionsNestedSmall + WorkerSizeOptionsSmall WorkerSizeOptions = original.WorkerSizeOptionsSmall ) type APIDefinitionInfo = original.APIDefinitionInfo +type APIKVReference = original.APIKVReference +type APIManagementConfig = original.APIManagementConfig type AbnormalTimePeriod = original.AbnormalTimePeriod type Address = original.Address type AddressResponse = original.AddressResponse +type AddressResponseProperties = original.AddressResponseProperties type AnalysisData = original.AnalysisData type AnalysisDefinition = original.AnalysisDefinition type AnalysisDefinitionProperties = original.AnalysisDefinitionProperties @@ -700,7 +738,10 @@ type ApplicationStack = original.ApplicationStack type ApplicationStackCollection = original.ApplicationStackCollection type ApplicationStackCollectionIterator = original.ApplicationStackCollectionIterator type ApplicationStackCollectionPage = original.ApplicationStackCollectionPage +type ApplicationStackResource = original.ApplicationStackResource type AppsClient = original.AppsClient +type AppsCopyProductionSlotFuture = original.AppsCopyProductionSlotFuture +type AppsCopySlotSlotFuture = original.AppsCopySlotSlotFuture type AppsCreateFunctionFuture = original.AppsCreateFunctionFuture type AppsCreateInstanceFunctionSlotFuture = original.AppsCreateInstanceFunctionSlotFuture type AppsCreateInstanceMSDeployOperationFuture = original.AppsCreateInstanceMSDeployOperationFuture @@ -774,12 +815,19 @@ type ConnStringInfo = original.ConnStringInfo type ConnStringValueTypePair = original.ConnStringValueTypePair type ConnectionStringDictionary = original.ConnectionStringDictionary type Contact = original.Contact +type ContainerCPUStatistics = original.ContainerCPUStatistics +type ContainerCPUUsage = original.ContainerCPUUsage +type ContainerInfo = original.ContainerInfo +type ContainerMemoryStatistics = original.ContainerMemoryStatistics +type ContainerNetworkInterfaceStatistics = original.ContainerNetworkInterfaceStatistics +type ContainerThrottlingData = original.ContainerThrottlingData type ContinuousWebJob = original.ContinuousWebJob type ContinuousWebJobCollection = original.ContinuousWebJobCollection type ContinuousWebJobCollectionIterator = original.ContinuousWebJobCollectionIterator type ContinuousWebJobCollectionPage = original.ContinuousWebJobCollectionPage type ContinuousWebJobProperties = original.ContinuousWebJobProperties type CorsSettings = original.CorsSettings +type CsmCopySlotEntity = original.CsmCopySlotEntity type CsmMoveResourceEnvelope = original.CsmMoveResourceEnvelope type CsmOperationCollection = original.CsmOperationCollection type CsmOperationCollectionIterator = original.CsmOperationCollectionIterator @@ -846,7 +894,7 @@ type DiagnosticMetricSet = original.DiagnosticMetricSet type DiagnosticsClient = original.DiagnosticsClient type Dimension = original.Dimension type Domain = original.Domain -type DomainAvailablilityCheckResult = original.DomainAvailablilityCheckResult +type DomainAvailabilityCheckResult = original.DomainAvailabilityCheckResult type DomainCollection = original.DomainCollection type DomainCollectionIterator = original.DomainCollectionIterator type DomainCollectionPage = original.DomainCollectionPage @@ -878,7 +926,6 @@ type FunctionEnvelopeCollectionPage = original.FunctionEnvelopeCollectionPage type FunctionEnvelopeProperties = original.FunctionEnvelopeProperties type FunctionSecrets = original.FunctionSecrets type FunctionSecretsProperties = original.FunctionSecretsProperties -type GeoDistribution = original.GeoDistribution type GeoRegion = original.GeoRegion type GeoRegionCollection = original.GeoRegionCollection type GeoRegionCollectionIterator = original.GeoRegionCollectionIterator @@ -921,6 +968,9 @@ type JobCollection = original.JobCollection type JobCollectionIterator = original.JobCollectionIterator type JobCollectionPage = original.JobCollectionPage type JobProperties = original.JobProperties +type KeyVaultReferenceCollection = original.KeyVaultReferenceCollection +type KeyVaultReferenceCollectionProperties = original.KeyVaultReferenceCollectionProperties +type KeyVaultReferenceResource = original.KeyVaultReferenceResource type ListCapability = original.ListCapability type ListCertificateEmail = original.ListCertificateEmail type ListCertificateOrderAction = original.ListCertificateOrderAction @@ -940,10 +990,7 @@ type MSDeployStatus = original.MSDeployStatus type MSDeployStatusProperties = original.MSDeployStatusProperties type ManagedServiceIdentity = original.ManagedServiceIdentity type ManagedServiceIdentityUserAssignedIdentitiesValue = original.ManagedServiceIdentityUserAssignedIdentitiesValue -type MetricAvailabilily = original.MetricAvailabilily type MetricAvailability = original.MetricAvailability -type MetricDefinition = original.MetricDefinition -type MetricDefinitionProperties = original.MetricDefinitionProperties type MetricSpecification = original.MetricSpecification type MigrateMySQLRequest = original.MigrateMySQLRequest type MigrateMySQLRequestProperties = original.MigrateMySQLRequestProperties @@ -1034,19 +1081,12 @@ type ResourceHealthMetadataCollection = original.ResourceHealthMetadataCollectio type ResourceHealthMetadataCollectionIterator = original.ResourceHealthMetadataCollectionIterator type ResourceHealthMetadataCollectionPage = original.ResourceHealthMetadataCollectionPage type ResourceHealthMetadataProperties = original.ResourceHealthMetadataProperties -type ResourceMetric = original.ResourceMetric type ResourceMetricAvailability = original.ResourceMetricAvailability -type ResourceMetricCollection = original.ResourceMetricCollection -type ResourceMetricCollectionIterator = original.ResourceMetricCollectionIterator -type ResourceMetricCollectionPage = original.ResourceMetricCollectionPage type ResourceMetricDefinition = original.ResourceMetricDefinition type ResourceMetricDefinitionCollection = original.ResourceMetricDefinitionCollection type ResourceMetricDefinitionCollectionIterator = original.ResourceMetricDefinitionCollectionIterator type ResourceMetricDefinitionCollectionPage = original.ResourceMetricDefinitionCollectionPage type ResourceMetricDefinitionProperties = original.ResourceMetricDefinitionProperties -type ResourceMetricName = original.ResourceMetricName -type ResourceMetricProperty = original.ResourceMetricProperty -type ResourceMetricValue = original.ResourceMetricValue type ResourceNameAvailability = original.ResourceNameAvailability type ResourceNameAvailabilityRequest = original.ResourceNameAvailabilityRequest type ResponseMetaData = original.ResponseMetaData @@ -1076,6 +1116,8 @@ type SiteExtensionInfoCollectionPage = original.SiteExtensionInfoCollectionPage type SiteExtensionInfoProperties = original.SiteExtensionInfoProperties type SiteInstance = original.SiteInstance type SiteInstanceProperties = original.SiteInstanceProperties +type SiteInstanceStatus = original.SiteInstanceStatus +type SiteInstanceStatusProperties = original.SiteInstanceStatusProperties type SiteLimits = original.SiteLimits type SiteLogsConfig = original.SiteLogsConfig type SiteLogsConfigProperties = original.SiteLogsConfigProperties @@ -1164,7 +1206,6 @@ type UsageCollectionPage = original.UsageCollectionPage type UsageProperties = original.UsageProperties type User = original.User type UserProperties = original.UserProperties -type ValidateContainerSettingsRequest = original.ValidateContainerSettingsRequest type ValidateProperties = original.ValidateProperties type ValidateRequest = original.ValidateRequest type ValidateResponse = original.ValidateResponse @@ -1506,12 +1547,6 @@ func NewResourceHealthMetadataCollectionIterator(page ResourceHealthMetadataColl func NewResourceHealthMetadataCollectionPage(getNextPage func(context.Context, ResourceHealthMetadataCollection) (ResourceHealthMetadataCollection, error)) ResourceHealthMetadataCollectionPage { return original.NewResourceHealthMetadataCollectionPage(getNextPage) } -func NewResourceMetricCollectionIterator(page ResourceMetricCollectionPage) ResourceMetricCollectionIterator { - return original.NewResourceMetricCollectionIterator(page) -} -func NewResourceMetricCollectionPage(getNextPage func(context.Context, ResourceMetricCollection) (ResourceMetricCollection, error)) ResourceMetricCollectionPage { - return original.NewResourceMetricCollectionPage(getNextPage) -} func NewResourceMetricDefinitionCollectionIterator(page ResourceMetricDefinitionCollectionPage) ResourceMetricDefinitionCollectionIterator { return original.NewResourceMetricDefinitionCollectionIterator(page) } @@ -1659,6 +1694,12 @@ func PossibleCloneAbilityResultValues() []CloneAbilityResult { func PossibleComputeModeOptionsValues() []ComputeModeOptions { return original.PossibleComputeModeOptionsValues() } +func PossibleConfigReferenceLocationValues() []ConfigReferenceLocation { + return original.PossibleConfigReferenceLocationValues() +} +func PossibleConfigReferenceSourceValues() []ConfigReferenceSource { + return original.PossibleConfigReferenceSourceValues() +} func PossibleConnectionStringTypeValues() []ConnectionStringType { return original.PossibleConnectionStringTypeValues() } @@ -1755,6 +1796,9 @@ func PossibleRedundancyModeValues() []RedundancyMode { func PossibleRenderingTypeValues() []RenderingType { return original.PossibleRenderingTypeValues() } +func PossibleResolveStatusValues() []ResolveStatus { + return original.PossibleResolveStatusValues() +} func PossibleResourceScopeTypeValues() []ResourceScopeType { return original.PossibleResourceScopeTypeValues() } @@ -1773,6 +1817,9 @@ func PossibleSiteExtensionTypeValues() []SiteExtensionType { func PossibleSiteLoadBalancingValues() []SiteLoadBalancing { return original.PossibleSiteLoadBalancingValues() } +func PossibleSiteRuntimeStateValues() []SiteRuntimeState { + return original.PossibleSiteRuntimeStateValues() +} func PossibleSkuNameValues() []SkuName { return original.PossibleSkuNameValues() } diff --git a/services/advisor/mgmt/2017-03-31/advisor/models.go b/services/advisor/mgmt/2017-03-31/advisor/models.go index a418c947c64d..0e4ae546d0a6 100644 --- a/services/advisor/mgmt/2017-03-31/advisor/models.go +++ b/services/advisor/mgmt/2017-03-31/advisor/models.go @@ -39,6 +39,8 @@ const ( Cost Category = "Cost" // HighAvailability ... HighAvailability Category = "HighAvailability" + // OperationalExcellence ... + OperationalExcellence Category = "OperationalExcellence" // Performance ... Performance Category = "Performance" // Security ... @@ -47,7 +49,7 @@ const ( // PossibleCategoryValues returns an array of possible values for the Category const type. func PossibleCategoryValues() []Category { - return []Category{Cost, HighAvailability, Performance, Security} + return []Category{Cost, HighAvailability, OperationalExcellence, Performance, Security} } // Impact enumerates the values for impact. @@ -258,7 +260,7 @@ func NewOperationEntityListResultPage(getNextPage func(context.Context, Operatio // RecommendationProperties the properties of the recommendation. type RecommendationProperties struct { - // Category - The category of the recommendation. Possible values include: 'HighAvailability', 'Security', 'Performance', 'Cost' + // Category - The category of the recommendation. Possible values include: 'HighAvailability', 'Security', 'Performance', 'Cost', 'OperationalExcellence' Category Category `json:"category,omitempty"` // Impact - The business impact of the recommendation. Possible values include: 'High', 'Medium', 'Low' Impact Impact `json:"impact,omitempty"` diff --git a/services/advisor/mgmt/2017-04-19/advisor/models.go b/services/advisor/mgmt/2017-04-19/advisor/models.go index 759a2b8c7acd..788887c60712 100644 --- a/services/advisor/mgmt/2017-04-19/advisor/models.go +++ b/services/advisor/mgmt/2017-04-19/advisor/models.go @@ -39,6 +39,8 @@ const ( Cost Category = "Cost" // HighAvailability ... HighAvailability Category = "HighAvailability" + // OperationalExcellence ... + OperationalExcellence Category = "OperationalExcellence" // Performance ... Performance Category = "Performance" // Security ... @@ -47,7 +49,7 @@ const ( // PossibleCategoryValues returns an array of possible values for the Category const type. func PossibleCategoryValues() []Category { - return []Category{Cost, HighAvailability, Performance, Security} + return []Category{Cost, HighAvailability, OperationalExcellence, Performance, Security} } // Impact enumerates the values for impact. @@ -749,7 +751,7 @@ func NewOperationEntityListResultPage(getNextPage func(context.Context, Operatio // RecommendationProperties the properties of the recommendation. type RecommendationProperties struct { - // Category - The category of the recommendation. Possible values include: 'HighAvailability', 'Security', 'Performance', 'Cost' + // Category - The category of the recommendation. Possible values include: 'HighAvailability', 'Security', 'Performance', 'Cost', 'OperationalExcellence' Category Category `json:"category,omitempty"` // Impact - The business impact of the recommendation. Possible values include: 'High', 'Medium', 'Low' Impact Impact `json:"impact,omitempty"` diff --git a/services/apimanagement/mgmt/2019-01-01/apimanagement/models.go b/services/apimanagement/mgmt/2019-01-01/apimanagement/models.go index 5895c52c995c..dd5b2d4daf44 100644 --- a/services/apimanagement/mgmt/2019-01-01/apimanagement/models.go +++ b/services/apimanagement/mgmt/2019-01-01/apimanagement/models.go @@ -4598,6 +4598,8 @@ type HTTPMessageDiagnostic struct { type IdentityProviderBaseParameters struct { // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' Type IdentityProviderType `json:"type,omitempty"` + // SigninTenant - The TenantId to use instead of Common when logging into Active Directory + SigninTenant *string `json:"signinTenant,omitempty"` // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. AllowedTenants *[]string `json:"allowedTenants,omitempty"` // Authority - OpenID Connect discovery endpoint hostname for AAD or AAD B2C. @@ -4695,6 +4697,8 @@ type IdentityProviderContractProperties struct { ClientSecret *string `json:"clientSecret,omitempty"` // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' Type IdentityProviderType `json:"type,omitempty"` + // SigninTenant - The TenantId to use instead of Common when logging into Active Directory + SigninTenant *string `json:"signinTenant,omitempty"` // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. AllowedTenants *[]string `json:"allowedTenants,omitempty"` // Authority - OpenID Connect discovery endpoint hostname for AAD or AAD B2C. @@ -4902,6 +4906,8 @@ type IdentityProviderUpdateProperties struct { ClientSecret *string `json:"clientSecret,omitempty"` // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' Type IdentityProviderType `json:"type,omitempty"` + // SigninTenant - The TenantId to use instead of Common when logging into Active Directory + SigninTenant *string `json:"signinTenant,omitempty"` // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. AllowedTenants *[]string `json:"allowedTenants,omitempty"` // Authority - OpenID Connect discovery endpoint hostname for AAD or AAD B2C. diff --git a/services/appconfiguration/mgmt/2019-10-01/appconfiguration/appconfigurationapi/interfaces.go b/services/appconfiguration/mgmt/2019-10-01/appconfiguration/appconfigurationapi/interfaces.go new file mode 100644 index 000000000000..ca316075bf32 --- /dev/null +++ b/services/appconfiguration/mgmt/2019-10-01/appconfiguration/appconfigurationapi/interfaces.go @@ -0,0 +1,46 @@ +package appconfigurationapi + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by 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/appconfiguration/mgmt/2019-10-01/appconfiguration" +) + +// ConfigurationStoresClientAPI contains the set of methods on the ConfigurationStoresClient type. +type ConfigurationStoresClientAPI interface { + Create(ctx context.Context, resourceGroupName string, configStoreName string, configStoreCreationParameters appconfiguration.ConfigurationStore) (result appconfiguration.ConfigurationStoresCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, configStoreName string) (result appconfiguration.ConfigurationStoresDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, configStoreName string) (result appconfiguration.ConfigurationStore, err error) + 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) +} + +var _ ConfigurationStoresClientAPI = (*appconfiguration.ConfigurationStoresClient)(nil) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + CheckNameAvailability(ctx context.Context, checkNameAvailabilityParameters appconfiguration.CheckNameAvailabilityParameters) (result appconfiguration.NameAvailabilityStatus, err error) + List(ctx context.Context, skipToken string) (result appconfiguration.OperationDefinitionListResultPage, err error) +} + +var _ OperationsClientAPI = (*appconfiguration.OperationsClient)(nil) diff --git a/services/preview/sql/mgmt/2018-06-15-preview/sql/client.go b/services/appconfiguration/mgmt/2019-10-01/appconfiguration/client.go similarity index 77% rename from services/preview/sql/mgmt/2018-06-15-preview/sql/client.go rename to services/appconfiguration/mgmt/2019-10-01/appconfiguration/client.go index 40ec57b36bab..ca729e4e34ff 100644 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/client.go +++ b/services/appconfiguration/mgmt/2019-10-01/appconfiguration/client.go @@ -1,8 +1,7 @@ -// Package sql implements the Azure ARM Sql service API version . +// Package appconfiguration implements the Azure ARM Appconfiguration service API version 2019-10-01. // -// The Azure SQL Database management API provides a RESTful set of web services that interact with Azure SQL Database -// services to manage your databases. The API enables you to create, retrieve, update, and delete databases. -package sql +// +package appconfiguration // Copyright (c) Microsoft and contributors. All rights reserved. // @@ -26,11 +25,11 @@ import ( ) const ( - // DefaultBaseURI is the default URI used for the service Sql + // DefaultBaseURI is the default URI used for the service Appconfiguration DefaultBaseURI = "https://management.azure.com" ) -// BaseClient is the base client for Sql. +// BaseClient is the base client for Appconfiguration. type BaseClient struct { autorest.Client BaseURI string diff --git a/services/appconfiguration/mgmt/2019-10-01/appconfiguration/configurationstores.go b/services/appconfiguration/mgmt/2019-10-01/appconfiguration/configurationstores.go new file mode 100644 index 000000000000..40daddce716f --- /dev/null +++ b/services/appconfiguration/mgmt/2019-10-01/appconfiguration/configurationstores.go @@ -0,0 +1,933 @@ +package appconfiguration + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the 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" +) + +// ConfigurationStoresClient is the client for the ConfigurationStores methods of the Appconfiguration service. +type ConfigurationStoresClient struct { + BaseClient +} + +// NewConfigurationStoresClient creates an instance of the ConfigurationStoresClient client. +func NewConfigurationStoresClient(subscriptionID string) ConfigurationStoresClient { + return NewConfigurationStoresClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewConfigurationStoresClientWithBaseURI creates an instance of the ConfigurationStoresClient client. +func NewConfigurationStoresClientWithBaseURI(baseURI string, subscriptionID string) ConfigurationStoresClient { + return ConfigurationStoresClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creates a configuration store with the specified parameters. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// configStoreName - the name of the configuration store. +// configStoreCreationParameters - the parameters for creating a configuration store. +func (client ConfigurationStoresClient) Create(ctx context.Context, resourceGroupName string, configStoreName string, configStoreCreationParameters ConfigurationStore) (result ConfigurationStoresCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationStoresClient.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: 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: configStoreCreationParameters, + Constraints: []validation.Constraint{{Target: "configStoreCreationParameters.Sku", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "configStoreCreationParameters.Sku.Name", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("appconfiguration.ConfigurationStoresClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, configStoreName, configStoreCreationParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ConfigurationStoresClient) CreatePreparer(ctx context.Context, resourceGroupName string, configStoreName string, configStoreCreationParameters ConfigurationStore) (*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-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}", pathParameters), + autorest.WithJSON(configStoreCreationParameters), + 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 ConfigurationStoresClient) CreateSender(req *http.Request) (future ConfigurationStoresCreateFuture, 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 ConfigurationStoresClient) CreateResponder(resp *http.Response) (result ConfigurationStore, 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 configuration store. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// configStoreName - the name of the configuration store. +func (client ConfigurationStoresClient) Delete(ctx context.Context, resourceGroupName string, configStoreName string) (result ConfigurationStoresDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationStoresClient.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: 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}}}}); err != nil { + return result, validation.NewError("appconfiguration.ConfigurationStoresClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, configStoreName) + if err != nil { + err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ConfigurationStoresClient) DeletePreparer(ctx context.Context, resourceGroupName string, configStoreName string) (*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-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}", 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 ConfigurationStoresClient) DeleteSender(req *http.Request) (future ConfigurationStoresDeleteFuture, 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 ConfigurationStoresClient) 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 configuration store. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// configStoreName - the name of the configuration store. +func (client ConfigurationStoresClient) Get(ctx context.Context, resourceGroupName string, configStoreName string) (result ConfigurationStore, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationStoresClient.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: 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}}}}); err != nil { + return result, validation.NewError("appconfiguration.ConfigurationStoresClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, configStoreName) + if err != nil { + err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ConfigurationStoresClient) GetPreparer(ctx context.Context, resourceGroupName string, configStoreName string) (*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-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}", 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 ConfigurationStoresClient) 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 ConfigurationStoresClient) GetResponder(resp *http.Response) (result ConfigurationStore, 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 configuration stores for a given subscription. +// Parameters: +// skipToken - a skip token is used to continue retrieving items after an operation returns a partial result. +// If a previous response contains a nextLink element, the value of the nextLink element will include a +// skipToken parameter that specifies a starting point to use for subsequent calls. +func (client ConfigurationStoresClient) List(ctx context.Context, skipToken string) (result ConfigurationStoreListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationStoresClient.List") + defer func() { + sc := -1 + if result.cslr.Response.Response != nil { + sc = result.cslr.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, "appconfiguration.ConfigurationStoresClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.cslr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresClient", "List", resp, "Failure sending request") + return + } + + result.cslr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ConfigurationStoresClient) ListPreparer(ctx context.Context, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + 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.AppConfiguration/configurationStores", 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 ConfigurationStoresClient) 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 ConfigurationStoresClient) ListResponder(resp *http.Response) (result ConfigurationStoreListResult, 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 ConfigurationStoresClient) listNextResults(ctx context.Context, lastResults ConfigurationStoreListResult) (result ConfigurationStoreListResult, err error) { + req, err := lastResults.configurationStoreListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresClient", "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, "appconfiguration.ConfigurationStoresClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ConfigurationStoresClient) ListComplete(ctx context.Context, skipToken string) (result ConfigurationStoreListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationStoresClient.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 the configuration stores for a given resource group. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// skipToken - a skip token is used to continue retrieving items after an operation returns a partial result. +// If a previous response contains a nextLink element, the value of the nextLink element will include a +// skipToken parameter that specifies a starting point to use for subsequent calls. +func (client ConfigurationStoresClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, skipToken string) (result ConfigurationStoreListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationStoresClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.cslr.Response.Response != nil { + sc = result.cslr.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, "appconfiguration.ConfigurationStoresClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.cslr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.cslr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client ConfigurationStoresClient) 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-10-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.AppConfiguration/configurationStores", 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 ConfigurationStoresClient) 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 ConfigurationStoresClient) ListByResourceGroupResponder(resp *http.Response) (result ConfigurationStoreListResult, 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 ConfigurationStoresClient) listByResourceGroupNextResults(ctx context.Context, lastResults ConfigurationStoreListResult) (result ConfigurationStoreListResult, err error) { + req, err := lastResults.configurationStoreListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresClient", "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, "appconfiguration.ConfigurationStoresClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client ConfigurationStoresClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, skipToken string) (result ConfigurationStoreListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationStoresClient.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 +} + +// ListKeys lists the access key for the specified configuration store. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// configStoreName - the name of the configuration store. +// skipToken - a skip token is used to continue retrieving items after an operation returns a partial result. +// If a previous response contains a nextLink element, the value of the nextLink element will include a +// skipToken parameter that specifies a starting point to use for subsequent calls. +func (client ConfigurationStoresClient) ListKeys(ctx context.Context, resourceGroupName string, configStoreName string, skipToken string) (result APIKeyListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationStoresClient.ListKeys") + defer func() { + sc := -1 + if result.aklr.Response.Response != nil { + sc = result.aklr.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}}}}); err != nil { + return result, validation.NewError("appconfiguration.ConfigurationStoresClient", "ListKeys", err.Error()) + } + + result.fn = client.listKeysNextResults + req, err := client.ListKeysPreparer(ctx, resourceGroupName, configStoreName, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresClient", "ListKeys", nil, "Failure preparing request") + return + } + + resp, err := client.ListKeysSender(req) + if err != nil { + result.aklr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresClient", "ListKeys", resp, "Failure sending request") + return + } + + result.aklr, err = client.ListKeysResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresClient", "ListKeys", resp, "Failure responding to request") + } + + return +} + +// ListKeysPreparer prepares the ListKeys request. +func (client ConfigurationStoresClient) ListKeysPreparer(ctx context.Context, resourceGroupName string, configStoreName string, skipToken string) (*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-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/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 ConfigurationStoresClient) ListKeysSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListKeysResponder handles the response to the ListKeys request. The method always +// closes the http.Response Body. +func (client ConfigurationStoresClient) ListKeysResponder(resp *http.Response) (result APIKeyListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listKeysNextResults retrieves the next set of results, if any. +func (client ConfigurationStoresClient) listKeysNextResults(ctx context.Context, lastResults APIKeyListResult) (result APIKeyListResult, err error) { + req, err := lastResults.aPIKeyListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresClient", "listKeysNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListKeysSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresClient", "listKeysNextResults", resp, "Failure sending next results request") + } + result, err = client.ListKeysResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresClient", "listKeysNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListKeysComplete enumerates all values, automatically crossing page boundaries as required. +func (client ConfigurationStoresClient) ListKeysComplete(ctx context.Context, resourceGroupName string, configStoreName string, skipToken string) (result APIKeyListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationStoresClient.ListKeys") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListKeys(ctx, resourceGroupName, configStoreName, skipToken) + 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-10-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.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. +// configStoreName - the name of the configuration store. +// regenerateKeyParameters - the parameters for regenerating an access key. +func (client ConfigurationStoresClient) RegenerateKey(ctx context.Context, resourceGroupName string, configStoreName string, regenerateKeyParameters RegenerateKeyParameters) (result APIKey, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationStoresClient.RegenerateKey") + defer func() { + 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}}}}); err != nil { + return result, validation.NewError("appconfiguration.ConfigurationStoresClient", "RegenerateKey", err.Error()) + } + + req, err := client.RegenerateKeyPreparer(ctx, resourceGroupName, configStoreName, regenerateKeyParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresClient", "RegenerateKey", nil, "Failure preparing request") + return + } + + resp, err := client.RegenerateKeySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresClient", "RegenerateKey", resp, "Failure sending request") + return + } + + result, err = client.RegenerateKeyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresClient", "RegenerateKey", resp, "Failure responding to request") + } + + return +} + +// RegenerateKeyPreparer prepares the RegenerateKey request. +func (client ConfigurationStoresClient) RegenerateKeyPreparer(ctx context.Context, resourceGroupName string, configStoreName string, regenerateKeyParameters RegenerateKeyParameters) (*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-10-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.AppConfiguration/configurationStores/{configStoreName}/RegenerateKey", pathParameters), + autorest.WithJSON(regenerateKeyParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RegenerateKeySender sends the RegenerateKey request. The method will close the +// http.Response Body if it receives an error. +func (client ConfigurationStoresClient) RegenerateKeySender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// RegenerateKeyResponder handles the response to the RegenerateKey request. The method always +// closes the http.Response Body. +func (client ConfigurationStoresClient) RegenerateKeyResponder(resp *http.Response) (result APIKey, 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 configuration store with the specified parameters. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// configStoreName - the name of the configuration store. +// configStoreUpdateParameters - the parameters for updating a configuration store. +func (client ConfigurationStoresClient) Update(ctx context.Context, resourceGroupName string, configStoreName string, configStoreUpdateParameters ConfigurationStoreUpdateParameters) (result ConfigurationStoresUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationStoresClient.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: 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}}}}); err != nil { + return result, validation.NewError("appconfiguration.ConfigurationStoresClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, configStoreName, configStoreUpdateParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ConfigurationStoresClient) UpdatePreparer(ctx context.Context, resourceGroupName string, configStoreName string, configStoreUpdateParameters ConfigurationStoreUpdateParameters) (*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-10-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.AppConfiguration/configurationStores/{configStoreName}", pathParameters), + autorest.WithJSON(configStoreUpdateParameters), + 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 ConfigurationStoresClient) UpdateSender(req *http.Request) (future ConfigurationStoresUpdateFuture, 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 ConfigurationStoresClient) UpdateResponder(resp *http.Response) (result ConfigurationStore, 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/appconfiguration/mgmt/2019-10-01/appconfiguration/models.go b/services/appconfiguration/mgmt/2019-10-01/appconfiguration/models.go new file mode 100644 index 000000000000..66ce6f2bd531 --- /dev/null +++ b/services/appconfiguration/mgmt/2019-10-01/appconfiguration/models.go @@ -0,0 +1,937 @@ +package appconfiguration + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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/appconfiguration/mgmt/2019-10-01/appconfiguration" + +// IdentityType enumerates the values for identity type. +type IdentityType string + +const ( + // None ... + None IdentityType = "None" + // SystemAssigned ... + SystemAssigned IdentityType = "SystemAssigned" + // SystemAssignedUserAssigned ... + SystemAssignedUserAssigned IdentityType = "SystemAssigned, UserAssigned" + // UserAssigned ... + UserAssigned IdentityType = "UserAssigned" +) + +// PossibleIdentityTypeValues returns an array of possible values for the IdentityType const type. +func PossibleIdentityTypeValues() []IdentityType { + return []IdentityType{None, SystemAssigned, SystemAssignedUserAssigned, UserAssigned} +} + +// 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" + // 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, Updating} +} + +// APIKey an API key used for authenticating with a configuration store endpoint. +type APIKey struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; The key ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; A name for the key describing its usage. + Name *string `json:"name,omitempty"` + // Value - READ-ONLY; The value of the key that is used for authentication purposes. + Value *string `json:"value,omitempty"` + // ConnectionString - READ-ONLY; A connection string that can be used by supporting clients for authentication. + ConnectionString *string `json:"connectionString,omitempty"` + // LastModified - READ-ONLY; The last time any of the key's properties were modified. + LastModified *date.Time `json:"lastModified,omitempty"` + // ReadOnly - READ-ONLY; Whether this key can only be used for read operations. + ReadOnly *bool `json:"readOnly,omitempty"` +} + +// APIKeyListResult the result of a request to list API keys. +type APIKeyListResult struct { + autorest.Response `json:"-"` + // Value - The collection value. + Value *[]APIKey `json:"value,omitempty"` + // NextLink - The URI that can be used to request the next set of paged results. + NextLink *string `json:"nextLink,omitempty"` +} + +// APIKeyListResultIterator provides access to a complete listing of APIKey values. +type APIKeyListResultIterator struct { + i int + page APIKeyListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *APIKeyListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/APIKeyListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *APIKeyListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter APIKeyListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter APIKeyListResultIterator) Response() APIKeyListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter APIKeyListResultIterator) Value() APIKey { + if !iter.page.NotDone() { + return APIKey{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the APIKeyListResultIterator type. +func NewAPIKeyListResultIterator(page APIKeyListResultPage) APIKeyListResultIterator { + return APIKeyListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (aklr APIKeyListResult) IsEmpty() bool { + return aklr.Value == nil || len(*aklr.Value) == 0 +} + +// aPIKeyListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (aklr APIKeyListResult) aPIKeyListResultPreparer(ctx context.Context) (*http.Request, error) { + if aklr.NextLink == nil || len(to.String(aklr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(aklr.NextLink))) +} + +// APIKeyListResultPage contains a page of APIKey values. +type APIKeyListResultPage struct { + fn func(context.Context, APIKeyListResult) (APIKeyListResult, error) + aklr APIKeyListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *APIKeyListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/APIKeyListResultPage.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.aklr) + if err != nil { + return err + } + page.aklr = 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 *APIKeyListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page APIKeyListResultPage) NotDone() bool { + return !page.aklr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page APIKeyListResultPage) Response() APIKeyListResult { + return page.aklr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page APIKeyListResultPage) Values() []APIKey { + if page.aklr.IsEmpty() { + return nil + } + return *page.aklr.Value +} + +// Creates a new instance of the APIKeyListResultPage type. +func NewAPIKeyListResultPage(getNextPage func(context.Context, APIKeyListResult) (APIKeyListResult, error)) APIKeyListResultPage { + return APIKeyListResultPage{fn: getNextPage} +} + +// CheckNameAvailabilityParameters parameters used for checking whether a resource name is available. +type CheckNameAvailabilityParameters struct { + // Name - The name to check for availability. + Name *string `json:"name,omitempty"` + // Type - The resource type to check for name availability. + Type *string `json:"type,omitempty"` +} + +// ConfigurationStore the configuration store along with all resource properties. The Configuration Store +// will have all information to begin utilizing it. +type ConfigurationStore struct { + autorest.Response `json:"-"` + // Identity - The managed identity information, if configured. + Identity *ResourceIdentity `json:"identity,omitempty"` + // ConfigurationStoreProperties - The properties of a configuration store. + *ConfigurationStoreProperties `json:"properties,omitempty"` + // Sku - The sku of the configuration store. + Sku *Sku `json:"sku,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 ConfigurationStore. +func (cs ConfigurationStore) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cs.Identity != nil { + objectMap["identity"] = cs.Identity + } + if cs.ConfigurationStoreProperties != nil { + objectMap["properties"] = cs.ConfigurationStoreProperties + } + if cs.Sku != nil { + objectMap["sku"] = cs.Sku + } + if cs.Location != nil { + objectMap["location"] = cs.Location + } + if cs.Tags != nil { + objectMap["tags"] = cs.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ConfigurationStore struct. +func (cs *ConfigurationStore) UnmarshalJSON(body []byte) error { + 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 ResourceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + cs.Identity = &identity + } + case "properties": + if v != nil { + var configurationStoreProperties ConfigurationStoreProperties + err = json.Unmarshal(*v, &configurationStoreProperties) + if err != nil { + return err + } + cs.ConfigurationStoreProperties = &configurationStoreProperties + } + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + cs.Sku = &sku + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + cs.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cs.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cs.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + cs.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + cs.Tags = tags + } + } + } + + return nil +} + +// ConfigurationStoreListResult the result of a request to list configuration stores. +type ConfigurationStoreListResult struct { + autorest.Response `json:"-"` + // Value - The collection value. + Value *[]ConfigurationStore `json:"value,omitempty"` + // NextLink - The URI that can be used to request the next set of paged results. + NextLink *string `json:"nextLink,omitempty"` +} + +// ConfigurationStoreListResultIterator provides access to a complete listing of ConfigurationStore values. +type ConfigurationStoreListResultIterator struct { + i int + page ConfigurationStoreListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ConfigurationStoreListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationStoreListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ConfigurationStoreListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ConfigurationStoreListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ConfigurationStoreListResultIterator) Response() ConfigurationStoreListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ConfigurationStoreListResultIterator) Value() ConfigurationStore { + if !iter.page.NotDone() { + return ConfigurationStore{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ConfigurationStoreListResultIterator type. +func NewConfigurationStoreListResultIterator(page ConfigurationStoreListResultPage) ConfigurationStoreListResultIterator { + return ConfigurationStoreListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (cslr ConfigurationStoreListResult) IsEmpty() bool { + return cslr.Value == nil || len(*cslr.Value) == 0 +} + +// configurationStoreListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (cslr ConfigurationStoreListResult) configurationStoreListResultPreparer(ctx context.Context) (*http.Request, error) { + if cslr.NextLink == nil || len(to.String(cslr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(cslr.NextLink))) +} + +// ConfigurationStoreListResultPage contains a page of ConfigurationStore values. +type ConfigurationStoreListResultPage struct { + fn func(context.Context, ConfigurationStoreListResult) (ConfigurationStoreListResult, error) + cslr ConfigurationStoreListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ConfigurationStoreListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationStoreListResultPage.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.cslr) + if err != nil { + return err + } + page.cslr = 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 *ConfigurationStoreListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ConfigurationStoreListResultPage) NotDone() bool { + return !page.cslr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ConfigurationStoreListResultPage) Response() ConfigurationStoreListResult { + return page.cslr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ConfigurationStoreListResultPage) Values() []ConfigurationStore { + if page.cslr.IsEmpty() { + return nil + } + return *page.cslr.Value +} + +// Creates a new instance of the ConfigurationStoreListResultPage type. +func NewConfigurationStoreListResultPage(getNextPage func(context.Context, ConfigurationStoreListResult) (ConfigurationStoreListResult, error)) ConfigurationStoreListResultPage { + return ConfigurationStoreListResultPage{fn: getNextPage} +} + +// ConfigurationStoreProperties the properties of a configuration store. +type ConfigurationStoreProperties struct { + // ProvisioningState - READ-ONLY; The provisioning state of the configuration store. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // CreationDate - READ-ONLY; The creation date of configuration store. + CreationDate *date.Time `json:"creationDate,omitempty"` + // Endpoint - READ-ONLY; The DNS endpoint where the configuration store API will be available. + Endpoint *string `json:"endpoint,omitempty"` +} + +// ConfigurationStoresCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ConfigurationStoresCreateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ConfigurationStoresCreateFuture) Result(client ConfigurationStoresClient) (cs ConfigurationStore, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("appconfiguration.ConfigurationStoresCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if cs.Response.Response, err = future.GetResult(sender); err == nil && cs.Response.Response.StatusCode != http.StatusNoContent { + cs, err = client.CreateResponder(cs.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresCreateFuture", "Result", cs.Response.Response, "Failure responding to request") + } + } + return +} + +// ConfigurationStoresDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ConfigurationStoresDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ConfigurationStoresDeleteFuture) Result(client ConfigurationStoresClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("appconfiguration.ConfigurationStoresDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ConfigurationStoresUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ConfigurationStoresUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ConfigurationStoresUpdateFuture) Result(client ConfigurationStoresClient) (cs ConfigurationStore, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("appconfiguration.ConfigurationStoresUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if cs.Response.Response, err = future.GetResult(sender); err == nil && cs.Response.Response.StatusCode != http.StatusNoContent { + cs, err = client.UpdateResponder(cs.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresUpdateFuture", "Result", cs.Response.Response, "Failure responding to request") + } + } + return +} + +// ConfigurationStoreUpdateParameters the parameters for updating a configuration store. +type ConfigurationStoreUpdateParameters struct { + // Properties - The properties for updating a configuration store. + Properties interface{} `json:"properties,omitempty"` + // Identity - The managed identity information for the configuration store. + Identity *ResourceIdentity `json:"identity,omitempty"` + // Sku - The SKU of the configuration store. + Sku *Sku `json:"sku,omitempty"` + // Tags - The ARM resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ConfigurationStoreUpdateParameters. +func (csup ConfigurationStoreUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if csup.Properties != nil { + objectMap["properties"] = csup.Properties + } + if csup.Identity != nil { + objectMap["identity"] = csup.Identity + } + if csup.Sku != nil { + objectMap["sku"] = csup.Sku + } + if csup.Tags != nil { + objectMap["tags"] = csup.Tags + } + return json.Marshal(objectMap) +} + +// Error appConfiguration error object. +type Error struct { + // Code - Error code. + Code *string `json:"code,omitempty"` + // Message - Error message. + 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:"-"` + // NameAvailable - READ-ONLY; The value indicating whether the resource name is available. + NameAvailable *bool `json:"nameAvailable,omitempty"` + // Message - READ-ONLY; If any, the error message that provides more detail for the reason that the name is not available. + Message *string `json:"message,omitempty"` + // Reason - READ-ONLY; If any, the reason that the name is not available. + Reason *string `json:"reason,omitempty"` +} + +// OperationDefinition the definition of a configuration store operation. +type OperationDefinition struct { + // Name - Operation name: {provider}/{resource}/{operation}. + Name *string `json:"name,omitempty"` + // Display - The display information for the configuration store operation. + Display *OperationDefinitionDisplay `json:"display,omitempty"` +} + +// OperationDefinitionDisplay the display information for a configuration store operation. +type OperationDefinitionDisplay struct { + // Provider - READ-ONLY; The resource provider name: Microsoft App Configuration." + 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"` +} + +// OperationDefinitionListResult the result of a request to list configuration store operations. +type OperationDefinitionListResult struct { + autorest.Response `json:"-"` + // Value - The collection value. + Value *[]OperationDefinition `json:"value,omitempty"` + // NextLink - The URI that can be used to request the next set of paged results. + NextLink *string `json:"nextLink,omitempty"` +} + +// OperationDefinitionListResultIterator provides access to a complete listing of OperationDefinition +// values. +type OperationDefinitionListResultIterator struct { + i int + page OperationDefinitionListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *OperationDefinitionListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationDefinitionListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *OperationDefinitionListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OperationDefinitionListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter OperationDefinitionListResultIterator) Response() OperationDefinitionListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter OperationDefinitionListResultIterator) Value() OperationDefinition { + if !iter.page.NotDone() { + return OperationDefinition{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OperationDefinitionListResultIterator type. +func NewOperationDefinitionListResultIterator(page OperationDefinitionListResultPage) OperationDefinitionListResultIterator { + return OperationDefinitionListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (odlr OperationDefinitionListResult) IsEmpty() bool { + return odlr.Value == nil || len(*odlr.Value) == 0 +} + +// operationDefinitionListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (odlr OperationDefinitionListResult) operationDefinitionListResultPreparer(ctx context.Context) (*http.Request, error) { + if odlr.NextLink == nil || len(to.String(odlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(odlr.NextLink))) +} + +// OperationDefinitionListResultPage contains a page of OperationDefinition values. +type OperationDefinitionListResultPage struct { + fn func(context.Context, OperationDefinitionListResult) (OperationDefinitionListResult, error) + odlr OperationDefinitionListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *OperationDefinitionListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationDefinitionListResultPage.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.odlr) + if err != nil { + return err + } + page.odlr = 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 *OperationDefinitionListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OperationDefinitionListResultPage) NotDone() bool { + return !page.odlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OperationDefinitionListResultPage) Response() OperationDefinitionListResult { + return page.odlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OperationDefinitionListResultPage) Values() []OperationDefinition { + if page.odlr.IsEmpty() { + return nil + } + return *page.odlr.Value +} + +// Creates a new instance of the OperationDefinitionListResultPage type. +func NewOperationDefinitionListResultPage(getNextPage func(context.Context, OperationDefinitionListResult) (OperationDefinitionListResult, error)) OperationDefinitionListResultPage { + return OperationDefinitionListResultPage{fn: getNextPage} +} + +// RegenerateKeyParameters the parameters used to regenerate an API key. +type RegenerateKeyParameters struct { + // ID - The id of the key to regenerate. + ID *string `json:"id,omitempty"` +} + +// Resource an Azure resource. +type Resource struct { + // ID - READ-ONLY; The resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource. This cannot be changed after the resource is created. + Location *string `json:"location,omitempty"` + // Tags - The tags of the resource. + Tags map[string]*string `json:"tags"` +} + +// 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) +} + +// ResourceIdentity ... +type ResourceIdentity struct { + // Type - The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user-assigned identities. The type 'None' will remove any identities. Possible values include: 'None', 'SystemAssigned', 'UserAssigned', 'SystemAssignedUserAssigned' + Type IdentityType `json:"type,omitempty"` + // UserAssignedIdentities - The list of user-assigned identities associated with the resource. The user-assigned identity dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + UserAssignedIdentities map[string]*UserIdentity `json:"userAssignedIdentities"` + // PrincipalID - READ-ONLY; The principal id of the identity. This property will only be provided for a system-assigned identity. + PrincipalID *string `json:"principalId,omitempty"` + // TenantID - READ-ONLY; The tenant id associated with the resource's identity. This property will only be provided for a system-assigned identity. + TenantID *string `json:"tenantId,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceIdentity. +func (ri ResourceIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ri.Type != "" { + objectMap["type"] = ri.Type + } + if ri.UserAssignedIdentities != nil { + objectMap["userAssignedIdentities"] = ri.UserAssignedIdentities + } + return json.Marshal(objectMap) +} + +// Sku describes a configuration store SKU. +type Sku struct { + // Name - The SKU name of the configuration store. + Name *string `json:"name,omitempty"` +} + +// UserIdentity ... +type UserIdentity struct { + // PrincipalID - READ-ONLY; The principal ID of the user-assigned identity. + PrincipalID *string `json:"principalId,omitempty"` + // ClientID - READ-ONLY; The client ID of the user-assigned identity. + ClientID *string `json:"clientId,omitempty"` +} diff --git a/services/appconfiguration/mgmt/2019-10-01/appconfiguration/operations.go b/services/appconfiguration/mgmt/2019-10-01/appconfiguration/operations.go new file mode 100644 index 000000000000..8840f7d4abdc --- /dev/null +++ b/services/appconfiguration/mgmt/2019-10-01/appconfiguration/operations.go @@ -0,0 +1,238 @@ +package appconfiguration + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the 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" +) + +// OperationsClient is the client for the Operations methods of the Appconfiguration 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)} +} + +// CheckNameAvailability checks whether the configuration store name is available for use. +// Parameters: +// checkNameAvailabilityParameters - the object containing information for the availability request. +func (client OperationsClient) CheckNameAvailability(ctx context.Context, checkNameAvailabilityParameters CheckNameAvailabilityParameters) (result NameAvailabilityStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.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: checkNameAvailabilityParameters, + Constraints: []validation.Constraint{{Target: "checkNameAvailabilityParameters.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "checkNameAvailabilityParameters.Type", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("appconfiguration.OperationsClient", "CheckNameAvailability", err.Error()) + } + + req, err := client.CheckNameAvailabilityPreparer(ctx, checkNameAvailabilityParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "appconfiguration.OperationsClient", "CheckNameAvailability", nil, "Failure preparing request") + return + } + + resp, err := client.CheckNameAvailabilitySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "appconfiguration.OperationsClient", "CheckNameAvailability", resp, "Failure sending request") + return + } + + result, err = client.CheckNameAvailabilityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "appconfiguration.OperationsClient", "CheckNameAvailability", resp, "Failure responding to request") + } + + return +} + +// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request. +func (client OperationsClient) CheckNameAvailabilityPreparer(ctx context.Context, checkNameAvailabilityParameters CheckNameAvailabilityParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/checkNameAvailability", pathParameters), + autorest.WithJSON(checkNameAvailabilityParameters), + 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 OperationsClient) 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 OperationsClient) CheckNameAvailabilityResponder(resp *http.Response) (result NameAvailabilityStatus, 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 operations available from this provider. +// Parameters: +// skipToken - a skip token is used to continue retrieving items after an operation returns a partial result. +// If a previous response contains a nextLink element, the value of the nextLink element will include a +// skipToken parameter that specifies a starting point to use for subsequent calls. +func (client OperationsClient) List(ctx context.Context, skipToken string) (result OperationDefinitionListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.odlr.Response.Response != nil { + sc = result.odlr.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, "appconfiguration.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.odlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "appconfiguration.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.odlr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "appconfiguration.OperationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context, skipToken string) (*http.Request, error) { + const APIVersion = "2019-10-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.WithPath("/providers/Microsoft.AppConfiguration/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 OperationDefinitionListResult, 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 OperationDefinitionListResult) (result OperationDefinitionListResult, err error) { + req, err := lastResults.operationDefinitionListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "appconfiguration.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, "appconfiguration.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "appconfiguration.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, skipToken string) (result OperationDefinitionListResultIterator, 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, skipToken) + return +} diff --git a/services/appconfiguration/mgmt/2019-10-01/appconfiguration/version.go b/services/appconfiguration/mgmt/2019-10-01/appconfiguration/version.go new file mode 100644 index 000000000000..122ce7758d0a --- /dev/null +++ b/services/appconfiguration/mgmt/2019-10-01/appconfiguration/version.go @@ -0,0 +1,30 @@ +package appconfiguration + +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 + " appconfiguration/2019-10-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/automation/mgmt/2015-10-31/automation/jobschedule.go b/services/automation/mgmt/2015-10-31/automation/jobschedule.go index 02866fdea827..78fd95ae7562 100644 --- a/services/automation/mgmt/2015-10-31/automation/jobschedule.go +++ b/services/automation/mgmt/2015-10-31/automation/jobschedule.go @@ -19,13 +19,12 @@ package automation import ( "context" - "net/http" - "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/validation" "github.com/Azure/go-autorest/tracing" "github.com/satori/go.uuid" + "net/http" ) // JobScheduleClient is the automation Client diff --git a/services/cdn/mgmt/2019-04-15/cdn/models.go b/services/cdn/mgmt/2019-04-15/cdn/models.go index 504a6cac16d5..30ad3746658e 100644 --- a/services/cdn/mgmt/2019-04-15/cdn/models.go +++ b/services/cdn/mgmt/2019-04-15/cdn/models.go @@ -79,6 +79,35 @@ func PossibleCertificateTypeValues() []CertificateType { return []CertificateType{Dedicated, Shared} } +// CookiesOperator enumerates the values for cookies operator. +type CookiesOperator string + +const ( + // Any ... + Any CookiesOperator = "Any" + // BeginsWith ... + BeginsWith CookiesOperator = "BeginsWith" + // Contains ... + Contains CookiesOperator = "Contains" + // EndsWith ... + EndsWith CookiesOperator = "EndsWith" + // Equal ... + Equal CookiesOperator = "Equal" + // GreaterThan ... + GreaterThan CookiesOperator = "GreaterThan" + // GreaterThanOrEqual ... + GreaterThanOrEqual CookiesOperator = "GreaterThanOrEqual" + // LessThan ... + LessThan CookiesOperator = "LessThan" + // LessThanOrEqual ... + LessThanOrEqual CookiesOperator = "LessThanOrEqual" +) + +// PossibleCookiesOperatorValues returns an array of possible values for the CookiesOperator const type. +func PossibleCookiesOperatorValues() []CookiesOperator { + return []CookiesOperator{Any, BeginsWith, Contains, EndsWith, Equal, GreaterThan, GreaterThanOrEqual, LessThan, LessThanOrEqual} +} + // CustomDomainResourceState enumerates the values for custom domain resource state. type CustomDomainResourceState string @@ -220,12 +249,33 @@ func PossibleHeaderActionValues() []HeaderAction { return []HeaderAction{Append, Delete, Overwrite} } +// MinimumTLSVersion enumerates the values for minimum tls version. +type MinimumTLSVersion string + +const ( + // None ... + None MinimumTLSVersion = "None" + // TLS10 ... + TLS10 MinimumTLSVersion = "TLS10" + // TLS12 ... + TLS12 MinimumTLSVersion = "TLS12" +) + +// PossibleMinimumTLSVersionValues returns an array of possible values for the MinimumTLSVersion const type. +func PossibleMinimumTLSVersionValues() []MinimumTLSVersion { + return []MinimumTLSVersion{None, TLS10, TLS12} +} + // Name enumerates the values for name. type Name string const ( + // NameCookies ... + NameCookies Name = "Cookies" // NameDeliveryRuleCondition ... NameDeliveryRuleCondition Name = "DeliveryRuleCondition" + // NameHTTPVersion ... + NameHTTPVersion Name = "HttpVersion" // NameIsDevice ... NameIsDevice Name = "IsDevice" // NamePostArgs ... @@ -254,7 +304,7 @@ const ( // PossibleNameValues returns an array of possible values for the Name const type. func PossibleNameValues() []Name { - return []Name{NameDeliveryRuleCondition, NameIsDevice, NamePostArgs, NameQueryString, NameRemoteAddress, NameRequestBody, NameRequestHeader, NameRequestMethod, NameRequestScheme, NameRequestURI, NameURLFileExtension, NameURLFileName, NameURLPath} + return []Name{NameCookies, NameDeliveryRuleCondition, NameHTTPVersion, NameIsDevice, NamePostArgs, NameQueryString, NameRemoteAddress, NameRequestBody, NameRequestHeader, NameRequestMethod, NameRequestScheme, NameRequestURI, NameURLFileExtension, NameURLFileName, NameURLPath} } // NameBasicDeliveryRuleAction enumerates the values for name basic delivery rule action. @@ -324,29 +374,29 @@ func PossibleOriginResourceStateValues() []OriginResourceState { type PostArgsOperator string const ( - // Any ... - Any PostArgsOperator = "Any" - // BeginsWith ... - BeginsWith PostArgsOperator = "BeginsWith" - // Contains ... - Contains PostArgsOperator = "Contains" - // EndsWith ... - EndsWith PostArgsOperator = "EndsWith" - // Equal ... - Equal PostArgsOperator = "Equal" - // GreaterThan ... - GreaterThan PostArgsOperator = "GreaterThan" - // GreaterThanOrEqual ... - GreaterThanOrEqual PostArgsOperator = "GreaterThanOrEqual" - // LessThan ... - LessThan PostArgsOperator = "LessThan" - // LessThanOrEqual ... - LessThanOrEqual PostArgsOperator = "LessThanOrEqual" + // PostArgsOperatorAny ... + PostArgsOperatorAny PostArgsOperator = "Any" + // PostArgsOperatorBeginsWith ... + PostArgsOperatorBeginsWith PostArgsOperator = "BeginsWith" + // PostArgsOperatorContains ... + PostArgsOperatorContains PostArgsOperator = "Contains" + // PostArgsOperatorEndsWith ... + PostArgsOperatorEndsWith PostArgsOperator = "EndsWith" + // PostArgsOperatorEqual ... + PostArgsOperatorEqual PostArgsOperator = "Equal" + // PostArgsOperatorGreaterThan ... + PostArgsOperatorGreaterThan PostArgsOperator = "GreaterThan" + // PostArgsOperatorGreaterThanOrEqual ... + PostArgsOperatorGreaterThanOrEqual PostArgsOperator = "GreaterThanOrEqual" + // PostArgsOperatorLessThan ... + PostArgsOperatorLessThan PostArgsOperator = "LessThan" + // PostArgsOperatorLessThanOrEqual ... + PostArgsOperatorLessThanOrEqual PostArgsOperator = "LessThanOrEqual" ) // PossiblePostArgsOperatorValues returns an array of possible values for the PostArgsOperator const type. func PossiblePostArgsOperatorValues() []PostArgsOperator { - return []PostArgsOperator{Any, BeginsWith, Contains, EndsWith, Equal, GreaterThan, GreaterThanOrEqual, LessThan, LessThanOrEqual} + return []PostArgsOperator{PostArgsOperatorAny, PostArgsOperatorBeginsWith, PostArgsOperatorContains, PostArgsOperatorEndsWith, PostArgsOperatorEqual, PostArgsOperatorGreaterThan, PostArgsOperatorGreaterThanOrEqual, PostArgsOperatorLessThan, PostArgsOperatorLessThanOrEqual} } // ProfileResourceState enumerates the values for profile resource state. @@ -770,6 +820,21 @@ type CidrIPAddress struct { PrefixLength *int32 `json:"prefixLength,omitempty"` } +// CookiesMatchConditionParameters defines the parameters for Cookies match conditions +type CookiesMatchConditionParameters struct { + OdataType *string `json:"@odata.type,omitempty"` + // Selector - Name of Cookies to be matched + Selector *string `json:"selector,omitempty"` + // Operator - Describes operator to be matched. Possible values include: 'Any', 'Equal', 'Contains', 'BeginsWith', 'EndsWith', 'LessThan', 'LessThanOrEqual', 'GreaterThan', 'GreaterThanOrEqual' + Operator CookiesOperator `json:"operator,omitempty"` + // NegateCondition - Describes if this is negate condition or not + NegateCondition *bool `json:"negateCondition,omitempty"` + // MatchValues - The match value for the condition of the delivery rule + MatchValues *[]string `json:"matchValues,omitempty"` + // Transforms - List of transforms + Transforms *[]Transform `json:"transforms,omitempty"` +} + // CustomDomain friendly domain name mapping to the endpoint hostname that the customer provides for // branding purposes, e.g. www.contoso.com. type CustomDomain struct { @@ -854,6 +919,8 @@ type BasicCustomDomainHTTPSParameters interface { type CustomDomainHTTPSParameters struct { // ProtocolType - Defines the TLS extension protocol that is used for secure delivery. Possible values include: 'ServerNameIndication', 'IPBased' ProtocolType ProtocolType `json:"protocolType,omitempty"` + // MinimumTLSVersion - TLS protocol version that will be used for Https. Possible values include: 'None', 'TLS10', 'TLS12' + MinimumTLSVersion MinimumTLSVersion `json:"minimumTlsVersion,omitempty"` // CertificateSource - Possible values include: 'CertificateSourceCustomDomainHTTPSParameters', 'CertificateSourceCdn', 'CertificateSourceAzureKeyVault' CertificateSource CertificateSource `json:"certificateSource,omitempty"` } @@ -906,6 +973,9 @@ func (cdhp CustomDomainHTTPSParameters) MarshalJSON() ([]byte, error) { if cdhp.ProtocolType != "" { objectMap["protocolType"] = cdhp.ProtocolType } + if cdhp.MinimumTLSVersion != "" { + objectMap["minimumTlsVersion"] = cdhp.MinimumTLSVersion + } if cdhp.CertificateSource != "" { objectMap["certificateSource"] = cdhp.CertificateSource } @@ -1127,12 +1197,91 @@ type CustomDomainProperties struct { CustomHTTPSProvisioningState CustomHTTPSProvisioningState `json:"customHttpsProvisioningState,omitempty"` // CustomHTTPSProvisioningSubstate - READ-ONLY; Provisioning substate shows the progress of custom HTTPS enabling/disabling process step by step. Possible values include: 'SubmittingDomainControlValidationRequest', 'PendingDomainControlValidationREquestApproval', 'DomainControlValidationRequestApproved', 'DomainControlValidationRequestRejected', 'DomainControlValidationRequestTimedOut', 'IssuingCertificate', 'DeployingCertificate', 'CertificateDeployed', 'DeletingCertificate', 'CertificateDeleted' CustomHTTPSProvisioningSubstate CustomHTTPSProvisioningSubstate `json:"customHttpsProvisioningSubstate,omitempty"` + // CustomHTTPSParameters - Certificate parameters for securing custom HTTPS + CustomHTTPSParameters BasicCustomDomainHTTPSParameters `json:"customHttpsParameters,omitempty"` // ValidationData - Special validation or data may be required when delivering CDN to some regions due to local compliance reasons. E.g. ICP license number of a custom domain is required to deliver content in China. ValidationData *string `json:"validationData,omitempty"` // ProvisioningState - READ-ONLY; Provisioning status of the custom domain. ProvisioningState *string `json:"provisioningState,omitempty"` } +// UnmarshalJSON is the custom unmarshaler for CustomDomainProperties struct. +func (cdp *CustomDomainProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "hostName": + if v != nil { + var hostName string + err = json.Unmarshal(*v, &hostName) + if err != nil { + return err + } + cdp.HostName = &hostName + } + case "resourceState": + if v != nil { + var resourceState CustomDomainResourceState + err = json.Unmarshal(*v, &resourceState) + if err != nil { + return err + } + cdp.ResourceState = resourceState + } + case "customHttpsProvisioningState": + if v != nil { + var customHTTPSProvisioningState CustomHTTPSProvisioningState + err = json.Unmarshal(*v, &customHTTPSProvisioningState) + if err != nil { + return err + } + cdp.CustomHTTPSProvisioningState = customHTTPSProvisioningState + } + case "customHttpsProvisioningSubstate": + if v != nil { + var customHTTPSProvisioningSubstate CustomHTTPSProvisioningSubstate + err = json.Unmarshal(*v, &customHTTPSProvisioningSubstate) + if err != nil { + return err + } + cdp.CustomHTTPSProvisioningSubstate = customHTTPSProvisioningSubstate + } + case "customHttpsParameters": + if v != nil { + customHTTPSParameters, err := unmarshalBasicCustomDomainHTTPSParameters(*v) + if err != nil { + return err + } + cdp.CustomHTTPSParameters = customHTTPSParameters + } + case "validationData": + if v != nil { + var validationData string + err = json.Unmarshal(*v, &validationData) + if err != nil { + return err + } + cdp.ValidationData = &validationData + } + case "provisioningState": + if v != nil { + var provisioningState string + err = json.Unmarshal(*v, &provisioningState) + if err != nil { + return err + } + cdp.ProvisioningState = &provisioningState + } + } + } + + return nil +} + // CustomDomainPropertiesParameters the JSON object that contains the properties of the custom domain to // create. type CustomDomainPropertiesParameters struct { @@ -1580,13 +1729,15 @@ type BasicDeliveryRuleCondition interface { AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) + AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) + AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) } // DeliveryRuleCondition a condition for the delivery rule. type DeliveryRuleCondition struct { - // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameIsDevice' + // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' Name Name `json:"name,omitempty"` } @@ -1642,6 +1793,14 @@ func unmarshalBasicDeliveryRuleCondition(body []byte) (BasicDeliveryRuleConditio var drufnc DeliveryRuleURLFileNameCondition err := json.Unmarshal(body, &drufnc) return drufnc, err + case string(NameHTTPVersion): + var drhvc DeliveryRuleHTTPVersionCondition + err := json.Unmarshal(body, &drhvc) + return drhvc, err + case string(NameCookies): + var drcc DeliveryRuleCookiesCondition + err := json.Unmarshal(body, &drcc) + return drcc, err case string(NameIsDevice): var dridc DeliveryRuleIsDeviceCondition err := json.Unmarshal(body, &dridc) @@ -1736,6 +1895,16 @@ func (drc DeliveryRuleCondition) AsDeliveryRuleURLFileNameCondition() (*Delivery return nil, false } +// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. +func (drc DeliveryRuleCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { + return nil, false +} + +// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. +func (drc DeliveryRuleCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { + return nil, false +} + // AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. func (drc DeliveryRuleCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { return nil, false @@ -1751,11 +1920,213 @@ func (drc DeliveryRuleCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRu return &drc, true } +// DeliveryRuleCookiesCondition defines the Cookies condition for the delivery rule. +type DeliveryRuleCookiesCondition struct { + // Parameters - Defines the parameters for the condition. + Parameters *CookiesMatchConditionParameters `json:"parameters,omitempty"` + // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' + Name Name `json:"name,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeliveryRuleCookiesCondition. +func (drcc DeliveryRuleCookiesCondition) MarshalJSON() ([]byte, error) { + drcc.Name = NameCookies + objectMap := make(map[string]interface{}) + if drcc.Parameters != nil { + objectMap["parameters"] = drcc.Parameters + } + if drcc.Name != "" { + objectMap["name"] = drcc.Name + } + return json.Marshal(objectMap) +} + +// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. +func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. +func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { + return nil, false +} + +// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. +func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { + return nil, false +} + +// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. +func (drcc DeliveryRuleCookiesCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. +func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. +func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. +func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. +func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. +func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. +func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. +func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { + return nil, false +} + +// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. +func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { + return nil, false +} + +// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. +func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { + return &drcc, true +} + +// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. +func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { + return nil, false +} + +// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. +func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { + return nil, false +} + +// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. +func (drcc DeliveryRuleCookiesCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { + return &drcc, true +} + +// DeliveryRuleHTTPVersionCondition defines the HttpVersion condition for the delivery rule. +type DeliveryRuleHTTPVersionCondition struct { + // Parameters - Defines the parameters for the condition. + Parameters *HTTPVersionMatchConditionParameters `json:"parameters,omitempty"` + // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' + Name Name `json:"name,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeliveryRuleHTTPVersionCondition. +func (drhvc DeliveryRuleHTTPVersionCondition) MarshalJSON() ([]byte, error) { + drhvc.Name = NameHTTPVersion + objectMap := make(map[string]interface{}) + if drhvc.Parameters != nil { + objectMap["parameters"] = drhvc.Parameters + } + if drhvc.Name != "" { + objectMap["name"] = drhvc.Name + } + return json.Marshal(objectMap) +} + +// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. +func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. +func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { + return nil, false +} + +// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. +func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { + return nil, false +} + +// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. +func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. +func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. +func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. +func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. +func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. +func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. +func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. +func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { + return nil, false +} + +// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. +func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { + return &drhvc, true +} + +// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. +func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { + return nil, false +} + +// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. +func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { + return nil, false +} + +// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. +func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { + return nil, false +} + +// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. +func (drhvc DeliveryRuleHTTPVersionCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { + return &drhvc, true +} + // DeliveryRuleIsDeviceCondition defines the IsDevice condition for the delivery rule. type DeliveryRuleIsDeviceCondition struct { // Parameters - Defines the parameters for the condition. Parameters *IsDeviceMatchConditionParameters `json:"parameters,omitempty"` - // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameIsDevice' + // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' Name Name `json:"name,omitempty"` } @@ -1827,6 +2198,16 @@ func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleURLFileNameCondition() return nil, false } +// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. +func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { + return nil, false +} + +// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. +func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { + return nil, false +} + // AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { return &dridc, true @@ -1846,7 +2227,7 @@ func (dridc DeliveryRuleIsDeviceCondition) AsBasicDeliveryRuleCondition() (Basic type DeliveryRulePostArgsCondition struct { // Parameters - Defines the parameters for the condition. Parameters *PostArgsMatchConditionParameters `json:"parameters,omitempty"` - // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameIsDevice' + // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' Name Name `json:"name,omitempty"` } @@ -1918,6 +2299,16 @@ func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleURLFileNameCondition() return nil, false } +// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. +func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { + return nil, false +} + +// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. +func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { + return nil, false +} + // AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { return nil, false @@ -1937,7 +2328,7 @@ func (drpac DeliveryRulePostArgsCondition) AsBasicDeliveryRuleCondition() (Basic type DeliveryRuleQueryStringCondition struct { // Parameters - Defines the parameters for the condition. Parameters *QueryStringMatchConditionParameters `json:"parameters,omitempty"` - // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameIsDevice' + // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' Name Name `json:"name,omitempty"` } @@ -2009,6 +2400,16 @@ func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleURLFileNameCondition return nil, false } +// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. +func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { + return nil, false +} + +// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. +func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { + return nil, false +} + // AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { return nil, false @@ -2028,7 +2429,7 @@ func (drqsc DeliveryRuleQueryStringCondition) AsBasicDeliveryRuleCondition() (Ba type DeliveryRuleRemoteAddressCondition struct { // Parameters - Defines the parameters for the condition. Parameters *RemoteAddressMatchConditionParameters `json:"parameters,omitempty"` - // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameIsDevice' + // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' Name Name `json:"name,omitempty"` } @@ -2100,6 +2501,16 @@ func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleURLFileNameConditi return nil, false } +// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. +func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { + return nil, false +} + +// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. +func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { + return nil, false +} + // AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { return nil, false @@ -2119,7 +2530,7 @@ func (drrac DeliveryRuleRemoteAddressCondition) AsBasicDeliveryRuleCondition() ( type DeliveryRuleRequestBodyCondition struct { // Parameters - Defines the parameters for the condition. Parameters *RequestBodyMatchConditionParameters `json:"parameters,omitempty"` - // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameIsDevice' + // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' Name Name `json:"name,omitempty"` } @@ -2191,6 +2602,16 @@ func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleURLFileNameCondition return nil, false } +// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. +func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { + return nil, false +} + +// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. +func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { + return nil, false +} + // AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { return nil, false @@ -2271,7 +2692,7 @@ func (drrha DeliveryRuleRequestHeaderAction) AsBasicDeliveryRuleAction() (BasicD type DeliveryRuleRequestHeaderCondition struct { // Parameters - Defines the parameters for the condition. Parameters *RequestHeaderMatchConditionParameters `json:"parameters,omitempty"` - // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameIsDevice' + // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' Name Name `json:"name,omitempty"` } @@ -2343,6 +2764,16 @@ func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleURLFileNameConditi return nil, false } +// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. +func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { + return nil, false +} + +// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. +func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { + return nil, false +} + // AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { return nil, false @@ -2362,7 +2793,7 @@ func (drrhc DeliveryRuleRequestHeaderCondition) AsBasicDeliveryRuleCondition() ( type DeliveryRuleRequestMethodCondition struct { // Parameters - Defines the parameters for the condition. Parameters *RequestMethodMatchConditionParameters `json:"parameters,omitempty"` - // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameIsDevice' + // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' Name Name `json:"name,omitempty"` } @@ -2434,6 +2865,16 @@ func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleURLFileNameConditi return nil, false } +// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. +func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { + return nil, false +} + +// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. +func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { + return nil, false +} + // AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { return nil, false @@ -2453,7 +2894,7 @@ func (drrmc DeliveryRuleRequestMethodCondition) AsBasicDeliveryRuleCondition() ( type DeliveryRuleRequestSchemeCondition struct { // Parameters - Defines the parameters for the condition. Parameters *RequestSchemeMatchConditionParameters `json:"parameters,omitempty"` - // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameIsDevice' + // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' Name Name `json:"name,omitempty"` } @@ -2525,6 +2966,16 @@ func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleURLFileNameConditi return nil, false } +// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. +func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { + return nil, false +} + +// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. +func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { + return nil, false +} + // AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { return nil, false @@ -2544,7 +2995,7 @@ func (drrsc DeliveryRuleRequestSchemeCondition) AsBasicDeliveryRuleCondition() ( type DeliveryRuleRequestURICondition struct { // Parameters - Defines the parameters for the condition. Parameters *RequestURIMatchConditionParameters `json:"parameters,omitempty"` - // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameIsDevice' + // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' Name Name `json:"name,omitempty"` } @@ -2616,6 +3067,16 @@ func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleURLFileNameCondition( return nil, false } +// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. +func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { + return nil, false +} + +// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. +func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { + return nil, false +} + // AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { return nil, false @@ -2696,7 +3157,7 @@ func (drrha DeliveryRuleResponseHeaderAction) AsBasicDeliveryRuleAction() (Basic type DeliveryRuleURLFileExtensionCondition struct { // Parameters - Defines the parameters for the condition. Parameters *URLFileExtensionMatchConditionParameters `json:"parameters,omitempty"` - // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameIsDevice' + // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' Name Name `json:"name,omitempty"` } @@ -2768,6 +3229,16 @@ func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleURLFileNameCon return nil, false } +// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. +func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { + return nil, false +} + +// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. +func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { + return nil, false +} + // AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { return nil, false @@ -2787,7 +3258,7 @@ func (drufec DeliveryRuleURLFileExtensionCondition) AsBasicDeliveryRuleCondition type DeliveryRuleURLFileNameCondition struct { // Parameters - Defines the parameters for the condition. Parameters *URLFileNameMatchConditionParameters `json:"parameters,omitempty"` - // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameIsDevice' + // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' Name Name `json:"name,omitempty"` } @@ -2859,6 +3330,16 @@ func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleURLFileNameConditio return &drufnc, true } +// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. +func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { + return nil, false +} + +// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. +func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { + return nil, false +} + // AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { return nil, false @@ -2878,7 +3359,7 @@ func (drufnc DeliveryRuleURLFileNameCondition) AsBasicDeliveryRuleCondition() (B type DeliveryRuleURLPathCondition struct { // Parameters - Defines the parameters for the condition. Parameters *URLPathMatchConditionParameters `json:"parameters,omitempty"` - // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameIsDevice' + // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' Name Name `json:"name,omitempty"` } @@ -2950,6 +3431,16 @@ func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleURLFileNameCondition() ( return nil, false } +// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. +func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { + return nil, false +} + +// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. +func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { + return nil, false +} + // AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { return nil, false @@ -3774,6 +4265,17 @@ type HeaderActionParameters struct { Value *string `json:"value,omitempty"` } +// HTTPVersionMatchConditionParameters defines the parameters for HttpVersion match conditions +type HTTPVersionMatchConditionParameters struct { + OdataType *string `json:"@odata.type,omitempty"` + // Operator - Describes operator to be matched + Operator *string `json:"operator,omitempty"` + // NegateCondition - Describes if this is negate condition or not + NegateCondition *bool `json:"negateCondition,omitempty"` + // MatchValues - The match value for the condition of the delivery rule + MatchValues *[]string `json:"matchValues,omitempty"` +} + // IPAddressGroup CDN Ip address group type IPAddressGroup struct { // DeliveryRegion - The delivery region of the ip address group @@ -3830,6 +4332,8 @@ type ManagedHTTPSParameters struct { CertificateSourceParameters *CertificateSourceParameters `json:"certificateSourceParameters,omitempty"` // ProtocolType - Defines the TLS extension protocol that is used for secure delivery. Possible values include: 'ServerNameIndication', 'IPBased' ProtocolType ProtocolType `json:"protocolType,omitempty"` + // MinimumTLSVersion - TLS protocol version that will be used for Https. Possible values include: 'None', 'TLS10', 'TLS12' + MinimumTLSVersion MinimumTLSVersion `json:"minimumTlsVersion,omitempty"` // CertificateSource - Possible values include: 'CertificateSourceCustomDomainHTTPSParameters', 'CertificateSourceCdn', 'CertificateSourceAzureKeyVault' CertificateSource CertificateSource `json:"certificateSource,omitempty"` } @@ -3844,6 +4348,9 @@ func (mhp ManagedHTTPSParameters) MarshalJSON() ([]byte, error) { if mhp.ProtocolType != "" { objectMap["protocolType"] = mhp.ProtocolType } + if mhp.MinimumTLSVersion != "" { + objectMap["minimumTlsVersion"] = mhp.MinimumTLSVersion + } if mhp.CertificateSource != "" { objectMap["certificateSource"] = mhp.CertificateSource } @@ -4380,7 +4887,7 @@ type PostArgsMatchConditionParameters struct { OdataType *string `json:"@odata.type,omitempty"` // Selector - Name of PostArg to be matched Selector *string `json:"selector,omitempty"` - // Operator - Describes operator to be matched. Possible values include: 'Any', 'Equal', 'Contains', 'BeginsWith', 'EndsWith', 'LessThan', 'LessThanOrEqual', 'GreaterThan', 'GreaterThanOrEqual' + // Operator - Describes operator to be matched. Possible values include: 'PostArgsOperatorAny', 'PostArgsOperatorEqual', 'PostArgsOperatorContains', 'PostArgsOperatorBeginsWith', 'PostArgsOperatorEndsWith', 'PostArgsOperatorLessThan', 'PostArgsOperatorLessThanOrEqual', 'PostArgsOperatorGreaterThan', 'PostArgsOperatorGreaterThanOrEqual' Operator PostArgsOperator `json:"operator,omitempty"` // NegateCondition - Describes if this is negate condition or not NegateCondition *bool `json:"negateCondition,omitempty"` @@ -5272,6 +5779,8 @@ type UserManagedHTTPSParameters struct { CertificateSourceParameters *KeyVaultCertificateSourceParameters `json:"certificateSourceParameters,omitempty"` // ProtocolType - Defines the TLS extension protocol that is used for secure delivery. Possible values include: 'ServerNameIndication', 'IPBased' ProtocolType ProtocolType `json:"protocolType,omitempty"` + // MinimumTLSVersion - TLS protocol version that will be used for Https. Possible values include: 'None', 'TLS10', 'TLS12' + MinimumTLSVersion MinimumTLSVersion `json:"minimumTlsVersion,omitempty"` // CertificateSource - Possible values include: 'CertificateSourceCustomDomainHTTPSParameters', 'CertificateSourceCdn', 'CertificateSourceAzureKeyVault' CertificateSource CertificateSource `json:"certificateSource,omitempty"` } @@ -5286,6 +5795,9 @@ func (umhp UserManagedHTTPSParameters) MarshalJSON() ([]byte, error) { if umhp.ProtocolType != "" { objectMap["protocolType"] = umhp.ProtocolType } + if umhp.MinimumTLSVersion != "" { + objectMap["minimumTlsVersion"] = umhp.MinimumTLSVersion + } if umhp.CertificateSource != "" { objectMap["certificateSource"] = umhp.CertificateSource } diff --git a/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/accounts.go b/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/accounts.go index 3e3eea0f5422..96aa03010e9f 100644 --- a/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/accounts.go +++ b/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/accounts.go @@ -46,8 +46,8 @@ func NewAccountsClientWithBaseURI(baseURI string, subscriptionID string) Account // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. // accountName - the name of Cognitive Services account. -// parameters - the parameters to provide for the created account. -func (client AccountsClient) Create(ctx context.Context, resourceGroupName string, accountName string, parameters AccountCreateParameters) (result Account, err error) { +// account - the parameters to provide for the created account. +func (client AccountsClient) Create(ctx context.Context, resourceGroupName string, accountName string, account Account) (result Account, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.Create") defer func() { @@ -63,16 +63,25 @@ func (client AccountsClient) Create(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 64, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 2, Chain: nil}, {Target: "accountName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9_.-]*$`, Chain: nil}}}, - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.Sku", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.Sku.Name", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "parameters.Kind", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.Location", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + {TargetValue: account, + Constraints: []validation.Constraint{{Target: "account.Properties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "account.Properties.APIProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "account.Properties.APIProperties.EventHubConnectionString", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "account.Properties.APIProperties.EventHubConnectionString", Name: validation.MaxLength, Rule: 1000, Chain: nil}, + {Target: "account.Properties.APIProperties.EventHubConnectionString", Name: validation.Pattern, Rule: `^( *)Endpoint=sb://(.*);( *)SharedAccessKeyName=(.*);( *)SharedAccessKey=(.*)$`, Chain: nil}, + }}, + {Target: "account.Properties.APIProperties.StorageAccountConnectionString", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "account.Properties.APIProperties.StorageAccountConnectionString", Name: validation.MaxLength, Rule: 1000, Chain: nil}, + {Target: "account.Properties.APIProperties.StorageAccountConnectionString", Name: validation.Pattern, Rule: `^(( *)DefaultEndpointsProtocol=(http|https)( *);( *))?AccountName=(.*)AccountKey=(.*)EndpointSuffix=(.*)$`, Chain: nil}, + }}, + }}, + }}, + {Target: "account.Sku", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "account.Sku.Name", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { return result, validation.NewError("cognitiveservices.AccountsClient", "Create", err.Error()) } - req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, parameters) + req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, account) if err != nil { err = autorest.NewErrorWithError(err, "cognitiveservices.AccountsClient", "Create", nil, "Failure preparing request") return @@ -94,7 +103,7 @@ func (client AccountsClient) Create(ctx context.Context, resourceGroupName strin } // CreatePreparer prepares the Create request. -func (client AccountsClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, parameters AccountCreateParameters) (*http.Request, error) { +func (client AccountsClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, account Account) (*http.Request, error) { pathParameters := map[string]interface{}{ "accountName": autorest.Encode("path", accountName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -106,12 +115,16 @@ func (client AccountsClient) CreatePreparer(ctx context.Context, resourceGroupNa "api-version": APIVersion, } + account.Etag = nil + account.ID = nil + account.Name = nil + account.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.CognitiveServices/accounts/{accountName}", pathParameters), - autorest.WithJSON(parameters), + autorest.WithJSON(account), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -880,8 +893,8 @@ func (client AccountsClient) RegenerateKeyResponder(resp *http.Response) (result // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. // accountName - the name of Cognitive Services account. -// parameters - the parameters to provide for the created account. -func (client AccountsClient) Update(ctx context.Context, resourceGroupName string, accountName string, parameters AccountUpdateParameters) (result Account, err error) { +// account - the parameters to provide for the created account. +func (client AccountsClient) Update(ctx context.Context, resourceGroupName string, accountName string, account Account) (result Account, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.Update") defer func() { @@ -900,7 +913,7 @@ func (client AccountsClient) Update(ctx context.Context, resourceGroupName strin return result, validation.NewError("cognitiveservices.AccountsClient", "Update", err.Error()) } - req, err := client.UpdatePreparer(ctx, resourceGroupName, accountName, parameters) + req, err := client.UpdatePreparer(ctx, resourceGroupName, accountName, account) if err != nil { err = autorest.NewErrorWithError(err, "cognitiveservices.AccountsClient", "Update", nil, "Failure preparing request") return @@ -922,7 +935,7 @@ func (client AccountsClient) Update(ctx context.Context, resourceGroupName strin } // UpdatePreparer prepares the Update request. -func (client AccountsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, parameters AccountUpdateParameters) (*http.Request, error) { +func (client AccountsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, account Account) (*http.Request, error) { pathParameters := map[string]interface{}{ "accountName": autorest.Encode("path", accountName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -934,12 +947,16 @@ func (client AccountsClient) UpdatePreparer(ctx context.Context, resourceGroupNa "api-version": APIVersion, } + account.Etag = nil + account.ID = nil + account.Name = nil + account.Type = nil preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}", pathParameters), - autorest.WithJSON(parameters), + autorest.WithJSON(account), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/checkskuavailability.go b/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/checkskuavailability.go deleted file mode 100644 index 4339b18a4838..000000000000 --- a/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/checkskuavailability.go +++ /dev/null @@ -1,128 +0,0 @@ -package cognitiveservices - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// CheckSkuAvailabilityClient is the cognitive Services Management Client -type CheckSkuAvailabilityClient struct { - BaseClient -} - -// NewCheckSkuAvailabilityClient creates an instance of the CheckSkuAvailabilityClient client. -func NewCheckSkuAvailabilityClient(subscriptionID string) CheckSkuAvailabilityClient { - return NewCheckSkuAvailabilityClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewCheckSkuAvailabilityClientWithBaseURI creates an instance of the CheckSkuAvailabilityClient client. -func NewCheckSkuAvailabilityClientWithBaseURI(baseURI string, subscriptionID string) CheckSkuAvailabilityClient { - return CheckSkuAvailabilityClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List check available SKUs. -// Parameters: -// location - resource location. -// parameters - check SKU Availability POST body. -func (client CheckSkuAvailabilityClient) List(ctx context.Context, location string, parameters CheckSkuAvailabilityParameter) (result CheckSkuAvailabilityResultList, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CheckSkuAvailabilityClient.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: parameters, - Constraints: []validation.Constraint{{Target: "parameters.Skus", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.Kind", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.Type", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("cognitiveservices.CheckSkuAvailabilityClient", "List", err.Error()) - } - - req, err := client.ListPreparer(ctx, location, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "cognitiveservices.CheckSkuAvailabilityClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "cognitiveservices.CheckSkuAvailabilityClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "cognitiveservices.CheckSkuAvailabilityClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client CheckSkuAvailabilityClient) ListPreparer(ctx context.Context, location string, parameters CheckSkuAvailabilityParameter) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-04-18" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/checkSkuAvailability", pathParameters), - autorest.WithJSON(parameters), - 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 CheckSkuAvailabilityClient) 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 CheckSkuAvailabilityClient) ListResponder(resp *http.Response) (result CheckSkuAvailabilityResultList, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/client.go b/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/client.go index ba2be90e1e99..49599b4fa9a3 100644 --- a/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/client.go +++ b/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/client.go @@ -137,3 +137,89 @@ func (client BaseClient) CheckDomainAvailabilityResponder(resp *http.Response) ( result.Response = autorest.Response{Response: resp} return } + +// CheckSkuAvailability check available SKUs. +// Parameters: +// location - resource location. +// parameters - check SKU Availability POST body. +func (client BaseClient) CheckSkuAvailability(ctx context.Context, location string, parameters CheckSkuAvailabilityParameter) (result CheckSkuAvailabilityResultList, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CheckSkuAvailability") + defer func() { + 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.Skus", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.Kind", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.Type", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("cognitiveservices.BaseClient", "CheckSkuAvailability", err.Error()) + } + + req, err := client.CheckSkuAvailabilityPreparer(ctx, location, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "cognitiveservices.BaseClient", "CheckSkuAvailability", nil, "Failure preparing request") + return + } + + resp, err := client.CheckSkuAvailabilitySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "cognitiveservices.BaseClient", "CheckSkuAvailability", resp, "Failure sending request") + return + } + + result, err = client.CheckSkuAvailabilityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cognitiveservices.BaseClient", "CheckSkuAvailability", resp, "Failure responding to request") + } + + return +} + +// CheckSkuAvailabilityPreparer prepares the CheckSkuAvailability request. +func (client BaseClient) CheckSkuAvailabilityPreparer(ctx context.Context, location string, parameters CheckSkuAvailabilityParameter) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-04-18" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/checkSkuAvailability", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckSkuAvailabilitySender sends the CheckSkuAvailability request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) CheckSkuAvailabilitySender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// CheckSkuAvailabilityResponder handles the response to the CheckSkuAvailability request. The method always +// closes the http.Response Body. +func (client BaseClient) CheckSkuAvailabilityResponder(resp *http.Response) (result CheckSkuAvailabilityResultList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/cognitiveservicesapi/interfaces.go b/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/cognitiveservicesapi/interfaces.go index 41455e9a1424..c8748ef2db14 100644 --- a/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/cognitiveservicesapi/interfaces.go +++ b/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/cognitiveservicesapi/interfaces.go @@ -26,13 +26,14 @@ import ( // BaseClientAPI contains the set of methods on the BaseClient type. type BaseClientAPI interface { CheckDomainAvailability(ctx context.Context, parameters cognitiveservices.CheckDomainAvailabilityParameter) (result cognitiveservices.CheckDomainAvailabilityResult, err error) + CheckSkuAvailability(ctx context.Context, location string, parameters cognitiveservices.CheckSkuAvailabilityParameter) (result cognitiveservices.CheckSkuAvailabilityResultList, err error) } var _ BaseClientAPI = (*cognitiveservices.BaseClient)(nil) // AccountsClientAPI contains the set of methods on the AccountsClient type. type AccountsClientAPI interface { - Create(ctx context.Context, resourceGroupName string, accountName string, parameters cognitiveservices.AccountCreateParameters) (result cognitiveservices.Account, err error) + Create(ctx context.Context, resourceGroupName string, accountName string, account cognitiveservices.Account) (result cognitiveservices.Account, err error) Delete(ctx context.Context, resourceGroupName string, accountName string) (result autorest.Response, err error) GetProperties(ctx context.Context, resourceGroupName string, accountName string) (result cognitiveservices.Account, err error) GetUsages(ctx context.Context, resourceGroupName string, accountName string, filter string) (result cognitiveservices.UsagesResult, err error) @@ -41,7 +42,7 @@ type AccountsClientAPI interface { ListKeys(ctx context.Context, resourceGroupName string, accountName string) (result cognitiveservices.AccountKeys, err error) ListSkus(ctx context.Context, resourceGroupName string, accountName string) (result cognitiveservices.AccountEnumerateSkusResult, err error) RegenerateKey(ctx context.Context, resourceGroupName string, accountName string, parameters cognitiveservices.RegenerateKeyParameters) (result cognitiveservices.AccountKeys, err error) - Update(ctx context.Context, resourceGroupName string, accountName string, parameters cognitiveservices.AccountUpdateParameters) (result cognitiveservices.Account, err error) + Update(ctx context.Context, resourceGroupName string, accountName string, account cognitiveservices.Account) (result cognitiveservices.Account, err error) } var _ AccountsClientAPI = (*cognitiveservices.AccountsClient)(nil) @@ -59,10 +60,3 @@ type OperationsClientAPI interface { } var _ OperationsClientAPI = (*cognitiveservices.OperationsClient)(nil) - -// CheckSkuAvailabilityClientAPI contains the set of methods on the CheckSkuAvailabilityClient type. -type CheckSkuAvailabilityClientAPI interface { - List(ctx context.Context, location string, parameters cognitiveservices.CheckSkuAvailabilityParameter) (result cognitiveservices.CheckSkuAvailabilityResultList, err error) -} - -var _ CheckSkuAvailabilityClientAPI = (*cognitiveservices.CheckSkuAvailabilityClient)(nil) diff --git a/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/models.go b/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/models.go index 4478c4e38058..732c8f44c7b1 100644 --- a/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/models.go +++ b/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/models.go @@ -59,21 +59,6 @@ func PossibleNetworkRuleActionValues() []NetworkRuleAction { return []NetworkRuleAction{Allow, Deny} } -// NetworkRuleBypassOptions enumerates the values for network rule bypass options. -type NetworkRuleBypassOptions string - -const ( - // AzureServices ... - AzureServices NetworkRuleBypassOptions = "AzureServices" - // None ... - None NetworkRuleBypassOptions = "None" -) - -// PossibleNetworkRuleBypassOptionsValues returns an array of possible values for the NetworkRuleBypassOptions const type. -func PossibleNetworkRuleBypassOptionsValues() []NetworkRuleBypassOptions { - return []NetworkRuleBypassOptions{AzureServices, None} -} - // ProvisioningState enumerates the values for provisioning state. type ProvisioningState string @@ -192,18 +177,18 @@ func PossibleUnitTypeValues() []UnitType { // location and SKU. type Account struct { autorest.Response `json:"-"` - // Etag - Entity Tag + // Etag - READ-ONLY; Entity Tag Etag *string `json:"etag,omitempty"` // ID - READ-ONLY; The id of the created account ID *string `json:"id,omitempty"` - // Kind - Type of cognitive service account. + // Kind - The Kind of the resource. Kind *string `json:"kind,omitempty"` // Location - The location of the resource Location *string `json:"location,omitempty"` // Name - READ-ONLY; The name of the created account Name *string `json:"name,omitempty"` - // AccountProperties - Properties of Cognitive Services account. - *AccountProperties `json:"properties,omitempty"` + // Properties - Properties of Cognitive Services account. + Properties *AccountProperties `json:"properties,omitempty"` // Sku - The SKU of Cognitive Services account. Sku *Sku `json:"sku,omitempty"` // Tags - Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. @@ -215,17 +200,14 @@ type Account struct { // MarshalJSON is the custom marshaler for Account. func (a Account) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if a.Etag != nil { - objectMap["etag"] = a.Etag - } if a.Kind != nil { objectMap["kind"] = a.Kind } if a.Location != nil { objectMap["location"] = a.Location } - if a.AccountProperties != nil { - objectMap["properties"] = a.AccountProperties + if a.Properties != nil { + objectMap["properties"] = a.Properties } if a.Sku != nil { objectMap["sku"] = a.Sku @@ -236,135 +218,16 @@ func (a Account) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for Account struct. -func (a *Account) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - a.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - a.ID = &ID - } - case "kind": - if v != nil { - var kind string - err = json.Unmarshal(*v, &kind) - if err != nil { - return err - } - a.Kind = &kind - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - a.Location = &location - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - a.Name = &name - } - case "properties": - if v != nil { - var accountProperties AccountProperties - err = json.Unmarshal(*v, &accountProperties) - if err != nil { - return err - } - a.AccountProperties = &accountProperties - } - case "sku": - if v != nil { - var sku Sku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - a.Sku = &sku - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - a.Tags = tags - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - a.Type = &typeVar - } - } - } - - return nil -} - -// AccountCreateParameters the parameters to provide for the account. -type AccountCreateParameters struct { - // Sku - Required. Gets or sets the SKU of the resource. - Sku *Sku `json:"sku,omitempty"` - // Kind - Required. Gets or sets the Kind of the resource. - Kind *string `json:"kind,omitempty"` - // Location - Required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update the request will succeed. - Location *string `json:"location,omitempty"` - // Tags - Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. - Tags map[string]*string `json:"tags"` - // Properties - Must exist in the request. Must be an empty object. Must not be null. - Properties interface{} `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for AccountCreateParameters. -func (acp AccountCreateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if acp.Sku != nil { - objectMap["sku"] = acp.Sku - } - if acp.Kind != nil { - objectMap["kind"] = acp.Kind - } - if acp.Location != nil { - objectMap["location"] = acp.Location - } - if acp.Tags != nil { - objectMap["tags"] = acp.Tags - } - if acp.Properties != nil { - objectMap["properties"] = acp.Properties - } - return json.Marshal(objectMap) +// AccountAPIProperties the api properties for special APIs. +type AccountAPIProperties struct { + // QnaRuntimeEndpoint - (QnAMaker Only) The runtime endpoint of QnAMaker. + QnaRuntimeEndpoint *string `json:"qnaRuntimeEndpoint,omitempty"` + // StatisticsEnabled - (Bing Search Only) The flag to enable statistics of Bing Search. + StatisticsEnabled *bool `json:"statisticsEnabled,omitempty"` + // EventHubConnectionString - (Personalization Only) The flag to enable statistics of Bing Search. + EventHubConnectionString *string `json:"eventHubConnectionString,omitempty"` + // StorageAccountConnectionString - (Personalization Only) The storage account connection string. + StorageAccountConnectionString *string `json:"storageAccountConnectionString,omitempty"` } // AccountEnumerateSkusResult the list of cognitive services accounts operation response. @@ -533,39 +396,16 @@ func NewAccountListResultPage(getNextPage func(context.Context, AccountListResul type AccountProperties struct { // ProvisioningState - READ-ONLY; Gets the status of the cognitive services account at the time the operation was called. Possible values include: 'Creating', 'ResolvingDNS', 'Moving', 'Deleting', 'Succeeded', 'Failed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // Endpoint - Endpoint of the created account. + // Endpoint - READ-ONLY; Endpoint of the created account. Endpoint *string `json:"endpoint,omitempty"` - // InternalID - The internal identifier. + // InternalID - READ-ONLY; The internal identifier. InternalID *string `json:"internalId,omitempty"` // CustomSubDomainName - Optional subdomain name used for token-based authentication. CustomSubDomainName *string `json:"customSubDomainName,omitempty"` // NetworkAcls - A collection of rules governing the accessibility from specific network locations. NetworkAcls *NetworkRuleSet `json:"networkAcls,omitempty"` -} - -// AccountUpdateParameters the parameters to provide for the account. -type AccountUpdateParameters struct { - // Sku - Gets or sets the SKU of the resource. - Sku *Sku `json:"sku,omitempty"` - // Tags - Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. - Tags map[string]*string `json:"tags"` - // Properties - Additional properties for Account. Only provided fields will be updated. - Properties interface{} `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for AccountUpdateParameters. -func (aup AccountUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if aup.Sku != nil { - objectMap["sku"] = aup.Sku - } - if aup.Tags != nil { - objectMap["tags"] = aup.Tags - } - if aup.Properties != nil { - objectMap["properties"] = aup.Properties - } - return json.Marshal(objectMap) + // APIProperties - The api properties for special APIs. + APIProperties *AccountAPIProperties `json:"apiProperties,omitempty"` } // CheckDomainAvailabilityParameter check Domain availability parameter. @@ -652,8 +492,6 @@ type MetricName struct { // NetworkRuleSet a set of rules governing the network accessibility. type NetworkRuleSet struct { - // Bypass - Tells what traffic can bypass network rules. This can be 'AzureServices' or 'None'. If not specified the default is 'AzureServices'. Possible values include: 'AzureServices', 'None' - Bypass NetworkRuleBypassOptions `json:"bypass,omitempty"` // DefaultAction - The default action when no rule from ipRules and from virtualNetworkRules match. This is only used after the bypass property has been evaluated. Possible values include: 'Allow', 'Deny' DefaultAction NetworkRuleAction `json:"defaultAction,omitempty"` // IPRules - The list of IP address rules. diff --git a/services/cognitiveservices/v3.1/customvision/training/client.go b/services/cognitiveservices/v3.1/customvision/training/client.go new file mode 100644 index 000000000000..d2e44f28285d --- /dev/null +++ b/services/cognitiveservices/v3.1/customvision/training/client.go @@ -0,0 +1,3930 @@ +// Package training implements the Azure ARM Training service API version 3.1. +// +// +package training + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "github.com/satori/go.uuid" + "io" + "net/http" +) + +// BaseClient is the base client for Training. +type BaseClient struct { + autorest.Client + APIKey string + Endpoint string +} + +// New creates an instance of the BaseClient client. +func New(aPIKey string, endpoint string) BaseClient { + return NewWithoutDefaults(aPIKey, endpoint) +} + +// NewWithoutDefaults creates an instance of the BaseClient client. +func NewWithoutDefaults(aPIKey string, endpoint string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + APIKey: aPIKey, + Endpoint: endpoint, + } +} + +// CreateImageRegions this API accepts a batch of image regions, and optionally tags, to update existing images with +// region information. +// There is a limit of 64 entries in the batch. +// Parameters: +// projectID - the project id. +// batch - batch of image regions which include a tag and bounding box. Limited to 64. +func (client BaseClient) CreateImageRegions(ctx context.Context, projectID uuid.UUID, batch ImageRegionCreateBatch) (result ImageRegionCreateSummary, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateImageRegions") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateImageRegionsPreparer(ctx, projectID, batch) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateImageRegions", nil, "Failure preparing request") + return + } + + resp, err := client.CreateImageRegionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateImageRegions", resp, "Failure sending request") + return + } + + result, err = client.CreateImageRegionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateImageRegions", resp, "Failure responding to request") + } + + return +} + +// CreateImageRegionsPreparer prepares the CreateImageRegions request. +func (client BaseClient) CreateImageRegionsPreparer(ctx context.Context, projectID uuid.UUID, batch ImageRegionCreateBatch) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "projectId": autorest.Encode("path", projectID), + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPathParameters("/projects/{projectId}/images/regions", pathParameters), + autorest.WithJSON(batch), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateImageRegionsSender sends the CreateImageRegions request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) CreateImageRegionsSender(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...) +} + +// CreateImageRegionsResponder handles the response to the CreateImageRegions request. The method always +// closes the http.Response Body. +func (client BaseClient) CreateImageRegionsResponder(resp *http.Response) (result ImageRegionCreateSummary, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateImagesFromData this API accepts body content as multipart/form-data and application/octet-stream. When using +// multipart +// multiple image files can be sent at once, with a maximum of 64 files +// Parameters: +// projectID - the project id. +// imageData - binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 6MB. +// tagIds - the tags ids with which to tag each image. Limited to 20. +func (client BaseClient) CreateImagesFromData(ctx context.Context, projectID uuid.UUID, imageData io.ReadCloser, tagIds []uuid.UUID) (result ImageCreateSummary, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateImagesFromData") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: tagIds, + Constraints: []validation.Constraint{{Target: "tagIds", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "tagIds", Name: validation.MaxItems, Rule: 20, Chain: nil}, + {Target: "tagIds", Name: validation.MinItems, Rule: 0, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("training.BaseClient", "CreateImagesFromData", err.Error()) + } + + req, err := client.CreateImagesFromDataPreparer(ctx, projectID, imageData, tagIds) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateImagesFromData", nil, "Failure preparing request") + return + } + + resp, err := client.CreateImagesFromDataSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateImagesFromData", resp, "Failure sending request") + return + } + + result, err = client.CreateImagesFromDataResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateImagesFromData", resp, "Failure responding to request") + } + + return +} + +// CreateImagesFromDataPreparer prepares the CreateImagesFromData request. +func (client BaseClient) CreateImagesFromDataPreparer(ctx context.Context, projectID uuid.UUID, imageData io.ReadCloser, tagIds []uuid.UUID) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "projectId": autorest.Encode("path", projectID), + } + + queryParameters := map[string]interface{}{} + if tagIds != nil && len(tagIds) > 0 { + queryParameters["tagIds"] = autorest.Encode("query", tagIds, ",") + } + + formDataParameters := map[string]interface{}{ + "imageData": imageData, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPathParameters("/projects/{projectId}/images", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithMultiPartFormData(formDataParameters), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateImagesFromDataSender sends the CreateImagesFromData request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) CreateImagesFromDataSender(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...) +} + +// CreateImagesFromDataResponder handles the response to the CreateImagesFromData request. The method always +// closes the http.Response Body. +func (client BaseClient) CreateImagesFromDataResponder(resp *http.Response) (result ImageCreateSummary, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateImagesFromFiles this API accepts a batch of files, and optionally tags, to create images. There is a limit of +// 64 images and 20 tags. +// Parameters: +// projectID - the project id. +// batch - the batch of image files to add. Limited to 64 images and 20 tags per batch. +func (client BaseClient) CreateImagesFromFiles(ctx context.Context, projectID uuid.UUID, batch ImageFileCreateBatch) (result ImageCreateSummary, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateImagesFromFiles") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateImagesFromFilesPreparer(ctx, projectID, batch) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateImagesFromFiles", nil, "Failure preparing request") + return + } + + resp, err := client.CreateImagesFromFilesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateImagesFromFiles", resp, "Failure sending request") + return + } + + result, err = client.CreateImagesFromFilesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateImagesFromFiles", resp, "Failure responding to request") + } + + return +} + +// CreateImagesFromFilesPreparer prepares the CreateImagesFromFiles request. +func (client BaseClient) CreateImagesFromFilesPreparer(ctx context.Context, projectID uuid.UUID, batch ImageFileCreateBatch) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "projectId": autorest.Encode("path", projectID), + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPathParameters("/projects/{projectId}/images/files", pathParameters), + autorest.WithJSON(batch), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateImagesFromFilesSender sends the CreateImagesFromFiles request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) CreateImagesFromFilesSender(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...) +} + +// CreateImagesFromFilesResponder handles the response to the CreateImagesFromFiles request. The method always +// closes the http.Response Body. +func (client BaseClient) CreateImagesFromFilesResponder(resp *http.Response) (result ImageCreateSummary, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateImagesFromPredictions this API creates a batch of images from predicted images specified. There is a limit of +// 64 images and 20 tags. +// Parameters: +// projectID - the project id. +// batch - image and tag ids. Limited to 64 images and 20 tags per batch. +func (client BaseClient) CreateImagesFromPredictions(ctx context.Context, projectID uuid.UUID, batch ImageIDCreateBatch) (result ImageCreateSummary, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateImagesFromPredictions") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateImagesFromPredictionsPreparer(ctx, projectID, batch) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateImagesFromPredictions", nil, "Failure preparing request") + return + } + + resp, err := client.CreateImagesFromPredictionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateImagesFromPredictions", resp, "Failure sending request") + return + } + + result, err = client.CreateImagesFromPredictionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateImagesFromPredictions", resp, "Failure responding to request") + } + + return +} + +// CreateImagesFromPredictionsPreparer prepares the CreateImagesFromPredictions request. +func (client BaseClient) CreateImagesFromPredictionsPreparer(ctx context.Context, projectID uuid.UUID, batch ImageIDCreateBatch) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "projectId": autorest.Encode("path", projectID), + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPathParameters("/projects/{projectId}/images/predictions", pathParameters), + autorest.WithJSON(batch), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateImagesFromPredictionsSender sends the CreateImagesFromPredictions request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) CreateImagesFromPredictionsSender(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...) +} + +// CreateImagesFromPredictionsResponder handles the response to the CreateImagesFromPredictions request. The method always +// closes the http.Response Body. +func (client BaseClient) CreateImagesFromPredictionsResponder(resp *http.Response) (result ImageCreateSummary, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateImagesFromUrls this API accepts a batch of urls, and optionally tags, to create images. There is a limit of 64 +// images and 20 tags. +// Parameters: +// projectID - the project id. +// batch - image urls and tag ids. Limited to 64 images and 20 tags per batch. +func (client BaseClient) CreateImagesFromUrls(ctx context.Context, projectID uuid.UUID, batch ImageURLCreateBatch) (result ImageCreateSummary, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateImagesFromUrls") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateImagesFromUrlsPreparer(ctx, projectID, batch) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateImagesFromUrls", nil, "Failure preparing request") + return + } + + resp, err := client.CreateImagesFromUrlsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateImagesFromUrls", resp, "Failure sending request") + return + } + + result, err = client.CreateImagesFromUrlsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateImagesFromUrls", resp, "Failure responding to request") + } + + return +} + +// CreateImagesFromUrlsPreparer prepares the CreateImagesFromUrls request. +func (client BaseClient) CreateImagesFromUrlsPreparer(ctx context.Context, projectID uuid.UUID, batch ImageURLCreateBatch) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "projectId": autorest.Encode("path", projectID), + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPathParameters("/projects/{projectId}/images/urls", pathParameters), + autorest.WithJSON(batch), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateImagesFromUrlsSender sends the CreateImagesFromUrls request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) CreateImagesFromUrlsSender(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...) +} + +// CreateImagesFromUrlsResponder handles the response to the CreateImagesFromUrls request. The method always +// closes the http.Response Body. +func (client BaseClient) CreateImagesFromUrlsResponder(resp *http.Response) (result ImageCreateSummary, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateImageTags sends the create image tags request. +// Parameters: +// projectID - the project id. +// batch - batch of image tags. Limited to 128 tags per batch. +func (client BaseClient) CreateImageTags(ctx context.Context, projectID uuid.UUID, batch ImageTagCreateBatch) (result ImageTagCreateSummary, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateImageTags") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateImageTagsPreparer(ctx, projectID, batch) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateImageTags", nil, "Failure preparing request") + return + } + + resp, err := client.CreateImageTagsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateImageTags", resp, "Failure sending request") + return + } + + result, err = client.CreateImageTagsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateImageTags", resp, "Failure responding to request") + } + + return +} + +// CreateImageTagsPreparer prepares the CreateImageTags request. +func (client BaseClient) CreateImageTagsPreparer(ctx context.Context, projectID uuid.UUID, batch ImageTagCreateBatch) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "projectId": autorest.Encode("path", projectID), + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPathParameters("/projects/{projectId}/images/tags", pathParameters), + autorest.WithJSON(batch), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateImageTagsSender sends the CreateImageTags request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) CreateImageTagsSender(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...) +} + +// CreateImageTagsResponder handles the response to the CreateImageTags request. The method always +// closes the http.Response Body. +func (client BaseClient) CreateImageTagsResponder(resp *http.Response) (result ImageTagCreateSummary, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateProject sends the create project request. +// Parameters: +// name - name of the project. +// description - the description of the project. +// domainID - the id of the domain to use for this project. Defaults to General. +// classificationType - the type of classifier to create for this project. +// targetExportPlatforms - list of platforms the trained model is intending exporting to. +func (client BaseClient) CreateProject(ctx context.Context, name string, description string, domainID *uuid.UUID, classificationType string, targetExportPlatforms []string) (result Project, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateProject") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateProjectPreparer(ctx, name, description, domainID, classificationType, targetExportPlatforms) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateProject", nil, "Failure preparing request") + return + } + + resp, err := client.CreateProjectSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateProject", resp, "Failure sending request") + return + } + + result, err = client.CreateProjectResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateProject", resp, "Failure responding to request") + } + + return +} + +// CreateProjectPreparer prepares the CreateProject request. +func (client BaseClient) CreateProjectPreparer(ctx context.Context, name string, description string, domainID *uuid.UUID, classificationType string, targetExportPlatforms []string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + queryParameters := map[string]interface{}{ + "name": autorest.Encode("query", name), + } + if len(description) > 0 { + queryParameters["description"] = autorest.Encode("query", description) + } + if domainID != nil { + queryParameters["domainId"] = autorest.Encode("query", *domainID) + } + if len(string(classificationType)) > 0 { + queryParameters["classificationType"] = autorest.Encode("query", classificationType) + } + if targetExportPlatforms != nil && len(targetExportPlatforms) > 0 { + queryParameters["targetExportPlatforms"] = autorest.Encode("query", targetExportPlatforms, ",") + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPath("/projects"), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateProjectSender sends the CreateProject request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) CreateProjectSender(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...) +} + +// CreateProjectResponder handles the response to the CreateProject request. The method always +// closes the http.Response Body. +func (client BaseClient) CreateProjectResponder(resp *http.Response) (result Project, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateTag sends the create tag request. +// Parameters: +// projectID - the project id. +// name - the tag name. +// description - optional description for the tag. +// typeParameter - optional type for the tag. +func (client BaseClient) CreateTag(ctx context.Context, projectID uuid.UUID, name string, description string, typeParameter string) (result Tag, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateTag") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateTagPreparer(ctx, projectID, name, description, typeParameter) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateTag", nil, "Failure preparing request") + return + } + + resp, err := client.CreateTagSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateTag", resp, "Failure sending request") + return + } + + result, err = client.CreateTagResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateTag", resp, "Failure responding to request") + } + + return +} + +// CreateTagPreparer prepares the CreateTag request. +func (client BaseClient) CreateTagPreparer(ctx context.Context, projectID uuid.UUID, name string, description string, typeParameter string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "projectId": autorest.Encode("path", projectID), + } + + queryParameters := map[string]interface{}{ + "name": autorest.Encode("query", name), + } + if len(description) > 0 { + queryParameters["description"] = autorest.Encode("query", description) + } + if len(string(typeParameter)) > 0 { + queryParameters["type"] = autorest.Encode("query", typeParameter) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPathParameters("/projects/{projectId}/tags", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateTagSender sends the CreateTag request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) CreateTagSender(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...) +} + +// CreateTagResponder handles the response to the CreateTag request. The method always +// closes the http.Response Body. +func (client BaseClient) CreateTagResponder(resp *http.Response) (result Tag, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DeleteImageRegions sends the delete image regions request. +// Parameters: +// projectID - the project id. +// regionIds - regions to delete. Limited to 64. +func (client BaseClient) DeleteImageRegions(ctx context.Context, projectID uuid.UUID, regionIds []uuid.UUID) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteImageRegions") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: regionIds, + Constraints: []validation.Constraint{{Target: "regionIds", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "regionIds", Name: validation.MaxItems, Rule: 64, Chain: nil}, + {Target: "regionIds", Name: validation.MinItems, Rule: 0, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("training.BaseClient", "DeleteImageRegions", err.Error()) + } + + req, err := client.DeleteImageRegionsPreparer(ctx, projectID, regionIds) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "DeleteImageRegions", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteImageRegionsSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "training.BaseClient", "DeleteImageRegions", resp, "Failure sending request") + return + } + + result, err = client.DeleteImageRegionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "DeleteImageRegions", resp, "Failure responding to request") + } + + return +} + +// DeleteImageRegionsPreparer prepares the DeleteImageRegions request. +func (client BaseClient) DeleteImageRegionsPreparer(ctx context.Context, projectID uuid.UUID, regionIds []uuid.UUID) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "projectId": autorest.Encode("path", projectID), + } + + queryParameters := map[string]interface{}{ + "regionIds": autorest.Encode("query", regionIds, ","), + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPathParameters("/projects/{projectId}/images/regions", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteImageRegionsSender sends the DeleteImageRegions request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) DeleteImageRegionsSender(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...) +} + +// DeleteImageRegionsResponder handles the response to the DeleteImageRegions request. The method always +// closes the http.Response Body. +func (client BaseClient) DeleteImageRegionsResponder(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 +} + +// DeleteImages sends the delete images request. +// Parameters: +// projectID - the project id. +// imageIds - ids of the images to be deleted. Limited to 256 images per batch. +// allImages - flag to specify delete all images, specify this flag or a list of images. Using this flag will +// return a 202 response to indicate the images are being deleted. +// allIterations - removes these images from all iterations, not just the current workspace. Using this flag +// will return a 202 response to indicate the images are being deleted. +func (client BaseClient) DeleteImages(ctx context.Context, projectID uuid.UUID, imageIds []uuid.UUID, allImages *bool, allIterations *bool) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteImages") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: imageIds, + Constraints: []validation.Constraint{{Target: "imageIds", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "imageIds", Name: validation.MaxItems, Rule: 256, Chain: nil}, + {Target: "imageIds", Name: validation.MinItems, Rule: 0, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("training.BaseClient", "DeleteImages", err.Error()) + } + + req, err := client.DeleteImagesPreparer(ctx, projectID, imageIds, allImages, allIterations) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "DeleteImages", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteImagesSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "training.BaseClient", "DeleteImages", resp, "Failure sending request") + return + } + + result, err = client.DeleteImagesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "DeleteImages", resp, "Failure responding to request") + } + + return +} + +// DeleteImagesPreparer prepares the DeleteImages request. +func (client BaseClient) DeleteImagesPreparer(ctx context.Context, projectID uuid.UUID, imageIds []uuid.UUID, allImages *bool, allIterations *bool) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "projectId": autorest.Encode("path", projectID), + } + + queryParameters := map[string]interface{}{} + if imageIds != nil && len(imageIds) > 0 { + queryParameters["imageIds"] = autorest.Encode("query", imageIds, ",") + } + if allImages != nil { + queryParameters["allImages"] = autorest.Encode("query", *allImages) + } + if allIterations != nil { + queryParameters["allIterations"] = autorest.Encode("query", *allIterations) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPathParameters("/projects/{projectId}/images", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteImagesSender sends the DeleteImages request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) DeleteImagesSender(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...) +} + +// DeleteImagesResponder handles the response to the DeleteImages request. The method always +// closes the http.Response Body. +func (client BaseClient) DeleteImagesResponder(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 +} + +// DeleteImageTags sends the delete image tags request. +// Parameters: +// projectID - the project id. +// imageIds - image ids. Limited to 64 images. +// tagIds - tags to be deleted from the specified images. Limited to 20 tags. +func (client BaseClient) DeleteImageTags(ctx context.Context, projectID uuid.UUID, imageIds []uuid.UUID, tagIds []uuid.UUID) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteImageTags") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: imageIds, + Constraints: []validation.Constraint{{Target: "imageIds", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "imageIds", Name: validation.MaxItems, Rule: 64, Chain: nil}, + {Target: "imageIds", Name: validation.MinItems, Rule: 0, Chain: nil}, + }}}}, + {TargetValue: tagIds, + Constraints: []validation.Constraint{{Target: "tagIds", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "tagIds", Name: validation.MaxItems, Rule: 20, Chain: nil}, + {Target: "tagIds", Name: validation.MinItems, Rule: 0, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("training.BaseClient", "DeleteImageTags", err.Error()) + } + + req, err := client.DeleteImageTagsPreparer(ctx, projectID, imageIds, tagIds) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "DeleteImageTags", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteImageTagsSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "training.BaseClient", "DeleteImageTags", resp, "Failure sending request") + return + } + + result, err = client.DeleteImageTagsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "DeleteImageTags", resp, "Failure responding to request") + } + + return +} + +// DeleteImageTagsPreparer prepares the DeleteImageTags request. +func (client BaseClient) DeleteImageTagsPreparer(ctx context.Context, projectID uuid.UUID, imageIds []uuid.UUID, tagIds []uuid.UUID) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "projectId": autorest.Encode("path", projectID), + } + + queryParameters := map[string]interface{}{ + "imageIds": autorest.Encode("query", imageIds, ","), + "tagIds": autorest.Encode("query", tagIds, ","), + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPathParameters("/projects/{projectId}/images/tags", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteImageTagsSender sends the DeleteImageTags request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) DeleteImageTagsSender(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...) +} + +// DeleteImageTagsResponder handles the response to the DeleteImageTags request. The method always +// closes the http.Response Body. +func (client BaseClient) DeleteImageTagsResponder(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 +} + +// DeleteIteration sends the delete iteration request. +// Parameters: +// projectID - the project id. +// iterationID - the iteration id. +func (client BaseClient) DeleteIteration(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteIteration") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeleteIterationPreparer(ctx, projectID, iterationID) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "DeleteIteration", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteIterationSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "training.BaseClient", "DeleteIteration", resp, "Failure sending request") + return + } + + result, err = client.DeleteIterationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "DeleteIteration", resp, "Failure responding to request") + } + + return +} + +// DeleteIterationPreparer prepares the DeleteIteration request. +func (client BaseClient) DeleteIterationPreparer(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "iterationId": autorest.Encode("path", iterationID), + "projectId": autorest.Encode("path", projectID), + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPathParameters("/projects/{projectId}/iterations/{iterationId}", pathParameters), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteIterationSender sends the DeleteIteration request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) DeleteIterationSender(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...) +} + +// DeleteIterationResponder handles the response to the DeleteIteration request. The method always +// closes the http.Response Body. +func (client BaseClient) DeleteIterationResponder(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 +} + +// DeletePrediction sends the delete prediction request. +// Parameters: +// projectID - the project id. +// ids - the prediction ids. Limited to 64. +func (client BaseClient) DeletePrediction(ctx context.Context, projectID uuid.UUID, ids []uuid.UUID) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeletePrediction") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: ids, + Constraints: []validation.Constraint{{Target: "ids", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "ids", Name: validation.MaxItems, Rule: 64, Chain: nil}, + {Target: "ids", Name: validation.MinItems, Rule: 0, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("training.BaseClient", "DeletePrediction", err.Error()) + } + + req, err := client.DeletePredictionPreparer(ctx, projectID, ids) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "DeletePrediction", nil, "Failure preparing request") + return + } + + resp, err := client.DeletePredictionSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "training.BaseClient", "DeletePrediction", resp, "Failure sending request") + return + } + + result, err = client.DeletePredictionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "DeletePrediction", resp, "Failure responding to request") + } + + return +} + +// DeletePredictionPreparer prepares the DeletePrediction request. +func (client BaseClient) DeletePredictionPreparer(ctx context.Context, projectID uuid.UUID, ids []uuid.UUID) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "projectId": autorest.Encode("path", projectID), + } + + queryParameters := map[string]interface{}{ + "ids": autorest.Encode("query", ids, ","), + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPathParameters("/projects/{projectId}/predictions", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeletePredictionSender sends the DeletePrediction request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) DeletePredictionSender(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...) +} + +// DeletePredictionResponder handles the response to the DeletePrediction request. The method always +// closes the http.Response Body. +func (client BaseClient) DeletePredictionResponder(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 +} + +// DeleteProject sends the delete project request. +// Parameters: +// projectID - the project id. +func (client BaseClient) DeleteProject(ctx context.Context, projectID uuid.UUID) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteProject") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeleteProjectPreparer(ctx, projectID) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "DeleteProject", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteProjectSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "training.BaseClient", "DeleteProject", resp, "Failure sending request") + return + } + + result, err = client.DeleteProjectResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "DeleteProject", resp, "Failure responding to request") + } + + return +} + +// DeleteProjectPreparer prepares the DeleteProject request. +func (client BaseClient) DeleteProjectPreparer(ctx context.Context, projectID uuid.UUID) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "projectId": autorest.Encode("path", projectID), + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPathParameters("/projects/{projectId}", pathParameters), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteProjectSender sends the DeleteProject request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) DeleteProjectSender(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...) +} + +// DeleteProjectResponder handles the response to the DeleteProject request. The method always +// closes the http.Response Body. +func (client BaseClient) DeleteProjectResponder(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 +} + +// DeleteTag sends the delete tag request. +// Parameters: +// projectID - the project id. +// tagID - id of the tag to be deleted. +func (client BaseClient) DeleteTag(ctx context.Context, projectID uuid.UUID, tagID uuid.UUID) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteTag") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeleteTagPreparer(ctx, projectID, tagID) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "DeleteTag", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteTagSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "training.BaseClient", "DeleteTag", resp, "Failure sending request") + return + } + + result, err = client.DeleteTagResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "DeleteTag", resp, "Failure responding to request") + } + + return +} + +// DeleteTagPreparer prepares the DeleteTag request. +func (client BaseClient) DeleteTagPreparer(ctx context.Context, projectID uuid.UUID, tagID uuid.UUID) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "projectId": autorest.Encode("path", projectID), + "tagId": autorest.Encode("path", tagID), + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPathParameters("/projects/{projectId}/tags/{tagId}", pathParameters), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteTagSender sends the DeleteTag request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) DeleteTagSender(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...) +} + +// DeleteTagResponder handles the response to the DeleteTag request. The method always +// closes the http.Response Body. +func (client BaseClient) DeleteTagResponder(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 +} + +// ExportIteration sends the export iteration request. +// Parameters: +// projectID - the project id. +// iterationID - the iteration id. +// platform - the target platform. +// flavor - the flavor of the target platform. +func (client BaseClient) ExportIteration(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, platform string, flavor string) (result Export, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ExportIteration") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ExportIterationPreparer(ctx, projectID, iterationID, platform, flavor) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "ExportIteration", nil, "Failure preparing request") + return + } + + resp, err := client.ExportIterationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "training.BaseClient", "ExportIteration", resp, "Failure sending request") + return + } + + result, err = client.ExportIterationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "ExportIteration", resp, "Failure responding to request") + } + + return +} + +// ExportIterationPreparer prepares the ExportIteration request. +func (client BaseClient) ExportIterationPreparer(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, platform string, flavor string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "iterationId": autorest.Encode("path", iterationID), + "projectId": autorest.Encode("path", projectID), + } + + queryParameters := map[string]interface{}{ + "platform": autorest.Encode("query", platform), + } + if len(string(flavor)) > 0 { + queryParameters["flavor"] = autorest.Encode("query", flavor) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPathParameters("/projects/{projectId}/iterations/{iterationId}/export", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ExportIterationSender sends the ExportIteration request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) ExportIterationSender(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...) +} + +// ExportIterationResponder handles the response to the ExportIteration request. The method always +// closes the http.Response Body. +func (client BaseClient) ExportIterationResponder(resp *http.Response) (result Export, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetDomain sends the get domain request. +// Parameters: +// domainID - the id of the domain to get information about. +func (client BaseClient) GetDomain(ctx context.Context, domainID uuid.UUID) (result Domain, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDomain") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetDomainPreparer(ctx, domainID) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetDomain", nil, "Failure preparing request") + return + } + + resp, err := client.GetDomainSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetDomain", resp, "Failure sending request") + return + } + + result, err = client.GetDomainResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetDomain", resp, "Failure responding to request") + } + + return +} + +// GetDomainPreparer prepares the GetDomain request. +func (client BaseClient) GetDomainPreparer(ctx context.Context, domainID uuid.UUID) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "domainId": autorest.Encode("path", domainID), + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPathParameters("/domains/{domainId}", pathParameters), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetDomainSender sends the GetDomain request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetDomainSender(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...) +} + +// GetDomainResponder handles the response to the GetDomain request. The method always +// closes the http.Response Body. +func (client BaseClient) GetDomainResponder(resp *http.Response) (result Domain, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetDomains sends the get domains request. +func (client BaseClient) GetDomains(ctx context.Context) (result ListDomain, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDomains") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetDomainsPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetDomains", nil, "Failure preparing request") + return + } + + resp, err := client.GetDomainsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetDomains", resp, "Failure sending request") + return + } + + result, err = client.GetDomainsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetDomains", resp, "Failure responding to request") + } + + return +} + +// GetDomainsPreparer prepares the GetDomains request. +func (client BaseClient) GetDomainsPreparer(ctx context.Context) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPath("/domains"), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetDomainsSender sends the GetDomains request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetDomainsSender(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...) +} + +// GetDomainsResponder handles the response to the GetDomains request. The method always +// closes the http.Response Body. +func (client BaseClient) GetDomainsResponder(resp *http.Response) (result ListDomain, 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 +} + +// GetExports sends the get exports request. +// Parameters: +// projectID - the project id. +// iterationID - the iteration id. +func (client BaseClient) GetExports(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID) (result ListExport, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetExports") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetExportsPreparer(ctx, projectID, iterationID) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetExports", nil, "Failure preparing request") + return + } + + resp, err := client.GetExportsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetExports", resp, "Failure sending request") + return + } + + result, err = client.GetExportsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetExports", resp, "Failure responding to request") + } + + return +} + +// GetExportsPreparer prepares the GetExports request. +func (client BaseClient) GetExportsPreparer(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "iterationId": autorest.Encode("path", iterationID), + "projectId": autorest.Encode("path", projectID), + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPathParameters("/projects/{projectId}/iterations/{iterationId}/export", pathParameters), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetExportsSender sends the GetExports request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetExportsSender(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...) +} + +// GetExportsResponder handles the response to the GetExports request. The method always +// closes the http.Response Body. +func (client BaseClient) GetExportsResponder(resp *http.Response) (result ListExport, 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 +} + +// GetImagePerformanceCount the filtering is on an and/or relationship. For example, if the provided tag ids are for +// the "Dog" and +// "Cat" tags, then only images tagged with Dog and/or Cat will be returned +// Parameters: +// projectID - the project id. +// iterationID - the iteration id. Defaults to workspace. +// tagIds - a list of tags ids to filter the images to count. Defaults to all tags when null. +func (client BaseClient) GetImagePerformanceCount(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, tagIds []uuid.UUID) (result Int32, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetImagePerformanceCount") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetImagePerformanceCountPreparer(ctx, projectID, iterationID, tagIds) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetImagePerformanceCount", nil, "Failure preparing request") + return + } + + resp, err := client.GetImagePerformanceCountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetImagePerformanceCount", resp, "Failure sending request") + return + } + + result, err = client.GetImagePerformanceCountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetImagePerformanceCount", resp, "Failure responding to request") + } + + return +} + +// GetImagePerformanceCountPreparer prepares the GetImagePerformanceCount request. +func (client BaseClient) GetImagePerformanceCountPreparer(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, tagIds []uuid.UUID) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "iterationId": autorest.Encode("path", iterationID), + "projectId": autorest.Encode("path", projectID), + } + + queryParameters := map[string]interface{}{} + if tagIds != nil && len(tagIds) > 0 { + queryParameters["tagIds"] = autorest.Encode("query", tagIds, ",") + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPathParameters("/projects/{projectId}/iterations/{iterationId}/performance/images/count", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetImagePerformanceCountSender sends the GetImagePerformanceCount request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetImagePerformanceCountSender(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...) +} + +// GetImagePerformanceCountResponder handles the response to the GetImagePerformanceCount request. The method always +// closes the http.Response Body. +func (client BaseClient) GetImagePerformanceCountResponder(resp *http.Response) (result Int32, 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 +} + +// GetImagePerformances this API supports batching and range selection. By default it will only return first 50 images +// matching images. +// Use the {take} and {skip} parameters to control how many images to return in a given batch. +// The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and +// "Cat" tags, then only images tagged with Dog and/or Cat will be returned +// Parameters: +// projectID - the project id. +// iterationID - the iteration id. Defaults to workspace. +// tagIds - a list of tags ids to filter the images. Defaults to all tagged images when null. Limited to 20. +// orderBy - the ordering. Defaults to newest. +// take - maximum number of images to return. Defaults to 50, limited to 256. +// skip - number of images to skip before beginning the image batch. Defaults to 0. +func (client BaseClient) GetImagePerformances(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, tagIds []uuid.UUID, orderBy string, take *int32, skip *int32) (result ListImagePerformance, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetImagePerformances") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: tagIds, + Constraints: []validation.Constraint{{Target: "tagIds", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "tagIds", Name: validation.MaxItems, Rule: 20, Chain: nil}, + {Target: "tagIds", Name: validation.MinItems, 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: int64(256), Chain: nil}, + {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("training.BaseClient", "GetImagePerformances", err.Error()) + } + + req, err := client.GetImagePerformancesPreparer(ctx, projectID, iterationID, tagIds, orderBy, take, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetImagePerformances", nil, "Failure preparing request") + return + } + + resp, err := client.GetImagePerformancesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetImagePerformances", resp, "Failure sending request") + return + } + + result, err = client.GetImagePerformancesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetImagePerformances", resp, "Failure responding to request") + } + + return +} + +// GetImagePerformancesPreparer prepares the GetImagePerformances request. +func (client BaseClient) GetImagePerformancesPreparer(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, tagIds []uuid.UUID, orderBy string, take *int32, skip *int32) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "iterationId": autorest.Encode("path", iterationID), + "projectId": autorest.Encode("path", projectID), + } + + queryParameters := map[string]interface{}{} + if tagIds != nil && len(tagIds) > 0 { + queryParameters["tagIds"] = autorest.Encode("query", tagIds, ",") + } + if len(string(orderBy)) > 0 { + queryParameters["orderBy"] = autorest.Encode("query", orderBy) + } + if take != nil { + queryParameters["take"] = autorest.Encode("query", *take) + } else { + queryParameters["take"] = autorest.Encode("query", 50) + } + if skip != nil { + queryParameters["skip"] = autorest.Encode("query", *skip) + } else { + queryParameters["skip"] = autorest.Encode("query", 0) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPathParameters("/projects/{projectId}/iterations/{iterationId}/performance/images", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetImagePerformancesSender sends the GetImagePerformances request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetImagePerformancesSender(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...) +} + +// GetImagePerformancesResponder handles the response to the GetImagePerformances request. The method always +// closes the http.Response Body. +func (client BaseClient) GetImagePerformancesResponder(resp *http.Response) (result ListImagePerformance, 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 +} + +// GetImageRegionProposals this API will get region proposals for an image along with confidences for the region. It +// returns an empty array if no proposals are found. +// Parameters: +// projectID - the project id. +// imageID - the image id. +func (client BaseClient) GetImageRegionProposals(ctx context.Context, projectID uuid.UUID, imageID uuid.UUID) (result ImageRegionProposal, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetImageRegionProposals") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetImageRegionProposalsPreparer(ctx, projectID, imageID) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetImageRegionProposals", nil, "Failure preparing request") + return + } + + resp, err := client.GetImageRegionProposalsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetImageRegionProposals", resp, "Failure sending request") + return + } + + result, err = client.GetImageRegionProposalsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetImageRegionProposals", resp, "Failure responding to request") + } + + return +} + +// GetImageRegionProposalsPreparer prepares the GetImageRegionProposals request. +func (client BaseClient) GetImageRegionProposalsPreparer(ctx context.Context, projectID uuid.UUID, imageID uuid.UUID) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "imageId": autorest.Encode("path", imageID), + "projectId": autorest.Encode("path", projectID), + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPathParameters("/projects/{projectId}/images/{imageId}/regionproposals", pathParameters), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetImageRegionProposalsSender sends the GetImageRegionProposals request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetImageRegionProposalsSender(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...) +} + +// GetImageRegionProposalsResponder handles the response to the GetImageRegionProposals request. The method always +// closes the http.Response Body. +func (client BaseClient) GetImageRegionProposalsResponder(resp *http.Response) (result ImageRegionProposal, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetImagesByIds this API will return a set of Images for the specified tags and optionally iteration. If no iteration +// is specified the +// current workspace is used. +// Parameters: +// projectID - the project id. +// imageIds - the list of image ids to retrieve. Limited to 256. +// iterationID - the iteration id. Defaults to workspace. +func (client BaseClient) GetImagesByIds(ctx context.Context, projectID uuid.UUID, imageIds []uuid.UUID, iterationID *uuid.UUID) (result ListImage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetImagesByIds") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: imageIds, + Constraints: []validation.Constraint{{Target: "imageIds", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "imageIds", Name: validation.MaxItems, Rule: 256, Chain: nil}, + {Target: "imageIds", Name: validation.MinItems, Rule: 0, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("training.BaseClient", "GetImagesByIds", err.Error()) + } + + req, err := client.GetImagesByIdsPreparer(ctx, projectID, imageIds, iterationID) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetImagesByIds", nil, "Failure preparing request") + return + } + + resp, err := client.GetImagesByIdsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetImagesByIds", resp, "Failure sending request") + return + } + + result, err = client.GetImagesByIdsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetImagesByIds", resp, "Failure responding to request") + } + + return +} + +// GetImagesByIdsPreparer prepares the GetImagesByIds request. +func (client BaseClient) GetImagesByIdsPreparer(ctx context.Context, projectID uuid.UUID, imageIds []uuid.UUID, iterationID *uuid.UUID) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "projectId": autorest.Encode("path", projectID), + } + + queryParameters := map[string]interface{}{} + if imageIds != nil && len(imageIds) > 0 { + queryParameters["imageIds"] = autorest.Encode("query", imageIds, ",") + } + if iterationID != nil { + queryParameters["iterationId"] = autorest.Encode("query", *iterationID) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPathParameters("/projects/{projectId}/images/id", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetImagesByIdsSender sends the GetImagesByIds request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetImagesByIdsSender(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...) +} + +// GetImagesByIdsResponder handles the response to the GetImagesByIds request. The method always +// closes the http.Response Body. +func (client BaseClient) GetImagesByIdsResponder(resp *http.Response) (result ListImage, 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 +} + +// GetIteration sends the get iteration request. +// Parameters: +// projectID - the id of the project the iteration belongs to. +// iterationID - the id of the iteration to get. +func (client BaseClient) GetIteration(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID) (result Iteration, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetIteration") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetIterationPreparer(ctx, projectID, iterationID) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetIteration", nil, "Failure preparing request") + return + } + + resp, err := client.GetIterationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetIteration", resp, "Failure sending request") + return + } + + result, err = client.GetIterationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetIteration", resp, "Failure responding to request") + } + + return +} + +// GetIterationPreparer prepares the GetIteration request. +func (client BaseClient) GetIterationPreparer(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "iterationId": autorest.Encode("path", iterationID), + "projectId": autorest.Encode("path", projectID), + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPathParameters("/projects/{projectId}/iterations/{iterationId}", pathParameters), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetIterationSender sends the GetIteration request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetIterationSender(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...) +} + +// GetIterationResponder handles the response to the GetIteration request. The method always +// closes the http.Response Body. +func (client BaseClient) GetIterationResponder(resp *http.Response) (result Iteration, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetIterationPerformance sends the get iteration performance request. +// Parameters: +// projectID - the id of the project the iteration belongs to. +// iterationID - the id of the iteration to get. +// threshold - the threshold used to determine true predictions. +// overlapThreshold - if applicable, the bounding box overlap threshold used to determine true predictions. +func (client BaseClient) GetIterationPerformance(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, threshold *float64, overlapThreshold *float64) (result IterationPerformance, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetIterationPerformance") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetIterationPerformancePreparer(ctx, projectID, iterationID, threshold, overlapThreshold) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetIterationPerformance", nil, "Failure preparing request") + return + } + + resp, err := client.GetIterationPerformanceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetIterationPerformance", resp, "Failure sending request") + return + } + + result, err = client.GetIterationPerformanceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetIterationPerformance", resp, "Failure responding to request") + } + + return +} + +// GetIterationPerformancePreparer prepares the GetIterationPerformance request. +func (client BaseClient) GetIterationPerformancePreparer(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, threshold *float64, overlapThreshold *float64) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "iterationId": autorest.Encode("path", iterationID), + "projectId": autorest.Encode("path", projectID), + } + + queryParameters := map[string]interface{}{} + if threshold != nil { + queryParameters["threshold"] = autorest.Encode("query", *threshold) + } + if overlapThreshold != nil { + queryParameters["overlapThreshold"] = autorest.Encode("query", *overlapThreshold) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPathParameters("/projects/{projectId}/iterations/{iterationId}/performance", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetIterationPerformanceSender sends the GetIterationPerformance request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetIterationPerformanceSender(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...) +} + +// GetIterationPerformanceResponder handles the response to the GetIterationPerformance request. The method always +// closes the http.Response Body. +func (client BaseClient) GetIterationPerformanceResponder(resp *http.Response) (result IterationPerformance, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetIterations sends the get iterations request. +// Parameters: +// projectID - the project id. +func (client BaseClient) GetIterations(ctx context.Context, projectID uuid.UUID) (result ListIteration, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetIterations") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetIterationsPreparer(ctx, projectID) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetIterations", nil, "Failure preparing request") + return + } + + resp, err := client.GetIterationsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetIterations", resp, "Failure sending request") + return + } + + result, err = client.GetIterationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetIterations", resp, "Failure responding to request") + } + + return +} + +// GetIterationsPreparer prepares the GetIterations request. +func (client BaseClient) GetIterationsPreparer(ctx context.Context, projectID uuid.UUID) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "projectId": autorest.Encode("path", projectID), + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPathParameters("/projects/{projectId}/iterations", pathParameters), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetIterationsSender sends the GetIterations request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetIterationsSender(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...) +} + +// GetIterationsResponder handles the response to the GetIterations request. The method always +// closes the http.Response Body. +func (client BaseClient) GetIterationsResponder(resp *http.Response) (result ListIteration, 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 +} + +// GetProject sends the get project request. +// Parameters: +// projectID - the id of the project to get. +func (client BaseClient) GetProject(ctx context.Context, projectID uuid.UUID) (result Project, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetProject") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetProjectPreparer(ctx, projectID) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetProject", nil, "Failure preparing request") + return + } + + resp, err := client.GetProjectSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetProject", resp, "Failure sending request") + return + } + + result, err = client.GetProjectResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetProject", resp, "Failure responding to request") + } + + return +} + +// GetProjectPreparer prepares the GetProject request. +func (client BaseClient) GetProjectPreparer(ctx context.Context, projectID uuid.UUID) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "projectId": autorest.Encode("path", projectID), + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPathParameters("/projects/{projectId}", pathParameters), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetProjectSender sends the GetProject request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetProjectSender(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...) +} + +// GetProjectResponder handles the response to the GetProject request. The method always +// closes the http.Response Body. +func (client BaseClient) GetProjectResponder(resp *http.Response) (result Project, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetProjects sends the get projects request. +func (client BaseClient) GetProjects(ctx context.Context) (result ListProject, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetProjects") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetProjectsPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetProjects", nil, "Failure preparing request") + return + } + + resp, err := client.GetProjectsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetProjects", resp, "Failure sending request") + return + } + + result, err = client.GetProjectsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetProjects", resp, "Failure responding to request") + } + + return +} + +// GetProjectsPreparer prepares the GetProjects request. +func (client BaseClient) GetProjectsPreparer(ctx context.Context) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPath("/projects"), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetProjectsSender sends the GetProjects request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetProjectsSender(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...) +} + +// GetProjectsResponder handles the response to the GetProjects request. The method always +// closes the http.Response Body. +func (client BaseClient) GetProjectsResponder(resp *http.Response) (result ListProject, 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 +} + +// GetTag sends the get tag request. +// Parameters: +// projectID - the project this tag belongs to. +// tagID - the tag id. +// iterationID - the iteration to retrieve this tag from. Optional, defaults to current training set. +func (client BaseClient) GetTag(ctx context.Context, projectID uuid.UUID, tagID uuid.UUID, iterationID *uuid.UUID) (result Tag, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetTag") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetTagPreparer(ctx, projectID, tagID, iterationID) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetTag", nil, "Failure preparing request") + return + } + + resp, err := client.GetTagSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetTag", resp, "Failure sending request") + return + } + + result, err = client.GetTagResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetTag", resp, "Failure responding to request") + } + + return +} + +// GetTagPreparer prepares the GetTag request. +func (client BaseClient) GetTagPreparer(ctx context.Context, projectID uuid.UUID, tagID uuid.UUID, iterationID *uuid.UUID) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "projectId": autorest.Encode("path", projectID), + "tagId": autorest.Encode("path", tagID), + } + + queryParameters := map[string]interface{}{} + if iterationID != nil { + queryParameters["iterationId"] = autorest.Encode("query", *iterationID) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPathParameters("/projects/{projectId}/tags/{tagId}", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetTagSender sends the GetTag request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetTagSender(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...) +} + +// GetTagResponder handles the response to the GetTag request. The method always +// closes the http.Response Body. +func (client BaseClient) GetTagResponder(resp *http.Response) (result Tag, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetTaggedImageCount the filtering is on an and/or relationship. For example, if the provided tag ids are for the +// "Dog" and +// "Cat" tags, then only images tagged with Dog and/or Cat will be returned +// Parameters: +// projectID - the project id. +// iterationID - the iteration id. Defaults to workspace. +// tagIds - a list of tags ids to filter the images to count. Defaults to all tags when null. +func (client BaseClient) GetTaggedImageCount(ctx context.Context, projectID uuid.UUID, iterationID *uuid.UUID, tagIds []uuid.UUID) (result Int32, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetTaggedImageCount") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetTaggedImageCountPreparer(ctx, projectID, iterationID, tagIds) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetTaggedImageCount", nil, "Failure preparing request") + return + } + + resp, err := client.GetTaggedImageCountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetTaggedImageCount", resp, "Failure sending request") + return + } + + result, err = client.GetTaggedImageCountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetTaggedImageCount", resp, "Failure responding to request") + } + + return +} + +// GetTaggedImageCountPreparer prepares the GetTaggedImageCount request. +func (client BaseClient) GetTaggedImageCountPreparer(ctx context.Context, projectID uuid.UUID, iterationID *uuid.UUID, tagIds []uuid.UUID) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "projectId": autorest.Encode("path", projectID), + } + + queryParameters := map[string]interface{}{} + if iterationID != nil { + queryParameters["iterationId"] = autorest.Encode("query", *iterationID) + } + if tagIds != nil && len(tagIds) > 0 { + queryParameters["tagIds"] = autorest.Encode("query", tagIds, ",") + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPathParameters("/projects/{projectId}/images/tagged/count", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetTaggedImageCountSender sends the GetTaggedImageCount request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetTaggedImageCountSender(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...) +} + +// GetTaggedImageCountResponder handles the response to the GetTaggedImageCount request. The method always +// closes the http.Response Body. +func (client BaseClient) GetTaggedImageCountResponder(resp *http.Response) (result Int32, 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 +} + +// GetTaggedImages this API supports batching and range selection. By default it will only return first 50 images +// matching images. +// Use the {take} and {skip} parameters to control how many images to return in a given batch. +// The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and +// "Cat" tags, then only images tagged with Dog and/or Cat will be returned +// Parameters: +// projectID - the project id. +// iterationID - the iteration id. Defaults to workspace. +// tagIds - a list of tags ids to filter the images. Defaults to all tagged images when null. Limited to 20. +// orderBy - the ordering. Defaults to newest. +// take - maximum number of images to return. Defaults to 50, limited to 256. +// skip - number of images to skip before beginning the image batch. Defaults to 0. +func (client BaseClient) GetTaggedImages(ctx context.Context, projectID uuid.UUID, iterationID *uuid.UUID, tagIds []uuid.UUID, orderBy string, take *int32, skip *int32) (result ListImage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetTaggedImages") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: tagIds, + Constraints: []validation.Constraint{{Target: "tagIds", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "tagIds", Name: validation.MaxItems, Rule: 20, Chain: nil}, + {Target: "tagIds", Name: validation.MinItems, 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: int64(256), Chain: nil}, + {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("training.BaseClient", "GetTaggedImages", err.Error()) + } + + req, err := client.GetTaggedImagesPreparer(ctx, projectID, iterationID, tagIds, orderBy, take, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetTaggedImages", nil, "Failure preparing request") + return + } + + resp, err := client.GetTaggedImagesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetTaggedImages", resp, "Failure sending request") + return + } + + result, err = client.GetTaggedImagesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetTaggedImages", resp, "Failure responding to request") + } + + return +} + +// GetTaggedImagesPreparer prepares the GetTaggedImages request. +func (client BaseClient) GetTaggedImagesPreparer(ctx context.Context, projectID uuid.UUID, iterationID *uuid.UUID, tagIds []uuid.UUID, orderBy string, take *int32, skip *int32) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "projectId": autorest.Encode("path", projectID), + } + + queryParameters := map[string]interface{}{} + if iterationID != nil { + queryParameters["iterationId"] = autorest.Encode("query", *iterationID) + } + if tagIds != nil && len(tagIds) > 0 { + queryParameters["tagIds"] = autorest.Encode("query", tagIds, ",") + } + if len(string(orderBy)) > 0 { + queryParameters["orderBy"] = autorest.Encode("query", orderBy) + } + if take != nil { + queryParameters["take"] = autorest.Encode("query", *take) + } else { + queryParameters["take"] = autorest.Encode("query", 50) + } + if skip != nil { + queryParameters["skip"] = autorest.Encode("query", *skip) + } else { + queryParameters["skip"] = autorest.Encode("query", 0) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPathParameters("/projects/{projectId}/images/tagged", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetTaggedImagesSender sends the GetTaggedImages request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetTaggedImagesSender(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...) +} + +// GetTaggedImagesResponder handles the response to the GetTaggedImages request. The method always +// closes the http.Response Body. +func (client BaseClient) GetTaggedImagesResponder(resp *http.Response) (result ListImage, 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 +} + +// GetTags sends the get tags request. +// Parameters: +// projectID - the project id. +// iterationID - the iteration id. Defaults to workspace. +func (client BaseClient) GetTags(ctx context.Context, projectID uuid.UUID, iterationID *uuid.UUID) (result ListTag, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetTags") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetTagsPreparer(ctx, projectID, iterationID) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetTags", nil, "Failure preparing request") + return + } + + resp, err := client.GetTagsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetTags", resp, "Failure sending request") + return + } + + result, err = client.GetTagsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetTags", resp, "Failure responding to request") + } + + return +} + +// GetTagsPreparer prepares the GetTags request. +func (client BaseClient) GetTagsPreparer(ctx context.Context, projectID uuid.UUID, iterationID *uuid.UUID) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "projectId": autorest.Encode("path", projectID), + } + + queryParameters := map[string]interface{}{} + if iterationID != nil { + queryParameters["iterationId"] = autorest.Encode("query", *iterationID) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPathParameters("/projects/{projectId}/tags", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetTagsSender sends the GetTags request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetTagsSender(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...) +} + +// GetTagsResponder handles the response to the GetTags request. The method always +// closes the http.Response Body. +func (client BaseClient) GetTagsResponder(resp *http.Response) (result ListTag, 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 +} + +// GetUntaggedImageCount this API returns the images which have no tags for a given project and optionally an +// iteration. If no iteration is specified the +// current workspace is used. +// Parameters: +// projectID - the project id. +// iterationID - the iteration id. Defaults to workspace. +func (client BaseClient) GetUntaggedImageCount(ctx context.Context, projectID uuid.UUID, iterationID *uuid.UUID) (result Int32, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetUntaggedImageCount") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetUntaggedImageCountPreparer(ctx, projectID, iterationID) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetUntaggedImageCount", nil, "Failure preparing request") + return + } + + resp, err := client.GetUntaggedImageCountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetUntaggedImageCount", resp, "Failure sending request") + return + } + + result, err = client.GetUntaggedImageCountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetUntaggedImageCount", resp, "Failure responding to request") + } + + return +} + +// GetUntaggedImageCountPreparer prepares the GetUntaggedImageCount request. +func (client BaseClient) GetUntaggedImageCountPreparer(ctx context.Context, projectID uuid.UUID, iterationID *uuid.UUID) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "projectId": autorest.Encode("path", projectID), + } + + queryParameters := map[string]interface{}{} + if iterationID != nil { + queryParameters["iterationId"] = autorest.Encode("query", *iterationID) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPathParameters("/projects/{projectId}/images/untagged/count", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetUntaggedImageCountSender sends the GetUntaggedImageCount request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetUntaggedImageCountSender(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...) +} + +// GetUntaggedImageCountResponder handles the response to the GetUntaggedImageCount request. The method always +// closes the http.Response Body. +func (client BaseClient) GetUntaggedImageCountResponder(resp *http.Response) (result Int32, 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 +} + +// GetUntaggedImages this API supports batching and range selection. By default it will only return first 50 images +// matching images. +// Use the {take} and {skip} parameters to control how many images to return in a given batch. +// Parameters: +// projectID - the project id. +// iterationID - the iteration id. Defaults to workspace. +// orderBy - the ordering. Defaults to newest. +// take - maximum number of images to return. Defaults to 50, limited to 256. +// skip - number of images to skip before beginning the image batch. Defaults to 0. +func (client BaseClient) GetUntaggedImages(ctx context.Context, projectID uuid.UUID, iterationID *uuid.UUID, orderBy string, take *int32, skip *int32) (result ListImage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetUntaggedImages") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + 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: int64(256), Chain: nil}, + {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("training.BaseClient", "GetUntaggedImages", err.Error()) + } + + req, err := client.GetUntaggedImagesPreparer(ctx, projectID, iterationID, orderBy, take, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetUntaggedImages", nil, "Failure preparing request") + return + } + + resp, err := client.GetUntaggedImagesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetUntaggedImages", resp, "Failure sending request") + return + } + + result, err = client.GetUntaggedImagesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "GetUntaggedImages", resp, "Failure responding to request") + } + + return +} + +// GetUntaggedImagesPreparer prepares the GetUntaggedImages request. +func (client BaseClient) GetUntaggedImagesPreparer(ctx context.Context, projectID uuid.UUID, iterationID *uuid.UUID, orderBy string, take *int32, skip *int32) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "projectId": autorest.Encode("path", projectID), + } + + queryParameters := map[string]interface{}{} + if iterationID != nil { + queryParameters["iterationId"] = autorest.Encode("query", *iterationID) + } + if len(string(orderBy)) > 0 { + queryParameters["orderBy"] = autorest.Encode("query", orderBy) + } + if take != nil { + queryParameters["take"] = autorest.Encode("query", *take) + } else { + queryParameters["take"] = autorest.Encode("query", 50) + } + if skip != nil { + queryParameters["skip"] = autorest.Encode("query", *skip) + } else { + queryParameters["skip"] = autorest.Encode("query", 0) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPathParameters("/projects/{projectId}/images/untagged", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetUntaggedImagesSender sends the GetUntaggedImages request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetUntaggedImagesSender(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...) +} + +// GetUntaggedImagesResponder handles the response to the GetUntaggedImages request. The method always +// closes the http.Response Body. +func (client BaseClient) GetUntaggedImagesResponder(resp *http.Response) (result ListImage, 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 +} + +// PublishIteration sends the publish iteration request. +// Parameters: +// projectID - the project id. +// iterationID - the iteration id. +// publishName - the name to give the published iteration. +// predictionID - the id of the prediction resource to publish to. +func (client BaseClient) PublishIteration(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, publishName string, predictionID string) (result Bool, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.PublishIteration") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PublishIterationPreparer(ctx, projectID, iterationID, publishName, predictionID) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "PublishIteration", nil, "Failure preparing request") + return + } + + resp, err := client.PublishIterationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "training.BaseClient", "PublishIteration", resp, "Failure sending request") + return + } + + result, err = client.PublishIterationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "PublishIteration", resp, "Failure responding to request") + } + + return +} + +// PublishIterationPreparer prepares the PublishIteration request. +func (client BaseClient) PublishIterationPreparer(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, publishName string, predictionID string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "iterationId": autorest.Encode("path", iterationID), + "projectId": autorest.Encode("path", projectID), + } + + queryParameters := map[string]interface{}{ + "predictionId": autorest.Encode("query", predictionID), + "publishName": autorest.Encode("query", publishName), + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPathParameters("/projects/{projectId}/iterations/{iterationId}/publish", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PublishIterationSender sends the PublishIteration request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) PublishIterationSender(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...) +} + +// PublishIterationResponder handles the response to the PublishIteration request. The method always +// closes the http.Response Body. +func (client BaseClient) PublishIterationResponder(resp *http.Response) (result Bool, 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 +} + +// QueryPredictions sends the query predictions request. +// Parameters: +// projectID - the project id. +// query - parameters used to query the predictions. Limited to combining 2 tags. +func (client BaseClient) QueryPredictions(ctx context.Context, projectID uuid.UUID, query PredictionQueryToken) (result PredictionQueryResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.QueryPredictions") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.QueryPredictionsPreparer(ctx, projectID, query) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "QueryPredictions", nil, "Failure preparing request") + return + } + + resp, err := client.QueryPredictionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "training.BaseClient", "QueryPredictions", resp, "Failure sending request") + return + } + + result, err = client.QueryPredictionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "QueryPredictions", resp, "Failure responding to request") + } + + return +} + +// QueryPredictionsPreparer prepares the QueryPredictions request. +func (client BaseClient) QueryPredictionsPreparer(ctx context.Context, projectID uuid.UUID, query PredictionQueryToken) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "projectId": autorest.Encode("path", projectID), + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPathParameters("/projects/{projectId}/predictions/query", pathParameters), + autorest.WithJSON(query), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// QueryPredictionsSender sends the QueryPredictions request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) QueryPredictionsSender(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...) +} + +// QueryPredictionsResponder handles the response to the QueryPredictions request. The method always +// closes the http.Response Body. +func (client BaseClient) QueryPredictionsResponder(resp *http.Response) (result PredictionQueryResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// QuerySuggestedImageCount this API takes in tagIds to get count of untagged images per suggested tags for a given +// threshold. +// Parameters: +// projectID - the project id. +// iterationID - iterationId to use for the suggested tags and regions. +// query - model that contains tagIds, threshold and projectType to query by. +func (client BaseClient) QuerySuggestedImageCount(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, query TagFilter) (result SetInt32, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.QuerySuggestedImageCount") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.QuerySuggestedImageCountPreparer(ctx, projectID, iterationID, query) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "QuerySuggestedImageCount", nil, "Failure preparing request") + return + } + + resp, err := client.QuerySuggestedImageCountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "training.BaseClient", "QuerySuggestedImageCount", resp, "Failure sending request") + return + } + + result, err = client.QuerySuggestedImageCountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "QuerySuggestedImageCount", resp, "Failure responding to request") + } + + return +} + +// QuerySuggestedImageCountPreparer prepares the QuerySuggestedImageCount request. +func (client BaseClient) QuerySuggestedImageCountPreparer(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, query TagFilter) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "projectId": autorest.Encode("path", projectID), + } + + queryParameters := map[string]interface{}{ + "iterationId": autorest.Encode("query", iterationID), + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPathParameters("/projects/{projectId}/images/suggested/count", pathParameters), + autorest.WithJSON(query), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// QuerySuggestedImageCountSender sends the QuerySuggestedImageCount request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) QuerySuggestedImageCountSender(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...) +} + +// QuerySuggestedImageCountResponder handles the response to the QuerySuggestedImageCount request. The method always +// closes the http.Response Body. +func (client BaseClient) QuerySuggestedImageCountResponder(resp *http.Response) (result SetInt32, 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 +} + +// QuerySuggestedImages this API will fetch untagged images filtered by suggested tags Ids. It returns an empty array +// if no images are found. +// Parameters: +// projectID - the project id. +// iterationID - iterationId to use for the suggested tags and regions. +// query - contains properties we need to query suggested images. +func (client BaseClient) QuerySuggestedImages(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, query SuggestedTagAndRegionQueryToken) (result SuggestedTagAndRegionQuery, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.QuerySuggestedImages") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.QuerySuggestedImagesPreparer(ctx, projectID, iterationID, query) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "QuerySuggestedImages", nil, "Failure preparing request") + return + } + + resp, err := client.QuerySuggestedImagesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "training.BaseClient", "QuerySuggestedImages", resp, "Failure sending request") + return + } + + result, err = client.QuerySuggestedImagesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "QuerySuggestedImages", resp, "Failure responding to request") + } + + return +} + +// QuerySuggestedImagesPreparer prepares the QuerySuggestedImages request. +func (client BaseClient) QuerySuggestedImagesPreparer(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, query SuggestedTagAndRegionQueryToken) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "projectId": autorest.Encode("path", projectID), + } + + queryParameters := map[string]interface{}{ + "iterationId": autorest.Encode("query", iterationID), + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPathParameters("/projects/{projectId}/images/suggested", pathParameters), + autorest.WithJSON(query), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// QuerySuggestedImagesSender sends the QuerySuggestedImages request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) QuerySuggestedImagesSender(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...) +} + +// QuerySuggestedImagesResponder handles the response to the QuerySuggestedImages request. The method always +// closes the http.Response Body. +func (client BaseClient) QuerySuggestedImagesResponder(resp *http.Response) (result SuggestedTagAndRegionQuery, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// QuickTestImage sends the quick test image request. +// Parameters: +// projectID - the project id. +// imageData - binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 6MB. +// iterationID - optional. Specifies the id of a particular iteration to evaluate against. +// The default iteration for the project will be used when not specified. +// store - optional. Specifies whether or not to store the result of this prediction. The default is true, to +// store. +func (client BaseClient) QuickTestImage(ctx context.Context, projectID uuid.UUID, imageData io.ReadCloser, iterationID *uuid.UUID, store *bool) (result ImagePrediction, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.QuickTestImage") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.QuickTestImagePreparer(ctx, projectID, imageData, iterationID, store) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "QuickTestImage", nil, "Failure preparing request") + return + } + + resp, err := client.QuickTestImageSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "training.BaseClient", "QuickTestImage", resp, "Failure sending request") + return + } + + result, err = client.QuickTestImageResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "QuickTestImage", resp, "Failure responding to request") + } + + return +} + +// QuickTestImagePreparer prepares the QuickTestImage request. +func (client BaseClient) QuickTestImagePreparer(ctx context.Context, projectID uuid.UUID, imageData io.ReadCloser, iterationID *uuid.UUID, store *bool) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "projectId": autorest.Encode("path", projectID), + } + + queryParameters := map[string]interface{}{} + if iterationID != nil { + queryParameters["iterationId"] = autorest.Encode("query", *iterationID) + } + if store != nil { + queryParameters["store"] = autorest.Encode("query", *store) + } else { + queryParameters["store"] = autorest.Encode("query", true) + } + + formDataParameters := map[string]interface{}{ + "imageData": imageData, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPathParameters("/projects/{projectId}/quicktest/image", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithMultiPartFormData(formDataParameters), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// QuickTestImageSender sends the QuickTestImage request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) QuickTestImageSender(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...) +} + +// QuickTestImageResponder handles the response to the QuickTestImage request. The method always +// closes the http.Response Body. +func (client BaseClient) QuickTestImageResponder(resp *http.Response) (result ImagePrediction, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// QuickTestImageURL sends the quick test image url request. +// Parameters: +// projectID - the project to evaluate against. +// imageURL - an ImageUrl that contains the url of the image to be evaluated. +// iterationID - optional. Specifies the id of a particular iteration to evaluate against. +// The default iteration for the project will be used when not specified. +// store - optional. Specifies whether or not to store the result of this prediction. The default is true, to +// store. +func (client BaseClient) QuickTestImageURL(ctx context.Context, projectID uuid.UUID, imageURL ImageURL, iterationID *uuid.UUID, store *bool) (result ImagePrediction, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.QuickTestImageURL") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: imageURL, + Constraints: []validation.Constraint{{Target: "imageURL.URL", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("training.BaseClient", "QuickTestImageURL", err.Error()) + } + + req, err := client.QuickTestImageURLPreparer(ctx, projectID, imageURL, iterationID, store) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "QuickTestImageURL", nil, "Failure preparing request") + return + } + + resp, err := client.QuickTestImageURLSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "training.BaseClient", "QuickTestImageURL", resp, "Failure sending request") + return + } + + result, err = client.QuickTestImageURLResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "QuickTestImageURL", resp, "Failure responding to request") + } + + return +} + +// QuickTestImageURLPreparer prepares the QuickTestImageURL request. +func (client BaseClient) QuickTestImageURLPreparer(ctx context.Context, projectID uuid.UUID, imageURL ImageURL, iterationID *uuid.UUID, store *bool) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "projectId": autorest.Encode("path", projectID), + } + + queryParameters := map[string]interface{}{} + if iterationID != nil { + queryParameters["iterationId"] = autorest.Encode("query", *iterationID) + } + if store != nil { + queryParameters["store"] = autorest.Encode("query", *store) + } else { + queryParameters["store"] = autorest.Encode("query", true) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPathParameters("/projects/{projectId}/quicktest/url", pathParameters), + autorest.WithJSON(imageURL), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// QuickTestImageURLSender sends the QuickTestImageURL request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) QuickTestImageURLSender(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...) +} + +// QuickTestImageURLResponder handles the response to the QuickTestImageURL request. The method always +// closes the http.Response Body. +func (client BaseClient) QuickTestImageURLResponder(resp *http.Response) (result ImagePrediction, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// SuggestTagsAndRegions this API will get suggested tags and regions for an array/batch of untagged images along with +// confidences for the tags. It returns an empty array if no tags are found. +// There is a limit of 64 images in the batch. +// Parameters: +// projectID - the project id. +// iterationID - iterationId to use for tag and region suggestion. +// imageIds - array of image ids tag suggestion are needed for. Use GetUntaggedImages API to get imageIds. +func (client BaseClient) SuggestTagsAndRegions(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, imageIds []uuid.UUID) (result ListSuggestedTagAndRegion, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.SuggestTagsAndRegions") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: imageIds, + Constraints: []validation.Constraint{{Target: "imageIds", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "imageIds", Name: validation.MaxItems, Rule: 64, Chain: nil}, + {Target: "imageIds", Name: validation.MinItems, Rule: 0, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("training.BaseClient", "SuggestTagsAndRegions", err.Error()) + } + + req, err := client.SuggestTagsAndRegionsPreparer(ctx, projectID, iterationID, imageIds) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "SuggestTagsAndRegions", nil, "Failure preparing request") + return + } + + resp, err := client.SuggestTagsAndRegionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "training.BaseClient", "SuggestTagsAndRegions", resp, "Failure sending request") + return + } + + result, err = client.SuggestTagsAndRegionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "SuggestTagsAndRegions", resp, "Failure responding to request") + } + + return +} + +// SuggestTagsAndRegionsPreparer prepares the SuggestTagsAndRegions request. +func (client BaseClient) SuggestTagsAndRegionsPreparer(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, imageIds []uuid.UUID) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "projectId": autorest.Encode("path", projectID), + } + + queryParameters := map[string]interface{}{ + "imageIds": autorest.Encode("query", imageIds, ","), + "iterationId": autorest.Encode("query", iterationID), + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPathParameters("/projects/{projectId}/tagsandregions/suggestions", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SuggestTagsAndRegionsSender sends the SuggestTagsAndRegions request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) SuggestTagsAndRegionsSender(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...) +} + +// SuggestTagsAndRegionsResponder handles the response to the SuggestTagsAndRegions request. The method always +// closes the http.Response Body. +func (client BaseClient) SuggestTagsAndRegionsResponder(resp *http.Response) (result ListSuggestedTagAndRegion, 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 +} + +// TrainProject sends the train project request. +// Parameters: +// projectID - the project id. +// trainingType - the type of training to use to train the project (default: Regular). +// reservedBudgetInHours - the number of hours reserved as budget for training (if applicable). +// forceTrain - whether to force train even if dataset and configuration does not change (default: false). +// notificationEmailAddress - the email address to send notification to when training finishes (default: null). +func (client BaseClient) TrainProject(ctx context.Context, projectID uuid.UUID, trainingType string, reservedBudgetInHours *int32, forceTrain *bool, notificationEmailAddress string) (result Iteration, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.TrainProject") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.TrainProjectPreparer(ctx, projectID, trainingType, reservedBudgetInHours, forceTrain, notificationEmailAddress) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "TrainProject", nil, "Failure preparing request") + return + } + + resp, err := client.TrainProjectSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "training.BaseClient", "TrainProject", resp, "Failure sending request") + return + } + + result, err = client.TrainProjectResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "TrainProject", resp, "Failure responding to request") + } + + return +} + +// TrainProjectPreparer prepares the TrainProject request. +func (client BaseClient) TrainProjectPreparer(ctx context.Context, projectID uuid.UUID, trainingType string, reservedBudgetInHours *int32, forceTrain *bool, notificationEmailAddress string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "projectId": autorest.Encode("path", projectID), + } + + queryParameters := map[string]interface{}{} + if len(string(trainingType)) > 0 { + queryParameters["trainingType"] = autorest.Encode("query", trainingType) + } + if reservedBudgetInHours != nil { + queryParameters["reservedBudgetInHours"] = autorest.Encode("query", *reservedBudgetInHours) + } else { + queryParameters["reservedBudgetInHours"] = autorest.Encode("query", 0) + } + if forceTrain != nil { + queryParameters["forceTrain"] = autorest.Encode("query", *forceTrain) + } else { + queryParameters["forceTrain"] = autorest.Encode("query", false) + } + if len(notificationEmailAddress) > 0 { + queryParameters["notificationEmailAddress"] = autorest.Encode("query", notificationEmailAddress) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPathParameters("/projects/{projectId}/train", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TrainProjectSender sends the TrainProject request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) TrainProjectSender(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...) +} + +// TrainProjectResponder handles the response to the TrainProject request. The method always +// closes the http.Response Body. +func (client BaseClient) TrainProjectResponder(resp *http.Response) (result Iteration, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UnpublishIteration sends the unpublish iteration request. +// Parameters: +// projectID - the project id. +// iterationID - the iteration id. +func (client BaseClient) UnpublishIteration(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UnpublishIteration") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UnpublishIterationPreparer(ctx, projectID, iterationID) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "UnpublishIteration", nil, "Failure preparing request") + return + } + + resp, err := client.UnpublishIterationSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "training.BaseClient", "UnpublishIteration", resp, "Failure sending request") + return + } + + result, err = client.UnpublishIterationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "UnpublishIteration", resp, "Failure responding to request") + } + + return +} + +// UnpublishIterationPreparer prepares the UnpublishIteration request. +func (client BaseClient) UnpublishIterationPreparer(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "iterationId": autorest.Encode("path", iterationID), + "projectId": autorest.Encode("path", projectID), + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPathParameters("/projects/{projectId}/iterations/{iterationId}/publish", pathParameters), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UnpublishIterationSender sends the UnpublishIteration request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) UnpublishIterationSender(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...) +} + +// UnpublishIterationResponder handles the response to the UnpublishIteration request. The method always +// closes the http.Response Body. +func (client BaseClient) UnpublishIterationResponder(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 +} + +// UpdateIteration sends the update iteration request. +// Parameters: +// projectID - project id. +// iterationID - iteration id. +// updatedIteration - the updated iteration model. +func (client BaseClient) UpdateIteration(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, updatedIteration Iteration) (result Iteration, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateIteration") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdateIterationPreparer(ctx, projectID, iterationID, updatedIteration) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "UpdateIteration", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateIterationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "training.BaseClient", "UpdateIteration", resp, "Failure sending request") + return + } + + result, err = client.UpdateIterationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "UpdateIteration", resp, "Failure responding to request") + } + + return +} + +// UpdateIterationPreparer prepares the UpdateIteration request. +func (client BaseClient) UpdateIterationPreparer(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, updatedIteration Iteration) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "iterationId": autorest.Encode("path", iterationID), + "projectId": autorest.Encode("path", projectID), + } + + updatedIteration.ID = nil + updatedIteration.Status = nil + updatedIteration.Created = nil + updatedIteration.LastModified = nil + updatedIteration.TrainedAt = nil + updatedIteration.ProjectID = nil + updatedIteration.Exportable = nil + updatedIteration.ExportableTo = nil + updatedIteration.DomainID = nil + updatedIteration.ClassificationType = "" + updatedIteration.TrainingType = "" + updatedIteration.ReservedBudgetInHours = nil + updatedIteration.TrainingTimeInMinutes = nil + updatedIteration.PublishName = nil + updatedIteration.OriginalPublishResourceID = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPathParameters("/projects/{projectId}/iterations/{iterationId}", pathParameters), + autorest.WithJSON(updatedIteration), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateIterationSender sends the UpdateIteration request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) UpdateIterationSender(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...) +} + +// UpdateIterationResponder handles the response to the UpdateIteration request. The method always +// closes the http.Response Body. +func (client BaseClient) UpdateIterationResponder(resp *http.Response) (result Iteration, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateProject sends the update project request. +// Parameters: +// projectID - the id of the project to update. +// updatedProject - the updated project model. +func (client BaseClient) UpdateProject(ctx context.Context, projectID uuid.UUID, updatedProject Project) (result Project, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateProject") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdateProjectPreparer(ctx, projectID, updatedProject) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "UpdateProject", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateProjectSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "training.BaseClient", "UpdateProject", resp, "Failure sending request") + return + } + + result, err = client.UpdateProjectResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "UpdateProject", resp, "Failure responding to request") + } + + return +} + +// UpdateProjectPreparer prepares the UpdateProject request. +func (client BaseClient) UpdateProjectPreparer(ctx context.Context, projectID uuid.UUID, updatedProject Project) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "projectId": autorest.Encode("path", projectID), + } + + updatedProject.ID = nil + updatedProject.Created = nil + updatedProject.LastModified = nil + updatedProject.ThumbnailURI = nil + updatedProject.DrModeEnabled = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPathParameters("/projects/{projectId}", pathParameters), + autorest.WithJSON(updatedProject), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateProjectSender sends the UpdateProject request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) UpdateProjectSender(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...) +} + +// UpdateProjectResponder handles the response to the UpdateProject request. The method always +// closes the http.Response Body. +func (client BaseClient) UpdateProjectResponder(resp *http.Response) (result Project, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateTag sends the update tag request. +// Parameters: +// projectID - the project id. +// tagID - the id of the target tag. +// updatedTag - the updated tag model. +func (client BaseClient) UpdateTag(ctx context.Context, projectID uuid.UUID, tagID uuid.UUID, updatedTag Tag) (result Tag, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateTag") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdateTagPreparer(ctx, projectID, tagID, updatedTag) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "UpdateTag", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateTagSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "training.BaseClient", "UpdateTag", resp, "Failure sending request") + return + } + + result, err = client.UpdateTagResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "training.BaseClient", "UpdateTag", resp, "Failure responding to request") + } + + return +} + +// UpdateTagPreparer prepares the UpdateTag request. +func (client BaseClient) UpdateTagPreparer(ctx context.Context, projectID uuid.UUID, tagID uuid.UUID, updatedTag Tag) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "projectId": autorest.Encode("path", projectID), + "tagId": autorest.Encode("path", tagID), + } + + updatedTag.ID = nil + updatedTag.ImageCount = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.1/training", urlParameters), + autorest.WithPathParameters("/projects/{projectId}/tags/{tagId}", pathParameters), + autorest.WithJSON(updatedTag), + autorest.WithHeader("Training-Key", client.APIKey)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateTagSender sends the UpdateTag request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) UpdateTagSender(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...) +} + +// UpdateTagResponder handles the response to the UpdateTag request. The method always +// closes the http.Response Body. +func (client BaseClient) UpdateTagResponder(resp *http.Response) (result Tag, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/cognitiveservices/v3.1/customvision/training/models.go b/services/cognitiveservices/v3.1/customvision/training/models.go new file mode 100644 index 000000000000..4bf92ebc7dd9 --- /dev/null +++ b/services/cognitiveservices/v3.1/customvision/training/models.go @@ -0,0 +1,1128 @@ +package training + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the 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" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v3.1/customvision/training" + +// Classifier enumerates the values for classifier. +type Classifier string + +const ( + // Multiclass ... + Multiclass Classifier = "Multiclass" + // Multilabel ... + Multilabel Classifier = "Multilabel" +) + +// PossibleClassifierValues returns an array of possible values for the Classifier const type. +func PossibleClassifierValues() []Classifier { + return []Classifier{Multiclass, Multilabel} +} + +// CustomVisionErrorCodes enumerates the values for custom vision error codes. +type CustomVisionErrorCodes string + +const ( + // BadRequest ... + BadRequest CustomVisionErrorCodes = "BadRequest" + // BadRequestCannotMigrateProjectWithName ... + BadRequestCannotMigrateProjectWithName CustomVisionErrorCodes = "BadRequestCannotMigrateProjectWithName" + // BadRequestClassificationTrainingValidationFailed ... + BadRequestClassificationTrainingValidationFailed CustomVisionErrorCodes = "BadRequestClassificationTrainingValidationFailed" + // BadRequestDetectionTrainingNotAllowNegativeTag ... + BadRequestDetectionTrainingNotAllowNegativeTag CustomVisionErrorCodes = "BadRequestDetectionTrainingNotAllowNegativeTag" + // BadRequestDetectionTrainingValidationFailed ... + BadRequestDetectionTrainingValidationFailed CustomVisionErrorCodes = "BadRequestDetectionTrainingValidationFailed" + // BadRequestDomainNotSupportedForAdvancedTraining ... + BadRequestDomainNotSupportedForAdvancedTraining CustomVisionErrorCodes = "BadRequestDomainNotSupportedForAdvancedTraining" + // BadRequestExceededBatchSize ... + BadRequestExceededBatchSize CustomVisionErrorCodes = "BadRequestExceededBatchSize" + // BadRequestExceededQuota ... + BadRequestExceededQuota CustomVisionErrorCodes = "BadRequestExceededQuota" + // BadRequestExceedIterationPerProjectLimit ... + BadRequestExceedIterationPerProjectLimit CustomVisionErrorCodes = "BadRequestExceedIterationPerProjectLimit" + // BadRequestExceedProjectLimit ... + BadRequestExceedProjectLimit CustomVisionErrorCodes = "BadRequestExceedProjectLimit" + // BadRequestExceedTagPerImageLimit ... + BadRequestExceedTagPerImageLimit CustomVisionErrorCodes = "BadRequestExceedTagPerImageLimit" + // BadRequestExceedTagPerProjectLimit ... + BadRequestExceedTagPerProjectLimit CustomVisionErrorCodes = "BadRequestExceedTagPerProjectLimit" + // BadRequestExportAlreadyInProgress ... + BadRequestExportAlreadyInProgress CustomVisionErrorCodes = "BadRequestExportAlreadyInProgress" + // BadRequestExportPlatformNotSupportedForAdvancedTraining ... + BadRequestExportPlatformNotSupportedForAdvancedTraining CustomVisionErrorCodes = "BadRequestExportPlatformNotSupportedForAdvancedTraining" + // BadRequestExportValidationFailed ... + BadRequestExportValidationFailed CustomVisionErrorCodes = "BadRequestExportValidationFailed" + // BadRequestImageBatch ... + BadRequestImageBatch CustomVisionErrorCodes = "BadRequestImageBatch" + // BadRequestImageExceededCount ... + BadRequestImageExceededCount CustomVisionErrorCodes = "BadRequestImageExceededCount" + // BadRequestImageFormat ... + BadRequestImageFormat CustomVisionErrorCodes = "BadRequestImageFormat" + // BadRequestImageRegions ... + BadRequestImageRegions CustomVisionErrorCodes = "BadRequestImageRegions" + // BadRequestImageSizeBytes ... + BadRequestImageSizeBytes CustomVisionErrorCodes = "BadRequestImageSizeBytes" + // BadRequestImageStream ... + BadRequestImageStream CustomVisionErrorCodes = "BadRequestImageStream" + // BadRequestImageTags ... + BadRequestImageTags CustomVisionErrorCodes = "BadRequestImageTags" + // BadRequestImageURL ... + BadRequestImageURL CustomVisionErrorCodes = "BadRequestImageUrl" + // BadRequestInvalid ... + BadRequestInvalid CustomVisionErrorCodes = "BadRequestInvalid" + // BadRequestInvalidEmailAddress ... + BadRequestInvalidEmailAddress CustomVisionErrorCodes = "BadRequestInvalidEmailAddress" + // BadRequestInvalidIds ... + BadRequestInvalidIds CustomVisionErrorCodes = "BadRequestInvalidIds" + // BadRequestInvalidPublishName ... + BadRequestInvalidPublishName CustomVisionErrorCodes = "BadRequestInvalidPublishName" + // BadRequestInvalidPublishTarget ... + BadRequestInvalidPublishTarget CustomVisionErrorCodes = "BadRequestInvalidPublishTarget" + // BadRequestIterationDescription ... + BadRequestIterationDescription CustomVisionErrorCodes = "BadRequestIterationDescription" + // BadRequestIterationIsNotTrained ... + BadRequestIterationIsNotTrained CustomVisionErrorCodes = "BadRequestIterationIsNotTrained" + // BadRequestIterationIsPublished ... + BadRequestIterationIsPublished CustomVisionErrorCodes = "BadRequestIterationIsPublished" + // BadRequestIterationName ... + BadRequestIterationName CustomVisionErrorCodes = "BadRequestIterationName" + // BadRequestIterationNameNotUnique ... + BadRequestIterationNameNotUnique CustomVisionErrorCodes = "BadRequestIterationNameNotUnique" + // BadRequestIterationNotPublished ... + BadRequestIterationNotPublished CustomVisionErrorCodes = "BadRequestIterationNotPublished" + // BadRequestMultiClassClassificationTrainingValidationFailed ... + BadRequestMultiClassClassificationTrainingValidationFailed CustomVisionErrorCodes = "BadRequestMultiClassClassificationTrainingValidationFailed" + // BadRequestMultiLabelClassificationTrainingValidationFailed ... + BadRequestMultiLabelClassificationTrainingValidationFailed CustomVisionErrorCodes = "BadRequestMultiLabelClassificationTrainingValidationFailed" + // BadRequestMultipleNegativeTag ... + BadRequestMultipleNegativeTag CustomVisionErrorCodes = "BadRequestMultipleNegativeTag" + // BadRequestNegativeAndRegularTagOnSameImage ... + BadRequestNegativeAndRegularTagOnSameImage CustomVisionErrorCodes = "BadRequestNegativeAndRegularTagOnSameImage" + // BadRequestNotLimitedTrial ... + BadRequestNotLimitedTrial CustomVisionErrorCodes = "BadRequestNotLimitedTrial" + // BadRequestNotSupported ... + BadRequestNotSupported CustomVisionErrorCodes = "BadRequestNotSupported" + // BadRequestPredictionIdsExceededCount ... + BadRequestPredictionIdsExceededCount CustomVisionErrorCodes = "BadRequestPredictionIdsExceededCount" + // BadRequestPredictionIdsMissing ... + BadRequestPredictionIdsMissing CustomVisionErrorCodes = "BadRequestPredictionIdsMissing" + // BadRequestPredictionInvalidApplicationName ... + BadRequestPredictionInvalidApplicationName CustomVisionErrorCodes = "BadRequestPredictionInvalidApplicationName" + // BadRequestPredictionInvalidQueryParameters ... + BadRequestPredictionInvalidQueryParameters CustomVisionErrorCodes = "BadRequestPredictionInvalidQueryParameters" + // BadRequestPredictionResultsExceededCount ... + BadRequestPredictionResultsExceededCount CustomVisionErrorCodes = "BadRequestPredictionResultsExceededCount" + // BadRequestPredictionTagsExceededCount ... + BadRequestPredictionTagsExceededCount CustomVisionErrorCodes = "BadRequestPredictionTagsExceededCount" + // BadRequestProjectDescription ... + BadRequestProjectDescription CustomVisionErrorCodes = "BadRequestProjectDescription" + // BadRequestProjectImagePreprocessingSettings ... + BadRequestProjectImagePreprocessingSettings CustomVisionErrorCodes = "BadRequestProjectImagePreprocessingSettings" + // BadRequestProjectName ... + BadRequestProjectName CustomVisionErrorCodes = "BadRequestProjectName" + // BadRequestProjectNameNotUnique ... + BadRequestProjectNameNotUnique CustomVisionErrorCodes = "BadRequestProjectNameNotUnique" + // BadRequestProjectUnknownClassification ... + BadRequestProjectUnknownClassification CustomVisionErrorCodes = "BadRequestProjectUnknownClassification" + // BadRequestProjectUnknownDomain ... + BadRequestProjectUnknownDomain CustomVisionErrorCodes = "BadRequestProjectUnknownDomain" + // BadRequestProjectUnsupportedDomainTypeChange ... + BadRequestProjectUnsupportedDomainTypeChange CustomVisionErrorCodes = "BadRequestProjectUnsupportedDomainTypeChange" + // BadRequestProjectUnsupportedExportPlatform ... + BadRequestProjectUnsupportedExportPlatform CustomVisionErrorCodes = "BadRequestProjectUnsupportedExportPlatform" + // BadRequestRequiredParamIsNull ... + BadRequestRequiredParamIsNull CustomVisionErrorCodes = "BadRequestRequiredParamIsNull" + // BadRequestReservedBudgetInHoursNotEnoughForAdvancedTraining ... + BadRequestReservedBudgetInHoursNotEnoughForAdvancedTraining CustomVisionErrorCodes = "BadRequestReservedBudgetInHoursNotEnoughForAdvancedTraining" + // BadRequestSubscriptionAPI ... + BadRequestSubscriptionAPI CustomVisionErrorCodes = "BadRequestSubscriptionApi" + // BadRequestTagDescription ... + BadRequestTagDescription CustomVisionErrorCodes = "BadRequestTagDescription" + // BadRequestTagName ... + BadRequestTagName CustomVisionErrorCodes = "BadRequestTagName" + // BadRequestTagNameNotUnique ... + BadRequestTagNameNotUnique CustomVisionErrorCodes = "BadRequestTagNameNotUnique" + // BadRequestTagType ... + BadRequestTagType CustomVisionErrorCodes = "BadRequestTagType" + // BadRequestTrainingAlreadyInProgress ... + BadRequestTrainingAlreadyInProgress CustomVisionErrorCodes = "BadRequestTrainingAlreadyInProgress" + // BadRequestTrainingNotNeeded ... + BadRequestTrainingNotNeeded CustomVisionErrorCodes = "BadRequestTrainingNotNeeded" + // BadRequestTrainingNotNeededButTrainingPipelineUpdated ... + BadRequestTrainingNotNeededButTrainingPipelineUpdated CustomVisionErrorCodes = "BadRequestTrainingNotNeededButTrainingPipelineUpdated" + // BadRequestTrainingValidationFailed ... + BadRequestTrainingValidationFailed CustomVisionErrorCodes = "BadRequestTrainingValidationFailed" + // BadRequestUnpublishFailed ... + BadRequestUnpublishFailed CustomVisionErrorCodes = "BadRequestUnpublishFailed" + // BadRequestWorkspaceCannotBeModified ... + BadRequestWorkspaceCannotBeModified CustomVisionErrorCodes = "BadRequestWorkspaceCannotBeModified" + // BadRequestWorkspaceNotDeletable ... + BadRequestWorkspaceNotDeletable CustomVisionErrorCodes = "BadRequestWorkspaceNotDeletable" + // Conflict ... + Conflict CustomVisionErrorCodes = "Conflict" + // ConflictInvalid ... + ConflictInvalid CustomVisionErrorCodes = "ConflictInvalid" + // ErrorExporterInvalidClassifier ... + ErrorExporterInvalidClassifier CustomVisionErrorCodes = "ErrorExporterInvalidClassifier" + // ErrorExporterInvalidFeaturizer ... + ErrorExporterInvalidFeaturizer CustomVisionErrorCodes = "ErrorExporterInvalidFeaturizer" + // ErrorExporterInvalidPlatform ... + ErrorExporterInvalidPlatform CustomVisionErrorCodes = "ErrorExporterInvalidPlatform" + // ErrorFeaturizationAugmentationError ... + ErrorFeaturizationAugmentationError CustomVisionErrorCodes = "ErrorFeaturizationAugmentationError" + // ErrorFeaturizationAugmentationUnavailable ... + ErrorFeaturizationAugmentationUnavailable CustomVisionErrorCodes = "ErrorFeaturizationAugmentationUnavailable" + // ErrorFeaturizationInvalidFeaturizer ... + ErrorFeaturizationInvalidFeaturizer CustomVisionErrorCodes = "ErrorFeaturizationInvalidFeaturizer" + // ErrorFeaturizationQueueTimeout ... + ErrorFeaturizationQueueTimeout CustomVisionErrorCodes = "ErrorFeaturizationQueueTimeout" + // ErrorFeaturizationServiceUnavailable ... + ErrorFeaturizationServiceUnavailable CustomVisionErrorCodes = "ErrorFeaturizationServiceUnavailable" + // ErrorFeaturizationUnrecognizedJob ... + ErrorFeaturizationUnrecognizedJob CustomVisionErrorCodes = "ErrorFeaturizationUnrecognizedJob" + // ErrorInvalid ... + ErrorInvalid CustomVisionErrorCodes = "ErrorInvalid" + // ErrorPrediction ... + ErrorPrediction CustomVisionErrorCodes = "ErrorPrediction" + // ErrorPredictionModelNotCached ... + ErrorPredictionModelNotCached CustomVisionErrorCodes = "ErrorPredictionModelNotCached" + // ErrorPredictionModelNotFound ... + ErrorPredictionModelNotFound CustomVisionErrorCodes = "ErrorPredictionModelNotFound" + // ErrorPredictionServiceUnavailable ... + ErrorPredictionServiceUnavailable CustomVisionErrorCodes = "ErrorPredictionServiceUnavailable" + // ErrorPredictionStorage ... + ErrorPredictionStorage CustomVisionErrorCodes = "ErrorPredictionStorage" + // ErrorProjectExportRequestFailed ... + ErrorProjectExportRequestFailed CustomVisionErrorCodes = "ErrorProjectExportRequestFailed" + // ErrorProjectInvalidDomain ... + ErrorProjectInvalidDomain CustomVisionErrorCodes = "ErrorProjectInvalidDomain" + // ErrorProjectInvalidPipelineConfiguration ... + ErrorProjectInvalidPipelineConfiguration CustomVisionErrorCodes = "ErrorProjectInvalidPipelineConfiguration" + // ErrorProjectInvalidWorkspace ... + ErrorProjectInvalidWorkspace CustomVisionErrorCodes = "ErrorProjectInvalidWorkspace" + // ErrorProjectTrainingRequestFailed ... + ErrorProjectTrainingRequestFailed CustomVisionErrorCodes = "ErrorProjectTrainingRequestFailed" + // ErrorRegionProposal ... + ErrorRegionProposal CustomVisionErrorCodes = "ErrorRegionProposal" + // ErrorUnknown ... + ErrorUnknown CustomVisionErrorCodes = "ErrorUnknown" + // Forbidden ... + Forbidden CustomVisionErrorCodes = "Forbidden" + // ForbiddenDRModeEnabled ... + ForbiddenDRModeEnabled CustomVisionErrorCodes = "ForbiddenDRModeEnabled" + // ForbiddenInvalid ... + ForbiddenInvalid CustomVisionErrorCodes = "ForbiddenInvalid" + // ForbiddenUser ... + ForbiddenUser CustomVisionErrorCodes = "ForbiddenUser" + // ForbiddenUserDisabled ... + ForbiddenUserDisabled CustomVisionErrorCodes = "ForbiddenUserDisabled" + // ForbiddenUserDoesNotExist ... + ForbiddenUserDoesNotExist CustomVisionErrorCodes = "ForbiddenUserDoesNotExist" + // ForbiddenUserInsufficientCapability ... + ForbiddenUserInsufficientCapability CustomVisionErrorCodes = "ForbiddenUserInsufficientCapability" + // ForbiddenUserResource ... + ForbiddenUserResource CustomVisionErrorCodes = "ForbiddenUserResource" + // ForbiddenUserSignupAllowanceExceeded ... + ForbiddenUserSignupAllowanceExceeded CustomVisionErrorCodes = "ForbiddenUserSignupAllowanceExceeded" + // ForbiddenUserSignupDisabled ... + ForbiddenUserSignupDisabled CustomVisionErrorCodes = "ForbiddenUserSignupDisabled" + // NoError ... + NoError CustomVisionErrorCodes = "NoError" + // NotFound ... + NotFound CustomVisionErrorCodes = "NotFound" + // NotFoundApimSubscription ... + NotFoundApimSubscription CustomVisionErrorCodes = "NotFoundApimSubscription" + // NotFoundDomain ... + NotFoundDomain CustomVisionErrorCodes = "NotFoundDomain" + // NotFoundImage ... + NotFoundImage CustomVisionErrorCodes = "NotFoundImage" + // NotFoundInvalid ... + NotFoundInvalid CustomVisionErrorCodes = "NotFoundInvalid" + // NotFoundIteration ... + NotFoundIteration CustomVisionErrorCodes = "NotFoundIteration" + // NotFoundIterationPerformance ... + NotFoundIterationPerformance CustomVisionErrorCodes = "NotFoundIterationPerformance" + // NotFoundProject ... + NotFoundProject CustomVisionErrorCodes = "NotFoundProject" + // NotFoundProjectDefaultIteration ... + NotFoundProjectDefaultIteration CustomVisionErrorCodes = "NotFoundProjectDefaultIteration" + // NotFoundTag ... + NotFoundTag CustomVisionErrorCodes = "NotFoundTag" + // UnsupportedMediaType ... + UnsupportedMediaType CustomVisionErrorCodes = "UnsupportedMediaType" +) + +// PossibleCustomVisionErrorCodesValues returns an array of possible values for the CustomVisionErrorCodes const type. +func PossibleCustomVisionErrorCodesValues() []CustomVisionErrorCodes { + return []CustomVisionErrorCodes{BadRequest, BadRequestCannotMigrateProjectWithName, BadRequestClassificationTrainingValidationFailed, BadRequestDetectionTrainingNotAllowNegativeTag, BadRequestDetectionTrainingValidationFailed, BadRequestDomainNotSupportedForAdvancedTraining, BadRequestExceededBatchSize, BadRequestExceededQuota, BadRequestExceedIterationPerProjectLimit, BadRequestExceedProjectLimit, BadRequestExceedTagPerImageLimit, BadRequestExceedTagPerProjectLimit, BadRequestExportAlreadyInProgress, BadRequestExportPlatformNotSupportedForAdvancedTraining, BadRequestExportValidationFailed, BadRequestImageBatch, BadRequestImageExceededCount, BadRequestImageFormat, BadRequestImageRegions, BadRequestImageSizeBytes, BadRequestImageStream, BadRequestImageTags, BadRequestImageURL, BadRequestInvalid, BadRequestInvalidEmailAddress, BadRequestInvalidIds, BadRequestInvalidPublishName, BadRequestInvalidPublishTarget, BadRequestIterationDescription, BadRequestIterationIsNotTrained, BadRequestIterationIsPublished, BadRequestIterationName, BadRequestIterationNameNotUnique, BadRequestIterationNotPublished, BadRequestMultiClassClassificationTrainingValidationFailed, BadRequestMultiLabelClassificationTrainingValidationFailed, BadRequestMultipleNegativeTag, BadRequestNegativeAndRegularTagOnSameImage, BadRequestNotLimitedTrial, BadRequestNotSupported, BadRequestPredictionIdsExceededCount, BadRequestPredictionIdsMissing, BadRequestPredictionInvalidApplicationName, BadRequestPredictionInvalidQueryParameters, BadRequestPredictionResultsExceededCount, BadRequestPredictionTagsExceededCount, BadRequestProjectDescription, BadRequestProjectImagePreprocessingSettings, BadRequestProjectName, BadRequestProjectNameNotUnique, BadRequestProjectUnknownClassification, BadRequestProjectUnknownDomain, BadRequestProjectUnsupportedDomainTypeChange, BadRequestProjectUnsupportedExportPlatform, BadRequestRequiredParamIsNull, BadRequestReservedBudgetInHoursNotEnoughForAdvancedTraining, BadRequestSubscriptionAPI, BadRequestTagDescription, BadRequestTagName, BadRequestTagNameNotUnique, BadRequestTagType, BadRequestTrainingAlreadyInProgress, BadRequestTrainingNotNeeded, BadRequestTrainingNotNeededButTrainingPipelineUpdated, BadRequestTrainingValidationFailed, BadRequestUnpublishFailed, BadRequestWorkspaceCannotBeModified, BadRequestWorkspaceNotDeletable, Conflict, ConflictInvalid, ErrorExporterInvalidClassifier, ErrorExporterInvalidFeaturizer, ErrorExporterInvalidPlatform, ErrorFeaturizationAugmentationError, ErrorFeaturizationAugmentationUnavailable, ErrorFeaturizationInvalidFeaturizer, ErrorFeaturizationQueueTimeout, ErrorFeaturizationServiceUnavailable, ErrorFeaturizationUnrecognizedJob, ErrorInvalid, ErrorPrediction, ErrorPredictionModelNotCached, ErrorPredictionModelNotFound, ErrorPredictionServiceUnavailable, ErrorPredictionStorage, ErrorProjectExportRequestFailed, ErrorProjectInvalidDomain, ErrorProjectInvalidPipelineConfiguration, ErrorProjectInvalidWorkspace, ErrorProjectTrainingRequestFailed, ErrorRegionProposal, ErrorUnknown, Forbidden, ForbiddenDRModeEnabled, ForbiddenInvalid, ForbiddenUser, ForbiddenUserDisabled, ForbiddenUserDoesNotExist, ForbiddenUserInsufficientCapability, ForbiddenUserResource, ForbiddenUserSignupAllowanceExceeded, ForbiddenUserSignupDisabled, NoError, NotFound, NotFoundApimSubscription, NotFoundDomain, NotFoundImage, NotFoundInvalid, NotFoundIteration, NotFoundIterationPerformance, NotFoundProject, NotFoundProjectDefaultIteration, NotFoundTag, UnsupportedMediaType} +} + +// DomainType enumerates the values for domain type. +type DomainType string + +const ( + // Classification ... + Classification DomainType = "Classification" + // ObjectDetection ... + ObjectDetection DomainType = "ObjectDetection" +) + +// PossibleDomainTypeValues returns an array of possible values for the DomainType const type. +func PossibleDomainTypeValues() []DomainType { + return []DomainType{Classification, ObjectDetection} +} + +// ExportFlavor enumerates the values for export flavor. +type ExportFlavor string + +const ( + // ARM ... + ARM ExportFlavor = "ARM" + // Linux ... + Linux ExportFlavor = "Linux" + // ONNX10 ... + ONNX10 ExportFlavor = "ONNX10" + // ONNX12 ... + ONNX12 ExportFlavor = "ONNX12" + // TensorFlowLite ... + TensorFlowLite ExportFlavor = "TensorFlowLite" + // TensorFlowNormal ... + TensorFlowNormal ExportFlavor = "TensorFlowNormal" + // Windows ... + Windows ExportFlavor = "Windows" +) + +// PossibleExportFlavorValues returns an array of possible values for the ExportFlavor const type. +func PossibleExportFlavorValues() []ExportFlavor { + return []ExportFlavor{ARM, Linux, ONNX10, ONNX12, TensorFlowLite, TensorFlowNormal, Windows} +} + +// ExportPlatform enumerates the values for export platform. +type ExportPlatform string + +const ( + // CoreML ... + CoreML ExportPlatform = "CoreML" + // DockerFile ... + DockerFile ExportPlatform = "DockerFile" + // ONNX ... + ONNX ExportPlatform = "ONNX" + // TensorFlow ... + TensorFlow ExportPlatform = "TensorFlow" + // VAIDK ... + VAIDK ExportPlatform = "VAIDK" +) + +// PossibleExportPlatformValues returns an array of possible values for the ExportPlatform const type. +func PossibleExportPlatformValues() []ExportPlatform { + return []ExportPlatform{CoreML, DockerFile, ONNX, TensorFlow, VAIDK} +} + +// ExportStatus enumerates the values for export status. +type ExportStatus string + +const ( + // Done ... + Done ExportStatus = "Done" + // Exporting ... + Exporting ExportStatus = "Exporting" + // Failed ... + Failed ExportStatus = "Failed" +) + +// PossibleExportStatusValues returns an array of possible values for the ExportStatus const type. +func PossibleExportStatusValues() []ExportStatus { + return []ExportStatus{Done, Exporting, Failed} +} + +// ImageCreateStatus enumerates the values for image create status. +type ImageCreateStatus string + +const ( + // ImageCreateStatusErrorImageFormat ... + ImageCreateStatusErrorImageFormat ImageCreateStatus = "ErrorImageFormat" + // ImageCreateStatusErrorImageSize ... + ImageCreateStatusErrorImageSize ImageCreateStatus = "ErrorImageSize" + // ImageCreateStatusErrorLimitExceed ... + ImageCreateStatusErrorLimitExceed ImageCreateStatus = "ErrorLimitExceed" + // ImageCreateStatusErrorNegativeAndRegularTagOnSameImage ... + ImageCreateStatusErrorNegativeAndRegularTagOnSameImage ImageCreateStatus = "ErrorNegativeAndRegularTagOnSameImage" + // ImageCreateStatusErrorRegionLimitExceed ... + ImageCreateStatusErrorRegionLimitExceed ImageCreateStatus = "ErrorRegionLimitExceed" + // ImageCreateStatusErrorSource ... + ImageCreateStatusErrorSource ImageCreateStatus = "ErrorSource" + // ImageCreateStatusErrorStorage ... + ImageCreateStatusErrorStorage ImageCreateStatus = "ErrorStorage" + // ImageCreateStatusErrorTagLimitExceed ... + ImageCreateStatusErrorTagLimitExceed ImageCreateStatus = "ErrorTagLimitExceed" + // ImageCreateStatusErrorUnknown ... + ImageCreateStatusErrorUnknown ImageCreateStatus = "ErrorUnknown" + // ImageCreateStatusOK ... + ImageCreateStatusOK ImageCreateStatus = "OK" + // ImageCreateStatusOKDuplicate ... + ImageCreateStatusOKDuplicate ImageCreateStatus = "OKDuplicate" +) + +// PossibleImageCreateStatusValues returns an array of possible values for the ImageCreateStatus const type. +func PossibleImageCreateStatusValues() []ImageCreateStatus { + return []ImageCreateStatus{ImageCreateStatusErrorImageFormat, ImageCreateStatusErrorImageSize, ImageCreateStatusErrorLimitExceed, ImageCreateStatusErrorNegativeAndRegularTagOnSameImage, ImageCreateStatusErrorRegionLimitExceed, ImageCreateStatusErrorSource, ImageCreateStatusErrorStorage, ImageCreateStatusErrorTagLimitExceed, ImageCreateStatusErrorUnknown, ImageCreateStatusOK, ImageCreateStatusOKDuplicate} +} + +// OrderBy enumerates the values for order by. +type OrderBy string + +const ( + // Newest ... + Newest OrderBy = "Newest" + // Oldest ... + Oldest OrderBy = "Oldest" + // Suggested ... + Suggested OrderBy = "Suggested" +) + +// PossibleOrderByValues returns an array of possible values for the OrderBy const type. +func PossibleOrderByValues() []OrderBy { + return []OrderBy{Newest, Oldest, Suggested} +} + +// SortBy enumerates the values for sort by. +type SortBy string + +const ( + // UncertaintyAscending ... + UncertaintyAscending SortBy = "UncertaintyAscending" + // UncertaintyDescending ... + UncertaintyDescending SortBy = "UncertaintyDescending" +) + +// PossibleSortByValues returns an array of possible values for the SortBy const type. +func PossibleSortByValues() []SortBy { + return []SortBy{UncertaintyAscending, UncertaintyDescending} +} + +// TagType enumerates the values for tag type. +type TagType string + +const ( + // Negative ... + Negative TagType = "Negative" + // Regular ... + Regular TagType = "Regular" +) + +// PossibleTagTypeValues returns an array of possible values for the TagType const type. +func PossibleTagTypeValues() []TagType { + return []TagType{Negative, Regular} +} + +// Type enumerates the values for type. +type Type string + +const ( + // TypeAdvanced ... + TypeAdvanced Type = "Advanced" + // TypeRegular ... + TypeRegular Type = "Regular" +) + +// PossibleTypeValues returns an array of possible values for the Type const type. +func PossibleTypeValues() []Type { + return []Type{TypeAdvanced, TypeRegular} +} + +// Bool ... +type Bool struct { + autorest.Response `json:"-"` + Value *bool `json:"value,omitempty"` +} + +// BoundingBox bounding box that defines a region of an image. +type BoundingBox struct { + // Left - Coordinate of the left boundary. + Left *float64 `json:"left,omitempty"` + // Top - Coordinate of the top boundary. + Top *float64 `json:"top,omitempty"` + // Width - Width. + Width *float64 `json:"width,omitempty"` + // Height - Height. + Height *float64 `json:"height,omitempty"` +} + +// CustomVisionError ... +type CustomVisionError struct { + // Code - The error code. Possible values include: 'NoError', 'BadRequest', 'BadRequestExceededBatchSize', 'BadRequestNotSupported', 'BadRequestInvalidIds', 'BadRequestProjectName', 'BadRequestProjectNameNotUnique', 'BadRequestProjectDescription', 'BadRequestProjectUnknownDomain', 'BadRequestProjectUnknownClassification', 'BadRequestProjectUnsupportedDomainTypeChange', 'BadRequestProjectUnsupportedExportPlatform', 'BadRequestProjectImagePreprocessingSettings', 'BadRequestIterationName', 'BadRequestIterationNameNotUnique', 'BadRequestIterationDescription', 'BadRequestIterationIsNotTrained', 'BadRequestWorkspaceCannotBeModified', 'BadRequestWorkspaceNotDeletable', 'BadRequestTagName', 'BadRequestTagNameNotUnique', 'BadRequestTagDescription', 'BadRequestTagType', 'BadRequestMultipleNegativeTag', 'BadRequestImageTags', 'BadRequestImageRegions', 'BadRequestNegativeAndRegularTagOnSameImage', 'BadRequestRequiredParamIsNull', 'BadRequestIterationIsPublished', 'BadRequestInvalidPublishName', 'BadRequestInvalidPublishTarget', 'BadRequestUnpublishFailed', 'BadRequestIterationNotPublished', 'BadRequestSubscriptionAPI', 'BadRequestExceedProjectLimit', 'BadRequestExceedIterationPerProjectLimit', 'BadRequestExceedTagPerProjectLimit', 'BadRequestExceedTagPerImageLimit', 'BadRequestExceededQuota', 'BadRequestCannotMigrateProjectWithName', 'BadRequestNotLimitedTrial', 'BadRequestImageBatch', 'BadRequestImageStream', 'BadRequestImageURL', 'BadRequestImageFormat', 'BadRequestImageSizeBytes', 'BadRequestImageExceededCount', 'BadRequestTrainingNotNeeded', 'BadRequestTrainingNotNeededButTrainingPipelineUpdated', 'BadRequestTrainingValidationFailed', 'BadRequestClassificationTrainingValidationFailed', 'BadRequestMultiClassClassificationTrainingValidationFailed', 'BadRequestMultiLabelClassificationTrainingValidationFailed', 'BadRequestDetectionTrainingValidationFailed', 'BadRequestTrainingAlreadyInProgress', 'BadRequestDetectionTrainingNotAllowNegativeTag', 'BadRequestInvalidEmailAddress', 'BadRequestDomainNotSupportedForAdvancedTraining', 'BadRequestExportPlatformNotSupportedForAdvancedTraining', 'BadRequestReservedBudgetInHoursNotEnoughForAdvancedTraining', 'BadRequestExportValidationFailed', 'BadRequestExportAlreadyInProgress', 'BadRequestPredictionIdsMissing', 'BadRequestPredictionIdsExceededCount', 'BadRequestPredictionTagsExceededCount', 'BadRequestPredictionResultsExceededCount', 'BadRequestPredictionInvalidApplicationName', 'BadRequestPredictionInvalidQueryParameters', 'BadRequestInvalid', 'UnsupportedMediaType', 'Forbidden', 'ForbiddenUser', 'ForbiddenUserResource', 'ForbiddenUserSignupDisabled', 'ForbiddenUserSignupAllowanceExceeded', 'ForbiddenUserDoesNotExist', 'ForbiddenUserDisabled', 'ForbiddenUserInsufficientCapability', 'ForbiddenDRModeEnabled', 'ForbiddenInvalid', 'NotFound', 'NotFoundProject', 'NotFoundProjectDefaultIteration', 'NotFoundIteration', 'NotFoundIterationPerformance', 'NotFoundTag', 'NotFoundImage', 'NotFoundDomain', 'NotFoundApimSubscription', 'NotFoundInvalid', 'Conflict', 'ConflictInvalid', 'ErrorUnknown', 'ErrorProjectInvalidWorkspace', 'ErrorProjectInvalidPipelineConfiguration', 'ErrorProjectInvalidDomain', 'ErrorProjectTrainingRequestFailed', 'ErrorProjectExportRequestFailed', 'ErrorFeaturizationServiceUnavailable', 'ErrorFeaturizationQueueTimeout', 'ErrorFeaturizationInvalidFeaturizer', 'ErrorFeaturizationAugmentationUnavailable', 'ErrorFeaturizationUnrecognizedJob', 'ErrorFeaturizationAugmentationError', 'ErrorExporterInvalidPlatform', 'ErrorExporterInvalidFeaturizer', 'ErrorExporterInvalidClassifier', 'ErrorPredictionServiceUnavailable', 'ErrorPredictionModelNotFound', 'ErrorPredictionModelNotCached', 'ErrorPrediction', 'ErrorPredictionStorage', 'ErrorRegionProposal', 'ErrorInvalid' + Code CustomVisionErrorCodes `json:"code,omitempty"` + // Message - A message explaining the error reported by the service. + Message *string `json:"message,omitempty"` +} + +// Domain ... +type Domain struct { + autorest.Response `json:"-"` + // ID - READ-ONLY + ID *uuid.UUID `json:"id,omitempty"` + // Name - READ-ONLY + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Possible values include: 'Classification', 'ObjectDetection' + Type DomainType `json:"type,omitempty"` + // Exportable - READ-ONLY + Exportable *bool `json:"exportable,omitempty"` + // Enabled - READ-ONLY + Enabled *bool `json:"enabled,omitempty"` +} + +// Export ... +type Export struct { + autorest.Response `json:"-"` + // Platform - READ-ONLY; Platform of the export. Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX', 'VAIDK' + Platform ExportPlatform `json:"platform,omitempty"` + // Status - READ-ONLY; Status of the export. Possible values include: 'Exporting', 'Failed', 'Done' + Status ExportStatus `json:"status,omitempty"` + // DownloadURI - READ-ONLY; URI used to download the model. + DownloadURI *string `json:"downloadUri,omitempty"` + // Flavor - READ-ONLY; Flavor of the export. Possible values include: 'Linux', 'Windows', 'ONNX10', 'ONNX12', 'ARM', 'TensorFlowNormal', 'TensorFlowLite' + Flavor ExportFlavor `json:"flavor,omitempty"` + // NewerVersionAvailable - READ-ONLY; Indicates an updated version of the export package is available and should be re-exported for the latest changes. + NewerVersionAvailable *bool `json:"newerVersionAvailable,omitempty"` +} + +// Image image model to be sent as JSON. +type Image struct { + // ID - READ-ONLY; Id of the image. + ID *uuid.UUID `json:"id,omitempty"` + // Created - READ-ONLY; Date the image was created. + Created *date.Time `json:"created,omitempty"` + // Width - READ-ONLY; Width of the image. + Width *int32 `json:"width,omitempty"` + // Height - READ-ONLY; Height of the image. + Height *int32 `json:"height,omitempty"` + // ResizedImageURI - READ-ONLY; The URI to the (resized) image used for training. + ResizedImageURI *string `json:"resizedImageUri,omitempty"` + // ThumbnailURI - READ-ONLY; The URI to the thumbnail of the original image. + ThumbnailURI *string `json:"thumbnailUri,omitempty"` + // OriginalImageURI - READ-ONLY; The URI to the original uploaded image. + OriginalImageURI *string `json:"originalImageUri,omitempty"` + // Tags - READ-ONLY; Tags associated with this image. + Tags *[]ImageTag `json:"tags,omitempty"` + // Regions - READ-ONLY; Regions associated with this image. + Regions *[]ImageRegion `json:"regions,omitempty"` +} + +// ImageCreateResult ... +type ImageCreateResult struct { + // SourceURL - READ-ONLY; Source URL of the image. + SourceURL *string `json:"sourceUrl,omitempty"` + // Status - READ-ONLY; Status of the image creation. Possible values include: 'ImageCreateStatusOK', 'ImageCreateStatusOKDuplicate', 'ImageCreateStatusErrorSource', 'ImageCreateStatusErrorImageFormat', 'ImageCreateStatusErrorImageSize', 'ImageCreateStatusErrorStorage', 'ImageCreateStatusErrorLimitExceed', 'ImageCreateStatusErrorTagLimitExceed', 'ImageCreateStatusErrorRegionLimitExceed', 'ImageCreateStatusErrorUnknown', 'ImageCreateStatusErrorNegativeAndRegularTagOnSameImage' + Status ImageCreateStatus `json:"status,omitempty"` + // Image - READ-ONLY; The image. + Image *Image `json:"image,omitempty"` +} + +// ImageCreateSummary ... +type ImageCreateSummary struct { + autorest.Response `json:"-"` + // IsBatchSuccessful - READ-ONLY; True if all of the images in the batch were created successfully, otherwise false. + IsBatchSuccessful *bool `json:"isBatchSuccessful,omitempty"` + // Images - READ-ONLY; List of the image creation results. + Images *[]ImageCreateResult `json:"images,omitempty"` +} + +// ImageFileCreateBatch ... +type ImageFileCreateBatch struct { + Images *[]ImageFileCreateEntry `json:"images,omitempty"` + TagIds *[]uuid.UUID `json:"tagIds,omitempty"` +} + +// ImageFileCreateEntry ... +type ImageFileCreateEntry struct { + Name *string `json:"name,omitempty"` + Contents *[]byte `json:"contents,omitempty"` + TagIds *[]uuid.UUID `json:"tagIds,omitempty"` + Regions *[]Region `json:"regions,omitempty"` +} + +// ImageIDCreateBatch ... +type ImageIDCreateBatch struct { + Images *[]ImageIDCreateEntry `json:"images,omitempty"` + TagIds *[]uuid.UUID `json:"tagIds,omitempty"` +} + +// ImageIDCreateEntry ... +type ImageIDCreateEntry struct { + // ID - Id of the image. + ID *uuid.UUID `json:"id,omitempty"` + TagIds *[]uuid.UUID `json:"tagIds,omitempty"` + Regions *[]Region `json:"regions,omitempty"` +} + +// ImagePerformance image performance model. +type ImagePerformance struct { + // Predictions - READ-ONLY + Predictions *[]Prediction `json:"predictions,omitempty"` + // ID - READ-ONLY + ID *uuid.UUID `json:"id,omitempty"` + // Created - READ-ONLY + Created *date.Time `json:"created,omitempty"` + // Width - READ-ONLY + Width *int32 `json:"width,omitempty"` + // Height - READ-ONLY + Height *int32 `json:"height,omitempty"` + // ImageURI - READ-ONLY + ImageURI *string `json:"imageUri,omitempty"` + // ThumbnailURI - READ-ONLY + ThumbnailURI *string `json:"thumbnailUri,omitempty"` + // Tags - READ-ONLY + Tags *[]ImageTag `json:"tags,omitempty"` + // Regions - READ-ONLY + Regions *[]ImageRegion `json:"regions,omitempty"` +} + +// ImagePrediction result of an image prediction request. +type ImagePrediction struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Prediction Id. + ID *uuid.UUID `json:"id,omitempty"` + // Project - READ-ONLY; Project Id. + Project *uuid.UUID `json:"project,omitempty"` + // Iteration - READ-ONLY; Iteration Id. + Iteration *uuid.UUID `json:"iteration,omitempty"` + // Created - READ-ONLY; Date this prediction was created. + Created *date.Time `json:"created,omitempty"` + // Predictions - READ-ONLY; List of predictions. + Predictions *[]Prediction `json:"predictions,omitempty"` +} + +// ImageProcessingSettings represents image preprocessing settings used by image augmentation. +type ImageProcessingSettings struct { + // AugmentationMethods - Gets or sets enabled image transforms. The key corresponds to the transform name. If value is set to true, then correspondent transform is enabled. Otherwise this transform will not be used. + // Augmentation will be uniformly distributed among enabled transforms. + AugmentationMethods map[string]*bool `json:"augmentationMethods"` +} + +// MarshalJSON is the custom marshaler for ImageProcessingSettings. +func (ips ImageProcessingSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ips.AugmentationMethods != nil { + objectMap["augmentationMethods"] = ips.AugmentationMethods + } + return json.Marshal(objectMap) +} + +// ImageRegion ... +type ImageRegion struct { + // RegionID - READ-ONLY + RegionID *uuid.UUID `json:"regionId,omitempty"` + // TagName - READ-ONLY + TagName *string `json:"tagName,omitempty"` + // Created - READ-ONLY + Created *date.Time `json:"created,omitempty"` + // TagID - Id of the tag associated with this region. + TagID *uuid.UUID `json:"tagId,omitempty"` + // Left - Coordinate of the left boundary. + Left *float64 `json:"left,omitempty"` + // Top - Coordinate of the top boundary. + Top *float64 `json:"top,omitempty"` + // Width - Width. + Width *float64 `json:"width,omitempty"` + // Height - Height. + Height *float64 `json:"height,omitempty"` +} + +// ImageRegionCreateBatch batch of image region information to create. +type ImageRegionCreateBatch struct { + Regions *[]ImageRegionCreateEntry `json:"regions,omitempty"` +} + +// ImageRegionCreateEntry entry associating a region to an image. +type ImageRegionCreateEntry struct { + // ImageID - Id of the image. + ImageID *uuid.UUID `json:"imageId,omitempty"` + // TagID - Id of the tag associated with this region. + TagID *uuid.UUID `json:"tagId,omitempty"` + // Left - Coordinate of the left boundary. + Left *float64 `json:"left,omitempty"` + // Top - Coordinate of the top boundary. + Top *float64 `json:"top,omitempty"` + // Width - Width. + Width *float64 `json:"width,omitempty"` + // Height - Height. + Height *float64 `json:"height,omitempty"` +} + +// ImageRegionCreateResult ... +type ImageRegionCreateResult struct { + // ImageID - READ-ONLY + ImageID *uuid.UUID `json:"imageId,omitempty"` + // RegionID - READ-ONLY + RegionID *uuid.UUID `json:"regionId,omitempty"` + // TagName - READ-ONLY + TagName *string `json:"tagName,omitempty"` + // Created - READ-ONLY + Created *date.Time `json:"created,omitempty"` + // TagID - Id of the tag associated with this region. + TagID *uuid.UUID `json:"tagId,omitempty"` + // Left - Coordinate of the left boundary. + Left *float64 `json:"left,omitempty"` + // Top - Coordinate of the top boundary. + Top *float64 `json:"top,omitempty"` + // Width - Width. + Width *float64 `json:"width,omitempty"` + // Height - Height. + Height *float64 `json:"height,omitempty"` +} + +// ImageRegionCreateSummary ... +type ImageRegionCreateSummary struct { + autorest.Response `json:"-"` + Created *[]ImageRegionCreateResult `json:"created,omitempty"` + Duplicated *[]ImageRegionCreateEntry `json:"duplicated,omitempty"` + Exceeded *[]ImageRegionCreateEntry `json:"exceeded,omitempty"` +} + +// ImageRegionProposal ... +type ImageRegionProposal struct { + autorest.Response `json:"-"` + // ProjectID - READ-ONLY + ProjectID *uuid.UUID `json:"projectId,omitempty"` + // ImageID - READ-ONLY + ImageID *uuid.UUID `json:"imageId,omitempty"` + // Proposals - READ-ONLY + Proposals *[]RegionProposal `json:"proposals,omitempty"` +} + +// ImageTag ... +type ImageTag struct { + // TagID - READ-ONLY + TagID *uuid.UUID `json:"tagId,omitempty"` + // TagName - READ-ONLY + TagName *string `json:"tagName,omitempty"` + // Created - READ-ONLY + Created *date.Time `json:"created,omitempty"` +} + +// ImageTagCreateBatch batch of image tags. +type ImageTagCreateBatch struct { + // Tags - Image Tag entries to include in this batch. + Tags *[]ImageTagCreateEntry `json:"tags,omitempty"` +} + +// ImageTagCreateEntry entry associating a tag to an image. +type ImageTagCreateEntry struct { + // ImageID - Id of the image. + ImageID *uuid.UUID `json:"imageId,omitempty"` + // TagID - Id of the tag. + TagID *uuid.UUID `json:"tagId,omitempty"` +} + +// ImageTagCreateSummary ... +type ImageTagCreateSummary struct { + autorest.Response `json:"-"` + Created *[]ImageTagCreateEntry `json:"created,omitempty"` + Duplicated *[]ImageTagCreateEntry `json:"duplicated,omitempty"` + Exceeded *[]ImageTagCreateEntry `json:"exceeded,omitempty"` +} + +// ImageURL image url. +type ImageURL struct { + // URL - Url of the image. + URL *string `json:"url,omitempty"` +} + +// ImageURLCreateBatch ... +type ImageURLCreateBatch struct { + Images *[]ImageURLCreateEntry `json:"images,omitempty"` + TagIds *[]uuid.UUID `json:"tagIds,omitempty"` +} + +// ImageURLCreateEntry ... +type ImageURLCreateEntry struct { + // URL - Url of the image. + URL *string `json:"url,omitempty"` + TagIds *[]uuid.UUID `json:"tagIds,omitempty"` + Regions *[]Region `json:"regions,omitempty"` +} + +// Int32 ... +type Int32 struct { + autorest.Response `json:"-"` + Value *int32 `json:"value,omitempty"` +} + +// Iteration iteration model to be sent over JSON. +type Iteration struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Gets the id of the iteration. + ID *uuid.UUID `json:"id,omitempty"` + // Name - Gets or sets the name of the iteration. + Name *string `json:"name,omitempty"` + // Status - READ-ONLY; Gets the current iteration status. + Status *string `json:"status,omitempty"` + // Created - READ-ONLY; Gets the time this iteration was completed. + Created *date.Time `json:"created,omitempty"` + // LastModified - READ-ONLY; Gets the time this iteration was last modified. + LastModified *date.Time `json:"lastModified,omitempty"` + // TrainedAt - READ-ONLY; Gets the time this iteration was last modified. + TrainedAt *date.Time `json:"trainedAt,omitempty"` + // ProjectID - READ-ONLY; Gets the project id of the iteration. + ProjectID *uuid.UUID `json:"projectId,omitempty"` + // Exportable - READ-ONLY; Whether the iteration can be exported to another format for download. + Exportable *bool `json:"exportable,omitempty"` + // ExportableTo - READ-ONLY; A set of platforms this iteration can export to. + ExportableTo *[]string `json:"exportableTo,omitempty"` + // DomainID - READ-ONLY; Get or sets a guid of the domain the iteration has been trained on. + DomainID *uuid.UUID `json:"domainId,omitempty"` + // ClassificationType - READ-ONLY; Gets the classification type of the project. Possible values include: 'Multiclass', 'Multilabel' + ClassificationType Classifier `json:"classificationType,omitempty"` + // TrainingType - READ-ONLY; Gets the training type of the iteration. Possible values include: 'TypeRegular', 'TypeAdvanced' + TrainingType Type `json:"trainingType,omitempty"` + // ReservedBudgetInHours - READ-ONLY; Gets the reserved advanced training budget for the iteration. + ReservedBudgetInHours *int32 `json:"reservedBudgetInHours,omitempty"` + // TrainingTimeInMinutes - READ-ONLY; Gets the training time for the iteration. + TrainingTimeInMinutes *int32 `json:"trainingTimeInMinutes,omitempty"` + // PublishName - READ-ONLY; Name of the published model. + PublishName *string `json:"publishName,omitempty"` + // OriginalPublishResourceID - READ-ONLY; Resource Provider Id this iteration was originally published to. + OriginalPublishResourceID *string `json:"originalPublishResourceId,omitempty"` +} + +// IterationPerformance represents the detailed performance data for a trained iteration. +type IterationPerformance struct { + autorest.Response `json:"-"` + // PerTagPerformance - READ-ONLY; Gets the per-tag performance details for this iteration. + PerTagPerformance *[]TagPerformance `json:"perTagPerformance,omitempty"` + // Precision - READ-ONLY; Gets the precision. + Precision *float64 `json:"precision,omitempty"` + // PrecisionStdDeviation - READ-ONLY; Gets the standard deviation for the precision. + PrecisionStdDeviation *float64 `json:"precisionStdDeviation,omitempty"` + // Recall - READ-ONLY; Gets the recall. + Recall *float64 `json:"recall,omitempty"` + // RecallStdDeviation - READ-ONLY; Gets the standard deviation for the recall. + RecallStdDeviation *float64 `json:"recallStdDeviation,omitempty"` + // AveragePrecision - READ-ONLY; Gets the average precision when applicable. + AveragePrecision *float64 `json:"averagePrecision,omitempty"` +} + +// ListDomain ... +type ListDomain struct { + autorest.Response `json:"-"` + Value *[]Domain `json:"value,omitempty"` +} + +// ListExport ... +type ListExport struct { + autorest.Response `json:"-"` + Value *[]Export `json:"value,omitempty"` +} + +// ListImage ... +type ListImage struct { + autorest.Response `json:"-"` + Value *[]Image `json:"value,omitempty"` +} + +// ListImagePerformance ... +type ListImagePerformance struct { + autorest.Response `json:"-"` + Value *[]ImagePerformance `json:"value,omitempty"` +} + +// ListIteration ... +type ListIteration struct { + autorest.Response `json:"-"` + Value *[]Iteration `json:"value,omitempty"` +} + +// ListProject ... +type ListProject struct { + autorest.Response `json:"-"` + Value *[]Project `json:"value,omitempty"` +} + +// ListSuggestedTagAndRegion ... +type ListSuggestedTagAndRegion struct { + autorest.Response `json:"-"` + Value *[]SuggestedTagAndRegion `json:"value,omitempty"` +} + +// ListTag ... +type ListTag struct { + autorest.Response `json:"-"` + Value *[]Tag `json:"value,omitempty"` +} + +// Prediction prediction result. +type Prediction struct { + // Probability - READ-ONLY; Probability of the tag. + Probability *float64 `json:"probability,omitempty"` + // TagID - READ-ONLY; Id of the predicted tag. + TagID *uuid.UUID `json:"tagId,omitempty"` + // TagName - READ-ONLY; Name of the predicted tag. + TagName *string `json:"tagName,omitempty"` + // BoundingBox - READ-ONLY; Bounding box of the prediction. + BoundingBox *BoundingBox `json:"boundingBox,omitempty"` +} + +// PredictionQueryResult query result of the prediction images that were sent to your prediction endpoint. +type PredictionQueryResult struct { + autorest.Response `json:"-"` + // Token - Prediction Query Token. + Token *PredictionQueryToken `json:"token,omitempty"` + // Results - READ-ONLY; Result of an prediction request. + Results *[]StoredImagePrediction `json:"results,omitempty"` +} + +// PredictionQueryTag ... +type PredictionQueryTag struct { + ID *uuid.UUID `json:"id,omitempty"` + MinThreshold *float64 `json:"minThreshold,omitempty"` + MaxThreshold *float64 `json:"maxThreshold,omitempty"` +} + +// PredictionQueryToken ... +type PredictionQueryToken struct { + Session *string `json:"session,omitempty"` + Continuation *string `json:"continuation,omitempty"` + MaxCount *int32 `json:"maxCount,omitempty"` + // OrderBy - Possible values include: 'Newest', 'Oldest', 'Suggested' + OrderBy OrderBy `json:"orderBy,omitempty"` + Tags *[]PredictionQueryTag `json:"tags,omitempty"` + IterationID *uuid.UUID `json:"iterationId,omitempty"` + StartTime *date.Time `json:"startTime,omitempty"` + EndTime *date.Time `json:"endTime,omitempty"` + Application *string `json:"application,omitempty"` +} + +// Project represents a project. +type Project struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Gets the project id. + ID *uuid.UUID `json:"id,omitempty"` + // Name - Gets or sets the name of the project. + Name *string `json:"name,omitempty"` + // Description - Gets or sets the description of the project. + Description *string `json:"description,omitempty"` + // Settings - Gets or sets the project settings. + Settings *ProjectSettings `json:"settings,omitempty"` + // Created - READ-ONLY; Gets the date this project was created. + Created *date.Time `json:"created,omitempty"` + // LastModified - READ-ONLY; Gets the date this project was last modified. + LastModified *date.Time `json:"lastModified,omitempty"` + // ThumbnailURI - READ-ONLY; Gets the thumbnail url representing the image. + ThumbnailURI *string `json:"thumbnailUri,omitempty"` + // DrModeEnabled - READ-ONLY; Gets if the Disaster Recovery (DR) mode is on, indicating the project is temporarily read-only. + DrModeEnabled *bool `json:"drModeEnabled,omitempty"` +} + +// ProjectSettings represents settings associated with a project. +type ProjectSettings struct { + // DomainID - Gets or sets the id of the Domain to use with this project. + DomainID *uuid.UUID `json:"domainId,omitempty"` + // ClassificationType - Gets or sets the classification type of the project. Possible values include: 'Multiclass', 'Multilabel' + ClassificationType Classifier `json:"classificationType,omitempty"` + // TargetExportPlatforms - A list of ExportPlatform that the trained model should be able to support. + TargetExportPlatforms *[]string `json:"targetExportPlatforms,omitempty"` + // UseNegativeSet - READ-ONLY; Indicates if negative set is being used. + UseNegativeSet *bool `json:"useNegativeSet,omitempty"` + // DetectionParameters - READ-ONLY; Detection parameters in use, if any. + DetectionParameters *string `json:"detectionParameters,omitempty"` + // ImageProcessingSettings - Gets or sets image preprocessing settings. + ImageProcessingSettings *ImageProcessingSettings `json:"imageProcessingSettings,omitempty"` +} + +// Region ... +type Region struct { + // TagID - Id of the tag associated with this region. + TagID *uuid.UUID `json:"tagId,omitempty"` + // Left - Coordinate of the left boundary. + Left *float64 `json:"left,omitempty"` + // Top - Coordinate of the top boundary. + Top *float64 `json:"top,omitempty"` + // Width - Width. + Width *float64 `json:"width,omitempty"` + // Height - Height. + Height *float64 `json:"height,omitempty"` +} + +// RegionProposal ... +type RegionProposal struct { + // Confidence - READ-ONLY + Confidence *float64 `json:"confidence,omitempty"` + // BoundingBox - READ-ONLY + BoundingBox *BoundingBox `json:"boundingBox,omitempty"` +} + +// SetInt32 ... +type SetInt32 struct { + autorest.Response `json:"-"` + Value map[string]*int32 `json:"value"` +} + +// MarshalJSON is the custom marshaler for SetInt32. +func (si3 SetInt32) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if si3.Value != nil { + objectMap["value"] = si3.Value + } + return json.Marshal(objectMap) +} + +// StoredImagePrediction result of an image prediction request. +type StoredImagePrediction struct { + // ResizedImageURI - READ-ONLY; The URI to the (resized) prediction image. + ResizedImageURI *string `json:"resizedImageUri,omitempty"` + // ThumbnailURI - READ-ONLY; The URI to the thumbnail of the original prediction image. + ThumbnailURI *string `json:"thumbnailUri,omitempty"` + // OriginalImageURI - READ-ONLY; The URI to the original prediction image. + OriginalImageURI *string `json:"originalImageUri,omitempty"` + // Domain - READ-ONLY; Domain used for the prediction. + Domain *uuid.UUID `json:"domain,omitempty"` + // ID - READ-ONLY; Prediction Id. + ID *uuid.UUID `json:"id,omitempty"` + // Project - READ-ONLY; Project Id. + Project *uuid.UUID `json:"project,omitempty"` + // Iteration - READ-ONLY; Iteration Id. + Iteration *uuid.UUID `json:"iteration,omitempty"` + // Created - READ-ONLY; Date this prediction was created. + Created *date.Time `json:"created,omitempty"` + // Predictions - READ-ONLY; List of predictions. + Predictions *[]Prediction `json:"predictions,omitempty"` +} + +// StoredSuggestedTagAndRegion result of a suggested tags and regions request of the untagged image. +type StoredSuggestedTagAndRegion struct { + // Width - READ-ONLY; Width of the resized image. + Width *int32 `json:"width,omitempty"` + // Height - READ-ONLY; Height of the resized image. + Height *int32 `json:"height,omitempty"` + // ResizedImageURI - READ-ONLY; The URI to the (resized) prediction image. + ResizedImageURI *string `json:"resizedImageUri,omitempty"` + // ThumbnailURI - READ-ONLY; The URI to the thumbnail of the original prediction image. + ThumbnailURI *string `json:"thumbnailUri,omitempty"` + // OriginalImageURI - READ-ONLY; The URI to the original prediction image. + OriginalImageURI *string `json:"originalImageUri,omitempty"` + // Domain - READ-ONLY; Domain used for the prediction. + Domain *uuid.UUID `json:"domain,omitempty"` + // ID - READ-ONLY; Prediction Id. + ID *uuid.UUID `json:"id,omitempty"` + // Project - READ-ONLY; Project Id. + Project *uuid.UUID `json:"project,omitempty"` + // Iteration - READ-ONLY; Iteration Id. + Iteration *uuid.UUID `json:"iteration,omitempty"` + // Created - READ-ONLY; Date this prediction was created. + Created *date.Time `json:"created,omitempty"` + // Predictions - READ-ONLY; List of predictions. + Predictions *[]Prediction `json:"predictions,omitempty"` + // PredictionUncertainty - READ-ONLY; Uncertainty (entropy) of suggested tags or regions per image. + PredictionUncertainty *float64 `json:"predictionUncertainty,omitempty"` +} + +// SuggestedTagAndRegion result of a suggested tags and regions request. +type SuggestedTagAndRegion struct { + // ID - READ-ONLY; Prediction Id. + ID *uuid.UUID `json:"id,omitempty"` + // Project - READ-ONLY; Project Id. + Project *uuid.UUID `json:"project,omitempty"` + // Iteration - READ-ONLY; Iteration Id. + Iteration *uuid.UUID `json:"iteration,omitempty"` + // Created - READ-ONLY; Date this prediction was created. + Created *date.Time `json:"created,omitempty"` + // Predictions - READ-ONLY; List of predictions. + Predictions *[]Prediction `json:"predictions,omitempty"` + // PredictionUncertainty - READ-ONLY; Uncertainty (entropy) of suggested tags or regions per image. + PredictionUncertainty *float64 `json:"predictionUncertainty,omitempty"` +} + +// SuggestedTagAndRegionQuery the array of result images and token containing session and continuation Ids +// for the next query. +type SuggestedTagAndRegionQuery struct { + autorest.Response `json:"-"` + // Token - Contains properties we need to fetch suggested tags for. + Token *SuggestedTagAndRegionQueryToken `json:"token,omitempty"` + // Results - READ-ONLY; Result of a suggested tags and regions request of the untagged image. + Results *[]StoredSuggestedTagAndRegion `json:"results,omitempty"` +} + +// SuggestedTagAndRegionQueryToken contains properties we need to fetch suggested tags for. For the first +// call, Session and continuation set to null. +// Then on subsequent calls, uses the session/continuation from the previous SuggestedTagAndRegionQuery +// result to fetch additional results. +type SuggestedTagAndRegionQueryToken struct { + // TagIds - Existing TagIds in project to filter suggested tags on. + TagIds *[]uuid.UUID `json:"tagIds,omitempty"` + // Threshold - Confidence threshold to filter suggested tags on. + Threshold *float64 `json:"threshold,omitempty"` + // Session - SessionId for database query. Initially set to null but later used to paginate. + Session *string `json:"session,omitempty"` + // Continuation - Continuation Id for database pagination. Initially null but later used to paginate. + Continuation *string `json:"continuation,omitempty"` + // MaxCount - Maximum number of results you want to be returned in the response. + MaxCount *int32 `json:"maxCount,omitempty"` + // SortBy - OrderBy. Ordering mechanism for your results. Possible values include: 'UncertaintyAscending', 'UncertaintyDescending' + SortBy SortBy `json:"sortBy,omitempty"` +} + +// Tag represents a Tag. +type Tag struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Gets the Tag ID. + ID *uuid.UUID `json:"id,omitempty"` + // Name - Gets or sets the name of the tag. + Name *string `json:"name,omitempty"` + // Description - Gets or sets the description of the tag. + Description *string `json:"description,omitempty"` + // Type - Gets or sets the type of the tag. Possible values include: 'Regular', 'Negative' + Type TagType `json:"type,omitempty"` + // ImageCount - READ-ONLY; Gets the number of images with this tag. + ImageCount *int32 `json:"imageCount,omitempty"` +} + +// TagFilter model that query for counting of images whose suggested tags match given tags and their +// probability are greater than or equal to the given threshold. +type TagFilter struct { + // TagIds - Existing TagIds in project to get suggested tags count for. + TagIds *[]uuid.UUID `json:"tagIds,omitempty"` + // Threshold - Confidence threshold to filter suggested tags on. + Threshold *float64 `json:"threshold,omitempty"` +} + +// TagPerformance represents performance data for a particular tag in a trained iteration. +type TagPerformance struct { + // ID - READ-ONLY + ID *uuid.UUID `json:"id,omitempty"` + // Name - READ-ONLY + Name *string `json:"name,omitempty"` + // Precision - READ-ONLY; Gets the precision. + Precision *float64 `json:"precision,omitempty"` + // PrecisionStdDeviation - READ-ONLY; Gets the standard deviation for the precision. + PrecisionStdDeviation *float64 `json:"precisionStdDeviation,omitempty"` + // Recall - READ-ONLY; Gets the recall. + Recall *float64 `json:"recall,omitempty"` + // RecallStdDeviation - READ-ONLY; Gets the standard deviation for the recall. + RecallStdDeviation *float64 `json:"recallStdDeviation,omitempty"` + // AveragePrecision - READ-ONLY; Gets the average precision when applicable. + AveragePrecision *float64 `json:"averagePrecision,omitempty"` +} diff --git a/services/cognitiveservices/v3.1/customvision/training/trainingapi/interfaces.go b/services/cognitiveservices/v3.1/customvision/training/trainingapi/interfaces.go new file mode 100644 index 000000000000..a8daec99beba --- /dev/null +++ b/services/cognitiveservices/v3.1/customvision/training/trainingapi/interfaces.go @@ -0,0 +1,78 @@ +package trainingapi + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v3.1/customvision/training" + "github.com/Azure/go-autorest/autorest" + "github.com/satori/go.uuid" + "io" +) + +// BaseClientAPI contains the set of methods on the BaseClient type. +type BaseClientAPI interface { + CreateImageRegions(ctx context.Context, projectID uuid.UUID, batch training.ImageRegionCreateBatch) (result training.ImageRegionCreateSummary, err error) + CreateImagesFromData(ctx context.Context, projectID uuid.UUID, imageData io.ReadCloser, tagIds []uuid.UUID) (result training.ImageCreateSummary, err error) + CreateImagesFromFiles(ctx context.Context, projectID uuid.UUID, batch training.ImageFileCreateBatch) (result training.ImageCreateSummary, err error) + CreateImagesFromPredictions(ctx context.Context, projectID uuid.UUID, batch training.ImageIDCreateBatch) (result training.ImageCreateSummary, err error) + CreateImagesFromUrls(ctx context.Context, projectID uuid.UUID, batch training.ImageURLCreateBatch) (result training.ImageCreateSummary, err error) + CreateImageTags(ctx context.Context, projectID uuid.UUID, batch training.ImageTagCreateBatch) (result training.ImageTagCreateSummary, err error) + CreateProject(ctx context.Context, name string, description string, domainID *uuid.UUID, classificationType string, targetExportPlatforms []string) (result training.Project, err error) + CreateTag(ctx context.Context, projectID uuid.UUID, name string, description string, typeParameter string) (result training.Tag, err error) + DeleteImageRegions(ctx context.Context, projectID uuid.UUID, regionIds []uuid.UUID) (result autorest.Response, err error) + DeleteImages(ctx context.Context, projectID uuid.UUID, imageIds []uuid.UUID, allImages *bool, allIterations *bool) (result autorest.Response, err error) + DeleteImageTags(ctx context.Context, projectID uuid.UUID, imageIds []uuid.UUID, tagIds []uuid.UUID) (result autorest.Response, err error) + DeleteIteration(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID) (result autorest.Response, err error) + DeletePrediction(ctx context.Context, projectID uuid.UUID, ids []uuid.UUID) (result autorest.Response, err error) + DeleteProject(ctx context.Context, projectID uuid.UUID) (result autorest.Response, err error) + DeleteTag(ctx context.Context, projectID uuid.UUID, tagID uuid.UUID) (result autorest.Response, err error) + ExportIteration(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, platform string, flavor string) (result training.Export, err error) + GetDomain(ctx context.Context, domainID uuid.UUID) (result training.Domain, err error) + GetDomains(ctx context.Context) (result training.ListDomain, err error) + GetExports(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID) (result training.ListExport, err error) + GetImagePerformanceCount(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, tagIds []uuid.UUID) (result training.Int32, err error) + GetImagePerformances(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, tagIds []uuid.UUID, orderBy string, take *int32, skip *int32) (result training.ListImagePerformance, err error) + GetImageRegionProposals(ctx context.Context, projectID uuid.UUID, imageID uuid.UUID) (result training.ImageRegionProposal, err error) + GetImagesByIds(ctx context.Context, projectID uuid.UUID, imageIds []uuid.UUID, iterationID *uuid.UUID) (result training.ListImage, err error) + GetIteration(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID) (result training.Iteration, err error) + GetIterationPerformance(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, threshold *float64, overlapThreshold *float64) (result training.IterationPerformance, err error) + GetIterations(ctx context.Context, projectID uuid.UUID) (result training.ListIteration, err error) + GetProject(ctx context.Context, projectID uuid.UUID) (result training.Project, err error) + GetProjects(ctx context.Context) (result training.ListProject, err error) + GetTag(ctx context.Context, projectID uuid.UUID, tagID uuid.UUID, iterationID *uuid.UUID) (result training.Tag, err error) + GetTaggedImageCount(ctx context.Context, projectID uuid.UUID, iterationID *uuid.UUID, tagIds []uuid.UUID) (result training.Int32, err error) + GetTaggedImages(ctx context.Context, projectID uuid.UUID, iterationID *uuid.UUID, tagIds []uuid.UUID, orderBy string, take *int32, skip *int32) (result training.ListImage, err error) + GetTags(ctx context.Context, projectID uuid.UUID, iterationID *uuid.UUID) (result training.ListTag, err error) + GetUntaggedImageCount(ctx context.Context, projectID uuid.UUID, iterationID *uuid.UUID) (result training.Int32, err error) + GetUntaggedImages(ctx context.Context, projectID uuid.UUID, iterationID *uuid.UUID, orderBy string, take *int32, skip *int32) (result training.ListImage, err error) + PublishIteration(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, publishName string, predictionID string) (result training.Bool, err error) + QueryPredictions(ctx context.Context, projectID uuid.UUID, query training.PredictionQueryToken) (result training.PredictionQueryResult, err error) + QuerySuggestedImageCount(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, query training.TagFilter) (result training.SetInt32, err error) + QuerySuggestedImages(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, query training.SuggestedTagAndRegionQueryToken) (result training.SuggestedTagAndRegionQuery, err error) + QuickTestImage(ctx context.Context, projectID uuid.UUID, imageData io.ReadCloser, iterationID *uuid.UUID, store *bool) (result training.ImagePrediction, err error) + QuickTestImageURL(ctx context.Context, projectID uuid.UUID, imageURL training.ImageURL, iterationID *uuid.UUID, store *bool) (result training.ImagePrediction, err error) + SuggestTagsAndRegions(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, imageIds []uuid.UUID) (result training.ListSuggestedTagAndRegion, err error) + TrainProject(ctx context.Context, projectID uuid.UUID, trainingType string, reservedBudgetInHours *int32, forceTrain *bool, notificationEmailAddress string) (result training.Iteration, err error) + UnpublishIteration(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID) (result autorest.Response, err error) + UpdateIteration(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, updatedIteration training.Iteration) (result training.Iteration, err error) + UpdateProject(ctx context.Context, projectID uuid.UUID, updatedProject training.Project) (result training.Project, err error) + UpdateTag(ctx context.Context, projectID uuid.UUID, tagID uuid.UUID, updatedTag training.Tag) (result training.Tag, err error) +} + +var _ BaseClientAPI = (*training.BaseClient)(nil) diff --git a/services/preview/sql/mgmt/2018-06-15-preview/sql/version.go b/services/cognitiveservices/v3.1/customvision/training/version.go similarity index 92% rename from services/preview/sql/mgmt/2018-06-15-preview/sql/version.go rename to services/cognitiveservices/v3.1/customvision/training/version.go index 113425810a20..9d1a5a43ec13 100644 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/version.go +++ b/services/cognitiveservices/v3.1/customvision/training/version.go @@ -1,4 +1,4 @@ -package sql +package training 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 + " sql/2018-06-15-preview" + return "Azure-SDK-For-Go/" + version.Number + " training/3.1" } // Version returns the semantic version (see http://semver.org) of the client. diff --git a/services/cognitiveservices/v4.0/qnamakerruntime/models.go b/services/cognitiveservices/v4.0/qnamakerruntime/models.go index eeb9d3630178..a207048f787c 100644 --- a/services/cognitiveservices/v4.0/qnamakerruntime/models.go +++ b/services/cognitiveservices/v4.0/qnamakerruntime/models.go @@ -256,6 +256,8 @@ type QueryDTO struct { ScoreThreshold *float64 `json:"scoreThreshold,omitempty"` // Context - Context object with previous QnA's information. Context *QueryDTOContext `json:"context,omitempty"` + // RankerType - Optional field. Set to 'QuestionOnly' for using a question only Ranker. + RankerType *string `json:"rankerType,omitempty"` // StrictFilters - Find only answers that contain these metadata. StrictFilters *[]MetadataDTO `json:"strictFilters,omitempty"` } diff --git a/services/compute/mgmt/2018-10-01/compute/models.go b/services/compute/mgmt/2018-10-01/compute/models.go index 5f691d90cfa7..8e8a1ec5ffe2 100644 --- a/services/compute/mgmt/2018-10-01/compute/models.go +++ b/services/compute/mgmt/2018-10-01/compute/models.go @@ -1244,6 +1244,17 @@ type AutomaticOSUpgradeProperties struct { AutomaticOSUpgradeSupported *bool `json:"automaticOSUpgradeSupported,omitempty"` } +// AutomaticRepairsPolicy specifies the configuration parameters for automatic repairs on the virtual +// machine scale set. +type AutomaticRepairsPolicy struct { + // Enabled - Specifies whether automatic repairs should be enabled on the virtual machine scale set. The default value is false. + Enabled *bool `json:"enabled,omitempty"` + // GracePeriod - The amount of time for which automatic repairs are suspended due to a state change on VM. The grace time starts after the state change has completed. This helps avoid premature or accidental repairs. The time duration should be specified in ISO 8601 format. The default value is 5 minutes (PT5M). + GracePeriod *string `json:"gracePeriod,omitempty"` + // MaxInstanceRepairsPercent - The percentage (capacity of scaleset) of virtual machines that will be simultaneously repaired. The default value is 20%. + MaxInstanceRepairsPercent *int32 `json:"maxInstanceRepairsPercent,omitempty"` +} + // AvailabilitySet specifies information about the availability set that the virtual machine should be // assigned to. Virtual machines specified in the same availability set are allocated to different nodes to // maximize availability. For more information about availability sets, see [Manage the availability of @@ -8709,6 +8720,8 @@ type VirtualMachineScaleSetOSProfile struct { type VirtualMachineScaleSetProperties struct { // UpgradePolicy - The upgrade policy. UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"` + // AutomaticRepairsPolicy - Policy for automatic repairs. + AutomaticRepairsPolicy *AutomaticRepairsPolicy `json:"automaticRepairsPolicy,omitempty"` // VirtualMachineProfile - The virtual machine profile. VirtualMachineProfile *VirtualMachineScaleSetVMProfile `json:"virtualMachineProfile,omitempty"` // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. @@ -9528,10 +9541,14 @@ type VirtualMachineScaleSetUpdateOSProfile struct { type VirtualMachineScaleSetUpdateProperties struct { // UpgradePolicy - The upgrade policy. UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"` + // AutomaticRepairsPolicy - Policy for automatic repairs. + AutomaticRepairsPolicy *AutomaticRepairsPolicy `json:"automaticRepairsPolicy,omitempty"` // VirtualMachineProfile - The virtual machine profile. VirtualMachineProfile *VirtualMachineScaleSetUpdateVMProfile `json:"virtualMachineProfile,omitempty"` // Overprovision - Specifies whether the Virtual Machine Scale Set should be overprovisioned. Overprovision *bool `json:"overprovision,omitempty"` + // DoNotRunExtensionsOnOverprovisionedVMs - When Overprovision is enabled, extensions are launched only on the requested number of VMs which are finally kept. This property will hence ensure that the extensions do not run on the extra overprovisioned VMs. + DoNotRunExtensionsOnOverprovisionedVMs *bool `json:"doNotRunExtensionsOnOverprovisionedVMs,omitempty"` // SinglePlacementGroup - When true this limits the scale set to a single placement group, of max size 100 virtual machines. SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"` } 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 b9cb016a868d..260b56f5cbef 100644 --- a/services/compute/mgmt/2019-03-01/compute/computeapi/interfaces.go +++ b/services/compute/mgmt/2019-03-01/compute/computeapi/interfaces.go @@ -246,7 +246,7 @@ var _ VirtualMachineRunCommandsClientAPI = (*compute.VirtualMachineRunCommandsCl // ResourceSkusClientAPI contains the set of methods on the ResourceSkusClient type. type ResourceSkusClientAPI interface { - List(ctx context.Context) (result compute.ResourceSkusResultPage, err error) + List(ctx context.Context, filter string) (result compute.ResourceSkusResultPage, err error) } var _ ResourceSkusClientAPI = (*compute.ResourceSkusClient)(nil) diff --git a/services/compute/mgmt/2019-03-01/compute/models.go b/services/compute/mgmt/2019-03-01/compute/models.go index 932e68cdb30a..f7461a488238 100644 --- a/services/compute/mgmt/2019-03-01/compute/models.go +++ b/services/compute/mgmt/2019-03-01/compute/models.go @@ -1395,6 +1395,17 @@ type AutomaticOSUpgradeProperties struct { AutomaticOSUpgradeSupported *bool `json:"automaticOSUpgradeSupported,omitempty"` } +// AutomaticRepairsPolicy specifies the configuration parameters for automatic repairs on the virtual +// machine scale set. +type AutomaticRepairsPolicy struct { + // Enabled - Specifies whether automatic repairs should be enabled on the virtual machine scale set. The default value is false. + Enabled *bool `json:"enabled,omitempty"` + // GracePeriod - The amount of time for which automatic repairs are suspended due to a state change on VM. The grace time starts after the state change has completed. This helps avoid premature or accidental repairs. The time duration should be specified in ISO 8601 format. The default value is 5 minutes (PT5M). + GracePeriod *string `json:"gracePeriod,omitempty"` + // MaxInstanceRepairsPercent - The percentage (capacity of scaleset) of virtual machines that will be simultaneously repaired. The default value is 20%. + MaxInstanceRepairsPercent *int32 `json:"maxInstanceRepairsPercent,omitempty"` +} + // AvailabilitySet specifies information about the availability set that the virtual machine should be // assigned to. Virtual machines specified in the same availability set are allocated to different nodes to // maximize availability. For more information about availability sets, see [Manage the availability of @@ -6298,6 +6309,8 @@ type OSProfile struct { Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` // AllowExtensionOperations - Specifies whether extension operations should be allowed on the virtual machine.

This may only be set to False when no extensions are present on the virtual machine. AllowExtensionOperations *bool `json:"allowExtensionOperations,omitempty"` + // RequireGuestProvisionSignal - Specifies whether the guest provision signal is required from the virtual machine. + RequireGuestProvisionSignal *bool `json:"requireGuestProvisionSignal,omitempty"` } // Plan specifies information about the marketplace image used to create the virtual machine. This element @@ -10385,6 +10398,8 @@ type VirtualMachineScaleSetOSProfile struct { type VirtualMachineScaleSetProperties struct { // UpgradePolicy - The upgrade policy. UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"` + // AutomaticRepairsPolicy - Policy for automatic repairs. + AutomaticRepairsPolicy *AutomaticRepairsPolicy `json:"automaticRepairsPolicy,omitempty"` // VirtualMachineProfile - The virtual machine profile. VirtualMachineProfile *VirtualMachineScaleSetVMProfile `json:"virtualMachineProfile,omitempty"` // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. @@ -11210,10 +11225,14 @@ type VirtualMachineScaleSetUpdateOSProfile struct { type VirtualMachineScaleSetUpdateProperties struct { // UpgradePolicy - The upgrade policy. UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"` + // AutomaticRepairsPolicy - Policy for automatic repairs. + AutomaticRepairsPolicy *AutomaticRepairsPolicy `json:"automaticRepairsPolicy,omitempty"` // VirtualMachineProfile - The virtual machine profile. VirtualMachineProfile *VirtualMachineScaleSetUpdateVMProfile `json:"virtualMachineProfile,omitempty"` // Overprovision - Specifies whether the Virtual Machine Scale Set should be overprovisioned. Overprovision *bool `json:"overprovision,omitempty"` + // DoNotRunExtensionsOnOverprovisionedVMs - When Overprovision is enabled, extensions are launched only on the requested number of VMs which are finally kept. This property will hence ensure that the extensions do not run on the extra overprovisioned VMs. + DoNotRunExtensionsOnOverprovisionedVMs *bool `json:"doNotRunExtensionsOnOverprovisionedVMs,omitempty"` // SinglePlacementGroup - When true this limits the scale set to a single placement group, of max size 100 virtual machines. 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. diff --git a/services/compute/mgmt/2019-03-01/compute/resourceskus.go b/services/compute/mgmt/2019-03-01/compute/resourceskus.go index dade057a45fe..adb402788c87 100644 --- a/services/compute/mgmt/2019-03-01/compute/resourceskus.go +++ b/services/compute/mgmt/2019-03-01/compute/resourceskus.go @@ -41,7 +41,9 @@ func NewResourceSkusClientWithBaseURI(baseURI string, subscriptionID string) Res } // List gets the list of Microsoft.Compute SKUs available for your Subscription. -func (client ResourceSkusClient) List(ctx context.Context) (result ResourceSkusResultPage, err error) { +// Parameters: +// filter - the filter to apply on the operation. +func (client ResourceSkusClient) List(ctx context.Context, filter string) (result ResourceSkusResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusClient.List") defer func() { @@ -53,7 +55,7 @@ func (client ResourceSkusClient) List(ctx context.Context) (result ResourceSkusR }() } result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) + req, err := client.ListPreparer(ctx, filter) if err != nil { err = autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "List", nil, "Failure preparing request") return @@ -75,7 +77,7 @@ func (client ResourceSkusClient) List(ctx context.Context) (result ResourceSkusR } // ListPreparer prepares the List request. -func (client ResourceSkusClient) ListPreparer(ctx context.Context) (*http.Request, error) { +func (client ResourceSkusClient) ListPreparer(ctx context.Context, filter string) (*http.Request, error) { pathParameters := map[string]interface{}{ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -84,6 +86,9 @@ func (client ResourceSkusClient) ListPreparer(ctx context.Context) (*http.Reques queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -135,7 +140,7 @@ func (client ResourceSkusClient) listNextResults(ctx context.Context, lastResult } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ResourceSkusClient) ListComplete(ctx context.Context) (result ResourceSkusResultIterator, err error) { +func (client ResourceSkusClient) ListComplete(ctx context.Context, filter string) (result ResourceSkusResultIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusClient.List") defer func() { @@ -146,6 +151,6 @@ func (client ResourceSkusClient) ListComplete(ctx context.Context) (result Resou tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.List(ctx) + result.page, err = client.List(ctx, filter) return } diff --git a/services/compute/mgmt/2019-07-01/compute/availabilitysets.go b/services/compute/mgmt/2019-07-01/compute/availabilitysets.go index 853abfc1c95c..92945517338f 100644 --- a/services/compute/mgmt/2019-07-01/compute/availabilitysets.go +++ b/services/compute/mgmt/2019-07-01/compute/availabilitysets.go @@ -85,7 +85,7 @@ func (client AvailabilitySetsClient) CreateOrUpdatePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -164,7 +164,7 @@ func (client AvailabilitySetsClient) DeletePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -240,7 +240,7 @@ func (client AvailabilitySetsClient) GetPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -316,7 +316,7 @@ func (client AvailabilitySetsClient) ListPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -431,7 +431,7 @@ func (client AvailabilitySetsClient) ListAvailableSizesPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -506,7 +506,7 @@ func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -624,7 +624,7 @@ func (client AvailabilitySetsClient) UpdatePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } 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 1a3fc7f1d25a..836e80dbc99c 100644 --- a/services/compute/mgmt/2019-07-01/compute/computeapi/interfaces.go +++ b/services/compute/mgmt/2019-07-01/compute/computeapi/interfaces.go @@ -127,11 +127,12 @@ type VirtualMachinesClientAPI interface { Get(ctx context.Context, resourceGroupName string, VMName string, expand compute.InstanceViewTypes) (result compute.VirtualMachine, err error) InstanceView(ctx context.Context, resourceGroupName string, VMName string) (result compute.VirtualMachineInstanceView, err error) List(ctx context.Context, resourceGroupName string) (result compute.VirtualMachineListResultPage, err error) - ListAll(ctx context.Context) (result compute.VirtualMachineListResultPage, err error) + ListAll(ctx context.Context, statusOnly string) (result compute.VirtualMachineListResultPage, err error) ListAvailableSizes(ctx context.Context, resourceGroupName string, VMName string) (result compute.VirtualMachineSizeListResult, err error) ListByLocation(ctx context.Context, location string) (result compute.VirtualMachineListResultPage, err error) PerformMaintenance(ctx context.Context, resourceGroupName string, VMName string) (result compute.VirtualMachinesPerformMaintenanceFuture, err error) PowerOff(ctx context.Context, resourceGroupName string, VMName string, skipShutdown *bool) (result compute.VirtualMachinesPowerOffFuture, err error) + Reapply(ctx context.Context, resourceGroupName string, VMName string) (result compute.VirtualMachinesReapplyFuture, err error) Redeploy(ctx context.Context, resourceGroupName string, VMName string) (result compute.VirtualMachinesRedeployFuture, err error) Reimage(ctx context.Context, resourceGroupName string, VMName string, parameters *compute.VirtualMachineReimageParameters) (result compute.VirtualMachinesReimageFuture, err error) Restart(ctx context.Context, resourceGroupName string, VMName string) (result compute.VirtualMachinesRestartFuture, err error) @@ -208,6 +209,17 @@ type VirtualMachineScaleSetRollingUpgradesClientAPI interface { var _ VirtualMachineScaleSetRollingUpgradesClientAPI = (*compute.VirtualMachineScaleSetRollingUpgradesClient)(nil) +// VirtualMachineScaleSetVMExtensionsClientAPI contains the set of methods on the VirtualMachineScaleSetVMExtensionsClient type. +type VirtualMachineScaleSetVMExtensionsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, extensionParameters compute.VirtualMachineExtension) (result compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string) (result compute.VirtualMachineScaleSetVMExtensionsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, expand string) (result compute.VirtualMachineExtension, err error) + List(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand string) (result compute.VirtualMachineExtensionsListResult, err error) + Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, extensionParameters compute.VirtualMachineExtensionUpdate) (result compute.VirtualMachineScaleSetVMExtensionsUpdateFuture, err error) +} + +var _ VirtualMachineScaleSetVMExtensionsClientAPI = (*compute.VirtualMachineScaleSetVMExtensionsClient)(nil) + // VirtualMachineScaleSetVMsClientAPI contains the set of methods on the VirtualMachineScaleSetVMsClient type. type VirtualMachineScaleSetVMsClientAPI interface { Deallocate(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result compute.VirtualMachineScaleSetVMsDeallocateFuture, err error) @@ -246,7 +258,7 @@ var _ VirtualMachineRunCommandsClientAPI = (*compute.VirtualMachineRunCommandsCl // ResourceSkusClientAPI contains the set of methods on the ResourceSkusClient type. type ResourceSkusClientAPI interface { - List(ctx context.Context) (result compute.ResourceSkusResultPage, err error) + List(ctx context.Context, filter string) (result compute.ResourceSkusResultPage, err error) } var _ ResourceSkusClientAPI = (*compute.ResourceSkusClient)(nil) @@ -279,6 +291,18 @@ type SnapshotsClientAPI interface { var _ SnapshotsClientAPI = (*compute.SnapshotsClient)(nil) +// DiskEncryptionSetsClientAPI contains the set of methods on the DiskEncryptionSetsClient type. +type DiskEncryptionSetsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet compute.DiskEncryptionSet) (result compute.DiskEncryptionSetsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, diskEncryptionSetName string) (result compute.DiskEncryptionSetsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, diskEncryptionSetName string) (result compute.DiskEncryptionSet, err error) + List(ctx context.Context) (result compute.DiskEncryptionSetListPage, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result compute.DiskEncryptionSetListPage, err error) + Update(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet compute.DiskEncryptionSetUpdate) (result compute.DiskEncryptionSetsUpdateFuture, err error) +} + +var _ DiskEncryptionSetsClientAPI = (*compute.DiskEncryptionSetsClient)(nil) + // GalleriesClientAPI contains the set of methods on the GalleriesClient type. type GalleriesClientAPI interface { CreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, gallery compute.Gallery) (result compute.GalleriesCreateOrUpdateFuture, err error) diff --git a/services/compute/mgmt/2019-07-01/compute/dedicatedhostgroups.go b/services/compute/mgmt/2019-07-01/compute/dedicatedhostgroups.go index 77ec9da3137b..c786ffefc3f3 100644 --- a/services/compute/mgmt/2019-07-01/compute/dedicatedhostgroups.go +++ b/services/compute/mgmt/2019-07-01/compute/dedicatedhostgroups.go @@ -98,7 +98,7 @@ func (client DedicatedHostGroupsClient) CreateOrUpdatePreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -177,7 +177,7 @@ func (client DedicatedHostGroupsClient) DeletePreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -253,7 +253,7 @@ func (client DedicatedHostGroupsClient) GetPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -330,7 +330,7 @@ func (client DedicatedHostGroupsClient) ListByResourceGroupPreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -441,7 +441,7 @@ func (client DedicatedHostGroupsClient) ListBySubscriptionPreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -556,7 +556,7 @@ func (client DedicatedHostGroupsClient) UpdatePreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/compute/mgmt/2019-07-01/compute/dedicatedhosts.go b/services/compute/mgmt/2019-07-01/compute/dedicatedhosts.go index 31f8795d6fdd..fb6ff59522b3 100644 --- a/services/compute/mgmt/2019-07-01/compute/dedicatedhosts.go +++ b/services/compute/mgmt/2019-07-01/compute/dedicatedhosts.go @@ -94,7 +94,7 @@ func (client DedicatedHostsClient) CreateOrUpdatePreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -175,7 +175,7 @@ func (client DedicatedHostsClient) DeletePreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -260,7 +260,7 @@ func (client DedicatedHostsClient) GetPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -342,7 +342,7 @@ func (client DedicatedHostsClient) ListByHostGroupPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -453,7 +453,7 @@ func (client DedicatedHostsClient) UpdatePreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/compute/mgmt/2019-07-01/compute/diskencryptionsets.go b/services/compute/mgmt/2019-07-01/compute/diskencryptionsets.go new file mode 100644 index 000000000000..cb93acdde874 --- /dev/null +++ b/services/compute/mgmt/2019-07-01/compute/diskencryptionsets.go @@ -0,0 +1,599 @@ +package compute + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the 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" +) + +// DiskEncryptionSetsClient is the compute Client +type DiskEncryptionSetsClient struct { + BaseClient +} + +// NewDiskEncryptionSetsClient creates an instance of the DiskEncryptionSetsClient client. +func NewDiskEncryptionSetsClient(subscriptionID string) DiskEncryptionSetsClient { + return NewDiskEncryptionSetsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDiskEncryptionSetsClientWithBaseURI creates an instance of the DiskEncryptionSetsClient client. +func NewDiskEncryptionSetsClientWithBaseURI(baseURI string, subscriptionID string) DiskEncryptionSetsClient { + return DiskEncryptionSetsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a disk encryption set +// Parameters: +// resourceGroupName - the name of the resource group. +// diskEncryptionSetName - the name of the disk encryption set that is being created. The name can't be changed +// after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The +// maximum name length is 80 characters. +// diskEncryptionSet - disk encryption set object supplied in the body of the Put disk encryption set +// operation. +func (client DiskEncryptionSetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSet) (result DiskEncryptionSetsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.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: diskEncryptionSet, + Constraints: []validation.Constraint{{Target: "diskEncryptionSet.EncryptionSetProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "diskEncryptionSet.EncryptionSetProperties.ActiveKey", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "diskEncryptionSet.EncryptionSetProperties.ActiveKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "diskEncryptionSet.EncryptionSetProperties.ActiveKey.KeyURL", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("compute.DiskEncryptionSetsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, diskEncryptionSetName, diskEncryptionSet) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client DiskEncryptionSetsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSet) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diskEncryptionSetName": autorest.Encode("path", diskEncryptionSetName), + "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.Compute/diskEncryptionSets/{diskEncryptionSetName}", pathParameters), + autorest.WithJSON(diskEncryptionSet), + 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 DiskEncryptionSetsClient) CreateOrUpdateSender(req *http.Request) (future DiskEncryptionSetsCreateOrUpdateFuture, 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 DiskEncryptionSetsClient) CreateOrUpdateResponder(resp *http.Response) (result DiskEncryptionSet, 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 disk encryption set. +// Parameters: +// resourceGroupName - the name of the resource group. +// diskEncryptionSetName - the name of the disk encryption set that is being created. The name can't be changed +// after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The +// maximum name length is 80 characters. +func (client DiskEncryptionSetsClient) Delete(ctx context.Context, resourceGroupName string, diskEncryptionSetName string) (result DiskEncryptionSetsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, diskEncryptionSetName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client DiskEncryptionSetsClient) DeletePreparer(ctx context.Context, resourceGroupName string, diskEncryptionSetName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diskEncryptionSetName": autorest.Encode("path", diskEncryptionSetName), + "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.Compute/diskEncryptionSets/{diskEncryptionSetName}", 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 DiskEncryptionSetsClient) DeleteSender(req *http.Request) (future DiskEncryptionSetsDeleteFuture, 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 DiskEncryptionSetsClient) 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 a disk encryption set. +// Parameters: +// resourceGroupName - the name of the resource group. +// diskEncryptionSetName - the name of the disk encryption set that is being created. The name can't be changed +// after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The +// maximum name length is 80 characters. +func (client DiskEncryptionSetsClient) Get(ctx context.Context, resourceGroupName string, diskEncryptionSetName string) (result DiskEncryptionSet, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.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, diskEncryptionSetName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client DiskEncryptionSetsClient) GetPreparer(ctx context.Context, resourceGroupName string, diskEncryptionSetName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diskEncryptionSetName": autorest.Encode("path", diskEncryptionSetName), + "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.Compute/diskEncryptionSets/{diskEncryptionSetName}", 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 DiskEncryptionSetsClient) 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 DiskEncryptionSetsClient) GetResponder(resp *http.Response) (result DiskEncryptionSet, 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 disk encryption sets under a subscription. +func (client DiskEncryptionSetsClient) List(ctx context.Context) (result DiskEncryptionSetListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.List") + defer func() { + sc := -1 + if result.desl.Response.Response != nil { + sc = result.desl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.desl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "List", resp, "Failure sending request") + return + } + + result.desl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client DiskEncryptionSetsClient) ListPreparer(ctx context.Context) (*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, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/diskEncryptionSets", 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 DiskEncryptionSetsClient) 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 DiskEncryptionSetsClient) ListResponder(resp *http.Response) (result DiskEncryptionSetList, 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 DiskEncryptionSetsClient) listNextResults(ctx context.Context, lastResults DiskEncryptionSetList) (result DiskEncryptionSetList, err error) { + req, err := lastResults.diskEncryptionSetListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "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, "compute.DiskEncryptionSetsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client DiskEncryptionSetsClient) ListComplete(ctx context.Context) (result DiskEncryptionSetListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.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 disk encryption sets under a resource group. +// Parameters: +// resourceGroupName - the name of the resource group. +func (client DiskEncryptionSetsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result DiskEncryptionSetListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.desl.Response.Response != nil { + sc = result.desl.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, "compute.DiskEncryptionSetsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.desl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.desl, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client DiskEncryptionSetsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets", 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 DiskEncryptionSetsClient) 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 DiskEncryptionSetsClient) ListByResourceGroupResponder(resp *http.Response) (result DiskEncryptionSetList, 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 DiskEncryptionSetsClient) listByResourceGroupNextResults(ctx context.Context, lastResults DiskEncryptionSetList) (result DiskEncryptionSetList, err error) { + req, err := lastResults.diskEncryptionSetListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "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, "compute.DiskEncryptionSetsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client DiskEncryptionSetsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result DiskEncryptionSetListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// Update updates (patches) a disk encryption set. +// Parameters: +// resourceGroupName - the name of the resource group. +// diskEncryptionSetName - the name of the disk encryption set that is being created. The name can't be changed +// after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The +// maximum name length is 80 characters. +// diskEncryptionSet - disk encryption set object supplied in the body of the Patch disk encryption set +// operation. +func (client DiskEncryptionSetsClient) Update(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSetUpdate) (result DiskEncryptionSetsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.Update") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, diskEncryptionSetName, diskEncryptionSet) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client DiskEncryptionSetsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSetUpdate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diskEncryptionSetName": autorest.Encode("path", diskEncryptionSetName), + "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.Compute/diskEncryptionSets/{diskEncryptionSetName}", pathParameters), + autorest.WithJSON(diskEncryptionSet), + 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 DiskEncryptionSetsClient) UpdateSender(req *http.Request) (future DiskEncryptionSetsUpdateFuture, 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 DiskEncryptionSetsClient) UpdateResponder(resp *http.Response) (result DiskEncryptionSet, 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/compute/mgmt/2019-07-01/compute/disks.go b/services/compute/mgmt/2019-07-01/compute/disks.go index 31ee32f12f42..4bf336689169 100644 --- a/services/compute/mgmt/2019-07-01/compute/disks.go +++ b/services/compute/mgmt/2019-07-01/compute/disks.go @@ -95,7 +95,7 @@ func (client DisksClient) CreateOrUpdatePreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -177,7 +177,7 @@ func (client DisksClient) DeletePreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -261,7 +261,7 @@ func (client DisksClient) GetPreparer(ctx context.Context, resourceGroupName str "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -341,7 +341,7 @@ func (client DisksClient) GrantAccessPreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -422,7 +422,7 @@ func (client DisksClient) ListPreparer(ctx context.Context) (*http.Request, erro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -535,7 +535,7 @@ func (client DisksClient) ListByResourceGroupPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -645,7 +645,7 @@ func (client DisksClient) RevokeAccessPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -724,7 +724,7 @@ func (client DisksClient) UpdatePreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/compute/mgmt/2019-07-01/compute/images.go b/services/compute/mgmt/2019-07-01/compute/images.go index e15083ca448d..dfb92b46b0f7 100644 --- a/services/compute/mgmt/2019-07-01/compute/images.go +++ b/services/compute/mgmt/2019-07-01/compute/images.go @@ -79,7 +79,7 @@ func (client ImagesClient) CreateOrUpdatePreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -158,7 +158,7 @@ func (client ImagesClient) DeletePreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -241,7 +241,7 @@ func (client ImagesClient) GetPreparer(ctx context.Context, resourceGroupName st "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -318,7 +318,7 @@ func (client ImagesClient) ListPreparer(ctx context.Context) (*http.Request, err "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -431,7 +431,7 @@ func (client ImagesClient) ListByResourceGroupPreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -540,7 +540,7 @@ func (client ImagesClient) UpdatePreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/compute/mgmt/2019-07-01/compute/loganalytics.go b/services/compute/mgmt/2019-07-01/compute/loganalytics.go index 8fa8c1b05416..145d834d59b8 100644 --- a/services/compute/mgmt/2019-07-01/compute/loganalytics.go +++ b/services/compute/mgmt/2019-07-01/compute/loganalytics.go @@ -85,7 +85,7 @@ func (client LogAnalyticsClient) ExportRequestRateByIntervalPreparer(ctx context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -170,7 +170,7 @@ func (client LogAnalyticsClient) ExportThrottledRequestsPreparer(ctx context.Con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/compute/mgmt/2019-07-01/compute/models.go b/services/compute/mgmt/2019-07-01/compute/models.go index 8cf3b0571819..11e0c0a1bd2c 100644 --- a/services/compute/mgmt/2019-07-01/compute/models.go +++ b/services/compute/mgmt/2019-07-01/compute/models.go @@ -311,6 +311,19 @@ func PossibleDiskCreateOptionTypesValues() []DiskCreateOptionTypes { return []DiskCreateOptionTypes{DiskCreateOptionTypesAttach, DiskCreateOptionTypesEmpty, DiskCreateOptionTypesFromImage} } +// DiskEncryptionSetIdentityType enumerates the values for disk encryption set identity type. +type DiskEncryptionSetIdentityType string + +const ( + // SystemAssigned ... + SystemAssigned DiskEncryptionSetIdentityType = "SystemAssigned" +) + +// PossibleDiskEncryptionSetIdentityTypeValues returns an array of possible values for the DiskEncryptionSetIdentityType const type. +func PossibleDiskEncryptionSetIdentityTypeValues() []DiskEncryptionSetIdentityType { + return []DiskEncryptionSetIdentityType{SystemAssigned} +} + // DiskState enumerates the values for disk state. type DiskState string @@ -357,6 +370,22 @@ func PossibleDiskStorageAccountTypesValues() []DiskStorageAccountTypes { return []DiskStorageAccountTypes{PremiumLRS, StandardLRS, StandardSSDLRS, UltraSSDLRS} } +// EncryptionType enumerates the values for encryption type. +type EncryptionType string + +const ( + // EncryptionAtRestWithCustomerKey Disk is encrypted with Customer managed key at rest. + EncryptionAtRestWithCustomerKey EncryptionType = "EncryptionAtRestWithCustomerKey" + // EncryptionAtRestWithPlatformKey Disk is encrypted with XStore managed key at rest. It is the default + // encryption type. + EncryptionAtRestWithPlatformKey EncryptionType = "EncryptionAtRestWithPlatformKey" +) + +// PossibleEncryptionTypeValues returns an array of possible values for the EncryptionType const type. +func PossibleEncryptionTypeValues() []EncryptionType { + return []EncryptionType{EncryptionAtRestWithCustomerKey, EncryptionAtRestWithPlatformKey} +} + // HostCaching enumerates the values for host caching. type HostCaching string @@ -1395,6 +1424,17 @@ type AutomaticOSUpgradeProperties struct { AutomaticOSUpgradeSupported *bool `json:"automaticOSUpgradeSupported,omitempty"` } +// AutomaticRepairsPolicy specifies the configuration parameters for automatic repairs on the virtual +// machine scale set. +type AutomaticRepairsPolicy struct { + // Enabled - Specifies whether automatic repairs should be enabled on the virtual machine scale set. The default value is false. + Enabled *bool `json:"enabled,omitempty"` + // GracePeriod - The amount of time for which automatic repairs are suspended due to a state change on VM. The grace time starts after the state change has completed. This helps avoid premature or accidental repairs. The time duration should be specified in ISO 8601 format. The default value is 5 minutes (PT5M). + GracePeriod *string `json:"gracePeriod,omitempty"` + // MaxInstanceRepairsPercent - The percentage (capacity of scaleset) of virtual machines that will be simultaneously repaired. The default value is 20%. + MaxInstanceRepairsPercent *int32 `json:"maxInstanceRepairsPercent,omitempty"` +} + // AvailabilitySet specifies information about the availability set that the virtual machine should be // assigned to. Virtual machines specified in the same availability set are allocated to different nodes to // maximize availability. For more information about availability sets, see [Manage the availability of @@ -1772,7 +1812,7 @@ type BootDiagnosticsInstanceView struct { Status *InstanceViewStatus `json:"status,omitempty"` } -// CloudError an error response from the Gallery service. +// CloudError an error response from the Compute service. type CloudError struct { Error *APIError `json:"error,omitempty"` } @@ -2224,6 +2264,10 @@ type DataDisk struct { ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` // ToBeDetached - Specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset ToBeDetached *bool `json:"toBeDetached,omitempty"` + // DiskIOPSReadWrite - READ-ONLY; Specifies the Read-Write IOPS for the managed disk when StorageAccountType is UltraSSD_LRS. Returned only for VirtualMachine ScaleSet VM disks. Can be updated only via updates to the VirtualMachine Scale Set. + DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` + // DiskMBpsReadWrite - READ-ONLY; Specifies the bandwidth in MB per second for the managed disk when StorageAccountType is UltraSSD_LRS. Returned only for VirtualMachine ScaleSet VM disks. Can be updated only via updates to the VirtualMachine Scale Set. + DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` } // DataDiskImage contains the data disk images information. @@ -3166,6 +3210,354 @@ func (d *Disk) UnmarshalJSON(body []byte) error { return nil } +// DiskEncryptionSet disk encryption set resource. +type DiskEncryptionSet struct { + autorest.Response `json:"-"` + Identity *EncryptionSetIdentity `json:"identity,omitempty"` + *EncryptionSetProperties `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 DiskEncryptionSet. +func (desVar DiskEncryptionSet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if desVar.Identity != nil { + objectMap["identity"] = desVar.Identity + } + if desVar.EncryptionSetProperties != nil { + objectMap["properties"] = desVar.EncryptionSetProperties + } + if desVar.Location != nil { + objectMap["location"] = desVar.Location + } + if desVar.Tags != nil { + objectMap["tags"] = desVar.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DiskEncryptionSet struct. +func (desVar *DiskEncryptionSet) UnmarshalJSON(body []byte) error { + 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 EncryptionSetIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + desVar.Identity = &identity + } + case "properties": + if v != nil { + var encryptionSetProperties EncryptionSetProperties + err = json.Unmarshal(*v, &encryptionSetProperties) + if err != nil { + return err + } + desVar.EncryptionSetProperties = &encryptionSetProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + desVar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + desVar.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + desVar.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + desVar.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + desVar.Tags = tags + } + } + } + + return nil +} + +// DiskEncryptionSetList the List disk encryption set operation response. +type DiskEncryptionSetList struct { + autorest.Response `json:"-"` + // Value - A list of disk encryption sets. + Value *[]DiskEncryptionSet `json:"value,omitempty"` + // NextLink - The uri to fetch the next page of disk encryption sets. Call ListNext() with this to fetch the next page of disk encryption sets. + NextLink *string `json:"nextLink,omitempty"` +} + +// DiskEncryptionSetListIterator provides access to a complete listing of DiskEncryptionSet values. +type DiskEncryptionSetListIterator struct { + i int + page DiskEncryptionSetListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DiskEncryptionSetListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *DiskEncryptionSetListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DiskEncryptionSetListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DiskEncryptionSetListIterator) Response() DiskEncryptionSetList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DiskEncryptionSetListIterator) Value() DiskEncryptionSet { + if !iter.page.NotDone() { + return DiskEncryptionSet{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DiskEncryptionSetListIterator type. +func NewDiskEncryptionSetListIterator(page DiskEncryptionSetListPage) DiskEncryptionSetListIterator { + return DiskEncryptionSetListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (desl DiskEncryptionSetList) IsEmpty() bool { + return desl.Value == nil || len(*desl.Value) == 0 +} + +// diskEncryptionSetListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (desl DiskEncryptionSetList) diskEncryptionSetListPreparer(ctx context.Context) (*http.Request, error) { + if desl.NextLink == nil || len(to.String(desl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(desl.NextLink))) +} + +// DiskEncryptionSetListPage contains a page of DiskEncryptionSet values. +type DiskEncryptionSetListPage struct { + fn func(context.Context, DiskEncryptionSetList) (DiskEncryptionSetList, error) + desl DiskEncryptionSetList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DiskEncryptionSetListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetListPage.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.desl) + if err != nil { + return err + } + page.desl = 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 *DiskEncryptionSetListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DiskEncryptionSetListPage) NotDone() bool { + return !page.desl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DiskEncryptionSetListPage) Response() DiskEncryptionSetList { + return page.desl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DiskEncryptionSetListPage) Values() []DiskEncryptionSet { + if page.desl.IsEmpty() { + return nil + } + return *page.desl.Value +} + +// Creates a new instance of the DiskEncryptionSetListPage type. +func NewDiskEncryptionSetListPage(getNextPage func(context.Context, DiskEncryptionSetList) (DiskEncryptionSetList, error)) DiskEncryptionSetListPage { + return DiskEncryptionSetListPage{fn: getNextPage} +} + +// DiskEncryptionSetParameters describes the parameter of customer managed disk encryption set resource id +// that can be specified for disk.

NOTE: The disk encryption set resource id can only be specified +// for managed disk. Please refer https://aka.ms/mdssewithcmkoverview for more details. +type DiskEncryptionSetParameters struct { + // ID - Resource Id + ID *string `json:"id,omitempty"` +} + +// DiskEncryptionSetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type DiskEncryptionSetsCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DiskEncryptionSetsCreateOrUpdateFuture) Result(client DiskEncryptionSetsClient) (desVar DiskEncryptionSet, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("compute.DiskEncryptionSetsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if desVar.Response.Response, err = future.GetResult(sender); err == nil && desVar.Response.Response.StatusCode != http.StatusNoContent { + desVar, err = client.CreateOrUpdateResponder(desVar.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsCreateOrUpdateFuture", "Result", desVar.Response.Response, "Failure responding to request") + } + } + return +} + +// DiskEncryptionSetsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type DiskEncryptionSetsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DiskEncryptionSetsDeleteFuture) Result(client DiskEncryptionSetsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("compute.DiskEncryptionSetsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// DiskEncryptionSetsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type DiskEncryptionSetsUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DiskEncryptionSetsUpdateFuture) Result(client DiskEncryptionSetsClient) (desVar DiskEncryptionSet, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("compute.DiskEncryptionSetsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if desVar.Response.Response, err = future.GetResult(sender); err == nil && desVar.Response.Response.StatusCode != http.StatusNoContent { + desVar, err = client.UpdateResponder(desVar.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsUpdateFuture", "Result", desVar.Response.Response, "Failure responding to request") + } + } + return +} + // DiskEncryptionSettings describes a Encryption Settings for a Disk type DiskEncryptionSettings struct { // DiskEncryptionKey - Specifies the location of the disk encryption key, which is a Key Vault Secret. @@ -3176,6 +3568,63 @@ type DiskEncryptionSettings struct { Enabled *bool `json:"enabled,omitempty"` } +// DiskEncryptionSetUpdate disk encryption set update resource. +type DiskEncryptionSetUpdate struct { + *DiskEncryptionSetUpdateProperties `json:"properties,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for DiskEncryptionSetUpdate. +func (desu DiskEncryptionSetUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if desu.DiskEncryptionSetUpdateProperties != nil { + objectMap["properties"] = desu.DiskEncryptionSetUpdateProperties + } + if desu.Tags != nil { + objectMap["tags"] = desu.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DiskEncryptionSetUpdate struct. +func (desu *DiskEncryptionSetUpdate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var diskEncryptionSetUpdateProperties DiskEncryptionSetUpdateProperties + err = json.Unmarshal(*v, &diskEncryptionSetUpdateProperties) + if err != nil { + return err + } + desu.DiskEncryptionSetUpdateProperties = &diskEncryptionSetUpdateProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + desu.Tags = tags + } + } + } + + return nil +} + +// DiskEncryptionSetUpdateProperties disk encryption set resource update properties. +type DiskEncryptionSetUpdateProperties struct { + ActiveKey *KeyVaultAndKeyReference `json:"activeKey,omitempty"` +} + // DiskInstanceView the instance view of the disk. type DiskInstanceView struct { // Name - The disk name. @@ -3358,6 +3807,8 @@ type DiskProperties struct { DiskMBpsReadWrite *int32 `json:"diskMBpsReadWrite,omitempty"` // DiskState - READ-ONLY; The state of the disk. Possible values include: 'Unattached', 'Attached', 'Reserved', 'ActiveSAS', 'ReadyToUpload', 'ActiveUpload' DiskState DiskState `json:"diskState,omitempty"` + // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. + Encryption *Encryption `json:"encryption,omitempty"` } // DisksCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running @@ -3578,6 +4029,35 @@ type DiskUpdateProperties struct { DiskMBpsReadWrite *int32 `json:"diskMBpsReadWrite,omitempty"` } +// Encryption encryption at rest settings for disk or snapshot +type Encryption struct { + // DiskEncryptionSetID - ResourceId of the disk encryption set to use for enabling encryption at rest. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // Type - The type of key used to encrypt the data of the disk. Possible values include: 'EncryptionAtRestWithPlatformKey', 'EncryptionAtRestWithCustomerKey' + Type EncryptionType `json:"type,omitempty"` +} + +// EncryptionSetIdentity the managed identity for the disk encryption set. It should be given permission on +// the key vault before it can be used to encrypt disks. +type EncryptionSetIdentity struct { + // Type - The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is supported. Possible values include: 'SystemAssigned' + Type DiskEncryptionSetIdentityType `json:"type,omitempty"` + // PrincipalID - READ-ONLY; The object id of the Managed Identity Resource. This will be sent to the RP from ARM via the x-ms-identity-principal-id header in the PUT request if the resource has a systemAssigned(implicit) identity + PrincipalID *string `json:"principalId,omitempty"` + // TenantID - READ-ONLY; The tenant id of the Managed Identity Resource. This will be sent to the RP from ARM via the x-ms-client-tenant-id header in the PUT request if the resource has a systemAssigned(implicit) identity + TenantID *string `json:"tenantId,omitempty"` +} + +// EncryptionSetProperties ... +type EncryptionSetProperties struct { + // ActiveKey - The key vault key which is currently used by this disk encryption set. + ActiveKey *KeyVaultAndKeyReference `json:"activeKey,omitempty"` + // PreviousKeys - READ-ONLY; A readonly collection of key vault keys previously used by this disk encryption set while a key rotation is in progress. It will be empty if there is no ongoing key rotation. + PreviousKeys *[]KeyVaultAndKeyReference `json:"previousKeys,omitempty"` + // ProvisioningState - READ-ONLY; The disk encryption set provisioning state. + ProvisioningState *string `json:"provisioningState,omitempty"` +} + // EncryptionSettingsCollection encryption settings for disk or snapshot type EncryptionSettingsCollection struct { // Enabled - Set this flag to true and provide DiskEncryptionKey and optional KeyEncryptionKey to enable encryption. Set this flag to false and remove DiskEncryptionKey and KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the request object, the existing settings remain unchanged. @@ -5409,6 +5889,26 @@ type ImageDataDisk struct { DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` // StorageAccountType - Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. Possible values include: 'StorageAccountTypesStandardLRS', 'StorageAccountTypesPremiumLRS', 'StorageAccountTypesStandardSSDLRS', 'StorageAccountTypesUltraSSDLRS' StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` + // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. + DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` +} + +// ImageDisk describes a image disk. +type ImageDisk struct { + // Snapshot - The snapshot. + Snapshot *SubResource `json:"snapshot,omitempty"` + // ManagedDisk - The managedDisk. + ManagedDisk *SubResource `json:"managedDisk,omitempty"` + // BlobURI - The Virtual Hard Disk. + BlobURI *string `json:"blobUri,omitempty"` + // Caching - Specifies the caching requirements.

Possible values are:

**None**

**ReadOnly**

**ReadWrite**

Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' + Caching CachingTypes `json:"caching,omitempty"` + // DiskSizeGB - Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image.

This value cannot be larger than 1023 GB + DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` + // StorageAccountType - Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. Possible values include: 'StorageAccountTypesStandardLRS', 'StorageAccountTypesPremiumLRS', 'StorageAccountTypesStandardSSDLRS', 'StorageAccountTypesUltraSSDLRS' + StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` + // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. + DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` } // ImageDiskReference the source image used for creating the disk. @@ -5581,8 +6081,10 @@ type ImageOSDisk struct { Caching CachingTypes `json:"caching,omitempty"` // DiskSizeGB - Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image.

This value cannot be larger than 1023 GB DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // StorageAccountType - Specifies the storage account type for the managed disk. UltraSSD_LRS cannot be used with OS Disk. Possible values include: 'StorageAccountTypesStandardLRS', 'StorageAccountTypesPremiumLRS', 'StorageAccountTypesStandardSSDLRS', 'StorageAccountTypesUltraSSDLRS' + // StorageAccountType - Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. Possible values include: 'StorageAccountTypesStandardLRS', 'StorageAccountTypesPremiumLRS', 'StorageAccountTypesStandardSSDLRS', 'StorageAccountTypesUltraSSDLRS' StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` + // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. + DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` } // ImageProperties describes the properties of an Image. @@ -6108,6 +6610,8 @@ type ManagedArtifact struct { type ManagedDiskParameters struct { // StorageAccountType - Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. Possible values include: 'StorageAccountTypesStandardLRS', 'StorageAccountTypesPremiumLRS', 'StorageAccountTypesStandardSSDLRS', 'StorageAccountTypesUltraSSDLRS' StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` + // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed disk. + DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` // ID - Resource Id ID *string `json:"id,omitempty"` } @@ -6307,6 +6811,8 @@ type OSProfile struct { Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` // AllowExtensionOperations - Specifies whether extension operations should be allowed on the virtual machine.

This may only be set to False when no extensions are present on the virtual machine. AllowExtensionOperations *bool `json:"allowExtensionOperations,omitempty"` + // RequireGuestProvisionSignal - Specifies whether the guest provision signal is required from the virtual machine. + RequireGuestProvisionSignal *bool `json:"requireGuestProvisionSignal,omitempty"` } // Plan specifies information about the marketplace image used to create the virtual machine. This element @@ -7631,6 +8137,8 @@ type SnapshotProperties struct { ProvisioningState *string `json:"provisioningState,omitempty"` // Incremental - Whether a snapshot is incremental. Incremental snapshots on the same disk occupy less space than full snapshots and can be diffed. Incremental *bool `json:"incremental,omitempty"` + // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. + Encryption *Encryption `json:"encryption,omitempty"` } // SnapshotsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running @@ -9213,6 +9721,10 @@ type VirtualMachineScaleSetDataDisk struct { DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` // ManagedDisk - The managed disk parameters. ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` + // DiskIOPSReadWrite - Specifies the Read-Write IOPS for the managed disk. Should be used only when StorageAccountType is UltraSSD_LRS. If not specified, a default value would be assigned based on diskSizeGB. + DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` + // DiskMBpsReadWrite - Specifies the bandwidth in MB per second for the managed disk. Should be used only when StorageAccountType is UltraSSD_LRS. If not specified, a default value would be assigned based on diskSizeGB. + DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` } // VirtualMachineScaleSetExtension describes a Virtual Machine Scale Set Extension. @@ -10247,6 +10759,8 @@ func NewVirtualMachineScaleSetListWithLinkResultPage(getNextPage func(context.Co type VirtualMachineScaleSetManagedDiskParameters struct { // StorageAccountType - Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. Possible values include: 'StorageAccountTypesStandardLRS', 'StorageAccountTypesPremiumLRS', 'StorageAccountTypesStandardSSDLRS', 'StorageAccountTypesUltraSSDLRS' StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` + // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed disk. + DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` } // VirtualMachineScaleSetNetworkConfiguration describes a virtual machine scale set network profile's @@ -10394,6 +10908,8 @@ type VirtualMachineScaleSetOSProfile struct { type VirtualMachineScaleSetProperties struct { // UpgradePolicy - The upgrade policy. UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"` + // AutomaticRepairsPolicy - Policy for automatic repairs. + AutomaticRepairsPolicy *AutomaticRepairsPolicy `json:"automaticRepairsPolicy,omitempty"` // VirtualMachineProfile - The virtual machine profile. VirtualMachineProfile *VirtualMachineScaleSetVMProfile `json:"virtualMachineProfile,omitempty"` // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. @@ -10489,6 +11005,8 @@ type VirtualMachineScaleSetPublicIPAddressConfigurationProperties struct { IPTags *[]VirtualMachineScaleSetIPTag `json:"ipTags,omitempty"` // PublicIPPrefix - The PublicIPPrefix from which to allocate publicIP addresses. PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` + // PublicIPAddressVersion - Available from Api-Version 2019-07-01 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' + PublicIPAddressVersion IPVersion `json:"publicIPAddressVersion,omitempty"` } // VirtualMachineScaleSetReimageParameters describes a Virtual Machine Scale Set VM Reimage Parameters. @@ -11219,10 +11737,14 @@ type VirtualMachineScaleSetUpdateOSProfile struct { type VirtualMachineScaleSetUpdateProperties struct { // UpgradePolicy - The upgrade policy. UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"` + // AutomaticRepairsPolicy - Policy for automatic repairs. + AutomaticRepairsPolicy *AutomaticRepairsPolicy `json:"automaticRepairsPolicy,omitempty"` // VirtualMachineProfile - The virtual machine profile. VirtualMachineProfile *VirtualMachineScaleSetUpdateVMProfile `json:"virtualMachineProfile,omitempty"` // Overprovision - Specifies whether the Virtual Machine Scale Set should be overprovisioned. Overprovision *bool `json:"overprovision,omitempty"` + // DoNotRunExtensionsOnOverprovisionedVMs - When Overprovision is enabled, extensions are launched only on the requested number of VMs which are finally kept. This property will hence ensure that the extensions do not run on the extra overprovisioned VMs. + DoNotRunExtensionsOnOverprovisionedVMs *bool `json:"doNotRunExtensionsOnOverprovisionedVMs,omitempty"` // SinglePlacementGroup - When true this limits the scale set to a single placement group, of max size 100 virtual machines. 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. @@ -11481,6 +12003,58 @@ func (vmssv *VirtualMachineScaleSetVM) UnmarshalJSON(body []byte) error { return nil } +// VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture) Result(client VirtualMachineScaleSetVMExtensionsClient) (vme VirtualMachineExtension, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vme.Response.Response, err = future.GetResult(sender); err == nil && vme.Response.Response.StatusCode != http.StatusNoContent { + vme, err = client.CreateOrUpdateResponder(vme.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture", "Result", vme.Response.Response, "Failure responding to request") + } + } + return +} + +// VirtualMachineScaleSetVMExtensionsDeleteFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type VirtualMachineScaleSetVMExtensionsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *VirtualMachineScaleSetVMExtensionsDeleteFuture) Result(client VirtualMachineScaleSetVMExtensionsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMExtensionsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + // VirtualMachineScaleSetVMExtensionsSummary extensions summary for virtual machines of a virtual machine // scale set. type VirtualMachineScaleSetVMExtensionsSummary struct { @@ -11490,6 +12064,35 @@ type VirtualMachineScaleSetVMExtensionsSummary struct { StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` } +// VirtualMachineScaleSetVMExtensionsUpdateFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type VirtualMachineScaleSetVMExtensionsUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *VirtualMachineScaleSetVMExtensionsUpdateFuture) Result(client VirtualMachineScaleSetVMExtensionsClient) (vme VirtualMachineExtension, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMExtensionsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vme.Response.Response, err = future.GetResult(sender); err == nil && vme.Response.Response.StatusCode != http.StatusNoContent { + vme, err = client.UpdateResponder(vme.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsUpdateFuture", "Result", vme.Response.Response, "Failure responding to request") + } + } + return +} + // VirtualMachineScaleSetVMInstanceIDs specifies a list of virtual machine instance IDs from the VM scale // set. type VirtualMachineScaleSetVMInstanceIDs struct { @@ -12219,6 +12822,29 @@ func (future *VirtualMachinesPowerOffFuture) Result(client VirtualMachinesClient return } +// VirtualMachinesReapplyFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type VirtualMachinesReapplyFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *VirtualMachinesReapplyFuture) Result(client VirtualMachinesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesReapplyFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesReapplyFuture") + return + } + ar.Response = future.Response() + return +} + // VirtualMachinesRedeployFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type VirtualMachinesRedeployFuture struct { diff --git a/services/compute/mgmt/2019-07-01/compute/operations.go b/services/compute/mgmt/2019-07-01/compute/operations.go index c19b7567d7dd..021b16328e7d 100644 --- a/services/compute/mgmt/2019-07-01/compute/operations.go +++ b/services/compute/mgmt/2019-07-01/compute/operations.go @@ -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 = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/compute/mgmt/2019-07-01/compute/proximityplacementgroups.go b/services/compute/mgmt/2019-07-01/compute/proximityplacementgroups.go index a85c1640cd43..a42d52685560 100644 --- a/services/compute/mgmt/2019-07-01/compute/proximityplacementgroups.go +++ b/services/compute/mgmt/2019-07-01/compute/proximityplacementgroups.go @@ -85,7 +85,7 @@ func (client ProximityPlacementGroupsClient) CreateOrUpdatePreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -164,7 +164,7 @@ func (client ProximityPlacementGroupsClient) DeletePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -240,7 +240,7 @@ func (client ProximityPlacementGroupsClient) GetPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -316,7 +316,7 @@ func (client ProximityPlacementGroupsClient) ListByResourceGroupPreparer(ctx con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -426,7 +426,7 @@ func (client ProximityPlacementGroupsClient) ListBySubscriptionPreparer(ctx cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -541,7 +541,7 @@ func (client ProximityPlacementGroupsClient) UpdatePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/compute/mgmt/2019-07-01/compute/resourceskus.go b/services/compute/mgmt/2019-07-01/compute/resourceskus.go index dade057a45fe..adb402788c87 100644 --- a/services/compute/mgmt/2019-07-01/compute/resourceskus.go +++ b/services/compute/mgmt/2019-07-01/compute/resourceskus.go @@ -41,7 +41,9 @@ func NewResourceSkusClientWithBaseURI(baseURI string, subscriptionID string) Res } // List gets the list of Microsoft.Compute SKUs available for your Subscription. -func (client ResourceSkusClient) List(ctx context.Context) (result ResourceSkusResultPage, err error) { +// Parameters: +// filter - the filter to apply on the operation. +func (client ResourceSkusClient) List(ctx context.Context, filter string) (result ResourceSkusResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusClient.List") defer func() { @@ -53,7 +55,7 @@ func (client ResourceSkusClient) List(ctx context.Context) (result ResourceSkusR }() } result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) + req, err := client.ListPreparer(ctx, filter) if err != nil { err = autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "List", nil, "Failure preparing request") return @@ -75,7 +77,7 @@ func (client ResourceSkusClient) List(ctx context.Context) (result ResourceSkusR } // ListPreparer prepares the List request. -func (client ResourceSkusClient) ListPreparer(ctx context.Context) (*http.Request, error) { +func (client ResourceSkusClient) ListPreparer(ctx context.Context, filter string) (*http.Request, error) { pathParameters := map[string]interface{}{ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -84,6 +86,9 @@ func (client ResourceSkusClient) ListPreparer(ctx context.Context) (*http.Reques queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -135,7 +140,7 @@ func (client ResourceSkusClient) listNextResults(ctx context.Context, lastResult } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ResourceSkusClient) ListComplete(ctx context.Context) (result ResourceSkusResultIterator, err error) { +func (client ResourceSkusClient) ListComplete(ctx context.Context, filter string) (result ResourceSkusResultIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusClient.List") defer func() { @@ -146,6 +151,6 @@ func (client ResourceSkusClient) ListComplete(ctx context.Context) (result Resou tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.List(ctx) + result.page, err = client.List(ctx, filter) return } diff --git a/services/compute/mgmt/2019-07-01/compute/snapshots.go b/services/compute/mgmt/2019-07-01/compute/snapshots.go index 5fca4e7acd7f..3a52fe87388b 100644 --- a/services/compute/mgmt/2019-07-01/compute/snapshots.go +++ b/services/compute/mgmt/2019-07-01/compute/snapshots.go @@ -94,7 +94,7 @@ func (client SnapshotsClient) CreateOrUpdatePreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -175,7 +175,7 @@ func (client SnapshotsClient) DeletePreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -258,7 +258,7 @@ func (client SnapshotsClient) GetPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -337,7 +337,7 @@ func (client SnapshotsClient) GrantAccessPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -418,7 +418,7 @@ func (client SnapshotsClient) ListPreparer(ctx context.Context) (*http.Request, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -531,7 +531,7 @@ func (client SnapshotsClient) ListByResourceGroupPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -640,7 +640,7 @@ func (client SnapshotsClient) RevokeAccessPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -718,7 +718,7 @@ func (client SnapshotsClient) UpdatePreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/compute/mgmt/2019-07-01/compute/usage.go b/services/compute/mgmt/2019-07-01/compute/usage.go index 36565c1a55c7..690136c06d54 100644 --- a/services/compute/mgmt/2019-07-01/compute/usage.go +++ b/services/compute/mgmt/2019-07-01/compute/usage.go @@ -91,7 +91,7 @@ func (client UsageClient) ListPreparer(ctx context.Context, location string) (*h "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/compute/mgmt/2019-07-01/compute/virtualmachineextensionimages.go b/services/compute/mgmt/2019-07-01/compute/virtualmachineextensionimages.go index 94adf706bf31..7a670a607c82 100644 --- a/services/compute/mgmt/2019-07-01/compute/virtualmachineextensionimages.go +++ b/services/compute/mgmt/2019-07-01/compute/virtualmachineextensionimages.go @@ -86,7 +86,7 @@ func (client VirtualMachineExtensionImagesClient) GetPreparer(ctx context.Contex "version": autorest.Encode("path", version), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -162,7 +162,7 @@ func (client VirtualMachineExtensionImagesClient) ListTypesPreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -240,7 +240,7 @@ func (client VirtualMachineExtensionImagesClient) ListVersionsPreparer(ctx conte "type": autorest.Encode("path", typeParameter), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/compute/mgmt/2019-07-01/compute/virtualmachineextensions.go b/services/compute/mgmt/2019-07-01/compute/virtualmachineextensions.go index bb80694c6340..a77180ddc688 100644 --- a/services/compute/mgmt/2019-07-01/compute/virtualmachineextensions.go +++ b/services/compute/mgmt/2019-07-01/compute/virtualmachineextensions.go @@ -81,7 +81,7 @@ func (client VirtualMachineExtensionsClient) CreateOrUpdatePreparer(ctx context. "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -162,7 +162,7 @@ func (client VirtualMachineExtensionsClient) DeletePreparer(ctx context.Context, "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -247,7 +247,7 @@ func (client VirtualMachineExtensionsClient) GetPreparer(ctx context.Context, re "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -328,7 +328,7 @@ func (client VirtualMachineExtensionsClient) ListPreparer(ctx context.Context, r "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -405,7 +405,7 @@ func (client VirtualMachineExtensionsClient) UpdatePreparer(ctx context.Context, "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/compute/mgmt/2019-07-01/compute/virtualmachineimages.go b/services/compute/mgmt/2019-07-01/compute/virtualmachineimages.go index 2843539d6a81..e1e830c2f432 100644 --- a/services/compute/mgmt/2019-07-01/compute/virtualmachineimages.go +++ b/services/compute/mgmt/2019-07-01/compute/virtualmachineimages.go @@ -90,7 +90,7 @@ func (client VirtualMachineImagesClient) GetPreparer(ctx context.Context, locati "version": autorest.Encode("path", version), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -172,7 +172,7 @@ func (client VirtualMachineImagesClient) ListPreparer(ctx context.Context, locat "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -258,7 +258,7 @@ func (client VirtualMachineImagesClient) ListOffersPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -333,7 +333,7 @@ func (client VirtualMachineImagesClient) ListPublishersPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -412,7 +412,7 @@ func (client VirtualMachineImagesClient) ListSkusPreparer(ctx context.Context, l "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/compute/mgmt/2019-07-01/compute/virtualmachineruncommands.go b/services/compute/mgmt/2019-07-01/compute/virtualmachineruncommands.go index e2b53b704796..82be43acfd4c 100644 --- a/services/compute/mgmt/2019-07-01/compute/virtualmachineruncommands.go +++ b/services/compute/mgmt/2019-07-01/compute/virtualmachineruncommands.go @@ -91,7 +91,7 @@ func (client VirtualMachineRunCommandsClient) GetPreparer(ctx context.Context, l "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -173,7 +173,7 @@ func (client VirtualMachineRunCommandsClient) ListPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/compute/mgmt/2019-07-01/compute/virtualmachines.go b/services/compute/mgmt/2019-07-01/compute/virtualmachines.go index 206e7f4d7257..b329db181d98 100644 --- a/services/compute/mgmt/2019-07-01/compute/virtualmachines.go +++ b/services/compute/mgmt/2019-07-01/compute/virtualmachines.go @@ -89,7 +89,7 @@ func (client VirtualMachinesClient) CapturePreparer(ctx context.Context, resourc "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -169,7 +169,7 @@ func (client VirtualMachinesClient) ConvertToManagedDisksPreparer(ctx context.Co "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -267,7 +267,7 @@ func (client VirtualMachinesClient) CreateOrUpdatePreparer(ctx context.Context, "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -348,7 +348,7 @@ func (client VirtualMachinesClient) DeallocatePreparer(ctx context.Context, reso "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -424,7 +424,7 @@ func (client VirtualMachinesClient) DeletePreparer(ctx context.Context, resource "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -506,7 +506,7 @@ func (client VirtualMachinesClient) GeneralizePreparer(ctx context.Context, reso "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -583,7 +583,7 @@ func (client VirtualMachinesClient) GetPreparer(ctx context.Context, resourceGro "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -663,7 +663,7 @@ func (client VirtualMachinesClient) InstanceViewPreparer(ctx context.Context, re "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -740,7 +740,7 @@ func (client VirtualMachinesClient) ListPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -812,7 +812,9 @@ func (client VirtualMachinesClient) ListComplete(ctx context.Context, resourceGr // ListAll lists all of the virtual machines in the specified subscription. Use the nextLink property in the response // to get the next page of virtual machines. -func (client VirtualMachinesClient) ListAll(ctx context.Context) (result VirtualMachineListResultPage, err error) { +// Parameters: +// statusOnly - statusOnly=true enables fetching run time status of all Virtual Machines in the subscription. +func (client VirtualMachinesClient) ListAll(ctx context.Context, statusOnly string) (result VirtualMachineListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ListAll") defer func() { @@ -824,7 +826,7 @@ func (client VirtualMachinesClient) ListAll(ctx context.Context) (result Virtual }() } result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) + req, err := client.ListAllPreparer(ctx, statusOnly) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAll", nil, "Failure preparing request") return @@ -846,15 +848,18 @@ func (client VirtualMachinesClient) ListAll(ctx context.Context) (result Virtual } // ListAllPreparer prepares the ListAll request. -func (client VirtualMachinesClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { +func (client VirtualMachinesClient) ListAllPreparer(ctx context.Context, statusOnly string) (*http.Request, error) { pathParameters := map[string]interface{}{ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if len(statusOnly) > 0 { + queryParameters["statusOnly"] = autorest.Encode("query", statusOnly) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -906,7 +911,7 @@ func (client VirtualMachinesClient) listAllNextResults(ctx context.Context, last } // ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachinesClient) ListAllComplete(ctx context.Context) (result VirtualMachineListResultIterator, err error) { +func (client VirtualMachinesClient) ListAllComplete(ctx context.Context, statusOnly string) (result VirtualMachineListResultIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ListAll") defer func() { @@ -917,7 +922,7 @@ func (client VirtualMachinesClient) ListAllComplete(ctx context.Context) (result tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListAll(ctx) + result.page, err = client.ListAll(ctx, statusOnly) return } @@ -965,7 +970,7 @@ func (client VirtualMachinesClient) ListAvailableSizesPreparer(ctx context.Conte "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1047,7 +1052,7 @@ func (client VirtualMachinesClient) ListByLocationPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1155,7 +1160,7 @@ func (client VirtualMachinesClient) PerformMaintenancePreparer(ctx context.Conte "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1235,7 +1240,7 @@ func (client VirtualMachinesClient) PowerOffPreparer(ctx context.Context, resour "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1278,6 +1283,82 @@ func (client VirtualMachinesClient) PowerOffResponder(resp *http.Response) (resu return } +// Reapply the operation to reapply a virtual machine's state. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMName - the name of the virtual machine. +func (client VirtualMachinesClient) Reapply(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesReapplyFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Reapply") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ReapplyPreparer(ctx, resourceGroupName, VMName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Reapply", nil, "Failure preparing request") + return + } + + result, err = client.ReapplySender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Reapply", result.Response(), "Failure sending request") + return + } + + return +} + +// ReapplyPreparer prepares the Reapply request. +func (client VirtualMachinesClient) ReapplyPreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmName": autorest.Encode("path", VMName), + } + + 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.Compute/virtualMachines/{vmName}/reapply", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReapplySender sends the Reapply request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) ReapplySender(req *http.Request) (future VirtualMachinesReapplyFuture, 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 +} + +// ReapplyResponder handles the response to the Reapply request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) ReapplyResponder(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 +} + // Redeploy shuts down the virtual machine, moves it to a new node, and powers it back on. // Parameters: // resourceGroupName - the name of the resource group. @@ -1316,7 +1397,7 @@ func (client VirtualMachinesClient) RedeployPreparer(ctx context.Context, resour "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1393,7 +1474,7 @@ func (client VirtualMachinesClient) ReimagePreparer(ctx context.Context, resourc "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1474,7 +1555,7 @@ func (client VirtualMachinesClient) RestartPreparer(ctx context.Context, resourc "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1557,7 +1638,7 @@ func (client VirtualMachinesClient) RunCommandPreparer(ctx context.Context, reso "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1636,7 +1717,7 @@ func (client VirtualMachinesClient) StartPreparer(ctx context.Context, resourceG "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1713,7 +1794,7 @@ func (client VirtualMachinesClient) UpdatePreparer(ctx context.Context, resource "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/compute/mgmt/2019-07-01/compute/virtualmachinescalesetextensions.go b/services/compute/mgmt/2019-07-01/compute/virtualmachinescalesetextensions.go index 041df6980553..7e4d6d0a6b70 100644 --- a/services/compute/mgmt/2019-07-01/compute/virtualmachinescalesetextensions.go +++ b/services/compute/mgmt/2019-07-01/compute/virtualmachinescalesetextensions.go @@ -82,7 +82,7 @@ func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdatePreparer(ctx "vmssExtensionName": autorest.Encode("path", vmssExtensionName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -163,7 +163,7 @@ func (client VirtualMachineScaleSetExtensionsClient) DeletePreparer(ctx context. "vmssExtensionName": autorest.Encode("path", vmssExtensionName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -248,7 +248,7 @@ func (client VirtualMachineScaleSetExtensionsClient) GetPreparer(ctx context.Con "vmssExtensionName": autorest.Encode("path", vmssExtensionName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -329,7 +329,7 @@ func (client VirtualMachineScaleSetExtensionsClient) ListPreparer(ctx context.Co "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/compute/mgmt/2019-07-01/compute/virtualmachinescalesetrollingupgrades.go b/services/compute/mgmt/2019-07-01/compute/virtualmachinescalesetrollingupgrades.go index 6bdc9f2b3224..c20c01d515cf 100644 --- a/services/compute/mgmt/2019-07-01/compute/virtualmachinescalesetrollingupgrades.go +++ b/services/compute/mgmt/2019-07-01/compute/virtualmachinescalesetrollingupgrades.go @@ -80,7 +80,7 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) CancelPreparer(ctx con "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -162,7 +162,7 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatestPreparer(ctx "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -235,7 +235,7 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) StartExtensionUpgradeP "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -312,7 +312,7 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgradePreparer "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/compute/mgmt/2019-07-01/compute/virtualmachinescalesets.go b/services/compute/mgmt/2019-07-01/compute/virtualmachinescalesets.go index 660464e05780..54b1393fe57d 100644 --- a/services/compute/mgmt/2019-07-01/compute/virtualmachinescalesets.go +++ b/services/compute/mgmt/2019-07-01/compute/virtualmachinescalesets.go @@ -177,7 +177,7 @@ func (client VirtualMachineScaleSetsClient) CreateOrUpdatePreparer(ctx context.C "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -258,7 +258,7 @@ func (client VirtualMachineScaleSetsClient) DeallocatePreparer(ctx context.Conte "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -339,7 +339,7 @@ func (client VirtualMachineScaleSetsClient) DeletePreparer(ctx context.Context, "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -422,7 +422,7 @@ func (client VirtualMachineScaleSetsClient) DeleteInstancesPreparer(ctx context. "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -508,7 +508,7 @@ func (client VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUp "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, "platformUpdateDomain": autorest.Encode("query", platformUpdateDomain), @@ -586,7 +586,7 @@ func (client VirtualMachineScaleSetsClient) GetPreparer(ctx context.Context, res "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -663,7 +663,7 @@ func (client VirtualMachineScaleSetsClient) GetInstanceViewPreparer(ctx context. "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -741,7 +741,7 @@ func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistoryPreparer(ctx cont "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -854,7 +854,7 @@ func (client VirtualMachineScaleSetsClient) ListPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -966,7 +966,7 @@ func (client VirtualMachineScaleSetsClient) ListAllPreparer(ctx context.Context) "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1082,7 +1082,7 @@ func (client VirtualMachineScaleSetsClient) ListSkusPreparer(ctx context.Context "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1193,7 +1193,7 @@ func (client VirtualMachineScaleSetsClient) PerformMaintenancePreparer(ctx conte "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1279,7 +1279,7 @@ func (client VirtualMachineScaleSetsClient) PowerOffPreparer(ctx context.Context "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1367,7 +1367,7 @@ func (client VirtualMachineScaleSetsClient) RedeployPreparer(ctx context.Context "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1450,7 +1450,7 @@ func (client VirtualMachineScaleSetsClient) ReimagePreparer(ctx context.Context, "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1533,7 +1533,7 @@ func (client VirtualMachineScaleSetsClient) ReimageAllPreparer(ctx context.Conte "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1615,7 +1615,7 @@ func (client VirtualMachineScaleSetsClient) RestartPreparer(ctx context.Context, "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1697,7 +1697,7 @@ func (client VirtualMachineScaleSetsClient) StartPreparer(ctx context.Context, r "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1779,7 +1779,7 @@ func (client VirtualMachineScaleSetsClient) UpdatePreparer(ctx context.Context, "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1865,7 +1865,7 @@ func (client VirtualMachineScaleSetsClient) UpdateInstancesPreparer(ctx context. "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/compute/mgmt/2019-07-01/compute/virtualmachinescalesetvmextensions.go b/services/compute/mgmt/2019-07-01/compute/virtualmachinescalesetvmextensions.go new file mode 100644 index 000000000000..3fe6bf51dd22 --- /dev/null +++ b/services/compute/mgmt/2019-07-01/compute/virtualmachinescalesetvmextensions.go @@ -0,0 +1,459 @@ +package compute + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if 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" +) + +// VirtualMachineScaleSetVMExtensionsClient is the compute Client +type VirtualMachineScaleSetVMExtensionsClient struct { + BaseClient +} + +// NewVirtualMachineScaleSetVMExtensionsClient creates an instance of the VirtualMachineScaleSetVMExtensionsClient +// client. +func NewVirtualMachineScaleSetVMExtensionsClient(subscriptionID string) VirtualMachineScaleSetVMExtensionsClient { + return NewVirtualMachineScaleSetVMExtensionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewVirtualMachineScaleSetVMExtensionsClientWithBaseURI creates an instance of the +// VirtualMachineScaleSetVMExtensionsClient client. +func NewVirtualMachineScaleSetVMExtensionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetVMExtensionsClient { + return VirtualMachineScaleSetVMExtensionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate the operation to create or update the VMSS VM extension. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// instanceID - the instance ID of the virtual machine. +// VMExtensionName - the name of the virtual machine extension. +// extensionParameters - parameters supplied to the Create Virtual Machine Extension operation. +func (client VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, extensionParameters VirtualMachineExtension) (result VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMExtensionsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, VMExtensionName, extensionParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, extensionParameters VirtualMachineExtension) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmExtensionName": autorest.Encode("path", VMExtensionName), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2019-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}", pathParameters), + autorest.WithJSON(extensionParameters), + 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 VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture, 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 VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineExtension, 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 the operation to delete the VMSS VM extension. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// instanceID - the instance ID of the virtual machine. +// VMExtensionName - the name of the virtual machine extension. +func (client VirtualMachineScaleSetVMExtensionsClient) Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string) (result VirtualMachineScaleSetVMExtensionsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMExtensionsClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, VMExtensionName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client VirtualMachineScaleSetVMExtensionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmExtensionName": autorest.Encode("path", VMExtensionName), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + 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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}", 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 VirtualMachineScaleSetVMExtensionsClient) DeleteSender(req *http.Request) (future VirtualMachineScaleSetVMExtensionsDeleteFuture, 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 VirtualMachineScaleSetVMExtensionsClient) 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 the operation to get the VMSS VM extension. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// instanceID - the instance ID of the virtual machine. +// VMExtensionName - the name of the virtual machine extension. +// expand - the expand expression to apply on the operation. +func (client VirtualMachineScaleSetVMExtensionsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, expand string) (result VirtualMachineExtension, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMExtensionsClient.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, VMScaleSetName, instanceID, VMExtensionName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client VirtualMachineScaleSetVMExtensionsClient) GetPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, expand string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmExtensionName": autorest.Encode("path", VMExtensionName), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + 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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}", 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 VirtualMachineScaleSetVMExtensionsClient) 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 VirtualMachineScaleSetVMExtensionsClient) GetResponder(resp *http.Response) (result VirtualMachineExtension, 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 the operation to get all extensions of an instance in Virtual Machine Scaleset. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// instanceID - the instance ID of the virtual machine. +// expand - the expand expression to apply on the operation. +func (client VirtualMachineScaleSetVMExtensionsClient) List(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand string) (result VirtualMachineExtensionsListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMExtensionsClient.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, VMScaleSetName, instanceID, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client VirtualMachineScaleSetVMExtensionsClient) ListPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + 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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions", 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 VirtualMachineScaleSetVMExtensionsClient) 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 VirtualMachineScaleSetVMExtensionsClient) ListResponder(resp *http.Response) (result VirtualMachineExtensionsListResult, 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 the operation to update the VMSS VM extension. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// instanceID - the instance ID of the virtual machine. +// VMExtensionName - the name of the virtual machine extension. +// extensionParameters - parameters supplied to the Update Virtual Machine Extension operation. +func (client VirtualMachineScaleSetVMExtensionsClient) Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, extensionParameters VirtualMachineExtensionUpdate) (result VirtualMachineScaleSetVMExtensionsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMExtensionsClient.Update") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, VMExtensionName, extensionParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client VirtualMachineScaleSetVMExtensionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, extensionParameters VirtualMachineExtensionUpdate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmExtensionName": autorest.Encode("path", VMExtensionName), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2019-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}", pathParameters), + autorest.WithJSON(extensionParameters), + 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 VirtualMachineScaleSetVMExtensionsClient) UpdateSender(req *http.Request) (future VirtualMachineScaleSetVMExtensionsUpdateFuture, 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 VirtualMachineScaleSetVMExtensionsClient) UpdateResponder(resp *http.Response) (result VirtualMachineExtension, 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/2019-07-01/compute/virtualmachinescalesetvms.go b/services/compute/mgmt/2019-07-01/compute/virtualmachinescalesetvms.go index 6015078f439d..155e6eee83df 100644 --- a/services/compute/mgmt/2019-07-01/compute/virtualmachinescalesetvms.go +++ b/services/compute/mgmt/2019-07-01/compute/virtualmachinescalesetvms.go @@ -83,7 +83,7 @@ func (client VirtualMachineScaleSetVMsClient) DeallocatePreparer(ctx context.Con "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -161,7 +161,7 @@ func (client VirtualMachineScaleSetVMsClient) DeletePreparer(ctx context.Context "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -246,7 +246,7 @@ func (client VirtualMachineScaleSetVMsClient) GetPreparer(ctx context.Context, r "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -328,7 +328,7 @@ func (client VirtualMachineScaleSetVMsClient) GetInstanceViewPreparer(ctx contex "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -409,7 +409,7 @@ func (client VirtualMachineScaleSetVMsClient) ListPreparer(ctx context.Context, "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -528,7 +528,7 @@ func (client VirtualMachineScaleSetVMsClient) PerformMaintenancePreparer(ctx con "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -610,7 +610,7 @@ func (client VirtualMachineScaleSetVMsClient) PowerOffPreparer(ctx context.Conte "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -694,7 +694,7 @@ func (client VirtualMachineScaleSetVMsClient) RedeployPreparer(ctx context.Conte "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -773,7 +773,7 @@ func (client VirtualMachineScaleSetVMsClient) ReimagePreparer(ctx context.Contex "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -857,7 +857,7 @@ func (client VirtualMachineScaleSetVMsClient) ReimageAllPreparer(ctx context.Con "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -935,7 +935,7 @@ func (client VirtualMachineScaleSetVMsClient) RestartPreparer(ctx context.Contex "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1020,7 +1020,7 @@ func (client VirtualMachineScaleSetVMsClient) RunCommandPreparer(ctx context.Con "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1101,7 +1101,7 @@ func (client VirtualMachineScaleSetVMsClient) StartPreparer(ctx context.Context, "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1201,7 +1201,7 @@ func (client VirtualMachineScaleSetVMsClient) UpdatePreparer(ctx context.Context "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/compute/mgmt/2019-07-01/compute/virtualmachinesizes.go b/services/compute/mgmt/2019-07-01/compute/virtualmachinesizes.go index 04bcbb0490d4..55335fe9a518 100644 --- a/services/compute/mgmt/2019-07-01/compute/virtualmachinesizes.go +++ b/services/compute/mgmt/2019-07-01/compute/virtualmachinesizes.go @@ -90,7 +90,7 @@ func (client VirtualMachineSizesClient) ListPreparer(ctx context.Context, locati "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/consumption/mgmt/2018-05-31/consumption/models.go b/services/consumption/mgmt/2018-05-31/consumption/models.go index ba5a6fdb7f95..ea7f67e61d30 100644 --- a/services/consumption/mgmt/2018-05-31/consumption/models.go +++ b/services/consumption/mgmt/2018-05-31/consumption/models.go @@ -20,14 +20,13 @@ package consumption import ( "context" "encoding/json" - "net/http" - "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/date" "github.com/Azure/go-autorest/autorest/to" "github.com/Azure/go-autorest/tracing" "github.com/satori/go.uuid" "github.com/shopspring/decimal" + "net/http" ) // The package's fully qualified name. diff --git a/services/containerregistry/mgmt/2017-10-01/containerregistry/models.go b/services/containerregistry/mgmt/2017-10-01/containerregistry/models.go index 3e8a7933a0a1..68da4edccd97 100644 --- a/services/containerregistry/mgmt/2017-10-01/containerregistry/models.go +++ b/services/containerregistry/mgmt/2017-10-01/containerregistry/models.go @@ -978,8 +978,6 @@ type Registry struct { autorest.Response `json:"-"` // Sku - The SKU of the container registry. Sku *Sku `json:"sku,omitempty"` - // Identity - The identity of the container registry. - Identity *RegistryIdentity `json:"identity,omitempty"` // RegistryProperties - The properties of the container registry. *RegistryProperties `json:"properties,omitempty"` // ID - READ-ONLY; The resource ID. @@ -1000,9 +998,6 @@ func (r Registry) MarshalJSON() ([]byte, error) { if r.Sku != nil { objectMap["sku"] = r.Sku } - if r.Identity != nil { - objectMap["identity"] = r.Identity - } if r.RegistryProperties != nil { objectMap["properties"] = r.RegistryProperties } @@ -1033,15 +1028,6 @@ func (r *Registry) UnmarshalJSON(body []byte) error { } r.Sku = &sku } - case "identity": - if v != nil { - var identity RegistryIdentity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - r.Identity = &identity - } case "properties": if v != nil { var registryProperties RegistryProperties @@ -1102,16 +1088,6 @@ func (r *Registry) UnmarshalJSON(body []byte) error { return nil } -// RegistryIdentity the identity of the container registry. -type RegistryIdentity struct { - // Type - The type of identity used for the registry. - Type *string `json:"type,omitempty"` - // PrincipalID - The principal ID of registry identity. - PrincipalID *string `json:"principalId,omitempty"` - // TenantID - The tenant ID associated with the registry. - TenantID *string `json:"tenantId,omitempty"` -} - // RegistryListCredentialsResult the response from the ListCredentials operation. type RegistryListCredentialsResult struct { autorest.Response `json:"-"` @@ -1337,8 +1313,6 @@ type RegistryUpdateParameters struct { Tags map[string]*string `json:"tags"` // Sku - The SKU of the container registry. Sku *Sku `json:"sku,omitempty"` - // Identity - The identity of the container registry. - Identity *RegistryIdentity `json:"identity,omitempty"` // RegistryPropertiesUpdateParameters - The properties that the container registry will be updated with. *RegistryPropertiesUpdateParameters `json:"properties,omitempty"` } @@ -1352,9 +1326,6 @@ func (rup RegistryUpdateParameters) MarshalJSON() ([]byte, error) { if rup.Sku != nil { objectMap["sku"] = rup.Sku } - if rup.Identity != nil { - objectMap["identity"] = rup.Identity - } if rup.RegistryPropertiesUpdateParameters != nil { objectMap["properties"] = rup.RegistryPropertiesUpdateParameters } @@ -1388,15 +1359,6 @@ func (rup *RegistryUpdateParameters) UnmarshalJSON(body []byte) error { } rup.Sku = &sku } - case "identity": - if v != nil { - var identity RegistryIdentity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - rup.Identity = &identity - } case "properties": if v != nil { var registryPropertiesUpdateParameters RegistryPropertiesUpdateParameters diff --git a/services/containerregistry/mgmt/2018-09-01/containerregistry/models.go b/services/containerregistry/mgmt/2018-09-01/containerregistry/models.go index a957075be5d0..94796bea2233 100644 --- a/services/containerregistry/mgmt/2018-09-01/containerregistry/models.go +++ b/services/containerregistry/mgmt/2018-09-01/containerregistry/models.go @@ -2180,8 +2180,6 @@ type Registry struct { autorest.Response `json:"-"` // Sku - The SKU of the container registry. Sku *Sku `json:"sku,omitempty"` - // Identity - The identity of the container registry. - Identity *RegistryIdentity `json:"identity,omitempty"` // RegistryProperties - The properties of the container registry. *RegistryProperties `json:"properties,omitempty"` // ID - READ-ONLY; The resource ID. @@ -2202,9 +2200,6 @@ func (r Registry) MarshalJSON() ([]byte, error) { if r.Sku != nil { objectMap["sku"] = r.Sku } - if r.Identity != nil { - objectMap["identity"] = r.Identity - } if r.RegistryProperties != nil { objectMap["properties"] = r.RegistryProperties } @@ -2235,15 +2230,6 @@ func (r *Registry) UnmarshalJSON(body []byte) error { } r.Sku = &sku } - case "identity": - if v != nil { - var identity RegistryIdentity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - r.Identity = &identity - } case "properties": if v != nil { var registryProperties RegistryProperties @@ -2304,16 +2290,6 @@ func (r *Registry) UnmarshalJSON(body []byte) error { return nil } -// RegistryIdentity the identity of the container registry. -type RegistryIdentity struct { - // Type - The type of identity used for the registry. - Type *string `json:"type,omitempty"` - // PrincipalID - The principal ID of registry identity. - PrincipalID *string `json:"principalId,omitempty"` - // TenantID - The tenant ID associated with the registry. - TenantID *string `json:"tenantId,omitempty"` -} - // RegistryListCredentialsResult the response from the ListCredentials operation. type RegistryListCredentialsResult struct { autorest.Response `json:"-"` @@ -2539,8 +2515,6 @@ type RegistryUpdateParameters struct { Tags map[string]*string `json:"tags"` // Sku - The SKU of the container registry. Sku *Sku `json:"sku,omitempty"` - // Identity - The identity of the container registry. - Identity *RegistryIdentity `json:"identity,omitempty"` // RegistryPropertiesUpdateParameters - The properties that the container registry will be updated with. *RegistryPropertiesUpdateParameters `json:"properties,omitempty"` } @@ -2554,9 +2528,6 @@ func (rup RegistryUpdateParameters) MarshalJSON() ([]byte, error) { if rup.Sku != nil { objectMap["sku"] = rup.Sku } - if rup.Identity != nil { - objectMap["identity"] = rup.Identity - } if rup.RegistryPropertiesUpdateParameters != nil { objectMap["properties"] = rup.RegistryPropertiesUpdateParameters } @@ -2590,15 +2561,6 @@ func (rup *RegistryUpdateParameters) UnmarshalJSON(body []byte) error { } rup.Sku = &sku } - case "identity": - if v != nil { - var identity RegistryIdentity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - rup.Identity = &identity - } case "properties": if v != nil { var registryPropertiesUpdateParameters RegistryPropertiesUpdateParameters 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 a56ebfb7f3c6..f1e48788ddb2 100644 --- a/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/models.go +++ b/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/models.go @@ -560,7 +560,7 @@ type GenerateCredentialsParameters struct { 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 - Specifies name of the password which should be regenerated if any -- password1 or password2. Possible values include: 'TokenPasswordNamePassword1', 'TokenPasswordNamePassword2' Name TokenPasswordName `json:"name,omitempty"` } @@ -2119,8 +2119,8 @@ type ScopeMapProperties struct { // 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 + // E.g. repositories/repository-name/content/read, + // repositories/repository-name/metadata/write Actions *[]string `json:"actions,omitempty"` } @@ -2554,7 +2554,7 @@ type TokenPassword struct { 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 - The password name "password1" or "password2". Possible values include: 'TokenPasswordNamePassword1', 'TokenPasswordNamePassword2' Name TokenPasswordName `json:"name,omitempty"` // Value - READ-ONLY; The password value. Value *string `json:"value,omitempty"` diff --git a/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/scopemaps.go b/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/scopemaps.go index 90bd1a9ff108..0872a95f4632 100644 --- a/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/scopemaps.go +++ b/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/scopemaps.go @@ -68,7 +68,7 @@ func (client ScopeMapsClient) Create(ctx context.Context, resourceGroupName stri {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}}}, + {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 { @@ -166,7 +166,7 @@ func (client ScopeMapsClient) Delete(ctx context.Context, resourceGroupName stri {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 { + {Target: "scopeMapName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9-_]*$`, Chain: nil}}}}); err != nil { return result, validation.NewError("containerregistry.ScopeMapsClient", "Delete", err.Error()) } @@ -258,7 +258,7 @@ func (client ScopeMapsClient) Get(ctx context.Context, resourceGroupName string, {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 { + {Target: "scopeMapName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9-_]*$`, Chain: nil}}}}); err != nil { return result, validation.NewError("containerregistry.ScopeMapsClient", "Get", err.Error()) } @@ -477,7 +477,7 @@ func (client ScopeMapsClient) Update(ctx context.Context, resourceGroupName stri {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 { + {Target: "scopeMapName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9-_]*$`, Chain: nil}}}}); err != nil { return result, validation.NewError("containerregistry.ScopeMapsClient", "Update", err.Error()) } 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 4a08cf77c1a5..2985cd7f36d1 100644 --- a/services/containerregistry/mgmt/2019-06-01-preview/containerregistry/models.go +++ b/services/containerregistry/mgmt/2019-06-01-preview/containerregistry/models.go @@ -1734,7 +1734,7 @@ type GenerateCredentialsParameters struct { 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 - Specifies name of the password which should be regenerated if any -- password1 or password2. Possible values include: 'TokenPasswordNamePassword1', 'TokenPasswordNamePassword2' Name TokenPasswordName `json:"name,omitempty"` } @@ -3854,8 +3854,8 @@ type ScopeMapProperties struct { // 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 + // E.g. repositories/repository-name/content/read, + // repositories/repository-name/metadata/write Actions *[]string `json:"actions,omitempty"` } @@ -5313,7 +5313,7 @@ type TokenPassword struct { 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 - The password name "password1" or "password2". Possible values include: 'TokenPasswordNamePassword1', 'TokenPasswordNamePassword2' Name TokenPasswordName `json:"name,omitempty"` // Value - READ-ONLY; The password value. Value *string `json:"value,omitempty"` diff --git a/services/containerregistry/mgmt/2019-06-01-preview/containerregistry/scopemaps.go b/services/containerregistry/mgmt/2019-06-01-preview/containerregistry/scopemaps.go index 90bd1a9ff108..0872a95f4632 100644 --- a/services/containerregistry/mgmt/2019-06-01-preview/containerregistry/scopemaps.go +++ b/services/containerregistry/mgmt/2019-06-01-preview/containerregistry/scopemaps.go @@ -68,7 +68,7 @@ func (client ScopeMapsClient) Create(ctx context.Context, resourceGroupName stri {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}}}, + {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 { @@ -166,7 +166,7 @@ func (client ScopeMapsClient) Delete(ctx context.Context, resourceGroupName stri {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 { + {Target: "scopeMapName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9-_]*$`, Chain: nil}}}}); err != nil { return result, validation.NewError("containerregistry.ScopeMapsClient", "Delete", err.Error()) } @@ -258,7 +258,7 @@ func (client ScopeMapsClient) Get(ctx context.Context, resourceGroupName string, {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 { + {Target: "scopeMapName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9-_]*$`, Chain: nil}}}}); err != nil { return result, validation.NewError("containerregistry.ScopeMapsClient", "Get", err.Error()) } @@ -477,7 +477,7 @@ func (client ScopeMapsClient) Update(ctx context.Context, resourceGroupName stri {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 { + {Target: "scopeMapName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9-_]*$`, Chain: nil}}}}); err != nil { return result, validation.NewError("containerregistry.ScopeMapsClient", "Update", err.Error()) } 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 73b71104a658..a8ab1592812e 100644 --- a/services/containerservice/mgmt/2019-08-01/containerservice/containerserviceapi/interfaces.go +++ b/services/containerservice/mgmt/2019-08-01/containerservice/containerserviceapi/interfaces.go @@ -66,6 +66,7 @@ type ManagedClustersClientAPI interface { ListClusterUserCredentials(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.CredentialResults, err error) ResetAADProfile(ctx context.Context, resourceGroupName string, resourceName string, parameters containerservice.ManagedClusterAADProfile) (result containerservice.ManagedClustersResetAADProfileFuture, err error) ResetServicePrincipalProfile(ctx context.Context, resourceGroupName string, resourceName string, parameters containerservice.ManagedClusterServicePrincipalProfile) (result containerservice.ManagedClustersResetServicePrincipalProfileFuture, err error) + RotateClusterCertificates(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.ManagedClustersRotateClusterCertificatesFuture, err error) UpdateTags(ctx context.Context, resourceGroupName string, resourceName string, parameters containerservice.TagsObject) (result containerservice.ManagedClustersUpdateTagsFuture, err error) } diff --git a/services/containerservice/mgmt/2019-08-01/containerservice/managedclusters.go b/services/containerservice/mgmt/2019-08-01/containerservice/managedclusters.go index fc526da89452..a58266d7e18a 100644 --- a/services/containerservice/mgmt/2019-08-01/containerservice/managedclusters.go +++ b/services/containerservice/mgmt/2019-08-01/containerservice/managedclusters.go @@ -1110,6 +1110,92 @@ func (client ManagedClustersClient) ResetServicePrincipalProfileResponder(resp * return } +// RotateClusterCertificates rotate certificates of a managed cluster. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +func (client ManagedClustersClient) RotateClusterCertificates(ctx context.Context, resourceGroupName string, resourceName string) (result ManagedClustersRotateClusterCertificatesFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.RotateClusterCertificates") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "RotateClusterCertificates", err.Error()) + } + + req, err := client.RotateClusterCertificatesPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "RotateClusterCertificates", nil, "Failure preparing request") + return + } + + result, err = client.RotateClusterCertificatesSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "RotateClusterCertificates", result.Response(), "Failure sending request") + return + } + + return +} + +// RotateClusterCertificatesPreparer prepares the RotateClusterCertificates request. +func (client ManagedClustersClient) RotateClusterCertificatesPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RotateClusterCertificatesSender sends the RotateClusterCertificates request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) RotateClusterCertificatesSender(req *http.Request) (future ManagedClustersRotateClusterCertificatesFuture, err error) { + 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 +} + +// RotateClusterCertificatesResponder handles the response to the RotateClusterCertificates request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) RotateClusterCertificatesResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + // UpdateTags updates a managed cluster with the specified tags. // Parameters: // resourceGroupName - the name of the resource group. diff --git a/services/containerservice/mgmt/2019-08-01/containerservice/models.go b/services/containerservice/mgmt/2019-08-01/containerservice/models.go index 8e06f1fad5c4..15181f4b7344 100644 --- a/services/containerservice/mgmt/2019-08-01/containerservice/models.go +++ b/services/containerservice/mgmt/2019-08-01/containerservice/models.go @@ -2226,6 +2226,29 @@ func (future *ManagedClustersResetServicePrincipalProfileFuture) Result(client M return } +// ManagedClustersRotateClusterCertificatesFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ManagedClustersRotateClusterCertificatesFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ManagedClustersRotateClusterCertificatesFuture) Result(client ManagedClustersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersRotateClusterCertificatesFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersRotateClusterCertificatesFuture") + return + } + ar.Response = future.Response() + return +} + // ManagedClustersUpdateTagsFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type ManagedClustersUpdateTagsFuture struct { diff --git a/services/containerservice/mgmt/2019-10-01/containerservice/agentpools.go b/services/containerservice/mgmt/2019-10-01/containerservice/agentpools.go new file mode 100644 index 000000000000..71b35f7d9603 --- /dev/null +++ b/services/containerservice/mgmt/2019-10-01/containerservice/agentpools.go @@ -0,0 +1,621 @@ +package containerservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// AgentPoolsClient is the the Container Service Client. +type AgentPoolsClient struct { + BaseClient +} + +// NewAgentPoolsClient creates an instance of the AgentPoolsClient client. +func NewAgentPoolsClient(subscriptionID string) AgentPoolsClient { + return NewAgentPoolsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAgentPoolsClientWithBaseURI creates an instance of the AgentPoolsClient client. +func NewAgentPoolsClientWithBaseURI(baseURI string, subscriptionID string) AgentPoolsClient { + return AgentPoolsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates an agent pool in the specified managed cluster. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +// agentPoolName - the name of the agent pool. +// parameters - parameters supplied to the Create or Update an agent pool operation. +func (client AgentPoolsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, parameters AgentPool) (result AgentPoolsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.ManagedClusterAgentPoolProfileProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterAgentPoolProfileProperties.Count", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterAgentPoolProfileProperties.Count", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, + {Target: "parameters.ManagedClusterAgentPoolProfileProperties.Count", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("containerservice.AgentPoolsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceName, agentPoolName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client AgentPoolsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, parameters AgentPool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "agentPoolName": autorest.Encode("path", agentPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client AgentPoolsClient) CreateOrUpdateSender(req *http.Request) (future AgentPoolsCreateOrUpdateFuture, err error) { + 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 AgentPoolsClient) CreateOrUpdateResponder(resp *http.Response) (result AgentPool, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the agent pool in the specified managed cluster. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +// agentPoolName - the name of the agent pool. +func (client AgentPoolsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (result AgentPoolsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolsClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.AgentPoolsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName, agentPoolName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client AgentPoolsClient) DeletePreparer(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "agentPoolName": autorest.Encode("path", agentPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client AgentPoolsClient) DeleteSender(req *http.Request) (future AgentPoolsDeleteFuture, err error) { + 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 AgentPoolsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of the agent pool by managed cluster and resource group. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +// agentPoolName - the name of the agent pool. +func (client AgentPoolsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (result AgentPool, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.AgentPoolsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName, agentPoolName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client AgentPoolsClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "agentPoolName": autorest.Encode("path", agentPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client AgentPoolsClient) GetSender(req *http.Request) (*http.Response, error) { + 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 AgentPoolsClient) GetResponder(resp *http.Response) (result AgentPool, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetAvailableAgentPoolVersions gets a list of supported versions for the specified agent pool. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +func (client AgentPoolsClient) GetAvailableAgentPoolVersions(ctx context.Context, resourceGroupName string, resourceName string) (result AgentPoolAvailableVersions, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolsClient.GetAvailableAgentPoolVersions") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.AgentPoolsClient", "GetAvailableAgentPoolVersions", err.Error()) + } + + req, err := client.GetAvailableAgentPoolVersionsPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "GetAvailableAgentPoolVersions", nil, "Failure preparing request") + return + } + + resp, err := client.GetAvailableAgentPoolVersionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "GetAvailableAgentPoolVersions", resp, "Failure sending request") + return + } + + result, err = client.GetAvailableAgentPoolVersionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "GetAvailableAgentPoolVersions", resp, "Failure responding to request") + } + + return +} + +// GetAvailableAgentPoolVersionsPreparer prepares the GetAvailableAgentPoolVersions request. +func (client AgentPoolsClient) GetAvailableAgentPoolVersionsPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetAvailableAgentPoolVersionsSender sends the GetAvailableAgentPoolVersions request. The method will close the +// http.Response Body if it receives an error. +func (client AgentPoolsClient) GetAvailableAgentPoolVersionsSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetAvailableAgentPoolVersionsResponder handles the response to the GetAvailableAgentPoolVersions request. The method always +// closes the http.Response Body. +func (client AgentPoolsClient) GetAvailableAgentPoolVersionsResponder(resp *http.Response) (result AgentPoolAvailableVersions, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetUpgradeProfile gets the details of the upgrade profile for an agent pool with a specified resource group and +// managed cluster name. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +// agentPoolName - the name of the agent pool. +func (client AgentPoolsClient) GetUpgradeProfile(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (result AgentPoolUpgradeProfile, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolsClient.GetUpgradeProfile") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.AgentPoolsClient", "GetUpgradeProfile", err.Error()) + } + + req, err := client.GetUpgradeProfilePreparer(ctx, resourceGroupName, resourceName, agentPoolName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "GetUpgradeProfile", nil, "Failure preparing request") + return + } + + resp, err := client.GetUpgradeProfileSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "GetUpgradeProfile", resp, "Failure sending request") + return + } + + result, err = client.GetUpgradeProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "GetUpgradeProfile", resp, "Failure responding to request") + } + + return +} + +// GetUpgradeProfilePreparer prepares the GetUpgradeProfile request. +func (client AgentPoolsClient) GetUpgradeProfilePreparer(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "agentPoolName": autorest.Encode("path", agentPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetUpgradeProfileSender sends the GetUpgradeProfile request. The method will close the +// http.Response Body if it receives an error. +func (client AgentPoolsClient) GetUpgradeProfileSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetUpgradeProfileResponder handles the response to the GetUpgradeProfile request. The method always +// closes the http.Response Body. +func (client AgentPoolsClient) GetUpgradeProfileResponder(resp *http.Response) (result AgentPoolUpgradeProfile, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets a list of agent pools in the specified managed cluster. The operation returns properties of each agent +// pool. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +func (client AgentPoolsClient) List(ctx context.Context, resourceGroupName string, resourceName string) (result AgentPoolListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolsClient.List") + defer func() { + sc := -1 + if result.aplr.Response.Response != nil { + sc = result.aplr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.AgentPoolsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.aplr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "List", resp, "Failure sending request") + return + } + + result.aplr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client AgentPoolsClient) ListPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client AgentPoolsClient) ListSender(req *http.Request) (*http.Response, error) { + 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 AgentPoolsClient) ListResponder(resp *http.Response) (result AgentPoolListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client AgentPoolsClient) listNextResults(ctx context.Context, lastResults AgentPoolListResult) (result AgentPoolListResult, err error) { + req, err := lastResults.agentPoolListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client AgentPoolsClient) ListComplete(ctx context.Context, resourceGroupName string, resourceName string) (result AgentPoolListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, resourceName) + return +} diff --git a/services/containerservice/mgmt/2019-10-01/containerservice/client.go b/services/containerservice/mgmt/2019-10-01/containerservice/client.go new file mode 100644 index 000000000000..09a36def717c --- /dev/null +++ b/services/containerservice/mgmt/2019-10-01/containerservice/client.go @@ -0,0 +1,51 @@ +// Package containerservice implements the Azure ARM Containerservice service API version . +// +// The Container Service Client. +package containerservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Containerservice + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Containerservice. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the BaseClient client. +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} diff --git a/services/containerservice/mgmt/2019-10-01/containerservice/containerserviceapi/interfaces.go b/services/containerservice/mgmt/2019-10-01/containerservice/containerserviceapi/interfaces.go new file mode 100644 index 000000000000..833bc9ff4ff4 --- /dev/null +++ b/services/containerservice/mgmt/2019-10-01/containerservice/containerserviceapi/interfaces.go @@ -0,0 +1,85 @@ +package containerserviceapi + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-10-01/containerservice" +) + +// OpenShiftManagedClustersClientAPI contains the set of methods on the OpenShiftManagedClustersClient type. +type OpenShiftManagedClustersClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters containerservice.OpenShiftManagedCluster) (result containerservice.OpenShiftManagedClustersCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.OpenShiftManagedClustersDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.OpenShiftManagedCluster, err error) + List(ctx context.Context) (result containerservice.OpenShiftManagedClusterListResultPage, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result containerservice.OpenShiftManagedClusterListResultPage, err error) + UpdateTags(ctx context.Context, resourceGroupName string, resourceName string, parameters containerservice.TagsObject) (result containerservice.OpenShiftManagedClustersUpdateTagsFuture, err error) +} + +var _ OpenShiftManagedClustersClientAPI = (*containerservice.OpenShiftManagedClustersClient)(nil) + +// ContainerServicesClientAPI contains the set of methods on the ContainerServicesClient type. +type ContainerServicesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, containerServiceName string, parameters containerservice.ContainerService) (result containerservice.ContainerServicesCreateOrUpdateFutureType, err error) + Delete(ctx context.Context, resourceGroupName string, containerServiceName string) (result containerservice.ContainerServicesDeleteFutureType, err error) + Get(ctx context.Context, resourceGroupName string, containerServiceName string) (result containerservice.ContainerService, err error) + List(ctx context.Context) (result containerservice.ListResultPage, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result containerservice.ListResultPage, err error) + ListOrchestrators(ctx context.Context, location string, resourceType string) (result containerservice.OrchestratorVersionProfileListResult, err error) +} + +var _ ContainerServicesClientAPI = (*containerservice.ContainerServicesClient)(nil) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result containerservice.OperationListResult, err error) +} + +var _ OperationsClientAPI = (*containerservice.OperationsClient)(nil) + +// ManagedClustersClientAPI contains the set of methods on the ManagedClustersClient type. +type ManagedClustersClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters containerservice.ManagedCluster) (result containerservice.ManagedClustersCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.ManagedClustersDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.ManagedCluster, err error) + GetAccessProfile(ctx context.Context, resourceGroupName string, resourceName string, roleName string) (result containerservice.ManagedClusterAccessProfile, err error) + GetUpgradeProfile(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.ManagedClusterUpgradeProfile, err error) + List(ctx context.Context) (result containerservice.ManagedClusterListResultPage, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result containerservice.ManagedClusterListResultPage, err error) + ListClusterAdminCredentials(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.CredentialResults, err error) + ListClusterUserCredentials(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.CredentialResults, err error) + ResetAADProfile(ctx context.Context, resourceGroupName string, resourceName string, parameters containerservice.ManagedClusterAADProfile) (result containerservice.ManagedClustersResetAADProfileFuture, err error) + ResetServicePrincipalProfile(ctx context.Context, resourceGroupName string, resourceName string, parameters containerservice.ManagedClusterServicePrincipalProfile) (result containerservice.ManagedClustersResetServicePrincipalProfileFuture, err error) + RotateClusterCertificates(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.ManagedClustersRotateClusterCertificatesFuture, err error) + UpdateTags(ctx context.Context, resourceGroupName string, resourceName string, parameters containerservice.TagsObject) (result containerservice.ManagedClustersUpdateTagsFuture, err error) +} + +var _ ManagedClustersClientAPI = (*containerservice.ManagedClustersClient)(nil) + +// AgentPoolsClientAPI contains the set of methods on the AgentPoolsClient type. +type AgentPoolsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, parameters containerservice.AgentPool) (result containerservice.AgentPoolsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (result containerservice.AgentPoolsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (result containerservice.AgentPool, err error) + GetAvailableAgentPoolVersions(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.AgentPoolAvailableVersions, err error) + GetUpgradeProfile(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (result containerservice.AgentPoolUpgradeProfile, err error) + List(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.AgentPoolListResultPage, err error) +} + +var _ AgentPoolsClientAPI = (*containerservice.AgentPoolsClient)(nil) diff --git a/services/containerservice/mgmt/2019-10-01/containerservice/containerservices.go b/services/containerservice/mgmt/2019-10-01/containerservice/containerservices.go new file mode 100644 index 000000000000..1bd2a37eec45 --- /dev/null +++ b/services/containerservice/mgmt/2019-10-01/containerservice/containerservices.go @@ -0,0 +1,622 @@ +package containerservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ContainerServicesClient is the the Container Service Client. +type ContainerServicesClient struct { + BaseClient +} + +// NewContainerServicesClient creates an instance of the ContainerServicesClient client. +func NewContainerServicesClient(subscriptionID string) ContainerServicesClient { + return NewContainerServicesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewContainerServicesClientWithBaseURI creates an instance of the ContainerServicesClient client. +func NewContainerServicesClientWithBaseURI(baseURI string, subscriptionID string) ContainerServicesClient { + return ContainerServicesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a container service with the specified configuration of orchestrator, masters, and +// agents. +// Parameters: +// resourceGroupName - the name of the resource group. +// containerServiceName - the name of the container service in the specified subscription and resource group. +// parameters - parameters supplied to the Create or Update a Container Service operation. +func (client ContainerServicesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, containerServiceName string, parameters ContainerService) (result ContainerServicesCreateOrUpdateFutureType, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Properties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Properties.OrchestratorProfile", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.Properties.CustomProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Properties.CustomProfile.Orchestrator", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.Properties.ServicePrincipalProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Properties.ServicePrincipalProfile.ClientID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.Properties.ServicePrincipalProfile.KeyVaultSecretRef", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Properties.ServicePrincipalProfile.KeyVaultSecretRef.VaultID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.Properties.ServicePrincipalProfile.KeyVaultSecretRef.SecretName", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + {Target: "parameters.Properties.MasterProfile", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Properties.MasterProfile.DNSPrefix", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.Properties.WindowsProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Properties.WindowsProfile.AdminUsername", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Properties.WindowsProfile.AdminUsername", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([._]?[a-zA-Z0-9]+)*$`, Chain: nil}}}, + {Target: "parameters.Properties.WindowsProfile.AdminPassword", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "parameters.Properties.LinuxProfile", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Properties.LinuxProfile.AdminUsername", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Properties.LinuxProfile.AdminUsername", Name: validation.Pattern, Rule: `^[A-Za-z][-A-Za-z0-9_]*$`, Chain: nil}}}, + {Target: "parameters.Properties.LinuxProfile.SSH", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Properties.LinuxProfile.SSH.PublicKeys", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + {Target: "parameters.Properties.DiagnosticsProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Properties.DiagnosticsProfile.VMDiagnostics", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Properties.DiagnosticsProfile.VMDiagnostics.Enabled", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + }}}}}); err != nil { + return result, validation.NewError("containerservice.ContainerServicesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, containerServiceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ContainerServicesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, containerServiceName string, parameters ContainerService) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerServiceName": autorest.Encode("path", containerServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerServicesClient) CreateOrUpdateSender(req *http.Request) (future ContainerServicesCreateOrUpdateFutureType, err error) { + 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 ContainerServicesClient) CreateOrUpdateResponder(resp *http.Response) (result ContainerService, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the specified container service in the specified subscription and resource group. The operation does +// not delete other resources created as part of creating a container service, including storage accounts, VMs, and +// availability sets. All the other resources created with the container service are part of the same resource group +// and can be deleted individually. +// Parameters: +// resourceGroupName - the name of the resource group. +// containerServiceName - the name of the container service in the specified subscription and resource group. +func (client ContainerServicesClient) Delete(ctx context.Context, resourceGroupName string, containerServiceName string) (result ContainerServicesDeleteFutureType, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, containerServiceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ContainerServicesClient) DeletePreparer(ctx context.Context, resourceGroupName string, containerServiceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerServiceName": autorest.Encode("path", containerServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerServicesClient) DeleteSender(req *http.Request) (future ContainerServicesDeleteFutureType, err error) { + 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 ContainerServicesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the properties of the specified container service in the specified subscription and resource group. The +// operation returns the properties including state, orchestrator, number of masters and agents, and FQDNs of masters +// and agents. +// Parameters: +// resourceGroupName - the name of the resource group. +// containerServiceName - the name of the container service in the specified subscription and resource group. +func (client ContainerServicesClient) Get(ctx context.Context, resourceGroupName string, containerServiceName string) (result ContainerService, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, containerServiceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ContainerServicesClient) GetPreparer(ctx context.Context, resourceGroupName string, containerServiceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerServiceName": autorest.Encode("path", containerServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerServicesClient) GetSender(req *http.Request) (*http.Response, error) { + 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 ContainerServicesClient) GetResponder(resp *http.Response) (result ContainerService, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets a list of container services in the specified subscription. The operation returns properties of each +// container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. +func (client ContainerServicesClient) List(ctx context.Context) (result ListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.List") + defer func() { + sc := -1 + if result.lr.Response.Response != nil { + sc = result.lr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.lr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "List", resp, "Failure sending request") + return + } + + result.lr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ContainerServicesClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/containerServices", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerServicesClient) ListSender(req *http.Request) (*http.Response, error) { + 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 ContainerServicesClient) ListResponder(resp *http.Response) (result ListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ContainerServicesClient) listNextResults(ctx context.Context, lastResults ListResult) (result ListResult, err error) { + req, err := lastResults.listResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ContainerServicesClient) ListComplete(ctx context.Context) (result ListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByResourceGroup gets a list of container services in the specified subscription and resource group. The +// operation returns properties of each container service including state, orchestrator, number of masters and agents, +// and FQDNs of masters and agents. +// Parameters: +// resourceGroupName - the name of the resource group. +func (client ContainerServicesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.lr.Response.Response != nil { + sc = result.lr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.lr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.lr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client ContainerServicesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerServicesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + 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 ContainerServicesClient) ListByResourceGroupResponder(resp *http.Response) (result ListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client ContainerServicesClient) listByResourceGroupNextResults(ctx context.Context, lastResults ListResult) (result ListResult, err error) { + req, err := lastResults.listResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client ContainerServicesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// ListOrchestrators gets a list of supported orchestrators in the specified subscription. The operation returns +// properties of each orchestrator including version, available upgrades and whether that version or upgrades are in +// preview. +// Parameters: +// location - the name of a supported Azure region. +// resourceType - resource type for which the list of orchestrators needs to be returned +func (client ContainerServicesClient) ListOrchestrators(ctx context.Context, location string, resourceType string) (result OrchestratorVersionProfileListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.ListOrchestrators") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListOrchestratorsPreparer(ctx, location, resourceType) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "ListOrchestrators", nil, "Failure preparing request") + return + } + + resp, err := client.ListOrchestratorsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "ListOrchestrators", resp, "Failure sending request") + return + } + + result, err = client.ListOrchestratorsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "ListOrchestrators", resp, "Failure responding to request") + } + + return +} + +// ListOrchestratorsPreparer prepares the ListOrchestrators request. +func (client ContainerServicesClient) ListOrchestratorsPreparer(ctx context.Context, location string, resourceType string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(resourceType) > 0 { + queryParameters["resource-type"] = autorest.Encode("query", resourceType) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/orchestrators", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListOrchestratorsSender sends the ListOrchestrators request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerServicesClient) ListOrchestratorsSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListOrchestratorsResponder handles the response to the ListOrchestrators request. The method always +// closes the http.Response Body. +func (client ContainerServicesClient) ListOrchestratorsResponder(resp *http.Response) (result OrchestratorVersionProfileListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/containerservice/mgmt/2019-10-01/containerservice/managedclusters.go b/services/containerservice/mgmt/2019-10-01/containerservice/managedclusters.go new file mode 100644 index 000000000000..46ea1d25531b --- /dev/null +++ b/services/containerservice/mgmt/2019-10-01/containerservice/managedclusters.go @@ -0,0 +1,1287 @@ +package containerservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ManagedClustersClient is the the Container Service Client. +type ManagedClustersClient struct { + BaseClient +} + +// NewManagedClustersClient creates an instance of the ManagedClustersClient client. +func NewManagedClustersClient(subscriptionID string) ManagedClustersClient { + return NewManagedClustersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewManagedClustersClientWithBaseURI creates an instance of the ManagedClustersClient client. +func NewManagedClustersClientWithBaseURI(baseURI string, subscriptionID string) ManagedClustersClient { + return ManagedClustersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a managed cluster with the specified configuration for agents and Kubernetes +// version. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +// parameters - parameters supplied to the Create or Update a Managed Cluster operation. +func (client ManagedClustersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedCluster) (result ManagedClustersCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.ManagedClusterProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.LinuxProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.LinuxProfile.AdminUsername", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.LinuxProfile.AdminUsername", Name: validation.Pattern, Rule: `^[A-Za-z][-A-Za-z0-9_]*$`, Chain: nil}}}, + {Target: "parameters.ManagedClusterProperties.LinuxProfile.SSH", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.LinuxProfile.SSH.PublicKeys", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + {Target: "parameters.ManagedClusterProperties.WindowsProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.WindowsProfile.AdminUsername", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.WindowsProfile.AdminUsername", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([._]?[a-zA-Z0-9]+)*$`, Chain: nil}}}, + }}, + {Target: "parameters.ManagedClusterProperties.ServicePrincipalProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.ServicePrincipalProfile.ClientID", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.PodCidr", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.PodCidr", Name: validation.Pattern, Rule: `^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$`, Chain: nil}}}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.ServiceCidr", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.ServiceCidr", Name: validation.Pattern, Rule: `^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$`, Chain: nil}}}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.DNSServiceIP", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.DNSServiceIP", Name: validation.Pattern, Rule: `^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$`, Chain: nil}}}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.DockerBridgeCidr", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.DockerBridgeCidr", Name: validation.Pattern, Rule: `^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$`, Chain: nil}}}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile.ManagedOutboundIPs", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile.ManagedOutboundIPs.Count", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile.ManagedOutboundIPs.Count", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile.ManagedOutboundIPs.Count", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}, + }}, + }}, + }}, + {Target: "parameters.ManagedClusterProperties.AadProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.AadProfile.ClientAppID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ManagedClusterProperties.AadProfile.ServerAppID", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ManagedClustersClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedCluster) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) CreateOrUpdateSender(req *http.Request) (future ManagedClustersCreateOrUpdateFuture, err error) { + 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 ManagedClustersClient) CreateOrUpdateResponder(resp *http.Response) (result ManagedCluster, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the managed cluster with a specified resource group and name. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +func (client ManagedClustersClient) Delete(ctx context.Context, resourceGroupName string, resourceName string) (result ManagedClustersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ManagedClustersClient) DeletePreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) DeleteSender(req *http.Request) (future ManagedClustersDeleteFuture, err error) { + 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 ManagedClustersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of the managed cluster with a specified resource group and name. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +func (client ManagedClustersClient) Get(ctx context.Context, resourceGroupName string, resourceName string) (result ManagedCluster, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ManagedClustersClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) GetSender(req *http.Request) (*http.Response, error) { + 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 ManagedClustersClient) GetResponder(resp *http.Response) (result ManagedCluster, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetAccessProfile gets the accessProfile for the specified role name of the managed cluster with a specified resource +// group and name. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +// roleName - the name of the role for managed cluster accessProfile resource. +func (client ManagedClustersClient) GetAccessProfile(ctx context.Context, resourceGroupName string, resourceName string, roleName string) (result ManagedClusterAccessProfile, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.GetAccessProfile") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "GetAccessProfile", err.Error()) + } + + req, err := client.GetAccessProfilePreparer(ctx, resourceGroupName, resourceName, roleName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "GetAccessProfile", nil, "Failure preparing request") + return + } + + resp, err := client.GetAccessProfileSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "GetAccessProfile", resp, "Failure sending request") + return + } + + result, err = client.GetAccessProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "GetAccessProfile", resp, "Failure responding to request") + } + + return +} + +// GetAccessProfilePreparer prepares the GetAccessProfile request. +func (client ManagedClustersClient) GetAccessProfilePreparer(ctx context.Context, resourceGroupName string, resourceName string, roleName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "roleName": autorest.Encode("path", roleName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetAccessProfileSender sends the GetAccessProfile request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) GetAccessProfileSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetAccessProfileResponder handles the response to the GetAccessProfile request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) GetAccessProfileResponder(resp *http.Response) (result ManagedClusterAccessProfile, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetUpgradeProfile gets the details of the upgrade profile for a managed cluster with a specified resource group and +// name. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +func (client ManagedClustersClient) GetUpgradeProfile(ctx context.Context, resourceGroupName string, resourceName string) (result ManagedClusterUpgradeProfile, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.GetUpgradeProfile") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "GetUpgradeProfile", err.Error()) + } + + req, err := client.GetUpgradeProfilePreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "GetUpgradeProfile", nil, "Failure preparing request") + return + } + + resp, err := client.GetUpgradeProfileSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "GetUpgradeProfile", resp, "Failure sending request") + return + } + + result, err = client.GetUpgradeProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "GetUpgradeProfile", resp, "Failure responding to request") + } + + return +} + +// GetUpgradeProfilePreparer prepares the GetUpgradeProfile request. +func (client ManagedClustersClient) GetUpgradeProfilePreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetUpgradeProfileSender sends the GetUpgradeProfile request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) GetUpgradeProfileSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetUpgradeProfileResponder handles the response to the GetUpgradeProfile request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) GetUpgradeProfileResponder(resp *http.Response) (result ManagedClusterUpgradeProfile, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets a list of managed clusters in the specified subscription. The operation returns properties of each managed +// cluster. +func (client ManagedClustersClient) List(ctx context.Context) (result ManagedClusterListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.List") + defer func() { + sc := -1 + if result.mclr.Response.Response != nil { + sc = result.mclr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.mclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "List", resp, "Failure sending request") + return + } + + result.mclr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ManagedClustersClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) ListSender(req *http.Request) (*http.Response, error) { + 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 ManagedClustersClient) ListResponder(resp *http.Response) (result ManagedClusterListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ManagedClustersClient) listNextResults(ctx context.Context, lastResults ManagedClusterListResult) (result ManagedClusterListResult, err error) { + req, err := lastResults.managedClusterListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ManagedClustersClient) ListComplete(ctx context.Context) (result ManagedClusterListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByResourceGroup lists managed clusters in the specified subscription and resource group. The operation returns +// properties of each managed cluster. +// Parameters: +// resourceGroupName - the name of the resource group. +func (client ManagedClustersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ManagedClusterListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.mclr.Response.Response != nil { + sc = result.mclr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.mclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.mclr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client ManagedClustersClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + 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 ManagedClustersClient) ListByResourceGroupResponder(resp *http.Response) (result ManagedClusterListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client ManagedClustersClient) listByResourceGroupNextResults(ctx context.Context, lastResults ManagedClusterListResult) (result ManagedClusterListResult, err error) { + req, err := lastResults.managedClusterListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client ManagedClustersClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ManagedClusterListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// ListClusterAdminCredentials gets cluster admin credential of the managed cluster with a specified resource group and +// name. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +func (client ManagedClustersClient) ListClusterAdminCredentials(ctx context.Context, resourceGroupName string, resourceName string) (result CredentialResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.ListClusterAdminCredentials") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "ListClusterAdminCredentials", err.Error()) + } + + req, err := client.ListClusterAdminCredentialsPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListClusterAdminCredentials", nil, "Failure preparing request") + return + } + + resp, err := client.ListClusterAdminCredentialsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListClusterAdminCredentials", resp, "Failure sending request") + return + } + + result, err = client.ListClusterAdminCredentialsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListClusterAdminCredentials", resp, "Failure responding to request") + } + + return +} + +// ListClusterAdminCredentialsPreparer prepares the ListClusterAdminCredentials request. +func (client ManagedClustersClient) ListClusterAdminCredentialsPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListClusterAdminCredentialsSender sends the ListClusterAdminCredentials request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) ListClusterAdminCredentialsSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListClusterAdminCredentialsResponder handles the response to the ListClusterAdminCredentials request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) ListClusterAdminCredentialsResponder(resp *http.Response) (result CredentialResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListClusterUserCredentials gets cluster user credential of the managed cluster with a specified resource group and +// name. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +func (client ManagedClustersClient) ListClusterUserCredentials(ctx context.Context, resourceGroupName string, resourceName string) (result CredentialResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.ListClusterUserCredentials") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "ListClusterUserCredentials", err.Error()) + } + + req, err := client.ListClusterUserCredentialsPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListClusterUserCredentials", nil, "Failure preparing request") + return + } + + resp, err := client.ListClusterUserCredentialsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListClusterUserCredentials", resp, "Failure sending request") + return + } + + result, err = client.ListClusterUserCredentialsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListClusterUserCredentials", resp, "Failure responding to request") + } + + return +} + +// ListClusterUserCredentialsPreparer prepares the ListClusterUserCredentials request. +func (client ManagedClustersClient) ListClusterUserCredentialsPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListClusterUserCredentialsSender sends the ListClusterUserCredentials request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) ListClusterUserCredentialsSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListClusterUserCredentialsResponder handles the response to the ListClusterUserCredentials request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) ListClusterUserCredentialsResponder(resp *http.Response) (result CredentialResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ResetAADProfile update the AAD Profile for a managed cluster. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +// parameters - parameters supplied to the Reset AAD Profile operation for a Managed Cluster. +func (client ManagedClustersClient) ResetAADProfile(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedClusterAADProfile) (result ManagedClustersResetAADProfileFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.ResetAADProfile") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.ClientAppID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ServerAppID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "ResetAADProfile", err.Error()) + } + + req, err := client.ResetAADProfilePreparer(ctx, resourceGroupName, resourceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ResetAADProfile", nil, "Failure preparing request") + return + } + + result, err = client.ResetAADProfileSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ResetAADProfile", result.Response(), "Failure sending request") + return + } + + return +} + +// ResetAADProfilePreparer prepares the ResetAADProfile request. +func (client ManagedClustersClient) ResetAADProfilePreparer(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedClusterAADProfile) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResetAADProfileSender sends the ResetAADProfile request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) ResetAADProfileSender(req *http.Request) (future ManagedClustersResetAADProfileFuture, err error) { + 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 +} + +// ResetAADProfileResponder handles the response to the ResetAADProfile request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) ResetAADProfileResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// ResetServicePrincipalProfile update the service principal Profile for a managed cluster. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +// parameters - parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. +func (client ManagedClustersClient) ResetServicePrincipalProfile(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedClusterServicePrincipalProfile) (result ManagedClustersResetServicePrincipalProfileFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.ResetServicePrincipalProfile") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.ClientID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "ResetServicePrincipalProfile", err.Error()) + } + + req, err := client.ResetServicePrincipalProfilePreparer(ctx, resourceGroupName, resourceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ResetServicePrincipalProfile", nil, "Failure preparing request") + return + } + + result, err = client.ResetServicePrincipalProfileSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ResetServicePrincipalProfile", result.Response(), "Failure sending request") + return + } + + return +} + +// ResetServicePrincipalProfilePreparer prepares the ResetServicePrincipalProfile request. +func (client ManagedClustersClient) ResetServicePrincipalProfilePreparer(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedClusterServicePrincipalProfile) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResetServicePrincipalProfileSender sends the ResetServicePrincipalProfile request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) ResetServicePrincipalProfileSender(req *http.Request) (future ManagedClustersResetServicePrincipalProfileFuture, err error) { + 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 +} + +// ResetServicePrincipalProfileResponder handles the response to the ResetServicePrincipalProfile request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) ResetServicePrincipalProfileResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// RotateClusterCertificates rotate certificates of a managed cluster. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +func (client ManagedClustersClient) RotateClusterCertificates(ctx context.Context, resourceGroupName string, resourceName string) (result ManagedClustersRotateClusterCertificatesFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.RotateClusterCertificates") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "RotateClusterCertificates", err.Error()) + } + + req, err := client.RotateClusterCertificatesPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "RotateClusterCertificates", nil, "Failure preparing request") + return + } + + result, err = client.RotateClusterCertificatesSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "RotateClusterCertificates", result.Response(), "Failure sending request") + return + } + + return +} + +// RotateClusterCertificatesPreparer prepares the RotateClusterCertificates request. +func (client ManagedClustersClient) RotateClusterCertificatesPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RotateClusterCertificatesSender sends the RotateClusterCertificates request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) RotateClusterCertificatesSender(req *http.Request) (future ManagedClustersRotateClusterCertificatesFuture, err error) { + 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 +} + +// RotateClusterCertificatesResponder handles the response to the RotateClusterCertificates request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) RotateClusterCertificatesResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// UpdateTags updates a managed cluster with the specified tags. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +// parameters - parameters supplied to the Update Managed Cluster Tags operation. +func (client ManagedClustersClient) UpdateTags(ctx context.Context, resourceGroupName string, resourceName string, parameters TagsObject) (result ManagedClustersUpdateTagsFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.UpdateTags") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "UpdateTags", err.Error()) + } + + req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, resourceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "UpdateTags", nil, "Failure preparing request") + return + } + + result, err = client.UpdateTagsSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "UpdateTags", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateTagsPreparer prepares the UpdateTags request. +func (client ManagedClustersClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, resourceName string, parameters TagsObject) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateTagsSender sends the UpdateTags request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) UpdateTagsSender(req *http.Request) (future ManagedClustersUpdateTagsFuture, err error) { + 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 +} + +// UpdateTagsResponder handles the response to the UpdateTags request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) UpdateTagsResponder(resp *http.Response) (result ManagedCluster, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/containerservice/mgmt/2019-10-01/containerservice/models.go b/services/containerservice/mgmt/2019-10-01/containerservice/models.go new file mode 100644 index 000000000000..5396d66d0e72 --- /dev/null +++ b/services/containerservice/mgmt/2019-10-01/containerservice/models.go @@ -0,0 +1,3322 @@ +package containerservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-10-01/containerservice" + +// AgentPoolType enumerates the values for agent pool type. +type AgentPoolType string + +const ( + // AvailabilitySet ... + AvailabilitySet AgentPoolType = "AvailabilitySet" + // VirtualMachineScaleSets ... + VirtualMachineScaleSets AgentPoolType = "VirtualMachineScaleSets" +) + +// PossibleAgentPoolTypeValues returns an array of possible values for the AgentPoolType const type. +func PossibleAgentPoolTypeValues() []AgentPoolType { + return []AgentPoolType{AvailabilitySet, VirtualMachineScaleSets} +} + +// Kind enumerates the values for kind. +type Kind string + +const ( + // KindAADIdentityProvider ... + KindAADIdentityProvider Kind = "AADIdentityProvider" + // KindOpenShiftManagedClusterBaseIdentityProvider ... + KindOpenShiftManagedClusterBaseIdentityProvider Kind = "OpenShiftManagedClusterBaseIdentityProvider" +) + +// PossibleKindValues returns an array of possible values for the Kind const type. +func PossibleKindValues() []Kind { + return []Kind{KindAADIdentityProvider, KindOpenShiftManagedClusterBaseIdentityProvider} +} + +// LoadBalancerSku enumerates the values for load balancer sku. +type LoadBalancerSku string + +const ( + // Basic ... + Basic LoadBalancerSku = "basic" + // Standard ... + Standard LoadBalancerSku = "standard" +) + +// PossibleLoadBalancerSkuValues returns an array of possible values for the LoadBalancerSku const type. +func PossibleLoadBalancerSkuValues() []LoadBalancerSku { + return []LoadBalancerSku{Basic, Standard} +} + +// NetworkPlugin enumerates the values for network plugin. +type NetworkPlugin string + +const ( + // Azure ... + Azure NetworkPlugin = "azure" + // Kubenet ... + Kubenet NetworkPlugin = "kubenet" +) + +// PossibleNetworkPluginValues returns an array of possible values for the NetworkPlugin const type. +func PossibleNetworkPluginValues() []NetworkPlugin { + return []NetworkPlugin{Azure, Kubenet} +} + +// NetworkPolicy enumerates the values for network policy. +type NetworkPolicy string + +const ( + // NetworkPolicyAzure ... + NetworkPolicyAzure NetworkPolicy = "azure" + // NetworkPolicyCalico ... + NetworkPolicyCalico NetworkPolicy = "calico" +) + +// PossibleNetworkPolicyValues returns an array of possible values for the NetworkPolicy const type. +func PossibleNetworkPolicyValues() []NetworkPolicy { + return []NetworkPolicy{NetworkPolicyAzure, NetworkPolicyCalico} +} + +// OpenShiftAgentPoolProfileRole enumerates the values for open shift agent pool profile role. +type OpenShiftAgentPoolProfileRole string + +const ( + // Compute ... + Compute OpenShiftAgentPoolProfileRole = "compute" + // Infra ... + Infra OpenShiftAgentPoolProfileRole = "infra" +) + +// PossibleOpenShiftAgentPoolProfileRoleValues returns an array of possible values for the OpenShiftAgentPoolProfileRole const type. +func PossibleOpenShiftAgentPoolProfileRoleValues() []OpenShiftAgentPoolProfileRole { + return []OpenShiftAgentPoolProfileRole{Compute, Infra} +} + +// OpenShiftContainerServiceVMSize enumerates the values for open shift container service vm size. +type OpenShiftContainerServiceVMSize string + +const ( + // StandardD16sV3 ... + StandardD16sV3 OpenShiftContainerServiceVMSize = "Standard_D16s_v3" + // StandardD2sV3 ... + StandardD2sV3 OpenShiftContainerServiceVMSize = "Standard_D2s_v3" + // StandardD32sV3 ... + StandardD32sV3 OpenShiftContainerServiceVMSize = "Standard_D32s_v3" + // StandardD4sV3 ... + StandardD4sV3 OpenShiftContainerServiceVMSize = "Standard_D4s_v3" + // StandardD64sV3 ... + StandardD64sV3 OpenShiftContainerServiceVMSize = "Standard_D64s_v3" + // StandardD8sV3 ... + StandardD8sV3 OpenShiftContainerServiceVMSize = "Standard_D8s_v3" + // StandardDS12V2 ... + StandardDS12V2 OpenShiftContainerServiceVMSize = "Standard_DS12_v2" + // StandardDS13V2 ... + StandardDS13V2 OpenShiftContainerServiceVMSize = "Standard_DS13_v2" + // StandardDS14V2 ... + StandardDS14V2 OpenShiftContainerServiceVMSize = "Standard_DS14_v2" + // StandardDS15V2 ... + StandardDS15V2 OpenShiftContainerServiceVMSize = "Standard_DS15_v2" + // StandardDS4V2 ... + StandardDS4V2 OpenShiftContainerServiceVMSize = "Standard_DS4_v2" + // StandardDS5V2 ... + StandardDS5V2 OpenShiftContainerServiceVMSize = "Standard_DS5_v2" + // StandardE16sV3 ... + StandardE16sV3 OpenShiftContainerServiceVMSize = "Standard_E16s_v3" + // StandardE20sV3 ... + StandardE20sV3 OpenShiftContainerServiceVMSize = "Standard_E20s_v3" + // StandardE32sV3 ... + StandardE32sV3 OpenShiftContainerServiceVMSize = "Standard_E32s_v3" + // StandardE4sV3 ... + StandardE4sV3 OpenShiftContainerServiceVMSize = "Standard_E4s_v3" + // StandardE64sV3 ... + StandardE64sV3 OpenShiftContainerServiceVMSize = "Standard_E64s_v3" + // StandardE8sV3 ... + StandardE8sV3 OpenShiftContainerServiceVMSize = "Standard_E8s_v3" + // StandardF16s ... + StandardF16s OpenShiftContainerServiceVMSize = "Standard_F16s" + // StandardF16sV2 ... + StandardF16sV2 OpenShiftContainerServiceVMSize = "Standard_F16s_v2" + // StandardF32sV2 ... + StandardF32sV2 OpenShiftContainerServiceVMSize = "Standard_F32s_v2" + // StandardF64sV2 ... + StandardF64sV2 OpenShiftContainerServiceVMSize = "Standard_F64s_v2" + // StandardF72sV2 ... + StandardF72sV2 OpenShiftContainerServiceVMSize = "Standard_F72s_v2" + // StandardF8s ... + StandardF8s OpenShiftContainerServiceVMSize = "Standard_F8s" + // StandardF8sV2 ... + StandardF8sV2 OpenShiftContainerServiceVMSize = "Standard_F8s_v2" + // StandardGS2 ... + StandardGS2 OpenShiftContainerServiceVMSize = "Standard_GS2" + // StandardGS3 ... + StandardGS3 OpenShiftContainerServiceVMSize = "Standard_GS3" + // StandardGS4 ... + StandardGS4 OpenShiftContainerServiceVMSize = "Standard_GS4" + // StandardGS5 ... + StandardGS5 OpenShiftContainerServiceVMSize = "Standard_GS5" + // StandardL16s ... + StandardL16s OpenShiftContainerServiceVMSize = "Standard_L16s" + // StandardL32s ... + StandardL32s OpenShiftContainerServiceVMSize = "Standard_L32s" + // StandardL4s ... + StandardL4s OpenShiftContainerServiceVMSize = "Standard_L4s" + // StandardL8s ... + StandardL8s OpenShiftContainerServiceVMSize = "Standard_L8s" +) + +// PossibleOpenShiftContainerServiceVMSizeValues returns an array of possible values for the OpenShiftContainerServiceVMSize const type. +func PossibleOpenShiftContainerServiceVMSizeValues() []OpenShiftContainerServiceVMSize { + return []OpenShiftContainerServiceVMSize{StandardD16sV3, StandardD2sV3, StandardD32sV3, StandardD4sV3, StandardD64sV3, StandardD8sV3, StandardDS12V2, StandardDS13V2, StandardDS14V2, StandardDS15V2, StandardDS4V2, StandardDS5V2, StandardE16sV3, StandardE20sV3, StandardE32sV3, StandardE4sV3, StandardE64sV3, StandardE8sV3, StandardF16s, StandardF16sV2, StandardF32sV2, StandardF64sV2, StandardF72sV2, StandardF8s, StandardF8sV2, StandardGS2, StandardGS3, StandardGS4, StandardGS5, StandardL16s, StandardL32s, StandardL4s, StandardL8s} +} + +// OrchestratorTypes enumerates the values for orchestrator types. +type OrchestratorTypes string + +const ( + // Custom ... + Custom OrchestratorTypes = "Custom" + // DCOS ... + DCOS OrchestratorTypes = "DCOS" + // DockerCE ... + DockerCE OrchestratorTypes = "DockerCE" + // Kubernetes ... + Kubernetes OrchestratorTypes = "Kubernetes" + // Swarm ... + Swarm OrchestratorTypes = "Swarm" +) + +// PossibleOrchestratorTypesValues returns an array of possible values for the OrchestratorTypes const type. +func PossibleOrchestratorTypesValues() []OrchestratorTypes { + return []OrchestratorTypes{Custom, DCOS, DockerCE, Kubernetes, Swarm} +} + +// OSType enumerates the values for os type. +type OSType string + +const ( + // Linux ... + Linux OSType = "Linux" + // Windows ... + Windows OSType = "Windows" +) + +// PossibleOSTypeValues returns an array of possible values for the OSType const type. +func PossibleOSTypeValues() []OSType { + return []OSType{Linux, Windows} +} + +// ResourceIdentityType enumerates the values for resource identity type. +type ResourceIdentityType string + +const ( + // None ... + None ResourceIdentityType = "None" + // SystemAssigned ... + SystemAssigned ResourceIdentityType = "SystemAssigned" +) + +// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. +func PossibleResourceIdentityTypeValues() []ResourceIdentityType { + return []ResourceIdentityType{None, SystemAssigned} +} + +// ScaleSetEvictionPolicy enumerates the values for scale set eviction policy. +type ScaleSetEvictionPolicy string + +const ( + // Deallocate ... + Deallocate ScaleSetEvictionPolicy = "Deallocate" + // Delete ... + Delete ScaleSetEvictionPolicy = "Delete" +) + +// PossibleScaleSetEvictionPolicyValues returns an array of possible values for the ScaleSetEvictionPolicy const type. +func PossibleScaleSetEvictionPolicyValues() []ScaleSetEvictionPolicy { + return []ScaleSetEvictionPolicy{Deallocate, Delete} +} + +// ScaleSetPriority enumerates the values for scale set priority. +type ScaleSetPriority string + +const ( + // Low ... + Low ScaleSetPriority = "Low" + // Regular ... + Regular ScaleSetPriority = "Regular" +) + +// PossibleScaleSetPriorityValues returns an array of possible values for the ScaleSetPriority const type. +func PossibleScaleSetPriorityValues() []ScaleSetPriority { + return []ScaleSetPriority{Low, Regular} +} + +// StorageProfileTypes enumerates the values for storage profile types. +type StorageProfileTypes string + +const ( + // ManagedDisks ... + ManagedDisks StorageProfileTypes = "ManagedDisks" + // StorageAccount ... + StorageAccount StorageProfileTypes = "StorageAccount" +) + +// PossibleStorageProfileTypesValues returns an array of possible values for the StorageProfileTypes const type. +func PossibleStorageProfileTypesValues() []StorageProfileTypes { + return []StorageProfileTypes{ManagedDisks, StorageAccount} +} + +// VMSizeTypes enumerates the values for vm size types. +type VMSizeTypes string + +const ( + // VMSizeTypesStandardA1 ... + VMSizeTypesStandardA1 VMSizeTypes = "Standard_A1" + // VMSizeTypesStandardA10 ... + VMSizeTypesStandardA10 VMSizeTypes = "Standard_A10" + // VMSizeTypesStandardA11 ... + VMSizeTypesStandardA11 VMSizeTypes = "Standard_A11" + // VMSizeTypesStandardA1V2 ... + VMSizeTypesStandardA1V2 VMSizeTypes = "Standard_A1_v2" + // VMSizeTypesStandardA2 ... + VMSizeTypesStandardA2 VMSizeTypes = "Standard_A2" + // VMSizeTypesStandardA2mV2 ... + VMSizeTypesStandardA2mV2 VMSizeTypes = "Standard_A2m_v2" + // VMSizeTypesStandardA2V2 ... + VMSizeTypesStandardA2V2 VMSizeTypes = "Standard_A2_v2" + // VMSizeTypesStandardA3 ... + VMSizeTypesStandardA3 VMSizeTypes = "Standard_A3" + // VMSizeTypesStandardA4 ... + VMSizeTypesStandardA4 VMSizeTypes = "Standard_A4" + // VMSizeTypesStandardA4mV2 ... + VMSizeTypesStandardA4mV2 VMSizeTypes = "Standard_A4m_v2" + // VMSizeTypesStandardA4V2 ... + VMSizeTypesStandardA4V2 VMSizeTypes = "Standard_A4_v2" + // VMSizeTypesStandardA5 ... + VMSizeTypesStandardA5 VMSizeTypes = "Standard_A5" + // VMSizeTypesStandardA6 ... + VMSizeTypesStandardA6 VMSizeTypes = "Standard_A6" + // VMSizeTypesStandardA7 ... + VMSizeTypesStandardA7 VMSizeTypes = "Standard_A7" + // VMSizeTypesStandardA8 ... + VMSizeTypesStandardA8 VMSizeTypes = "Standard_A8" + // VMSizeTypesStandardA8mV2 ... + VMSizeTypesStandardA8mV2 VMSizeTypes = "Standard_A8m_v2" + // VMSizeTypesStandardA8V2 ... + VMSizeTypesStandardA8V2 VMSizeTypes = "Standard_A8_v2" + // VMSizeTypesStandardA9 ... + VMSizeTypesStandardA9 VMSizeTypes = "Standard_A9" + // VMSizeTypesStandardB2ms ... + VMSizeTypesStandardB2ms VMSizeTypes = "Standard_B2ms" + // VMSizeTypesStandardB2s ... + VMSizeTypesStandardB2s VMSizeTypes = "Standard_B2s" + // VMSizeTypesStandardB4ms ... + VMSizeTypesStandardB4ms VMSizeTypes = "Standard_B4ms" + // VMSizeTypesStandardB8ms ... + VMSizeTypesStandardB8ms VMSizeTypes = "Standard_B8ms" + // VMSizeTypesStandardD1 ... + VMSizeTypesStandardD1 VMSizeTypes = "Standard_D1" + // VMSizeTypesStandardD11 ... + VMSizeTypesStandardD11 VMSizeTypes = "Standard_D11" + // VMSizeTypesStandardD11V2 ... + VMSizeTypesStandardD11V2 VMSizeTypes = "Standard_D11_v2" + // VMSizeTypesStandardD11V2Promo ... + VMSizeTypesStandardD11V2Promo VMSizeTypes = "Standard_D11_v2_Promo" + // VMSizeTypesStandardD12 ... + VMSizeTypesStandardD12 VMSizeTypes = "Standard_D12" + // VMSizeTypesStandardD12V2 ... + VMSizeTypesStandardD12V2 VMSizeTypes = "Standard_D12_v2" + // VMSizeTypesStandardD12V2Promo ... + VMSizeTypesStandardD12V2Promo VMSizeTypes = "Standard_D12_v2_Promo" + // VMSizeTypesStandardD13 ... + VMSizeTypesStandardD13 VMSizeTypes = "Standard_D13" + // VMSizeTypesStandardD13V2 ... + VMSizeTypesStandardD13V2 VMSizeTypes = "Standard_D13_v2" + // VMSizeTypesStandardD13V2Promo ... + VMSizeTypesStandardD13V2Promo VMSizeTypes = "Standard_D13_v2_Promo" + // VMSizeTypesStandardD14 ... + VMSizeTypesStandardD14 VMSizeTypes = "Standard_D14" + // VMSizeTypesStandardD14V2 ... + VMSizeTypesStandardD14V2 VMSizeTypes = "Standard_D14_v2" + // VMSizeTypesStandardD14V2Promo ... + VMSizeTypesStandardD14V2Promo VMSizeTypes = "Standard_D14_v2_Promo" + // VMSizeTypesStandardD15V2 ... + VMSizeTypesStandardD15V2 VMSizeTypes = "Standard_D15_v2" + // VMSizeTypesStandardD16sV3 ... + VMSizeTypesStandardD16sV3 VMSizeTypes = "Standard_D16s_v3" + // VMSizeTypesStandardD16V3 ... + VMSizeTypesStandardD16V3 VMSizeTypes = "Standard_D16_v3" + // VMSizeTypesStandardD1V2 ... + VMSizeTypesStandardD1V2 VMSizeTypes = "Standard_D1_v2" + // VMSizeTypesStandardD2 ... + VMSizeTypesStandardD2 VMSizeTypes = "Standard_D2" + // VMSizeTypesStandardD2sV3 ... + VMSizeTypesStandardD2sV3 VMSizeTypes = "Standard_D2s_v3" + // VMSizeTypesStandardD2V2 ... + VMSizeTypesStandardD2V2 VMSizeTypes = "Standard_D2_v2" + // VMSizeTypesStandardD2V2Promo ... + VMSizeTypesStandardD2V2Promo VMSizeTypes = "Standard_D2_v2_Promo" + // VMSizeTypesStandardD2V3 ... + VMSizeTypesStandardD2V3 VMSizeTypes = "Standard_D2_v3" + // VMSizeTypesStandardD3 ... + VMSizeTypesStandardD3 VMSizeTypes = "Standard_D3" + // VMSizeTypesStandardD32sV3 ... + VMSizeTypesStandardD32sV3 VMSizeTypes = "Standard_D32s_v3" + // VMSizeTypesStandardD32V3 ... + VMSizeTypesStandardD32V3 VMSizeTypes = "Standard_D32_v3" + // VMSizeTypesStandardD3V2 ... + VMSizeTypesStandardD3V2 VMSizeTypes = "Standard_D3_v2" + // VMSizeTypesStandardD3V2Promo ... + VMSizeTypesStandardD3V2Promo VMSizeTypes = "Standard_D3_v2_Promo" + // VMSizeTypesStandardD4 ... + VMSizeTypesStandardD4 VMSizeTypes = "Standard_D4" + // VMSizeTypesStandardD4sV3 ... + VMSizeTypesStandardD4sV3 VMSizeTypes = "Standard_D4s_v3" + // VMSizeTypesStandardD4V2 ... + VMSizeTypesStandardD4V2 VMSizeTypes = "Standard_D4_v2" + // VMSizeTypesStandardD4V2Promo ... + VMSizeTypesStandardD4V2Promo VMSizeTypes = "Standard_D4_v2_Promo" + // VMSizeTypesStandardD4V3 ... + VMSizeTypesStandardD4V3 VMSizeTypes = "Standard_D4_v3" + // VMSizeTypesStandardD5V2 ... + VMSizeTypesStandardD5V2 VMSizeTypes = "Standard_D5_v2" + // VMSizeTypesStandardD5V2Promo ... + VMSizeTypesStandardD5V2Promo VMSizeTypes = "Standard_D5_v2_Promo" + // VMSizeTypesStandardD64sV3 ... + VMSizeTypesStandardD64sV3 VMSizeTypes = "Standard_D64s_v3" + // VMSizeTypesStandardD64V3 ... + VMSizeTypesStandardD64V3 VMSizeTypes = "Standard_D64_v3" + // VMSizeTypesStandardD8sV3 ... + VMSizeTypesStandardD8sV3 VMSizeTypes = "Standard_D8s_v3" + // VMSizeTypesStandardD8V3 ... + VMSizeTypesStandardD8V3 VMSizeTypes = "Standard_D8_v3" + // VMSizeTypesStandardDS1 ... + VMSizeTypesStandardDS1 VMSizeTypes = "Standard_DS1" + // VMSizeTypesStandardDS11 ... + VMSizeTypesStandardDS11 VMSizeTypes = "Standard_DS11" + // VMSizeTypesStandardDS11V2 ... + VMSizeTypesStandardDS11V2 VMSizeTypes = "Standard_DS11_v2" + // VMSizeTypesStandardDS11V2Promo ... + VMSizeTypesStandardDS11V2Promo VMSizeTypes = "Standard_DS11_v2_Promo" + // VMSizeTypesStandardDS12 ... + VMSizeTypesStandardDS12 VMSizeTypes = "Standard_DS12" + // VMSizeTypesStandardDS12V2 ... + VMSizeTypesStandardDS12V2 VMSizeTypes = "Standard_DS12_v2" + // VMSizeTypesStandardDS12V2Promo ... + VMSizeTypesStandardDS12V2Promo VMSizeTypes = "Standard_DS12_v2_Promo" + // VMSizeTypesStandardDS13 ... + VMSizeTypesStandardDS13 VMSizeTypes = "Standard_DS13" + // VMSizeTypesStandardDS132V2 ... + VMSizeTypesStandardDS132V2 VMSizeTypes = "Standard_DS13-2_v2" + // VMSizeTypesStandardDS134V2 ... + VMSizeTypesStandardDS134V2 VMSizeTypes = "Standard_DS13-4_v2" + // VMSizeTypesStandardDS13V2 ... + VMSizeTypesStandardDS13V2 VMSizeTypes = "Standard_DS13_v2" + // VMSizeTypesStandardDS13V2Promo ... + VMSizeTypesStandardDS13V2Promo VMSizeTypes = "Standard_DS13_v2_Promo" + // VMSizeTypesStandardDS14 ... + VMSizeTypesStandardDS14 VMSizeTypes = "Standard_DS14" + // VMSizeTypesStandardDS144V2 ... + VMSizeTypesStandardDS144V2 VMSizeTypes = "Standard_DS14-4_v2" + // VMSizeTypesStandardDS148V2 ... + VMSizeTypesStandardDS148V2 VMSizeTypes = "Standard_DS14-8_v2" + // VMSizeTypesStandardDS14V2 ... + VMSizeTypesStandardDS14V2 VMSizeTypes = "Standard_DS14_v2" + // VMSizeTypesStandardDS14V2Promo ... + VMSizeTypesStandardDS14V2Promo VMSizeTypes = "Standard_DS14_v2_Promo" + // VMSizeTypesStandardDS15V2 ... + VMSizeTypesStandardDS15V2 VMSizeTypes = "Standard_DS15_v2" + // VMSizeTypesStandardDS1V2 ... + VMSizeTypesStandardDS1V2 VMSizeTypes = "Standard_DS1_v2" + // VMSizeTypesStandardDS2 ... + VMSizeTypesStandardDS2 VMSizeTypes = "Standard_DS2" + // VMSizeTypesStandardDS2V2 ... + VMSizeTypesStandardDS2V2 VMSizeTypes = "Standard_DS2_v2" + // VMSizeTypesStandardDS2V2Promo ... + VMSizeTypesStandardDS2V2Promo VMSizeTypes = "Standard_DS2_v2_Promo" + // VMSizeTypesStandardDS3 ... + VMSizeTypesStandardDS3 VMSizeTypes = "Standard_DS3" + // VMSizeTypesStandardDS3V2 ... + VMSizeTypesStandardDS3V2 VMSizeTypes = "Standard_DS3_v2" + // VMSizeTypesStandardDS3V2Promo ... + VMSizeTypesStandardDS3V2Promo VMSizeTypes = "Standard_DS3_v2_Promo" + // VMSizeTypesStandardDS4 ... + VMSizeTypesStandardDS4 VMSizeTypes = "Standard_DS4" + // VMSizeTypesStandardDS4V2 ... + VMSizeTypesStandardDS4V2 VMSizeTypes = "Standard_DS4_v2" + // VMSizeTypesStandardDS4V2Promo ... + VMSizeTypesStandardDS4V2Promo VMSizeTypes = "Standard_DS4_v2_Promo" + // VMSizeTypesStandardDS5V2 ... + VMSizeTypesStandardDS5V2 VMSizeTypes = "Standard_DS5_v2" + // VMSizeTypesStandardDS5V2Promo ... + VMSizeTypesStandardDS5V2Promo VMSizeTypes = "Standard_DS5_v2_Promo" + // VMSizeTypesStandardE16sV3 ... + VMSizeTypesStandardE16sV3 VMSizeTypes = "Standard_E16s_v3" + // VMSizeTypesStandardE16V3 ... + VMSizeTypesStandardE16V3 VMSizeTypes = "Standard_E16_v3" + // VMSizeTypesStandardE2sV3 ... + VMSizeTypesStandardE2sV3 VMSizeTypes = "Standard_E2s_v3" + // VMSizeTypesStandardE2V3 ... + VMSizeTypesStandardE2V3 VMSizeTypes = "Standard_E2_v3" + // VMSizeTypesStandardE3216sV3 ... + VMSizeTypesStandardE3216sV3 VMSizeTypes = "Standard_E32-16s_v3" + // VMSizeTypesStandardE328sV3 ... + VMSizeTypesStandardE328sV3 VMSizeTypes = "Standard_E32-8s_v3" + // VMSizeTypesStandardE32sV3 ... + VMSizeTypesStandardE32sV3 VMSizeTypes = "Standard_E32s_v3" + // VMSizeTypesStandardE32V3 ... + VMSizeTypesStandardE32V3 VMSizeTypes = "Standard_E32_v3" + // VMSizeTypesStandardE4sV3 ... + VMSizeTypesStandardE4sV3 VMSizeTypes = "Standard_E4s_v3" + // VMSizeTypesStandardE4V3 ... + VMSizeTypesStandardE4V3 VMSizeTypes = "Standard_E4_v3" + // VMSizeTypesStandardE6416sV3 ... + VMSizeTypesStandardE6416sV3 VMSizeTypes = "Standard_E64-16s_v3" + // VMSizeTypesStandardE6432sV3 ... + VMSizeTypesStandardE6432sV3 VMSizeTypes = "Standard_E64-32s_v3" + // VMSizeTypesStandardE64sV3 ... + VMSizeTypesStandardE64sV3 VMSizeTypes = "Standard_E64s_v3" + // VMSizeTypesStandardE64V3 ... + VMSizeTypesStandardE64V3 VMSizeTypes = "Standard_E64_v3" + // VMSizeTypesStandardE8sV3 ... + VMSizeTypesStandardE8sV3 VMSizeTypes = "Standard_E8s_v3" + // VMSizeTypesStandardE8V3 ... + VMSizeTypesStandardE8V3 VMSizeTypes = "Standard_E8_v3" + // VMSizeTypesStandardF1 ... + VMSizeTypesStandardF1 VMSizeTypes = "Standard_F1" + // VMSizeTypesStandardF16 ... + VMSizeTypesStandardF16 VMSizeTypes = "Standard_F16" + // VMSizeTypesStandardF16s ... + VMSizeTypesStandardF16s VMSizeTypes = "Standard_F16s" + // VMSizeTypesStandardF16sV2 ... + VMSizeTypesStandardF16sV2 VMSizeTypes = "Standard_F16s_v2" + // VMSizeTypesStandardF1s ... + VMSizeTypesStandardF1s VMSizeTypes = "Standard_F1s" + // VMSizeTypesStandardF2 ... + VMSizeTypesStandardF2 VMSizeTypes = "Standard_F2" + // VMSizeTypesStandardF2s ... + VMSizeTypesStandardF2s VMSizeTypes = "Standard_F2s" + // VMSizeTypesStandardF2sV2 ... + VMSizeTypesStandardF2sV2 VMSizeTypes = "Standard_F2s_v2" + // VMSizeTypesStandardF32sV2 ... + VMSizeTypesStandardF32sV2 VMSizeTypes = "Standard_F32s_v2" + // VMSizeTypesStandardF4 ... + VMSizeTypesStandardF4 VMSizeTypes = "Standard_F4" + // VMSizeTypesStandardF4s ... + VMSizeTypesStandardF4s VMSizeTypes = "Standard_F4s" + // VMSizeTypesStandardF4sV2 ... + VMSizeTypesStandardF4sV2 VMSizeTypes = "Standard_F4s_v2" + // VMSizeTypesStandardF64sV2 ... + VMSizeTypesStandardF64sV2 VMSizeTypes = "Standard_F64s_v2" + // VMSizeTypesStandardF72sV2 ... + VMSizeTypesStandardF72sV2 VMSizeTypes = "Standard_F72s_v2" + // VMSizeTypesStandardF8 ... + VMSizeTypesStandardF8 VMSizeTypes = "Standard_F8" + // VMSizeTypesStandardF8s ... + VMSizeTypesStandardF8s VMSizeTypes = "Standard_F8s" + // VMSizeTypesStandardF8sV2 ... + VMSizeTypesStandardF8sV2 VMSizeTypes = "Standard_F8s_v2" + // VMSizeTypesStandardG1 ... + VMSizeTypesStandardG1 VMSizeTypes = "Standard_G1" + // VMSizeTypesStandardG2 ... + VMSizeTypesStandardG2 VMSizeTypes = "Standard_G2" + // VMSizeTypesStandardG3 ... + VMSizeTypesStandardG3 VMSizeTypes = "Standard_G3" + // VMSizeTypesStandardG4 ... + VMSizeTypesStandardG4 VMSizeTypes = "Standard_G4" + // VMSizeTypesStandardG5 ... + VMSizeTypesStandardG5 VMSizeTypes = "Standard_G5" + // VMSizeTypesStandardGS1 ... + VMSizeTypesStandardGS1 VMSizeTypes = "Standard_GS1" + // VMSizeTypesStandardGS2 ... + VMSizeTypesStandardGS2 VMSizeTypes = "Standard_GS2" + // VMSizeTypesStandardGS3 ... + VMSizeTypesStandardGS3 VMSizeTypes = "Standard_GS3" + // VMSizeTypesStandardGS4 ... + VMSizeTypesStandardGS4 VMSizeTypes = "Standard_GS4" + // VMSizeTypesStandardGS44 ... + VMSizeTypesStandardGS44 VMSizeTypes = "Standard_GS4-4" + // VMSizeTypesStandardGS48 ... + VMSizeTypesStandardGS48 VMSizeTypes = "Standard_GS4-8" + // VMSizeTypesStandardGS5 ... + VMSizeTypesStandardGS5 VMSizeTypes = "Standard_GS5" + // VMSizeTypesStandardGS516 ... + VMSizeTypesStandardGS516 VMSizeTypes = "Standard_GS5-16" + // VMSizeTypesStandardGS58 ... + VMSizeTypesStandardGS58 VMSizeTypes = "Standard_GS5-8" + // VMSizeTypesStandardH16 ... + VMSizeTypesStandardH16 VMSizeTypes = "Standard_H16" + // VMSizeTypesStandardH16m ... + VMSizeTypesStandardH16m VMSizeTypes = "Standard_H16m" + // VMSizeTypesStandardH16mr ... + VMSizeTypesStandardH16mr VMSizeTypes = "Standard_H16mr" + // VMSizeTypesStandardH16r ... + VMSizeTypesStandardH16r VMSizeTypes = "Standard_H16r" + // VMSizeTypesStandardH8 ... + VMSizeTypesStandardH8 VMSizeTypes = "Standard_H8" + // VMSizeTypesStandardH8m ... + VMSizeTypesStandardH8m VMSizeTypes = "Standard_H8m" + // VMSizeTypesStandardL16s ... + VMSizeTypesStandardL16s VMSizeTypes = "Standard_L16s" + // VMSizeTypesStandardL32s ... + VMSizeTypesStandardL32s VMSizeTypes = "Standard_L32s" + // VMSizeTypesStandardL4s ... + VMSizeTypesStandardL4s VMSizeTypes = "Standard_L4s" + // VMSizeTypesStandardL8s ... + VMSizeTypesStandardL8s VMSizeTypes = "Standard_L8s" + // VMSizeTypesStandardM12832ms ... + VMSizeTypesStandardM12832ms VMSizeTypes = "Standard_M128-32ms" + // VMSizeTypesStandardM12864ms ... + VMSizeTypesStandardM12864ms VMSizeTypes = "Standard_M128-64ms" + // VMSizeTypesStandardM128ms ... + VMSizeTypesStandardM128ms VMSizeTypes = "Standard_M128ms" + // VMSizeTypesStandardM128s ... + VMSizeTypesStandardM128s VMSizeTypes = "Standard_M128s" + // VMSizeTypesStandardM6416ms ... + VMSizeTypesStandardM6416ms VMSizeTypes = "Standard_M64-16ms" + // VMSizeTypesStandardM6432ms ... + VMSizeTypesStandardM6432ms VMSizeTypes = "Standard_M64-32ms" + // VMSizeTypesStandardM64ms ... + VMSizeTypesStandardM64ms VMSizeTypes = "Standard_M64ms" + // VMSizeTypesStandardM64s ... + VMSizeTypesStandardM64s VMSizeTypes = "Standard_M64s" + // VMSizeTypesStandardNC12 ... + VMSizeTypesStandardNC12 VMSizeTypes = "Standard_NC12" + // VMSizeTypesStandardNC12sV2 ... + VMSizeTypesStandardNC12sV2 VMSizeTypes = "Standard_NC12s_v2" + // VMSizeTypesStandardNC12sV3 ... + VMSizeTypesStandardNC12sV3 VMSizeTypes = "Standard_NC12s_v3" + // VMSizeTypesStandardNC24 ... + VMSizeTypesStandardNC24 VMSizeTypes = "Standard_NC24" + // VMSizeTypesStandardNC24r ... + VMSizeTypesStandardNC24r VMSizeTypes = "Standard_NC24r" + // VMSizeTypesStandardNC24rsV2 ... + VMSizeTypesStandardNC24rsV2 VMSizeTypes = "Standard_NC24rs_v2" + // VMSizeTypesStandardNC24rsV3 ... + VMSizeTypesStandardNC24rsV3 VMSizeTypes = "Standard_NC24rs_v3" + // VMSizeTypesStandardNC24sV2 ... + VMSizeTypesStandardNC24sV2 VMSizeTypes = "Standard_NC24s_v2" + // VMSizeTypesStandardNC24sV3 ... + VMSizeTypesStandardNC24sV3 VMSizeTypes = "Standard_NC24s_v3" + // VMSizeTypesStandardNC6 ... + VMSizeTypesStandardNC6 VMSizeTypes = "Standard_NC6" + // VMSizeTypesStandardNC6sV2 ... + VMSizeTypesStandardNC6sV2 VMSizeTypes = "Standard_NC6s_v2" + // VMSizeTypesStandardNC6sV3 ... + VMSizeTypesStandardNC6sV3 VMSizeTypes = "Standard_NC6s_v3" + // VMSizeTypesStandardND12s ... + VMSizeTypesStandardND12s VMSizeTypes = "Standard_ND12s" + // VMSizeTypesStandardND24rs ... + VMSizeTypesStandardND24rs VMSizeTypes = "Standard_ND24rs" + // VMSizeTypesStandardND24s ... + VMSizeTypesStandardND24s VMSizeTypes = "Standard_ND24s" + // VMSizeTypesStandardND6s ... + VMSizeTypesStandardND6s VMSizeTypes = "Standard_ND6s" + // VMSizeTypesStandardNV12 ... + VMSizeTypesStandardNV12 VMSizeTypes = "Standard_NV12" + // VMSizeTypesStandardNV24 ... + VMSizeTypesStandardNV24 VMSizeTypes = "Standard_NV24" + // VMSizeTypesStandardNV6 ... + VMSizeTypesStandardNV6 VMSizeTypes = "Standard_NV6" +) + +// PossibleVMSizeTypesValues returns an array of possible values for the VMSizeTypes const type. +func PossibleVMSizeTypesValues() []VMSizeTypes { + return []VMSizeTypes{VMSizeTypesStandardA1, VMSizeTypesStandardA10, VMSizeTypesStandardA11, VMSizeTypesStandardA1V2, VMSizeTypesStandardA2, VMSizeTypesStandardA2mV2, VMSizeTypesStandardA2V2, VMSizeTypesStandardA3, VMSizeTypesStandardA4, VMSizeTypesStandardA4mV2, VMSizeTypesStandardA4V2, VMSizeTypesStandardA5, VMSizeTypesStandardA6, VMSizeTypesStandardA7, VMSizeTypesStandardA8, VMSizeTypesStandardA8mV2, VMSizeTypesStandardA8V2, VMSizeTypesStandardA9, VMSizeTypesStandardB2ms, VMSizeTypesStandardB2s, VMSizeTypesStandardB4ms, VMSizeTypesStandardB8ms, VMSizeTypesStandardD1, VMSizeTypesStandardD11, VMSizeTypesStandardD11V2, VMSizeTypesStandardD11V2Promo, VMSizeTypesStandardD12, VMSizeTypesStandardD12V2, VMSizeTypesStandardD12V2Promo, VMSizeTypesStandardD13, VMSizeTypesStandardD13V2, VMSizeTypesStandardD13V2Promo, VMSizeTypesStandardD14, VMSizeTypesStandardD14V2, VMSizeTypesStandardD14V2Promo, VMSizeTypesStandardD15V2, VMSizeTypesStandardD16sV3, VMSizeTypesStandardD16V3, VMSizeTypesStandardD1V2, VMSizeTypesStandardD2, VMSizeTypesStandardD2sV3, VMSizeTypesStandardD2V2, VMSizeTypesStandardD2V2Promo, VMSizeTypesStandardD2V3, VMSizeTypesStandardD3, VMSizeTypesStandardD32sV3, VMSizeTypesStandardD32V3, VMSizeTypesStandardD3V2, VMSizeTypesStandardD3V2Promo, VMSizeTypesStandardD4, VMSizeTypesStandardD4sV3, VMSizeTypesStandardD4V2, VMSizeTypesStandardD4V2Promo, VMSizeTypesStandardD4V3, VMSizeTypesStandardD5V2, VMSizeTypesStandardD5V2Promo, VMSizeTypesStandardD64sV3, VMSizeTypesStandardD64V3, VMSizeTypesStandardD8sV3, VMSizeTypesStandardD8V3, VMSizeTypesStandardDS1, VMSizeTypesStandardDS11, VMSizeTypesStandardDS11V2, VMSizeTypesStandardDS11V2Promo, VMSizeTypesStandardDS12, VMSizeTypesStandardDS12V2, VMSizeTypesStandardDS12V2Promo, VMSizeTypesStandardDS13, VMSizeTypesStandardDS132V2, VMSizeTypesStandardDS134V2, VMSizeTypesStandardDS13V2, VMSizeTypesStandardDS13V2Promo, VMSizeTypesStandardDS14, VMSizeTypesStandardDS144V2, VMSizeTypesStandardDS148V2, VMSizeTypesStandardDS14V2, VMSizeTypesStandardDS14V2Promo, VMSizeTypesStandardDS15V2, VMSizeTypesStandardDS1V2, VMSizeTypesStandardDS2, VMSizeTypesStandardDS2V2, VMSizeTypesStandardDS2V2Promo, VMSizeTypesStandardDS3, VMSizeTypesStandardDS3V2, VMSizeTypesStandardDS3V2Promo, VMSizeTypesStandardDS4, VMSizeTypesStandardDS4V2, VMSizeTypesStandardDS4V2Promo, VMSizeTypesStandardDS5V2, VMSizeTypesStandardDS5V2Promo, VMSizeTypesStandardE16sV3, VMSizeTypesStandardE16V3, VMSizeTypesStandardE2sV3, VMSizeTypesStandardE2V3, VMSizeTypesStandardE3216sV3, VMSizeTypesStandardE328sV3, VMSizeTypesStandardE32sV3, VMSizeTypesStandardE32V3, VMSizeTypesStandardE4sV3, VMSizeTypesStandardE4V3, VMSizeTypesStandardE6416sV3, VMSizeTypesStandardE6432sV3, VMSizeTypesStandardE64sV3, VMSizeTypesStandardE64V3, VMSizeTypesStandardE8sV3, VMSizeTypesStandardE8V3, VMSizeTypesStandardF1, VMSizeTypesStandardF16, VMSizeTypesStandardF16s, VMSizeTypesStandardF16sV2, VMSizeTypesStandardF1s, VMSizeTypesStandardF2, VMSizeTypesStandardF2s, VMSizeTypesStandardF2sV2, VMSizeTypesStandardF32sV2, VMSizeTypesStandardF4, VMSizeTypesStandardF4s, VMSizeTypesStandardF4sV2, VMSizeTypesStandardF64sV2, VMSizeTypesStandardF72sV2, VMSizeTypesStandardF8, VMSizeTypesStandardF8s, VMSizeTypesStandardF8sV2, VMSizeTypesStandardG1, VMSizeTypesStandardG2, VMSizeTypesStandardG3, VMSizeTypesStandardG4, VMSizeTypesStandardG5, VMSizeTypesStandardGS1, VMSizeTypesStandardGS2, VMSizeTypesStandardGS3, VMSizeTypesStandardGS4, VMSizeTypesStandardGS44, VMSizeTypesStandardGS48, VMSizeTypesStandardGS5, VMSizeTypesStandardGS516, VMSizeTypesStandardGS58, VMSizeTypesStandardH16, VMSizeTypesStandardH16m, VMSizeTypesStandardH16mr, VMSizeTypesStandardH16r, VMSizeTypesStandardH8, VMSizeTypesStandardH8m, VMSizeTypesStandardL16s, VMSizeTypesStandardL32s, VMSizeTypesStandardL4s, VMSizeTypesStandardL8s, VMSizeTypesStandardM12832ms, VMSizeTypesStandardM12864ms, VMSizeTypesStandardM128ms, VMSizeTypesStandardM128s, VMSizeTypesStandardM6416ms, VMSizeTypesStandardM6432ms, VMSizeTypesStandardM64ms, VMSizeTypesStandardM64s, VMSizeTypesStandardNC12, VMSizeTypesStandardNC12sV2, VMSizeTypesStandardNC12sV3, VMSizeTypesStandardNC24, VMSizeTypesStandardNC24r, VMSizeTypesStandardNC24rsV2, VMSizeTypesStandardNC24rsV3, VMSizeTypesStandardNC24sV2, VMSizeTypesStandardNC24sV3, VMSizeTypesStandardNC6, VMSizeTypesStandardNC6sV2, VMSizeTypesStandardNC6sV3, VMSizeTypesStandardND12s, VMSizeTypesStandardND24rs, VMSizeTypesStandardND24s, VMSizeTypesStandardND6s, VMSizeTypesStandardNV12, VMSizeTypesStandardNV24, VMSizeTypesStandardNV6} +} + +// AccessProfile profile for enabling a user to access a managed cluster. +type AccessProfile struct { + // KubeConfig - Base64-encoded Kubernetes configuration file. + KubeConfig *[]byte `json:"kubeConfig,omitempty"` +} + +// AgentPool agent Pool. +type AgentPool struct { + autorest.Response `json:"-"` + // ManagedClusterAgentPoolProfileProperties - Properties of an agent pool. + *ManagedClusterAgentPoolProfileProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AgentPool. +func (ap AgentPool) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ap.ManagedClusterAgentPoolProfileProperties != nil { + objectMap["properties"] = ap.ManagedClusterAgentPoolProfileProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AgentPool struct. +func (ap *AgentPool) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var managedClusterAgentPoolProfileProperties ManagedClusterAgentPoolProfileProperties + err = json.Unmarshal(*v, &managedClusterAgentPoolProfileProperties) + if err != nil { + return err + } + ap.ManagedClusterAgentPoolProfileProperties = &managedClusterAgentPoolProfileProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ap.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ap.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ap.Type = &typeVar + } + } + } + + return nil +} + +// AgentPoolAvailableVersions the list of available versions for an agent pool. +type AgentPoolAvailableVersions struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Id of the agent pool available versions. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the agent pool available versions. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the agent pool available versions. + Type *string `json:"type,omitempty"` + // AgentPoolAvailableVersionsProperties - Properties of agent pool available versions. + *AgentPoolAvailableVersionsProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for AgentPoolAvailableVersions. +func (apav AgentPoolAvailableVersions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if apav.AgentPoolAvailableVersionsProperties != nil { + objectMap["properties"] = apav.AgentPoolAvailableVersionsProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AgentPoolAvailableVersions struct. +func (apav *AgentPoolAvailableVersions) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + apav.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + apav.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + apav.Type = &typeVar + } + case "properties": + if v != nil { + var agentPoolAvailableVersionsProperties AgentPoolAvailableVersionsProperties + err = json.Unmarshal(*v, &agentPoolAvailableVersionsProperties) + if err != nil { + return err + } + apav.AgentPoolAvailableVersionsProperties = &agentPoolAvailableVersionsProperties + } + } + } + + return nil +} + +// AgentPoolAvailableVersionsProperties the list of available agent pool versions. +type AgentPoolAvailableVersionsProperties struct { + // AgentPoolVersions - List of versions available for agent pool. + AgentPoolVersions *[]AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem `json:"agentPoolVersions,omitempty"` +} + +// AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem ... +type AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem struct { + // Default - Whether this version is the default agent pool version. + Default *bool `json:"default,omitempty"` + // KubernetesVersion - Kubernetes version (major, minor, patch). + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` + // IsPreview - Whether Kubernetes version is currently in preview. + IsPreview *bool `json:"isPreview,omitempty"` +} + +// AgentPoolListResult the response from the List Agent Pools operation. +type AgentPoolListResult struct { + autorest.Response `json:"-"` + // Value - The list of agent pools. + Value *[]AgentPool `json:"value,omitempty"` + // NextLink - READ-ONLY; The URL to get the next set of agent pool results. + NextLink *string `json:"nextLink,omitempty"` +} + +// AgentPoolListResultIterator provides access to a complete listing of AgentPool values. +type AgentPoolListResultIterator struct { + i int + page AgentPoolListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *AgentPoolListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *AgentPoolListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AgentPoolListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter AgentPoolListResultIterator) Response() AgentPoolListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter AgentPoolListResultIterator) Value() AgentPool { + if !iter.page.NotDone() { + return AgentPool{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AgentPoolListResultIterator type. +func NewAgentPoolListResultIterator(page AgentPoolListResultPage) AgentPoolListResultIterator { + return AgentPoolListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (aplr AgentPoolListResult) IsEmpty() bool { + return aplr.Value == nil || len(*aplr.Value) == 0 +} + +// agentPoolListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (aplr AgentPoolListResult) agentPoolListResultPreparer(ctx context.Context) (*http.Request, error) { + if aplr.NextLink == nil || len(to.String(aplr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(aplr.NextLink))) +} + +// AgentPoolListResultPage contains a page of AgentPool values. +type AgentPoolListResultPage struct { + fn func(context.Context, AgentPoolListResult) (AgentPoolListResult, error) + aplr AgentPoolListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *AgentPoolListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.aplr) + if err != nil { + return err + } + page.aplr = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *AgentPoolListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AgentPoolListResultPage) NotDone() bool { + return !page.aplr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AgentPoolListResultPage) Response() AgentPoolListResult { + return page.aplr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AgentPoolListResultPage) Values() []AgentPool { + if page.aplr.IsEmpty() { + return nil + } + return *page.aplr.Value +} + +// Creates a new instance of the AgentPoolListResultPage type. +func NewAgentPoolListResultPage(getNextPage func(context.Context, AgentPoolListResult) (AgentPoolListResult, error)) AgentPoolListResultPage { + return AgentPoolListResultPage{fn: getNextPage} +} + +// AgentPoolProfile profile for the container service agent pool. +type AgentPoolProfile struct { + // Name - Unique name of the agent pool profile in the context of the subscription and resource group. + Name *string `json:"name,omitempty"` + // Count - Number of agents (VMs) to host docker containers. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. + Count *int32 `json:"count,omitempty"` + // VMSize - Size of agent VMs. Possible values include: 'VMSizeTypesStandardA1', 'VMSizeTypesStandardA10', 'VMSizeTypesStandardA11', 'VMSizeTypesStandardA1V2', 'VMSizeTypesStandardA2', 'VMSizeTypesStandardA2V2', 'VMSizeTypesStandardA2mV2', 'VMSizeTypesStandardA3', 'VMSizeTypesStandardA4', 'VMSizeTypesStandardA4V2', 'VMSizeTypesStandardA4mV2', 'VMSizeTypesStandardA5', 'VMSizeTypesStandardA6', 'VMSizeTypesStandardA7', 'VMSizeTypesStandardA8', 'VMSizeTypesStandardA8V2', 'VMSizeTypesStandardA8mV2', 'VMSizeTypesStandardA9', 'VMSizeTypesStandardB2ms', 'VMSizeTypesStandardB2s', 'VMSizeTypesStandardB4ms', 'VMSizeTypesStandardB8ms', 'VMSizeTypesStandardD1', 'VMSizeTypesStandardD11', 'VMSizeTypesStandardD11V2', 'VMSizeTypesStandardD11V2Promo', 'VMSizeTypesStandardD12', 'VMSizeTypesStandardD12V2', 'VMSizeTypesStandardD12V2Promo', 'VMSizeTypesStandardD13', 'VMSizeTypesStandardD13V2', 'VMSizeTypesStandardD13V2Promo', 'VMSizeTypesStandardD14', 'VMSizeTypesStandardD14V2', 'VMSizeTypesStandardD14V2Promo', 'VMSizeTypesStandardD15V2', 'VMSizeTypesStandardD16V3', 'VMSizeTypesStandardD16sV3', 'VMSizeTypesStandardD1V2', 'VMSizeTypesStandardD2', 'VMSizeTypesStandardD2V2', 'VMSizeTypesStandardD2V2Promo', 'VMSizeTypesStandardD2V3', 'VMSizeTypesStandardD2sV3', 'VMSizeTypesStandardD3', 'VMSizeTypesStandardD32V3', 'VMSizeTypesStandardD32sV3', 'VMSizeTypesStandardD3V2', 'VMSizeTypesStandardD3V2Promo', 'VMSizeTypesStandardD4', 'VMSizeTypesStandardD4V2', 'VMSizeTypesStandardD4V2Promo', 'VMSizeTypesStandardD4V3', 'VMSizeTypesStandardD4sV3', 'VMSizeTypesStandardD5V2', 'VMSizeTypesStandardD5V2Promo', 'VMSizeTypesStandardD64V3', 'VMSizeTypesStandardD64sV3', 'VMSizeTypesStandardD8V3', 'VMSizeTypesStandardD8sV3', 'VMSizeTypesStandardDS1', 'VMSizeTypesStandardDS11', 'VMSizeTypesStandardDS11V2', 'VMSizeTypesStandardDS11V2Promo', 'VMSizeTypesStandardDS12', 'VMSizeTypesStandardDS12V2', 'VMSizeTypesStandardDS12V2Promo', 'VMSizeTypesStandardDS13', 'VMSizeTypesStandardDS132V2', 'VMSizeTypesStandardDS134V2', 'VMSizeTypesStandardDS13V2', 'VMSizeTypesStandardDS13V2Promo', 'VMSizeTypesStandardDS14', 'VMSizeTypesStandardDS144V2', 'VMSizeTypesStandardDS148V2', 'VMSizeTypesStandardDS14V2', 'VMSizeTypesStandardDS14V2Promo', 'VMSizeTypesStandardDS15V2', 'VMSizeTypesStandardDS1V2', 'VMSizeTypesStandardDS2', 'VMSizeTypesStandardDS2V2', 'VMSizeTypesStandardDS2V2Promo', 'VMSizeTypesStandardDS3', 'VMSizeTypesStandardDS3V2', 'VMSizeTypesStandardDS3V2Promo', 'VMSizeTypesStandardDS4', 'VMSizeTypesStandardDS4V2', 'VMSizeTypesStandardDS4V2Promo', 'VMSizeTypesStandardDS5V2', 'VMSizeTypesStandardDS5V2Promo', 'VMSizeTypesStandardE16V3', 'VMSizeTypesStandardE16sV3', 'VMSizeTypesStandardE2V3', 'VMSizeTypesStandardE2sV3', 'VMSizeTypesStandardE3216sV3', 'VMSizeTypesStandardE328sV3', 'VMSizeTypesStandardE32V3', 'VMSizeTypesStandardE32sV3', 'VMSizeTypesStandardE4V3', 'VMSizeTypesStandardE4sV3', 'VMSizeTypesStandardE6416sV3', 'VMSizeTypesStandardE6432sV3', 'VMSizeTypesStandardE64V3', 'VMSizeTypesStandardE64sV3', 'VMSizeTypesStandardE8V3', 'VMSizeTypesStandardE8sV3', 'VMSizeTypesStandardF1', 'VMSizeTypesStandardF16', 'VMSizeTypesStandardF16s', 'VMSizeTypesStandardF16sV2', 'VMSizeTypesStandardF1s', 'VMSizeTypesStandardF2', 'VMSizeTypesStandardF2s', 'VMSizeTypesStandardF2sV2', 'VMSizeTypesStandardF32sV2', 'VMSizeTypesStandardF4', 'VMSizeTypesStandardF4s', 'VMSizeTypesStandardF4sV2', 'VMSizeTypesStandardF64sV2', 'VMSizeTypesStandardF72sV2', 'VMSizeTypesStandardF8', 'VMSizeTypesStandardF8s', 'VMSizeTypesStandardF8sV2', 'VMSizeTypesStandardG1', 'VMSizeTypesStandardG2', 'VMSizeTypesStandardG3', 'VMSizeTypesStandardG4', 'VMSizeTypesStandardG5', 'VMSizeTypesStandardGS1', 'VMSizeTypesStandardGS2', 'VMSizeTypesStandardGS3', 'VMSizeTypesStandardGS4', 'VMSizeTypesStandardGS44', 'VMSizeTypesStandardGS48', 'VMSizeTypesStandardGS5', 'VMSizeTypesStandardGS516', 'VMSizeTypesStandardGS58', 'VMSizeTypesStandardH16', 'VMSizeTypesStandardH16m', 'VMSizeTypesStandardH16mr', 'VMSizeTypesStandardH16r', 'VMSizeTypesStandardH8', 'VMSizeTypesStandardH8m', 'VMSizeTypesStandardL16s', 'VMSizeTypesStandardL32s', 'VMSizeTypesStandardL4s', 'VMSizeTypesStandardL8s', 'VMSizeTypesStandardM12832ms', 'VMSizeTypesStandardM12864ms', 'VMSizeTypesStandardM128ms', 'VMSizeTypesStandardM128s', 'VMSizeTypesStandardM6416ms', 'VMSizeTypesStandardM6432ms', 'VMSizeTypesStandardM64ms', 'VMSizeTypesStandardM64s', 'VMSizeTypesStandardNC12', 'VMSizeTypesStandardNC12sV2', 'VMSizeTypesStandardNC12sV3', 'VMSizeTypesStandardNC24', 'VMSizeTypesStandardNC24r', 'VMSizeTypesStandardNC24rsV2', 'VMSizeTypesStandardNC24rsV3', 'VMSizeTypesStandardNC24sV2', 'VMSizeTypesStandardNC24sV3', 'VMSizeTypesStandardNC6', 'VMSizeTypesStandardNC6sV2', 'VMSizeTypesStandardNC6sV3', 'VMSizeTypesStandardND12s', 'VMSizeTypesStandardND24rs', 'VMSizeTypesStandardND24s', 'VMSizeTypesStandardND6s', 'VMSizeTypesStandardNV12', 'VMSizeTypesStandardNV24', 'VMSizeTypesStandardNV6' + VMSize VMSizeTypes `json:"vmSize,omitempty"` + // OsDiskSizeGB - OS Disk Size in GB to be used to specify the disk size for every machine in this master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. + OsDiskSizeGB *int32 `json:"osDiskSizeGB,omitempty"` + // DNSPrefix - DNS prefix to be used to create the FQDN for the agent pool. + DNSPrefix *string `json:"dnsPrefix,omitempty"` + // Fqdn - READ-ONLY; FQDN for the agent pool. + Fqdn *string `json:"fqdn,omitempty"` + // Ports - Ports number array used to expose on this agent pool. The default opened ports are different based on your choice of orchestrator. + Ports *[]int32 `json:"ports,omitempty"` + // StorageProfile - Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. Possible values include: 'StorageAccount', 'ManagedDisks' + StorageProfile StorageProfileTypes `json:"storageProfile,omitempty"` + // VnetSubnetID - VNet SubnetID specifies the VNet's subnet identifier. + VnetSubnetID *string `json:"vnetSubnetID,omitempty"` + // OsType - OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: 'Linux', 'Windows' + OsType OSType `json:"osType,omitempty"` +} + +// AgentPoolsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type AgentPoolsCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *AgentPoolsCreateOrUpdateFuture) Result(client AgentPoolsClient) (ap AgentPool, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerservice.AgentPoolsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ap.Response.Response, err = future.GetResult(sender); err == nil && ap.Response.Response.StatusCode != http.StatusNoContent { + ap, err = client.CreateOrUpdateResponder(ap.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsCreateOrUpdateFuture", "Result", ap.Response.Response, "Failure responding to request") + } + } + return +} + +// AgentPoolsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type AgentPoolsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *AgentPoolsDeleteFuture) Result(client AgentPoolsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerservice.AgentPoolsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// AgentPoolUpgradeProfile the list of available upgrades for an agent pool. +type AgentPoolUpgradeProfile struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Id of the agent pool upgrade profile. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the agent pool upgrade profile. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the agent pool upgrade profile. + Type *string `json:"type,omitempty"` + // AgentPoolUpgradeProfileProperties - Properties of agent pool upgrade profile. + *AgentPoolUpgradeProfileProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for AgentPoolUpgradeProfile. +func (apup AgentPoolUpgradeProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if apup.AgentPoolUpgradeProfileProperties != nil { + objectMap["properties"] = apup.AgentPoolUpgradeProfileProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AgentPoolUpgradeProfile struct. +func (apup *AgentPoolUpgradeProfile) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + apup.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + apup.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + apup.Type = &typeVar + } + case "properties": + if v != nil { + var agentPoolUpgradeProfileProperties AgentPoolUpgradeProfileProperties + err = json.Unmarshal(*v, &agentPoolUpgradeProfileProperties) + if err != nil { + return err + } + apup.AgentPoolUpgradeProfileProperties = &agentPoolUpgradeProfileProperties + } + } + } + + return nil +} + +// AgentPoolUpgradeProfileProperties the list of available upgrade versions. +type AgentPoolUpgradeProfileProperties struct { + // KubernetesVersion - Kubernetes version (major, minor, patch). + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` + // OsType - OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: 'Linux', 'Windows' + OsType OSType `json:"osType,omitempty"` + // Upgrades - List of orchestrator types and versions available for upgrade. + Upgrades *[]AgentPoolUpgradeProfilePropertiesUpgradesItem `json:"upgrades,omitempty"` +} + +// AgentPoolUpgradeProfilePropertiesUpgradesItem ... +type AgentPoolUpgradeProfilePropertiesUpgradesItem struct { + // KubernetesVersion - Kubernetes version (major, minor, patch). + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` + // IsPreview - Whether Kubernetes version is currently in preview. + IsPreview *bool `json:"isPreview,omitempty"` +} + +// CloudError an error response from the Container service. +type CloudError struct { + // Error - Details about the error. + Error *CloudErrorBody `json:"error,omitempty"` +} + +// CloudErrorBody an error response from the Container service. +type CloudErrorBody struct { + // Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + Code *string `json:"code,omitempty"` + // Message - A message describing the error, intended to be suitable for display in a user interface. + Message *string `json:"message,omitempty"` + // Target - The target of the particular error. For example, the name of the property in error. + Target *string `json:"target,omitempty"` + // Details - A list of additional details about the error. + Details *[]CloudErrorBody `json:"details,omitempty"` +} + +// ContainerService container service. +type ContainerService struct { + autorest.Response `json:"-"` + // Properties - Properties of the container service. + *Properties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ContainerService. +func (cs ContainerService) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cs.Properties != nil { + objectMap["properties"] = cs.Properties + } + if cs.Location != nil { + objectMap["location"] = cs.Location + } + if cs.Tags != nil { + objectMap["tags"] = cs.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ContainerService struct. +func (cs *ContainerService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var properties Properties + err = json.Unmarshal(*v, &properties) + if err != nil { + return err + } + cs.Properties = &properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + cs.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cs.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cs.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + cs.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + cs.Tags = tags + } + } + } + + return nil +} + +// ContainerServicesCreateOrUpdateFutureType an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ContainerServicesCreateOrUpdateFutureType struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ContainerServicesCreateOrUpdateFutureType) Result(client ContainerServicesClient) (cs ContainerService, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesCreateOrUpdateFutureType", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerservice.ContainerServicesCreateOrUpdateFutureType") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if cs.Response.Response, err = future.GetResult(sender); err == nil && cs.Response.Response.StatusCode != http.StatusNoContent { + cs, err = client.CreateOrUpdateResponder(cs.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesCreateOrUpdateFutureType", "Result", cs.Response.Response, "Failure responding to request") + } + } + return +} + +// ContainerServicesDeleteFutureType an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ContainerServicesDeleteFutureType struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ContainerServicesDeleteFutureType) Result(client ContainerServicesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesDeleteFutureType", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerservice.ContainerServicesDeleteFutureType") + return + } + ar.Response = future.Response() + return +} + +// CredentialResult the credential result response. +type CredentialResult struct { + // Name - READ-ONLY; The name of the credential. + Name *string `json:"name,omitempty"` + // Value - READ-ONLY; Base64-encoded Kubernetes configuration file. + Value *[]byte `json:"value,omitempty"` +} + +// CredentialResults the list of credential result response. +type CredentialResults struct { + autorest.Response `json:"-"` + // Kubeconfigs - READ-ONLY; Base64-encoded Kubernetes configuration file. + Kubeconfigs *[]CredentialResult `json:"kubeconfigs,omitempty"` +} + +// CustomProfile properties to configure a custom container service cluster. +type CustomProfile struct { + // Orchestrator - The name of the custom orchestrator to use. + Orchestrator *string `json:"orchestrator,omitempty"` +} + +// DiagnosticsProfile profile for diagnostics on the container service cluster. +type DiagnosticsProfile struct { + // VMDiagnostics - Profile for diagnostics on the container service VMs. + VMDiagnostics *VMDiagnostics `json:"vmDiagnostics,omitempty"` +} + +// KeyVaultSecretRef reference to a secret stored in Azure Key Vault. +type KeyVaultSecretRef struct { + // VaultID - Key vault identifier. + VaultID *string `json:"vaultID,omitempty"` + // SecretName - The secret name. + SecretName *string `json:"secretName,omitempty"` + // Version - The secret version. + Version *string `json:"version,omitempty"` +} + +// LinuxProfile profile for Linux VMs in the container service cluster. +type LinuxProfile struct { + // AdminUsername - The administrator username to use for Linux VMs. + AdminUsername *string `json:"adminUsername,omitempty"` + // SSH - SSH configuration for Linux-based VMs running on Azure. + SSH *SSHConfiguration `json:"ssh,omitempty"` +} + +// ListResult the response from the List Container Services operation. +type ListResult struct { + autorest.Response `json:"-"` + // Value - The list of container services. + Value *[]ContainerService `json:"value,omitempty"` + // NextLink - READ-ONLY; The URL to get the next set of container service results. + NextLink *string `json:"nextLink,omitempty"` +} + +// ListResultIterator provides access to a complete listing of ContainerService values. +type ListResultIterator struct { + i int + page ListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ListResultIterator) Response() ListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ListResultIterator) Value() ContainerService { + if !iter.page.NotDone() { + return ContainerService{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ListResultIterator type. +func NewListResultIterator(page ListResultPage) ListResultIterator { + return ListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (lr ListResult) IsEmpty() bool { + return lr.Value == nil || len(*lr.Value) == 0 +} + +// listResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lr ListResult) listResultPreparer(ctx context.Context) (*http.Request, error) { + if lr.NextLink == nil || len(to.String(lr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lr.NextLink))) +} + +// ListResultPage contains a page of ContainerService values. +type ListResultPage struct { + fn func(context.Context, ListResult) (ListResult, error) + lr ListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.lr) + if err != nil { + return err + } + page.lr = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ListResultPage) NotDone() bool { + return !page.lr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ListResultPage) Response() ListResult { + return page.lr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ListResultPage) Values() []ContainerService { + if page.lr.IsEmpty() { + return nil + } + return *page.lr.Value +} + +// Creates a new instance of the ListResultPage type. +func NewListResultPage(getNextPage func(context.Context, ListResult) (ListResult, error)) ListResultPage { + return ListResultPage{fn: getNextPage} +} + +// ManagedCluster managed cluster. +type ManagedCluster struct { + autorest.Response `json:"-"` + // ManagedClusterProperties - Properties of a managed cluster. + *ManagedClusterProperties `json:"properties,omitempty"` + // Identity - The identity of the managed cluster, if configured. + Identity *ManagedClusterIdentity `json:"identity,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ManagedCluster. +func (mc ManagedCluster) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mc.ManagedClusterProperties != nil { + objectMap["properties"] = mc.ManagedClusterProperties + } + if mc.Identity != nil { + objectMap["identity"] = mc.Identity + } + if mc.Location != nil { + objectMap["location"] = mc.Location + } + if mc.Tags != nil { + objectMap["tags"] = mc.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ManagedCluster struct. +func (mc *ManagedCluster) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var managedClusterProperties ManagedClusterProperties + err = json.Unmarshal(*v, &managedClusterProperties) + if err != nil { + return err + } + mc.ManagedClusterProperties = &managedClusterProperties + } + case "identity": + if v != nil { + var identity ManagedClusterIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + mc.Identity = &identity + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mc.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + mc.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + mc.Tags = tags + } + } + } + + return nil +} + +// ManagedClusterAADProfile aADProfile specifies attributes for Azure Active Directory integration. +type ManagedClusterAADProfile struct { + // ClientAppID - The client AAD application ID. + ClientAppID *string `json:"clientAppID,omitempty"` + // ServerAppID - The server AAD application ID. + ServerAppID *string `json:"serverAppID,omitempty"` + // ServerAppSecret - The server AAD application secret. + ServerAppSecret *string `json:"serverAppSecret,omitempty"` + // TenantID - The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. + TenantID *string `json:"tenantID,omitempty"` +} + +// ManagedClusterAccessProfile managed cluster Access Profile. +type ManagedClusterAccessProfile struct { + autorest.Response `json:"-"` + // AccessProfile - AccessProfile of a managed cluster. + *AccessProfile `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ManagedClusterAccessProfile. +func (mcap ManagedClusterAccessProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mcap.AccessProfile != nil { + objectMap["properties"] = mcap.AccessProfile + } + if mcap.Location != nil { + objectMap["location"] = mcap.Location + } + if mcap.Tags != nil { + objectMap["tags"] = mcap.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ManagedClusterAccessProfile struct. +func (mcap *ManagedClusterAccessProfile) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var accessProfile AccessProfile + err = json.Unmarshal(*v, &accessProfile) + if err != nil { + return err + } + mcap.AccessProfile = &accessProfile + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mcap.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mcap.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mcap.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + mcap.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + mcap.Tags = tags + } + } + } + + return nil +} + +// ManagedClusterAddonProfile a Kubernetes add-on profile for a managed cluster. +type ManagedClusterAddonProfile struct { + // Enabled - Whether the add-on is enabled or not. + Enabled *bool `json:"enabled,omitempty"` + // Config - Key-value pairs for configuring an add-on. + Config map[string]*string `json:"config"` +} + +// MarshalJSON is the custom marshaler for ManagedClusterAddonProfile. +func (mcap ManagedClusterAddonProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mcap.Enabled != nil { + objectMap["enabled"] = mcap.Enabled + } + if mcap.Config != nil { + objectMap["config"] = mcap.Config + } + return json.Marshal(objectMap) +} + +// ManagedClusterAgentPoolProfile profile for the container service agent pool. +type ManagedClusterAgentPoolProfile struct { + // Name - Unique name of the agent pool profile in the context of the subscription and resource group. + Name *string `json:"name,omitempty"` + // Count - Number of agents (VMs) to host docker containers. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. + Count *int32 `json:"count,omitempty"` + // VMSize - Size of agent VMs. Possible values include: 'VMSizeTypesStandardA1', 'VMSizeTypesStandardA10', 'VMSizeTypesStandardA11', 'VMSizeTypesStandardA1V2', 'VMSizeTypesStandardA2', 'VMSizeTypesStandardA2V2', 'VMSizeTypesStandardA2mV2', 'VMSizeTypesStandardA3', 'VMSizeTypesStandardA4', 'VMSizeTypesStandardA4V2', 'VMSizeTypesStandardA4mV2', 'VMSizeTypesStandardA5', 'VMSizeTypesStandardA6', 'VMSizeTypesStandardA7', 'VMSizeTypesStandardA8', 'VMSizeTypesStandardA8V2', 'VMSizeTypesStandardA8mV2', 'VMSizeTypesStandardA9', 'VMSizeTypesStandardB2ms', 'VMSizeTypesStandardB2s', 'VMSizeTypesStandardB4ms', 'VMSizeTypesStandardB8ms', 'VMSizeTypesStandardD1', 'VMSizeTypesStandardD11', 'VMSizeTypesStandardD11V2', 'VMSizeTypesStandardD11V2Promo', 'VMSizeTypesStandardD12', 'VMSizeTypesStandardD12V2', 'VMSizeTypesStandardD12V2Promo', 'VMSizeTypesStandardD13', 'VMSizeTypesStandardD13V2', 'VMSizeTypesStandardD13V2Promo', 'VMSizeTypesStandardD14', 'VMSizeTypesStandardD14V2', 'VMSizeTypesStandardD14V2Promo', 'VMSizeTypesStandardD15V2', 'VMSizeTypesStandardD16V3', 'VMSizeTypesStandardD16sV3', 'VMSizeTypesStandardD1V2', 'VMSizeTypesStandardD2', 'VMSizeTypesStandardD2V2', 'VMSizeTypesStandardD2V2Promo', 'VMSizeTypesStandardD2V3', 'VMSizeTypesStandardD2sV3', 'VMSizeTypesStandardD3', 'VMSizeTypesStandardD32V3', 'VMSizeTypesStandardD32sV3', 'VMSizeTypesStandardD3V2', 'VMSizeTypesStandardD3V2Promo', 'VMSizeTypesStandardD4', 'VMSizeTypesStandardD4V2', 'VMSizeTypesStandardD4V2Promo', 'VMSizeTypesStandardD4V3', 'VMSizeTypesStandardD4sV3', 'VMSizeTypesStandardD5V2', 'VMSizeTypesStandardD5V2Promo', 'VMSizeTypesStandardD64V3', 'VMSizeTypesStandardD64sV3', 'VMSizeTypesStandardD8V3', 'VMSizeTypesStandardD8sV3', 'VMSizeTypesStandardDS1', 'VMSizeTypesStandardDS11', 'VMSizeTypesStandardDS11V2', 'VMSizeTypesStandardDS11V2Promo', 'VMSizeTypesStandardDS12', 'VMSizeTypesStandardDS12V2', 'VMSizeTypesStandardDS12V2Promo', 'VMSizeTypesStandardDS13', 'VMSizeTypesStandardDS132V2', 'VMSizeTypesStandardDS134V2', 'VMSizeTypesStandardDS13V2', 'VMSizeTypesStandardDS13V2Promo', 'VMSizeTypesStandardDS14', 'VMSizeTypesStandardDS144V2', 'VMSizeTypesStandardDS148V2', 'VMSizeTypesStandardDS14V2', 'VMSizeTypesStandardDS14V2Promo', 'VMSizeTypesStandardDS15V2', 'VMSizeTypesStandardDS1V2', 'VMSizeTypesStandardDS2', 'VMSizeTypesStandardDS2V2', 'VMSizeTypesStandardDS2V2Promo', 'VMSizeTypesStandardDS3', 'VMSizeTypesStandardDS3V2', 'VMSizeTypesStandardDS3V2Promo', 'VMSizeTypesStandardDS4', 'VMSizeTypesStandardDS4V2', 'VMSizeTypesStandardDS4V2Promo', 'VMSizeTypesStandardDS5V2', 'VMSizeTypesStandardDS5V2Promo', 'VMSizeTypesStandardE16V3', 'VMSizeTypesStandardE16sV3', 'VMSizeTypesStandardE2V3', 'VMSizeTypesStandardE2sV3', 'VMSizeTypesStandardE3216sV3', 'VMSizeTypesStandardE328sV3', 'VMSizeTypesStandardE32V3', 'VMSizeTypesStandardE32sV3', 'VMSizeTypesStandardE4V3', 'VMSizeTypesStandardE4sV3', 'VMSizeTypesStandardE6416sV3', 'VMSizeTypesStandardE6432sV3', 'VMSizeTypesStandardE64V3', 'VMSizeTypesStandardE64sV3', 'VMSizeTypesStandardE8V3', 'VMSizeTypesStandardE8sV3', 'VMSizeTypesStandardF1', 'VMSizeTypesStandardF16', 'VMSizeTypesStandardF16s', 'VMSizeTypesStandardF16sV2', 'VMSizeTypesStandardF1s', 'VMSizeTypesStandardF2', 'VMSizeTypesStandardF2s', 'VMSizeTypesStandardF2sV2', 'VMSizeTypesStandardF32sV2', 'VMSizeTypesStandardF4', 'VMSizeTypesStandardF4s', 'VMSizeTypesStandardF4sV2', 'VMSizeTypesStandardF64sV2', 'VMSizeTypesStandardF72sV2', 'VMSizeTypesStandardF8', 'VMSizeTypesStandardF8s', 'VMSizeTypesStandardF8sV2', 'VMSizeTypesStandardG1', 'VMSizeTypesStandardG2', 'VMSizeTypesStandardG3', 'VMSizeTypesStandardG4', 'VMSizeTypesStandardG5', 'VMSizeTypesStandardGS1', 'VMSizeTypesStandardGS2', 'VMSizeTypesStandardGS3', 'VMSizeTypesStandardGS4', 'VMSizeTypesStandardGS44', 'VMSizeTypesStandardGS48', 'VMSizeTypesStandardGS5', 'VMSizeTypesStandardGS516', 'VMSizeTypesStandardGS58', 'VMSizeTypesStandardH16', 'VMSizeTypesStandardH16m', 'VMSizeTypesStandardH16mr', 'VMSizeTypesStandardH16r', 'VMSizeTypesStandardH8', 'VMSizeTypesStandardH8m', 'VMSizeTypesStandardL16s', 'VMSizeTypesStandardL32s', 'VMSizeTypesStandardL4s', 'VMSizeTypesStandardL8s', 'VMSizeTypesStandardM12832ms', 'VMSizeTypesStandardM12864ms', 'VMSizeTypesStandardM128ms', 'VMSizeTypesStandardM128s', 'VMSizeTypesStandardM6416ms', 'VMSizeTypesStandardM6432ms', 'VMSizeTypesStandardM64ms', 'VMSizeTypesStandardM64s', 'VMSizeTypesStandardNC12', 'VMSizeTypesStandardNC12sV2', 'VMSizeTypesStandardNC12sV3', 'VMSizeTypesStandardNC24', 'VMSizeTypesStandardNC24r', 'VMSizeTypesStandardNC24rsV2', 'VMSizeTypesStandardNC24rsV3', 'VMSizeTypesStandardNC24sV2', 'VMSizeTypesStandardNC24sV3', 'VMSizeTypesStandardNC6', 'VMSizeTypesStandardNC6sV2', 'VMSizeTypesStandardNC6sV3', 'VMSizeTypesStandardND12s', 'VMSizeTypesStandardND24rs', 'VMSizeTypesStandardND24s', 'VMSizeTypesStandardND6s', 'VMSizeTypesStandardNV12', 'VMSizeTypesStandardNV24', 'VMSizeTypesStandardNV6' + VMSize VMSizeTypes `json:"vmSize,omitempty"` + // OsDiskSizeGB - OS Disk Size in GB to be used to specify the disk size for every machine in this master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. + OsDiskSizeGB *int32 `json:"osDiskSizeGB,omitempty"` + // VnetSubnetID - VNet SubnetID specifies the VNet's subnet identifier. + VnetSubnetID *string `json:"vnetSubnetID,omitempty"` + // MaxPods - Maximum number of pods that can run on a node. + MaxPods *int32 `json:"maxPods,omitempty"` + // OsType - OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: 'Linux', 'Windows' + OsType OSType `json:"osType,omitempty"` + // MaxCount - Maximum number of nodes for auto-scaling + MaxCount *int32 `json:"maxCount,omitempty"` + // MinCount - Minimum number of nodes for auto-scaling + MinCount *int32 `json:"minCount,omitempty"` + // EnableAutoScaling - Whether to enable auto-scaler + EnableAutoScaling *bool `json:"enableAutoScaling,omitempty"` + // Type - AgentPoolType represents types of an agent pool. Possible values include: 'VirtualMachineScaleSets', 'AvailabilitySet' + Type AgentPoolType `json:"type,omitempty"` + // OrchestratorVersion - Version of orchestrator specified when creating the managed cluster. + OrchestratorVersion *string `json:"orchestratorVersion,omitempty"` + // ProvisioningState - READ-ONLY; The current deployment or provisioning state, which only appears in the response. + ProvisioningState *string `json:"provisioningState,omitempty"` + // AvailabilityZones - (PREVIEW) Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. + AvailabilityZones *[]string `json:"availabilityZones,omitempty"` + // EnableNodePublicIP - Enable public IP for nodes + EnableNodePublicIP *bool `json:"enableNodePublicIP,omitempty"` + // ScaleSetPriority - ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: 'Low', 'Regular' + ScaleSetPriority ScaleSetPriority `json:"scaleSetPriority,omitempty"` + // ScaleSetEvictionPolicy - ScaleSetEvictionPolicy to be used to specify eviction policy for low priority virtual machine scale set. Default to Delete. Possible values include: 'Delete', 'Deallocate' + ScaleSetEvictionPolicy ScaleSetEvictionPolicy `json:"scaleSetEvictionPolicy,omitempty"` + // NodeTaints - Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. + NodeTaints *[]string `json:"nodeTaints,omitempty"` +} + +// ManagedClusterAgentPoolProfileProperties properties for the container service agent pool profile. +type ManagedClusterAgentPoolProfileProperties struct { + // Count - Number of agents (VMs) to host docker containers. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. + Count *int32 `json:"count,omitempty"` + // VMSize - Size of agent VMs. Possible values include: 'VMSizeTypesStandardA1', 'VMSizeTypesStandardA10', 'VMSizeTypesStandardA11', 'VMSizeTypesStandardA1V2', 'VMSizeTypesStandardA2', 'VMSizeTypesStandardA2V2', 'VMSizeTypesStandardA2mV2', 'VMSizeTypesStandardA3', 'VMSizeTypesStandardA4', 'VMSizeTypesStandardA4V2', 'VMSizeTypesStandardA4mV2', 'VMSizeTypesStandardA5', 'VMSizeTypesStandardA6', 'VMSizeTypesStandardA7', 'VMSizeTypesStandardA8', 'VMSizeTypesStandardA8V2', 'VMSizeTypesStandardA8mV2', 'VMSizeTypesStandardA9', 'VMSizeTypesStandardB2ms', 'VMSizeTypesStandardB2s', 'VMSizeTypesStandardB4ms', 'VMSizeTypesStandardB8ms', 'VMSizeTypesStandardD1', 'VMSizeTypesStandardD11', 'VMSizeTypesStandardD11V2', 'VMSizeTypesStandardD11V2Promo', 'VMSizeTypesStandardD12', 'VMSizeTypesStandardD12V2', 'VMSizeTypesStandardD12V2Promo', 'VMSizeTypesStandardD13', 'VMSizeTypesStandardD13V2', 'VMSizeTypesStandardD13V2Promo', 'VMSizeTypesStandardD14', 'VMSizeTypesStandardD14V2', 'VMSizeTypesStandardD14V2Promo', 'VMSizeTypesStandardD15V2', 'VMSizeTypesStandardD16V3', 'VMSizeTypesStandardD16sV3', 'VMSizeTypesStandardD1V2', 'VMSizeTypesStandardD2', 'VMSizeTypesStandardD2V2', 'VMSizeTypesStandardD2V2Promo', 'VMSizeTypesStandardD2V3', 'VMSizeTypesStandardD2sV3', 'VMSizeTypesStandardD3', 'VMSizeTypesStandardD32V3', 'VMSizeTypesStandardD32sV3', 'VMSizeTypesStandardD3V2', 'VMSizeTypesStandardD3V2Promo', 'VMSizeTypesStandardD4', 'VMSizeTypesStandardD4V2', 'VMSizeTypesStandardD4V2Promo', 'VMSizeTypesStandardD4V3', 'VMSizeTypesStandardD4sV3', 'VMSizeTypesStandardD5V2', 'VMSizeTypesStandardD5V2Promo', 'VMSizeTypesStandardD64V3', 'VMSizeTypesStandardD64sV3', 'VMSizeTypesStandardD8V3', 'VMSizeTypesStandardD8sV3', 'VMSizeTypesStandardDS1', 'VMSizeTypesStandardDS11', 'VMSizeTypesStandardDS11V2', 'VMSizeTypesStandardDS11V2Promo', 'VMSizeTypesStandardDS12', 'VMSizeTypesStandardDS12V2', 'VMSizeTypesStandardDS12V2Promo', 'VMSizeTypesStandardDS13', 'VMSizeTypesStandardDS132V2', 'VMSizeTypesStandardDS134V2', 'VMSizeTypesStandardDS13V2', 'VMSizeTypesStandardDS13V2Promo', 'VMSizeTypesStandardDS14', 'VMSizeTypesStandardDS144V2', 'VMSizeTypesStandardDS148V2', 'VMSizeTypesStandardDS14V2', 'VMSizeTypesStandardDS14V2Promo', 'VMSizeTypesStandardDS15V2', 'VMSizeTypesStandardDS1V2', 'VMSizeTypesStandardDS2', 'VMSizeTypesStandardDS2V2', 'VMSizeTypesStandardDS2V2Promo', 'VMSizeTypesStandardDS3', 'VMSizeTypesStandardDS3V2', 'VMSizeTypesStandardDS3V2Promo', 'VMSizeTypesStandardDS4', 'VMSizeTypesStandardDS4V2', 'VMSizeTypesStandardDS4V2Promo', 'VMSizeTypesStandardDS5V2', 'VMSizeTypesStandardDS5V2Promo', 'VMSizeTypesStandardE16V3', 'VMSizeTypesStandardE16sV3', 'VMSizeTypesStandardE2V3', 'VMSizeTypesStandardE2sV3', 'VMSizeTypesStandardE3216sV3', 'VMSizeTypesStandardE328sV3', 'VMSizeTypesStandardE32V3', 'VMSizeTypesStandardE32sV3', 'VMSizeTypesStandardE4V3', 'VMSizeTypesStandardE4sV3', 'VMSizeTypesStandardE6416sV3', 'VMSizeTypesStandardE6432sV3', 'VMSizeTypesStandardE64V3', 'VMSizeTypesStandardE64sV3', 'VMSizeTypesStandardE8V3', 'VMSizeTypesStandardE8sV3', 'VMSizeTypesStandardF1', 'VMSizeTypesStandardF16', 'VMSizeTypesStandardF16s', 'VMSizeTypesStandardF16sV2', 'VMSizeTypesStandardF1s', 'VMSizeTypesStandardF2', 'VMSizeTypesStandardF2s', 'VMSizeTypesStandardF2sV2', 'VMSizeTypesStandardF32sV2', 'VMSizeTypesStandardF4', 'VMSizeTypesStandardF4s', 'VMSizeTypesStandardF4sV2', 'VMSizeTypesStandardF64sV2', 'VMSizeTypesStandardF72sV2', 'VMSizeTypesStandardF8', 'VMSizeTypesStandardF8s', 'VMSizeTypesStandardF8sV2', 'VMSizeTypesStandardG1', 'VMSizeTypesStandardG2', 'VMSizeTypesStandardG3', 'VMSizeTypesStandardG4', 'VMSizeTypesStandardG5', 'VMSizeTypesStandardGS1', 'VMSizeTypesStandardGS2', 'VMSizeTypesStandardGS3', 'VMSizeTypesStandardGS4', 'VMSizeTypesStandardGS44', 'VMSizeTypesStandardGS48', 'VMSizeTypesStandardGS5', 'VMSizeTypesStandardGS516', 'VMSizeTypesStandardGS58', 'VMSizeTypesStandardH16', 'VMSizeTypesStandardH16m', 'VMSizeTypesStandardH16mr', 'VMSizeTypesStandardH16r', 'VMSizeTypesStandardH8', 'VMSizeTypesStandardH8m', 'VMSizeTypesStandardL16s', 'VMSizeTypesStandardL32s', 'VMSizeTypesStandardL4s', 'VMSizeTypesStandardL8s', 'VMSizeTypesStandardM12832ms', 'VMSizeTypesStandardM12864ms', 'VMSizeTypesStandardM128ms', 'VMSizeTypesStandardM128s', 'VMSizeTypesStandardM6416ms', 'VMSizeTypesStandardM6432ms', 'VMSizeTypesStandardM64ms', 'VMSizeTypesStandardM64s', 'VMSizeTypesStandardNC12', 'VMSizeTypesStandardNC12sV2', 'VMSizeTypesStandardNC12sV3', 'VMSizeTypesStandardNC24', 'VMSizeTypesStandardNC24r', 'VMSizeTypesStandardNC24rsV2', 'VMSizeTypesStandardNC24rsV3', 'VMSizeTypesStandardNC24sV2', 'VMSizeTypesStandardNC24sV3', 'VMSizeTypesStandardNC6', 'VMSizeTypesStandardNC6sV2', 'VMSizeTypesStandardNC6sV3', 'VMSizeTypesStandardND12s', 'VMSizeTypesStandardND24rs', 'VMSizeTypesStandardND24s', 'VMSizeTypesStandardND6s', 'VMSizeTypesStandardNV12', 'VMSizeTypesStandardNV24', 'VMSizeTypesStandardNV6' + VMSize VMSizeTypes `json:"vmSize,omitempty"` + // OsDiskSizeGB - OS Disk Size in GB to be used to specify the disk size for every machine in this master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. + OsDiskSizeGB *int32 `json:"osDiskSizeGB,omitempty"` + // VnetSubnetID - VNet SubnetID specifies the VNet's subnet identifier. + VnetSubnetID *string `json:"vnetSubnetID,omitempty"` + // MaxPods - Maximum number of pods that can run on a node. + MaxPods *int32 `json:"maxPods,omitempty"` + // OsType - OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: 'Linux', 'Windows' + OsType OSType `json:"osType,omitempty"` + // MaxCount - Maximum number of nodes for auto-scaling + MaxCount *int32 `json:"maxCount,omitempty"` + // MinCount - Minimum number of nodes for auto-scaling + MinCount *int32 `json:"minCount,omitempty"` + // EnableAutoScaling - Whether to enable auto-scaler + EnableAutoScaling *bool `json:"enableAutoScaling,omitempty"` + // Type - AgentPoolType represents types of an agent pool. Possible values include: 'VirtualMachineScaleSets', 'AvailabilitySet' + Type AgentPoolType `json:"type,omitempty"` + // OrchestratorVersion - Version of orchestrator specified when creating the managed cluster. + OrchestratorVersion *string `json:"orchestratorVersion,omitempty"` + // ProvisioningState - READ-ONLY; The current deployment or provisioning state, which only appears in the response. + ProvisioningState *string `json:"provisioningState,omitempty"` + // AvailabilityZones - (PREVIEW) Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. + AvailabilityZones *[]string `json:"availabilityZones,omitempty"` + // EnableNodePublicIP - Enable public IP for nodes + EnableNodePublicIP *bool `json:"enableNodePublicIP,omitempty"` + // ScaleSetPriority - ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: 'Low', 'Regular' + ScaleSetPriority ScaleSetPriority `json:"scaleSetPriority,omitempty"` + // ScaleSetEvictionPolicy - ScaleSetEvictionPolicy to be used to specify eviction policy for low priority virtual machine scale set. Default to Delete. Possible values include: 'Delete', 'Deallocate' + ScaleSetEvictionPolicy ScaleSetEvictionPolicy `json:"scaleSetEvictionPolicy,omitempty"` + // NodeTaints - Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. + NodeTaints *[]string `json:"nodeTaints,omitempty"` +} + +// ManagedClusterAPIServerAccessProfile access profile for managed cluster API server. +type ManagedClusterAPIServerAccessProfile struct { + // AuthorizedIPRanges - Authorized IP Ranges to kubernetes API server. + AuthorizedIPRanges *[]string `json:"authorizedIPRanges,omitempty"` + // EnablePrivateCluster - Whether to create the cluster as a private cluster or not. + EnablePrivateCluster *bool `json:"enablePrivateCluster,omitempty"` +} + +// ManagedClusterIdentity identity for the managed cluster. +type ManagedClusterIdentity struct { + // PrincipalID - READ-ONLY; The principal id of the system assigned identity which is used by master components. + PrincipalID *string `json:"principalId,omitempty"` + // TenantID - READ-ONLY; The tenant id of the system assigned identity which is used by master components. + TenantID *string `json:"tenantId,omitempty"` + // Type - The type of identity used for the managed cluster. Type 'SystemAssigned' will use an implicitly created identity in master components and an auto-created user assigned identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, service principal will be used instead. Possible values include: 'SystemAssigned', 'None' + Type ResourceIdentityType `json:"type,omitempty"` +} + +// ManagedClusterListResult the response from the List Managed Clusters operation. +type ManagedClusterListResult struct { + autorest.Response `json:"-"` + // Value - The list of managed clusters. + Value *[]ManagedCluster `json:"value,omitempty"` + // NextLink - READ-ONLY; The URL to get the next set of managed cluster results. + NextLink *string `json:"nextLink,omitempty"` +} + +// ManagedClusterListResultIterator provides access to a complete listing of ManagedCluster values. +type ManagedClusterListResultIterator struct { + i int + page ManagedClusterListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ManagedClusterListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClusterListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ManagedClusterListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ManagedClusterListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ManagedClusterListResultIterator) Response() ManagedClusterListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ManagedClusterListResultIterator) Value() ManagedCluster { + if !iter.page.NotDone() { + return ManagedCluster{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ManagedClusterListResultIterator type. +func NewManagedClusterListResultIterator(page ManagedClusterListResultPage) ManagedClusterListResultIterator { + return ManagedClusterListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (mclr ManagedClusterListResult) IsEmpty() bool { + return mclr.Value == nil || len(*mclr.Value) == 0 +} + +// managedClusterListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (mclr ManagedClusterListResult) managedClusterListResultPreparer(ctx context.Context) (*http.Request, error) { + if mclr.NextLink == nil || len(to.String(mclr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(mclr.NextLink))) +} + +// ManagedClusterListResultPage contains a page of ManagedCluster values. +type ManagedClusterListResultPage struct { + fn func(context.Context, ManagedClusterListResult) (ManagedClusterListResult, error) + mclr ManagedClusterListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ManagedClusterListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClusterListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.mclr) + if err != nil { + return err + } + page.mclr = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ManagedClusterListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ManagedClusterListResultPage) NotDone() bool { + return !page.mclr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ManagedClusterListResultPage) Response() ManagedClusterListResult { + return page.mclr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ManagedClusterListResultPage) Values() []ManagedCluster { + if page.mclr.IsEmpty() { + return nil + } + return *page.mclr.Value +} + +// Creates a new instance of the ManagedClusterListResultPage type. +func NewManagedClusterListResultPage(getNextPage func(context.Context, ManagedClusterListResult) (ManagedClusterListResult, error)) ManagedClusterListResultPage { + return ManagedClusterListResultPage{fn: getNextPage} +} + +// ManagedClusterLoadBalancerProfile profile of the managed cluster load balancer +type ManagedClusterLoadBalancerProfile struct { + // ManagedOutboundIPs - Desired managed outbound IPs for the cluster load balancer. + ManagedOutboundIPs *ManagedClusterLoadBalancerProfileManagedOutboundIPs `json:"managedOutboundIPs,omitempty"` + // OutboundIPPrefixes - Desired outbound IP Prefix resources for the cluster load balancer. + OutboundIPPrefixes *ManagedClusterLoadBalancerProfileOutboundIPPrefixes `json:"outboundIPPrefixes,omitempty"` + // OutboundIPs - Desired outbound IP resources for the cluster load balancer. + OutboundIPs *ManagedClusterLoadBalancerProfileOutboundIPs `json:"outboundIPs,omitempty"` + // EffectiveOutboundIPs - The effective outbound IP resources of the cluster load balancer. + EffectiveOutboundIPs *[]ResourceReference `json:"effectiveOutboundIPs,omitempty"` +} + +// ManagedClusterLoadBalancerProfileManagedOutboundIPs desired managed outbound IPs for the cluster load +// balancer. +type ManagedClusterLoadBalancerProfileManagedOutboundIPs struct { + // Count - Desired number of outbound IP created/managed by Azure for the cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. + Count *int32 `json:"count,omitempty"` +} + +// ManagedClusterLoadBalancerProfileOutboundIPPrefixes desired outbound IP Prefix resources for the cluster +// load balancer. +type ManagedClusterLoadBalancerProfileOutboundIPPrefixes struct { + // PublicIPPrefixes - A list of public IP prefix resources. + PublicIPPrefixes *[]ResourceReference `json:"publicIPPrefixes,omitempty"` +} + +// ManagedClusterLoadBalancerProfileOutboundIPs desired outbound IP resources for the cluster load +// balancer. +type ManagedClusterLoadBalancerProfileOutboundIPs struct { + // PublicIPs - A list of public IP resources. + PublicIPs *[]ResourceReference `json:"publicIPs,omitempty"` +} + +// ManagedClusterPoolUpgradeProfile the list of available upgrade versions. +type ManagedClusterPoolUpgradeProfile struct { + // KubernetesVersion - Kubernetes version (major, minor, patch). + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` + // Name - Pool name. + Name *string `json:"name,omitempty"` + // OsType - OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: 'Linux', 'Windows' + OsType OSType `json:"osType,omitempty"` + // Upgrades - List of orchestrator types and versions available for upgrade. + Upgrades *[]ManagedClusterPoolUpgradeProfileUpgradesItem `json:"upgrades,omitempty"` +} + +// ManagedClusterPoolUpgradeProfileUpgradesItem ... +type ManagedClusterPoolUpgradeProfileUpgradesItem struct { + // KubernetesVersion - Kubernetes version (major, minor, patch). + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` + // IsPreview - Whether Kubernetes version is currently in preview. + IsPreview *bool `json:"isPreview,omitempty"` +} + +// ManagedClusterProperties properties of the managed cluster. +type ManagedClusterProperties struct { + // ProvisioningState - READ-ONLY; The current deployment or provisioning state, which only appears in the response. + ProvisioningState *string `json:"provisioningState,omitempty"` + // MaxAgentPools - READ-ONLY; The max number of agent pools for the managed cluster. + MaxAgentPools *int32 `json:"maxAgentPools,omitempty"` + // KubernetesVersion - Version of Kubernetes specified when creating the managed cluster. + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` + // DNSPrefix - DNS prefix specified when creating the managed cluster. + DNSPrefix *string `json:"dnsPrefix,omitempty"` + // Fqdn - READ-ONLY; FQDN for the master pool. + Fqdn *string `json:"fqdn,omitempty"` + // PrivateFQDN - READ-ONLY; FQDN of private cluster. + PrivateFQDN *string `json:"privateFQDN,omitempty"` + // AgentPoolProfiles - Properties of the agent pool. + AgentPoolProfiles *[]ManagedClusterAgentPoolProfile `json:"agentPoolProfiles,omitempty"` + // LinuxProfile - Profile for Linux VMs in the container service cluster. + LinuxProfile *LinuxProfile `json:"linuxProfile,omitempty"` + // WindowsProfile - Profile for Windows VMs in the container service cluster. + WindowsProfile *ManagedClusterWindowsProfile `json:"windowsProfile,omitempty"` + // ServicePrincipalProfile - Information about a service principal identity for the cluster to use for manipulating Azure APIs. + ServicePrincipalProfile *ManagedClusterServicePrincipalProfile `json:"servicePrincipalProfile,omitempty"` + // AddonProfiles - Profile of managed cluster add-on. + AddonProfiles map[string]*ManagedClusterAddonProfile `json:"addonProfiles"` + // NodeResourceGroup - Name of the resource group containing agent pool nodes. + NodeResourceGroup *string `json:"nodeResourceGroup,omitempty"` + // EnableRBAC - Whether to enable Kubernetes Role-Based Access Control. + EnableRBAC *bool `json:"enableRBAC,omitempty"` + // EnablePodSecurityPolicy - (PREVIEW) Whether to enable Kubernetes Pod security policy. + EnablePodSecurityPolicy *bool `json:"enablePodSecurityPolicy,omitempty"` + // NetworkProfile - Profile of network configuration. + NetworkProfile *NetworkProfileType `json:"networkProfile,omitempty"` + // AadProfile - Profile of Azure Active Directory configuration. + AadProfile *ManagedClusterAADProfile `json:"aadProfile,omitempty"` + // APIServerAccessProfile - Access profile for managed cluster API server. + APIServerAccessProfile *ManagedClusterAPIServerAccessProfile `json:"apiServerAccessProfile,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManagedClusterProperties. +func (mcp ManagedClusterProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mcp.KubernetesVersion != nil { + objectMap["kubernetesVersion"] = mcp.KubernetesVersion + } + if mcp.DNSPrefix != nil { + objectMap["dnsPrefix"] = mcp.DNSPrefix + } + if mcp.AgentPoolProfiles != nil { + objectMap["agentPoolProfiles"] = mcp.AgentPoolProfiles + } + if mcp.LinuxProfile != nil { + objectMap["linuxProfile"] = mcp.LinuxProfile + } + if mcp.WindowsProfile != nil { + objectMap["windowsProfile"] = mcp.WindowsProfile + } + if mcp.ServicePrincipalProfile != nil { + objectMap["servicePrincipalProfile"] = mcp.ServicePrincipalProfile + } + if mcp.AddonProfiles != nil { + objectMap["addonProfiles"] = mcp.AddonProfiles + } + if mcp.NodeResourceGroup != nil { + objectMap["nodeResourceGroup"] = mcp.NodeResourceGroup + } + if mcp.EnableRBAC != nil { + objectMap["enableRBAC"] = mcp.EnableRBAC + } + if mcp.EnablePodSecurityPolicy != nil { + objectMap["enablePodSecurityPolicy"] = mcp.EnablePodSecurityPolicy + } + if mcp.NetworkProfile != nil { + objectMap["networkProfile"] = mcp.NetworkProfile + } + if mcp.AadProfile != nil { + objectMap["aadProfile"] = mcp.AadProfile + } + if mcp.APIServerAccessProfile != nil { + objectMap["apiServerAccessProfile"] = mcp.APIServerAccessProfile + } + return json.Marshal(objectMap) +} + +// ManagedClustersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ManagedClustersCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ManagedClustersCreateOrUpdateFuture) Result(client ManagedClustersClient) (mc ManagedCluster, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mc.Response.Response, err = future.GetResult(sender); err == nil && mc.Response.Response.StatusCode != http.StatusNoContent { + mc, err = client.CreateOrUpdateResponder(mc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersCreateOrUpdateFuture", "Result", mc.Response.Response, "Failure responding to request") + } + } + return +} + +// ManagedClustersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ManagedClustersDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ManagedClustersDeleteFuture) Result(client ManagedClustersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ManagedClusterServicePrincipalProfile information about a service principal identity for the cluster to +// use for manipulating Azure APIs. +type ManagedClusterServicePrincipalProfile struct { + // ClientID - The ID for the service principal. + ClientID *string `json:"clientId,omitempty"` + // Secret - The secret password associated with the service principal in plain text. + Secret *string `json:"secret,omitempty"` +} + +// ManagedClustersResetAADProfileFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ManagedClustersResetAADProfileFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ManagedClustersResetAADProfileFuture) Result(client ManagedClustersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersResetAADProfileFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersResetAADProfileFuture") + return + } + ar.Response = future.Response() + return +} + +// ManagedClustersResetServicePrincipalProfileFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ManagedClustersResetServicePrincipalProfileFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ManagedClustersResetServicePrincipalProfileFuture) Result(client ManagedClustersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersResetServicePrincipalProfileFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersResetServicePrincipalProfileFuture") + return + } + ar.Response = future.Response() + return +} + +// ManagedClustersRotateClusterCertificatesFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ManagedClustersRotateClusterCertificatesFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ManagedClustersRotateClusterCertificatesFuture) Result(client ManagedClustersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersRotateClusterCertificatesFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersRotateClusterCertificatesFuture") + return + } + ar.Response = future.Response() + return +} + +// ManagedClustersUpdateTagsFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ManagedClustersUpdateTagsFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ManagedClustersUpdateTagsFuture) Result(client ManagedClustersClient) (mc ManagedCluster, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersUpdateTagsFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersUpdateTagsFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mc.Response.Response, err = future.GetResult(sender); err == nil && mc.Response.Response.StatusCode != http.StatusNoContent { + mc, err = client.UpdateTagsResponder(mc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersUpdateTagsFuture", "Result", mc.Response.Response, "Failure responding to request") + } + } + return +} + +// ManagedClusterUpgradeProfile the list of available upgrades for compute pools. +type ManagedClusterUpgradeProfile struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Id of upgrade profile. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of upgrade profile. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of upgrade profile. + Type *string `json:"type,omitempty"` + // ManagedClusterUpgradeProfileProperties - Properties of upgrade profile. + *ManagedClusterUpgradeProfileProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManagedClusterUpgradeProfile. +func (mcup ManagedClusterUpgradeProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mcup.ManagedClusterUpgradeProfileProperties != nil { + objectMap["properties"] = mcup.ManagedClusterUpgradeProfileProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ManagedClusterUpgradeProfile struct. +func (mcup *ManagedClusterUpgradeProfile) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mcup.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mcup.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mcup.Type = &typeVar + } + case "properties": + if v != nil { + var managedClusterUpgradeProfileProperties ManagedClusterUpgradeProfileProperties + err = json.Unmarshal(*v, &managedClusterUpgradeProfileProperties) + if err != nil { + return err + } + mcup.ManagedClusterUpgradeProfileProperties = &managedClusterUpgradeProfileProperties + } + } + } + + return nil +} + +// ManagedClusterUpgradeProfileProperties control plane and agent pool upgrade profiles. +type ManagedClusterUpgradeProfileProperties struct { + // ControlPlaneProfile - The list of available upgrade versions for the control plane. + ControlPlaneProfile *ManagedClusterPoolUpgradeProfile `json:"controlPlaneProfile,omitempty"` + // AgentPoolProfiles - The list of available upgrade versions for agent pools. + AgentPoolProfiles *[]ManagedClusterPoolUpgradeProfile `json:"agentPoolProfiles,omitempty"` +} + +// ManagedClusterWindowsProfile profile for Windows VMs in the container service cluster. +type ManagedClusterWindowsProfile struct { + // AdminUsername - The administrator username to use for Windows VMs. + AdminUsername *string `json:"adminUsername,omitempty"` + // AdminPassword - The administrator password to use for Windows VMs. + AdminPassword *string `json:"adminPassword,omitempty"` +} + +// MasterProfile profile for the container service master. +type MasterProfile struct { + // Count - Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. + Count *int32 `json:"count,omitempty"` + // DNSPrefix - DNS prefix to be used to create the FQDN for the master pool. + DNSPrefix *string `json:"dnsPrefix,omitempty"` + // VMSize - Size of agent VMs. Possible values include: 'VMSizeTypesStandardA1', 'VMSizeTypesStandardA10', 'VMSizeTypesStandardA11', 'VMSizeTypesStandardA1V2', 'VMSizeTypesStandardA2', 'VMSizeTypesStandardA2V2', 'VMSizeTypesStandardA2mV2', 'VMSizeTypesStandardA3', 'VMSizeTypesStandardA4', 'VMSizeTypesStandardA4V2', 'VMSizeTypesStandardA4mV2', 'VMSizeTypesStandardA5', 'VMSizeTypesStandardA6', 'VMSizeTypesStandardA7', 'VMSizeTypesStandardA8', 'VMSizeTypesStandardA8V2', 'VMSizeTypesStandardA8mV2', 'VMSizeTypesStandardA9', 'VMSizeTypesStandardB2ms', 'VMSizeTypesStandardB2s', 'VMSizeTypesStandardB4ms', 'VMSizeTypesStandardB8ms', 'VMSizeTypesStandardD1', 'VMSizeTypesStandardD11', 'VMSizeTypesStandardD11V2', 'VMSizeTypesStandardD11V2Promo', 'VMSizeTypesStandardD12', 'VMSizeTypesStandardD12V2', 'VMSizeTypesStandardD12V2Promo', 'VMSizeTypesStandardD13', 'VMSizeTypesStandardD13V2', 'VMSizeTypesStandardD13V2Promo', 'VMSizeTypesStandardD14', 'VMSizeTypesStandardD14V2', 'VMSizeTypesStandardD14V2Promo', 'VMSizeTypesStandardD15V2', 'VMSizeTypesStandardD16V3', 'VMSizeTypesStandardD16sV3', 'VMSizeTypesStandardD1V2', 'VMSizeTypesStandardD2', 'VMSizeTypesStandardD2V2', 'VMSizeTypesStandardD2V2Promo', 'VMSizeTypesStandardD2V3', 'VMSizeTypesStandardD2sV3', 'VMSizeTypesStandardD3', 'VMSizeTypesStandardD32V3', 'VMSizeTypesStandardD32sV3', 'VMSizeTypesStandardD3V2', 'VMSizeTypesStandardD3V2Promo', 'VMSizeTypesStandardD4', 'VMSizeTypesStandardD4V2', 'VMSizeTypesStandardD4V2Promo', 'VMSizeTypesStandardD4V3', 'VMSizeTypesStandardD4sV3', 'VMSizeTypesStandardD5V2', 'VMSizeTypesStandardD5V2Promo', 'VMSizeTypesStandardD64V3', 'VMSizeTypesStandardD64sV3', 'VMSizeTypesStandardD8V3', 'VMSizeTypesStandardD8sV3', 'VMSizeTypesStandardDS1', 'VMSizeTypesStandardDS11', 'VMSizeTypesStandardDS11V2', 'VMSizeTypesStandardDS11V2Promo', 'VMSizeTypesStandardDS12', 'VMSizeTypesStandardDS12V2', 'VMSizeTypesStandardDS12V2Promo', 'VMSizeTypesStandardDS13', 'VMSizeTypesStandardDS132V2', 'VMSizeTypesStandardDS134V2', 'VMSizeTypesStandardDS13V2', 'VMSizeTypesStandardDS13V2Promo', 'VMSizeTypesStandardDS14', 'VMSizeTypesStandardDS144V2', 'VMSizeTypesStandardDS148V2', 'VMSizeTypesStandardDS14V2', 'VMSizeTypesStandardDS14V2Promo', 'VMSizeTypesStandardDS15V2', 'VMSizeTypesStandardDS1V2', 'VMSizeTypesStandardDS2', 'VMSizeTypesStandardDS2V2', 'VMSizeTypesStandardDS2V2Promo', 'VMSizeTypesStandardDS3', 'VMSizeTypesStandardDS3V2', 'VMSizeTypesStandardDS3V2Promo', 'VMSizeTypesStandardDS4', 'VMSizeTypesStandardDS4V2', 'VMSizeTypesStandardDS4V2Promo', 'VMSizeTypesStandardDS5V2', 'VMSizeTypesStandardDS5V2Promo', 'VMSizeTypesStandardE16V3', 'VMSizeTypesStandardE16sV3', 'VMSizeTypesStandardE2V3', 'VMSizeTypesStandardE2sV3', 'VMSizeTypesStandardE3216sV3', 'VMSizeTypesStandardE328sV3', 'VMSizeTypesStandardE32V3', 'VMSizeTypesStandardE32sV3', 'VMSizeTypesStandardE4V3', 'VMSizeTypesStandardE4sV3', 'VMSizeTypesStandardE6416sV3', 'VMSizeTypesStandardE6432sV3', 'VMSizeTypesStandardE64V3', 'VMSizeTypesStandardE64sV3', 'VMSizeTypesStandardE8V3', 'VMSizeTypesStandardE8sV3', 'VMSizeTypesStandardF1', 'VMSizeTypesStandardF16', 'VMSizeTypesStandardF16s', 'VMSizeTypesStandardF16sV2', 'VMSizeTypesStandardF1s', 'VMSizeTypesStandardF2', 'VMSizeTypesStandardF2s', 'VMSizeTypesStandardF2sV2', 'VMSizeTypesStandardF32sV2', 'VMSizeTypesStandardF4', 'VMSizeTypesStandardF4s', 'VMSizeTypesStandardF4sV2', 'VMSizeTypesStandardF64sV2', 'VMSizeTypesStandardF72sV2', 'VMSizeTypesStandardF8', 'VMSizeTypesStandardF8s', 'VMSizeTypesStandardF8sV2', 'VMSizeTypesStandardG1', 'VMSizeTypesStandardG2', 'VMSizeTypesStandardG3', 'VMSizeTypesStandardG4', 'VMSizeTypesStandardG5', 'VMSizeTypesStandardGS1', 'VMSizeTypesStandardGS2', 'VMSizeTypesStandardGS3', 'VMSizeTypesStandardGS4', 'VMSizeTypesStandardGS44', 'VMSizeTypesStandardGS48', 'VMSizeTypesStandardGS5', 'VMSizeTypesStandardGS516', 'VMSizeTypesStandardGS58', 'VMSizeTypesStandardH16', 'VMSizeTypesStandardH16m', 'VMSizeTypesStandardH16mr', 'VMSizeTypesStandardH16r', 'VMSizeTypesStandardH8', 'VMSizeTypesStandardH8m', 'VMSizeTypesStandardL16s', 'VMSizeTypesStandardL32s', 'VMSizeTypesStandardL4s', 'VMSizeTypesStandardL8s', 'VMSizeTypesStandardM12832ms', 'VMSizeTypesStandardM12864ms', 'VMSizeTypesStandardM128ms', 'VMSizeTypesStandardM128s', 'VMSizeTypesStandardM6416ms', 'VMSizeTypesStandardM6432ms', 'VMSizeTypesStandardM64ms', 'VMSizeTypesStandardM64s', 'VMSizeTypesStandardNC12', 'VMSizeTypesStandardNC12sV2', 'VMSizeTypesStandardNC12sV3', 'VMSizeTypesStandardNC24', 'VMSizeTypesStandardNC24r', 'VMSizeTypesStandardNC24rsV2', 'VMSizeTypesStandardNC24rsV3', 'VMSizeTypesStandardNC24sV2', 'VMSizeTypesStandardNC24sV3', 'VMSizeTypesStandardNC6', 'VMSizeTypesStandardNC6sV2', 'VMSizeTypesStandardNC6sV3', 'VMSizeTypesStandardND12s', 'VMSizeTypesStandardND24rs', 'VMSizeTypesStandardND24s', 'VMSizeTypesStandardND6s', 'VMSizeTypesStandardNV12', 'VMSizeTypesStandardNV24', 'VMSizeTypesStandardNV6' + VMSize VMSizeTypes `json:"vmSize,omitempty"` + // OsDiskSizeGB - OS Disk Size in GB to be used to specify the disk size for every machine in this master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. + OsDiskSizeGB *int32 `json:"osDiskSizeGB,omitempty"` + // VnetSubnetID - VNet SubnetID specifies the VNet's subnet identifier. + VnetSubnetID *string `json:"vnetSubnetID,omitempty"` + // FirstConsecutiveStaticIP - FirstConsecutiveStaticIP used to specify the first static ip of masters. + FirstConsecutiveStaticIP *string `json:"firstConsecutiveStaticIP,omitempty"` + // StorageProfile - Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. Possible values include: 'StorageAccount', 'ManagedDisks' + StorageProfile StorageProfileTypes `json:"storageProfile,omitempty"` + // Fqdn - READ-ONLY; FQDN for the master pool. + Fqdn *string `json:"fqdn,omitempty"` +} + +// NetworkProfile represents the OpenShift networking configuration +type NetworkProfile struct { + // VnetCidr - CIDR for the OpenShift Vnet. + VnetCidr *string `json:"vnetCidr,omitempty"` + // PeerVnetID - CIDR of the Vnet to peer. + PeerVnetID *string `json:"peerVnetId,omitempty"` + // VnetID - ID of the Vnet created for OSA cluster. + VnetID *string `json:"vnetId,omitempty"` +} + +// NetworkProfileType profile of network configuration. +type NetworkProfileType struct { + // NetworkPlugin - Network plugin used for building Kubernetes network. Possible values include: 'Azure', 'Kubenet' + NetworkPlugin NetworkPlugin `json:"networkPlugin,omitempty"` + // NetworkPolicy - Network policy used for building Kubernetes network. Possible values include: 'NetworkPolicyCalico', 'NetworkPolicyAzure' + NetworkPolicy NetworkPolicy `json:"networkPolicy,omitempty"` + // PodCidr - A CIDR notation IP range from which to assign pod IPs when kubenet is used. + PodCidr *string `json:"podCidr,omitempty"` + // ServiceCidr - A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. + ServiceCidr *string `json:"serviceCidr,omitempty"` + // DNSServiceIP - An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. + DNSServiceIP *string `json:"dnsServiceIP,omitempty"` + // DockerBridgeCidr - A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes service address range. + DockerBridgeCidr *string `json:"dockerBridgeCidr,omitempty"` + // LoadBalancerSku - The load balancer sku for the managed cluster. Possible values include: 'Standard', 'Basic' + LoadBalancerSku LoadBalancerSku `json:"loadBalancerSku,omitempty"` + // LoadBalancerProfile - Profile of the cluster load balancer. + LoadBalancerProfile *ManagedClusterLoadBalancerProfile `json:"loadBalancerProfile,omitempty"` +} + +// OpenShiftManagedCluster openShift Managed cluster. +type OpenShiftManagedCluster struct { + autorest.Response `json:"-"` + // Plan - Define the resource plan as required by ARM for billing purposes + Plan *PurchasePlan `json:"plan,omitempty"` + // OpenShiftManagedClusterProperties - Properties of a OpenShift managed cluster. + *OpenShiftManagedClusterProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for OpenShiftManagedCluster. +func (osmc OpenShiftManagedCluster) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if osmc.Plan != nil { + objectMap["plan"] = osmc.Plan + } + if osmc.OpenShiftManagedClusterProperties != nil { + objectMap["properties"] = osmc.OpenShiftManagedClusterProperties + } + if osmc.Location != nil { + objectMap["location"] = osmc.Location + } + if osmc.Tags != nil { + objectMap["tags"] = osmc.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for OpenShiftManagedCluster struct. +func (osmc *OpenShiftManagedCluster) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "plan": + if v != nil { + var plan PurchasePlan + err = json.Unmarshal(*v, &plan) + if err != nil { + return err + } + osmc.Plan = &plan + } + case "properties": + if v != nil { + var openShiftManagedClusterProperties OpenShiftManagedClusterProperties + err = json.Unmarshal(*v, &openShiftManagedClusterProperties) + if err != nil { + return err + } + osmc.OpenShiftManagedClusterProperties = &openShiftManagedClusterProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + osmc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + osmc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + osmc.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + osmc.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + osmc.Tags = tags + } + } + } + + return nil +} + +// OpenShiftManagedClusterAADIdentityProvider defines the Identity provider for MS AAD. +type OpenShiftManagedClusterAADIdentityProvider struct { + // ClientID - The clientId password associated with the provider. + ClientID *string `json:"clientId,omitempty"` + // Secret - The secret password associated with the provider. + Secret *string `json:"secret,omitempty"` + // TenantID - The tenantId associated with the provider. + TenantID *string `json:"tenantId,omitempty"` + // CustomerAdminGroupID - The groupId to be granted cluster admin role. + CustomerAdminGroupID *string `json:"customerAdminGroupId,omitempty"` + // Kind - Possible values include: 'KindOpenShiftManagedClusterBaseIdentityProvider', 'KindAADIdentityProvider' + Kind Kind `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for OpenShiftManagedClusterAADIdentityProvider. +func (osmcaip OpenShiftManagedClusterAADIdentityProvider) MarshalJSON() ([]byte, error) { + osmcaip.Kind = KindAADIdentityProvider + objectMap := make(map[string]interface{}) + if osmcaip.ClientID != nil { + objectMap["clientId"] = osmcaip.ClientID + } + if osmcaip.Secret != nil { + objectMap["secret"] = osmcaip.Secret + } + if osmcaip.TenantID != nil { + objectMap["tenantId"] = osmcaip.TenantID + } + if osmcaip.CustomerAdminGroupID != nil { + objectMap["customerAdminGroupId"] = osmcaip.CustomerAdminGroupID + } + if osmcaip.Kind != "" { + objectMap["kind"] = osmcaip.Kind + } + return json.Marshal(objectMap) +} + +// AsOpenShiftManagedClusterAADIdentityProvider is the BasicOpenShiftManagedClusterBaseIdentityProvider implementation for OpenShiftManagedClusterAADIdentityProvider. +func (osmcaip OpenShiftManagedClusterAADIdentityProvider) AsOpenShiftManagedClusterAADIdentityProvider() (*OpenShiftManagedClusterAADIdentityProvider, bool) { + return &osmcaip, true +} + +// AsOpenShiftManagedClusterBaseIdentityProvider is the BasicOpenShiftManagedClusterBaseIdentityProvider implementation for OpenShiftManagedClusterAADIdentityProvider. +func (osmcaip OpenShiftManagedClusterAADIdentityProvider) AsOpenShiftManagedClusterBaseIdentityProvider() (*OpenShiftManagedClusterBaseIdentityProvider, bool) { + return nil, false +} + +// AsBasicOpenShiftManagedClusterBaseIdentityProvider is the BasicOpenShiftManagedClusterBaseIdentityProvider implementation for OpenShiftManagedClusterAADIdentityProvider. +func (osmcaip OpenShiftManagedClusterAADIdentityProvider) AsBasicOpenShiftManagedClusterBaseIdentityProvider() (BasicOpenShiftManagedClusterBaseIdentityProvider, bool) { + return &osmcaip, true +} + +// OpenShiftManagedClusterAgentPoolProfile defines the configuration of the OpenShift cluster VMs. +type OpenShiftManagedClusterAgentPoolProfile struct { + // Name - Unique name of the pool profile in the context of the subscription and resource group. + Name *string `json:"name,omitempty"` + // Count - Number of agents (VMs) to host docker containers. + Count *int32 `json:"count,omitempty"` + // VMSize - Size of agent VMs. Possible values include: 'StandardD2sV3', 'StandardD4sV3', 'StandardD8sV3', 'StandardD16sV3', 'StandardD32sV3', 'StandardD64sV3', 'StandardDS4V2', 'StandardDS5V2', 'StandardF8sV2', 'StandardF16sV2', 'StandardF32sV2', 'StandardF64sV2', 'StandardF72sV2', 'StandardF8s', 'StandardF16s', 'StandardE4sV3', 'StandardE8sV3', 'StandardE16sV3', 'StandardE20sV3', 'StandardE32sV3', 'StandardE64sV3', 'StandardGS2', 'StandardGS3', 'StandardGS4', 'StandardGS5', 'StandardDS12V2', 'StandardDS13V2', 'StandardDS14V2', 'StandardDS15V2', 'StandardL4s', 'StandardL8s', 'StandardL16s', 'StandardL32s' + VMSize OpenShiftContainerServiceVMSize `json:"vmSize,omitempty"` + // SubnetCidr - Subnet CIDR for the peering. + SubnetCidr *string `json:"subnetCidr,omitempty"` + // OsType - OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: 'Linux', 'Windows' + OsType OSType `json:"osType,omitempty"` + // Role - Define the role of the AgentPoolProfile. Possible values include: 'Compute', 'Infra' + Role OpenShiftAgentPoolProfileRole `json:"role,omitempty"` +} + +// OpenShiftManagedClusterAuthProfile defines all possible authentication profiles for the OpenShift +// cluster. +type OpenShiftManagedClusterAuthProfile struct { + // IdentityProviders - Type of authentication profile to use. + IdentityProviders *[]OpenShiftManagedClusterIdentityProvider `json:"identityProviders,omitempty"` +} + +// BasicOpenShiftManagedClusterBaseIdentityProvider structure for any Identity provider. +type BasicOpenShiftManagedClusterBaseIdentityProvider interface { + AsOpenShiftManagedClusterAADIdentityProvider() (*OpenShiftManagedClusterAADIdentityProvider, bool) + AsOpenShiftManagedClusterBaseIdentityProvider() (*OpenShiftManagedClusterBaseIdentityProvider, bool) +} + +// OpenShiftManagedClusterBaseIdentityProvider structure for any Identity provider. +type OpenShiftManagedClusterBaseIdentityProvider struct { + // Kind - Possible values include: 'KindOpenShiftManagedClusterBaseIdentityProvider', 'KindAADIdentityProvider' + Kind Kind `json:"kind,omitempty"` +} + +func unmarshalBasicOpenShiftManagedClusterBaseIdentityProvider(body []byte) (BasicOpenShiftManagedClusterBaseIdentityProvider, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["kind"] { + case string(KindAADIdentityProvider): + var osmcaip OpenShiftManagedClusterAADIdentityProvider + err := json.Unmarshal(body, &osmcaip) + return osmcaip, err + default: + var osmcbip OpenShiftManagedClusterBaseIdentityProvider + err := json.Unmarshal(body, &osmcbip) + return osmcbip, err + } +} +func unmarshalBasicOpenShiftManagedClusterBaseIdentityProviderArray(body []byte) ([]BasicOpenShiftManagedClusterBaseIdentityProvider, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + osmcbipArray := make([]BasicOpenShiftManagedClusterBaseIdentityProvider, len(rawMessages)) + + for index, rawMessage := range rawMessages { + osmcbip, err := unmarshalBasicOpenShiftManagedClusterBaseIdentityProvider(*rawMessage) + if err != nil { + return nil, err + } + osmcbipArray[index] = osmcbip + } + return osmcbipArray, nil +} + +// MarshalJSON is the custom marshaler for OpenShiftManagedClusterBaseIdentityProvider. +func (osmcbip OpenShiftManagedClusterBaseIdentityProvider) MarshalJSON() ([]byte, error) { + osmcbip.Kind = KindOpenShiftManagedClusterBaseIdentityProvider + objectMap := make(map[string]interface{}) + if osmcbip.Kind != "" { + objectMap["kind"] = osmcbip.Kind + } + return json.Marshal(objectMap) +} + +// AsOpenShiftManagedClusterAADIdentityProvider is the BasicOpenShiftManagedClusterBaseIdentityProvider implementation for OpenShiftManagedClusterBaseIdentityProvider. +func (osmcbip OpenShiftManagedClusterBaseIdentityProvider) AsOpenShiftManagedClusterAADIdentityProvider() (*OpenShiftManagedClusterAADIdentityProvider, bool) { + return nil, false +} + +// AsOpenShiftManagedClusterBaseIdentityProvider is the BasicOpenShiftManagedClusterBaseIdentityProvider implementation for OpenShiftManagedClusterBaseIdentityProvider. +func (osmcbip OpenShiftManagedClusterBaseIdentityProvider) AsOpenShiftManagedClusterBaseIdentityProvider() (*OpenShiftManagedClusterBaseIdentityProvider, bool) { + return &osmcbip, true +} + +// AsBasicOpenShiftManagedClusterBaseIdentityProvider is the BasicOpenShiftManagedClusterBaseIdentityProvider implementation for OpenShiftManagedClusterBaseIdentityProvider. +func (osmcbip OpenShiftManagedClusterBaseIdentityProvider) AsBasicOpenShiftManagedClusterBaseIdentityProvider() (BasicOpenShiftManagedClusterBaseIdentityProvider, bool) { + return &osmcbip, true +} + +// OpenShiftManagedClusterIdentityProvider defines the configuration of the identity providers to be used +// in the OpenShift cluster. +type OpenShiftManagedClusterIdentityProvider struct { + // Name - Name of the provider. + Name *string `json:"name,omitempty"` + // Provider - Configuration of the provider. + Provider BasicOpenShiftManagedClusterBaseIdentityProvider `json:"provider,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for OpenShiftManagedClusterIdentityProvider struct. +func (osmcip *OpenShiftManagedClusterIdentityProvider) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + osmcip.Name = &name + } + case "provider": + if v != nil { + provider, err := unmarshalBasicOpenShiftManagedClusterBaseIdentityProvider(*v) + if err != nil { + return err + } + osmcip.Provider = provider + } + } + } + + return nil +} + +// OpenShiftManagedClusterListResult the response from the List OpenShift Managed Clusters operation. +type OpenShiftManagedClusterListResult struct { + autorest.Response `json:"-"` + // Value - The list of OpenShift managed clusters. + Value *[]OpenShiftManagedCluster `json:"value,omitempty"` + // NextLink - READ-ONLY; The URL to get the next set of OpenShift managed cluster results. + NextLink *string `json:"nextLink,omitempty"` +} + +// OpenShiftManagedClusterListResultIterator provides access to a complete listing of +// OpenShiftManagedCluster values. +type OpenShiftManagedClusterListResultIterator struct { + i int + page OpenShiftManagedClusterListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *OpenShiftManagedClusterListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftManagedClusterListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *OpenShiftManagedClusterListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OpenShiftManagedClusterListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter OpenShiftManagedClusterListResultIterator) Response() OpenShiftManagedClusterListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter OpenShiftManagedClusterListResultIterator) Value() OpenShiftManagedCluster { + if !iter.page.NotDone() { + return OpenShiftManagedCluster{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OpenShiftManagedClusterListResultIterator type. +func NewOpenShiftManagedClusterListResultIterator(page OpenShiftManagedClusterListResultPage) OpenShiftManagedClusterListResultIterator { + return OpenShiftManagedClusterListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (osmclr OpenShiftManagedClusterListResult) IsEmpty() bool { + return osmclr.Value == nil || len(*osmclr.Value) == 0 +} + +// openShiftManagedClusterListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (osmclr OpenShiftManagedClusterListResult) openShiftManagedClusterListResultPreparer(ctx context.Context) (*http.Request, error) { + if osmclr.NextLink == nil || len(to.String(osmclr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(osmclr.NextLink))) +} + +// OpenShiftManagedClusterListResultPage contains a page of OpenShiftManagedCluster values. +type OpenShiftManagedClusterListResultPage struct { + fn func(context.Context, OpenShiftManagedClusterListResult) (OpenShiftManagedClusterListResult, error) + osmclr OpenShiftManagedClusterListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *OpenShiftManagedClusterListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftManagedClusterListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.osmclr) + if err != nil { + return err + } + page.osmclr = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *OpenShiftManagedClusterListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OpenShiftManagedClusterListResultPage) NotDone() bool { + return !page.osmclr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OpenShiftManagedClusterListResultPage) Response() OpenShiftManagedClusterListResult { + return page.osmclr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OpenShiftManagedClusterListResultPage) Values() []OpenShiftManagedCluster { + if page.osmclr.IsEmpty() { + return nil + } + return *page.osmclr.Value +} + +// Creates a new instance of the OpenShiftManagedClusterListResultPage type. +func NewOpenShiftManagedClusterListResultPage(getNextPage func(context.Context, OpenShiftManagedClusterListResult) (OpenShiftManagedClusterListResult, error)) OpenShiftManagedClusterListResultPage { + return OpenShiftManagedClusterListResultPage{fn: getNextPage} +} + +// OpenShiftManagedClusterMasterPoolProfile openShiftManagedClusterMaterPoolProfile contains configuration +// for OpenShift master VMs. +type OpenShiftManagedClusterMasterPoolProfile struct { + // Name - Unique name of the master pool profile in the context of the subscription and resource group. + Name *string `json:"name,omitempty"` + // Count - Number of masters (VMs) to host docker containers. The default value is 3. + Count *int32 `json:"count,omitempty"` + // VMSize - Size of agent VMs. Possible values include: 'StandardD2sV3', 'StandardD4sV3', 'StandardD8sV3', 'StandardD16sV3', 'StandardD32sV3', 'StandardD64sV3', 'StandardDS4V2', 'StandardDS5V2', 'StandardF8sV2', 'StandardF16sV2', 'StandardF32sV2', 'StandardF64sV2', 'StandardF72sV2', 'StandardF8s', 'StandardF16s', 'StandardE4sV3', 'StandardE8sV3', 'StandardE16sV3', 'StandardE20sV3', 'StandardE32sV3', 'StandardE64sV3', 'StandardGS2', 'StandardGS3', 'StandardGS4', 'StandardGS5', 'StandardDS12V2', 'StandardDS13V2', 'StandardDS14V2', 'StandardDS15V2', 'StandardL4s', 'StandardL8s', 'StandardL16s', 'StandardL32s' + VMSize OpenShiftContainerServiceVMSize `json:"vmSize,omitempty"` + // SubnetCidr - Subnet CIDR for the peering. + SubnetCidr *string `json:"subnetCidr,omitempty"` + // OsType - OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: 'Linux', 'Windows' + OsType OSType `json:"osType,omitempty"` +} + +// OpenShiftManagedClusterProperties properties of the OpenShift managed cluster. +type OpenShiftManagedClusterProperties struct { + // ProvisioningState - READ-ONLY; The current deployment or provisioning state, which only appears in the response. + ProvisioningState *string `json:"provisioningState,omitempty"` + // OpenShiftVersion - Version of OpenShift specified when creating the cluster. + OpenShiftVersion *string `json:"openShiftVersion,omitempty"` + // ClusterVersion - READ-ONLY; Version of OpenShift specified when creating the cluster. + ClusterVersion *string `json:"clusterVersion,omitempty"` + // PublicHostname - READ-ONLY; Service generated FQDN for OpenShift API server. + PublicHostname *string `json:"publicHostname,omitempty"` + // Fqdn - READ-ONLY; Service generated FQDN for OpenShift API server loadbalancer internal hostname. + Fqdn *string `json:"fqdn,omitempty"` + // NetworkProfile - Configuration for OpenShift networking. + NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` + // RouterProfiles - Configuration for OpenShift router(s). + RouterProfiles *[]OpenShiftRouterProfile `json:"routerProfiles,omitempty"` + // MasterPoolProfile - Configuration for OpenShift master VMs. + MasterPoolProfile *OpenShiftManagedClusterMasterPoolProfile `json:"masterPoolProfile,omitempty"` + // AgentPoolProfiles - Configuration of OpenShift cluster VMs. + AgentPoolProfiles *[]OpenShiftManagedClusterAgentPoolProfile `json:"agentPoolProfiles,omitempty"` + // AuthProfile - Configures OpenShift authentication. + AuthProfile *OpenShiftManagedClusterAuthProfile `json:"authProfile,omitempty"` +} + +// OpenShiftManagedClustersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type OpenShiftManagedClustersCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *OpenShiftManagedClustersCreateOrUpdateFuture) Result(client OpenShiftManagedClustersClient) (osmc OpenShiftManagedCluster, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerservice.OpenShiftManagedClustersCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if osmc.Response.Response, err = future.GetResult(sender); err == nil && osmc.Response.Response.StatusCode != http.StatusNoContent { + osmc, err = client.CreateOrUpdateResponder(osmc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersCreateOrUpdateFuture", "Result", osmc.Response.Response, "Failure responding to request") + } + } + return +} + +// OpenShiftManagedClustersDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type OpenShiftManagedClustersDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *OpenShiftManagedClustersDeleteFuture) Result(client OpenShiftManagedClustersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerservice.OpenShiftManagedClustersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// OpenShiftManagedClustersUpdateTagsFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type OpenShiftManagedClustersUpdateTagsFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *OpenShiftManagedClustersUpdateTagsFuture) Result(client OpenShiftManagedClustersClient) (osmc OpenShiftManagedCluster, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersUpdateTagsFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerservice.OpenShiftManagedClustersUpdateTagsFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if osmc.Response.Response, err = future.GetResult(sender); err == nil && osmc.Response.Response.StatusCode != http.StatusNoContent { + osmc, err = client.UpdateTagsResponder(osmc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersUpdateTagsFuture", "Result", osmc.Response.Response, "Failure responding to request") + } + } + return +} + +// OpenShiftRouterProfile represents an OpenShift router +type OpenShiftRouterProfile struct { + // Name - Name of the router profile. + Name *string `json:"name,omitempty"` + // PublicSubdomain - READ-ONLY; DNS subdomain for OpenShift router. + PublicSubdomain *string `json:"publicSubdomain,omitempty"` + // Fqdn - READ-ONLY; Auto-allocated FQDN for the OpenShift router. + Fqdn *string `json:"fqdn,omitempty"` +} + +// OperationListResult the List Compute Operation operation response. +type OperationListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of compute operations + Value *[]OperationValue `json:"value,omitempty"` +} + +// OperationValue describes the properties of a Compute Operation value. +type OperationValue struct { + // Origin - READ-ONLY; The origin of the compute operation. + Origin *string `json:"origin,omitempty"` + // Name - READ-ONLY; The name of the compute operation. + Name *string `json:"name,omitempty"` + // OperationValueDisplay - Describes the properties of a Compute Operation Value Display. + *OperationValueDisplay `json:"display,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationValue. +func (ov OperationValue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ov.OperationValueDisplay != nil { + objectMap["display"] = ov.OperationValueDisplay + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for OperationValue struct. +func (ov *OperationValue) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "origin": + if v != nil { + var origin string + err = json.Unmarshal(*v, &origin) + if err != nil { + return err + } + ov.Origin = &origin + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ov.Name = &name + } + case "display": + if v != nil { + var operationValueDisplay OperationValueDisplay + err = json.Unmarshal(*v, &operationValueDisplay) + if err != nil { + return err + } + ov.OperationValueDisplay = &operationValueDisplay + } + } + } + + return nil +} + +// OperationValueDisplay describes the properties of a Compute Operation Value Display. +type OperationValueDisplay struct { + // Operation - READ-ONLY; The display name of the compute operation. + Operation *string `json:"operation,omitempty"` + // Resource - READ-ONLY; The display name of the resource the operation applies to. + Resource *string `json:"resource,omitempty"` + // Description - READ-ONLY; The description of the operation. + Description *string `json:"description,omitempty"` + // Provider - READ-ONLY; The resource provider for the operation. + Provider *string `json:"provider,omitempty"` +} + +// OrchestratorProfile contains information about orchestrator. +type OrchestratorProfile struct { + // OrchestratorType - Orchestrator type. + OrchestratorType *string `json:"orchestratorType,omitempty"` + // OrchestratorVersion - Orchestrator version (major, minor, patch). + OrchestratorVersion *string `json:"orchestratorVersion,omitempty"` + // IsPreview - Whether Kubernetes version is currently in preview. + IsPreview *bool `json:"isPreview,omitempty"` +} + +// OrchestratorProfileType profile for the container service orchestrator. +type OrchestratorProfileType struct { + // OrchestratorType - The orchestrator to use to manage container service cluster resources. Valid values are Kubernetes, Swarm, DCOS, DockerCE and Custom. Possible values include: 'Kubernetes', 'Swarm', 'DCOS', 'DockerCE', 'Custom' + OrchestratorType OrchestratorTypes `json:"orchestratorType,omitempty"` + // OrchestratorVersion - The version of the orchestrator to use. You can specify the major.minor.patch part of the actual version.For example, you can specify version as "1.6.11". + OrchestratorVersion *string `json:"orchestratorVersion,omitempty"` +} + +// OrchestratorVersionProfile the profile of an orchestrator and its available versions. +type OrchestratorVersionProfile struct { + // OrchestratorType - Orchestrator type. + OrchestratorType *string `json:"orchestratorType,omitempty"` + // OrchestratorVersion - Orchestrator version (major, minor, patch). + OrchestratorVersion *string `json:"orchestratorVersion,omitempty"` + // Default - Installed by default if version is not specified. + Default *bool `json:"default,omitempty"` + // IsPreview - Whether Kubernetes version is currently in preview. + IsPreview *bool `json:"isPreview,omitempty"` + // Upgrades - The list of available upgrade versions. + Upgrades *[]OrchestratorProfile `json:"upgrades,omitempty"` +} + +// OrchestratorVersionProfileListResult the list of versions for supported orchestrators. +type OrchestratorVersionProfileListResult struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Id of the orchestrator version profile list result. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the orchestrator version profile list result. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the orchestrator version profile list result. + Type *string `json:"type,omitempty"` + // OrchestratorVersionProfileProperties - The properties of an orchestrator version profile. + *OrchestratorVersionProfileProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for OrchestratorVersionProfileListResult. +func (ovplr OrchestratorVersionProfileListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ovplr.OrchestratorVersionProfileProperties != nil { + objectMap["properties"] = ovplr.OrchestratorVersionProfileProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for OrchestratorVersionProfileListResult struct. +func (ovplr *OrchestratorVersionProfileListResult) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ovplr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ovplr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ovplr.Type = &typeVar + } + case "properties": + if v != nil { + var orchestratorVersionProfileProperties OrchestratorVersionProfileProperties + err = json.Unmarshal(*v, &orchestratorVersionProfileProperties) + if err != nil { + return err + } + ovplr.OrchestratorVersionProfileProperties = &orchestratorVersionProfileProperties + } + } + } + + return nil +} + +// OrchestratorVersionProfileProperties the properties of an orchestrator version profile. +type OrchestratorVersionProfileProperties struct { + // Orchestrators - List of orchestrator version profiles. + Orchestrators *[]OrchestratorVersionProfile `json:"orchestrators,omitempty"` +} + +// Properties properties of the container service. +type Properties struct { + // ProvisioningState - READ-ONLY; The current deployment or provisioning state, which only appears in the response. + ProvisioningState *string `json:"provisioningState,omitempty"` + // OrchestratorProfile - Profile for the container service orchestrator. + OrchestratorProfile *OrchestratorProfileType `json:"orchestratorProfile,omitempty"` + // CustomProfile - Properties to configure a custom container service cluster. + CustomProfile *CustomProfile `json:"customProfile,omitempty"` + // ServicePrincipalProfile - Information about a service principal identity for the cluster to use for manipulating Azure APIs. Exact one of secret or keyVaultSecretRef need to be specified. + ServicePrincipalProfile *ServicePrincipalProfile `json:"servicePrincipalProfile,omitempty"` + // MasterProfile - Profile for the container service master. + MasterProfile *MasterProfile `json:"masterProfile,omitempty"` + // AgentPoolProfiles - Properties of the agent pool. + AgentPoolProfiles *[]AgentPoolProfile `json:"agentPoolProfiles,omitempty"` + // WindowsProfile - Profile for Windows VMs in the container service cluster. + WindowsProfile *WindowsProfile `json:"windowsProfile,omitempty"` + // LinuxProfile - Profile for Linux VMs in the container service cluster. + LinuxProfile *LinuxProfile `json:"linuxProfile,omitempty"` + // DiagnosticsProfile - Profile for diagnostics in the container service cluster. + DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` +} + +// PurchasePlan used for establishing the purchase context of any 3rd Party artifact through MarketPlace. +type PurchasePlan struct { + // Name - The plan ID. + Name *string `json:"name,omitempty"` + // Product - Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. + Product *string `json:"product,omitempty"` + // PromotionCode - The promotion code. + PromotionCode *string `json:"promotionCode,omitempty"` + // Publisher - The plan ID. + Publisher *string `json:"publisher,omitempty"` +} + +// Resource the Resource model definition. +type Resource struct { + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + return json.Marshal(objectMap) +} + +// ResourceReference a reference to an Azure resource. +type ResourceReference struct { + // ID - The fully qualified Azure resource id. + ID *string `json:"id,omitempty"` +} + +// ServicePrincipalProfile information about a service principal identity for the cluster to use for +// manipulating Azure APIs. Either secret or keyVaultSecretRef must be specified. +type ServicePrincipalProfile struct { + // ClientID - The ID for the service principal. + ClientID *string `json:"clientId,omitempty"` + // Secret - The secret password associated with the service principal in plain text. + Secret *string `json:"secret,omitempty"` + // KeyVaultSecretRef - Reference to a secret stored in Azure Key Vault. + KeyVaultSecretRef *KeyVaultSecretRef `json:"keyVaultSecretRef,omitempty"` +} + +// SSHConfiguration SSH configuration for Linux-based VMs running on Azure. +type SSHConfiguration struct { + // PublicKeys - The list of SSH public keys used to authenticate with Linux-based VMs. Only expect one key specified. + PublicKeys *[]SSHPublicKey `json:"publicKeys,omitempty"` +} + +// SSHPublicKey contains information about SSH certificate public key data. +type SSHPublicKey struct { + // KeyData - Certificate public key used to authenticate with VMs through SSH. The certificate must be in PEM format with or without headers. + KeyData *string `json:"keyData,omitempty"` +} + +// SubResource reference to another subresource. +type SubResource struct { + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` +} + +// TagsObject tags object for patch operations. +type TagsObject struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for TagsObject. +func (toVar TagsObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if toVar.Tags != nil { + objectMap["tags"] = toVar.Tags + } + return json.Marshal(objectMap) +} + +// VMDiagnostics profile for diagnostics on the container service VMs. +type VMDiagnostics struct { + // Enabled - Whether the VM diagnostic agent is provisioned on the VM. + Enabled *bool `json:"enabled,omitempty"` + // StorageURI - READ-ONLY; The URI of the storage account where diagnostics are stored. + StorageURI *string `json:"storageUri,omitempty"` +} + +// WindowsProfile profile for Windows VMs in the container service cluster. +type WindowsProfile struct { + // AdminUsername - The administrator username to use for Windows VMs. + AdminUsername *string `json:"adminUsername,omitempty"` + // AdminPassword - The administrator password to use for Windows VMs. + AdminPassword *string `json:"adminPassword,omitempty"` +} diff --git a/services/containerservice/mgmt/2019-10-01/containerservice/openshiftmanagedclusters.go b/services/containerservice/mgmt/2019-10-01/containerservice/openshiftmanagedclusters.go new file mode 100644 index 000000000000..ac574f3c4121 --- /dev/null +++ b/services/containerservice/mgmt/2019-10-01/containerservice/openshiftmanagedclusters.go @@ -0,0 +1,617 @@ +package containerservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// OpenShiftManagedClustersClient is the the Container Service Client. +type OpenShiftManagedClustersClient struct { + BaseClient +} + +// NewOpenShiftManagedClustersClient creates an instance of the OpenShiftManagedClustersClient client. +func NewOpenShiftManagedClustersClient(subscriptionID string) OpenShiftManagedClustersClient { + return NewOpenShiftManagedClustersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOpenShiftManagedClustersClientWithBaseURI creates an instance of the OpenShiftManagedClustersClient client. +func NewOpenShiftManagedClustersClientWithBaseURI(baseURI string, subscriptionID string) OpenShiftManagedClustersClient { + return OpenShiftManagedClustersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a OpenShift managed cluster with the specified configuration for agents and +// OpenShift version. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the OpenShift managed cluster resource. +// parameters - parameters supplied to the Create or Update an OpenShift Managed Cluster operation. +func (client OpenShiftManagedClustersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters OpenShiftManagedCluster) (result OpenShiftManagedClustersCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftManagedClustersClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.OpenShiftManagedClusterProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.OpenShiftManagedClusterProperties.OpenShiftVersion", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.OpenShiftManagedClusterProperties.MasterPoolProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.OpenShiftManagedClusterProperties.MasterPoolProfile.Count", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("containerservice.OpenShiftManagedClustersClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client OpenShiftManagedClustersClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, parameters OpenShiftManagedCluster) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-04-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client OpenShiftManagedClustersClient) CreateOrUpdateSender(req *http.Request) (future OpenShiftManagedClustersCreateOrUpdateFuture, err error) { + 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 OpenShiftManagedClustersClient) CreateOrUpdateResponder(resp *http.Response) (result OpenShiftManagedCluster, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the OpenShift managed cluster with a specified resource group and name. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the OpenShift managed cluster resource. +func (client OpenShiftManagedClustersClient) Delete(ctx context.Context, resourceGroupName string, resourceName string) (result OpenShiftManagedClustersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftManagedClustersClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.OpenShiftManagedClustersClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client OpenShiftManagedClustersClient) DeletePreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-04-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client OpenShiftManagedClustersClient) DeleteSender(req *http.Request) (future OpenShiftManagedClustersDeleteFuture, err error) { + 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 OpenShiftManagedClustersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of the managed OpenShift cluster with a specified resource group and name. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the OpenShift managed cluster resource. +func (client OpenShiftManagedClustersClient) Get(ctx context.Context, resourceGroupName string, resourceName string) (result OpenShiftManagedCluster, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftManagedClustersClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.OpenShiftManagedClustersClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client OpenShiftManagedClustersClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-04-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client OpenShiftManagedClustersClient) GetSender(req *http.Request) (*http.Response, error) { + 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 OpenShiftManagedClustersClient) GetResponder(resp *http.Response) (result OpenShiftManagedCluster, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets a list of OpenShift managed clusters in the specified subscription. The operation returns properties of +// each OpenShift managed cluster. +func (client OpenShiftManagedClustersClient) List(ctx context.Context) (result OpenShiftManagedClusterListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftManagedClustersClient.List") + defer func() { + sc := -1 + if result.osmclr.Response.Response != nil { + sc = result.osmclr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.osmclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "List", resp, "Failure sending request") + return + } + + result.osmclr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client OpenShiftManagedClustersClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-04-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/openShiftManagedClusters", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OpenShiftManagedClustersClient) ListSender(req *http.Request) (*http.Response, error) { + 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 OpenShiftManagedClustersClient) ListResponder(resp *http.Response) (result OpenShiftManagedClusterListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client OpenShiftManagedClustersClient) listNextResults(ctx context.Context, lastResults OpenShiftManagedClusterListResult) (result OpenShiftManagedClusterListResult, err error) { + req, err := lastResults.openShiftManagedClusterListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client OpenShiftManagedClustersClient) ListComplete(ctx context.Context) (result OpenShiftManagedClusterListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftManagedClustersClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByResourceGroup lists OpenShift managed clusters in the specified subscription and resource group. The operation +// returns properties of each OpenShift managed cluster. +// Parameters: +// resourceGroupName - the name of the resource group. +func (client OpenShiftManagedClustersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result OpenShiftManagedClusterListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftManagedClustersClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.osmclr.Response.Response != nil { + sc = result.osmclr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.OpenShiftManagedClustersClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.osmclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.osmclr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client OpenShiftManagedClustersClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-04-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client OpenShiftManagedClustersClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + 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 OpenShiftManagedClustersClient) ListByResourceGroupResponder(resp *http.Response) (result OpenShiftManagedClusterListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client OpenShiftManagedClustersClient) listByResourceGroupNextResults(ctx context.Context, lastResults OpenShiftManagedClusterListResult) (result OpenShiftManagedClusterListResult, err error) { + req, err := lastResults.openShiftManagedClusterListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client OpenShiftManagedClustersClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result OpenShiftManagedClusterListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftManagedClustersClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// UpdateTags updates an OpenShift managed cluster with the specified tags. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the OpenShift managed cluster resource. +// parameters - parameters supplied to the Update OpenShift Managed Cluster Tags operation. +func (client OpenShiftManagedClustersClient) UpdateTags(ctx context.Context, resourceGroupName string, resourceName string, parameters TagsObject) (result OpenShiftManagedClustersUpdateTagsFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftManagedClustersClient.UpdateTags") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.OpenShiftManagedClustersClient", "UpdateTags", err.Error()) + } + + req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, resourceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "UpdateTags", nil, "Failure preparing request") + return + } + + result, err = client.UpdateTagsSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "UpdateTags", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateTagsPreparer prepares the UpdateTags request. +func (client OpenShiftManagedClustersClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, resourceName string, parameters TagsObject) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-04-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateTagsSender sends the UpdateTags request. The method will close the +// http.Response Body if it receives an error. +func (client OpenShiftManagedClustersClient) UpdateTagsSender(req *http.Request) (future OpenShiftManagedClustersUpdateTagsFuture, err error) { + 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 +} + +// UpdateTagsResponder handles the response to the UpdateTags request. The method always +// closes the http.Response Body. +func (client OpenShiftManagedClustersClient) UpdateTagsResponder(resp *http.Response) (result OpenShiftManagedCluster, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/containerservice/mgmt/2019-10-01/containerservice/operations.go b/services/containerservice/mgmt/2019-10-01/containerservice/operations.go new file mode 100644 index 000000000000..978c301f731c --- /dev/null +++ b/services/containerservice/mgmt/2019-10-01/containerservice/operations.go @@ -0,0 +1,109 @@ +package containerservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// OperationsClient is the the Container Service Client. +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client. +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List gets a list of compute operations. +func (client OperationsClient) List(ctx context.Context) (result OperationListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.OperationsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OperationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.ContainerService/operations"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + 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 +} diff --git a/services/containerservice/mgmt/2019-10-01/containerservice/version.go b/services/containerservice/mgmt/2019-10-01/containerservice/version.go new file mode 100644 index 000000000000..8c5a50141b93 --- /dev/null +++ b/services/containerservice/mgmt/2019-10-01/containerservice/version.go @@ -0,0 +1,30 @@ +package containerservice + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + version.Number + " containerservice/2019-10-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/costmanagement/mgmt/2019-10-01/costmanagement/client.go b/services/costmanagement/mgmt/2019-10-01/costmanagement/client.go new file mode 100644 index 000000000000..4b604b5ee4e5 --- /dev/null +++ b/services/costmanagement/mgmt/2019-10-01/costmanagement/client.go @@ -0,0 +1,51 @@ +// Package costmanagement implements the Azure ARM Costmanagement service API version 2019-10-01. +// +// +package costmanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the 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 Costmanagement + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Costmanagement. +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/costmanagement/mgmt/2019-10-01/costmanagement/costmanagementapi/interfaces.go b/services/costmanagement/mgmt/2019-10-01/costmanagement/costmanagementapi/interfaces.go new file mode 100644 index 000000000000..99f0991e8484 --- /dev/null +++ b/services/costmanagement/mgmt/2019-10-01/costmanagement/costmanagementapi/interfaces.go @@ -0,0 +1,57 @@ +package costmanagementapi + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by 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/costmanagement/mgmt/2019-10-01/costmanagement" + "github.com/Azure/go-autorest/autorest" +) + +// DimensionsClientAPI contains the set of methods on the DimensionsClient type. +type DimensionsClientAPI interface { + List(ctx context.Context, scope string, filter string, expand string, skiptoken string, top *int32) (result costmanagement.DimensionsListResult, err error) +} + +var _ DimensionsClientAPI = (*costmanagement.DimensionsClient)(nil) + +// QueryClientAPI contains the set of methods on the QueryClient type. +type QueryClientAPI interface { + Usage(ctx context.Context, scope string, parameters costmanagement.QueryDefinition) (result costmanagement.QueryResult, err error) +} + +var _ QueryClientAPI = (*costmanagement.QueryClient)(nil) + +// ExportsClientAPI contains the set of methods on the ExportsClient type. +type ExportsClientAPI interface { + CreateOrUpdate(ctx context.Context, scope string, exportName string, parameters costmanagement.Export) (result costmanagement.Export, err error) + Delete(ctx context.Context, scope string, exportName string) (result autorest.Response, err error) + Execute(ctx context.Context, scope string, exportName string) (result autorest.Response, err error) + Get(ctx context.Context, scope string, exportName string) (result costmanagement.Export, err error) + GetExecutionHistory(ctx context.Context, scope string, exportName string) (result costmanagement.ExportExecutionListResult, err error) + List(ctx context.Context, scope string) (result costmanagement.ExportListResult, err error) +} + +var _ ExportsClientAPI = (*costmanagement.ExportsClient)(nil) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result costmanagement.OperationListResultPage, err error) +} + +var _ OperationsClientAPI = (*costmanagement.OperationsClient)(nil) diff --git a/services/costmanagement/mgmt/2019-10-01/costmanagement/dimensions.go b/services/costmanagement/mgmt/2019-10-01/costmanagement/dimensions.go new file mode 100644 index 000000000000..304cf2898f40 --- /dev/null +++ b/services/costmanagement/mgmt/2019-10-01/costmanagement/dimensions.go @@ -0,0 +1,158 @@ +package costmanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the 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" +) + +// DimensionsClient is the client for the Dimensions methods of the Costmanagement service. +type DimensionsClient struct { + BaseClient +} + +// NewDimensionsClient creates an instance of the DimensionsClient client. +func NewDimensionsClient(subscriptionID string) DimensionsClient { + return NewDimensionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDimensionsClientWithBaseURI creates an instance of the DimensionsClient client. +func NewDimensionsClientWithBaseURI(baseURI string, subscriptionID string) DimensionsClient { + return DimensionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists the dimensions by the defined scope. +// Parameters: +// scope - the scope associated with dimension operations. This includes '/subscriptions/{subscriptionId}/' for +// subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup +// scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department +// scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' +// for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for +// Management Group scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for +// billingProfile scope, +// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' +// for invoiceSection scope, and +// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for +// partners. +// filter - may be used to filter dimensions by properties/category, properties/usageStart, +// properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'. +// expand - may be used to expand the properties/data within a dimension category. By default, data is not +// included when listing dimensions. +// 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. +// top - may be used to limit the number of results to the most recent N dimension data. +func (client DimensionsClient) List(ctx context.Context, scope string, filter string, expand string, skiptoken string, top *int32) (result DimensionsListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DimensionsClient.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: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, + {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("costmanagement.DimensionsClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, scope, filter, expand, skiptoken, top) + if err != nil { + err = autorest.NewErrorWithError(err, "costmanagement.DimensionsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "costmanagement.DimensionsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "costmanagement.DimensionsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client DimensionsClient) ListPreparer(ctx context.Context, scope string, filter string, expand string, skiptoken string, top *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "scope": scope, + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + if len(skiptoken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skiptoken) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{scope}/providers/Microsoft.CostManagement/dimensions", 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 DimensionsClient) 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 DimensionsClient) ListResponder(resp *http.Response) (result DimensionsListResult, 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/costmanagement/mgmt/2019-10-01/costmanagement/exports.go b/services/costmanagement/mgmt/2019-10-01/costmanagement/exports.go new file mode 100644 index 000000000000..9042b6af21cc --- /dev/null +++ b/services/costmanagement/mgmt/2019-10-01/costmanagement/exports.go @@ -0,0 +1,593 @@ +package costmanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the 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" +) + +// ExportsClient is the client for the Exports methods of the Costmanagement service. +type ExportsClient struct { + BaseClient +} + +// NewExportsClient creates an instance of the ExportsClient client. +func NewExportsClient(subscriptionID string) ExportsClient { + return NewExportsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewExportsClientWithBaseURI creates an instance of the ExportsClient client. +func NewExportsClientWithBaseURI(baseURI string, subscriptionID string) ExportsClient { + return ExportsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate the operation to create or update a export. Update operation requires latest eTag to be set in the +// request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag. +// Parameters: +// scope - the scope associated with query and export operations. This includes +// '/subscriptions/{subscriptionId}/' for subscription scope, +// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department +// scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' +// for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for +// Management Group scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for +// billingProfile scope, +// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' +// for invoiceSection scope, and +// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for +// partners. +// exportName - export Name. +// parameters - parameters supplied to the CreateOrUpdate Export operation. +func (client ExportsClient) CreateOrUpdate(ctx context.Context, scope string, exportName string, parameters Export) (result Export, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExportsClient.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: parameters, + Constraints: []validation.Constraint{{Target: "parameters.ExportProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ExportProperties.Schedule", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ExportProperties.Schedule.RecurrencePeriod", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ExportProperties.Schedule.RecurrencePeriod.From", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + }}}}}); err != nil { + return result, validation.NewError("costmanagement.ExportsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, scope, exportName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ExportsClient) CreateOrUpdatePreparer(ctx context.Context, scope string, exportName string, parameters Export) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "exportName": autorest.Encode("path", exportName), + "scope": scope, + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{scope}/providers/Microsoft.CostManagement/exports/{exportName}", 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 ExportsClient) 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 ExportsClient) CreateOrUpdateResponder(resp *http.Response) (result Export, 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 the operation to delete a export. +// Parameters: +// scope - the scope associated with query and export operations. This includes +// '/subscriptions/{subscriptionId}/' for subscription scope, +// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department +// scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' +// for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for +// Management Group scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for +// billingProfile scope, +// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' +// for invoiceSection scope, and +// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for +// partners. +// exportName - export Name. +func (client ExportsClient) Delete(ctx context.Context, scope string, exportName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExportsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, scope, exportName) + if err != nil { + err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ExportsClient) DeletePreparer(ctx context.Context, scope string, exportName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "exportName": autorest.Encode("path", exportName), + "scope": scope, + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{scope}/providers/Microsoft.CostManagement/exports/{exportName}", 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 ExportsClient) 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 ExportsClient) 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 +} + +// Execute the operation to execute a export. +// Parameters: +// scope - the scope associated with query and export operations. This includes +// '/subscriptions/{subscriptionId}/' for subscription scope, +// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department +// scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' +// for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for +// Management Group scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for +// billingProfile scope, +// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' +// for invoiceSection scope, and +// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for +// partners. +// exportName - export Name. +func (client ExportsClient) Execute(ctx context.Context, scope string, exportName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExportsClient.Execute") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ExecutePreparer(ctx, scope, exportName) + if err != nil { + err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "Execute", nil, "Failure preparing request") + return + } + + resp, err := client.ExecuteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "Execute", resp, "Failure sending request") + return + } + + result, err = client.ExecuteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "Execute", resp, "Failure responding to request") + } + + return +} + +// ExecutePreparer prepares the Execute request. +func (client ExportsClient) ExecutePreparer(ctx context.Context, scope string, exportName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "exportName": autorest.Encode("path", exportName), + "scope": scope, + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/run", pathParameters), + autorest.WithQueryParameters(queryParameters)) + 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 ExportsClient) ExecuteSender(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...) +} + +// ExecuteResponder handles the response to the Execute request. The method always +// closes the http.Response Body. +func (client ExportsClient) ExecuteResponder(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 the operation to get the export for the defined scope by export name. +// Parameters: +// scope - the scope associated with query and export operations. This includes +// '/subscriptions/{subscriptionId}/' for subscription scope, +// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department +// scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' +// for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for +// Management Group scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for +// billingProfile scope, +// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' +// for invoiceSection scope, and +// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for +// partners. +// exportName - export Name. +func (client ExportsClient) Get(ctx context.Context, scope string, exportName string) (result Export, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExportsClient.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, exportName) + if err != nil { + err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ExportsClient) GetPreparer(ctx context.Context, scope string, exportName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "exportName": autorest.Encode("path", exportName), + "scope": scope, + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{scope}/providers/Microsoft.CostManagement/exports/{exportName}", 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 ExportsClient) 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 ExportsClient) GetResponder(resp *http.Response) (result Export, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetExecutionHistory the operation to get the execution history of an export for the defined scope by export name. +// Parameters: +// scope - the scope associated with query and export operations. This includes +// '/subscriptions/{subscriptionId}/' for subscription scope, +// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department +// scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' +// for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for +// Management Group scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for +// billingProfile scope, +// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' +// for invoiceSection scope, and +// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for +// partners. +// exportName - export Name. +func (client ExportsClient) GetExecutionHistory(ctx context.Context, scope string, exportName string) (result ExportExecutionListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExportsClient.GetExecutionHistory") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetExecutionHistoryPreparer(ctx, scope, exportName) + if err != nil { + err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "GetExecutionHistory", nil, "Failure preparing request") + return + } + + resp, err := client.GetExecutionHistorySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "GetExecutionHistory", resp, "Failure sending request") + return + } + + result, err = client.GetExecutionHistoryResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "GetExecutionHistory", resp, "Failure responding to request") + } + + return +} + +// GetExecutionHistoryPreparer prepares the GetExecutionHistory request. +func (client ExportsClient) GetExecutionHistoryPreparer(ctx context.Context, scope string, exportName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "exportName": autorest.Encode("path", exportName), + "scope": scope, + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/runHistory", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetExecutionHistorySender sends the GetExecutionHistory request. The method will close the +// http.Response Body if it receives an error. +func (client ExportsClient) GetExecutionHistorySender(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...) +} + +// GetExecutionHistoryResponder handles the response to the GetExecutionHistory request. The method always +// closes the http.Response Body. +func (client ExportsClient) GetExecutionHistoryResponder(resp *http.Response) (result ExportExecutionListResult, 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 the operation to list all exports at the given scope. +// Parameters: +// scope - the scope associated with query and export operations. This includes +// '/subscriptions/{subscriptionId}/' for subscription scope, +// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department +// scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' +// for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for +// Management Group scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for +// billingProfile scope, +// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' +// for invoiceSection scope, and +// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for +// partners. +func (client ExportsClient) List(ctx context.Context, scope string) (result ExportListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExportsClient.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, scope) + if err != nil { + err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ExportsClient) ListPreparer(ctx context.Context, scope string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "scope": scope, + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{scope}/providers/Microsoft.CostManagement/exports", 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 ExportsClient) 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 ExportsClient) ListResponder(resp *http.Response) (result ExportListResult, 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/costmanagement/mgmt/2019-10-01/costmanagement/models.go b/services/costmanagement/mgmt/2019-10-01/costmanagement/models.go new file mode 100644 index 000000000000..edc00a3dc0c2 --- /dev/null +++ b/services/costmanagement/mgmt/2019-10-01/costmanagement/models.go @@ -0,0 +1,966 @@ +package costmanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2019-10-01/costmanagement" + +// ExecutionStatus enumerates the values for execution status. +type ExecutionStatus string + +const ( + // Completed ... + Completed ExecutionStatus = "Completed" + // DataNotAvailable ... + DataNotAvailable ExecutionStatus = "DataNotAvailable" + // Failed ... + Failed ExecutionStatus = "Failed" + // InProgress ... + InProgress ExecutionStatus = "InProgress" + // NewDataNotAvailable ... + NewDataNotAvailable ExecutionStatus = "NewDataNotAvailable" + // Queued ... + Queued ExecutionStatus = "Queued" + // Timeout ... + Timeout ExecutionStatus = "Timeout" +) + +// PossibleExecutionStatusValues returns an array of possible values for the ExecutionStatus const type. +func PossibleExecutionStatusValues() []ExecutionStatus { + return []ExecutionStatus{Completed, DataNotAvailable, Failed, InProgress, NewDataNotAvailable, Queued, Timeout} +} + +// ExecutionType enumerates the values for execution type. +type ExecutionType string + +const ( + // OnDemand ... + OnDemand ExecutionType = "OnDemand" + // Scheduled ... + Scheduled ExecutionType = "Scheduled" +) + +// PossibleExecutionTypeValues returns an array of possible values for the ExecutionType const type. +func PossibleExecutionTypeValues() []ExecutionType { + return []ExecutionType{OnDemand, Scheduled} +} + +// FormatType enumerates the values for format type. +type FormatType string + +const ( + // Csv ... + Csv FormatType = "Csv" +) + +// PossibleFormatTypeValues returns an array of possible values for the FormatType const type. +func PossibleFormatTypeValues() []FormatType { + return []FormatType{Csv} +} + +// GranularityType enumerates the values for granularity type. +type GranularityType string + +const ( + // Daily ... + Daily GranularityType = "Daily" + // Hourly ... + Hourly GranularityType = "Hourly" +) + +// PossibleGranularityTypeValues returns an array of possible values for the GranularityType const type. +func PossibleGranularityTypeValues() []GranularityType { + return []GranularityType{Daily, Hourly} +} + +// QueryColumnType enumerates the values for query column type. +type QueryColumnType string + +const ( + // QueryColumnTypeDimension ... + QueryColumnTypeDimension QueryColumnType = "Dimension" + // QueryColumnTypeTag ... + QueryColumnTypeTag QueryColumnType = "Tag" +) + +// PossibleQueryColumnTypeValues returns an array of possible values for the QueryColumnType const type. +func PossibleQueryColumnTypeValues() []QueryColumnType { + return []QueryColumnType{QueryColumnTypeDimension, QueryColumnTypeTag} +} + +// RecurrenceType enumerates the values for recurrence type. +type RecurrenceType string + +const ( + // RecurrenceTypeAnnually ... + RecurrenceTypeAnnually RecurrenceType = "Annually" + // RecurrenceTypeDaily ... + RecurrenceTypeDaily RecurrenceType = "Daily" + // RecurrenceTypeMonthly ... + RecurrenceTypeMonthly RecurrenceType = "Monthly" + // RecurrenceTypeWeekly ... + RecurrenceTypeWeekly RecurrenceType = "Weekly" +) + +// PossibleRecurrenceTypeValues returns an array of possible values for the RecurrenceType const type. +func PossibleRecurrenceTypeValues() []RecurrenceType { + return []RecurrenceType{RecurrenceTypeAnnually, RecurrenceTypeDaily, RecurrenceTypeMonthly, RecurrenceTypeWeekly} +} + +// SortDirection enumerates the values for sort direction. +type SortDirection string + +const ( + // Ascending ... + Ascending SortDirection = "Ascending" + // Descending ... + Descending SortDirection = "Descending" +) + +// PossibleSortDirectionValues returns an array of possible values for the SortDirection const type. +func PossibleSortDirectionValues() []SortDirection { + return []SortDirection{Ascending, Descending} +} + +// StatusType enumerates the values for status type. +type StatusType string + +const ( + // Active ... + Active StatusType = "Active" + // Inactive ... + Inactive StatusType = "Inactive" +) + +// PossibleStatusTypeValues returns an array of possible values for the StatusType const type. +func PossibleStatusTypeValues() []StatusType { + return []StatusType{Active, Inactive} +} + +// TimeframeType enumerates the values for timeframe type. +type TimeframeType string + +const ( + // Custom ... + Custom TimeframeType = "Custom" + // MonthToDate ... + MonthToDate TimeframeType = "MonthToDate" + // TheLastMonth ... + TheLastMonth TimeframeType = "TheLastMonth" + // TheLastWeek ... + TheLastWeek TimeframeType = "TheLastWeek" + // TheLastYear ... + TheLastYear TimeframeType = "TheLastYear" + // WeekToDate ... + WeekToDate TimeframeType = "WeekToDate" + // YearToDate ... + YearToDate TimeframeType = "YearToDate" +) + +// PossibleTimeframeTypeValues returns an array of possible values for the TimeframeType const type. +func PossibleTimeframeTypeValues() []TimeframeType { + return []TimeframeType{Custom, MonthToDate, TheLastMonth, TheLastWeek, TheLastYear, WeekToDate, YearToDate} +} + +// CommonExportProperties the common properties of the export. +type CommonExportProperties struct { + // Format - The format of the export being delivered. Possible values include: 'Csv' + Format FormatType `json:"format,omitempty"` + // DeliveryInfo - Has delivery information for the export. + DeliveryInfo *ExportDeliveryInfo `json:"deliveryInfo,omitempty"` + // Definition - Has definition for the export. + Definition *QueryDefinition `json:"definition,omitempty"` +} + +// Dimension ... +type Dimension struct { + *DimensionProperties `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"` + // Tags - READ-ONLY; Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Dimension. +func (d Dimension) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if d.DimensionProperties != nil { + objectMap["properties"] = d.DimensionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Dimension struct. +func (d *Dimension) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var dimensionProperties DimensionProperties + err = json.Unmarshal(*v, &dimensionProperties) + if err != nil { + return err + } + d.DimensionProperties = &dimensionProperties + } + 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 "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + d.Tags = tags + } + } + } + + return nil +} + +// DimensionProperties ... +type DimensionProperties struct { + // Description - READ-ONLY; Dimension description. + Description *string `json:"description,omitempty"` + // FilterEnabled - READ-ONLY; Filter enabled. + FilterEnabled *bool `json:"filterEnabled,omitempty"` + // GroupingEnabled - READ-ONLY; Grouping enabled. + GroupingEnabled *bool `json:"groupingEnabled,omitempty"` + Data *[]string `json:"data,omitempty"` + // Total - READ-ONLY; Total number of data for the dimension. + Total *int32 `json:"total,omitempty"` + // Category - READ-ONLY; Dimension category. + Category *string `json:"category,omitempty"` + // UsageStart - READ-ONLY; Usage start. + UsageStart *date.Time `json:"usageStart,omitempty"` + // UsageEnd - READ-ONLY; Usage end. + UsageEnd *date.Time `json:"usageEnd,omitempty"` + // NextLink - READ-ONLY; The link (url) to the next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// DimensionsListResult result of listing dimensions. It contains a list of available dimensions. +type DimensionsListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of dimensions. + Value *[]Dimension `json:"value,omitempty"` +} + +// ErrorDetails the details of the error. +type ErrorDetails struct { + // Code - READ-ONLY; Error code. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; Error message indicating why the operation failed. + Message *string `json:"message,omitempty"` +} + +// 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"` +} + +// Export a export resource. +type Export struct { + autorest.Response `json:"-"` + *ExportProperties `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"` + // Tags - READ-ONLY; Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Export. +func (e Export) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if e.ExportProperties != nil { + objectMap["properties"] = e.ExportProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Export struct. +func (e *Export) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var exportProperties ExportProperties + err = json.Unmarshal(*v, &exportProperties) + if err != nil { + return err + } + e.ExportProperties = &exportProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + e.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + e.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + e.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + e.Tags = tags + } + } + } + + return nil +} + +// ExportDeliveryDestination the destination information for the delivery of the export. +type ExportDeliveryDestination struct { + // ResourceID - The resource id of the storage account where exports will be delivered. + ResourceID *string `json:"resourceId,omitempty"` + // Container - The name of the container where exports will be uploaded. + Container *string `json:"container,omitempty"` + // RootFolderPath - The name of the directory where exports will be uploaded. + RootFolderPath *string `json:"rootFolderPath,omitempty"` +} + +// ExportDeliveryInfo the delivery information associated with a export. +type ExportDeliveryInfo struct { + // Destination - Has destination for the export being delivered. + Destination *ExportDeliveryDestination `json:"destination,omitempty"` +} + +// ExportExecution a export execution. +type ExportExecution struct { + *ExportExecutionProperties `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"` + // Tags - READ-ONLY; Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ExportExecution. +func (ee ExportExecution) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ee.ExportExecutionProperties != nil { + objectMap["properties"] = ee.ExportExecutionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ExportExecution struct. +func (ee *ExportExecution) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var exportExecutionProperties ExportExecutionProperties + err = json.Unmarshal(*v, &exportExecutionProperties) + if err != nil { + return err + } + ee.ExportExecutionProperties = &exportExecutionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ee.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ee.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ee.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ee.Tags = tags + } + } + } + + return nil +} + +// ExportExecutionListResult result of listing exports execution history of a export by name +type ExportExecutionListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of export executions. + Value *[]ExportExecution `json:"value,omitempty"` +} + +// ExportExecutionProperties the properties of the export execution. +type ExportExecutionProperties struct { + // ExecutionType - The type of the export execution. Possible values include: 'OnDemand', 'Scheduled' + ExecutionType ExecutionType `json:"executionType,omitempty"` + // Status - The status of the export execution. Possible values include: 'Queued', 'InProgress', 'Completed', 'Failed', 'Timeout', 'NewDataNotAvailable', 'DataNotAvailable' + Status ExecutionStatus `json:"status,omitempty"` + // SubmittedBy - The identifier for the entity that executed the export. For OnDemand executions, it is the email id. For Scheduled executions, it is the constant value - System. + SubmittedBy *string `json:"submittedBy,omitempty"` + // SubmittedTime - The time when export was queued to be executed. + SubmittedTime *date.Time `json:"submittedTime,omitempty"` + // ProcessingStartTime - The time when export was picked up to be executed. + ProcessingStartTime *date.Time `json:"processingStartTime,omitempty"` + // ProcessingEndTime - The time when export execution finished. + ProcessingEndTime *date.Time `json:"processingEndTime,omitempty"` + // FileName - The name of the file export got written to. + FileName *string `json:"fileName,omitempty"` + RunSettings *CommonExportProperties `json:"runSettings,omitempty"` +} + +// ExportListResult result of listing exports. It contains a list of available exports in the scope +// provided. +type ExportListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of exports. + Value *[]Export `json:"value,omitempty"` +} + +// ExportProperties the properties of the export. +type ExportProperties struct { + // Schedule - Has schedule information for the export. + Schedule *ExportSchedule `json:"schedule,omitempty"` + // Format - The format of the export being delivered. Possible values include: 'Csv' + Format FormatType `json:"format,omitempty"` + // DeliveryInfo - Has delivery information for the export. + DeliveryInfo *ExportDeliveryInfo `json:"deliveryInfo,omitempty"` + // Definition - Has definition for the export. + Definition *QueryDefinition `json:"definition,omitempty"` +} + +// ExportRecurrencePeriod the start and end date for recurrence schedule. +type ExportRecurrencePeriod struct { + // From - The start date of recurrence. + From *date.Time `json:"from,omitempty"` + // To - The end date of recurrence. + To *date.Time `json:"to,omitempty"` +} + +// ExportSchedule the schedule associated with a export. +type ExportSchedule struct { + // Status - The status of the schedule. Whether active or not. If inactive, the export's scheduled execution is paused. Possible values include: 'Active', 'Inactive' + Status StatusType `json:"status,omitempty"` + // Recurrence - The schedule recurrence. Possible values include: 'RecurrenceTypeDaily', 'RecurrenceTypeWeekly', 'RecurrenceTypeMonthly', 'RecurrenceTypeAnnually' + Recurrence RecurrenceType `json:"recurrence,omitempty"` + // RecurrencePeriod - Has start and end date of the recurrence. The start date must be in future. If present, the end date must be greater than start date. + RecurrencePeriod *ExportRecurrencePeriod `json:"recurrencePeriod,omitempty"` +} + +// Operation a Cost management REST API operation. +type Operation struct { + // Name - READ-ONLY; Operation name: {provider}/{resource}/{operation}. + Name *string `json:"name,omitempty"` + // Display - The object that represents the operation. + Display *OperationDisplay `json:"display,omitempty"` +} + +// OperationDisplay the object that represents the operation. +type OperationDisplay struct { + // Provider - READ-ONLY; Service provider: Microsoft.CostManagement. + Provider *string `json:"provider,omitempty"` + // Resource - READ-ONLY; Resource on which the operation is performed: Dimensions, Query. + Resource *string `json:"resource,omitempty"` + // Operation - READ-ONLY; Operation type: Read, write, delete, etc. + Operation *string `json:"operation,omitempty"` +} + +// OperationListResult result of listing cost management operations. It contains a list of operations and a +// URL link to get the next set of results. +type OperationListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of cost management operations supported by the Microsoft.CostManagement resource provider. + Value *[]Operation `json:"value,omitempty"` + // NextLink - READ-ONLY; URL to get the next set of operation list results if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// OperationListResultIterator provides access to a complete listing of Operation values. +type OperationListResultIterator struct { + i int + page OperationListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *OperationListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OperationListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter OperationListResultIterator) Response() OperationListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter OperationListResultIterator) Value() Operation { + if !iter.page.NotDone() { + return Operation{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OperationListResultIterator type. +func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { + return OperationListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (olr OperationListResult) IsEmpty() bool { + return olr.Value == nil || len(*olr.Value) == 0 +} + +// operationListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { + if olr.NextLink == nil || len(to.String(olr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(olr.NextLink))) +} + +// OperationListResultPage contains a page of Operation values. +type OperationListResultPage struct { + fn func(context.Context, OperationListResult) (OperationListResult, error) + olr OperationListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.olr) + if err != nil { + return err + } + page.olr = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *OperationListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OperationListResultPage) NotDone() bool { + return !page.olr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OperationListResultPage) Response() OperationListResult { + return page.olr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OperationListResultPage) Values() []Operation { + if page.olr.IsEmpty() { + return nil + } + return *page.olr.Value +} + +// Creates a new instance of the OperationListResultPage type. +func NewOperationListResultPage(getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { + return OperationListResultPage{fn: getNextPage} +} + +// QueryAggregation the aggregation expression to be used in the query. +type QueryAggregation struct { + // Name - The name of the column to aggregate. + Name *string `json:"name,omitempty"` + // Function - The name of the aggregation function to use. + Function *string `json:"function,omitempty"` +} + +// QueryColumn ... +type QueryColumn struct { + // Name - The name of column. + Name *string `json:"name,omitempty"` + // Type - The type of column. + Type *string `json:"type,omitempty"` +} + +// QueryComparisonExpression the comparison expression to be used in the query. +type QueryComparisonExpression struct { + // Name - The name of the column to use in comparison. + Name *string `json:"name,omitempty"` + // Operator - The operator to use for comparison. + Operator *string `json:"operator,omitempty"` + // Values - Array of values to use for comparison + Values *[]string `json:"values,omitempty"` +} + +// QueryDataset the definition of data present in the query. +type QueryDataset struct { + // Granularity - The granularity of rows in the query. Possible values include: 'Daily', 'Hourly' + Granularity GranularityType `json:"granularity,omitempty"` + // Configuration - Has configuration information for the data in the export. The configuration will be ignored if aggregation and grouping are provided. + Configuration *QueryDatasetConfiguration `json:"configuration,omitempty"` + // Aggregation - Dictionary of aggregation expression to use in the query. The key of each item in the dictionary is the alias for the aggregated column. Query can have up to 2 aggregation clauses. + Aggregation map[string]*QueryAggregation `json:"aggregation"` + // Grouping - Array of group by expression to use in the query. Query can have up to 2 group by clauses. + Grouping *[]QueryGrouping `json:"grouping,omitempty"` + // Sorting - Array of sorting by columns in query. + Sorting *[]QuerySortingConfiguration `json:"sorting,omitempty"` + // Filter - Has filter expression to use in the query. + Filter *QueryFilter `json:"filter,omitempty"` +} + +// MarshalJSON is the custom marshaler for QueryDataset. +func (qd QueryDataset) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if qd.Granularity != "" { + objectMap["granularity"] = qd.Granularity + } + if qd.Configuration != nil { + objectMap["configuration"] = qd.Configuration + } + if qd.Aggregation != nil { + objectMap["aggregation"] = qd.Aggregation + } + if qd.Grouping != nil { + objectMap["grouping"] = qd.Grouping + } + if qd.Sorting != nil { + objectMap["sorting"] = qd.Sorting + } + if qd.Filter != nil { + objectMap["filter"] = qd.Filter + } + return json.Marshal(objectMap) +} + +// QueryDatasetConfiguration the configuration of dataset in the query. +type QueryDatasetConfiguration struct { + // Columns - Array of column names to be included in the query. Any valid query column name is allowed. If not provided, then query includes all columns. + Columns *[]string `json:"columns,omitempty"` +} + +// QueryDefinition the definition of a query. +type QueryDefinition struct { + // Type - The type of the query. + Type *string `json:"type,omitempty"` + // Timeframe - The time frame for pulling data for the query. If custom, then a specific time period must be provided. Possible values include: 'WeekToDate', 'MonthToDate', 'YearToDate', 'TheLastWeek', 'TheLastMonth', 'TheLastYear', 'Custom' + Timeframe TimeframeType `json:"timeframe,omitempty"` + // TimePeriod - Has time period for pulling data for the query. + TimePeriod *QueryTimePeriod `json:"timePeriod,omitempty"` + // Dataset - Has definition for data in this query. + Dataset *QueryDataset `json:"dataset,omitempty"` +} + +// QueryFilter the filter expression to be used in the export. +type QueryFilter struct { + // And - The logical "AND" expression. Must have at least 2 items. + And *[]QueryFilter `json:"and,omitempty"` + // Or - The logical "OR" expression. Must have at least 2 items. + Or *[]QueryFilter `json:"or,omitempty"` + // Not - The logical "NOT" expression. + Not *QueryFilter `json:"not,omitempty"` + // Dimension - Has comparison expression for a dimension + Dimension *QueryComparisonExpression `json:"dimension,omitempty"` + // Tag - Has comparison expression for a tag + Tag *QueryComparisonExpression `json:"tag,omitempty"` +} + +// QueryGrouping the group by expression to be used in the query. +type QueryGrouping struct { + // Type - Has type of the column to group. Possible values include: 'QueryColumnTypeTag', 'QueryColumnTypeDimension' + Type QueryColumnType `json:"type,omitempty"` + // Name - The name of the column to group. + Name *string `json:"name,omitempty"` +} + +// QueryProperties ... +type QueryProperties struct { + // NextLink - The link (url) to the next page of results. + NextLink *string `json:"nextLink,omitempty"` + // Columns - Array of columns + Columns *[]QueryColumn `json:"columns,omitempty"` + // Rows - Array of rows + Rows *[][]interface{} `json:"rows,omitempty"` +} + +// QueryResult result of query. It contains all columns listed under groupings and aggregation. +type QueryResult struct { + autorest.Response `json:"-"` + *QueryProperties `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"` + // Tags - READ-ONLY; Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for QueryResult. +func (qr QueryResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if qr.QueryProperties != nil { + objectMap["properties"] = qr.QueryProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for QueryResult struct. +func (qr *QueryResult) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var queryProperties QueryProperties + err = json.Unmarshal(*v, &queryProperties) + if err != nil { + return err + } + qr.QueryProperties = &queryProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + qr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + qr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + qr.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + qr.Tags = tags + } + } + } + + return nil +} + +// QuerySortingConfiguration the configuration for sorting in the query. +type QuerySortingConfiguration struct { + // QuerySortingDirection - The sorting direction. Possible values include: 'Ascending', 'Descending' + QuerySortingDirection SortDirection `json:"querySortingDirection,omitempty"` + // Name - The name of the column to use in sorting. + Name *string `json:"name,omitempty"` +} + +// QueryTimePeriod the start and end date for pulling data for the query. +type QueryTimePeriod struct { + // From - The start date to pull data from. + From *date.Time `json:"from,omitempty"` + // To - The end date to pull data to. + To *date.Time `json:"to,omitempty"` +} + +// Resource the Resource model definition. +type Resource struct { + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Tags - READ-ONLY; 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{}) + return json.Marshal(objectMap) +} diff --git a/services/costmanagement/mgmt/2019-10-01/costmanagement/operations.go b/services/costmanagement/mgmt/2019-10-01/costmanagement/operations.go new file mode 100644 index 000000000000..d8eb4bd62a9d --- /dev/null +++ b/services/costmanagement/mgmt/2019-10-01/costmanagement/operations.go @@ -0,0 +1,147 @@ +package costmanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if 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 Costmanagement 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 lists all of the available cost management 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, "costmanagement.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, "costmanagement.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.olr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "costmanagement.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-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.CostManagement/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, "costmanagement.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, "costmanagement.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "costmanagement.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/costmanagement/mgmt/2019-10-01/costmanagement/query.go b/services/costmanagement/mgmt/2019-10-01/costmanagement/query.go new file mode 100644 index 000000000000..faaec591ea5b --- /dev/null +++ b/services/costmanagement/mgmt/2019-10-01/costmanagement/query.go @@ -0,0 +1,166 @@ +package costmanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the 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 client for the Query methods of the Costmanagement service. +type QueryClient struct { + BaseClient +} + +// NewQueryClient creates an instance of the QueryClient client. +func NewQueryClient(subscriptionID string) QueryClient { + return NewQueryClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewQueryClientWithBaseURI creates an instance of the QueryClient client. +func NewQueryClientWithBaseURI(baseURI string, subscriptionID string) QueryClient { + return QueryClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Usage query the usage data for scope defined. +// Parameters: +// scope - the scope associated with query and export operations. This includes +// '/subscriptions/{subscriptionId}/' for subscription scope, +// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department +// scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' +// for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for +// Management Group scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for +// billingProfile scope, +// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' +// for invoiceSection scope, and +// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for +// partners. +// parameters - parameters supplied to the CreateOrUpdate Query Config operation. +func (client QueryClient) Usage(ctx context.Context, scope string, parameters QueryDefinition) (result QueryResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/QueryClient.Usage") + defer func() { + 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.Type", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.TimePeriod", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.TimePeriod.From", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.TimePeriod.To", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "parameters.Dataset", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Dataset.Grouping", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Dataset.Grouping", Name: validation.MaxItems, Rule: 2, Chain: nil}}}, + {Target: "parameters.Dataset.Filter", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Dataset.Filter.And", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Dataset.Filter.And", Name: validation.MinItems, Rule: 2, Chain: nil}}}, + {Target: "parameters.Dataset.Filter.Or", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Dataset.Filter.Or", Name: validation.MinItems, Rule: 2, Chain: nil}}}, + {Target: "parameters.Dataset.Filter.Not", Name: validation.Null, Rule: false, Chain: nil}, + {Target: "parameters.Dataset.Filter.Dimension", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Dataset.Filter.Dimension.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.Dataset.Filter.Dimension.Operator", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.Dataset.Filter.Dimension.Values", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Dataset.Filter.Dimension.Values", Name: validation.MinItems, Rule: 1, Chain: nil}}}, + }}, + {Target: "parameters.Dataset.Filter.Tag", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Dataset.Filter.Tag.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.Dataset.Filter.Tag.Operator", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.Dataset.Filter.Tag.Values", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Dataset.Filter.Tag.Values", Name: validation.MinItems, Rule: 1, Chain: nil}}}, + }}, + }}, + }}}}}); err != nil { + return result, validation.NewError("costmanagement.QueryClient", "Usage", err.Error()) + } + + req, err := client.UsagePreparer(ctx, scope, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "costmanagement.QueryClient", "Usage", nil, "Failure preparing request") + return + } + + resp, err := client.UsageSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "costmanagement.QueryClient", "Usage", resp, "Failure sending request") + return + } + + result, err = client.UsageResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "costmanagement.QueryClient", "Usage", resp, "Failure responding to request") + } + + return +} + +// UsagePreparer prepares the Usage request. +func (client QueryClient) UsagePreparer(ctx context.Context, scope string, parameters QueryDefinition) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "scope": scope, + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{scope}/providers/Microsoft.CostManagement/query", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UsageSender sends the Usage request. The method will close the +// http.Response Body if it receives an error. +func (client QueryClient) UsageSender(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...) +} + +// UsageResponder handles the response to the Usage request. The method always +// closes the http.Response Body. +func (client QueryClient) UsageResponder(resp *http.Response) (result QueryResult, 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/costmanagement/mgmt/2019-10-01/costmanagement/version.go b/services/costmanagement/mgmt/2019-10-01/costmanagement/version.go new file mode 100644 index 000000000000..f1711e9d07e1 --- /dev/null +++ b/services/costmanagement/mgmt/2019-10-01/costmanagement/version.go @@ -0,0 +1,30 @@ +package costmanagement + +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 + " costmanagement/2019-10-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/datafactory/mgmt/2018-06-01/datafactory/models.go b/services/datafactory/mgmt/2018-06-01/datafactory/models.go index a7f764d671c7..210e26dfdf33 100644 --- a/services/datafactory/mgmt/2018-06-01/datafactory/models.go +++ b/services/datafactory/mgmt/2018-06-01/datafactory/models.go @@ -295,6 +295,8 @@ func PossibleDependencyConditionValues() []DependencyCondition { type DynamicsAuthenticationType string const ( + // AADServicePrincipal ... + AADServicePrincipal DynamicsAuthenticationType = "AADServicePrincipal" // Ifd ... Ifd DynamicsAuthenticationType = "Ifd" // Office365 ... @@ -303,7 +305,7 @@ const ( // PossibleDynamicsAuthenticationTypeValues returns an array of possible values for the DynamicsAuthenticationType const type. func PossibleDynamicsAuthenticationTypeValues() []DynamicsAuthenticationType { - return []DynamicsAuthenticationType{Ifd, Office365} + return []DynamicsAuthenticationType{AADServicePrincipal, Ifd, Office365} } // DynamicsDeploymentType enumerates the values for dynamics deployment type. @@ -806,6 +808,23 @@ func PossibleOraclePartitionOptionValues() []OraclePartitionOption { return []OraclePartitionOption{OraclePartitionOptionDynamicRange, OraclePartitionOptionNone, OraclePartitionOptionPhysicalPartitionsOfTable} } +// OrcCompressionCodec enumerates the values for orc compression codec. +type OrcCompressionCodec string + +const ( + // OrcCompressionCodecNone ... + OrcCompressionCodecNone OrcCompressionCodec = "none" + // OrcCompressionCodecSnappy ... + OrcCompressionCodecSnappy OrcCompressionCodec = "snappy" + // OrcCompressionCodecZlib ... + OrcCompressionCodecZlib OrcCompressionCodec = "zlib" +) + +// PossibleOrcCompressionCodecValues returns an array of possible values for the OrcCompressionCodec const type. +func PossibleOrcCompressionCodecValues() []OrcCompressionCodec { + return []OrcCompressionCodec{OrcCompressionCodecNone, OrcCompressionCodecSnappy, OrcCompressionCodecZlib} +} + // ParameterType enumerates the values for parameter type. type ParameterType string @@ -1398,6 +1417,8 @@ const ( TypeAzureFunctionActivity TypeBasicActivity = "AzureFunctionActivity" // TypeAzureMLBatchExecution ... TypeAzureMLBatchExecution TypeBasicActivity = "AzureMLBatchExecution" + // TypeAzureMLExecutePipeline ... + TypeAzureMLExecutePipeline TypeBasicActivity = "AzureMLExecutePipeline" // TypeAzureMLUpdateResource ... TypeAzureMLUpdateResource TypeBasicActivity = "AzureMLUpdateResource" // TypeContainer ... @@ -1448,6 +1469,8 @@ const ( TypeSetVariable TypeBasicActivity = "SetVariable" // TypeSQLServerStoredProcedure ... TypeSQLServerStoredProcedure TypeBasicActivity = "SqlServerStoredProcedure" + // TypeSwitch ... + TypeSwitch TypeBasicActivity = "Switch" // TypeUntil ... TypeUntil TypeBasicActivity = "Until" // TypeValidation ... @@ -1462,7 +1485,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, TypeExecuteDataFlow, 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, TypeAzureMLExecutePipeline, 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, TypeSwitch, TypeUntil, TypeValidation, TypeWait, TypeWebActivity, TypeWebHook} } // TypeBasicCopySink enumerates the values for type basic copy sink. @@ -2092,6 +2115,8 @@ const ( TypeAzureDataLakeAnalytics TypeBasicLinkedService = "AzureDataLakeAnalytics" // TypeAzureDataLakeStore ... TypeAzureDataLakeStore TypeBasicLinkedService = "AzureDataLakeStore" + // TypeAzureFileStorage ... + TypeAzureFileStorage TypeBasicLinkedService = "AzureFileStorage" // TypeAzureFunction ... TypeAzureFunction TypeBasicLinkedService = "AzureFunction" // TypeAzureKeyVault ... @@ -2100,6 +2125,8 @@ const ( TypeAzureMariaDB TypeBasicLinkedService = "AzureMariaDB" // TypeAzureML ... TypeAzureML TypeBasicLinkedService = "AzureML" + // TypeAzureMLService ... + TypeAzureMLService TypeBasicLinkedService = "AzureMLService" // TypeAzureMySQL ... TypeAzureMySQL TypeBasicLinkedService = "AzureMySql" // TypeAzurePostgreSQL ... @@ -2150,6 +2177,8 @@ const ( TypeGoogleAdWords TypeBasicLinkedService = "GoogleAdWords" // TypeGoogleBigQuery ... TypeGoogleBigQuery TypeBasicLinkedService = "GoogleBigQuery" + // TypeGoogleCloudStorage ... + TypeGoogleCloudStorage TypeBasicLinkedService = "GoogleCloudStorage" // TypeGreenplum ... TypeGreenplum TypeBasicLinkedService = "Greenplum" // TypeHBase ... @@ -2260,7 +2289,7 @@ const ( // PossibleTypeBasicLinkedServiceValues returns an array of possible values for the TypeBasicLinkedService const type. func PossibleTypeBasicLinkedServiceValues() []TypeBasicLinkedService { - return []TypeBasicLinkedService{TypeAmazonMWS, TypeAmazonRedshift, TypeAmazonS3, TypeAzureBatch, TypeAzureBlobFS, TypeAzureBlobStorage, TypeAzureDatabricks, TypeAzureDataExplorer, TypeAzureDataLakeAnalytics, TypeAzureDataLakeStore, TypeAzureFunction, TypeAzureKeyVault, TypeAzureMariaDB, TypeAzureML, TypeAzureMySQL, TypeAzurePostgreSQL, TypeAzureSearch, TypeAzureSQLDatabase, TypeAzureSQLDW, TypeAzureSQLMI, TypeAzureStorage, TypeAzureTableStorage, TypeCassandra, TypeCommonDataServiceForApps, TypeConcur, TypeCosmosDb, TypeCosmosDbMongoDbAPI, TypeCouchbase, TypeCustomDataSource, TypeDb2, TypeDrill, TypeDynamics, TypeDynamicsAX, TypeDynamicsCrm, TypeEloqua, TypeFileServer, TypeFtpServer, TypeGoogleAdWords, TypeGoogleBigQuery, TypeGreenplum, TypeHBase, TypeHdfs, TypeHDInsight, TypeHDInsightOnDemand, TypeHive, TypeHTTPServer, TypeHubspot, TypeImpala, TypeInformix, TypeJira, TypeLinkedService, TypeMagento, TypeMariaDB, TypeMarketo, TypeMicrosoftAccess, TypeMongoDb, TypeMongoDbV2, TypeMySQL, TypeNetezza, TypeOData, TypeOdbc, TypeOffice365, TypeOracle, TypeOracleServiceCloud, TypePaypal, TypePhoenix, TypePostgreSQL, TypePresto, TypeQuickBooks, TypeResponsys, TypeRestService, TypeSalesforce, TypeSalesforceMarketingCloud, TypeSalesforceServiceCloud, TypeSapBW, TypeSapCloudForCustomer, TypeSapEcc, TypeSapHana, TypeSapOpenHub, TypeSapTable, TypeServiceNow, TypeSftp, TypeShopify, TypeSpark, TypeSQLServer, TypeSquare, TypeSybase, TypeTeradata, TypeVertica, TypeWeb, TypeXero, TypeZoho} + return []TypeBasicLinkedService{TypeAmazonMWS, TypeAmazonRedshift, TypeAmazonS3, TypeAzureBatch, TypeAzureBlobFS, TypeAzureBlobStorage, TypeAzureDatabricks, TypeAzureDataExplorer, TypeAzureDataLakeAnalytics, TypeAzureDataLakeStore, TypeAzureFileStorage, TypeAzureFunction, TypeAzureKeyVault, TypeAzureMariaDB, TypeAzureML, TypeAzureMLService, TypeAzureMySQL, TypeAzurePostgreSQL, TypeAzureSearch, TypeAzureSQLDatabase, TypeAzureSQLDW, TypeAzureSQLMI, TypeAzureStorage, TypeAzureTableStorage, TypeCassandra, TypeCommonDataServiceForApps, TypeConcur, TypeCosmosDb, TypeCosmosDbMongoDbAPI, TypeCouchbase, TypeCustomDataSource, TypeDb2, TypeDrill, TypeDynamics, TypeDynamicsAX, TypeDynamicsCrm, TypeEloqua, TypeFileServer, TypeFtpServer, TypeGoogleAdWords, TypeGoogleBigQuery, TypeGoogleCloudStorage, TypeGreenplum, TypeHBase, TypeHdfs, TypeHDInsight, TypeHDInsightOnDemand, TypeHive, TypeHTTPServer, TypeHubspot, TypeImpala, TypeInformix, TypeJira, TypeLinkedService, TypeMagento, TypeMariaDB, TypeMarketo, TypeMicrosoftAccess, TypeMongoDb, TypeMongoDbV2, TypeMySQL, TypeNetezza, TypeOData, TypeOdbc, TypeOffice365, TypeOracle, TypeOracleServiceCloud, TypePaypal, TypePhoenix, TypePostgreSQL, TypePresto, TypeQuickBooks, TypeResponsys, TypeRestService, TypeSalesforce, TypeSalesforceMarketingCloud, TypeSalesforceServiceCloud, TypeSapBW, TypeSapCloudForCustomer, TypeSapEcc, TypeSapHana, TypeSapOpenHub, TypeSapTable, TypeServiceNow, TypeSftp, TypeShopify, TypeSpark, TypeSQLServer, TypeSquare, TypeSybase, TypeTeradata, TypeVertica, TypeWeb, TypeXero, TypeZoho} } // TypeBasicSsisObjectMetadata enumerates the values for type basic ssis object metadata. @@ -2400,6 +2429,7 @@ type BasicActivity interface { AsDatabricksSparkJarActivity() (*DatabricksSparkJarActivity, bool) AsDatabricksNotebookActivity() (*DatabricksNotebookActivity, bool) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUSQLActivity, bool) + AsAzureMLExecutePipelineActivity() (*AzureMLExecutePipelineActivity, bool) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) AsAzureMLBatchExecutionActivity() (*AzureMLBatchExecutionActivity, bool) AsGetMetadataActivity() (*GetMetadataActivity, bool) @@ -2426,6 +2456,7 @@ type BasicActivity interface { AsUntilActivity() (*UntilActivity, bool) AsWaitActivity() (*WaitActivity, bool) AsForEachActivity() (*ForEachActivity, bool) + AsSwitchActivity() (*SwitchActivity, bool) AsIfConditionActivity() (*IfConditionActivity, bool) AsExecutePipelineActivity() (*ExecutePipelineActivity, bool) AsControlActivity() (*ControlActivity, bool) @@ -2445,7 +2476,7 @@ type Activity struct { 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 - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLExecutePipeline', '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', 'TypeSwitch', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -2481,6 +2512,10 @@ func unmarshalBasicActivity(body []byte) (BasicActivity, error) { var dlaua DataLakeAnalyticsUSQLActivity err := json.Unmarshal(body, &dlaua) return dlaua, err + case string(TypeAzureMLExecutePipeline): + var amepa AzureMLExecutePipelineActivity + err := json.Unmarshal(body, &amepa) + return amepa, err case string(TypeAzureMLUpdateResource): var amura AzureMLUpdateResourceActivity err := json.Unmarshal(body, &amura) @@ -2581,6 +2616,10 @@ func unmarshalBasicActivity(body []byte) (BasicActivity, error) { var fea ForEachActivity err := json.Unmarshal(body, &fea) return fea, err + case string(TypeSwitch): + var sa SwitchActivity + err := json.Unmarshal(body, &sa) + return sa, err case string(TypeIfCondition): var ica IfConditionActivity err := json.Unmarshal(body, &ica) @@ -2673,6 +2712,11 @@ func (a Activity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUSQLActiv return nil, false } +// AsAzureMLExecutePipelineActivity is the BasicActivity implementation for Activity. +func (a Activity) AsAzureMLExecutePipelineActivity() (*AzureMLExecutePipelineActivity, bool) { + return nil, false +} + // AsAzureMLUpdateResourceActivity is the BasicActivity implementation for Activity. func (a Activity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { return nil, false @@ -2803,6 +2847,11 @@ func (a Activity) AsForEachActivity() (*ForEachActivity, bool) { return nil, false } +// AsSwitchActivity is the BasicActivity implementation for Activity. +func (a Activity) AsSwitchActivity() (*SwitchActivity, bool) { + return nil, false +} + // AsIfConditionActivity is the BasicActivity implementation for Activity. func (a Activity) AsIfConditionActivity() (*IfConditionActivity, bool) { return nil, false @@ -3302,7 +3351,7 @@ type AmazonMWSLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -3674,6 +3723,11 @@ func (amls AmazonMWSLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bo return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. func (amls AmazonMWSLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -3714,6 +3768,16 @@ func (amls AmazonMWSLinkedService) AsOracleLinkedService() (*OracleLinkedService return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. func (amls AmazonMWSLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -5212,7 +5276,7 @@ type AmazonRedshiftLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -5584,6 +5648,11 @@ func (arls AmazonRedshiftLinkedService) AsOdbcLinkedService() (*OdbcLinkedServic return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. func (arls AmazonRedshiftLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -5624,6 +5693,16 @@ func (arls AmazonRedshiftLinkedService) AsOracleLinkedService() (*OracleLinkedSe return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. func (arls AmazonRedshiftLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -7822,7 +7901,7 @@ type AmazonS3LinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -8194,6 +8273,11 @@ func (asls AmazonS3LinkedService) AsOdbcLinkedService() (*OdbcLinkedService, boo return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. func (asls AmazonS3LinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -8234,6 +8318,16 @@ func (asls AmazonS3LinkedService) AsOracleLinkedService() (*OracleLinkedService, return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. func (asls AmazonS3LinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -8756,7 +8850,7 @@ type AppendVariableActivity struct { 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 - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLExecutePipeline', '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', 'TypeSwitch', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -8818,6 +8912,11 @@ func (ava AppendVariableActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAn return nil, false } +// AsAzureMLExecutePipelineActivity is the BasicActivity implementation for AppendVariableActivity. +func (ava AppendVariableActivity) AsAzureMLExecutePipelineActivity() (*AzureMLExecutePipelineActivity, bool) { + return nil, false +} + // AsAzureMLUpdateResourceActivity is the BasicActivity implementation for AppendVariableActivity. func (ava AppendVariableActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { return nil, false @@ -8948,6 +9047,11 @@ func (ava AppendVariableActivity) AsForEachActivity() (*ForEachActivity, bool) { return nil, false } +// AsSwitchActivity is the BasicActivity implementation for AppendVariableActivity. +func (ava AppendVariableActivity) AsSwitchActivity() (*SwitchActivity, bool) { + return nil, false +} + // AsIfConditionActivity is the BasicActivity implementation for AppendVariableActivity. func (ava AppendVariableActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { return nil, false @@ -10803,7 +10907,7 @@ type AzureBatchLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -11175,6 +11279,11 @@ func (abls AzureBatchLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, b return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. func (abls AzureBatchLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -11215,6 +11324,16 @@ func (abls AzureBatchLinkedService) AsOracleLinkedService() (*OracleLinkedServic return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. func (abls AzureBatchLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -12862,7 +12981,7 @@ type AzureBlobFSLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -13234,6 +13353,11 @@ func (abfls AzureBlobFSLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for AzureBlobFSLinkedService. +func (abfls AzureBlobFSLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for AzureBlobFSLinkedService. func (abfls AzureBlobFSLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -13274,6 +13398,16 @@ func (abfls AzureBlobFSLinkedService) AsOracleLinkedService() (*OracleLinkedServ return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for AzureBlobFSLinkedService. +func (abfls AzureBlobFSLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for AzureBlobFSLinkedService. +func (abfls AzureBlobFSLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for AzureBlobFSLinkedService. func (abfls AzureBlobFSLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -14831,7 +14965,7 @@ type AzureBlobStorageLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -15203,6 +15337,11 @@ func (absls AzureBlobStorageLinkedService) AsOdbcLinkedService() (*OdbcLinkedSer return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for AzureBlobStorageLinkedService. +func (absls AzureBlobStorageLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for AzureBlobStorageLinkedService. func (absls AzureBlobStorageLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -15243,6 +15382,16 @@ func (absls AzureBlobStorageLinkedService) AsOracleLinkedService() (*OracleLinke return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for AzureBlobStorageLinkedService. +func (absls AzureBlobStorageLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for AzureBlobStorageLinkedService. +func (absls AzureBlobStorageLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for AzureBlobStorageLinkedService. func (absls AzureBlobStorageLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -15921,7 +16070,7 @@ type AzureDatabricksLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -16293,6 +16442,11 @@ func (adls AzureDatabricksLinkedService) AsOdbcLinkedService() (*OdbcLinkedServi return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. func (adls AzureDatabricksLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -16333,6 +16487,16 @@ func (adls AzureDatabricksLinkedService) AsOracleLinkedService() (*OracleLinkedS return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. func (adls AzureDatabricksLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -16735,7 +16899,7 @@ type AzureDataExplorerCommandActivity struct { 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 - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLExecutePipeline', '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', 'TypeSwitch', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -16803,6 +16967,11 @@ func (adeca AzureDataExplorerCommandActivity) AsDataLakeAnalyticsUSQLActivity() return nil, false } +// AsAzureMLExecutePipelineActivity is the BasicActivity implementation for AzureDataExplorerCommandActivity. +func (adeca AzureDataExplorerCommandActivity) AsAzureMLExecutePipelineActivity() (*AzureMLExecutePipelineActivity, bool) { + return nil, false +} + // AsAzureMLUpdateResourceActivity is the BasicActivity implementation for AzureDataExplorerCommandActivity. func (adeca AzureDataExplorerCommandActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { return nil, false @@ -16933,6 +17102,11 @@ func (adeca AzureDataExplorerCommandActivity) AsForEachActivity() (*ForEachActiv return nil, false } +// AsSwitchActivity is the BasicActivity implementation for AzureDataExplorerCommandActivity. +func (adeca AzureDataExplorerCommandActivity) AsSwitchActivity() (*SwitchActivity, bool) { + return nil, false +} + // AsIfConditionActivity is the BasicActivity implementation for AzureDataExplorerCommandActivity. func (adeca AzureDataExplorerCommandActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { return nil, false @@ -17090,7 +17264,7 @@ type AzureDataExplorerLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -17462,6 +17636,11 @@ func (adels AzureDataExplorerLinkedService) AsOdbcLinkedService() (*OdbcLinkedSe return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for AzureDataExplorerLinkedService. +func (adels AzureDataExplorerLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for AzureDataExplorerLinkedService. func (adels AzureDataExplorerLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -17502,6 +17681,16 @@ func (adels AzureDataExplorerLinkedService) AsOracleLinkedService() (*OracleLink return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for AzureDataExplorerLinkedService. +func (adels AzureDataExplorerLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for AzureDataExplorerLinkedService. +func (adels AzureDataExplorerLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for AzureDataExplorerLinkedService. func (adels AzureDataExplorerLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -19309,7 +19498,7 @@ type AzureDataLakeAnalyticsLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -19681,6 +19870,11 @@ func (adlals AzureDataLakeAnalyticsLinkedService) AsOdbcLinkedService() (*OdbcLi return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. func (adlals AzureDataLakeAnalyticsLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -19721,6 +19915,16 @@ func (adlals AzureDataLakeAnalyticsLinkedService) AsOracleLinkedService() (*Orac return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. func (adlals AzureDataLakeAnalyticsLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -20682,7 +20886,7 @@ type AzureDataLakeStoreLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -21054,6 +21258,11 @@ func (adlsls AzureDataLakeStoreLinkedService) AsOdbcLinkedService() (*OdbcLinked return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. func (adlsls AzureDataLakeStoreLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -21094,6 +21303,16 @@ func (adlsls AzureDataLakeStoreLinkedService) AsOracleLinkedService() (*OracleLi return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. func (adlsls AzureDataLakeStoreLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -22617,6 +22836,913 @@ func (adlsws *AzureDataLakeStoreWriteSettings) UnmarshalJSON(body []byte) error return nil } +// AzureFileStorageLinkedService azure File Storage linked service. +type AzureFileStorageLinkedService struct { + // AzureFileStorageLinkedServiceTypeProperties - Azure File Storage linked service properties. + *AzureFileStorageLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the linked service. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) MarshalJSON() ([]byte, error) { + afsls.Type = TypeAzureFileStorage + objectMap := make(map[string]interface{}) + if afsls.AzureFileStorageLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = afsls.AzureFileStorageLinkedServiceTypeProperties + } + if afsls.ConnectVia != nil { + objectMap["connectVia"] = afsls.ConnectVia + } + if afsls.Description != nil { + objectMap["description"] = afsls.Description + } + if afsls.Parameters != nil { + objectMap["parameters"] = afsls.Parameters + } + if afsls.Annotations != nil { + objectMap["annotations"] = afsls.Annotations + } + if afsls.Type != "" { + objectMap["type"] = afsls.Type + } + for k, v := range afsls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAzureFunctionLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsAzureFunctionLinkedService() (*AzureFunctionLinkedService, bool) { + return nil, false +} + +// AsAzureDataExplorerLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsAzureDataExplorerLinkedService() (*AzureDataExplorerLinkedService, bool) { + return nil, false +} + +// AsSapTableLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsSapTableLinkedService() (*SapTableLinkedService, bool) { + return nil, false +} + +// AsGoogleAdWordsLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsGoogleAdWordsLinkedService() (*GoogleAdWordsLinkedService, bool) { + return nil, false +} + +// AsOracleServiceCloudLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsOracleServiceCloudLinkedService() (*OracleServiceCloudLinkedService, bool) { + return nil, false +} + +// AsDynamicsAXLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsDynamicsAXLinkedService() (*DynamicsAXLinkedService, bool) { + return nil, false +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsAzureMariaDBLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsAzureMariaDBLinkedService() (*AzureMariaDBLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsRestServiceLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsRestServiceLinkedService() (*RestServiceLinkedService, bool) { + return nil, false +} + +// AsSapOpenHubLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsSapOpenHubLinkedService() (*SapOpenHubLinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceServiceCloudLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsSalesforceServiceCloudLinkedService() (*SalesforceServiceCloudLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsOffice365LinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsOffice365LinkedService() (*Office365LinkedService, bool) { + return nil, false +} + +// AsAzureBlobFSLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsAzureBlobFSLinkedService() (*AzureBlobFSLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPILinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsCosmosDbMongoDbAPILinkedService() (*CosmosDbMongoDbAPILinkedService, bool) { + return nil, false +} + +// AsMongoDbV2LinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsMongoDbV2LinkedService() (*MongoDbV2LinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsMicrosoftAccessLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsMicrosoftAccessLinkedService() (*MicrosoftAccessLinkedService, bool) { + return nil, false +} + +// AsInformixLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsInformixLinkedService() (*InformixLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return &afsls, true +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsCommonDataServiceForAppsLinkedService() (*CommonDataServiceForAppsLinkedService, bool) { + return nil, false +} + +// AsDynamicsCrmLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsDynamicsCrmLinkedService() (*DynamicsCrmLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLMILinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsAzureSQLMILinkedService() (*AzureSQLMILinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureTableStorageLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsAzureTableStorageLinkedService() (*AzureTableStorageLinkedService, bool) { + return nil, false +} + +// AsAzureBlobStorageLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsAzureBlobStorageLinkedService() (*AzureBlobStorageLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for AzureFileStorageLinkedService. +func (afsls AzureFileStorageLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &afsls, true +} + +// UnmarshalJSON is the custom unmarshaler for AzureFileStorageLinkedService struct. +func (afsls *AzureFileStorageLinkedService) UnmarshalJSON(body []byte) error { + 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 azureFileStorageLinkedServiceTypeProperties AzureFileStorageLinkedServiceTypeProperties + err = json.Unmarshal(*v, &azureFileStorageLinkedServiceTypeProperties) + if err != nil { + return err + } + afsls.AzureFileStorageLinkedServiceTypeProperties = &azureFileStorageLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if afsls.AdditionalProperties == nil { + afsls.AdditionalProperties = make(map[string]interface{}) + } + afsls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + afsls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + afsls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + afsls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + afsls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + afsls.Type = typeVar + } + } + } + + return nil +} + +// AzureFileStorageLinkedServiceTypeProperties azure File Storage linked service properties. +type AzureFileStorageLinkedServiceTypeProperties struct { + // Host - Host name of the server. Type: string (or Expression with resultType string). + Host interface{} `json:"host,omitempty"` + // UserID - User ID to logon the server. Type: string (or Expression with resultType string). + UserID interface{} `json:"userId,omitempty"` + // Password - Password to logon the server. + Password BasicSecretBase `json:"password,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 AzureFileStorageLinkedServiceTypeProperties struct. +func (afslstp *AzureFileStorageLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "host": + if v != nil { + var host interface{} + err = json.Unmarshal(*v, &host) + if err != nil { + return err + } + afslstp.Host = host + } + case "userId": + if v != nil { + var userID interface{} + err = json.Unmarshal(*v, &userID) + if err != nil { + return err + } + afslstp.UserID = userID + } + case "password": + if v != nil { + password, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + afslstp.Password = password + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + afslstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// AzureFileStorageLocation the location of file server dataset. +type AzureFileStorageLocation struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Type - Type of dataset storage location. + Type *string `json:"type,omitempty"` + // FolderPath - Specify the folder path of dataset. Type: string (or Expression with resultType string) + FolderPath interface{} `json:"folderPath,omitempty"` + // FileName - Specify the file name of dataset. Type: string (or Expression with resultType string). + FileName interface{} `json:"fileName,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFileStorageLocation. +func (afsl AzureFileStorageLocation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if afsl.Type != nil { + objectMap["type"] = afsl.Type + } + if afsl.FolderPath != nil { + objectMap["folderPath"] = afsl.FolderPath + } + if afsl.FileName != nil { + objectMap["fileName"] = afsl.FileName + } + for k, v := range afsl.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AzureFileStorageLocation struct. +func (afsl *AzureFileStorageLocation) UnmarshalJSON(body []byte) 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 afsl.AdditionalProperties == nil { + afsl.AdditionalProperties = make(map[string]interface{}) + } + afsl.AdditionalProperties[k] = additionalProperties + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + afsl.Type = &typeVar + } + case "folderPath": + if v != nil { + var folderPath interface{} + err = json.Unmarshal(*v, &folderPath) + if err != nil { + return err + } + afsl.FolderPath = folderPath + } + case "fileName": + if v != nil { + var fileName interface{} + err = json.Unmarshal(*v, &fileName) + if err != nil { + return err + } + afsl.FileName = fileName + } + } + } + + return nil +} + +// AzureFileStorageReadSettings azure File Storage read settings. +type AzureFileStorageReadSettings struct { + // Recursive - If true, files under the folder path will be read recursively. Default is true. Type: boolean (or Expression with resultType boolean). + Recursive interface{} `json:"recursive,omitempty"` + // WildcardFolderPath - Azure File Storage wildcardFolderPath. Type: string (or Expression with resultType string). + WildcardFolderPath interface{} `json:"wildcardFolderPath,omitempty"` + // WildcardFileName - Azure File Storage wildcardFileName. Type: string (or Expression with resultType string). + WildcardFileName interface{} `json:"wildcardFileName,omitempty"` + // EnablePartitionDiscovery - Indicates whether to enable partition discovery. + EnablePartitionDiscovery *bool `json:"enablePartitionDiscovery,omitempty"` + // ModifiedDatetimeStart - The start of file's modified datetime. Type: string (or Expression with resultType string). + ModifiedDatetimeStart interface{} `json:"modifiedDatetimeStart,omitempty"` + // ModifiedDatetimeEnd - The end of file's modified datetime. Type: string (or Expression with resultType string). + ModifiedDatetimeEnd interface{} `json:"modifiedDatetimeEnd,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Type - The read setting type. + Type *string `json:"type,omitempty"` + // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). + MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFileStorageReadSettings. +func (afsrs AzureFileStorageReadSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if afsrs.Recursive != nil { + objectMap["recursive"] = afsrs.Recursive + } + if afsrs.WildcardFolderPath != nil { + objectMap["wildcardFolderPath"] = afsrs.WildcardFolderPath + } + if afsrs.WildcardFileName != nil { + objectMap["wildcardFileName"] = afsrs.WildcardFileName + } + if afsrs.EnablePartitionDiscovery != nil { + objectMap["enablePartitionDiscovery"] = afsrs.EnablePartitionDiscovery + } + if afsrs.ModifiedDatetimeStart != nil { + objectMap["modifiedDatetimeStart"] = afsrs.ModifiedDatetimeStart + } + if afsrs.ModifiedDatetimeEnd != nil { + objectMap["modifiedDatetimeEnd"] = afsrs.ModifiedDatetimeEnd + } + if afsrs.Type != nil { + objectMap["type"] = afsrs.Type + } + if afsrs.MaxConcurrentConnections != nil { + objectMap["maxConcurrentConnections"] = afsrs.MaxConcurrentConnections + } + for k, v := range afsrs.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AzureFileStorageReadSettings struct. +func (afsrs *AzureFileStorageReadSettings) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "recursive": + if v != nil { + var recursive interface{} + err = json.Unmarshal(*v, &recursive) + if err != nil { + return err + } + afsrs.Recursive = recursive + } + case "wildcardFolderPath": + if v != nil { + var wildcardFolderPath interface{} + err = json.Unmarshal(*v, &wildcardFolderPath) + if err != nil { + return err + } + afsrs.WildcardFolderPath = wildcardFolderPath + } + case "wildcardFileName": + if v != nil { + var wildcardFileName interface{} + err = json.Unmarshal(*v, &wildcardFileName) + if err != nil { + return err + } + afsrs.WildcardFileName = wildcardFileName + } + case "enablePartitionDiscovery": + if v != nil { + var enablePartitionDiscovery bool + err = json.Unmarshal(*v, &enablePartitionDiscovery) + if err != nil { + return err + } + afsrs.EnablePartitionDiscovery = &enablePartitionDiscovery + } + case "modifiedDatetimeStart": + if v != nil { + var modifiedDatetimeStart interface{} + err = json.Unmarshal(*v, &modifiedDatetimeStart) + if err != nil { + return err + } + afsrs.ModifiedDatetimeStart = modifiedDatetimeStart + } + case "modifiedDatetimeEnd": + if v != nil { + var modifiedDatetimeEnd interface{} + err = json.Unmarshal(*v, &modifiedDatetimeEnd) + if err != nil { + return err + } + afsrs.ModifiedDatetimeEnd = modifiedDatetimeEnd + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if afsrs.AdditionalProperties == nil { + afsrs.AdditionalProperties = make(map[string]interface{}) + } + afsrs.AdditionalProperties[k] = additionalProperties + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + afsrs.Type = &typeVar + } + case "maxConcurrentConnections": + if v != nil { + var maxConcurrentConnections interface{} + err = json.Unmarshal(*v, &maxConcurrentConnections) + if err != nil { + return err + } + afsrs.MaxConcurrentConnections = maxConcurrentConnections + } + } + } + + return nil +} + // AzureFunctionActivity azure Function activity. type AzureFunctionActivity struct { // AzureFunctionActivityTypeProperties - Azure Function activity properties. @@ -22635,7 +23761,7 @@ type AzureFunctionActivity struct { 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 - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLExecutePipeline', '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', 'TypeSwitch', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -22703,6 +23829,11 @@ func (afa AzureFunctionActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAna return nil, false } +// AsAzureMLExecutePipelineActivity is the BasicActivity implementation for AzureFunctionActivity. +func (afa AzureFunctionActivity) AsAzureMLExecutePipelineActivity() (*AzureMLExecutePipelineActivity, bool) { + return nil, false +} + // AsAzureMLUpdateResourceActivity is the BasicActivity implementation for AzureFunctionActivity. func (afa AzureFunctionActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { return nil, false @@ -22833,6 +23964,11 @@ func (afa AzureFunctionActivity) AsForEachActivity() (*ForEachActivity, bool) { return nil, false } +// AsSwitchActivity is the BasicActivity implementation for AzureFunctionActivity. +func (afa AzureFunctionActivity) AsSwitchActivity() (*SwitchActivity, bool) { + return nil, false +} + // AsIfConditionActivity is the BasicActivity implementation for AzureFunctionActivity. func (afa AzureFunctionActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { return nil, false @@ -22988,7 +24124,7 @@ type AzureFunctionLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -23360,6 +24496,11 @@ func (afls AzureFunctionLinkedService) AsOdbcLinkedService() (*OdbcLinkedService return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for AzureFunctionLinkedService. +func (afls AzureFunctionLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for AzureFunctionLinkedService. func (afls AzureFunctionLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -23400,6 +24541,16 @@ func (afls AzureFunctionLinkedService) AsOracleLinkedService() (*OracleLinkedSer return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for AzureFunctionLinkedService. +func (afls AzureFunctionLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for AzureFunctionLinkedService. +func (afls AzureFunctionLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for AzureFunctionLinkedService. func (afls AzureFunctionLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -23631,7 +24782,7 @@ type AzureKeyVaultLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -24003,6 +25154,11 @@ func (akvls AzureKeyVaultLinkedService) AsOdbcLinkedService() (*OdbcLinkedServic return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. func (akvls AzureKeyVaultLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -24043,6 +25199,16 @@ func (akvls AzureKeyVaultLinkedService) AsOracleLinkedService() (*OracleLinkedSe return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. func (akvls AzureKeyVaultLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -24280,7 +25446,7 @@ type AzureMariaDBLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -24652,6 +25818,11 @@ func (amdls AzureMariaDBLinkedService) AsOdbcLinkedService() (*OdbcLinkedService return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for AzureMariaDBLinkedService. +func (amdls AzureMariaDBLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for AzureMariaDBLinkedService. func (amdls AzureMariaDBLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -24692,6 +25863,16 @@ func (amdls AzureMariaDBLinkedService) AsOracleLinkedService() (*OracleLinkedSer return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for AzureMariaDBLinkedService. +func (amdls AzureMariaDBLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for AzureMariaDBLinkedService. +func (amdls AzureMariaDBLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for AzureMariaDBLinkedService. func (amdls AzureMariaDBLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -26077,7 +27258,7 @@ type AzureMLBatchExecutionActivity struct { 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 - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLExecutePipeline', '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', 'TypeSwitch', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -26145,6 +27326,11 @@ func (ambea AzureMLBatchExecutionActivity) AsDataLakeAnalyticsUSQLActivity() (*D return nil, false } +// AsAzureMLExecutePipelineActivity is the BasicActivity implementation for AzureMLBatchExecutionActivity. +func (ambea AzureMLBatchExecutionActivity) AsAzureMLExecutePipelineActivity() (*AzureMLExecutePipelineActivity, bool) { + return nil, false +} + // AsAzureMLUpdateResourceActivity is the BasicActivity implementation for AzureMLBatchExecutionActivity. func (ambea AzureMLBatchExecutionActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { return nil, false @@ -26275,6 +27461,11 @@ func (ambea AzureMLBatchExecutionActivity) AsForEachActivity() (*ForEachActivity return nil, false } +// AsSwitchActivity is the BasicActivity implementation for AzureMLBatchExecutionActivity. +func (ambea AzureMLBatchExecutionActivity) AsSwitchActivity() (*SwitchActivity, bool) { + return nil, false +} + // AsIfConditionActivity is the BasicActivity implementation for AzureMLBatchExecutionActivity. func (ambea AzureMLBatchExecutionActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { return nil, false @@ -26429,9 +27620,378 @@ func (ambeatp AzureMLBatchExecutionActivityTypeProperties) MarshalJSON() ([]byte return json.Marshal(objectMap) } -// AzureMLLinkedService azure ML Web Service linked service. +// AzureMLExecutePipelineActivity azure ML Execute Pipeline activity. +type AzureMLExecutePipelineActivity struct { + // AzureMLExecutePipelineActivityTypeProperties - Azure ML Execute Pipeline activity properties. + *AzureMLExecutePipelineActivityTypeProperties `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', 'TypeAzureMLExecutePipeline', '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', 'TypeSwitch', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + Type TypeBasicActivity `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureMLExecutePipelineActivity. +func (amepa AzureMLExecutePipelineActivity) MarshalJSON() ([]byte, error) { + amepa.Type = TypeAzureMLExecutePipeline + objectMap := make(map[string]interface{}) + if amepa.AzureMLExecutePipelineActivityTypeProperties != nil { + objectMap["typeProperties"] = amepa.AzureMLExecutePipelineActivityTypeProperties + } + if amepa.LinkedServiceName != nil { + objectMap["linkedServiceName"] = amepa.LinkedServiceName + } + if amepa.Policy != nil { + objectMap["policy"] = amepa.Policy + } + if amepa.Name != nil { + objectMap["name"] = amepa.Name + } + if amepa.Description != nil { + objectMap["description"] = amepa.Description + } + if amepa.DependsOn != nil { + objectMap["dependsOn"] = amepa.DependsOn + } + if amepa.UserProperties != nil { + objectMap["userProperties"] = amepa.UserProperties + } + if amepa.Type != "" { + objectMap["type"] = amepa.Type + } + for k, v := range amepa.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsExecuteDataFlowActivity is the BasicActivity implementation for AzureMLExecutePipelineActivity. +func (amepa AzureMLExecutePipelineActivity) AsExecuteDataFlowActivity() (*ExecuteDataFlowActivity, bool) { + return nil, false +} + +// AsAzureFunctionActivity is the BasicActivity implementation for AzureMLExecutePipelineActivity. +func (amepa AzureMLExecutePipelineActivity) AsAzureFunctionActivity() (*AzureFunctionActivity, bool) { + return nil, false +} + +// AsDatabricksSparkPythonActivity is the BasicActivity implementation for AzureMLExecutePipelineActivity. +func (amepa AzureMLExecutePipelineActivity) AsDatabricksSparkPythonActivity() (*DatabricksSparkPythonActivity, bool) { + return nil, false +} + +// AsDatabricksSparkJarActivity is the BasicActivity implementation for AzureMLExecutePipelineActivity. +func (amepa AzureMLExecutePipelineActivity) AsDatabricksSparkJarActivity() (*DatabricksSparkJarActivity, bool) { + return nil, false +} + +// AsDatabricksNotebookActivity is the BasicActivity implementation for AzureMLExecutePipelineActivity. +func (amepa AzureMLExecutePipelineActivity) AsDatabricksNotebookActivity() (*DatabricksNotebookActivity, bool) { + return nil, false +} + +// AsDataLakeAnalyticsUSQLActivity is the BasicActivity implementation for AzureMLExecutePipelineActivity. +func (amepa AzureMLExecutePipelineActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUSQLActivity, bool) { + return nil, false +} + +// AsAzureMLExecutePipelineActivity is the BasicActivity implementation for AzureMLExecutePipelineActivity. +func (amepa AzureMLExecutePipelineActivity) AsAzureMLExecutePipelineActivity() (*AzureMLExecutePipelineActivity, bool) { + return &amepa, true +} + +// AsAzureMLUpdateResourceActivity is the BasicActivity implementation for AzureMLExecutePipelineActivity. +func (amepa AzureMLExecutePipelineActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { + return nil, false +} + +// AsAzureMLBatchExecutionActivity is the BasicActivity implementation for AzureMLExecutePipelineActivity. +func (amepa AzureMLExecutePipelineActivity) AsAzureMLBatchExecutionActivity() (*AzureMLBatchExecutionActivity, bool) { + return nil, false +} + +// AsGetMetadataActivity is the BasicActivity implementation for AzureMLExecutePipelineActivity. +func (amepa AzureMLExecutePipelineActivity) AsGetMetadataActivity() (*GetMetadataActivity, bool) { + return nil, false +} + +// AsWebActivity is the BasicActivity implementation for AzureMLExecutePipelineActivity. +func (amepa AzureMLExecutePipelineActivity) AsWebActivity() (*WebActivity, bool) { + return nil, false +} + +// AsLookupActivity is the BasicActivity implementation for AzureMLExecutePipelineActivity. +func (amepa AzureMLExecutePipelineActivity) AsLookupActivity() (*LookupActivity, bool) { + return nil, false +} + +// AsAzureDataExplorerCommandActivity is the BasicActivity implementation for AzureMLExecutePipelineActivity. +func (amepa AzureMLExecutePipelineActivity) AsAzureDataExplorerCommandActivity() (*AzureDataExplorerCommandActivity, bool) { + return nil, false +} + +// AsDeleteActivity is the BasicActivity implementation for AzureMLExecutePipelineActivity. +func (amepa AzureMLExecutePipelineActivity) AsDeleteActivity() (*DeleteActivity, bool) { + return nil, false +} + +// AsSQLServerStoredProcedureActivity is the BasicActivity implementation for AzureMLExecutePipelineActivity. +func (amepa AzureMLExecutePipelineActivity) AsSQLServerStoredProcedureActivity() (*SQLServerStoredProcedureActivity, bool) { + return nil, false +} + +// AsCustomActivity is the BasicActivity implementation for AzureMLExecutePipelineActivity. +func (amepa AzureMLExecutePipelineActivity) AsCustomActivity() (*CustomActivity, bool) { + return nil, false +} + +// AsExecuteSSISPackageActivity is the BasicActivity implementation for AzureMLExecutePipelineActivity. +func (amepa AzureMLExecutePipelineActivity) AsExecuteSSISPackageActivity() (*ExecuteSSISPackageActivity, bool) { + return nil, false +} + +// AsHDInsightSparkActivity is the BasicActivity implementation for AzureMLExecutePipelineActivity. +func (amepa AzureMLExecutePipelineActivity) AsHDInsightSparkActivity() (*HDInsightSparkActivity, bool) { + return nil, false +} + +// AsHDInsightStreamingActivity is the BasicActivity implementation for AzureMLExecutePipelineActivity. +func (amepa AzureMLExecutePipelineActivity) AsHDInsightStreamingActivity() (*HDInsightStreamingActivity, bool) { + return nil, false +} + +// AsHDInsightMapReduceActivity is the BasicActivity implementation for AzureMLExecutePipelineActivity. +func (amepa AzureMLExecutePipelineActivity) AsHDInsightMapReduceActivity() (*HDInsightMapReduceActivity, bool) { + return nil, false +} + +// AsHDInsightPigActivity is the BasicActivity implementation for AzureMLExecutePipelineActivity. +func (amepa AzureMLExecutePipelineActivity) AsHDInsightPigActivity() (*HDInsightPigActivity, bool) { + return nil, false +} + +// AsHDInsightHiveActivity is the BasicActivity implementation for AzureMLExecutePipelineActivity. +func (amepa AzureMLExecutePipelineActivity) AsHDInsightHiveActivity() (*HDInsightHiveActivity, bool) { + return nil, false +} + +// AsCopyActivity is the BasicActivity implementation for AzureMLExecutePipelineActivity. +func (amepa AzureMLExecutePipelineActivity) AsCopyActivity() (*CopyActivity, bool) { + return nil, false +} + +// AsExecutionActivity is the BasicActivity implementation for AzureMLExecutePipelineActivity. +func (amepa AzureMLExecutePipelineActivity) AsExecutionActivity() (*ExecutionActivity, bool) { + return nil, false +} + +// AsBasicExecutionActivity is the BasicActivity implementation for AzureMLExecutePipelineActivity. +func (amepa AzureMLExecutePipelineActivity) AsBasicExecutionActivity() (BasicExecutionActivity, bool) { + return &amepa, true +} + +// AsWebHookActivity is the BasicActivity implementation for AzureMLExecutePipelineActivity. +func (amepa AzureMLExecutePipelineActivity) AsWebHookActivity() (*WebHookActivity, bool) { + return nil, false +} + +// AsAppendVariableActivity is the BasicActivity implementation for AzureMLExecutePipelineActivity. +func (amepa AzureMLExecutePipelineActivity) AsAppendVariableActivity() (*AppendVariableActivity, bool) { + return nil, false +} + +// AsSetVariableActivity is the BasicActivity implementation for AzureMLExecutePipelineActivity. +func (amepa AzureMLExecutePipelineActivity) AsSetVariableActivity() (*SetVariableActivity, bool) { + return nil, false +} + +// AsFilterActivity is the BasicActivity implementation for AzureMLExecutePipelineActivity. +func (amepa AzureMLExecutePipelineActivity) AsFilterActivity() (*FilterActivity, bool) { + return nil, false +} + +// AsValidationActivity is the BasicActivity implementation for AzureMLExecutePipelineActivity. +func (amepa AzureMLExecutePipelineActivity) AsValidationActivity() (*ValidationActivity, bool) { + return nil, false +} + +// AsUntilActivity is the BasicActivity implementation for AzureMLExecutePipelineActivity. +func (amepa AzureMLExecutePipelineActivity) AsUntilActivity() (*UntilActivity, bool) { + return nil, false +} + +// AsWaitActivity is the BasicActivity implementation for AzureMLExecutePipelineActivity. +func (amepa AzureMLExecutePipelineActivity) AsWaitActivity() (*WaitActivity, bool) { + return nil, false +} + +// AsForEachActivity is the BasicActivity implementation for AzureMLExecutePipelineActivity. +func (amepa AzureMLExecutePipelineActivity) AsForEachActivity() (*ForEachActivity, bool) { + return nil, false +} + +// AsSwitchActivity is the BasicActivity implementation for AzureMLExecutePipelineActivity. +func (amepa AzureMLExecutePipelineActivity) AsSwitchActivity() (*SwitchActivity, bool) { + return nil, false +} + +// AsIfConditionActivity is the BasicActivity implementation for AzureMLExecutePipelineActivity. +func (amepa AzureMLExecutePipelineActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { + return nil, false +} + +// AsExecutePipelineActivity is the BasicActivity implementation for AzureMLExecutePipelineActivity. +func (amepa AzureMLExecutePipelineActivity) AsExecutePipelineActivity() (*ExecutePipelineActivity, bool) { + return nil, false +} + +// AsControlActivity is the BasicActivity implementation for AzureMLExecutePipelineActivity. +func (amepa AzureMLExecutePipelineActivity) AsControlActivity() (*ControlActivity, bool) { + return nil, false +} + +// AsBasicControlActivity is the BasicActivity implementation for AzureMLExecutePipelineActivity. +func (amepa AzureMLExecutePipelineActivity) AsBasicControlActivity() (BasicControlActivity, bool) { + return nil, false +} + +// AsActivity is the BasicActivity implementation for AzureMLExecutePipelineActivity. +func (amepa AzureMLExecutePipelineActivity) AsActivity() (*Activity, bool) { + return nil, false +} + +// AsBasicActivity is the BasicActivity implementation for AzureMLExecutePipelineActivity. +func (amepa AzureMLExecutePipelineActivity) AsBasicActivity() (BasicActivity, bool) { + return &amepa, true +} + +// UnmarshalJSON is the custom unmarshaler for AzureMLExecutePipelineActivity struct. +func (amepa *AzureMLExecutePipelineActivity) UnmarshalJSON(body []byte) error { + 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 azureMLExecutePipelineActivityTypeProperties AzureMLExecutePipelineActivityTypeProperties + err = json.Unmarshal(*v, &azureMLExecutePipelineActivityTypeProperties) + if err != nil { + return err + } + amepa.AzureMLExecutePipelineActivityTypeProperties = &azureMLExecutePipelineActivityTypeProperties + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + amepa.LinkedServiceName = &linkedServiceName + } + case "policy": + if v != nil { + var policy ActivityPolicy + err = json.Unmarshal(*v, &policy) + if err != nil { + return err + } + amepa.Policy = &policy + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if amepa.AdditionalProperties == nil { + amepa.AdditionalProperties = make(map[string]interface{}) + } + amepa.AdditionalProperties[k] = additionalProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + amepa.Name = &name + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + amepa.Description = &description + } + case "dependsOn": + if v != nil { + var dependsOn []ActivityDependency + err = json.Unmarshal(*v, &dependsOn) + if err != nil { + return err + } + amepa.DependsOn = &dependsOn + } + case "userProperties": + if v != nil { + var userProperties []UserProperty + err = json.Unmarshal(*v, &userProperties) + if err != nil { + return err + } + amepa.UserProperties = &userProperties + } + case "type": + if v != nil { + var typeVar TypeBasicActivity + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + amepa.Type = typeVar + } + } + } + + return nil +} + +// AzureMLExecutePipelineActivityTypeProperties azure ML Execute Pipeline activity properties. +type AzureMLExecutePipelineActivityTypeProperties struct { + // MlPipelineID - ID of the published Azure ML pipeline. Type: string (or Expression with resultType string). + MlPipelineID interface{} `json:"mlPipelineId,omitempty"` + // ExperimentName - Run history experiment name of the pipeline run. This information will be passed in the ExperimentName property of the published pipeline execution request. Type: string (or Expression with resultType string). + ExperimentName interface{} `json:"experimentName,omitempty"` + // MlPipelineParameters - Key,Value pairs to be passed to the published Azure ML pipeline endpoint. Keys must match the names of pipeline parameters defined in the published pipeline. Values will be passed in the ParameterAssignments property of the published pipeline execution request. Type: object with key value pairs (or Expression with resultType object). + MlPipelineParameters interface{} `json:"mlPipelineParameters,omitempty"` + // MlParentRunID - The parent Azure ML Service pipeline run id. This information will be passed in the ParentRunId property of the published pipeline execution request. Type: string (or Expression with resultType string). + MlParentRunID interface{} `json:"mlParentRunId,omitempty"` + // ContinueOnStepFailure - Whether to continue execution of other steps in the PipelineRun if a step fails. This information will be passed in the continueOnStepFailure property of the published pipeline execution request. Type: boolean (or Expression with resultType boolean). + ContinueOnStepFailure interface{} `json:"continueOnStepFailure,omitempty"` +} + +// AzureMLLinkedService azure ML Studio Web Service linked service. type AzureMLLinkedService struct { - // AzureMLLinkedServiceTypeProperties - Azure ML Web Service linked service properties. + // AzureMLLinkedServiceTypeProperties - Azure ML Studio Web Service linked service properties. *AzureMLLinkedServiceTypeProperties `json:"typeProperties,omitempty"` // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` @@ -26443,7 +28003,7 @@ type AzureMLLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -26815,6 +28375,11 @@ func (amls AzureMLLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. func (amls AzureMLLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return &amls, true @@ -26855,6 +28420,16 @@ func (amls AzureMLLinkedService) AsOracleLinkedService() (*OracleLinkedService, return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. func (amls AzureMLLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -27021,17 +28596,17 @@ func (amls *AzureMLLinkedService) UnmarshalJSON(body []byte) error { return nil } -// AzureMLLinkedServiceTypeProperties azure ML Web Service linked service properties. +// AzureMLLinkedServiceTypeProperties azure ML Studio Web Service linked service properties. type AzureMLLinkedServiceTypeProperties struct { - // MlEndpoint - The Batch Execution REST URL for an Azure ML Web Service endpoint. Type: string (or Expression with resultType string). + // MlEndpoint - The Batch Execution REST URL for an Azure ML Studio Web Service endpoint. Type: string (or Expression with resultType string). MlEndpoint interface{} `json:"mlEndpoint,omitempty"` // APIKey - The API key for accessing the Azure ML model endpoint. APIKey BasicSecretBase `json:"apiKey,omitempty"` - // UpdateResourceEndpoint - The Update Resource REST URL for an Azure ML Web Service endpoint. Type: string (or Expression with resultType string). + // UpdateResourceEndpoint - The Update Resource REST URL for an Azure ML Studio Web Service endpoint. Type: string (or Expression with resultType string). UpdateResourceEndpoint interface{} `json:"updateResourceEndpoint,omitempty"` - // ServicePrincipalID - The ID of the service principal used to authenticate against the ARM-based updateResourceEndpoint of an Azure ML web service. Type: string (or Expression with resultType string). + // ServicePrincipalID - The ID of the service principal used to authenticate against the ARM-based updateResourceEndpoint of an Azure ML Studio web service. Type: string (or Expression with resultType string). ServicePrincipalID interface{} `json:"servicePrincipalId,omitempty"` - // ServicePrincipalKey - The key of the service principal used to authenticate against the ARM-based updateResourceEndpoint of an Azure ML web service. + // ServicePrincipalKey - The key of the service principal used to authenticate against the ARM-based updateResourceEndpoint of an Azure ML Studio web service. ServicePrincipalKey BasicSecretBase `json:"servicePrincipalKey,omitempty"` // Tenant - The name or ID of the tenant to which the service principal belongs. Type: string (or Expression with resultType string). Tenant interface{} `json:"tenant,omitempty"` @@ -27115,6 +28690,708 @@ func (amlstp *AzureMLLinkedServiceTypeProperties) UnmarshalJSON(body []byte) err return nil } +// AzureMLServiceLinkedService azure ML Service linked service. +type AzureMLServiceLinkedService struct { + // AzureMLServiceLinkedServiceTypeProperties - Azure ML Service linked service properties. + *AzureMLServiceLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the linked service. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) MarshalJSON() ([]byte, error) { + amsls.Type = TypeAzureMLService + objectMap := make(map[string]interface{}) + if amsls.AzureMLServiceLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = amsls.AzureMLServiceLinkedServiceTypeProperties + } + if amsls.ConnectVia != nil { + objectMap["connectVia"] = amsls.ConnectVia + } + if amsls.Description != nil { + objectMap["description"] = amsls.Description + } + if amsls.Parameters != nil { + objectMap["parameters"] = amsls.Parameters + } + if amsls.Annotations != nil { + objectMap["annotations"] = amsls.Annotations + } + if amsls.Type != "" { + objectMap["type"] = amsls.Type + } + for k, v := range amsls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAzureFunctionLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsAzureFunctionLinkedService() (*AzureFunctionLinkedService, bool) { + return nil, false +} + +// AsAzureDataExplorerLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsAzureDataExplorerLinkedService() (*AzureDataExplorerLinkedService, bool) { + return nil, false +} + +// AsSapTableLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsSapTableLinkedService() (*SapTableLinkedService, bool) { + return nil, false +} + +// AsGoogleAdWordsLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsGoogleAdWordsLinkedService() (*GoogleAdWordsLinkedService, bool) { + return nil, false +} + +// AsOracleServiceCloudLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsOracleServiceCloudLinkedService() (*OracleServiceCloudLinkedService, bool) { + return nil, false +} + +// AsDynamicsAXLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsDynamicsAXLinkedService() (*DynamicsAXLinkedService, bool) { + return nil, false +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsAzureMariaDBLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsAzureMariaDBLinkedService() (*AzureMariaDBLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsRestServiceLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsRestServiceLinkedService() (*RestServiceLinkedService, bool) { + return nil, false +} + +// AsSapOpenHubLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsSapOpenHubLinkedService() (*SapOpenHubLinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceServiceCloudLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsSalesforceServiceCloudLinkedService() (*SalesforceServiceCloudLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsOffice365LinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsOffice365LinkedService() (*Office365LinkedService, bool) { + return nil, false +} + +// AsAzureBlobFSLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsAzureBlobFSLinkedService() (*AzureBlobFSLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPILinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsCosmosDbMongoDbAPILinkedService() (*CosmosDbMongoDbAPILinkedService, bool) { + return nil, false +} + +// AsMongoDbV2LinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsMongoDbV2LinkedService() (*MongoDbV2LinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsMicrosoftAccessLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsMicrosoftAccessLinkedService() (*MicrosoftAccessLinkedService, bool) { + return nil, false +} + +// AsInformixLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsInformixLinkedService() (*InformixLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return &amsls, true +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsCommonDataServiceForAppsLinkedService() (*CommonDataServiceForAppsLinkedService, bool) { + return nil, false +} + +// AsDynamicsCrmLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsDynamicsCrmLinkedService() (*DynamicsCrmLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLMILinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsAzureSQLMILinkedService() (*AzureSQLMILinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureTableStorageLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsAzureTableStorageLinkedService() (*AzureTableStorageLinkedService, bool) { + return nil, false +} + +// AsAzureBlobStorageLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsAzureBlobStorageLinkedService() (*AzureBlobStorageLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for AzureMLServiceLinkedService. +func (amsls AzureMLServiceLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &amsls, true +} + +// UnmarshalJSON is the custom unmarshaler for AzureMLServiceLinkedService struct. +func (amsls *AzureMLServiceLinkedService) UnmarshalJSON(body []byte) error { + 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 azureMLServiceLinkedServiceTypeProperties AzureMLServiceLinkedServiceTypeProperties + err = json.Unmarshal(*v, &azureMLServiceLinkedServiceTypeProperties) + if err != nil { + return err + } + amsls.AzureMLServiceLinkedServiceTypeProperties = &azureMLServiceLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if amsls.AdditionalProperties == nil { + amsls.AdditionalProperties = make(map[string]interface{}) + } + amsls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + amsls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + amsls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + amsls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + amsls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + amsls.Type = typeVar + } + } + } + + return nil +} + +// AzureMLServiceLinkedServiceTypeProperties azure ML Service linked service properties. +type AzureMLServiceLinkedServiceTypeProperties struct { + // SubscriptionID - Azure ML Service workspace subscription ID. Type: string (or Expression with resultType string). + SubscriptionID interface{} `json:"subscriptionId,omitempty"` + // ResourceGroupName - Azure ML Service workspace resource group name. Type: string (or Expression with resultType string). + ResourceGroupName interface{} `json:"resourceGroupName,omitempty"` + // MlWorkspaceName - Azure ML Service workspace name. Type: string (or Expression with resultType string). + MlWorkspaceName interface{} `json:"mlWorkspaceName,omitempty"` + // ServicePrincipalID - The ID of the service principal used to authenticate against the endpoint of a published Azure ML Service pipeline. Type: string (or Expression with resultType string). + ServicePrincipalID interface{} `json:"servicePrincipalId,omitempty"` + // ServicePrincipalKey - The key of the service principal used to authenticate against the endpoint of a published Azure ML Service pipeline. + ServicePrincipalKey BasicSecretBase `json:"servicePrincipalKey,omitempty"` + // Tenant - The name or ID of the tenant to which the service principal belongs. Type: string (or Expression with resultType string). + Tenant interface{} `json:"tenant,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 AzureMLServiceLinkedServiceTypeProperties struct. +func (amslstp *AzureMLServiceLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "subscriptionId": + if v != nil { + var subscriptionID interface{} + err = json.Unmarshal(*v, &subscriptionID) + if err != nil { + return err + } + amslstp.SubscriptionID = subscriptionID + } + case "resourceGroupName": + if v != nil { + var resourceGroupName interface{} + err = json.Unmarshal(*v, &resourceGroupName) + if err != nil { + return err + } + amslstp.ResourceGroupName = resourceGroupName + } + case "mlWorkspaceName": + if v != nil { + var mlWorkspaceName interface{} + err = json.Unmarshal(*v, &mlWorkspaceName) + if err != nil { + return err + } + amslstp.MlWorkspaceName = mlWorkspaceName + } + case "servicePrincipalId": + if v != nil { + var servicePrincipalID interface{} + err = json.Unmarshal(*v, &servicePrincipalID) + if err != nil { + return err + } + amslstp.ServicePrincipalID = servicePrincipalID + } + case "servicePrincipalKey": + if v != nil { + servicePrincipalKey, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + amslstp.ServicePrincipalKey = servicePrincipalKey + } + case "tenant": + if v != nil { + var tenant interface{} + err = json.Unmarshal(*v, &tenant) + if err != nil { + return err + } + amslstp.Tenant = tenant + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + amslstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + // AzureMLUpdateResourceActivity azure ML Update Resource management activity. type AzureMLUpdateResourceActivity struct { // AzureMLUpdateResourceActivityTypeProperties - Azure ML Update Resource management activity properties. @@ -27133,7 +29410,7 @@ type AzureMLUpdateResourceActivity struct { 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 - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLExecutePipeline', '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', 'TypeSwitch', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -27201,6 +29478,11 @@ func (amura AzureMLUpdateResourceActivity) AsDataLakeAnalyticsUSQLActivity() (*D return nil, false } +// AsAzureMLExecutePipelineActivity is the BasicActivity implementation for AzureMLUpdateResourceActivity. +func (amura AzureMLUpdateResourceActivity) AsAzureMLExecutePipelineActivity() (*AzureMLExecutePipelineActivity, bool) { + return nil, false +} + // AsAzureMLUpdateResourceActivity is the BasicActivity implementation for AzureMLUpdateResourceActivity. func (amura AzureMLUpdateResourceActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { return &amura, true @@ -27331,6 +29613,11 @@ func (amura AzureMLUpdateResourceActivity) AsForEachActivity() (*ForEachActivity return nil, false } +// AsSwitchActivity is the BasicActivity implementation for AzureMLUpdateResourceActivity. +func (amura AzureMLUpdateResourceActivity) AsSwitchActivity() (*SwitchActivity, bool) { + return nil, false +} + // AsIfConditionActivity is the BasicActivity implementation for AzureMLUpdateResourceActivity. func (amura AzureMLUpdateResourceActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { return nil, false @@ -27492,7 +29779,7 @@ type AzureMySQLLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -27864,6 +30151,11 @@ func (amsls AzureMySQLLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. func (amsls AzureMySQLLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -27904,6 +30196,16 @@ func (amsls AzureMySQLLinkedService) AsOracleLinkedService() (*OracleLinkedServi return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. func (amsls AzureMySQLLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -29596,6 +31898,8 @@ func (amstd *AzureMySQLTableDataset) UnmarshalJSON(body []byte) error { type AzureMySQLTableDatasetTypeProperties struct { // TableName - The Azure MySQL database table name. Type: string (or Expression with resultType string). TableName interface{} `json:"tableName,omitempty"` + // Table - The name of Azure MySQL database table. Type: string (or Expression with resultType string). + Table interface{} `json:"table,omitempty"` } // AzurePostgreSQLLinkedService azure PostgreSQL linked service. @@ -29612,7 +31916,7 @@ type AzurePostgreSQLLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -29984,6 +32288,11 @@ func (apsls AzurePostgreSQLLinkedService) AsOdbcLinkedService() (*OdbcLinkedServ return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. func (apsls AzurePostgreSQLLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -30024,6 +32333,16 @@ func (apsls AzurePostgreSQLLinkedService) AsOracleLinkedService() (*OracleLinked return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. func (apsls AzurePostgreSQLLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -32984,7 +35303,7 @@ type AzureSearchLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -33356,6 +35675,11 @@ func (asls AzureSearchLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. func (asls AzureSearchLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -33396,6 +35720,16 @@ func (asls AzureSearchLinkedService) AsOracleLinkedService() (*OracleLinkedServi return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. func (asls AzureSearchLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -33627,7 +35961,7 @@ type AzureSQLDatabaseLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -33999,6 +36333,11 @@ func (asdls AzureSQLDatabaseLinkedService) AsOdbcLinkedService() (*OdbcLinkedSer return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. func (asdls AzureSQLDatabaseLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -34039,6 +36378,16 @@ func (asdls AzureSQLDatabaseLinkedService) AsOracleLinkedService() (*OracleLinke return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. func (asdls AzureSQLDatabaseLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -34303,7 +36652,7 @@ type AzureSQLDWLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -34675,6 +37024,11 @@ func (asdls AzureSQLDWLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. func (asdls AzureSQLDWLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -34715,6 +37069,16 @@ func (asdls AzureSQLDWLinkedService) AsOracleLinkedService() (*OracleLinkedServi return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. func (asdls AzureSQLDWLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -35603,7 +37967,7 @@ type AzureSQLMILinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -35975,6 +38339,11 @@ func (asmls AzureSQLMILinkedService) AsOdbcLinkedService() (*OdbcLinkedService, return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for AzureSQLMILinkedService. +func (asmls AzureSQLMILinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for AzureSQLMILinkedService. func (asmls AzureSQLMILinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -36015,6 +38384,16 @@ func (asmls AzureSQLMILinkedService) AsOracleLinkedService() (*OracleLinkedServi return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for AzureSQLMILinkedService. +func (asmls AzureSQLMILinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for AzureSQLMILinkedService. +func (asmls AzureSQLMILinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for AzureSQLMILinkedService. func (asmls AzureSQLMILinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -38537,7 +40916,7 @@ type AzureStorageLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -38909,6 +41288,11 @@ func (asls AzureStorageLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. func (asls AzureStorageLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -38949,6 +41333,16 @@ func (asls AzureStorageLinkedService) AsOracleLinkedService() (*OracleLinkedServ return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. func (asls AzureStorageLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -40717,7 +43111,7 @@ type AzureTableStorageLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -41089,6 +43483,11 @@ func (atsls AzureTableStorageLinkedService) AsOdbcLinkedService() (*OdbcLinkedSe return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for AzureTableStorageLinkedService. +func (atsls AzureTableStorageLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for AzureTableStorageLinkedService. func (atsls AzureTableStorageLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -41129,6 +43528,16 @@ func (atsls AzureTableStorageLinkedService) AsOracleLinkedService() (*OracleLink return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for AzureTableStorageLinkedService. +func (atsls AzureTableStorageLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for AzureTableStorageLinkedService. +func (atsls AzureTableStorageLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for AzureTableStorageLinkedService. func (atsls AzureTableStorageLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -43010,6 +45419,8 @@ type BlobEventsTriggerTypeProperties struct { BlobPathBeginsWith *string `json:"blobPathBeginsWith,omitempty"` // BlobPathEndsWith - The blob path must end with the pattern provided for trigger to fire. For example, 'december/boxes.csv' will only fire the trigger for blobs named boxes in a december folder. At least one of these must be provided: blobPathBeginsWith, blobPathEndsWith. BlobPathEndsWith *string `json:"blobPathEndsWith,omitempty"` + // IgnoreEmptyBlobs - If set to true, blobs with zero bytes will be ignored. + IgnoreEmptyBlobs *bool `json:"ignoreEmptyBlobs,omitempty"` // Events - The type of events that cause this trigger to fire. Events *[]BlobEventTypes `json:"events,omitempty"` // Scope - The ARM resource ID of the Storage Account. @@ -44168,7 +46579,7 @@ type CassandraLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -44540,6 +46951,11 @@ func (cls CassandraLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, boo return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for CassandraLinkedService. func (cls CassandraLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -44580,6 +46996,16 @@ func (cls CassandraLinkedService) AsOracleLinkedService() (*OracleLinkedService, return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for CassandraLinkedService. func (cls CassandraLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -47044,7 +49470,7 @@ type CommonDataServiceForAppsLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -47416,6 +49842,11 @@ func (cdsfals CommonDataServiceForAppsLinkedService) AsOdbcLinkedService() (*Odb return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for CommonDataServiceForAppsLinkedService. +func (cdsfals CommonDataServiceForAppsLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for CommonDataServiceForAppsLinkedService. func (cdsfals CommonDataServiceForAppsLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -47456,6 +49887,16 @@ func (cdsfals CommonDataServiceForAppsLinkedService) AsOracleLinkedService() (*O return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for CommonDataServiceForAppsLinkedService. +func (cdsfals CommonDataServiceForAppsLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for CommonDataServiceForAppsLinkedService. +func (cdsfals CommonDataServiceForAppsLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for CommonDataServiceForAppsLinkedService. func (cdsfals CommonDataServiceForAppsLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -47635,12 +50076,18 @@ type CommonDataServiceForAppsLinkedServiceTypeProperties struct { ServiceURI interface{} `json:"serviceUri,omitempty"` // OrganizationName - The organization name of the Common Data Service for Apps instance. The property is required for on-prem and required for online when there are more than one Common Data Service for Apps instances associated with the user. Type: string (or Expression with resultType string). OrganizationName interface{} `json:"organizationName,omitempty"` - // AuthenticationType - The authentication type to connect to Common Data Service for Apps server. 'Office365' for online scenario, 'Ifd' for on-premises with Ifd scenario. Type: string (or Expression with resultType string). Possible values include: 'Office365', 'Ifd' + // AuthenticationType - The authentication type to connect to Common Data Service for Apps server. 'Office365' for online scenario, 'Ifd' for on-premises with Ifd scenario. 'AADServicePrincipal' for Server-To-Server authentication in online scenario. Type: string (or Expression with resultType string). Possible values include: 'Office365', 'Ifd', 'AADServicePrincipal' AuthenticationType DynamicsAuthenticationType `json:"authenticationType,omitempty"` // Username - User name to access the Common Data Service for Apps instance. Type: string (or Expression with resultType string). Username interface{} `json:"username,omitempty"` // Password - Password to access the Common Data Service for Apps instance. Password BasicSecretBase `json:"password,omitempty"` + // ServicePrincipalID - The client ID of the application in Azure Active Directory used for Server-To-Server authentication. Type: string (or Expression with resultType string). + ServicePrincipalID interface{} `json:"servicePrincipalId,omitempty"` + // ServicePrincipalCredentialType - The service principal credential type to use in Server-To-Server authentication. 'ServicePrincipalKey' for key/secret, 'ServicePrincipalCert' for certificate. Type: string (or Expression with resultType string). + ServicePrincipalCredentialType interface{} `json:"servicePrincipalCredentialType,omitempty"` + // ServicePrincipalCredential - The credential of the service principal object in Azure Active Directory. If servicePrincipalCredentialType is 'ServicePrincipalKey', servicePrincipalCredential can be SecureString or AzureKeyVaultSecretReference. If servicePrincipalCredentialType is 'ServicePrincipalCert', servicePrincipalCredential can only be AzureKeyVaultSecretReference. + ServicePrincipalCredential BasicSecretBase `json:"servicePrincipalCredential,omitempty"` // 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"` } @@ -47725,6 +50172,32 @@ func (cdsfalstp *CommonDataServiceForAppsLinkedServiceTypeProperties) UnmarshalJ } cdsfalstp.Password = password } + case "servicePrincipalId": + if v != nil { + var servicePrincipalID interface{} + err = json.Unmarshal(*v, &servicePrincipalID) + if err != nil { + return err + } + cdsfalstp.ServicePrincipalID = servicePrincipalID + } + case "servicePrincipalCredentialType": + if v != nil { + var servicePrincipalCredentialType interface{} + err = json.Unmarshal(*v, &servicePrincipalCredentialType) + if err != nil { + return err + } + cdsfalstp.ServicePrincipalCredentialType = servicePrincipalCredentialType + } + case "servicePrincipalCredential": + if v != nil { + servicePrincipalCredential, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + cdsfalstp.ServicePrincipalCredential = servicePrincipalCredential + } case "encryptedCredential": if v != nil { var encryptedCredential interface{} @@ -48745,7 +51218,7 @@ type ConcurLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -49117,6 +51590,11 @@ func (cls ConcurLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for ConcurLinkedService. func (cls ConcurLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -49157,6 +51635,16 @@ func (cls ConcurLinkedService) AsOracleLinkedService() (*OracleLinkedService, bo return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for ConcurLinkedService. func (cls ConcurLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -50619,6 +53107,7 @@ type BasicControlActivity interface { AsUntilActivity() (*UntilActivity, bool) AsWaitActivity() (*WaitActivity, bool) AsForEachActivity() (*ForEachActivity, bool) + AsSwitchActivity() (*SwitchActivity, bool) AsIfConditionActivity() (*IfConditionActivity, bool) AsExecutePipelineActivity() (*ExecutePipelineActivity, bool) AsControlActivity() (*ControlActivity, bool) @@ -50636,7 +53125,7 @@ type ControlActivity struct { 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 - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLExecutePipeline', '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', 'TypeSwitch', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -50680,6 +53169,10 @@ func unmarshalBasicControlActivity(body []byte) (BasicControlActivity, error) { var fea ForEachActivity err := json.Unmarshal(body, &fea) return fea, err + case string(TypeSwitch): + var sa SwitchActivity + err := json.Unmarshal(body, &sa) + return sa, err case string(TypeIfCondition): var ica IfConditionActivity err := json.Unmarshal(body, &ica) @@ -50768,6 +53261,11 @@ func (ca ControlActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsU return nil, false } +// AsAzureMLExecutePipelineActivity is the BasicActivity implementation for ControlActivity. +func (ca ControlActivity) AsAzureMLExecutePipelineActivity() (*AzureMLExecutePipelineActivity, bool) { + return nil, false +} + // AsAzureMLUpdateResourceActivity is the BasicActivity implementation for ControlActivity. func (ca ControlActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { return nil, false @@ -50898,6 +53396,11 @@ func (ca ControlActivity) AsForEachActivity() (*ForEachActivity, bool) { return nil, false } +// AsSwitchActivity is the BasicActivity implementation for ControlActivity. +func (ca ControlActivity) AsSwitchActivity() (*SwitchActivity, bool) { + return nil, false +} + // AsIfConditionActivity is the BasicActivity implementation for ControlActivity. func (ca ControlActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { return nil, false @@ -51022,7 +53525,7 @@ type CopyActivity struct { 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 - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLExecutePipeline', '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', 'TypeSwitch', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -51096,6 +53599,11 @@ func (ca CopyActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUSQL return nil, false } +// AsAzureMLExecutePipelineActivity is the BasicActivity implementation for CopyActivity. +func (ca CopyActivity) AsAzureMLExecutePipelineActivity() (*AzureMLExecutePipelineActivity, bool) { + return nil, false +} + // AsAzureMLUpdateResourceActivity is the BasicActivity implementation for CopyActivity. func (ca CopyActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { return nil, false @@ -51226,6 +53734,11 @@ func (ca CopyActivity) AsForEachActivity() (*ForEachActivity, bool) { return nil, false } +// AsSwitchActivity is the BasicActivity implementation for CopyActivity. +func (ca CopyActivity) AsSwitchActivity() (*SwitchActivity, bool) { + return nil, false +} + // AsIfConditionActivity is the BasicActivity implementation for CopyActivity. func (ca CopyActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { return nil, false @@ -53063,7 +55576,7 @@ type CosmosDbLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -53435,6 +55948,11 @@ func (cdls CosmosDbLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, boo return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. func (cdls CosmosDbLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -53475,6 +55993,16 @@ func (cdls CosmosDbLinkedService) AsOracleLinkedService() (*OracleLinkedService, return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. func (cdls CosmosDbLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -54348,7 +56876,7 @@ type CosmosDbMongoDbAPILinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -54720,6 +57248,11 @@ func (cdmdals CosmosDbMongoDbAPILinkedService) AsOdbcLinkedService() (*OdbcLinke return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for CosmosDbMongoDbAPILinkedService. +func (cdmdals CosmosDbMongoDbAPILinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for CosmosDbMongoDbAPILinkedService. func (cdmdals CosmosDbMongoDbAPILinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -54760,6 +57293,16 @@ func (cdmdals CosmosDbMongoDbAPILinkedService) AsOracleLinkedService() (*OracleL return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for CosmosDbMongoDbAPILinkedService. +func (cdmdals CosmosDbMongoDbAPILinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for CosmosDbMongoDbAPILinkedService. +func (cdmdals CosmosDbMongoDbAPILinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for CosmosDbMongoDbAPILinkedService. func (cdmdals CosmosDbMongoDbAPILinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -57406,7 +59949,7 @@ type CouchbaseLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -57778,6 +60321,11 @@ func (cls CouchbaseLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, boo return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. func (cls CouchbaseLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -57818,6 +60366,16 @@ func (cls CouchbaseLinkedService) AsOracleLinkedService() (*OracleLinkedService, return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. func (cls CouchbaseLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -59194,7 +61752,7 @@ type CreateDataFlowDebugSessionRequest struct { // 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"` + IntegrationRuntime *IntegrationRuntimeDebugResource `json:"integrationRuntime,omitempty"` } // CreateDataFlowDebugSessionResponse response body structure for creating data flow debug session. @@ -59243,7 +61801,7 @@ type CustomActivity struct { 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 - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLExecutePipeline', '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', 'TypeSwitch', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -59311,6 +61869,11 @@ func (ca CustomActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUS return nil, false } +// AsAzureMLExecutePipelineActivity is the BasicActivity implementation for CustomActivity. +func (ca CustomActivity) AsAzureMLExecutePipelineActivity() (*AzureMLExecutePipelineActivity, bool) { + return nil, false +} + // AsAzureMLUpdateResourceActivity is the BasicActivity implementation for CustomActivity. func (ca CustomActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { return nil, false @@ -59441,6 +62004,11 @@ func (ca CustomActivity) AsForEachActivity() (*ForEachActivity, bool) { return nil, false } +// AsSwitchActivity is the BasicActivity implementation for CustomActivity. +func (ca CustomActivity) AsSwitchActivity() (*SwitchActivity, bool) { + return nil, false +} + // AsIfConditionActivity is the BasicActivity implementation for CustomActivity. func (ca CustomActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { return nil, false @@ -60246,7 +62814,7 @@ type CustomDataSourceLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -60618,6 +63186,11 @@ func (cdsls CustomDataSourceLinkedService) AsOdbcLinkedService() (*OdbcLinkedSer return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. func (cdsls CustomDataSourceLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -60658,6 +63231,16 @@ func (cdsls CustomDataSourceLinkedService) AsOracleLinkedService() (*OracleLinke return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. func (cdsls CustomDataSourceLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -60936,7 +63519,7 @@ type DatabricksNotebookActivity struct { 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 - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLExecutePipeline', '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', 'TypeSwitch', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -61004,6 +63587,11 @@ func (dna DatabricksNotebookActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLa return nil, false } +// AsAzureMLExecutePipelineActivity is the BasicActivity implementation for DatabricksNotebookActivity. +func (dna DatabricksNotebookActivity) AsAzureMLExecutePipelineActivity() (*AzureMLExecutePipelineActivity, bool) { + return nil, false +} + // AsAzureMLUpdateResourceActivity is the BasicActivity implementation for DatabricksNotebookActivity. func (dna DatabricksNotebookActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { return nil, false @@ -61134,6 +63722,11 @@ func (dna DatabricksNotebookActivity) AsForEachActivity() (*ForEachActivity, boo return nil, false } +// AsSwitchActivity is the BasicActivity implementation for DatabricksNotebookActivity. +func (dna DatabricksNotebookActivity) AsSwitchActivity() (*SwitchActivity, bool) { + return nil, false +} + // AsIfConditionActivity is the BasicActivity implementation for DatabricksNotebookActivity. func (dna DatabricksNotebookActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { return nil, false @@ -61306,7 +63899,7 @@ type DatabricksSparkJarActivity struct { 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 - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLExecutePipeline', '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', 'TypeSwitch', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -61374,6 +63967,11 @@ func (dsja DatabricksSparkJarActivity) AsDataLakeAnalyticsUSQLActivity() (*DataL return nil, false } +// AsAzureMLExecutePipelineActivity is the BasicActivity implementation for DatabricksSparkJarActivity. +func (dsja DatabricksSparkJarActivity) AsAzureMLExecutePipelineActivity() (*AzureMLExecutePipelineActivity, bool) { + return nil, false +} + // AsAzureMLUpdateResourceActivity is the BasicActivity implementation for DatabricksSparkJarActivity. func (dsja DatabricksSparkJarActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { return nil, false @@ -61504,6 +64102,11 @@ func (dsja DatabricksSparkJarActivity) AsForEachActivity() (*ForEachActivity, bo return nil, false } +// AsSwitchActivity is the BasicActivity implementation for DatabricksSparkJarActivity. +func (dsja DatabricksSparkJarActivity) AsSwitchActivity() (*SwitchActivity, bool) { + return nil, false +} + // AsIfConditionActivity is the BasicActivity implementation for DatabricksSparkJarActivity. func (dsja DatabricksSparkJarActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { return nil, false @@ -61661,7 +64264,7 @@ type DatabricksSparkPythonActivity struct { 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 - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLExecutePipeline', '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', 'TypeSwitch', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -61729,6 +64332,11 @@ func (dspa DatabricksSparkPythonActivity) AsDataLakeAnalyticsUSQLActivity() (*Da return nil, false } +// AsAzureMLExecutePipelineActivity is the BasicActivity implementation for DatabricksSparkPythonActivity. +func (dspa DatabricksSparkPythonActivity) AsAzureMLExecutePipelineActivity() (*AzureMLExecutePipelineActivity, bool) { + return nil, false +} + // AsAzureMLUpdateResourceActivity is the BasicActivity implementation for DatabricksSparkPythonActivity. func (dspa DatabricksSparkPythonActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { return nil, false @@ -61859,6 +64467,11 @@ func (dspa DatabricksSparkPythonActivity) AsForEachActivity() (*ForEachActivity, return nil, false } +// AsSwitchActivity is the BasicActivity implementation for DatabricksSparkPythonActivity. +func (dspa DatabricksSparkPythonActivity) AsSwitchActivity() (*SwitchActivity, bool) { + return nil, false +} + // AsIfConditionActivity is the BasicActivity implementation for DatabricksSparkPythonActivity. func (dspa DatabricksSparkPythonActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { return nil, false @@ -62126,11 +64739,11 @@ type DataFlowDebugPackage struct { // SessionID - The ID of data flow debug session. SessionID *string `json:"sessionId,omitempty"` // DataFlow - Data flow instance. - DataFlow *DataFlowResource `json:"dataFlow,omitempty"` + DataFlow *DataFlowDebugResource `json:"dataFlow,omitempty"` // Datasets - List of datasets. - Datasets *[]DatasetResource `json:"datasets,omitempty"` + Datasets *[]DatasetDebugResource `json:"datasets,omitempty"` // LinkedServices - List of linked services. - LinkedServices *[]LinkedServiceResource `json:"linkedServices,omitempty"` + LinkedServices *[]LinkedServiceDebugResource `json:"linkedServices,omitempty"` // Staging - Staging info for debug session. Staging *DataFlowStagingInfo `json:"staging,omitempty"` // DebugSettings - Data flow debug settings. @@ -62196,7 +64809,7 @@ func (dfdp *DataFlowDebugPackage) UnmarshalJSON(body []byte) error { } case "dataFlow": if v != nil { - var dataFlow DataFlowResource + var dataFlow DataFlowDebugResource err = json.Unmarshal(*v, &dataFlow) if err != nil { return err @@ -62205,7 +64818,7 @@ func (dfdp *DataFlowDebugPackage) UnmarshalJSON(body []byte) error { } case "datasets": if v != nil { - var datasets []DatasetResource + var datasets []DatasetDebugResource err = json.Unmarshal(*v, &datasets) if err != nil { return err @@ -62214,7 +64827,7 @@ func (dfdp *DataFlowDebugPackage) UnmarshalJSON(body []byte) error { } case "linkedServices": if v != nil { - var linkedServices []LinkedServiceResource + var linkedServices []LinkedServiceDebugResource err = json.Unmarshal(*v, &linkedServices) if err != nil { return err @@ -62270,6 +64883,46 @@ func (dfdpS DataFlowDebugPackageDebugSettings) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// DataFlowDebugResource data flow debug resource. +type DataFlowDebugResource struct { + // Properties - Data flow properties. + Properties BasicDataFlow `json:"properties,omitempty"` + // Name - The resource name. + Name *string `json:"name,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for DataFlowDebugResource struct. +func (dfdr *DataFlowDebugResource) UnmarshalJSON(body []byte) error { + var m map[string]*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 + } + dfdr.Properties = properties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dfdr.Name = &name + } + } + } + + return nil +} + // DataFlowDebugSessionCreateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type DataFlowDebugSessionCreateFuture struct { @@ -62849,7 +65502,7 @@ type DataLakeAnalyticsUSQLActivity struct { 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 - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLExecutePipeline', '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', 'TypeSwitch', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -62917,6 +65570,11 @@ func (dlaua DataLakeAnalyticsUSQLActivity) AsDataLakeAnalyticsUSQLActivity() (*D return &dlaua, true } +// AsAzureMLExecutePipelineActivity is the BasicActivity implementation for DataLakeAnalyticsUSQLActivity. +func (dlaua DataLakeAnalyticsUSQLActivity) AsAzureMLExecutePipelineActivity() (*AzureMLExecutePipelineActivity, bool) { + return nil, false +} + // AsAzureMLUpdateResourceActivity is the BasicActivity implementation for DataLakeAnalyticsUSQLActivity. func (dlaua DataLakeAnalyticsUSQLActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { return nil, false @@ -63047,6 +65705,11 @@ func (dlaua DataLakeAnalyticsUSQLActivity) AsForEachActivity() (*ForEachActivity return nil, false } +// AsSwitchActivity is the BasicActivity implementation for DataLakeAnalyticsUSQLActivity. +func (dlaua DataLakeAnalyticsUSQLActivity) AsSwitchActivity() (*SwitchActivity, bool) { + return nil, false +} + // AsIfConditionActivity is the BasicActivity implementation for DataLakeAnalyticsUSQLActivity. func (dlaua DataLakeAnalyticsUSQLActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { return nil, false @@ -64528,6 +67191,46 @@ func (dc *DatasetCompression) UnmarshalJSON(body []byte) error { return nil } +// DatasetDebugResource dataset debug resource. +type DatasetDebugResource struct { + // Properties - Dataset properties. + Properties BasicDataset `json:"properties,omitempty"` + // Name - The resource name. + Name *string `json:"name,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for DatasetDebugResource struct. +func (ddr *DatasetDebugResource) UnmarshalJSON(body []byte) error { + var m map[string]*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 := unmarshalBasicDataset(*v) + if err != nil { + return err + } + ddr.Properties = properties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ddr.Name = &name + } + } + } + + return nil +} + // DatasetDeflateCompression the Deflate compression method used on a dataset. type DatasetDeflateCompression struct { // Level - The Deflate compression level. @@ -65364,7 +68067,7 @@ type Db2LinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -65736,6 +68439,11 @@ func (d2ls Db2LinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for Db2LinkedService. func (d2ls Db2LinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -65776,6 +68484,16 @@ func (d2ls Db2LinkedService) AsOracleLinkedService() (*OracleLinkedService, bool return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for Db2LinkedService. func (d2ls Db2LinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -65954,6 +68672,10 @@ type Db2LinkedServiceTypeProperties struct { Username interface{} `json:"username,omitempty"` // Password - Password for authentication. Password BasicSecretBase `json:"password,omitempty"` + // PackageCollection - Under where packages are created when querying database. Type: string (or Expression with resultType string). + PackageCollection interface{} `json:"packageCollection,omitempty"` + // CertificateCommonName - Certificate Common Name when TLS is enabled. Type: string (or Expression with resultType string). + CertificateCommonName interface{} `json:"certificateCommonName,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"` } @@ -66011,6 +68733,24 @@ func (d2lstp *Db2LinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { } d2lstp.Password = password } + case "packageCollection": + if v != nil { + var packageCollection interface{} + err = json.Unmarshal(*v, &packageCollection) + if err != nil { + return err + } + d2lstp.PackageCollection = packageCollection + } + case "certificateCommonName": + if v != nil { + var certificateCommonName interface{} + err = json.Unmarshal(*v, &certificateCommonName) + if err != nil { + return err + } + d2lstp.CertificateCommonName = certificateCommonName + } case "encryptedCredential": if v != nil { var encryptedCredential interface{} @@ -67245,7 +69985,7 @@ type DeleteActivity struct { 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 - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLExecutePipeline', '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', 'TypeSwitch', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -67313,6 +70053,11 @@ func (da DeleteActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUS return nil, false } +// AsAzureMLExecutePipelineActivity is the BasicActivity implementation for DeleteActivity. +func (da DeleteActivity) AsAzureMLExecutePipelineActivity() (*AzureMLExecutePipelineActivity, bool) { + return nil, false +} + // AsAzureMLUpdateResourceActivity is the BasicActivity implementation for DeleteActivity. func (da DeleteActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { return nil, false @@ -67443,6 +70188,11 @@ func (da DeleteActivity) AsForEachActivity() (*ForEachActivity, bool) { return nil, false } +// AsSwitchActivity is the BasicActivity implementation for DeleteActivity. +func (da DeleteActivity) AsSwitchActivity() (*SwitchActivity, bool) { + return nil, false +} + // AsIfConditionActivity is the BasicActivity implementation for DeleteActivity. func (da DeleteActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { return nil, false @@ -70972,7 +73722,7 @@ type DrillLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -71344,6 +74094,11 @@ func (dls DrillLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for DrillLinkedService. func (dls DrillLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -71384,6 +74139,16 @@ func (dls DrillLinkedService) AsOracleLinkedService() (*OracleLinkedService, boo return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for DrillLinkedService. func (dls DrillLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -72765,7 +75530,7 @@ type DynamicsAXLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -73137,6 +75902,11 @@ func (dals DynamicsAXLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, b return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for DynamicsAXLinkedService. +func (dals DynamicsAXLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for DynamicsAXLinkedService. func (dals DynamicsAXLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -73177,6 +75947,16 @@ func (dals DynamicsAXLinkedService) AsOracleLinkedService() (*OracleLinkedServic return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for DynamicsAXLinkedService. +func (dals DynamicsAXLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for DynamicsAXLinkedService. +func (dals DynamicsAXLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for DynamicsAXLinkedService. func (dals DynamicsAXLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -75258,7 +78038,7 @@ type DynamicsCrmLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -75630,6 +78410,11 @@ func (dcls DynamicsCrmLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for DynamicsCrmLinkedService. +func (dcls DynamicsCrmLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for DynamicsCrmLinkedService. func (dcls DynamicsCrmLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -75670,6 +78455,16 @@ func (dcls DynamicsCrmLinkedService) AsOracleLinkedService() (*OracleLinkedServi return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for DynamicsCrmLinkedService. +func (dcls DynamicsCrmLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for DynamicsCrmLinkedService. +func (dcls DynamicsCrmLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for DynamicsCrmLinkedService. func (dcls DynamicsCrmLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -75848,12 +78643,18 @@ type DynamicsCrmLinkedServiceTypeProperties struct { ServiceURI interface{} `json:"serviceUri,omitempty"` // OrganizationName - The organization name of the Dynamics CRM instance. The property is required for on-prem and required for online when there are more than one Dynamics CRM instances associated with the user. Type: string (or Expression with resultType string). OrganizationName interface{} `json:"organizationName,omitempty"` - // AuthenticationType - The authentication type to connect to Dynamics CRM server. 'Office365' for online scenario, 'Ifd' for on-premises with Ifd scenario. Type: string (or Expression with resultType string). Possible values include: 'Office365', 'Ifd' + // AuthenticationType - The authentication type to connect to Dynamics CRM server. 'Office365' for online scenario, 'Ifd' for on-premises with Ifd scenario, 'AADServicePrincipal' for Server-To-Server authentication in online scenario. Type: string (or Expression with resultType string). Possible values include: 'Office365', 'Ifd', 'AADServicePrincipal' AuthenticationType DynamicsAuthenticationType `json:"authenticationType,omitempty"` // Username - User name to access the Dynamics CRM instance. Type: string (or Expression with resultType string). Username interface{} `json:"username,omitempty"` // Password - Password to access the Dynamics CRM instance. Password BasicSecretBase `json:"password,omitempty"` + // ServicePrincipalID - The client ID of the application in Azure Active Directory used for Server-To-Server authentication. Type: string (or Expression with resultType string). + ServicePrincipalID interface{} `json:"servicePrincipalId,omitempty"` + // ServicePrincipalCredentialType - The service principal credential type to use in Server-To-Server authentication. 'ServicePrincipalKey' for key/secret, 'ServicePrincipalCert' for certificate. Type: string (or Expression with resultType string). + ServicePrincipalCredentialType interface{} `json:"servicePrincipalCredentialType,omitempty"` + // ServicePrincipalCredential - The credential of the service principal object in Azure Active Directory. If servicePrincipalCredentialType is 'ServicePrincipalKey', servicePrincipalCredential can be SecureString or AzureKeyVaultSecretReference. If servicePrincipalCredentialType is 'ServicePrincipalCert', servicePrincipalCredential can only be AzureKeyVaultSecretReference. + ServicePrincipalCredential BasicSecretBase `json:"servicePrincipalCredential,omitempty"` // 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"` } @@ -75938,6 +78739,32 @@ func (dclstp *DynamicsCrmLinkedServiceTypeProperties) UnmarshalJSON(body []byte) } dclstp.Password = password } + case "servicePrincipalId": + if v != nil { + var servicePrincipalID interface{} + err = json.Unmarshal(*v, &servicePrincipalID) + if err != nil { + return err + } + dclstp.ServicePrincipalID = servicePrincipalID + } + case "servicePrincipalCredentialType": + if v != nil { + var servicePrincipalCredentialType interface{} + err = json.Unmarshal(*v, &servicePrincipalCredentialType) + if err != nil { + return err + } + dclstp.ServicePrincipalCredentialType = servicePrincipalCredentialType + } + case "servicePrincipalCredential": + if v != nil { + servicePrincipalCredential, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + dclstp.ServicePrincipalCredential = servicePrincipalCredential + } case "encryptedCredential": if v != nil { var encryptedCredential interface{} @@ -77499,7 +80326,7 @@ type DynamicsLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -77871,6 +80698,11 @@ func (dls DynamicsLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. func (dls DynamicsLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -77911,6 +80743,16 @@ func (dls DynamicsLinkedService) AsOracleLinkedService() (*OracleLinkedService, return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. func (dls DynamicsLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -78089,12 +80931,18 @@ type DynamicsLinkedServiceTypeProperties struct { ServiceURI interface{} `json:"serviceUri,omitempty"` // OrganizationName - The organization name of the Dynamics instance. The property is required for on-prem and required for online when there are more than one Dynamics instances associated with the user. Type: string (or Expression with resultType string). OrganizationName interface{} `json:"organizationName,omitempty"` - // AuthenticationType - The authentication type to connect to Dynamics server. 'Office365' for online scenario, 'Ifd' for on-premises with Ifd scenario. Type: string (or Expression with resultType string). + // AuthenticationType - The authentication type to connect to Dynamics server. 'Office365' for online scenario, 'Ifd' for on-premises with Ifd scenario, 'AADServicePrincipal' for Server-To-Server authentication in online scenario. Type: string (or Expression with resultType string). AuthenticationType interface{} `json:"authenticationType,omitempty"` // Username - User name to access the Dynamics instance. Type: string (or Expression with resultType string). Username interface{} `json:"username,omitempty"` // Password - Password to access the Dynamics instance. Password BasicSecretBase `json:"password,omitempty"` + // ServicePrincipalID - The client ID of the application in Azure Active Directory used for Server-To-Server authentication. Type: string (or Expression with resultType string). + ServicePrincipalID interface{} `json:"servicePrincipalId,omitempty"` + // ServicePrincipalCredentialType - The service principal credential type to use in Server-To-Server authentication. 'ServicePrincipalKey' for key/secret, 'ServicePrincipalCert' for certificate. Type: string (or Expression with resultType string). + ServicePrincipalCredentialType interface{} `json:"servicePrincipalCredentialType,omitempty"` + // ServicePrincipalCredential - The credential of the service principal object in Azure Active Directory. If servicePrincipalCredentialType is 'ServicePrincipalKey', servicePrincipalCredential can be SecureString or AzureKeyVaultSecretReference. If servicePrincipalCredentialType is 'ServicePrincipalCert', servicePrincipalCredential can only be AzureKeyVaultSecretReference. + ServicePrincipalCredential BasicSecretBase `json:"servicePrincipalCredential,omitempty"` // 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"` } @@ -78179,6 +81027,32 @@ func (dlstp *DynamicsLinkedServiceTypeProperties) UnmarshalJSON(body []byte) err } dlstp.Password = password } + case "servicePrincipalId": + if v != nil { + var servicePrincipalID interface{} + err = json.Unmarshal(*v, &servicePrincipalID) + if err != nil { + return err + } + dlstp.ServicePrincipalID = servicePrincipalID + } + case "servicePrincipalCredentialType": + if v != nil { + var servicePrincipalCredentialType interface{} + err = json.Unmarshal(*v, &servicePrincipalCredentialType) + if err != nil { + return err + } + dlstp.ServicePrincipalCredentialType = servicePrincipalCredentialType + } + case "servicePrincipalCredential": + if v != nil { + servicePrincipalCredential, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + dlstp.ServicePrincipalCredential = servicePrincipalCredential + } case "encryptedCredential": if v != nil { var encryptedCredential interface{} @@ -79120,7 +81994,7 @@ type EloquaLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -79492,6 +82366,11 @@ func (els EloquaLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for EloquaLinkedService. func (els EloquaLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -79532,6 +82411,16 @@ func (els EloquaLinkedService) AsOracleLinkedService() (*OracleLinkedService, bo return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for EloquaLinkedService. func (els EloquaLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -81097,7 +83986,7 @@ type ExecuteDataFlowActivity struct { 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 - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLExecutePipeline', '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', 'TypeSwitch', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -81165,6 +84054,11 @@ func (edfa ExecuteDataFlowActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLake return nil, false } +// AsAzureMLExecutePipelineActivity is the BasicActivity implementation for ExecuteDataFlowActivity. +func (edfa ExecuteDataFlowActivity) AsAzureMLExecutePipelineActivity() (*AzureMLExecutePipelineActivity, bool) { + return nil, false +} + // AsAzureMLUpdateResourceActivity is the BasicActivity implementation for ExecuteDataFlowActivity. func (edfa ExecuteDataFlowActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { return nil, false @@ -81295,6 +84189,11 @@ func (edfa ExecuteDataFlowActivity) AsForEachActivity() (*ForEachActivity, bool) return nil, false } +// AsSwitchActivity is the BasicActivity implementation for ExecuteDataFlowActivity. +func (edfa ExecuteDataFlowActivity) AsSwitchActivity() (*SwitchActivity, bool) { + return nil, false +} + // AsIfConditionActivity is the BasicActivity implementation for ExecuteDataFlowActivity. func (edfa ExecuteDataFlowActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { return nil, false @@ -81448,7 +84347,7 @@ type ExecutePipelineActivity struct { 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 - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLExecutePipeline', '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', 'TypeSwitch', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -81510,6 +84409,11 @@ func (epa ExecutePipelineActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeA return nil, false } +// AsAzureMLExecutePipelineActivity is the BasicActivity implementation for ExecutePipelineActivity. +func (epa ExecutePipelineActivity) AsAzureMLExecutePipelineActivity() (*AzureMLExecutePipelineActivity, bool) { + return nil, false +} + // AsAzureMLUpdateResourceActivity is the BasicActivity implementation for ExecutePipelineActivity. func (epa ExecutePipelineActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { return nil, false @@ -81640,6 +84544,11 @@ func (epa ExecutePipelineActivity) AsForEachActivity() (*ForEachActivity, bool) return nil, false } +// AsSwitchActivity is the BasicActivity implementation for ExecutePipelineActivity. +func (epa ExecutePipelineActivity) AsSwitchActivity() (*SwitchActivity, bool) { + return nil, false +} + // AsIfConditionActivity is the BasicActivity implementation for ExecutePipelineActivity. func (epa ExecutePipelineActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { return nil, false @@ -81794,7 +84703,7 @@ type ExecuteSSISPackageActivity struct { 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 - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLExecutePipeline', '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', 'TypeSwitch', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -81862,6 +84771,11 @@ func (espa ExecuteSSISPackageActivity) AsDataLakeAnalyticsUSQLActivity() (*DataL return nil, false } +// AsAzureMLExecutePipelineActivity is the BasicActivity implementation for ExecuteSSISPackageActivity. +func (espa ExecuteSSISPackageActivity) AsAzureMLExecutePipelineActivity() (*AzureMLExecutePipelineActivity, bool) { + return nil, false +} + // AsAzureMLUpdateResourceActivity is the BasicActivity implementation for ExecuteSSISPackageActivity. func (espa ExecuteSSISPackageActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { return nil, false @@ -81992,6 +84906,11 @@ func (espa ExecuteSSISPackageActivity) AsForEachActivity() (*ForEachActivity, bo return nil, false } +// AsSwitchActivity is the BasicActivity implementation for ExecuteSSISPackageActivity. +func (espa ExecuteSSISPackageActivity) AsSwitchActivity() (*SwitchActivity, bool) { + return nil, false +} + // AsIfConditionActivity is the BasicActivity implementation for ExecuteSSISPackageActivity. func (espa ExecuteSSISPackageActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { return nil, false @@ -82199,6 +85118,7 @@ type BasicExecutionActivity interface { AsDatabricksSparkJarActivity() (*DatabricksSparkJarActivity, bool) AsDatabricksNotebookActivity() (*DatabricksNotebookActivity, bool) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUSQLActivity, bool) + AsAzureMLExecutePipelineActivity() (*AzureMLExecutePipelineActivity, bool) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) AsAzureMLBatchExecutionActivity() (*AzureMLBatchExecutionActivity, bool) AsGetMetadataActivity() (*GetMetadataActivity, bool) @@ -82234,7 +85154,7 @@ type ExecutionActivity struct { 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 - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLExecutePipeline', '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', 'TypeSwitch', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -82270,6 +85190,10 @@ func unmarshalBasicExecutionActivity(body []byte) (BasicExecutionActivity, error var dlaua DataLakeAnalyticsUSQLActivity err := json.Unmarshal(body, &dlaua) return dlaua, err + case string(TypeAzureMLExecutePipeline): + var amepa AzureMLExecutePipelineActivity + err := json.Unmarshal(body, &amepa) + return amepa, err case string(TypeAzureMLUpdateResource): var amura AzureMLUpdateResourceActivity err := json.Unmarshal(body, &amura) @@ -82420,6 +85344,11 @@ func (ea ExecutionActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalytic return nil, false } +// AsAzureMLExecutePipelineActivity is the BasicActivity implementation for ExecutionActivity. +func (ea ExecutionActivity) AsAzureMLExecutePipelineActivity() (*AzureMLExecutePipelineActivity, bool) { + return nil, false +} + // AsAzureMLUpdateResourceActivity is the BasicActivity implementation for ExecutionActivity. func (ea ExecutionActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { return nil, false @@ -82550,6 +85479,11 @@ func (ea ExecutionActivity) AsForEachActivity() (*ForEachActivity, bool) { return nil, false } +// AsSwitchActivity is the BasicActivity implementation for ExecutionActivity. +func (ea ExecutionActivity) AsSwitchActivity() (*SwitchActivity, bool) { + return nil, false +} + // AsIfConditionActivity is the BasicActivity implementation for ExecutionActivity. func (ea ExecutionActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { return nil, false @@ -83376,7 +86310,7 @@ type FileServerLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -83748,6 +86682,11 @@ func (fsls FileServerLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, b return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for FileServerLinkedService. func (fsls FileServerLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -83788,6 +86727,16 @@ func (fsls FileServerLinkedService) AsOracleLinkedService() (*OracleLinkedServic return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for FileServerLinkedService. func (fsls FileServerLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return &fsls, true @@ -85975,7 +88924,7 @@ type FilterActivity struct { 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 - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLExecutePipeline', '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', 'TypeSwitch', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -86037,6 +88986,11 @@ func (fa FilterActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUS return nil, false } +// AsAzureMLExecutePipelineActivity is the BasicActivity implementation for FilterActivity. +func (fa FilterActivity) AsAzureMLExecutePipelineActivity() (*AzureMLExecutePipelineActivity, bool) { + return nil, false +} + // AsAzureMLUpdateResourceActivity is the BasicActivity implementation for FilterActivity. func (fa FilterActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { return nil, false @@ -86167,6 +89121,11 @@ func (fa FilterActivity) AsForEachActivity() (*ForEachActivity, bool) { return nil, false } +// AsSwitchActivity is the BasicActivity implementation for FilterActivity. +func (fa FilterActivity) AsSwitchActivity() (*SwitchActivity, bool) { + return nil, false +} + // AsIfConditionActivity is the BasicActivity implementation for FilterActivity. func (fa FilterActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { return nil, false @@ -86300,7 +89259,7 @@ type ForEachActivity struct { 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 - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLExecutePipeline', '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', 'TypeSwitch', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -86362,6 +89321,11 @@ func (fea ForEachActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalytics return nil, false } +// AsAzureMLExecutePipelineActivity is the BasicActivity implementation for ForEachActivity. +func (fea ForEachActivity) AsAzureMLExecutePipelineActivity() (*AzureMLExecutePipelineActivity, bool) { + return nil, false +} + // AsAzureMLUpdateResourceActivity is the BasicActivity implementation for ForEachActivity. func (fea ForEachActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { return nil, false @@ -86492,6 +89456,11 @@ func (fea ForEachActivity) AsForEachActivity() (*ForEachActivity, bool) { return &fea, true } +// AsSwitchActivity is the BasicActivity implementation for ForEachActivity. +func (fea ForEachActivity) AsSwitchActivity() (*SwitchActivity, bool) { + return nil, false +} + // AsIfConditionActivity is the BasicActivity implementation for ForEachActivity. func (fea ForEachActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { return nil, false @@ -86917,7 +89886,7 @@ type FtpServerLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -87289,6 +90258,11 @@ func (fsls FtpServerLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bo return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. func (fsls FtpServerLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -87329,6 +90303,16 @@ func (fsls FtpServerLinkedService) AsOracleLinkedService() (*OracleLinkedService return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. func (fsls FtpServerLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -87765,7 +90749,7 @@ type GetMetadataActivity struct { 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 - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLExecutePipeline', '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', 'TypeSwitch', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -87833,6 +90817,11 @@ func (gma GetMetadataActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnaly return nil, false } +// AsAzureMLExecutePipelineActivity is the BasicActivity implementation for GetMetadataActivity. +func (gma GetMetadataActivity) AsAzureMLExecutePipelineActivity() (*AzureMLExecutePipelineActivity, bool) { + return nil, false +} + // AsAzureMLUpdateResourceActivity is the BasicActivity implementation for GetMetadataActivity. func (gma GetMetadataActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { return nil, false @@ -87963,6 +90952,11 @@ func (gma GetMetadataActivity) AsForEachActivity() (*ForEachActivity, bool) { return nil, false } +// AsSwitchActivity is the BasicActivity implementation for GetMetadataActivity. +func (gma GetMetadataActivity) AsSwitchActivity() (*SwitchActivity, bool) { + return nil, false +} + // AsIfConditionActivity is the BasicActivity implementation for GetMetadataActivity. func (gma GetMetadataActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { return nil, false @@ -88137,7 +91131,7 @@ type GoogleAdWordsLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -88509,6 +91503,11 @@ func (gawls GoogleAdWordsLinkedService) AsOdbcLinkedService() (*OdbcLinkedServic return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for GoogleAdWordsLinkedService. +func (gawls GoogleAdWordsLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for GoogleAdWordsLinkedService. func (gawls GoogleAdWordsLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -88549,6 +91548,16 @@ func (gawls GoogleAdWordsLinkedService) AsOracleLinkedService() (*OracleLinkedSe return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for GoogleAdWordsLinkedService. +func (gawls GoogleAdWordsLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for GoogleAdWordsLinkedService. +func (gawls GoogleAdWordsLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for GoogleAdWordsLinkedService. func (gawls GoogleAdWordsLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -90066,7 +93075,7 @@ type GoogleBigQueryLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -90438,6 +93447,11 @@ func (gbqls GoogleBigQueryLinkedService) AsOdbcLinkedService() (*OdbcLinkedServi return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. func (gbqls GoogleBigQueryLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -90478,6 +93492,16 @@ func (gbqls GoogleBigQueryLinkedService) AsOracleLinkedService() (*OracleLinkedS return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. func (gbqls GoogleBigQueryLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -91983,6 +95007,955 @@ func (gbqs *GoogleBigQuerySource) UnmarshalJSON(body []byte) error { return nil } +// GoogleCloudStorageLinkedService linked service for Google Cloud Storage. +type GoogleCloudStorageLinkedService struct { + // GoogleCloudStorageLinkedServiceTypeProperties - Google Cloud Storage linked service properties. + *GoogleCloudStorageLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the linked service. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) MarshalJSON() ([]byte, error) { + gcsls.Type = TypeGoogleCloudStorage + objectMap := make(map[string]interface{}) + if gcsls.GoogleCloudStorageLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = gcsls.GoogleCloudStorageLinkedServiceTypeProperties + } + if gcsls.ConnectVia != nil { + objectMap["connectVia"] = gcsls.ConnectVia + } + if gcsls.Description != nil { + objectMap["description"] = gcsls.Description + } + if gcsls.Parameters != nil { + objectMap["parameters"] = gcsls.Parameters + } + if gcsls.Annotations != nil { + objectMap["annotations"] = gcsls.Annotations + } + if gcsls.Type != "" { + objectMap["type"] = gcsls.Type + } + for k, v := range gcsls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAzureFunctionLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsAzureFunctionLinkedService() (*AzureFunctionLinkedService, bool) { + return nil, false +} + +// AsAzureDataExplorerLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsAzureDataExplorerLinkedService() (*AzureDataExplorerLinkedService, bool) { + return nil, false +} + +// AsSapTableLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsSapTableLinkedService() (*SapTableLinkedService, bool) { + return nil, false +} + +// AsGoogleAdWordsLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsGoogleAdWordsLinkedService() (*GoogleAdWordsLinkedService, bool) { + return nil, false +} + +// AsOracleServiceCloudLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsOracleServiceCloudLinkedService() (*OracleServiceCloudLinkedService, bool) { + return nil, false +} + +// AsDynamicsAXLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsDynamicsAXLinkedService() (*DynamicsAXLinkedService, bool) { + return nil, false +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsAzureMariaDBLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsAzureMariaDBLinkedService() (*AzureMariaDBLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsRestServiceLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsRestServiceLinkedService() (*RestServiceLinkedService, bool) { + return nil, false +} + +// AsSapOpenHubLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsSapOpenHubLinkedService() (*SapOpenHubLinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceServiceCloudLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsSalesforceServiceCloudLinkedService() (*SalesforceServiceCloudLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsOffice365LinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsOffice365LinkedService() (*Office365LinkedService, bool) { + return nil, false +} + +// AsAzureBlobFSLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsAzureBlobFSLinkedService() (*AzureBlobFSLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPILinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsCosmosDbMongoDbAPILinkedService() (*CosmosDbMongoDbAPILinkedService, bool) { + return nil, false +} + +// AsMongoDbV2LinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsMongoDbV2LinkedService() (*MongoDbV2LinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsMicrosoftAccessLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsMicrosoftAccessLinkedService() (*MicrosoftAccessLinkedService, bool) { + return nil, false +} + +// AsInformixLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsInformixLinkedService() (*InformixLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return &gcsls, true +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsCommonDataServiceForAppsLinkedService() (*CommonDataServiceForAppsLinkedService, bool) { + return nil, false +} + +// AsDynamicsCrmLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsDynamicsCrmLinkedService() (*DynamicsCrmLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLMILinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsAzureSQLMILinkedService() (*AzureSQLMILinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureTableStorageLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsAzureTableStorageLinkedService() (*AzureTableStorageLinkedService, bool) { + return nil, false +} + +// AsAzureBlobStorageLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsAzureBlobStorageLinkedService() (*AzureBlobStorageLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for GoogleCloudStorageLinkedService. +func (gcsls GoogleCloudStorageLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &gcsls, true +} + +// UnmarshalJSON is the custom unmarshaler for GoogleCloudStorageLinkedService struct. +func (gcsls *GoogleCloudStorageLinkedService) UnmarshalJSON(body []byte) error { + 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 googleCloudStorageLinkedServiceTypeProperties GoogleCloudStorageLinkedServiceTypeProperties + err = json.Unmarshal(*v, &googleCloudStorageLinkedServiceTypeProperties) + if err != nil { + return err + } + gcsls.GoogleCloudStorageLinkedServiceTypeProperties = &googleCloudStorageLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if gcsls.AdditionalProperties == nil { + gcsls.AdditionalProperties = make(map[string]interface{}) + } + gcsls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + gcsls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + gcsls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + gcsls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + gcsls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + gcsls.Type = typeVar + } + } + } + + return nil +} + +// GoogleCloudStorageLinkedServiceTypeProperties google Cloud Storage linked service properties. +type GoogleCloudStorageLinkedServiceTypeProperties struct { + // AccessKeyID - The access key identifier of the Google Cloud Storage Identity and Access Management (IAM) user. Type: string (or Expression with resultType string). + AccessKeyID interface{} `json:"accessKeyId,omitempty"` + // SecretAccessKey - The secret access key of the Google Cloud Storage Identity and Access Management (IAM) user. + SecretAccessKey BasicSecretBase `json:"secretAccessKey,omitempty"` + // ServiceURL - This value specifies the endpoint to access with the Google Cloud Storage Connector. This is an optional property; change it only if you want to try a different service endpoint or want to switch between https and http. Type: string (or Expression with resultType string). + ServiceURL interface{} `json:"serviceUrl,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 GoogleCloudStorageLinkedServiceTypeProperties struct. +func (gcslstp *GoogleCloudStorageLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "accessKeyId": + if v != nil { + var accessKeyID interface{} + err = json.Unmarshal(*v, &accessKeyID) + if err != nil { + return err + } + gcslstp.AccessKeyID = accessKeyID + } + case "secretAccessKey": + if v != nil { + secretAccessKey, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + gcslstp.SecretAccessKey = secretAccessKey + } + case "serviceUrl": + if v != nil { + var serviceURL interface{} + err = json.Unmarshal(*v, &serviceURL) + if err != nil { + return err + } + gcslstp.ServiceURL = serviceURL + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + gcslstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// GoogleCloudStorageLocation the location of Google Cloud Storage dataset. +type GoogleCloudStorageLocation struct { + // BucketName - Specify the bucketName of Google Cloud Storage. Type: string (or Expression with resultType string) + BucketName interface{} `json:"bucketName,omitempty"` + // Version - Specify the version of Google Cloud Storage. Type: string (or Expression with resultType string). + Version interface{} `json:"version,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Type - Type of dataset storage location. + Type *string `json:"type,omitempty"` + // FolderPath - Specify the folder path of dataset. Type: string (or Expression with resultType string) + FolderPath interface{} `json:"folderPath,omitempty"` + // FileName - Specify the file name of dataset. Type: string (or Expression with resultType string). + FileName interface{} `json:"fileName,omitempty"` +} + +// MarshalJSON is the custom marshaler for GoogleCloudStorageLocation. +func (gcsl GoogleCloudStorageLocation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gcsl.BucketName != nil { + objectMap["bucketName"] = gcsl.BucketName + } + if gcsl.Version != nil { + objectMap["version"] = gcsl.Version + } + if gcsl.Type != nil { + objectMap["type"] = gcsl.Type + } + if gcsl.FolderPath != nil { + objectMap["folderPath"] = gcsl.FolderPath + } + if gcsl.FileName != nil { + objectMap["fileName"] = gcsl.FileName + } + for k, v := range gcsl.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for GoogleCloudStorageLocation struct. +func (gcsl *GoogleCloudStorageLocation) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "bucketName": + if v != nil { + var bucketName interface{} + err = json.Unmarshal(*v, &bucketName) + if err != nil { + return err + } + gcsl.BucketName = bucketName + } + case "version": + if v != nil { + var version interface{} + err = json.Unmarshal(*v, &version) + if err != nil { + return err + } + gcsl.Version = version + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if gcsl.AdditionalProperties == nil { + gcsl.AdditionalProperties = make(map[string]interface{}) + } + gcsl.AdditionalProperties[k] = additionalProperties + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + gcsl.Type = &typeVar + } + case "folderPath": + if v != nil { + var folderPath interface{} + err = json.Unmarshal(*v, &folderPath) + if err != nil { + return err + } + gcsl.FolderPath = folderPath + } + case "fileName": + if v != nil { + var fileName interface{} + err = json.Unmarshal(*v, &fileName) + if err != nil { + return err + } + gcsl.FileName = fileName + } + } + } + + return nil +} + +// GoogleCloudStorageReadSettings google Cloud Storage read settings. +type GoogleCloudStorageReadSettings struct { + // Recursive - If true, files under the folder path will be read recursively. Default is true. Type: boolean (or Expression with resultType boolean). + Recursive interface{} `json:"recursive,omitempty"` + // WildcardFolderPath - Google Cloud Storage wildcardFolderPath. Type: string (or Expression with resultType string). + WildcardFolderPath interface{} `json:"wildcardFolderPath,omitempty"` + // WildcardFileName - Google Cloud Storage wildcardFileName. Type: string (or Expression with resultType string). + WildcardFileName interface{} `json:"wildcardFileName,omitempty"` + // Prefix - The prefix filter for the Google Cloud Storage object name. Type: string (or Expression with resultType string). + Prefix interface{} `json:"prefix,omitempty"` + // EnablePartitionDiscovery - Indicates whether to enable partition discovery. + EnablePartitionDiscovery *bool `json:"enablePartitionDiscovery,omitempty"` + // ModifiedDatetimeStart - The start of file's modified datetime. Type: string (or Expression with resultType string). + ModifiedDatetimeStart interface{} `json:"modifiedDatetimeStart,omitempty"` + // ModifiedDatetimeEnd - The end of file's modified datetime. Type: string (or Expression with resultType string). + ModifiedDatetimeEnd interface{} `json:"modifiedDatetimeEnd,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Type - The read setting type. + Type *string `json:"type,omitempty"` + // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). + MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` +} + +// MarshalJSON is the custom marshaler for GoogleCloudStorageReadSettings. +func (gcsrs GoogleCloudStorageReadSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gcsrs.Recursive != nil { + objectMap["recursive"] = gcsrs.Recursive + } + if gcsrs.WildcardFolderPath != nil { + objectMap["wildcardFolderPath"] = gcsrs.WildcardFolderPath + } + if gcsrs.WildcardFileName != nil { + objectMap["wildcardFileName"] = gcsrs.WildcardFileName + } + if gcsrs.Prefix != nil { + objectMap["prefix"] = gcsrs.Prefix + } + if gcsrs.EnablePartitionDiscovery != nil { + objectMap["enablePartitionDiscovery"] = gcsrs.EnablePartitionDiscovery + } + if gcsrs.ModifiedDatetimeStart != nil { + objectMap["modifiedDatetimeStart"] = gcsrs.ModifiedDatetimeStart + } + if gcsrs.ModifiedDatetimeEnd != nil { + objectMap["modifiedDatetimeEnd"] = gcsrs.ModifiedDatetimeEnd + } + if gcsrs.Type != nil { + objectMap["type"] = gcsrs.Type + } + if gcsrs.MaxConcurrentConnections != nil { + objectMap["maxConcurrentConnections"] = gcsrs.MaxConcurrentConnections + } + for k, v := range gcsrs.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for GoogleCloudStorageReadSettings struct. +func (gcsrs *GoogleCloudStorageReadSettings) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "recursive": + if v != nil { + var recursive interface{} + err = json.Unmarshal(*v, &recursive) + if err != nil { + return err + } + gcsrs.Recursive = recursive + } + case "wildcardFolderPath": + if v != nil { + var wildcardFolderPath interface{} + err = json.Unmarshal(*v, &wildcardFolderPath) + if err != nil { + return err + } + gcsrs.WildcardFolderPath = wildcardFolderPath + } + case "wildcardFileName": + if v != nil { + var wildcardFileName interface{} + err = json.Unmarshal(*v, &wildcardFileName) + if err != nil { + return err + } + gcsrs.WildcardFileName = wildcardFileName + } + case "prefix": + if v != nil { + var prefix interface{} + err = json.Unmarshal(*v, &prefix) + if err != nil { + return err + } + gcsrs.Prefix = prefix + } + case "enablePartitionDiscovery": + if v != nil { + var enablePartitionDiscovery bool + err = json.Unmarshal(*v, &enablePartitionDiscovery) + if err != nil { + return err + } + gcsrs.EnablePartitionDiscovery = &enablePartitionDiscovery + } + case "modifiedDatetimeStart": + if v != nil { + var modifiedDatetimeStart interface{} + err = json.Unmarshal(*v, &modifiedDatetimeStart) + if err != nil { + return err + } + gcsrs.ModifiedDatetimeStart = modifiedDatetimeStart + } + case "modifiedDatetimeEnd": + if v != nil { + var modifiedDatetimeEnd interface{} + err = json.Unmarshal(*v, &modifiedDatetimeEnd) + if err != nil { + return err + } + gcsrs.ModifiedDatetimeEnd = modifiedDatetimeEnd + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if gcsrs.AdditionalProperties == nil { + gcsrs.AdditionalProperties = make(map[string]interface{}) + } + gcsrs.AdditionalProperties[k] = additionalProperties + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + gcsrs.Type = &typeVar + } + case "maxConcurrentConnections": + if v != nil { + var maxConcurrentConnections interface{} + err = json.Unmarshal(*v, &maxConcurrentConnections) + if err != nil { + return err + } + gcsrs.MaxConcurrentConnections = maxConcurrentConnections + } + } + } + + return nil +} + // GreenplumDatasetTypeProperties greenplum Dataset Properties type GreenplumDatasetTypeProperties struct { // TableName - This property will be retired. Please consider using schema + table properties instead. @@ -92007,7 +95980,7 @@ type GreenplumLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -92379,6 +96352,11 @@ func (gls GreenplumLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, boo return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. func (gls GreenplumLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -92419,6 +96397,16 @@ func (gls GreenplumLinkedService) AsOracleLinkedService() (*OracleLinkedService, return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. func (gls GreenplumLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -93800,7 +97788,7 @@ type HBaseLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -94172,6 +98160,11 @@ func (hbls HBaseLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for HBaseLinkedService. func (hbls HBaseLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -94212,6 +98205,16 @@ func (hbls HBaseLinkedService) AsOracleLinkedService() (*OracleLinkedService, bo return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for HBaseLinkedService. func (hbls HBaseLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -95722,7 +99725,7 @@ type HdfsLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -96094,6 +100097,11 @@ func (hls HdfsLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for HdfsLinkedService. func (hls HdfsLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -96134,6 +100142,16 @@ func (hls HdfsLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for HdfsLinkedService. func (hls HdfsLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -97220,7 +101238,7 @@ type HDInsightHiveActivity struct { 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 - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLExecutePipeline', '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', 'TypeSwitch', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -97288,6 +101306,11 @@ func (hiha HDInsightHiveActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAn return nil, false } +// AsAzureMLExecutePipelineActivity is the BasicActivity implementation for HDInsightHiveActivity. +func (hiha HDInsightHiveActivity) AsAzureMLExecutePipelineActivity() (*AzureMLExecutePipelineActivity, bool) { + return nil, false +} + // AsAzureMLUpdateResourceActivity is the BasicActivity implementation for HDInsightHiveActivity. func (hiha HDInsightHiveActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { return nil, false @@ -97418,6 +101441,11 @@ func (hiha HDInsightHiveActivity) AsForEachActivity() (*ForEachActivity, bool) { return nil, false } +// AsSwitchActivity is the BasicActivity implementation for HDInsightHiveActivity. +func (hiha HDInsightHiveActivity) AsSwitchActivity() (*SwitchActivity, bool) { + return nil, false +} + // AsIfConditionActivity is the BasicActivity implementation for HDInsightHiveActivity. func (hiha HDInsightHiveActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { return nil, false @@ -97611,7 +101639,7 @@ type HDInsightLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -97983,6 +102011,11 @@ func (hils HDInsightLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bo return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. func (hils HDInsightLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -98023,6 +102056,16 @@ func (hils HDInsightLinkedService) AsOracleLinkedService() (*OracleLinkedService return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. func (hils HDInsightLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -98313,7 +102356,7 @@ type HDInsightMapReduceActivity struct { 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 - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLExecutePipeline', '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', 'TypeSwitch', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -98381,6 +102424,11 @@ func (himra HDInsightMapReduceActivity) AsDataLakeAnalyticsUSQLActivity() (*Data return nil, false } +// AsAzureMLExecutePipelineActivity is the BasicActivity implementation for HDInsightMapReduceActivity. +func (himra HDInsightMapReduceActivity) AsAzureMLExecutePipelineActivity() (*AzureMLExecutePipelineActivity, bool) { + return nil, false +} + // AsAzureMLUpdateResourceActivity is the BasicActivity implementation for HDInsightMapReduceActivity. func (himra HDInsightMapReduceActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { return nil, false @@ -98511,6 +102559,11 @@ func (himra HDInsightMapReduceActivity) AsForEachActivity() (*ForEachActivity, b return nil, false } +// AsSwitchActivity is the BasicActivity implementation for HDInsightMapReduceActivity. +func (himra HDInsightMapReduceActivity) AsSwitchActivity() (*SwitchActivity, bool) { + return nil, false +} + // AsIfConditionActivity is the BasicActivity implementation for HDInsightMapReduceActivity. func (himra HDInsightMapReduceActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { return nil, false @@ -98704,7 +102757,7 @@ type HDInsightOnDemandLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -99076,6 +103129,11 @@ func (hiodls HDInsightOnDemandLinkedService) AsOdbcLinkedService() (*OdbcLinkedS return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. func (hiodls HDInsightOnDemandLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -99116,6 +103174,16 @@ func (hiodls HDInsightOnDemandLinkedService) AsOracleLinkedService() (*OracleLin return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. func (hiodls HDInsightOnDemandLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -99679,7 +103747,7 @@ type HDInsightPigActivity struct { 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 - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLExecutePipeline', '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', 'TypeSwitch', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -99747,6 +103815,11 @@ func (hipa HDInsightPigActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAna return nil, false } +// AsAzureMLExecutePipelineActivity is the BasicActivity implementation for HDInsightPigActivity. +func (hipa HDInsightPigActivity) AsAzureMLExecutePipelineActivity() (*AzureMLExecutePipelineActivity, bool) { + return nil, false +} + // AsAzureMLUpdateResourceActivity is the BasicActivity implementation for HDInsightPigActivity. func (hipa HDInsightPigActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { return nil, false @@ -99877,6 +103950,11 @@ func (hipa HDInsightPigActivity) AsForEachActivity() (*ForEachActivity, bool) { return nil, false } +// AsSwitchActivity is the BasicActivity implementation for HDInsightPigActivity. +func (hipa HDInsightPigActivity) AsSwitchActivity() (*SwitchActivity, bool) { + return nil, false +} + // AsIfConditionActivity is the BasicActivity implementation for HDInsightPigActivity. func (hipa HDInsightPigActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { return nil, false @@ -100010,8 +104088,8 @@ func (hipa *HDInsightPigActivity) UnmarshalJSON(body []byte) error { type HDInsightPigActivityTypeProperties struct { // StorageLinkedServices - Storage linked service references. StorageLinkedServices *[]LinkedServiceReference `json:"storageLinkedServices,omitempty"` - // Arguments - User specified arguments to HDInsightActivity. - Arguments *[]interface{} `json:"arguments,omitempty"` + // Arguments - User specified arguments to HDInsightActivity. Type: array (or Expression with resultType array). + Arguments interface{} `json:"arguments,omitempty"` // GetDebugInfo - Debug info option. Possible values include: 'HDInsightActivityDebugInfoOptionNone', 'HDInsightActivityDebugInfoOptionAlways', 'HDInsightActivityDebugInfoOptionFailure' GetDebugInfo HDInsightActivityDebugInfoOption `json:"getDebugInfo,omitempty"` // ScriptPath - Script path. Type: string (or Expression with resultType string). @@ -100064,7 +104142,7 @@ type HDInsightSparkActivity struct { 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 - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLExecutePipeline', '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', 'TypeSwitch', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -100132,6 +104210,11 @@ func (hisa HDInsightSparkActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeA return nil, false } +// AsAzureMLExecutePipelineActivity is the BasicActivity implementation for HDInsightSparkActivity. +func (hisa HDInsightSparkActivity) AsAzureMLExecutePipelineActivity() (*AzureMLExecutePipelineActivity, bool) { + return nil, false +} + // AsAzureMLUpdateResourceActivity is the BasicActivity implementation for HDInsightSparkActivity. func (hisa HDInsightSparkActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { return nil, false @@ -100262,6 +104345,11 @@ func (hisa HDInsightSparkActivity) AsForEachActivity() (*ForEachActivity, bool) return nil, false } +// AsSwitchActivity is the BasicActivity implementation for HDInsightSparkActivity. +func (hisa HDInsightSparkActivity) AsSwitchActivity() (*SwitchActivity, bool) { + return nil, false +} + // AsIfConditionActivity is the BasicActivity implementation for HDInsightSparkActivity. func (hisa HDInsightSparkActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { return nil, false @@ -100459,7 +104547,7 @@ type HDInsightStreamingActivity struct { 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 - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLExecutePipeline', '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', 'TypeSwitch', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -100527,6 +104615,11 @@ func (hisa HDInsightStreamingActivity) AsDataLakeAnalyticsUSQLActivity() (*DataL return nil, false } +// AsAzureMLExecutePipelineActivity is the BasicActivity implementation for HDInsightStreamingActivity. +func (hisa HDInsightStreamingActivity) AsAzureMLExecutePipelineActivity() (*AzureMLExecutePipelineActivity, bool) { + return nil, false +} + // AsAzureMLUpdateResourceActivity is the BasicActivity implementation for HDInsightStreamingActivity. func (hisa HDInsightStreamingActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { return nil, false @@ -100657,6 +104750,11 @@ func (hisa HDInsightStreamingActivity) AsForEachActivity() (*ForEachActivity, bo return nil, false } +// AsSwitchActivity is the BasicActivity implementation for HDInsightStreamingActivity. +func (hisa HDInsightStreamingActivity) AsSwitchActivity() (*SwitchActivity, bool) { + return nil, false +} + // AsIfConditionActivity is the BasicActivity implementation for HDInsightStreamingActivity. func (hisa HDInsightStreamingActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { return nil, false @@ -100880,7 +104978,7 @@ type HiveLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -101252,6 +105350,11 @@ func (hls HiveLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for HiveLinkedService. func (hls HiveLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -101292,6 +105395,16 @@ func (hls HiveLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for HiveLinkedService. func (hls HiveLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -103567,7 +107680,7 @@ type HTTPLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -103939,6 +108052,11 @@ func (hls HTTPLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for HTTPLinkedService. func (hls HTTPLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -103979,6 +108097,16 @@ func (hls HTTPLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for HTTPLinkedService. func (hls HTTPLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -105052,7 +109180,7 @@ type HubspotLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -105424,6 +109552,11 @@ func (hls HubspotLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for HubspotLinkedService. func (hls HubspotLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -105464,6 +109597,16 @@ func (hls HubspotLinkedService) AsOracleLinkedService() (*OracleLinkedService, b return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for HubspotLinkedService. func (hls HubspotLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -106941,7 +111084,7 @@ type IfConditionActivity struct { 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 - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLExecutePipeline', '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', 'TypeSwitch', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -107003,6 +111146,11 @@ func (ica IfConditionActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnaly return nil, false } +// AsAzureMLExecutePipelineActivity is the BasicActivity implementation for IfConditionActivity. +func (ica IfConditionActivity) AsAzureMLExecutePipelineActivity() (*AzureMLExecutePipelineActivity, bool) { + return nil, false +} + // AsAzureMLUpdateResourceActivity is the BasicActivity implementation for IfConditionActivity. func (ica IfConditionActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { return nil, false @@ -107133,6 +111281,11 @@ func (ica IfConditionActivity) AsForEachActivity() (*ForEachActivity, bool) { return nil, false } +// AsSwitchActivity is the BasicActivity implementation for IfConditionActivity. +func (ica IfConditionActivity) AsSwitchActivity() (*SwitchActivity, bool) { + return nil, false +} + // AsIfConditionActivity is the BasicActivity implementation for IfConditionActivity. func (ica IfConditionActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { return &ica, true @@ -107318,7 +111471,7 @@ type ImpalaLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -107690,6 +111843,11 @@ func (ils ImpalaLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. func (ils ImpalaLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -107730,6 +111888,16 @@ func (ils ImpalaLinkedService) AsOracleLinkedService() (*OracleLinkedService, bo return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. func (ils ImpalaLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -109240,7 +113408,7 @@ type InformixLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -109612,6 +113780,11 @@ func (ils InformixLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for InformixLinkedService. +func (ils InformixLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for InformixLinkedService. func (ils InformixLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -109652,6 +113825,16 @@ func (ils InformixLinkedService) AsOracleLinkedService() (*OracleLinkedService, return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for InformixLinkedService. +func (ils InformixLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for InformixLinkedService. +func (ils InformixLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for InformixLinkedService. func (ils InformixLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -111906,6 +116089,46 @@ type IntegrationRuntimeDataProxyProperties struct { Path *string `json:"path,omitempty"` } +// IntegrationRuntimeDebugResource integration runtime debug resource. +type IntegrationRuntimeDebugResource struct { + // Properties - Integration runtime properties. + Properties BasicIntegrationRuntime `json:"properties,omitempty"` + // Name - The resource name. + Name *string `json:"name,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for IntegrationRuntimeDebugResource struct. +func (irdr *IntegrationRuntimeDebugResource) UnmarshalJSON(body []byte) error { + var m map[string]*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 := unmarshalBasicIntegrationRuntime(*v) + if err != nil { + return err + } + irdr.Properties = properties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + irdr.Name = &name + } + } + } + + return nil +} + // IntegrationRuntimeListResponse a list of integration runtime resources. type IntegrationRuntimeListResponse struct { autorest.Response `json:"-"` @@ -112888,7 +117111,7 @@ type JiraLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -113260,6 +117483,11 @@ func (jls JiraLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for JiraLinkedService. func (jls JiraLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -113300,6 +117528,16 @@ func (jls JiraLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for JiraLinkedService. func (jls JiraLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -116881,6 +121119,7 @@ type BasicLinkedService interface { AsMicrosoftAccessLinkedService() (*MicrosoftAccessLinkedService, bool) AsInformixLinkedService() (*InformixLinkedService, bool) AsOdbcLinkedService() (*OdbcLinkedService, bool) + AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) AsTeradataLinkedService() (*TeradataLinkedService, bool) AsDb2LinkedService() (*Db2LinkedService, bool) @@ -116889,6 +121128,8 @@ type BasicLinkedService interface { AsMySQLLinkedService() (*MySQLLinkedService, bool) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) AsOracleLinkedService() (*OracleLinkedService, bool) + AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) + AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) AsFileServerLinkedService() (*FileServerLinkedService, bool) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) AsCommonDataServiceForAppsLinkedService() (*CommonDataServiceForAppsLinkedService, bool) @@ -116920,7 +121161,7 @@ type LinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -117204,6 +121445,10 @@ func unmarshalBasicLinkedService(body []byte) (BasicLinkedService, error) { var ols OdbcLinkedService err := json.Unmarshal(body, &ols) return ols, err + case string(TypeAzureMLService): + var amsls AzureMLServiceLinkedService + err := json.Unmarshal(body, &amsls) + return amsls, err case string(TypeAzureML): var amls AzureMLLinkedService err := json.Unmarshal(body, &amls) @@ -117236,6 +121481,14 @@ func unmarshalBasicLinkedService(body []byte) (BasicLinkedService, error) { var ols OracleLinkedService err := json.Unmarshal(body, &ols) return ols, err + case string(TypeGoogleCloudStorage): + var gcsls GoogleCloudStorageLinkedService + err := json.Unmarshal(body, &gcsls) + return gcsls, err + case string(TypeAzureFileStorage): + var afsls AzureFileStorageLinkedService + err := json.Unmarshal(body, &afsls) + return afsls, err case string(TypeFileServer): var fsls FileServerLinkedService err := json.Unmarshal(body, &fsls) @@ -117686,6 +121939,11 @@ func (ls LinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for LinkedService. func (ls LinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -117726,6 +121984,16 @@ func (ls LinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for LinkedService. func (ls LinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -117883,6 +122151,46 @@ func (ls *LinkedService) UnmarshalJSON(body []byte) error { return nil } +// LinkedServiceDebugResource linked service debug resource. +type LinkedServiceDebugResource struct { + // Properties - Properties of linked service. + Properties BasicLinkedService `json:"properties,omitempty"` + // Name - The resource name. + Name *string `json:"name,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for LinkedServiceDebugResource struct. +func (lsdr *LinkedServiceDebugResource) UnmarshalJSON(body []byte) error { + var m map[string]*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 := unmarshalBasicLinkedService(*v) + if err != nil { + return err + } + lsdr.Properties = properties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + lsdr.Name = &name + } + } + } + + return nil +} + // LinkedServiceListResponse a list of linked service resources. type LinkedServiceListResponse struct { autorest.Response `json:"-"` @@ -118216,7 +122524,7 @@ type LookupActivity struct { 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 - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLExecutePipeline', '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', 'TypeSwitch', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -118284,6 +122592,11 @@ func (la LookupActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUS return nil, false } +// AsAzureMLExecutePipelineActivity is the BasicActivity implementation for LookupActivity. +func (la LookupActivity) AsAzureMLExecutePipelineActivity() (*AzureMLExecutePipelineActivity, bool) { + return nil, false +} + // AsAzureMLUpdateResourceActivity is the BasicActivity implementation for LookupActivity. func (la LookupActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { return nil, false @@ -118414,6 +122727,11 @@ func (la LookupActivity) AsForEachActivity() (*ForEachActivity, bool) { return nil, false } +// AsSwitchActivity is the BasicActivity implementation for LookupActivity. +func (la LookupActivity) AsSwitchActivity() (*SwitchActivity, bool) { + return nil, false +} + // AsIfConditionActivity is the BasicActivity implementation for LookupActivity. func (la LookupActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { return nil, false @@ -118608,7 +122926,7 @@ type MagentoLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -118980,6 +123298,11 @@ func (mls MagentoLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for MagentoLinkedService. func (mls MagentoLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -119020,6 +123343,16 @@ func (mls MagentoLinkedService) AsOracleLinkedService() (*OracleLinkedService, b return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for MagentoLinkedService. func (mls MagentoLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -120886,7 +125219,7 @@ type MariaDBLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -121258,6 +125591,11 @@ func (mdls MariaDBLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. func (mdls MariaDBLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -121298,6 +125636,16 @@ func (mdls MariaDBLinkedService) AsOracleLinkedService() (*OracleLinkedService, return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. func (mdls MariaDBLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -122679,7 +127027,7 @@ type MarketoLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -123051,6 +127399,11 @@ func (mls MarketoLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for MarketoLinkedService. func (mls MarketoLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -123091,6 +127444,16 @@ func (mls MarketoLinkedService) AsOracleLinkedService() (*OracleLinkedService, b return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for MarketoLinkedService. func (mls MarketoLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -124557,7 +128920,7 @@ type MicrosoftAccessLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -124929,6 +129292,11 @@ func (mals MicrosoftAccessLinkedService) AsOdbcLinkedService() (*OdbcLinkedServi return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for MicrosoftAccessLinkedService. +func (mals MicrosoftAccessLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for MicrosoftAccessLinkedService. func (mals MicrosoftAccessLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -124969,6 +129337,16 @@ func (mals MicrosoftAccessLinkedService) AsOracleLinkedService() (*OracleLinkedS return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for MicrosoftAccessLinkedService. +func (mals MicrosoftAccessLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for MicrosoftAccessLinkedService. +func (mals MicrosoftAccessLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for MicrosoftAccessLinkedService. func (mals MicrosoftAccessLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -127454,7 +131832,7 @@ type MongoDbLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -127826,6 +132204,11 @@ func (mdls MongoDbLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. func (mdls MongoDbLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -127866,6 +132249,16 @@ func (mdls MongoDbLinkedService) AsOracleLinkedService() (*OracleLinkedService, return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. func (mdls MongoDbLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -129357,7 +133750,7 @@ type MongoDbV2LinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -129729,6 +134122,11 @@ func (mdvls MongoDbV2LinkedService) AsOdbcLinkedService() (*OdbcLinkedService, b return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for MongoDbV2LinkedService. +func (mdvls MongoDbV2LinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for MongoDbV2LinkedService. func (mdvls MongoDbV2LinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -129769,6 +134167,16 @@ func (mdvls MongoDbV2LinkedService) AsOracleLinkedService() (*OracleLinkedServic return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for MongoDbV2LinkedService. +func (mdvls MongoDbV2LinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for MongoDbV2LinkedService. +func (mdvls MongoDbV2LinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for MongoDbV2LinkedService. func (mdvls MongoDbV2LinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -130775,7 +135183,7 @@ type MySQLLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -131147,6 +135555,11 @@ func (msls MySQLLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for MySQLLinkedService. func (msls MySQLLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -131187,6 +135600,16 @@ func (msls MySQLLinkedService) AsOracleLinkedService() (*OracleLinkedService, bo return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for MySQLLinkedService. func (msls MySQLLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -132615,7 +137038,7 @@ type NetezzaLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -132987,6 +137410,11 @@ func (nls NetezzaLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. func (nls NetezzaLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -133027,6 +137455,16 @@ func (nls NetezzaLinkedService) AsOracleLinkedService() (*OracleLinkedService, b return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. func (nls NetezzaLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -134456,7 +138894,7 @@ type ODataLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -134828,6 +139266,11 @@ func (odls ODataLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for ODataLinkedService. func (odls ODataLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -134868,6 +139311,16 @@ func (odls ODataLinkedService) AsOracleLinkedService() (*OracleLinkedService, bo return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for ODataLinkedService. func (odls ODataLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -136378,7 +140831,7 @@ type OdbcLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -136750,6 +141203,11 @@ func (ols OdbcLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { return &ols, true } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for OdbcLinkedService. func (ols OdbcLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -136790,6 +141248,16 @@ func (ols OdbcLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for OdbcLinkedService. func (ols OdbcLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -139193,7 +143661,7 @@ type Office365LinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -139565,6 +144033,11 @@ func (o3ls Office365LinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bo return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for Office365LinkedService. +func (o3ls Office365LinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for Office365LinkedService. func (o3ls Office365LinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -139605,6 +144078,16 @@ func (o3ls Office365LinkedService) AsOracleLinkedService() (*OracleLinkedService return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for Office365LinkedService. +func (o3ls Office365LinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for Office365LinkedService. +func (o3ls Office365LinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for Office365LinkedService. func (o3ls Office365LinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -140796,7 +145279,7 @@ type OracleLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -141168,6 +145651,11 @@ func (ols OracleLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for OracleLinkedService. func (ols OracleLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -141208,6 +145696,16 @@ func (ols OracleLinkedService) AsOracleLinkedService() (*OracleLinkedService, bo return &ols, true } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for OracleLinkedService. func (ols OracleLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -141410,7 +145908,7 @@ type OracleServiceCloudLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -141782,6 +146280,11 @@ func (oscls OracleServiceCloudLinkedService) AsOdbcLinkedService() (*OdbcLinkedS return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for OracleServiceCloudLinkedService. +func (oscls OracleServiceCloudLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for OracleServiceCloudLinkedService. func (oscls OracleServiceCloudLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -141822,6 +146325,16 @@ func (oscls OracleServiceCloudLinkedService) AsOracleLinkedService() (*OracleLin return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for OracleServiceCloudLinkedService. +func (oscls OracleServiceCloudLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for OracleServiceCloudLinkedService. +func (oscls OracleServiceCloudLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for OracleServiceCloudLinkedService. func (oscls OracleServiceCloudLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -145442,6 +149955,8 @@ func (od *OrcDataset) UnmarshalJSON(body []byte) error { type OrcDatasetTypeProperties struct { // Location - The location of the ORC data storage. Location *DatasetLocation `json:"location,omitempty"` + // OrcCompressionCodec - Possible values include: 'OrcCompressionCodecNone', 'OrcCompressionCodecZlib', 'OrcCompressionCodecSnappy' + OrcCompressionCodec OrcCompressionCodec `json:"orcCompressionCodec,omitempty"` } // OrcFormat the data stored in Optimized Row Columnar (ORC) format. @@ -148089,7 +152604,7 @@ type PaypalLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -148461,6 +152976,11 @@ func (pls PaypalLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for PaypalLinkedService. func (pls PaypalLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -148501,6 +153021,16 @@ func (pls PaypalLinkedService) AsOracleLinkedService() (*OracleLinkedService, bo return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for PaypalLinkedService. func (pls PaypalLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -149977,7 +154507,7 @@ type PhoenixLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -150349,6 +154879,11 @@ func (pls PhoenixLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. func (pls PhoenixLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -150389,6 +154924,16 @@ func (pls PhoenixLinkedService) AsOracleLinkedService() (*OracleLinkedService, b return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. func (pls PhoenixLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -152613,7 +157158,7 @@ type PostgreSQLLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -152985,6 +157530,11 @@ func (psls PostgreSQLLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, b return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. func (psls PostgreSQLLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -153025,6 +157575,16 @@ func (psls PostgreSQLLinkedService) AsOracleLinkedService() (*OracleLinkedServic return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. func (psls PostgreSQLLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -154467,7 +159027,7 @@ type PrestoLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -154839,6 +159399,11 @@ func (pls PrestoLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for PrestoLinkedService. func (pls PrestoLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -154879,6 +159444,16 @@ func (pls PrestoLinkedService) AsOracleLinkedService() (*OracleLinkedService, bo return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for PrestoLinkedService. func (pls PrestoLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -156569,7 +161144,7 @@ type QuickBooksLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -156941,6 +161516,11 @@ func (qbls QuickBooksLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, b return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. func (qbls QuickBooksLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -156981,6 +161561,16 @@ func (qbls QuickBooksLinkedService) AsOracleLinkedService() (*OracleLinkedServic return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. func (qbls QuickBooksLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -160341,7 +164931,7 @@ type ResponsysLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -160713,6 +165303,11 @@ func (rls ResponsysLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, boo return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. func (rls ResponsysLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -160753,6 +165348,16 @@ func (rls ResponsysLinkedService) AsOracleLinkedService() (*OracleLinkedService, return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. func (rls ResponsysLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -162847,7 +167452,7 @@ type RestServiceLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -163219,6 +167824,11 @@ func (rsls RestServiceLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for RestServiceLinkedService. +func (rsls RestServiceLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for RestServiceLinkedService. func (rsls RestServiceLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -163259,6 +167869,16 @@ func (rsls RestServiceLinkedService) AsOracleLinkedService() (*OracleLinkedServi return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for RestServiceLinkedService. +func (rsls RestServiceLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for RestServiceLinkedService. +func (rsls RestServiceLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for RestServiceLinkedService. func (rsls RestServiceLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -164239,7 +168859,7 @@ type SalesforceLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -164611,6 +169231,11 @@ func (sls SalesforceLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bo return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. func (sls SalesforceLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -164651,6 +169276,16 @@ func (sls SalesforceLinkedService) AsOracleLinkedService() (*OracleLinkedService return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. func (sls SalesforceLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -164903,7 +169538,7 @@ type SalesforceMarketingCloudLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -165275,6 +169910,11 @@ func (smcls SalesforceMarketingCloudLinkedService) AsOdbcLinkedService() (*OdbcL return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. func (smcls SalesforceMarketingCloudLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -165315,6 +169955,16 @@ func (smcls SalesforceMarketingCloudLinkedService) AsOracleLinkedService() (*Ora return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. func (smcls SalesforceMarketingCloudLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -167391,7 +172041,7 @@ type SalesforceServiceCloudLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -167763,6 +172413,11 @@ func (sscls SalesforceServiceCloudLinkedService) AsOdbcLinkedService() (*OdbcLin return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for SalesforceServiceCloudLinkedService. +func (sscls SalesforceServiceCloudLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for SalesforceServiceCloudLinkedService. func (sscls SalesforceServiceCloudLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -167803,6 +172458,16 @@ func (sscls SalesforceServiceCloudLinkedService) AsOracleLinkedService() (*Oracl return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for SalesforceServiceCloudLinkedService. +func (sscls SalesforceServiceCloudLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for SalesforceServiceCloudLinkedService. +func (sscls SalesforceServiceCloudLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for SalesforceServiceCloudLinkedService. func (sscls SalesforceServiceCloudLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -171152,7 +175817,7 @@ type SapBWLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -171524,6 +176189,11 @@ func (sbls SapBWLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for SapBWLinkedService. func (sbls SapBWLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -171564,6 +176234,16 @@ func (sbls SapBWLinkedService) AsOracleLinkedService() (*OracleLinkedService, bo return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for SapBWLinkedService. func (sbls SapBWLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -172405,7 +177085,7 @@ type SapCloudForCustomerLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -172777,6 +177457,11 @@ func (scfcls SapCloudForCustomerLinkedService) AsOdbcLinkedService() (*OdbcLinke return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. func (scfcls SapCloudForCustomerLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -172817,6 +177502,16 @@ func (scfcls SapCloudForCustomerLinkedService) AsOracleLinkedService() (*OracleL return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. func (scfcls SapCloudForCustomerLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -174578,7 +179273,7 @@ type SapEccLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -174950,6 +179645,11 @@ func (sels SapEccLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for SapEccLinkedService. func (sels SapEccLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -174990,6 +179690,16 @@ func (sels SapEccLinkedService) AsOracleLinkedService() (*OracleLinkedService, b return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for SapEccLinkedService. func (sels SapEccLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -176429,7 +181139,7 @@ type SapHanaLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -176801,6 +181511,11 @@ func (shls SapHanaLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. func (shls SapHanaLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -176841,6 +181556,16 @@ func (shls SapHanaLinkedService) AsOracleLinkedService() (*OracleLinkedService, return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. func (shls SapHanaLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -178318,7 +183043,7 @@ type SapOpenHubLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -178690,6 +183415,11 @@ func (sohls SapOpenHubLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for SapOpenHubLinkedService. +func (sohls SapOpenHubLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for SapOpenHubLinkedService. func (sohls SapOpenHubLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -178730,6 +183460,16 @@ func (sohls SapOpenHubLinkedService) AsOracleLinkedService() (*OracleLinkedServi return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for SapOpenHubLinkedService. +func (sohls SapOpenHubLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for SapOpenHubLinkedService. +func (sohls SapOpenHubLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for SapOpenHubLinkedService. func (sohls SapOpenHubLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -180221,7 +184961,7 @@ type SapTableLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -180593,6 +185333,11 @@ func (stls SapTableLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, boo return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for SapTableLinkedService. +func (stls SapTableLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for SapTableLinkedService. func (stls SapTableLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -180633,6 +185378,16 @@ func (stls SapTableLinkedService) AsOracleLinkedService() (*OracleLinkedService, return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for SapTableLinkedService. +func (stls SapTableLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for SapTableLinkedService. +func (stls SapTableLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for SapTableLinkedService. func (stls SapTableLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -183155,7 +187910,7 @@ type ServiceNowLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -183527,6 +188282,11 @@ func (snls ServiceNowLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, b return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. func (snls ServiceNowLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -183567,6 +188327,16 @@ func (snls ServiceNowLinkedService) AsOracleLinkedService() (*OracleLinkedServic return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. func (snls ServiceNowLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -185065,7 +189835,7 @@ type SetVariableActivity struct { 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 - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLExecutePipeline', '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', 'TypeSwitch', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -185127,6 +189897,11 @@ func (sva SetVariableActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnaly return nil, false } +// AsAzureMLExecutePipelineActivity is the BasicActivity implementation for SetVariableActivity. +func (sva SetVariableActivity) AsAzureMLExecutePipelineActivity() (*AzureMLExecutePipelineActivity, bool) { + return nil, false +} + // AsAzureMLUpdateResourceActivity is the BasicActivity implementation for SetVariableActivity. func (sva SetVariableActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { return nil, false @@ -185257,6 +190032,11 @@ func (sva SetVariableActivity) AsForEachActivity() (*ForEachActivity, bool) { return nil, false } +// AsSwitchActivity is the BasicActivity implementation for SetVariableActivity. +func (sva SetVariableActivity) AsSwitchActivity() (*SwitchActivity, bool) { + return nil, false +} + // AsIfConditionActivity is the BasicActivity implementation for SetVariableActivity. func (sva SetVariableActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { return nil, false @@ -185614,7 +190394,7 @@ type SftpServerLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -185986,6 +190766,11 @@ func (ssls SftpServerLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, b return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. func (ssls SftpServerLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -186026,6 +190811,16 @@ func (ssls SftpServerLinkedService) AsOracleLinkedService() (*OracleLinkedServic return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. func (ssls SftpServerLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -186343,7 +191138,7 @@ type ShopifyLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -186715,6 +191510,11 @@ func (sls ShopifyLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. func (sls ShopifyLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -186755,6 +191555,16 @@ func (sls ShopifyLinkedService) AsOracleLinkedService() (*OracleLinkedService, b return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. func (sls ShopifyLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -188220,7 +193030,7 @@ type SparkLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -188592,6 +193402,11 @@ func (sls SparkLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for SparkLinkedService. func (sls SparkLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -188632,6 +193447,16 @@ func (sls SparkLinkedService) AsOracleLinkedService() (*OracleLinkedService, boo return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for SparkLinkedService. func (sls SparkLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -192153,7 +196978,7 @@ type SQLServerLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -192525,6 +197350,11 @@ func (ssls SQLServerLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bo return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. func (ssls SQLServerLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -192565,6 +197395,16 @@ func (ssls SQLServerLinkedService) AsOracleLinkedService() (*OracleLinkedService return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. func (ssls SQLServerLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -193821,7 +198661,7 @@ type SQLServerStoredProcedureActivity struct { 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 - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLExecutePipeline', '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', 'TypeSwitch', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -193889,6 +198729,11 @@ func (ssspa SQLServerStoredProcedureActivity) AsDataLakeAnalyticsUSQLActivity() return nil, false } +// AsAzureMLExecutePipelineActivity is the BasicActivity implementation for SQLServerStoredProcedureActivity. +func (ssspa SQLServerStoredProcedureActivity) AsAzureMLExecutePipelineActivity() (*AzureMLExecutePipelineActivity, bool) { + return nil, false +} + // AsAzureMLUpdateResourceActivity is the BasicActivity implementation for SQLServerStoredProcedureActivity. func (ssspa SQLServerStoredProcedureActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { return nil, false @@ -194019,6 +198864,11 @@ func (ssspa SQLServerStoredProcedureActivity) AsForEachActivity() (*ForEachActiv return nil, false } +// AsSwitchActivity is the BasicActivity implementation for SQLServerStoredProcedureActivity. +func (ssspa SQLServerStoredProcedureActivity) AsSwitchActivity() (*SwitchActivity, bool) { + return nil, false +} + // AsIfConditionActivity is the BasicActivity implementation for SQLServerStoredProcedureActivity. func (ssspa SQLServerStoredProcedureActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { return nil, false @@ -195802,7 +200652,7 @@ type SquareLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -196174,6 +201024,11 @@ func (sls SquareLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for SquareLinkedService. func (sls SquareLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -196214,6 +201069,16 @@ func (sls SquareLinkedService) AsOracleLinkedService() (*OracleLinkedService, bo return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for SquareLinkedService. func (sls SquareLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -197684,7 +202549,48 @@ type SSISAccessCredential struct { // UserName - UseName for windows authentication. UserName interface{} `json:"userName,omitempty"` // Password - Password for windows authentication. - Password *SecureString `json:"password,omitempty"` + Password BasicSecretBase `json:"password,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SSISAccessCredential struct. +func (sac *SSISAccessCredential) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "domain": + if v != nil { + var domain interface{} + err = json.Unmarshal(*v, &domain) + if err != nil { + return err + } + sac.Domain = domain + } + case "userName": + if v != nil { + var userName interface{} + err = json.Unmarshal(*v, &userName) + if err != nil { + return err + } + sac.UserName = userName + } + case "password": + if v != nil { + password, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + sac.Password = password + } + } + } + + return nil } // SsisEnvironment ssis environment. @@ -198246,13 +203152,54 @@ func (spl *SSISPackageLocation) UnmarshalJSON(body []byte) error { // SSISPackageLocationTypeProperties SSIS package location properties. type SSISPackageLocationTypeProperties struct { // PackagePassword - Password of the package. - PackagePassword *SecureString `json:"packagePassword,omitempty"` + PackagePassword BasicSecretBase `json:"packagePassword,omitempty"` // AccessCredential - The package access credential. AccessCredential *SSISAccessCredential `json:"accessCredential,omitempty"` // ConfigurationPath - The configuration file of the package execution. Type: string (or Expression with resultType string). ConfigurationPath interface{} `json:"configurationPath,omitempty"` } +// UnmarshalJSON is the custom unmarshaler for SSISPackageLocationTypeProperties struct. +func (spltp *SSISPackageLocationTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "packagePassword": + if v != nil { + packagePassword, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + spltp.PackagePassword = packagePassword + } + case "accessCredential": + if v != nil { + var accessCredential SSISAccessCredential + err = json.Unmarshal(*v, &accessCredential) + if err != nil { + return err + } + spltp.AccessCredential = &accessCredential + } + case "configurationPath": + if v != nil { + var configurationPath interface{} + err = json.Unmarshal(*v, &configurationPath) + if err != nil { + return err + } + spltp.ConfigurationPath = configurationPath + } + } + } + + return nil +} + // SsisParameter ssis parameter. type SsisParameter struct { // ID - Parameter id. @@ -198735,6 +203682,431 @@ type SubResource struct { Etag *string `json:"etag,omitempty"` } +// SubResourceDebugResource azure Data Factory nested debug resource. +type SubResourceDebugResource struct { + // Name - The resource name. + Name *string `json:"name,omitempty"` +} + +// SwitchActivity this activity evaluates an expression and executes activities under the cases property +// that correspond to the expression evaluation expected in the equals property. +type SwitchActivity struct { + // SwitchActivityTypeProperties - Switch activity properties. + *SwitchActivityTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Name - Activity name. + Name *string `json:"name,omitempty"` + // Description - Activity description. + Description *string `json:"description,omitempty"` + // DependsOn - Activity depends on condition. + DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` + // UserProperties - Activity user properties. + UserProperties *[]UserProperty `json:"userProperties,omitempty"` + // Type - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLExecutePipeline', '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', 'TypeSwitch', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + Type TypeBasicActivity `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SwitchActivity. +func (sa SwitchActivity) MarshalJSON() ([]byte, error) { + sa.Type = TypeSwitch + objectMap := make(map[string]interface{}) + if sa.SwitchActivityTypeProperties != nil { + objectMap["typeProperties"] = sa.SwitchActivityTypeProperties + } + if sa.Name != nil { + objectMap["name"] = sa.Name + } + if sa.Description != nil { + objectMap["description"] = sa.Description + } + if sa.DependsOn != nil { + objectMap["dependsOn"] = sa.DependsOn + } + if sa.UserProperties != nil { + objectMap["userProperties"] = sa.UserProperties + } + if sa.Type != "" { + objectMap["type"] = sa.Type + } + for k, v := range sa.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsExecuteDataFlowActivity is the BasicActivity implementation for SwitchActivity. +func (sa SwitchActivity) AsExecuteDataFlowActivity() (*ExecuteDataFlowActivity, bool) { + return nil, false +} + +// AsAzureFunctionActivity is the BasicActivity implementation for SwitchActivity. +func (sa SwitchActivity) AsAzureFunctionActivity() (*AzureFunctionActivity, bool) { + return nil, false +} + +// AsDatabricksSparkPythonActivity is the BasicActivity implementation for SwitchActivity. +func (sa SwitchActivity) AsDatabricksSparkPythonActivity() (*DatabricksSparkPythonActivity, bool) { + return nil, false +} + +// AsDatabricksSparkJarActivity is the BasicActivity implementation for SwitchActivity. +func (sa SwitchActivity) AsDatabricksSparkJarActivity() (*DatabricksSparkJarActivity, bool) { + return nil, false +} + +// AsDatabricksNotebookActivity is the BasicActivity implementation for SwitchActivity. +func (sa SwitchActivity) AsDatabricksNotebookActivity() (*DatabricksNotebookActivity, bool) { + return nil, false +} + +// AsDataLakeAnalyticsUSQLActivity is the BasicActivity implementation for SwitchActivity. +func (sa SwitchActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUSQLActivity, bool) { + return nil, false +} + +// AsAzureMLExecutePipelineActivity is the BasicActivity implementation for SwitchActivity. +func (sa SwitchActivity) AsAzureMLExecutePipelineActivity() (*AzureMLExecutePipelineActivity, bool) { + return nil, false +} + +// AsAzureMLUpdateResourceActivity is the BasicActivity implementation for SwitchActivity. +func (sa SwitchActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { + return nil, false +} + +// AsAzureMLBatchExecutionActivity is the BasicActivity implementation for SwitchActivity. +func (sa SwitchActivity) AsAzureMLBatchExecutionActivity() (*AzureMLBatchExecutionActivity, bool) { + return nil, false +} + +// AsGetMetadataActivity is the BasicActivity implementation for SwitchActivity. +func (sa SwitchActivity) AsGetMetadataActivity() (*GetMetadataActivity, bool) { + return nil, false +} + +// AsWebActivity is the BasicActivity implementation for SwitchActivity. +func (sa SwitchActivity) AsWebActivity() (*WebActivity, bool) { + return nil, false +} + +// AsLookupActivity is the BasicActivity implementation for SwitchActivity. +func (sa SwitchActivity) AsLookupActivity() (*LookupActivity, bool) { + return nil, false +} + +// AsAzureDataExplorerCommandActivity is the BasicActivity implementation for SwitchActivity. +func (sa SwitchActivity) AsAzureDataExplorerCommandActivity() (*AzureDataExplorerCommandActivity, bool) { + return nil, false +} + +// AsDeleteActivity is the BasicActivity implementation for SwitchActivity. +func (sa SwitchActivity) AsDeleteActivity() (*DeleteActivity, bool) { + return nil, false +} + +// AsSQLServerStoredProcedureActivity is the BasicActivity implementation for SwitchActivity. +func (sa SwitchActivity) AsSQLServerStoredProcedureActivity() (*SQLServerStoredProcedureActivity, bool) { + return nil, false +} + +// AsCustomActivity is the BasicActivity implementation for SwitchActivity. +func (sa SwitchActivity) AsCustomActivity() (*CustomActivity, bool) { + return nil, false +} + +// AsExecuteSSISPackageActivity is the BasicActivity implementation for SwitchActivity. +func (sa SwitchActivity) AsExecuteSSISPackageActivity() (*ExecuteSSISPackageActivity, bool) { + return nil, false +} + +// AsHDInsightSparkActivity is the BasicActivity implementation for SwitchActivity. +func (sa SwitchActivity) AsHDInsightSparkActivity() (*HDInsightSparkActivity, bool) { + return nil, false +} + +// AsHDInsightStreamingActivity is the BasicActivity implementation for SwitchActivity. +func (sa SwitchActivity) AsHDInsightStreamingActivity() (*HDInsightStreamingActivity, bool) { + return nil, false +} + +// AsHDInsightMapReduceActivity is the BasicActivity implementation for SwitchActivity. +func (sa SwitchActivity) AsHDInsightMapReduceActivity() (*HDInsightMapReduceActivity, bool) { + return nil, false +} + +// AsHDInsightPigActivity is the BasicActivity implementation for SwitchActivity. +func (sa SwitchActivity) AsHDInsightPigActivity() (*HDInsightPigActivity, bool) { + return nil, false +} + +// AsHDInsightHiveActivity is the BasicActivity implementation for SwitchActivity. +func (sa SwitchActivity) AsHDInsightHiveActivity() (*HDInsightHiveActivity, bool) { + return nil, false +} + +// AsCopyActivity is the BasicActivity implementation for SwitchActivity. +func (sa SwitchActivity) AsCopyActivity() (*CopyActivity, bool) { + return nil, false +} + +// AsExecutionActivity is the BasicActivity implementation for SwitchActivity. +func (sa SwitchActivity) AsExecutionActivity() (*ExecutionActivity, bool) { + return nil, false +} + +// AsBasicExecutionActivity is the BasicActivity implementation for SwitchActivity. +func (sa SwitchActivity) AsBasicExecutionActivity() (BasicExecutionActivity, bool) { + return nil, false +} + +// AsWebHookActivity is the BasicActivity implementation for SwitchActivity. +func (sa SwitchActivity) AsWebHookActivity() (*WebHookActivity, bool) { + return nil, false +} + +// AsAppendVariableActivity is the BasicActivity implementation for SwitchActivity. +func (sa SwitchActivity) AsAppendVariableActivity() (*AppendVariableActivity, bool) { + return nil, false +} + +// AsSetVariableActivity is the BasicActivity implementation for SwitchActivity. +func (sa SwitchActivity) AsSetVariableActivity() (*SetVariableActivity, bool) { + return nil, false +} + +// AsFilterActivity is the BasicActivity implementation for SwitchActivity. +func (sa SwitchActivity) AsFilterActivity() (*FilterActivity, bool) { + return nil, false +} + +// AsValidationActivity is the BasicActivity implementation for SwitchActivity. +func (sa SwitchActivity) AsValidationActivity() (*ValidationActivity, bool) { + return nil, false +} + +// AsUntilActivity is the BasicActivity implementation for SwitchActivity. +func (sa SwitchActivity) AsUntilActivity() (*UntilActivity, bool) { + return nil, false +} + +// AsWaitActivity is the BasicActivity implementation for SwitchActivity. +func (sa SwitchActivity) AsWaitActivity() (*WaitActivity, bool) { + return nil, false +} + +// AsForEachActivity is the BasicActivity implementation for SwitchActivity. +func (sa SwitchActivity) AsForEachActivity() (*ForEachActivity, bool) { + return nil, false +} + +// AsSwitchActivity is the BasicActivity implementation for SwitchActivity. +func (sa SwitchActivity) AsSwitchActivity() (*SwitchActivity, bool) { + return &sa, true +} + +// AsIfConditionActivity is the BasicActivity implementation for SwitchActivity. +func (sa SwitchActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { + return nil, false +} + +// AsExecutePipelineActivity is the BasicActivity implementation for SwitchActivity. +func (sa SwitchActivity) AsExecutePipelineActivity() (*ExecutePipelineActivity, bool) { + return nil, false +} + +// AsControlActivity is the BasicActivity implementation for SwitchActivity. +func (sa SwitchActivity) AsControlActivity() (*ControlActivity, bool) { + return nil, false +} + +// AsBasicControlActivity is the BasicActivity implementation for SwitchActivity. +func (sa SwitchActivity) AsBasicControlActivity() (BasicControlActivity, bool) { + return &sa, true +} + +// AsActivity is the BasicActivity implementation for SwitchActivity. +func (sa SwitchActivity) AsActivity() (*Activity, bool) { + return nil, false +} + +// AsBasicActivity is the BasicActivity implementation for SwitchActivity. +func (sa SwitchActivity) AsBasicActivity() (BasicActivity, bool) { + return &sa, true +} + +// UnmarshalJSON is the custom unmarshaler for SwitchActivity struct. +func (sa *SwitchActivity) UnmarshalJSON(body []byte) error { + 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 switchActivityTypeProperties SwitchActivityTypeProperties + err = json.Unmarshal(*v, &switchActivityTypeProperties) + if err != nil { + return err + } + sa.SwitchActivityTypeProperties = &switchActivityTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if sa.AdditionalProperties == nil { + sa.AdditionalProperties = make(map[string]interface{}) + } + sa.AdditionalProperties[k] = additionalProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sa.Name = &name + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + sa.Description = &description + } + case "dependsOn": + if v != nil { + var dependsOn []ActivityDependency + err = json.Unmarshal(*v, &dependsOn) + if err != nil { + return err + } + sa.DependsOn = &dependsOn + } + case "userProperties": + if v != nil { + var userProperties []UserProperty + err = json.Unmarshal(*v, &userProperties) + if err != nil { + return err + } + sa.UserProperties = &userProperties + } + case "type": + if v != nil { + var typeVar TypeBasicActivity + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sa.Type = typeVar + } + } + } + + return nil +} + +// SwitchActivityTypeProperties switch activity properties. +type SwitchActivityTypeProperties struct { + // On - An expression that would evaluate to a string or integer. This is used to determine the block of activities in cases that will be executed. + On *Expression `json:"on,omitempty"` + // Cases - List of cases that correspond to expected values of the 'on' property. This is an optional property and if not provided, the activity will execute activities provided in defaultActivities. + Cases *[]SwitchCase `json:"cases,omitempty"` + // DefaultActivities - List of activities to execute if no case condition is satisfied. This is an optional property and if not provided, the activity will exit without any action. + DefaultActivities *[]BasicActivity `json:"defaultActivities,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SwitchActivityTypeProperties struct. +func (satp *SwitchActivityTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "on": + if v != nil { + var on Expression + err = json.Unmarshal(*v, &on) + if err != nil { + return err + } + satp.On = &on + } + case "cases": + if v != nil { + var cases []SwitchCase + err = json.Unmarshal(*v, &cases) + if err != nil { + return err + } + satp.Cases = &cases + } + case "defaultActivities": + if v != nil { + defaultActivities, err := unmarshalBasicActivityArray(*v) + if err != nil { + return err + } + satp.DefaultActivities = &defaultActivities + } + } + } + + return nil +} + +// SwitchCase switch cases with have a value and corresponding activities. +type SwitchCase struct { + // Value - Expected value that satisfies the expression result of the 'on' property. + Value *string `json:"value,omitempty"` + // Activities - List of activities to execute for satisfied case condition. + Activities *[]BasicActivity `json:"activities,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SwitchCase struct. +func (sc *SwitchCase) UnmarshalJSON(body []byte) error { + 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 { + var value string + err = json.Unmarshal(*v, &value) + if err != nil { + return err + } + sc.Value = &value + } + case "activities": + if v != nil { + activities, err := unmarshalBasicActivityArray(*v) + if err != nil { + return err + } + sc.Activities = &activities + } + } + } + + return nil +} + // SybaseLinkedService linked service for Sybase data source. type SybaseLinkedService struct { // SybaseLinkedServiceTypeProperties - Sybase linked service properties. @@ -198749,7 +204121,7 @@ type SybaseLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -199121,6 +204493,11 @@ func (sls SybaseLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for SybaseLinkedService. func (sls SybaseLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -199161,6 +204538,16 @@ func (sls SybaseLinkedService) AsOracleLinkedService() (*OracleLinkedService, bo return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for SybaseLinkedService. func (sls SybaseLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -201519,7 +206906,7 @@ type TeradataLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -201891,6 +207278,11 @@ func (TLSVar TeradataLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, b return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for TeradataLinkedService. func (TLSVar TeradataLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -201931,6 +207323,16 @@ func (TLSVar TeradataLinkedService) AsOracleLinkedService() (*OracleLinkedServic return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for TeradataLinkedService. func (TLSVar TeradataLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -204864,7 +210266,7 @@ type UntilActivity struct { 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 - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLExecutePipeline', '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', 'TypeSwitch', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -204926,6 +210328,11 @@ func (ua UntilActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUSQ return nil, false } +// AsAzureMLExecutePipelineActivity is the BasicActivity implementation for UntilActivity. +func (ua UntilActivity) AsAzureMLExecutePipelineActivity() (*AzureMLExecutePipelineActivity, bool) { + return nil, false +} + // AsAzureMLUpdateResourceActivity is the BasicActivity implementation for UntilActivity. func (ua UntilActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { return nil, false @@ -205056,6 +210463,11 @@ func (ua UntilActivity) AsForEachActivity() (*ForEachActivity, bool) { return nil, false } +// AsSwitchActivity is the BasicActivity implementation for UntilActivity. +func (ua UntilActivity) AsSwitchActivity() (*SwitchActivity, bool) { + return nil, false +} + // AsIfConditionActivity is the BasicActivity implementation for UntilActivity. func (ua UntilActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { return nil, false @@ -205268,7 +210680,7 @@ type ValidationActivity struct { 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 - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLExecutePipeline', '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', 'TypeSwitch', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -205330,6 +210742,11 @@ func (va ValidationActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyti return nil, false } +// AsAzureMLExecutePipelineActivity is the BasicActivity implementation for ValidationActivity. +func (va ValidationActivity) AsAzureMLExecutePipelineActivity() (*AzureMLExecutePipelineActivity, bool) { + return nil, false +} + // AsAzureMLUpdateResourceActivity is the BasicActivity implementation for ValidationActivity. func (va ValidationActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { return nil, false @@ -205460,6 +210877,11 @@ func (va ValidationActivity) AsForEachActivity() (*ForEachActivity, bool) { return nil, false } +// AsSwitchActivity is the BasicActivity implementation for ValidationActivity. +func (va ValidationActivity) AsSwitchActivity() (*SwitchActivity, bool) { + return nil, false +} + // AsIfConditionActivity is the BasicActivity implementation for ValidationActivity. func (va ValidationActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { return nil, false @@ -205617,7 +211039,7 @@ type VerticaLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -205989,6 +211411,11 @@ func (vls VerticaLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for VerticaLinkedService. func (vls VerticaLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -206029,6 +211456,16 @@ func (vls VerticaLinkedService) AsOracleLinkedService() (*OracleLinkedService, b return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for VerticaLinkedService. func (vls VerticaLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -207410,7 +212847,7 @@ type WaitActivity struct { 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 - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLExecutePipeline', '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', 'TypeSwitch', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -207472,6 +212909,11 @@ func (wa WaitActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUSQL return nil, false } +// AsAzureMLExecutePipelineActivity is the BasicActivity implementation for WaitActivity. +func (wa WaitActivity) AsAzureMLExecutePipelineActivity() (*AzureMLExecutePipelineActivity, bool) { + return nil, false +} + // AsAzureMLUpdateResourceActivity is the BasicActivity implementation for WaitActivity. func (wa WaitActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { return nil, false @@ -207602,6 +213044,11 @@ func (wa WaitActivity) AsForEachActivity() (*ForEachActivity, bool) { return nil, false } +// AsSwitchActivity is the BasicActivity implementation for WaitActivity. +func (wa WaitActivity) AsSwitchActivity() (*SwitchActivity, bool) { + return nil, false +} + // AsIfConditionActivity is the BasicActivity implementation for WaitActivity. func (wa WaitActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { return nil, false @@ -207713,260 +213160,383 @@ func (wa *WaitActivity) UnmarshalJSON(body []byte) error { return nil } -// WaitActivityTypeProperties wait activity properties. -type WaitActivityTypeProperties struct { - // WaitTimeInSeconds - Duration in seconds. - WaitTimeInSeconds *int32 `json:"waitTimeInSeconds,omitempty"` -} - -// WebActivity web activity. -type WebActivity struct { - // WebActivityTypeProperties - Web activity properties. - *WebActivityTypeProperties `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 WebActivity. -func (wa WebActivity) MarshalJSON() ([]byte, error) { - wa.Type = TypeWebActivity - objectMap := make(map[string]interface{}) - if wa.WebActivityTypeProperties != nil { - objectMap["typeProperties"] = wa.WebActivityTypeProperties - } - if wa.LinkedServiceName != nil { - objectMap["linkedServiceName"] = wa.LinkedServiceName - } - if wa.Policy != nil { - objectMap["policy"] = wa.Policy - } - if wa.Name != nil { - objectMap["name"] = wa.Name - } - if wa.Description != nil { - objectMap["description"] = wa.Description - } - if wa.DependsOn != nil { - objectMap["dependsOn"] = wa.DependsOn - } - if wa.UserProperties != nil { - objectMap["userProperties"] = wa.UserProperties - } - if wa.Type != "" { - objectMap["type"] = wa.Type - } - for k, v := range wa.AdditionalProperties { - objectMap[k] = v - } - 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 -} - -// AsDatabricksSparkPythonActivity is the BasicActivity implementation for WebActivity. -func (wa WebActivity) AsDatabricksSparkPythonActivity() (*DatabricksSparkPythonActivity, bool) { - return nil, false -} - -// AsDatabricksSparkJarActivity is the BasicActivity implementation for WebActivity. -func (wa WebActivity) AsDatabricksSparkJarActivity() (*DatabricksSparkJarActivity, bool) { - return nil, false -} - -// AsDatabricksNotebookActivity is the BasicActivity implementation for WebActivity. -func (wa WebActivity) AsDatabricksNotebookActivity() (*DatabricksNotebookActivity, bool) { - return nil, false -} - -// AsDataLakeAnalyticsUSQLActivity is the BasicActivity implementation for WebActivity. -func (wa WebActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUSQLActivity, bool) { - return nil, false -} - -// AsAzureMLUpdateResourceActivity is the BasicActivity implementation for WebActivity. -func (wa WebActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { - return nil, false -} - -// AsAzureMLBatchExecutionActivity is the BasicActivity implementation for WebActivity. -func (wa WebActivity) AsAzureMLBatchExecutionActivity() (*AzureMLBatchExecutionActivity, bool) { - return nil, false -} - -// AsGetMetadataActivity is the BasicActivity implementation for WebActivity. -func (wa WebActivity) AsGetMetadataActivity() (*GetMetadataActivity, bool) { - return nil, false -} - -// AsWebActivity is the BasicActivity implementation for WebActivity. -func (wa WebActivity) AsWebActivity() (*WebActivity, bool) { - return &wa, true -} - -// AsLookupActivity is the BasicActivity implementation for WebActivity. -func (wa WebActivity) AsLookupActivity() (*LookupActivity, bool) { - return nil, false -} - -// AsAzureDataExplorerCommandActivity is the BasicActivity implementation for WebActivity. -func (wa WebActivity) AsAzureDataExplorerCommandActivity() (*AzureDataExplorerCommandActivity, bool) { - return nil, false -} - -// AsDeleteActivity is the BasicActivity implementation for WebActivity. -func (wa WebActivity) AsDeleteActivity() (*DeleteActivity, bool) { - return nil, false -} - -// AsSQLServerStoredProcedureActivity is the BasicActivity implementation for WebActivity. -func (wa WebActivity) AsSQLServerStoredProcedureActivity() (*SQLServerStoredProcedureActivity, bool) { - return nil, false -} - -// AsCustomActivity is the BasicActivity implementation for WebActivity. -func (wa WebActivity) AsCustomActivity() (*CustomActivity, bool) { - return nil, false -} - -// AsExecuteSSISPackageActivity is the BasicActivity implementation for WebActivity. -func (wa WebActivity) AsExecuteSSISPackageActivity() (*ExecuteSSISPackageActivity, bool) { - return nil, false -} - -// AsHDInsightSparkActivity is the BasicActivity implementation for WebActivity. -func (wa WebActivity) AsHDInsightSparkActivity() (*HDInsightSparkActivity, bool) { - return nil, false -} - -// AsHDInsightStreamingActivity is the BasicActivity implementation for WebActivity. -func (wa WebActivity) AsHDInsightStreamingActivity() (*HDInsightStreamingActivity, bool) { - return nil, false -} - -// AsHDInsightMapReduceActivity is the BasicActivity implementation for WebActivity. -func (wa WebActivity) AsHDInsightMapReduceActivity() (*HDInsightMapReduceActivity, bool) { - return nil, false -} - -// AsHDInsightPigActivity is the BasicActivity implementation for WebActivity. -func (wa WebActivity) AsHDInsightPigActivity() (*HDInsightPigActivity, bool) { - return nil, false -} - -// AsHDInsightHiveActivity is the BasicActivity implementation for WebActivity. -func (wa WebActivity) AsHDInsightHiveActivity() (*HDInsightHiveActivity, bool) { - return nil, false -} - -// AsCopyActivity is the BasicActivity implementation for WebActivity. -func (wa WebActivity) AsCopyActivity() (*CopyActivity, bool) { - return nil, false -} - -// AsExecutionActivity is the BasicActivity implementation for WebActivity. -func (wa WebActivity) AsExecutionActivity() (*ExecutionActivity, bool) { - return nil, false -} - -// AsBasicExecutionActivity is the BasicActivity implementation for WebActivity. -func (wa WebActivity) AsBasicExecutionActivity() (BasicExecutionActivity, bool) { - return &wa, true -} - -// AsWebHookActivity is the BasicActivity implementation for WebActivity. -func (wa WebActivity) AsWebHookActivity() (*WebHookActivity, bool) { - return nil, false -} - -// AsAppendVariableActivity is the BasicActivity implementation for WebActivity. -func (wa WebActivity) AsAppendVariableActivity() (*AppendVariableActivity, bool) { - return nil, false -} - -// AsSetVariableActivity is the BasicActivity implementation for WebActivity. -func (wa WebActivity) AsSetVariableActivity() (*SetVariableActivity, bool) { - return nil, false -} - -// AsFilterActivity is the BasicActivity implementation for WebActivity. -func (wa WebActivity) AsFilterActivity() (*FilterActivity, bool) { - return nil, false -} - -// AsValidationActivity is the BasicActivity implementation for WebActivity. -func (wa WebActivity) AsValidationActivity() (*ValidationActivity, bool) { - return nil, false -} - -// AsUntilActivity is the BasicActivity implementation for WebActivity. -func (wa WebActivity) AsUntilActivity() (*UntilActivity, bool) { - return nil, false -} - -// AsWaitActivity is the BasicActivity implementation for WebActivity. -func (wa WebActivity) AsWaitActivity() (*WaitActivity, bool) { - return nil, false -} - -// AsForEachActivity is the BasicActivity implementation for WebActivity. -func (wa WebActivity) AsForEachActivity() (*ForEachActivity, bool) { - return nil, false -} - -// AsIfConditionActivity is the BasicActivity implementation for WebActivity. -func (wa WebActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { - return nil, false -} - -// AsExecutePipelineActivity is the BasicActivity implementation for WebActivity. -func (wa WebActivity) AsExecutePipelineActivity() (*ExecutePipelineActivity, bool) { - return nil, false -} - -// AsControlActivity is the BasicActivity implementation for WebActivity. -func (wa WebActivity) AsControlActivity() (*ControlActivity, bool) { - return nil, false -} - -// AsBasicControlActivity is the BasicActivity implementation for WebActivity. -func (wa WebActivity) AsBasicControlActivity() (BasicControlActivity, bool) { - return nil, false -} - -// AsActivity is the BasicActivity implementation for WebActivity. -func (wa WebActivity) AsActivity() (*Activity, bool) { - return nil, false -} - -// AsBasicActivity is the BasicActivity implementation for WebActivity. -func (wa WebActivity) AsBasicActivity() (BasicActivity, bool) { - return &wa, true +// WaitActivityTypeProperties wait activity properties. +type WaitActivityTypeProperties struct { + // WaitTimeInSeconds - Duration in seconds. + WaitTimeInSeconds *int32 `json:"waitTimeInSeconds,omitempty"` +} + +// WebActivity web activity. +type WebActivity struct { + // WebActivityTypeProperties - Web activity properties. + *WebActivityTypeProperties `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', 'TypeAzureMLExecutePipeline', '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', 'TypeSwitch', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + Type TypeBasicActivity `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for WebActivity. +func (wa WebActivity) MarshalJSON() ([]byte, error) { + wa.Type = TypeWebActivity + objectMap := make(map[string]interface{}) + if wa.WebActivityTypeProperties != nil { + objectMap["typeProperties"] = wa.WebActivityTypeProperties + } + if wa.LinkedServiceName != nil { + objectMap["linkedServiceName"] = wa.LinkedServiceName + } + if wa.Policy != nil { + objectMap["policy"] = wa.Policy + } + if wa.Name != nil { + objectMap["name"] = wa.Name + } + if wa.Description != nil { + objectMap["description"] = wa.Description + } + if wa.DependsOn != nil { + objectMap["dependsOn"] = wa.DependsOn + } + if wa.UserProperties != nil { + objectMap["userProperties"] = wa.UserProperties + } + if wa.Type != "" { + objectMap["type"] = wa.Type + } + for k, v := range wa.AdditionalProperties { + objectMap[k] = v + } + 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 +} + +// AsDatabricksSparkPythonActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsDatabricksSparkPythonActivity() (*DatabricksSparkPythonActivity, bool) { + return nil, false +} + +// AsDatabricksSparkJarActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsDatabricksSparkJarActivity() (*DatabricksSparkJarActivity, bool) { + return nil, false +} + +// AsDatabricksNotebookActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsDatabricksNotebookActivity() (*DatabricksNotebookActivity, bool) { + return nil, false +} + +// AsDataLakeAnalyticsUSQLActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUSQLActivity, bool) { + return nil, false +} + +// AsAzureMLExecutePipelineActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsAzureMLExecutePipelineActivity() (*AzureMLExecutePipelineActivity, bool) { + return nil, false +} + +// AsAzureMLUpdateResourceActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { + return nil, false +} + +// AsAzureMLBatchExecutionActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsAzureMLBatchExecutionActivity() (*AzureMLBatchExecutionActivity, bool) { + return nil, false +} + +// AsGetMetadataActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsGetMetadataActivity() (*GetMetadataActivity, bool) { + return nil, false +} + +// AsWebActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsWebActivity() (*WebActivity, bool) { + return &wa, true +} + +// AsLookupActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsLookupActivity() (*LookupActivity, bool) { + return nil, false +} + +// AsAzureDataExplorerCommandActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsAzureDataExplorerCommandActivity() (*AzureDataExplorerCommandActivity, bool) { + return nil, false +} + +// AsDeleteActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsDeleteActivity() (*DeleteActivity, bool) { + return nil, false +} + +// AsSQLServerStoredProcedureActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsSQLServerStoredProcedureActivity() (*SQLServerStoredProcedureActivity, bool) { + return nil, false +} + +// AsCustomActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsCustomActivity() (*CustomActivity, bool) { + return nil, false +} + +// AsExecuteSSISPackageActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsExecuteSSISPackageActivity() (*ExecuteSSISPackageActivity, bool) { + return nil, false +} + +// AsHDInsightSparkActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsHDInsightSparkActivity() (*HDInsightSparkActivity, bool) { + return nil, false +} + +// AsHDInsightStreamingActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsHDInsightStreamingActivity() (*HDInsightStreamingActivity, bool) { + return nil, false +} + +// AsHDInsightMapReduceActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsHDInsightMapReduceActivity() (*HDInsightMapReduceActivity, bool) { + return nil, false +} + +// AsHDInsightPigActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsHDInsightPigActivity() (*HDInsightPigActivity, bool) { + return nil, false +} + +// AsHDInsightHiveActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsHDInsightHiveActivity() (*HDInsightHiveActivity, bool) { + return nil, false +} + +// AsCopyActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsCopyActivity() (*CopyActivity, bool) { + return nil, false +} + +// AsExecutionActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsExecutionActivity() (*ExecutionActivity, bool) { + return nil, false +} + +// AsBasicExecutionActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsBasicExecutionActivity() (BasicExecutionActivity, bool) { + return &wa, true +} + +// AsWebHookActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsWebHookActivity() (*WebHookActivity, bool) { + return nil, false +} + +// AsAppendVariableActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsAppendVariableActivity() (*AppendVariableActivity, bool) { + return nil, false +} + +// AsSetVariableActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsSetVariableActivity() (*SetVariableActivity, bool) { + return nil, false +} + +// AsFilterActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsFilterActivity() (*FilterActivity, bool) { + return nil, false +} + +// AsValidationActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsValidationActivity() (*ValidationActivity, bool) { + return nil, false +} + +// AsUntilActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsUntilActivity() (*UntilActivity, bool) { + return nil, false +} + +// AsWaitActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsWaitActivity() (*WaitActivity, bool) { + return nil, false +} + +// AsForEachActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsForEachActivity() (*ForEachActivity, bool) { + return nil, false +} + +// AsSwitchActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsSwitchActivity() (*SwitchActivity, bool) { + return nil, false +} + +// AsIfConditionActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { + return nil, false +} + +// AsExecutePipelineActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsExecutePipelineActivity() (*ExecutePipelineActivity, bool) { + return nil, false +} + +// AsControlActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsControlActivity() (*ControlActivity, bool) { + return nil, false +} + +// AsBasicControlActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsBasicControlActivity() (BasicControlActivity, bool) { + return nil, false +} + +// AsActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsActivity() (*Activity, bool) { + return nil, false +} + +// AsBasicActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsBasicActivity() (BasicActivity, bool) { + return &wa, true +} + +// UnmarshalJSON is the custom unmarshaler for WebActivity struct. +func (wa *WebActivity) UnmarshalJSON(body []byte) error { + 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 webActivityTypeProperties WebActivityTypeProperties + err = json.Unmarshal(*v, &webActivityTypeProperties) + if err != nil { + return err + } + wa.WebActivityTypeProperties = &webActivityTypeProperties + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + wa.LinkedServiceName = &linkedServiceName + } + case "policy": + if v != nil { + var policy ActivityPolicy + err = json.Unmarshal(*v, &policy) + if err != nil { + return err + } + wa.Policy = &policy + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if wa.AdditionalProperties == nil { + wa.AdditionalProperties = make(map[string]interface{}) + } + wa.AdditionalProperties[k] = additionalProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + wa.Name = &name + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + wa.Description = &description + } + case "dependsOn": + if v != nil { + var dependsOn []ActivityDependency + err = json.Unmarshal(*v, &dependsOn) + if err != nil { + return err + } + wa.DependsOn = &dependsOn + } + case "userProperties": + if v != nil { + var userProperties []UserProperty + err = json.Unmarshal(*v, &userProperties) + if err != nil { + return err + } + wa.UserProperties = &userProperties + } + case "type": + if v != nil { + var typeVar TypeBasicActivity + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + wa.Type = typeVar + } + } + } + + return nil +} + +// WebActivityAuthentication web activity authentication properties. +type WebActivityAuthentication struct { + // Type - Web activity authentication (Basic/ClientCertificate/MSI) + Type *string `json:"type,omitempty"` + // Pfx - Base64-encoded contents of a PFX file. + Pfx BasicSecretBase `json:"pfx,omitempty"` + // Username - Web activity authentication user name for basic authentication. + Username *string `json:"username,omitempty"` + // Password - Password for the PFX file or basic authentication. + Password BasicSecretBase `json:"password,omitempty"` + // Resource - Resource for which Azure Auth token will be requested when using MSI Authentication. + Resource *string `json:"resource,omitempty"` } -// UnmarshalJSON is the custom unmarshaler for WebActivity struct. -func (wa *WebActivity) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for WebActivityAuthentication struct. +func (waa *WebActivityAuthentication) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -207974,89 +213544,48 @@ func (wa *WebActivity) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "typeProperties": - if v != nil { - var webActivityTypeProperties WebActivityTypeProperties - err = json.Unmarshal(*v, &webActivityTypeProperties) - if err != nil { - return err - } - wa.WebActivityTypeProperties = &webActivityTypeProperties - } - case "linkedServiceName": - if v != nil { - var linkedServiceName LinkedServiceReference - err = json.Unmarshal(*v, &linkedServiceName) - if err != nil { - return err - } - wa.LinkedServiceName = &linkedServiceName - } - case "policy": - if v != nil { - var policy ActivityPolicy - err = json.Unmarshal(*v, &policy) - if err != nil { - return err - } - wa.Policy = &policy - } - default: + case "type": if v != nil { - var additionalProperties interface{} - err = json.Unmarshal(*v, &additionalProperties) + var typeVar string + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - if wa.AdditionalProperties == nil { - wa.AdditionalProperties = make(map[string]interface{}) - } - wa.AdditionalProperties[k] = additionalProperties + waa.Type = &typeVar } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - wa.Name = &name - } - case "description": + case "pfx": if v != nil { - var description string - err = json.Unmarshal(*v, &description) + pfx, err := unmarshalBasicSecretBase(*v) if err != nil { return err } - wa.Description = &description + waa.Pfx = pfx } - case "dependsOn": + case "username": if v != nil { - var dependsOn []ActivityDependency - err = json.Unmarshal(*v, &dependsOn) + var username string + err = json.Unmarshal(*v, &username) if err != nil { return err } - wa.DependsOn = &dependsOn + waa.Username = &username } - case "userProperties": + case "password": if v != nil { - var userProperties []UserProperty - err = json.Unmarshal(*v, &userProperties) + password, err := unmarshalBasicSecretBase(*v) if err != nil { return err } - wa.UserProperties = &userProperties + waa.Password = password } - case "type": + case "resource": if v != nil { - var typeVar TypeBasicActivity - err = json.Unmarshal(*v, &typeVar) + var resource string + err = json.Unmarshal(*v, &resource) if err != nil { return err } - wa.Type = typeVar + waa.Resource = &resource } } } @@ -208064,20 +213593,6 @@ func (wa *WebActivity) UnmarshalJSON(body []byte) error { return nil } -// WebActivityAuthentication web activity authentication properties. -type WebActivityAuthentication struct { - // Type - Web activity authentication (Basic/ClientCertificate/MSI) - Type *string `json:"type,omitempty"` - // Pfx - Base64-encoded contents of a PFX file. - Pfx *SecureString `json:"pfx,omitempty"` - // Username - Web activity authentication user name for basic authentication. - Username *string `json:"username,omitempty"` - // Password - Password for the PFX file or basic authentication. - Password *SecureString `json:"password,omitempty"` - // Resource - Resource for which Azure Auth token will be requested when using MSI Authentication. - Resource *string `json:"resource,omitempty"` -} - // WebActivityTypeProperties web activity type properties. type WebActivityTypeProperties struct { // Method - Rest API method for target endpoint. Possible values include: 'WebActivityMethodGET', 'WebActivityMethodPOST', 'WebActivityMethodPUT', 'WebActivityMethodDELETE' @@ -208365,7 +213880,7 @@ type WebHookActivity struct { 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 - Possible values include: 'TypeActivity', 'TypeExecuteDataFlow', 'TypeAzureFunctionActivity', 'TypeDatabricksSparkPython', 'TypeDatabricksSparkJar', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLExecutePipeline', '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', 'TypeSwitch', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -208427,6 +213942,11 @@ func (wha WebHookActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalytics return nil, false } +// AsAzureMLExecutePipelineActivity is the BasicActivity implementation for WebHookActivity. +func (wha WebHookActivity) AsAzureMLExecutePipelineActivity() (*AzureMLExecutePipelineActivity, bool) { + return nil, false +} + // AsAzureMLUpdateResourceActivity is the BasicActivity implementation for WebHookActivity. func (wha WebHookActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { return nil, false @@ -208557,6 +214077,11 @@ func (wha WebHookActivity) AsForEachActivity() (*ForEachActivity, bool) { return nil, false } +// AsSwitchActivity is the BasicActivity implementation for WebHookActivity. +func (wha WebHookActivity) AsSwitchActivity() (*SwitchActivity, bool) { + return nil, false +} + // AsIfConditionActivity is the BasicActivity implementation for WebHookActivity. func (wha WebHookActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { return nil, false @@ -208698,7 +214223,7 @@ type WebLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -209068,6 +214593,11 @@ func (wls WebLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for WebLinkedService. func (wls WebLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -209108,6 +214638,16 @@ func (wls WebLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for WebLinkedService. func (wls WebLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -210559,7 +216099,7 @@ type XeroLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -210931,6 +216471,11 @@ func (xls XeroLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for XeroLinkedService. func (xls XeroLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -210971,6 +216516,16 @@ func (xls XeroLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for XeroLinkedService. func (xls XeroLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false @@ -212437,7 +217992,7 @@ type ZohoLinkedService struct { Parameters map[string]*ParameterSpecification `json:"parameters"` // Annotations - List of tags that can be used for describing the linked service. Annotations *[]interface{} `json:"annotations,omitempty"` - // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' + // Type - Possible values include: 'TypeLinkedService', 'TypeAzureFunction', 'TypeAzureDataExplorer', 'TypeSapTable', 'TypeGoogleAdWords', 'TypeOracleServiceCloud', 'TypeDynamicsAX', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeAzureMariaDB', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeRestService', 'TypeSapOpenHub', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforceServiceCloud', 'TypeSalesforce', 'TypeOffice365', 'TypeAzureBlobFS', 'TypeAzureDataLakeStore', 'TypeCosmosDbMongoDbAPI', 'TypeMongoDbV2', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeMicrosoftAccess', 'TypeInformix', 'TypeOdbc', 'TypeAzureMLService', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeGoogleCloudStorage', 'TypeAzureFileStorage', 'TypeFileServer', 'TypeHDInsight', 'TypeCommonDataServiceForApps', 'TypeDynamicsCrm', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLMI', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureTableStorage', 'TypeAzureBlobStorage', 'TypeAzureStorage' Type TypeBasicLinkedService `json:"type,omitempty"` } @@ -212809,6 +218364,11 @@ func (zls ZohoLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { return nil, false } +// AsAzureMLServiceLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) { + return nil, false +} + // AsAzureMLLinkedService is the BasicLinkedService implementation for ZohoLinkedService. func (zls ZohoLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { return nil, false @@ -212849,6 +218409,16 @@ func (zls ZohoLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool return nil, false } +// AsGoogleCloudStorageLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) { + return nil, false +} + +// AsAzureFileStorageLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) { + return nil, false +} + // AsFileServerLinkedService is the BasicLinkedService implementation for ZohoLinkedService. func (zls ZohoLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { return nil, false diff --git a/services/datashare/mgmt/2019-11-01/datashare/accounts.go b/services/datashare/mgmt/2019-11-01/datashare/accounts.go new file mode 100644 index 000000000000..a6f223dd5992 --- /dev/null +++ b/services/datashare/mgmt/2019-11-01/datashare/accounts.go @@ -0,0 +1,594 @@ +package datashare + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the 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" +) + +// AccountsClient is the creates a Microsoft.DataShare management client. +type AccountsClient struct { + BaseClient +} + +// NewAccountsClient creates an instance of the AccountsClient client. +func NewAccountsClient(subscriptionID string) AccountsClient { + return NewAccountsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAccountsClientWithBaseURI creates an instance of the AccountsClient client. +func NewAccountsClientWithBaseURI(baseURI string, subscriptionID string) AccountsClient { + return AccountsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create create an account +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// account - the account payload. +func (client AccountsClient) Create(ctx context.Context, resourceGroupName string, accountName string, account Account) (result AccountsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.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: account, + Constraints: []validation.Constraint{{Target: "account.Identity", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("datashare.AccountsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, account) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.AccountsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.AccountsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client AccountsClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, account Account) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}", pathParameters), + autorest.WithJSON(account), + 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 AccountsClient) CreateSender(req *http.Request) (future AccountsCreateFuture, 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 AccountsClient) CreateResponder(resp *http.Response) (result Account, 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 deleteAccount +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +func (client AccountsClient) Delete(ctx context.Context, resourceGroupName string, accountName string) (result AccountsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.AccountsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.AccountsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client AccountsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client AccountsClient) DeleteSender(req *http.Request) (future AccountsDeleteFuture, 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 AccountsClient) DeleteResponder(resp *http.Response) (result OperationResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get get an account +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +func (client AccountsClient) Get(ctx context.Context, resourceGroupName string, accountName string) (result Account, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.AccountsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.AccountsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.AccountsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client AccountsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client AccountsClient) 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 AccountsClient) GetResponder(resp *http.Response) (result Account, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup list Accounts in ResourceGroup +// Parameters: +// resourceGroupName - the resource group name. +// skipToken - continuation token +func (client AccountsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, skipToken string) (result AccountListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.al.Response.Response != nil { + sc = result.al.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, "datashare.AccountsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.al.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.AccountsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.al, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.AccountsClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client AccountsClient) 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-11-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.DataShare/accounts", 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 AccountsClient) 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 AccountsClient) ListByResourceGroupResponder(resp *http.Response) (result AccountList, 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 AccountsClient) listByResourceGroupNextResults(ctx context.Context, lastResults AccountList) (result AccountList, err error) { + req, err := lastResults.accountListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "datashare.AccountsClient", "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, "datashare.AccountsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.AccountsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client AccountsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, skipToken string) (result AccountListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.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 list Accounts in Subscription +// Parameters: +// skipToken - continuation token +func (client AccountsClient) ListBySubscription(ctx context.Context, skipToken string) (result AccountListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListBySubscription") + defer func() { + sc := -1 + if result.al.Response.Response != nil { + sc = result.al.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, "datashare.AccountsClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.al.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.AccountsClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.al, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.AccountsClient", "ListBySubscription", resp, "Failure responding to request") + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client AccountsClient) ListBySubscriptionPreparer(ctx context.Context, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + 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.DataShare/accounts", 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 AccountsClient) 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 AccountsClient) ListBySubscriptionResponder(resp *http.Response) (result AccountList, 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 AccountsClient) listBySubscriptionNextResults(ctx context.Context, lastResults AccountList) (result AccountList, err error) { + req, err := lastResults.accountListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "datashare.AccountsClient", "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, "datashare.AccountsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.AccountsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client AccountsClient) ListBySubscriptionComplete(ctx context.Context, skipToken string) (result AccountListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.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 +} + +// Update patch an account +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// accountUpdateParameters - the account update parameters. +func (client AccountsClient) Update(ctx context.Context, resourceGroupName string, accountName string, accountUpdateParameters AccountUpdateParameters) (result Account, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.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, accountName, accountUpdateParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.AccountsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.AccountsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.AccountsClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client AccountsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, accountUpdateParameters AccountUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}", pathParameters), + autorest.WithJSON(accountUpdateParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client AccountsClient) UpdateSender(req *http.Request) (*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 AccountsClient) UpdateResponder(resp *http.Response) (result Account, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/datashare/mgmt/2019-11-01/datashare/client.go b/services/datashare/mgmt/2019-11-01/datashare/client.go new file mode 100644 index 000000000000..de12f9c689d9 --- /dev/null +++ b/services/datashare/mgmt/2019-11-01/datashare/client.go @@ -0,0 +1,51 @@ +// Package datashare implements the Azure ARM Datashare service API version 2019-11-01. +// +// Creates a Microsoft.DataShare management client. +package datashare + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the 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 Datashare + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Datashare. +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/datashare/mgmt/2019-11-01/datashare/consumerinvitations.go b/services/datashare/mgmt/2019-11-01/datashare/consumerinvitations.go new file mode 100644 index 000000000000..3fb5b0818b00 --- /dev/null +++ b/services/datashare/mgmt/2019-11-01/datashare/consumerinvitations.go @@ -0,0 +1,313 @@ +package datashare + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the 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" +) + +// ConsumerInvitationsClient is the creates a Microsoft.DataShare management client. +type ConsumerInvitationsClient struct { + BaseClient +} + +// NewConsumerInvitationsClient creates an instance of the ConsumerInvitationsClient client. +func NewConsumerInvitationsClient(subscriptionID string) ConsumerInvitationsClient { + return NewConsumerInvitationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewConsumerInvitationsClientWithBaseURI creates an instance of the ConsumerInvitationsClient client. +func NewConsumerInvitationsClientWithBaseURI(baseURI string, subscriptionID string) ConsumerInvitationsClient { + return ConsumerInvitationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get get an invitation +// Parameters: +// location - location of the invitation +// invitationID - an invitation id +func (client ConsumerInvitationsClient) Get(ctx context.Context, location string, invitationID string) (result ConsumerInvitation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConsumerInvitationsClient.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, invitationID) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ConsumerInvitationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.ConsumerInvitationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ConsumerInvitationsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ConsumerInvitationsClient) GetPreparer(ctx context.Context, location string, invitationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "invitationId": autorest.Encode("path", invitationID), + "location": autorest.Encode("path", location), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.DataShare/locations/{location}/consumerInvitations/{invitationId}", 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 ConsumerInvitationsClient) 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 ConsumerInvitationsClient) GetResponder(resp *http.Response) (result ConsumerInvitation, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListInvitations lists invitations +// Parameters: +// skipToken - the continuation token +func (client ConsumerInvitationsClient) ListInvitations(ctx context.Context, skipToken string) (result ConsumerInvitationListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConsumerInvitationsClient.ListInvitations") + defer func() { + sc := -1 + if result.cil.Response.Response != nil { + sc = result.cil.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listInvitationsNextResults + req, err := client.ListInvitationsPreparer(ctx, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ConsumerInvitationsClient", "ListInvitations", nil, "Failure preparing request") + return + } + + resp, err := client.ListInvitationsSender(req) + if err != nil { + result.cil.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.ConsumerInvitationsClient", "ListInvitations", resp, "Failure sending request") + return + } + + result.cil, err = client.ListInvitationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ConsumerInvitationsClient", "ListInvitations", resp, "Failure responding to request") + } + + return +} + +// ListInvitationsPreparer prepares the ListInvitations request. +func (client ConsumerInvitationsClient) ListInvitationsPreparer(ctx context.Context, skipToken string) (*http.Request, error) { + const APIVersion = "2019-11-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.WithPath("/providers/Microsoft.DataShare/ListInvitations"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListInvitationsSender sends the ListInvitations request. The method will close the +// http.Response Body if it receives an error. +func (client ConsumerInvitationsClient) ListInvitationsSender(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...) +} + +// ListInvitationsResponder handles the response to the ListInvitations request. The method always +// closes the http.Response Body. +func (client ConsumerInvitationsClient) ListInvitationsResponder(resp *http.Response) (result ConsumerInvitationList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listInvitationsNextResults retrieves the next set of results, if any. +func (client ConsumerInvitationsClient) listInvitationsNextResults(ctx context.Context, lastResults ConsumerInvitationList) (result ConsumerInvitationList, err error) { + req, err := lastResults.consumerInvitationListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "datashare.ConsumerInvitationsClient", "listInvitationsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListInvitationsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "datashare.ConsumerInvitationsClient", "listInvitationsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListInvitationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ConsumerInvitationsClient", "listInvitationsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListInvitationsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ConsumerInvitationsClient) ListInvitationsComplete(ctx context.Context, skipToken string) (result ConsumerInvitationListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConsumerInvitationsClient.ListInvitations") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListInvitations(ctx, skipToken) + return +} + +// RejectInvitation reject an invitation +// Parameters: +// location - location of the invitation +// invitation - an invitation payload +func (client ConsumerInvitationsClient) RejectInvitation(ctx context.Context, location string, invitation ConsumerInvitation) (result ConsumerInvitation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConsumerInvitationsClient.RejectInvitation") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: invitation, + Constraints: []validation.Constraint{{Target: "invitation.ConsumerInvitationProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "invitation.ConsumerInvitationProperties.InvitationID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("datashare.ConsumerInvitationsClient", "RejectInvitation", err.Error()) + } + + req, err := client.RejectInvitationPreparer(ctx, location, invitation) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ConsumerInvitationsClient", "RejectInvitation", nil, "Failure preparing request") + return + } + + resp, err := client.RejectInvitationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.ConsumerInvitationsClient", "RejectInvitation", resp, "Failure sending request") + return + } + + result, err = client.RejectInvitationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ConsumerInvitationsClient", "RejectInvitation", resp, "Failure responding to request") + } + + return +} + +// RejectInvitationPreparer prepares the RejectInvitation request. +func (client ConsumerInvitationsClient) RejectInvitationPreparer(ctx context.Context, location string, invitation ConsumerInvitation) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.DataShare/locations/{location}/RejectInvitation", pathParameters), + autorest.WithJSON(invitation), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RejectInvitationSender sends the RejectInvitation request. The method will close the +// http.Response Body if it receives an error. +func (client ConsumerInvitationsClient) RejectInvitationSender(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...) +} + +// RejectInvitationResponder handles the response to the RejectInvitation request. The method always +// closes the http.Response Body. +func (client ConsumerInvitationsClient) RejectInvitationResponder(resp *http.Response) (result ConsumerInvitation, 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/datashare/mgmt/2019-11-01/datashare/consumersourcedatasets.go b/services/datashare/mgmt/2019-11-01/datashare/consumersourcedatasets.go new file mode 100644 index 000000000000..18a6baf1fb8b --- /dev/null +++ b/services/datashare/mgmt/2019-11-01/datashare/consumersourcedatasets.go @@ -0,0 +1,162 @@ +package datashare + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if 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" +) + +// ConsumerSourceDataSetsClient is the creates a Microsoft.DataShare management client. +type ConsumerSourceDataSetsClient struct { + BaseClient +} + +// NewConsumerSourceDataSetsClient creates an instance of the ConsumerSourceDataSetsClient client. +func NewConsumerSourceDataSetsClient(subscriptionID string) ConsumerSourceDataSetsClient { + return NewConsumerSourceDataSetsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewConsumerSourceDataSetsClientWithBaseURI creates an instance of the ConsumerSourceDataSetsClient client. +func NewConsumerSourceDataSetsClientWithBaseURI(baseURI string, subscriptionID string) ConsumerSourceDataSetsClient { + return ConsumerSourceDataSetsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListByShareSubscription get source dataSets of a shareSubscription +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareSubscriptionName - the name of the shareSubscription. +// skipToken - continuation token +func (client ConsumerSourceDataSetsClient) ListByShareSubscription(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, skipToken string) (result ConsumerSourceDataSetListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConsumerSourceDataSetsClient.ListByShareSubscription") + defer func() { + sc := -1 + if result.csdsl.Response.Response != nil { + sc = result.csdsl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByShareSubscriptionNextResults + req, err := client.ListByShareSubscriptionPreparer(ctx, resourceGroupName, accountName, shareSubscriptionName, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ConsumerSourceDataSetsClient", "ListByShareSubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListByShareSubscriptionSender(req) + if err != nil { + result.csdsl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.ConsumerSourceDataSetsClient", "ListByShareSubscription", resp, "Failure sending request") + return + } + + result.csdsl, err = client.ListByShareSubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ConsumerSourceDataSetsClient", "ListByShareSubscription", resp, "Failure responding to request") + } + + return +} + +// ListByShareSubscriptionPreparer prepares the ListByShareSubscription request. +func (client ConsumerSourceDataSetsClient) ListByShareSubscriptionPreparer(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareSubscriptionName": autorest.Encode("path", shareSubscriptionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/ConsumerSourceDataSets", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByShareSubscriptionSender sends the ListByShareSubscription request. The method will close the +// http.Response Body if it receives an error. +func (client ConsumerSourceDataSetsClient) ListByShareSubscriptionSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByShareSubscriptionResponder handles the response to the ListByShareSubscription request. The method always +// closes the http.Response Body. +func (client ConsumerSourceDataSetsClient) ListByShareSubscriptionResponder(resp *http.Response) (result ConsumerSourceDataSetList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByShareSubscriptionNextResults retrieves the next set of results, if any. +func (client ConsumerSourceDataSetsClient) listByShareSubscriptionNextResults(ctx context.Context, lastResults ConsumerSourceDataSetList) (result ConsumerSourceDataSetList, err error) { + req, err := lastResults.consumerSourceDataSetListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "datashare.ConsumerSourceDataSetsClient", "listByShareSubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByShareSubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "datashare.ConsumerSourceDataSetsClient", "listByShareSubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByShareSubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ConsumerSourceDataSetsClient", "listByShareSubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByShareSubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client ConsumerSourceDataSetsClient) ListByShareSubscriptionComplete(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, skipToken string) (result ConsumerSourceDataSetListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConsumerSourceDataSetsClient.ListByShareSubscription") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByShareSubscription(ctx, resourceGroupName, accountName, shareSubscriptionName, skipToken) + return +} diff --git a/services/datashare/mgmt/2019-11-01/datashare/datasetmappings.go b/services/datashare/mgmt/2019-11-01/datashare/datasetmappings.go new file mode 100644 index 000000000000..7b191048f461 --- /dev/null +++ b/services/datashare/mgmt/2019-11-01/datashare/datasetmappings.go @@ -0,0 +1,407 @@ +package datashare + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if 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" +) + +// DataSetMappingsClient is the creates a Microsoft.DataShare management client. +type DataSetMappingsClient struct { + BaseClient +} + +// NewDataSetMappingsClient creates an instance of the DataSetMappingsClient client. +func NewDataSetMappingsClient(subscriptionID string) DataSetMappingsClient { + return NewDataSetMappingsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDataSetMappingsClientWithBaseURI creates an instance of the DataSetMappingsClient client. +func NewDataSetMappingsClientWithBaseURI(baseURI string, subscriptionID string) DataSetMappingsClient { + return DataSetMappingsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create create a DataSetMapping +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareSubscriptionName - the name of the share subscription which will hold the data set sink. +// dataSetMappingName - the name of the data set mapping to be created. +// dataSetMapping - destination data set configuration details. +func (client DataSetMappingsClient) Create(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, dataSetMappingName string, dataSetMapping BasicDataSetMapping) (result DataSetMappingModel, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataSetMappingsClient.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, accountName, shareSubscriptionName, dataSetMappingName, dataSetMapping) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.DataSetMappingsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.DataSetMappingsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.DataSetMappingsClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client DataSetMappingsClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, dataSetMappingName string, dataSetMapping BasicDataSetMapping) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "dataSetMappingName": autorest.Encode("path", dataSetMappingName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareSubscriptionName": autorest.Encode("path", shareSubscriptionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/dataSetMappings/{dataSetMappingName}", pathParameters), + autorest.WithJSON(dataSetMapping), + 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 DataSetMappingsClient) 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 DataSetMappingsClient) CreateResponder(resp *http.Response) (result DataSetMappingModel, 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 DataSetMapping in a shareSubscription +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareSubscriptionName - the name of the shareSubscription. +// dataSetMappingName - the name of the dataSetMapping. +func (client DataSetMappingsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, dataSetMappingName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataSetMappingsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, shareSubscriptionName, dataSetMappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.DataSetMappingsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "datashare.DataSetMappingsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.DataSetMappingsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client DataSetMappingsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, dataSetMappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "dataSetMappingName": autorest.Encode("path", dataSetMappingName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareSubscriptionName": autorest.Encode("path", shareSubscriptionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/dataSetMappings/{dataSetMappingName}", 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 DataSetMappingsClient) 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 DataSetMappingsClient) 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 DataSetMapping in a shareSubscription +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareSubscriptionName - the name of the shareSubscription. +// dataSetMappingName - the name of the dataSetMapping. +func (client DataSetMappingsClient) Get(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, dataSetMappingName string) (result DataSetMappingModel, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataSetMappingsClient.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, accountName, shareSubscriptionName, dataSetMappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.DataSetMappingsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.DataSetMappingsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.DataSetMappingsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client DataSetMappingsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, dataSetMappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "dataSetMappingName": autorest.Encode("path", dataSetMappingName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareSubscriptionName": autorest.Encode("path", shareSubscriptionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/dataSetMappings/{dataSetMappingName}", 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 DataSetMappingsClient) 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 DataSetMappingsClient) GetResponder(resp *http.Response) (result DataSetMappingModel, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByShareSubscription list DataSetMappings in a share subscription +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareSubscriptionName - the name of the share subscription. +// skipToken - continuation token +func (client DataSetMappingsClient) ListByShareSubscription(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, skipToken string) (result DataSetMappingListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataSetMappingsClient.ListByShareSubscription") + defer func() { + sc := -1 + if result.dsml.Response.Response != nil { + sc = result.dsml.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByShareSubscriptionNextResults + req, err := client.ListByShareSubscriptionPreparer(ctx, resourceGroupName, accountName, shareSubscriptionName, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.DataSetMappingsClient", "ListByShareSubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListByShareSubscriptionSender(req) + if err != nil { + result.dsml.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.DataSetMappingsClient", "ListByShareSubscription", resp, "Failure sending request") + return + } + + result.dsml, err = client.ListByShareSubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.DataSetMappingsClient", "ListByShareSubscription", resp, "Failure responding to request") + } + + return +} + +// ListByShareSubscriptionPreparer prepares the ListByShareSubscription request. +func (client DataSetMappingsClient) ListByShareSubscriptionPreparer(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareSubscriptionName": autorest.Encode("path", shareSubscriptionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/dataSetMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByShareSubscriptionSender sends the ListByShareSubscription request. The method will close the +// http.Response Body if it receives an error. +func (client DataSetMappingsClient) ListByShareSubscriptionSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByShareSubscriptionResponder handles the response to the ListByShareSubscription request. The method always +// closes the http.Response Body. +func (client DataSetMappingsClient) ListByShareSubscriptionResponder(resp *http.Response) (result DataSetMappingList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByShareSubscriptionNextResults retrieves the next set of results, if any. +func (client DataSetMappingsClient) listByShareSubscriptionNextResults(ctx context.Context, lastResults DataSetMappingList) (result DataSetMappingList, err error) { + req, err := lastResults.dataSetMappingListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "datashare.DataSetMappingsClient", "listByShareSubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByShareSubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "datashare.DataSetMappingsClient", "listByShareSubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByShareSubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.DataSetMappingsClient", "listByShareSubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByShareSubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client DataSetMappingsClient) ListByShareSubscriptionComplete(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, skipToken string) (result DataSetMappingListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataSetMappingsClient.ListByShareSubscription") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByShareSubscription(ctx, resourceGroupName, accountName, shareSubscriptionName, skipToken) + return +} diff --git a/services/datashare/mgmt/2019-11-01/datashare/datasets.go b/services/datashare/mgmt/2019-11-01/datashare/datasets.go new file mode 100644 index 000000000000..7e6e3df8fc66 --- /dev/null +++ b/services/datashare/mgmt/2019-11-01/datashare/datasets.go @@ -0,0 +1,407 @@ +package datashare + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if 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" +) + +// DataSetsClient is the creates a Microsoft.DataShare management client. +type DataSetsClient struct { + BaseClient +} + +// NewDataSetsClient creates an instance of the DataSetsClient client. +func NewDataSetsClient(subscriptionID string) DataSetsClient { + return NewDataSetsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDataSetsClientWithBaseURI creates an instance of the DataSetsClient client. +func NewDataSetsClientWithBaseURI(baseURI string, subscriptionID string) DataSetsClient { + return DataSetsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create create a DataSet +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareName - the name of the share to add the data set to. +// dataSetName - the name of the dataSet. +// dataSet - the new data set information. +func (client DataSetsClient) Create(ctx context.Context, resourceGroupName string, accountName string, shareName string, dataSetName string, dataSet BasicDataSet) (result DataSetModel, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataSetsClient.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, accountName, shareName, dataSetName, dataSet) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.DataSetsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.DataSetsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.DataSetsClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client DataSetsClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, dataSetName string, dataSet BasicDataSet) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "dataSetName": autorest.Encode("path", dataSetName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareName": autorest.Encode("path", shareName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets/{dataSetName}", pathParameters), + autorest.WithJSON(dataSet), + 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 DataSetsClient) 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 DataSetsClient) CreateResponder(resp *http.Response) (result DataSetModel, 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 DataSet in a share +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareName - the name of the share. +// dataSetName - the name of the dataSet. +func (client DataSetsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, shareName string, dataSetName string) (result DataSetsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataSetsClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, shareName, dataSetName) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.DataSetsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.DataSetsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client DataSetsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, dataSetName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "dataSetName": autorest.Encode("path", dataSetName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareName": autorest.Encode("path", shareName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets/{dataSetName}", 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 DataSetsClient) DeleteSender(req *http.Request) (future DataSetsDeleteFuture, 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 DataSetsClient) 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 DataSet in a share +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareName - the name of the share. +// dataSetName - the name of the dataSet. +func (client DataSetsClient) Get(ctx context.Context, resourceGroupName string, accountName string, shareName string, dataSetName string) (result DataSetModel, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataSetsClient.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, accountName, shareName, dataSetName) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.DataSetsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.DataSetsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.DataSetsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client DataSetsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, dataSetName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "dataSetName": autorest.Encode("path", dataSetName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareName": autorest.Encode("path", shareName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets/{dataSetName}", 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 DataSetsClient) 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 DataSetsClient) GetResponder(resp *http.Response) (result DataSetModel, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByShare list DataSets in a share +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareName - the name of the share. +// skipToken - continuation token +func (client DataSetsClient) ListByShare(ctx context.Context, resourceGroupName string, accountName string, shareName string, skipToken string) (result DataSetListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataSetsClient.ListByShare") + defer func() { + sc := -1 + if result.dsl.Response.Response != nil { + sc = result.dsl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByShareNextResults + req, err := client.ListBySharePreparer(ctx, resourceGroupName, accountName, shareName, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.DataSetsClient", "ListByShare", nil, "Failure preparing request") + return + } + + resp, err := client.ListByShareSender(req) + if err != nil { + result.dsl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.DataSetsClient", "ListByShare", resp, "Failure sending request") + return + } + + result.dsl, err = client.ListByShareResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.DataSetsClient", "ListByShare", resp, "Failure responding to request") + } + + return +} + +// ListBySharePreparer prepares the ListByShare request. +func (client DataSetsClient) ListBySharePreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareName": autorest.Encode("path", shareName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.DataShare/accounts/{accountName}/shares/{shareName}/dataSets", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByShareSender sends the ListByShare request. The method will close the +// http.Response Body if it receives an error. +func (client DataSetsClient) ListByShareSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByShareResponder handles the response to the ListByShare request. The method always +// closes the http.Response Body. +func (client DataSetsClient) ListByShareResponder(resp *http.Response) (result DataSetList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByShareNextResults retrieves the next set of results, if any. +func (client DataSetsClient) listByShareNextResults(ctx context.Context, lastResults DataSetList) (result DataSetList, err error) { + req, err := lastResults.dataSetListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "datashare.DataSetsClient", "listByShareNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByShareSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "datashare.DataSetsClient", "listByShareNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByShareResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.DataSetsClient", "listByShareNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByShareComplete enumerates all values, automatically crossing page boundaries as required. +func (client DataSetsClient) ListByShareComplete(ctx context.Context, resourceGroupName string, accountName string, shareName string, skipToken string) (result DataSetListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataSetsClient.ListByShare") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByShare(ctx, resourceGroupName, accountName, shareName, skipToken) + return +} diff --git a/services/datashare/mgmt/2019-11-01/datashare/datashareapi/interfaces.go b/services/datashare/mgmt/2019-11-01/datashare/datashareapi/interfaces.go new file mode 100644 index 000000000000..84cab0ea6297 --- /dev/null +++ b/services/datashare/mgmt/2019-11-01/datashare/datashareapi/interfaces.go @@ -0,0 +1,146 @@ +package datashareapi + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by 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/datashare/mgmt/2019-11-01/datashare" + "github.com/Azure/go-autorest/autorest" +) + +// AccountsClientAPI contains the set of methods on the AccountsClient type. +type AccountsClientAPI interface { + Create(ctx context.Context, resourceGroupName string, accountName string, account datashare.Account) (result datashare.AccountsCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, accountName string) (result datashare.AccountsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, accountName string) (result datashare.Account, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string, skipToken string) (result datashare.AccountListPage, err error) + ListBySubscription(ctx context.Context, skipToken string) (result datashare.AccountListPage, err error) + Update(ctx context.Context, resourceGroupName string, accountName string, accountUpdateParameters datashare.AccountUpdateParameters) (result datashare.Account, err error) +} + +var _ AccountsClientAPI = (*datashare.AccountsClient)(nil) + +// ConsumerInvitationsClientAPI contains the set of methods on the ConsumerInvitationsClient type. +type ConsumerInvitationsClientAPI interface { + Get(ctx context.Context, location string, invitationID string) (result datashare.ConsumerInvitation, err error) + ListInvitations(ctx context.Context, skipToken string) (result datashare.ConsumerInvitationListPage, err error) + RejectInvitation(ctx context.Context, location string, invitation datashare.ConsumerInvitation) (result datashare.ConsumerInvitation, err error) +} + +var _ ConsumerInvitationsClientAPI = (*datashare.ConsumerInvitationsClient)(nil) + +// DataSetsClientAPI contains the set of methods on the DataSetsClient type. +type DataSetsClientAPI interface { + Create(ctx context.Context, resourceGroupName string, accountName string, shareName string, dataSetName string, dataSet datashare.BasicDataSet) (result datashare.DataSetModel, err error) + Delete(ctx context.Context, resourceGroupName string, accountName string, shareName string, dataSetName string) (result datashare.DataSetsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, accountName string, shareName string, dataSetName string) (result datashare.DataSetModel, err error) + ListByShare(ctx context.Context, resourceGroupName string, accountName string, shareName string, skipToken string) (result datashare.DataSetListPage, err error) +} + +var _ DataSetsClientAPI = (*datashare.DataSetsClient)(nil) + +// DataSetMappingsClientAPI contains the set of methods on the DataSetMappingsClient type. +type DataSetMappingsClientAPI interface { + Create(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, dataSetMappingName string, dataSetMapping datashare.BasicDataSetMapping) (result datashare.DataSetMappingModel, err error) + Delete(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, dataSetMappingName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, dataSetMappingName string) (result datashare.DataSetMappingModel, err error) + ListByShareSubscription(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, skipToken string) (result datashare.DataSetMappingListPage, err error) +} + +var _ DataSetMappingsClientAPI = (*datashare.DataSetMappingsClient)(nil) + +// InvitationsClientAPI contains the set of methods on the InvitationsClient type. +type InvitationsClientAPI interface { + Create(ctx context.Context, resourceGroupName string, accountName string, shareName string, invitationName string, invitation datashare.Invitation) (result datashare.Invitation, err error) + Delete(ctx context.Context, resourceGroupName string, accountName string, shareName string, invitationName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, accountName string, shareName string, invitationName string) (result datashare.Invitation, err error) + ListByShare(ctx context.Context, resourceGroupName string, accountName string, shareName string, skipToken string) (result datashare.InvitationListPage, err error) +} + +var _ InvitationsClientAPI = (*datashare.InvitationsClient)(nil) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result datashare.OperationListPage, err error) +} + +var _ OperationsClientAPI = (*datashare.OperationsClient)(nil) + +// SharesClientAPI contains the set of methods on the SharesClient type. +type SharesClientAPI interface { + Create(ctx context.Context, resourceGroupName string, accountName string, shareName string, share datashare.Share) (result datashare.Share, err error) + Delete(ctx context.Context, resourceGroupName string, accountName string, shareName string) (result datashare.SharesDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, accountName string, shareName string) (result datashare.Share, err error) + ListByAccount(ctx context.Context, resourceGroupName string, accountName string, skipToken string) (result datashare.ShareListPage, err error) + ListSynchronizationDetails(ctx context.Context, resourceGroupName string, accountName string, shareName string, shareSynchronization datashare.ShareSynchronization, skipToken string) (result datashare.SynchronizationDetailsListPage, err error) + ListSynchronizations(ctx context.Context, resourceGroupName string, accountName string, shareName string, skipToken string) (result datashare.ShareSynchronizationListPage, err error) +} + +var _ SharesClientAPI = (*datashare.SharesClient)(nil) + +// ProviderShareSubscriptionsClientAPI contains the set of methods on the ProviderShareSubscriptionsClient type. +type ProviderShareSubscriptionsClientAPI interface { + GetByShare(ctx context.Context, resourceGroupName string, accountName string, shareName string, providerShareSubscriptionID string) (result datashare.ProviderShareSubscription, err error) + ListByShare(ctx context.Context, resourceGroupName string, accountName string, shareName string, skipToken string) (result datashare.ProviderShareSubscriptionListPage, err error) + Reinstate(ctx context.Context, resourceGroupName string, accountName string, shareName string, providerShareSubscriptionID string) (result datashare.ProviderShareSubscription, err error) + Revoke(ctx context.Context, resourceGroupName string, accountName string, shareName string, providerShareSubscriptionID string) (result datashare.ProviderShareSubscriptionsRevokeFuture, err error) +} + +var _ ProviderShareSubscriptionsClientAPI = (*datashare.ProviderShareSubscriptionsClient)(nil) + +// ShareSubscriptionsClientAPI contains the set of methods on the ShareSubscriptionsClient type. +type ShareSubscriptionsClientAPI interface { + CancelSynchronization(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, shareSubscriptionSynchronization datashare.ShareSubscriptionSynchronization) (result datashare.ShareSubscriptionsCancelSynchronizationFuture, err error) + Create(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, shareSubscription datashare.ShareSubscription) (result datashare.ShareSubscription, err error) + Delete(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string) (result datashare.ShareSubscriptionsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string) (result datashare.ShareSubscription, err error) + ListByAccount(ctx context.Context, resourceGroupName string, accountName string, skipToken string) (result datashare.ShareSubscriptionListPage, err error) + ListSourceShareSynchronizationSettings(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, skipToken string) (result datashare.SourceShareSynchronizationSettingListPage, err error) + ListSynchronizationDetails(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, shareSubscriptionSynchronization datashare.ShareSubscriptionSynchronization, skipToken string) (result datashare.SynchronizationDetailsListPage, err error) + ListSynchronizations(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, skipToken string) (result datashare.ShareSubscriptionSynchronizationListPage, err error) + SynchronizeMethod(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, synchronize datashare.Synchronize) (result datashare.ShareSubscriptionsSynchronizeMethodFuture, err error) +} + +var _ ShareSubscriptionsClientAPI = (*datashare.ShareSubscriptionsClient)(nil) + +// ConsumerSourceDataSetsClientAPI contains the set of methods on the ConsumerSourceDataSetsClient type. +type ConsumerSourceDataSetsClientAPI interface { + ListByShareSubscription(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, skipToken string) (result datashare.ConsumerSourceDataSetListPage, err error) +} + +var _ ConsumerSourceDataSetsClientAPI = (*datashare.ConsumerSourceDataSetsClient)(nil) + +// SynchronizationSettingsClientAPI contains the set of methods on the SynchronizationSettingsClient type. +type SynchronizationSettingsClientAPI interface { + Create(ctx context.Context, resourceGroupName string, accountName string, shareName string, synchronizationSettingName string, synchronizationSetting datashare.BasicSynchronizationSetting) (result datashare.SynchronizationSettingModel, err error) + Delete(ctx context.Context, resourceGroupName string, accountName string, shareName string, synchronizationSettingName string) (result datashare.SynchronizationSettingsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, accountName string, shareName string, synchronizationSettingName string) (result datashare.SynchronizationSettingModel, err error) + ListByShare(ctx context.Context, resourceGroupName string, accountName string, shareName string, skipToken string) (result datashare.SynchronizationSettingListPage, err error) +} + +var _ SynchronizationSettingsClientAPI = (*datashare.SynchronizationSettingsClient)(nil) + +// TriggersClientAPI contains the set of methods on the TriggersClient type. +type TriggersClientAPI interface { + Create(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, triggerName string, trigger datashare.BasicTrigger) (result datashare.TriggersCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, triggerName string) (result datashare.TriggersDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, triggerName string) (result datashare.TriggerModel, err error) + ListByShareSubscription(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, skipToken string) (result datashare.TriggerListPage, err error) +} + +var _ TriggersClientAPI = (*datashare.TriggersClient)(nil) diff --git a/services/datashare/mgmt/2019-11-01/datashare/invitations.go b/services/datashare/mgmt/2019-11-01/datashare/invitations.go new file mode 100644 index 000000000000..a30e426f71c3 --- /dev/null +++ b/services/datashare/mgmt/2019-11-01/datashare/invitations.go @@ -0,0 +1,407 @@ +package datashare + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if 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" +) + +// InvitationsClient is the creates a Microsoft.DataShare management client. +type InvitationsClient struct { + BaseClient +} + +// NewInvitationsClient creates an instance of the InvitationsClient client. +func NewInvitationsClient(subscriptionID string) InvitationsClient { + return NewInvitationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewInvitationsClientWithBaseURI creates an instance of the InvitationsClient client. +func NewInvitationsClientWithBaseURI(baseURI string, subscriptionID string) InvitationsClient { + return InvitationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create create an invitation +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareName - the name of the share to send the invitation for. +// invitationName - the name of the invitation. +// invitation - invitation details. +func (client InvitationsClient) Create(ctx context.Context, resourceGroupName string, accountName string, shareName string, invitationName string, invitation Invitation) (result Invitation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InvitationsClient.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, accountName, shareName, invitationName, invitation) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.InvitationsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.InvitationsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.InvitationsClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client InvitationsClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, invitationName string, invitation Invitation) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "invitationName": autorest.Encode("path", invitationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareName": autorest.Encode("path", shareName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/invitations/{invitationName}", pathParameters), + autorest.WithJSON(invitation), + 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 InvitationsClient) 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 InvitationsClient) CreateResponder(resp *http.Response) (result Invitation, 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 invitation in a share +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareName - the name of the share. +// invitationName - the name of the invitation. +func (client InvitationsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, shareName string, invitationName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InvitationsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, shareName, invitationName) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.InvitationsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "datashare.InvitationsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.InvitationsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client InvitationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, invitationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "invitationName": autorest.Encode("path", invitationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareName": autorest.Encode("path", shareName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/invitations/{invitationName}", 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 InvitationsClient) 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 InvitationsClient) 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 invitation in a share +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareName - the name of the share. +// invitationName - the name of the invitation. +func (client InvitationsClient) Get(ctx context.Context, resourceGroupName string, accountName string, shareName string, invitationName string) (result Invitation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InvitationsClient.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, accountName, shareName, invitationName) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.InvitationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.InvitationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.InvitationsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client InvitationsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, invitationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "invitationName": autorest.Encode("path", invitationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareName": autorest.Encode("path", shareName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/invitations/{invitationName}", 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 InvitationsClient) 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 InvitationsClient) GetResponder(resp *http.Response) (result Invitation, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByShare list invitations in a share +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareName - the name of the share. +// skipToken - the continuation token +func (client InvitationsClient) ListByShare(ctx context.Context, resourceGroupName string, accountName string, shareName string, skipToken string) (result InvitationListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InvitationsClient.ListByShare") + defer func() { + sc := -1 + if result.il.Response.Response != nil { + sc = result.il.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByShareNextResults + req, err := client.ListBySharePreparer(ctx, resourceGroupName, accountName, shareName, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.InvitationsClient", "ListByShare", nil, "Failure preparing request") + return + } + + resp, err := client.ListByShareSender(req) + if err != nil { + result.il.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.InvitationsClient", "ListByShare", resp, "Failure sending request") + return + } + + result.il, err = client.ListByShareResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.InvitationsClient", "ListByShare", resp, "Failure responding to request") + } + + return +} + +// ListBySharePreparer prepares the ListByShare request. +func (client InvitationsClient) ListBySharePreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareName": autorest.Encode("path", shareName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.DataShare/accounts/{accountName}/shares/{shareName}/invitations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByShareSender sends the ListByShare request. The method will close the +// http.Response Body if it receives an error. +func (client InvitationsClient) ListByShareSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByShareResponder handles the response to the ListByShare request. The method always +// closes the http.Response Body. +func (client InvitationsClient) ListByShareResponder(resp *http.Response) (result InvitationList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByShareNextResults retrieves the next set of results, if any. +func (client InvitationsClient) listByShareNextResults(ctx context.Context, lastResults InvitationList) (result InvitationList, err error) { + req, err := lastResults.invitationListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "datashare.InvitationsClient", "listByShareNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByShareSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "datashare.InvitationsClient", "listByShareNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByShareResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.InvitationsClient", "listByShareNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByShareComplete enumerates all values, automatically crossing page boundaries as required. +func (client InvitationsClient) ListByShareComplete(ctx context.Context, resourceGroupName string, accountName string, shareName string, skipToken string) (result InvitationListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InvitationsClient.ListByShare") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByShare(ctx, resourceGroupName, accountName, shareName, skipToken) + return +} diff --git a/services/datashare/mgmt/2019-11-01/datashare/models.go b/services/datashare/mgmt/2019-11-01/datashare/models.go new file mode 100644 index 000000000000..2219eb89f0b7 --- /dev/null +++ b/services/datashare/mgmt/2019-11-01/datashare/models.go @@ -0,0 +1,8906 @@ +package datashare + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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/datashare/mgmt/2019-11-01/datashare" + +// DataSetMappingStatus enumerates the values for data set mapping status. +type DataSetMappingStatus string + +const ( + // Broken ... + Broken DataSetMappingStatus = "Broken" + // Ok ... + Ok DataSetMappingStatus = "Ok" +) + +// PossibleDataSetMappingStatusValues returns an array of possible values for the DataSetMappingStatus const type. +func PossibleDataSetMappingStatusValues() []DataSetMappingStatus { + return []DataSetMappingStatus{Broken, Ok} +} + +// DataSetType enumerates the values for data set type. +type DataSetType string + +const ( + // AdlsGen1File ... + AdlsGen1File DataSetType = "AdlsGen1File" + // AdlsGen1Folder ... + AdlsGen1Folder DataSetType = "AdlsGen1Folder" + // AdlsGen2File ... + AdlsGen2File DataSetType = "AdlsGen2File" + // AdlsGen2FileSystem ... + AdlsGen2FileSystem DataSetType = "AdlsGen2FileSystem" + // AdlsGen2Folder ... + AdlsGen2Folder DataSetType = "AdlsGen2Folder" + // Blob ... + Blob DataSetType = "Blob" + // BlobFolder ... + BlobFolder DataSetType = "BlobFolder" + // Container ... + Container DataSetType = "Container" + // KustoCluster ... + KustoCluster DataSetType = "KustoCluster" + // KustoDatabase ... + KustoDatabase DataSetType = "KustoDatabase" + // 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, KustoCluster, KustoDatabase, SQLDBTable, SQLDWTable} +} + +// InvitationStatus enumerates the values for invitation status. +type InvitationStatus string + +const ( + // Accepted ... + Accepted InvitationStatus = "Accepted" + // Pending ... + Pending InvitationStatus = "Pending" + // Rejected ... + Rejected InvitationStatus = "Rejected" + // Withdrawn ... + Withdrawn InvitationStatus = "Withdrawn" +) + +// PossibleInvitationStatusValues returns an array of possible values for the InvitationStatus const type. +func PossibleInvitationStatusValues() []InvitationStatus { + return []InvitationStatus{Accepted, Pending, Rejected, Withdrawn} +} + +// Kind enumerates the values for kind. +type Kind string + +const ( + // KindAdlsGen1File ... + KindAdlsGen1File Kind = "AdlsGen1File" + // KindAdlsGen1Folder ... + KindAdlsGen1Folder Kind = "AdlsGen1Folder" + // KindAdlsGen2File ... + KindAdlsGen2File Kind = "AdlsGen2File" + // KindAdlsGen2FileSystem ... + KindAdlsGen2FileSystem Kind = "AdlsGen2FileSystem" + // KindAdlsGen2Folder ... + KindAdlsGen2Folder Kind = "AdlsGen2Folder" + // KindBlob ... + KindBlob Kind = "Blob" + // KindBlobFolder ... + KindBlobFolder Kind = "BlobFolder" + // KindContainer ... + KindContainer Kind = "Container" + // KindDataSet ... + KindDataSet Kind = "DataSet" + // KindKustoCluster ... + KindKustoCluster Kind = "KustoCluster" + // KindKustoDatabase ... + KindKustoDatabase Kind = "KustoDatabase" + // 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, KindKustoCluster, KindKustoDatabase, KindSQLDBTable, KindSQLDWTable} +} + +// KindBasicDataSetMapping enumerates the values for kind basic data set mapping. +type KindBasicDataSetMapping string + +const ( + // KindBasicDataSetMappingKindAdlsGen2File ... + KindBasicDataSetMappingKindAdlsGen2File KindBasicDataSetMapping = "AdlsGen2File" + // KindBasicDataSetMappingKindAdlsGen2FileSystem ... + KindBasicDataSetMappingKindAdlsGen2FileSystem KindBasicDataSetMapping = "AdlsGen2FileSystem" + // KindBasicDataSetMappingKindAdlsGen2Folder ... + KindBasicDataSetMappingKindAdlsGen2Folder KindBasicDataSetMapping = "AdlsGen2Folder" + // KindBasicDataSetMappingKindBlob ... + KindBasicDataSetMappingKindBlob KindBasicDataSetMapping = "Blob" + // KindBasicDataSetMappingKindBlobFolder ... + KindBasicDataSetMappingKindBlobFolder KindBasicDataSetMapping = "BlobFolder" + // KindBasicDataSetMappingKindContainer ... + KindBasicDataSetMappingKindContainer KindBasicDataSetMapping = "Container" + // KindBasicDataSetMappingKindDataSetMapping ... + KindBasicDataSetMappingKindDataSetMapping KindBasicDataSetMapping = "DataSetMapping" + // KindBasicDataSetMappingKindKustoCluster ... + KindBasicDataSetMappingKindKustoCluster KindBasicDataSetMapping = "KustoCluster" + // KindBasicDataSetMappingKindKustoDatabase ... + KindBasicDataSetMappingKindKustoDatabase KindBasicDataSetMapping = "KustoDatabase" + // 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, KindBasicDataSetMappingKindKustoCluster, KindBasicDataSetMappingKindKustoDatabase, KindBasicDataSetMappingKindSQLDBTable, KindBasicDataSetMappingKindSQLDWTable} +} + +// KindBasicSourceShareSynchronizationSetting enumerates the values for kind basic source share synchronization +// setting. +type KindBasicSourceShareSynchronizationSetting string + +const ( + // KindScheduleBased ... + KindScheduleBased KindBasicSourceShareSynchronizationSetting = "ScheduleBased" + // KindSourceShareSynchronizationSetting ... + KindSourceShareSynchronizationSetting KindBasicSourceShareSynchronizationSetting = "SourceShareSynchronizationSetting" +) + +// PossibleKindBasicSourceShareSynchronizationSettingValues returns an array of possible values for the KindBasicSourceShareSynchronizationSetting const type. +func PossibleKindBasicSourceShareSynchronizationSettingValues() []KindBasicSourceShareSynchronizationSetting { + return []KindBasicSourceShareSynchronizationSetting{KindScheduleBased, KindSourceShareSynchronizationSetting} +} + +// KindBasicSynchronizationSetting enumerates the values for kind basic synchronization setting. +type KindBasicSynchronizationSetting string + +const ( + // KindBasicSynchronizationSettingKindScheduleBased ... + KindBasicSynchronizationSettingKindScheduleBased KindBasicSynchronizationSetting = "ScheduleBased" + // KindBasicSynchronizationSettingKindSynchronizationSetting ... + KindBasicSynchronizationSettingKindSynchronizationSetting KindBasicSynchronizationSetting = "SynchronizationSetting" +) + +// PossibleKindBasicSynchronizationSettingValues returns an array of possible values for the KindBasicSynchronizationSetting const type. +func PossibleKindBasicSynchronizationSettingValues() []KindBasicSynchronizationSetting { + return []KindBasicSynchronizationSetting{KindBasicSynchronizationSettingKindScheduleBased, KindBasicSynchronizationSettingKindSynchronizationSetting} +} + +// KindBasicTrigger enumerates the values for kind basic trigger. +type KindBasicTrigger string + +const ( + // KindBasicTriggerKindScheduleBased ... + KindBasicTriggerKindScheduleBased KindBasicTrigger = "ScheduleBased" + // KindBasicTriggerKindTrigger ... + KindBasicTriggerKindTrigger KindBasicTrigger = "Trigger" +) + +// PossibleKindBasicTriggerValues returns an array of possible values for the KindBasicTrigger const type. +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 + +const ( + // Creating ... + Creating ProvisioningState = "Creating" + // Deleting ... + Deleting ProvisioningState = "Deleting" + // Failed ... + Failed ProvisioningState = "Failed" + // Moving ... + Moving ProvisioningState = "Moving" + // 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, Succeeded} +} + +// RecurrenceInterval enumerates the values for recurrence interval. +type RecurrenceInterval string + +const ( + // Day ... + Day RecurrenceInterval = "Day" + // Hour ... + Hour RecurrenceInterval = "Hour" +) + +// PossibleRecurrenceIntervalValues returns an array of possible values for the RecurrenceInterval const type. +func PossibleRecurrenceIntervalValues() []RecurrenceInterval { + return []RecurrenceInterval{Day, Hour} +} + +// ShareKind enumerates the values for share kind. +type ShareKind string + +const ( + // CopyBased ... + CopyBased ShareKind = "CopyBased" + // InPlace ... + InPlace ShareKind = "InPlace" +) + +// PossibleShareKindValues returns an array of possible values for the ShareKind const type. +func PossibleShareKindValues() []ShareKind { + return []ShareKind{CopyBased, InPlace} +} + +// ShareSubscriptionStatus enumerates the values for share subscription status. +type ShareSubscriptionStatus string + +const ( + // Active ... + Active ShareSubscriptionStatus = "Active" + // Revoked ... + Revoked ShareSubscriptionStatus = "Revoked" + // Revoking ... + Revoking ShareSubscriptionStatus = "Revoking" + // SourceDeleted ... + SourceDeleted ShareSubscriptionStatus = "SourceDeleted" +) + +// PossibleShareSubscriptionStatusValues returns an array of possible values for the ShareSubscriptionStatus const type. +func PossibleShareSubscriptionStatusValues() []ShareSubscriptionStatus { + return []ShareSubscriptionStatus{Active, Revoked, Revoking, SourceDeleted} +} + +// Status enumerates the values for status. +type Status string + +const ( + // StatusAccepted ... + StatusAccepted Status = "Accepted" + // StatusCanceled ... + StatusCanceled Status = "Canceled" + // StatusFailed ... + StatusFailed Status = "Failed" + // StatusInProgress ... + StatusInProgress Status = "InProgress" + // StatusSucceeded ... + StatusSucceeded Status = "Succeeded" + // StatusTransientFailure ... + StatusTransientFailure Status = "TransientFailure" +) + +// PossibleStatusValues returns an array of possible values for the Status const type. +func PossibleStatusValues() []Status { + return []Status{StatusAccepted, StatusCanceled, StatusFailed, StatusInProgress, StatusSucceeded, StatusTransientFailure} +} + +// SynchronizationMode enumerates the values for synchronization mode. +type SynchronizationMode string + +const ( + // FullSync ... + FullSync SynchronizationMode = "FullSync" + // Incremental ... + Incremental SynchronizationMode = "Incremental" +) + +// PossibleSynchronizationModeValues returns an array of possible values for the SynchronizationMode const type. +func PossibleSynchronizationModeValues() []SynchronizationMode { + return []SynchronizationMode{FullSync, Incremental} +} + +// TriggerStatus enumerates the values for trigger status. +type TriggerStatus string + +const ( + // TriggerStatusActive ... + TriggerStatusActive TriggerStatus = "Active" + // TriggerStatusInactive ... + TriggerStatusInactive TriggerStatus = "Inactive" + // TriggerStatusSourceSynchronizationSettingDeleted ... + TriggerStatusSourceSynchronizationSettingDeleted TriggerStatus = "SourceSynchronizationSettingDeleted" +) + +// PossibleTriggerStatusValues returns an array of possible values for the TriggerStatus const type. +func PossibleTriggerStatusValues() []TriggerStatus { + return []TriggerStatus{TriggerStatusActive, TriggerStatusInactive, TriggerStatusSourceSynchronizationSettingDeleted} +} + +// Type enumerates the values for type. +type Type string + +const ( + // SystemAssigned ... + SystemAssigned Type = "SystemAssigned" +) + +// PossibleTypeValues returns an array of possible values for the Type const type. +func PossibleTypeValues() []Type { + return []Type{SystemAssigned} +} + +// Account an account data transfer object. +type Account struct { + autorest.Response `json:"-"` + // Identity - Identity Info on the Account + Identity *Identity `json:"identity,omitempty"` + // AccountProperties - Properties on the account + *AccountProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The resource id of the azure resource + ID *string `json:"id,omitempty"` + // Location - Location of the azure resource. + Location *string `json:"location,omitempty"` + // Name - READ-ONLY; Name of the azure resource + Name *string `json:"name,omitempty"` + // Tags - Tags on the azure resource. + Tags map[string]*string `json:"tags"` + // Type - READ-ONLY; Type of the azure resource + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Account. +func (a Account) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if a.Identity != nil { + objectMap["identity"] = a.Identity + } + if a.AccountProperties != nil { + objectMap["properties"] = a.AccountProperties + } + 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 Account struct. +func (a *Account) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "identity": + if v != nil { + var identity Identity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + a.Identity = &identity + } + case "properties": + if v != nil { + var accountProperties AccountProperties + err = json.Unmarshal(*v, &accountProperties) + if err != nil { + return err + } + a.AccountProperties = &accountProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + a.ID = &ID + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + a.Location = &location + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + a.Name = &name + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + a.Tags = tags + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + a.Type = &typeVar + } + } + } + + return nil +} + +// AccountList list response for get Accounts. +type AccountList struct { + autorest.Response `json:"-"` + // NextLink - The Url of next result page. + NextLink *string `json:"nextLink,omitempty"` + // Value - Collection of items of type DataTransferObjects. + Value *[]Account `json:"value,omitempty"` +} + +// AccountListIterator provides access to a complete listing of Account values. +type AccountListIterator struct { + i int + page AccountListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *AccountListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *AccountListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AccountListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter AccountListIterator) Response() AccountList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter AccountListIterator) Value() Account { + if !iter.page.NotDone() { + return Account{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AccountListIterator type. +func NewAccountListIterator(page AccountListPage) AccountListIterator { + return AccountListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (al AccountList) IsEmpty() bool { + return al.Value == nil || len(*al.Value) == 0 +} + +// accountListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (al AccountList) accountListPreparer(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))) +} + +// AccountListPage contains a page of Account values. +type AccountListPage struct { + fn func(context.Context, AccountList) (AccountList, error) + al AccountList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *AccountListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountListPage.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 *AccountListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AccountListPage) NotDone() bool { + return !page.al.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AccountListPage) Response() AccountList { + return page.al +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AccountListPage) Values() []Account { + if page.al.IsEmpty() { + return nil + } + return *page.al.Value +} + +// Creates a new instance of the AccountListPage type. +func NewAccountListPage(getNextPage func(context.Context, AccountList) (AccountList, error)) AccountListPage { + return AccountListPage{fn: getNextPage} +} + +// AccountProperties account property bag. +type AccountProperties struct { + // CreatedAt - READ-ONLY; Time at which the account was created. + CreatedAt *date.Time `json:"createdAt,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the Account. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // UserEmail - READ-ONLY; Email of the user who created the resource + UserEmail *string `json:"userEmail,omitempty"` + // UserName - READ-ONLY; Name of the user who created the resource + UserName *string `json:"userName,omitempty"` +} + +// AccountsCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type AccountsCreateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *AccountsCreateFuture) Result(client AccountsClient) (a Account, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.AccountsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("datashare.AccountsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if a.Response.Response, err = future.GetResult(sender); err == nil && a.Response.Response.StatusCode != http.StatusNoContent { + a, err = client.CreateResponder(a.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.AccountsCreateFuture", "Result", a.Response.Response, "Failure responding to request") + } + } + return +} + +// AccountsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type AccountsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *AccountsDeleteFuture) Result(client AccountsClient) (or OperationResponse, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.AccountsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("datashare.AccountsDeleteFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if or.Response.Response, err = future.GetResult(sender); err == nil && or.Response.Response.StatusCode != http.StatusNoContent { + or, err = client.DeleteResponder(or.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.AccountsDeleteFuture", "Result", or.Response.Response, "Failure responding to request") + } + } + return +} + +// AccountUpdateParameters update parameters for accounts +type AccountUpdateParameters struct { + // Tags - Tags on the azure resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for AccountUpdateParameters. +func (aup AccountUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if aup.Tags != nil { + objectMap["tags"] = aup.Tags + } + return json.Marshal(objectMap) +} + +// ADLSGen1FileDataSet an ADLS Gen 1 file data set. +type ADLSGen1FileDataSet struct { + // ADLSGen1FileProperties - ADLS Gen 1 file data set properties. + *ADLSGen1FileProperties `json:"properties,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"` + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindKustoCluster', 'KindKustoDatabase', 'KindSQLDWTable', 'KindSQLDBTable' + Kind Kind `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for ADLSGen1FileDataSet. +func (ag1fds ADLSGen1FileDataSet) MarshalJSON() ([]byte, error) { + ag1fds.Kind = KindAdlsGen1File + objectMap := make(map[string]interface{}) + if ag1fds.ADLSGen1FileProperties != nil { + objectMap["properties"] = ag1fds.ADLSGen1FileProperties + } + if ag1fds.Kind != "" { + objectMap["kind"] = ag1fds.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSet is the BasicDataSet implementation for ADLSGen1FileDataSet. +func (ag1fds ADLSGen1FileDataSet) AsBlobDataSet() (*BlobDataSet, bool) { + return nil, false +} + +// AsBlobFolderDataSet is the BasicDataSet implementation for ADLSGen1FileDataSet. +func (ag1fds ADLSGen1FileDataSet) AsBlobFolderDataSet() (*BlobFolderDataSet, bool) { + return nil, false +} + +// AsBlobContainerDataSet is the BasicDataSet implementation for ADLSGen1FileDataSet. +func (ag1fds ADLSGen1FileDataSet) AsBlobContainerDataSet() (*BlobContainerDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileDataSet is the BasicDataSet implementation for ADLSGen1FileDataSet. +func (ag1fds ADLSGen1FileDataSet) AsADLSGen2FileDataSet() (*ADLSGen2FileDataSet, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSet is the BasicDataSet implementation for ADLSGen1FileDataSet. +func (ag1fds ADLSGen1FileDataSet) AsADLSGen2FolderDataSet() (*ADLSGen2FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSet is the BasicDataSet implementation for ADLSGen1FileDataSet. +func (ag1fds ADLSGen1FileDataSet) AsADLSGen2FileSystemDataSet() (*ADLSGen2FileSystemDataSet, bool) { + return nil, false +} + +// AsADLSGen1FolderDataSet is the BasicDataSet implementation for ADLSGen1FileDataSet. +func (ag1fds ADLSGen1FileDataSet) AsADLSGen1FolderDataSet() (*ADLSGen1FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen1FileDataSet is the BasicDataSet implementation for ADLSGen1FileDataSet. +func (ag1fds ADLSGen1FileDataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, bool) { + return &ag1fds, true +} + +// AsKustoClusterDataSet is the BasicDataSet implementation for ADLSGen1FileDataSet. +func (ag1fds ADLSGen1FileDataSet) AsKustoClusterDataSet() (*KustoClusterDataSet, bool) { + return nil, false +} + +// AsKustoDatabaseDataSet is the BasicDataSet implementation for ADLSGen1FileDataSet. +func (ag1fds ADLSGen1FileDataSet) AsKustoDatabaseDataSet() (*KustoDatabaseDataSet, bool) { + return nil, false +} + +// 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 +} + +// AsBasicDataSet is the BasicDataSet implementation for ADLSGen1FileDataSet. +func (ag1fds ADLSGen1FileDataSet) AsBasicDataSet() (BasicDataSet, bool) { + return &ag1fds, true +} + +// UnmarshalJSON is the custom unmarshaler for ADLSGen1FileDataSet struct. +func (ag1fds *ADLSGen1FileDataSet) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var aDLSGen1FileProperties ADLSGen1FileProperties + err = json.Unmarshal(*v, &aDLSGen1FileProperties) + if err != nil { + return err + } + ag1fds.ADLSGen1FileProperties = &aDLSGen1FileProperties + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ag1fds.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ag1fds.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ag1fds.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ag1fds.Type = &typeVar + } + } + } + + return nil +} + +// ADLSGen1FileProperties properties of the ADLS Gen1 file data set. +type ADLSGen1FileProperties struct { + // AccountName - The ADLS account name. + AccountName *string `json:"accountName,omitempty"` + // 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"` + // FolderPath - The folder path within the ADLS account. + FolderPath *string `json:"folderPath,omitempty"` + // ResourceGroup - Resource group of ADLS account. + ResourceGroup *string `json:"resourceGroup,omitempty"` + // SubscriptionID - Subscription id of ADLS account. + SubscriptionID *string `json:"subscriptionId,omitempty"` +} + +// ADLSGen1FolderDataSet an ADLS Gen 1 folder data set. +type ADLSGen1FolderDataSet struct { + // ADLSGen1FolderProperties - ADLS Gen 1 folder data set properties. + *ADLSGen1FolderProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindKustoCluster', 'KindKustoDatabase', '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 ADLSGen1FolderDataSet. +func (ag1fds ADLSGen1FolderDataSet) MarshalJSON() ([]byte, error) { + ag1fds.Kind = KindAdlsGen1Folder + objectMap := make(map[string]interface{}) + if ag1fds.ADLSGen1FolderProperties != nil { + objectMap["properties"] = ag1fds.ADLSGen1FolderProperties + } + if ag1fds.Kind != "" { + objectMap["kind"] = ag1fds.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSet is the BasicDataSet implementation for ADLSGen1FolderDataSet. +func (ag1fds ADLSGen1FolderDataSet) AsBlobDataSet() (*BlobDataSet, bool) { + return nil, false +} + +// AsBlobFolderDataSet is the BasicDataSet implementation for ADLSGen1FolderDataSet. +func (ag1fds ADLSGen1FolderDataSet) AsBlobFolderDataSet() (*BlobFolderDataSet, bool) { + return nil, false +} + +// AsBlobContainerDataSet is the BasicDataSet implementation for ADLSGen1FolderDataSet. +func (ag1fds ADLSGen1FolderDataSet) AsBlobContainerDataSet() (*BlobContainerDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileDataSet is the BasicDataSet implementation for ADLSGen1FolderDataSet. +func (ag1fds ADLSGen1FolderDataSet) AsADLSGen2FileDataSet() (*ADLSGen2FileDataSet, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSet is the BasicDataSet implementation for ADLSGen1FolderDataSet. +func (ag1fds ADLSGen1FolderDataSet) AsADLSGen2FolderDataSet() (*ADLSGen2FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSet is the BasicDataSet implementation for ADLSGen1FolderDataSet. +func (ag1fds ADLSGen1FolderDataSet) AsADLSGen2FileSystemDataSet() (*ADLSGen2FileSystemDataSet, bool) { + return nil, false +} + +// AsADLSGen1FolderDataSet is the BasicDataSet implementation for ADLSGen1FolderDataSet. +func (ag1fds ADLSGen1FolderDataSet) AsADLSGen1FolderDataSet() (*ADLSGen1FolderDataSet, bool) { + return &ag1fds, true +} + +// AsADLSGen1FileDataSet is the BasicDataSet implementation for ADLSGen1FolderDataSet. +func (ag1fds ADLSGen1FolderDataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, bool) { + return nil, false +} + +// AsKustoClusterDataSet is the BasicDataSet implementation for ADLSGen1FolderDataSet. +func (ag1fds ADLSGen1FolderDataSet) AsKustoClusterDataSet() (*KustoClusterDataSet, bool) { + return nil, false +} + +// AsKustoDatabaseDataSet is the BasicDataSet implementation for ADLSGen1FolderDataSet. +func (ag1fds ADLSGen1FolderDataSet) AsKustoDatabaseDataSet() (*KustoDatabaseDataSet, bool) { + 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 +} + +// AsBasicDataSet is the BasicDataSet implementation for ADLSGen1FolderDataSet. +func (ag1fds ADLSGen1FolderDataSet) AsBasicDataSet() (BasicDataSet, bool) { + return &ag1fds, true +} + +// UnmarshalJSON is the custom unmarshaler for ADLSGen1FolderDataSet struct. +func (ag1fds *ADLSGen1FolderDataSet) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var aDLSGen1FolderProperties ADLSGen1FolderProperties + err = json.Unmarshal(*v, &aDLSGen1FolderProperties) + if err != nil { + return err + } + ag1fds.ADLSGen1FolderProperties = &aDLSGen1FolderProperties + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ag1fds.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ag1fds.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ag1fds.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ag1fds.Type = &typeVar + } + } + } + + return nil +} + +// ADLSGen1FolderProperties properties of the ADLS Gen1 folder data set. +type ADLSGen1FolderProperties struct { + // AccountName - The ADLS account name. + AccountName *string `json:"accountName,omitempty"` + // 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"` + // ResourceGroup - Resource group of ADLS account. + ResourceGroup *string `json:"resourceGroup,omitempty"` + // SubscriptionID - Subscription id of ADLS account. + SubscriptionID *string `json:"subscriptionId,omitempty"` +} + +// ADLSGen2FileDataSet an ADLS Gen 2 file data set. +type ADLSGen2FileDataSet struct { + // ADLSGen2FileProperties - ADLS Gen 2 file data set properties. + *ADLSGen2FileProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindKustoCluster', 'KindKustoDatabase', '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 ADLSGen2FileDataSet. +func (ag2fds ADLSGen2FileDataSet) MarshalJSON() ([]byte, error) { + ag2fds.Kind = KindAdlsGen2File + objectMap := make(map[string]interface{}) + if ag2fds.ADLSGen2FileProperties != nil { + objectMap["properties"] = ag2fds.ADLSGen2FileProperties + } + if ag2fds.Kind != "" { + objectMap["kind"] = ag2fds.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSet is the BasicDataSet implementation for ADLSGen2FileDataSet. +func (ag2fds ADLSGen2FileDataSet) AsBlobDataSet() (*BlobDataSet, bool) { + return nil, false +} + +// AsBlobFolderDataSet is the BasicDataSet implementation for ADLSGen2FileDataSet. +func (ag2fds ADLSGen2FileDataSet) AsBlobFolderDataSet() (*BlobFolderDataSet, bool) { + return nil, false +} + +// AsBlobContainerDataSet is the BasicDataSet implementation for ADLSGen2FileDataSet. +func (ag2fds ADLSGen2FileDataSet) AsBlobContainerDataSet() (*BlobContainerDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileDataSet is the BasicDataSet implementation for ADLSGen2FileDataSet. +func (ag2fds ADLSGen2FileDataSet) AsADLSGen2FileDataSet() (*ADLSGen2FileDataSet, bool) { + return &ag2fds, true +} + +// AsADLSGen2FolderDataSet is the BasicDataSet implementation for ADLSGen2FileDataSet. +func (ag2fds ADLSGen2FileDataSet) AsADLSGen2FolderDataSet() (*ADLSGen2FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSet is the BasicDataSet implementation for ADLSGen2FileDataSet. +func (ag2fds ADLSGen2FileDataSet) AsADLSGen2FileSystemDataSet() (*ADLSGen2FileSystemDataSet, bool) { + return nil, false +} + +// AsADLSGen1FolderDataSet is the BasicDataSet implementation for ADLSGen2FileDataSet. +func (ag2fds ADLSGen2FileDataSet) AsADLSGen1FolderDataSet() (*ADLSGen1FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen1FileDataSet is the BasicDataSet implementation for ADLSGen2FileDataSet. +func (ag2fds ADLSGen2FileDataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, bool) { + return nil, false +} + +// AsKustoClusterDataSet is the BasicDataSet implementation for ADLSGen2FileDataSet. +func (ag2fds ADLSGen2FileDataSet) AsKustoClusterDataSet() (*KustoClusterDataSet, bool) { + return nil, false +} + +// AsKustoDatabaseDataSet is the BasicDataSet implementation for ADLSGen2FileDataSet. +func (ag2fds ADLSGen2FileDataSet) AsKustoDatabaseDataSet() (*KustoDatabaseDataSet, bool) { + 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 +} + +// AsBasicDataSet is the BasicDataSet implementation for ADLSGen2FileDataSet. +func (ag2fds ADLSGen2FileDataSet) AsBasicDataSet() (BasicDataSet, bool) { + return &ag2fds, true +} + +// UnmarshalJSON is the custom unmarshaler for ADLSGen2FileDataSet struct. +func (ag2fds *ADLSGen2FileDataSet) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var aDLSGen2FileProperties ADLSGen2FileProperties + err = json.Unmarshal(*v, &aDLSGen2FileProperties) + if err != nil { + return err + } + ag2fds.ADLSGen2FileProperties = &aDLSGen2FileProperties + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ag2fds.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ag2fds.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ag2fds.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ag2fds.Type = &typeVar + } + } + } + + return nil +} + +// ADLSGen2FileDataSetMapping an ADLS Gen2 file data set mapping. +type ADLSGen2FileDataSetMapping struct { + // ADLSGen2FileDataSetMappingProperties - ADLS Gen2 file data set mapping properties. + *ADLSGen2FileDataSetMappingProperties `json:"properties,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"` + // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindKustoCluster', 'KindBasicDataSetMappingKindKustoDatabase', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' + Kind KindBasicDataSetMapping `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for ADLSGen2FileDataSetMapping. +func (ag2fdsm ADLSGen2FileDataSetMapping) MarshalJSON() ([]byte, error) { + ag2fdsm.Kind = KindBasicDataSetMappingKindAdlsGen2File + objectMap := make(map[string]interface{}) + if ag2fdsm.ADLSGen2FileDataSetMappingProperties != nil { + objectMap["properties"] = ag2fdsm.ADLSGen2FileDataSetMappingProperties + } + if ag2fdsm.Kind != "" { + objectMap["kind"] = ag2fdsm.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileDataSetMapping. +func (ag2fdsm ADLSGen2FileDataSetMapping) AsBlobDataSetMapping() (*BlobDataSetMapping, bool) { + return nil, false +} + +// AsBlobFolderDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileDataSetMapping. +func (ag2fdsm ADLSGen2FileDataSetMapping) AsBlobFolderDataSetMapping() (*BlobFolderDataSetMapping, bool) { + return nil, false +} + +// AsBlobContainerDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileDataSetMapping. +func (ag2fdsm ADLSGen2FileDataSetMapping) AsBlobContainerDataSetMapping() (*BlobContainerDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FileDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileDataSetMapping. +func (ag2fdsm ADLSGen2FileDataSetMapping) AsADLSGen2FileDataSetMapping() (*ADLSGen2FileDataSetMapping, bool) { + return &ag2fdsm, true +} + +// AsADLSGen2FolderDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileDataSetMapping. +func (ag2fdsm ADLSGen2FileDataSetMapping) AsADLSGen2FolderDataSetMapping() (*ADLSGen2FolderDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileDataSetMapping. +func (ag2fdsm ADLSGen2FileDataSetMapping) AsADLSGen2FileSystemDataSetMapping() (*ADLSGen2FileSystemDataSetMapping, bool) { + return nil, false +} + +// AsKustoClusterDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileDataSetMapping. +func (ag2fdsm ADLSGen2FileDataSetMapping) AsKustoClusterDataSetMapping() (*KustoClusterDataSetMapping, bool) { + return nil, false +} + +// AsKustoDatabaseDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileDataSetMapping. +func (ag2fdsm ADLSGen2FileDataSetMapping) AsKustoDatabaseDataSetMapping() (*KustoDatabaseDataSetMapping, bool) { + 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 +} + +// AsBasicDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileDataSetMapping. +func (ag2fdsm ADLSGen2FileDataSetMapping) AsBasicDataSetMapping() (BasicDataSetMapping, bool) { + return &ag2fdsm, true +} + +// UnmarshalJSON is the custom unmarshaler for ADLSGen2FileDataSetMapping struct. +func (ag2fdsm *ADLSGen2FileDataSetMapping) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var aDLSGen2FileDataSetMappingProperties ADLSGen2FileDataSetMappingProperties + err = json.Unmarshal(*v, &aDLSGen2FileDataSetMappingProperties) + if err != nil { + return err + } + ag2fdsm.ADLSGen2FileDataSetMappingProperties = &aDLSGen2FileDataSetMappingProperties + } + case "kind": + if v != nil { + var kind KindBasicDataSetMapping + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ag2fdsm.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ag2fdsm.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ag2fdsm.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ag2fdsm.Type = &typeVar + } + } + } + + return nil +} + +// ADLSGen2FileDataSetMappingProperties ADLS Gen 2 file data set mapping property bag. +type ADLSGen2FileDataSetMappingProperties struct { + // DataSetID - The id of the source data set. + DataSetID *string `json:"dataSetId,omitempty"` + // DataSetMappingStatus - READ-ONLY; Gets the status of the data set mapping. Possible values include: 'Ok', 'Broken' + DataSetMappingStatus DataSetMappingStatus `json:"dataSetMappingStatus,omitempty"` + // FilePath - File path within the file system. + 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"` + // ProvisioningState - READ-ONLY; Provisioning state of the data set mapping. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // ResourceGroup - Resource group of storage account. + ResourceGroup *string `json:"resourceGroup,omitempty"` + // StorageAccountName - Storage account name of the source data set. + StorageAccountName *string `json:"storageAccountName,omitempty"` + // SubscriptionID - Subscription id of storage account. + SubscriptionID *string `json:"subscriptionId,omitempty"` +} + +// ADLSGen2FileProperties properties of the ADLS Gen2 file data set. +type ADLSGen2FileProperties struct { + // 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"` + // FileSystem - File system to which the file belongs. + FileSystem *string `json:"fileSystem,omitempty"` + // ResourceGroup - Resource group of storage account + ResourceGroup *string `json:"resourceGroup,omitempty"` + // StorageAccountName - Storage account name of the source data set + StorageAccountName *string `json:"storageAccountName,omitempty"` + // SubscriptionID - Subscription id of storage account + SubscriptionID *string `json:"subscriptionId,omitempty"` +} + +// ADLSGen2FileSystemDataSet an ADLS Gen 2 file system data set. +type ADLSGen2FileSystemDataSet struct { + // ADLSGen2FileSystemProperties - ADLS Gen 2 file system data set properties. + *ADLSGen2FileSystemProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindKustoCluster', 'KindKustoDatabase', '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 ADLSGen2FileSystemDataSet. +func (ag2fsds ADLSGen2FileSystemDataSet) MarshalJSON() ([]byte, error) { + ag2fsds.Kind = KindAdlsGen2FileSystem + objectMap := make(map[string]interface{}) + if ag2fsds.ADLSGen2FileSystemProperties != nil { + objectMap["properties"] = ag2fsds.ADLSGen2FileSystemProperties + } + if ag2fsds.Kind != "" { + objectMap["kind"] = ag2fsds.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSet is the BasicDataSet implementation for ADLSGen2FileSystemDataSet. +func (ag2fsds ADLSGen2FileSystemDataSet) AsBlobDataSet() (*BlobDataSet, bool) { + return nil, false +} + +// AsBlobFolderDataSet is the BasicDataSet implementation for ADLSGen2FileSystemDataSet. +func (ag2fsds ADLSGen2FileSystemDataSet) AsBlobFolderDataSet() (*BlobFolderDataSet, bool) { + return nil, false +} + +// AsBlobContainerDataSet is the BasicDataSet implementation for ADLSGen2FileSystemDataSet. +func (ag2fsds ADLSGen2FileSystemDataSet) AsBlobContainerDataSet() (*BlobContainerDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileDataSet is the BasicDataSet implementation for ADLSGen2FileSystemDataSet. +func (ag2fsds ADLSGen2FileSystemDataSet) AsADLSGen2FileDataSet() (*ADLSGen2FileDataSet, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSet is the BasicDataSet implementation for ADLSGen2FileSystemDataSet. +func (ag2fsds ADLSGen2FileSystemDataSet) AsADLSGen2FolderDataSet() (*ADLSGen2FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSet is the BasicDataSet implementation for ADLSGen2FileSystemDataSet. +func (ag2fsds ADLSGen2FileSystemDataSet) AsADLSGen2FileSystemDataSet() (*ADLSGen2FileSystemDataSet, bool) { + return &ag2fsds, true +} + +// AsADLSGen1FolderDataSet is the BasicDataSet implementation for ADLSGen2FileSystemDataSet. +func (ag2fsds ADLSGen2FileSystemDataSet) AsADLSGen1FolderDataSet() (*ADLSGen1FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen1FileDataSet is the BasicDataSet implementation for ADLSGen2FileSystemDataSet. +func (ag2fsds ADLSGen2FileSystemDataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, bool) { + return nil, false +} + +// AsKustoClusterDataSet is the BasicDataSet implementation for ADLSGen2FileSystemDataSet. +func (ag2fsds ADLSGen2FileSystemDataSet) AsKustoClusterDataSet() (*KustoClusterDataSet, bool) { + return nil, false +} + +// AsKustoDatabaseDataSet is the BasicDataSet implementation for ADLSGen2FileSystemDataSet. +func (ag2fsds ADLSGen2FileSystemDataSet) AsKustoDatabaseDataSet() (*KustoDatabaseDataSet, bool) { + 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 +} + +// AsBasicDataSet is the BasicDataSet implementation for ADLSGen2FileSystemDataSet. +func (ag2fsds ADLSGen2FileSystemDataSet) AsBasicDataSet() (BasicDataSet, bool) { + return &ag2fsds, true +} + +// UnmarshalJSON is the custom unmarshaler for ADLSGen2FileSystemDataSet struct. +func (ag2fsds *ADLSGen2FileSystemDataSet) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var aDLSGen2FileSystemProperties ADLSGen2FileSystemProperties + err = json.Unmarshal(*v, &aDLSGen2FileSystemProperties) + if err != nil { + return err + } + ag2fsds.ADLSGen2FileSystemProperties = &aDLSGen2FileSystemProperties + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ag2fsds.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ag2fsds.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ag2fsds.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ag2fsds.Type = &typeVar + } + } + } + + return nil +} + +// ADLSGen2FileSystemDataSetMapping an ADLS Gen2 file system data set mapping. +type ADLSGen2FileSystemDataSetMapping struct { + // ADLSGen2FileSystemDataSetMappingProperties - ADLS Gen2 file system data set mapping properties. + *ADLSGen2FileSystemDataSetMappingProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindKustoCluster', 'KindBasicDataSetMappingKindKustoDatabase', '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 ADLSGen2FileSystemDataSetMapping. +func (ag2fsdsm ADLSGen2FileSystemDataSetMapping) MarshalJSON() ([]byte, error) { + ag2fsdsm.Kind = KindBasicDataSetMappingKindAdlsGen2FileSystem + objectMap := make(map[string]interface{}) + if ag2fsdsm.ADLSGen2FileSystemDataSetMappingProperties != nil { + objectMap["properties"] = ag2fsdsm.ADLSGen2FileSystemDataSetMappingProperties + } + if ag2fsdsm.Kind != "" { + objectMap["kind"] = ag2fsdsm.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileSystemDataSetMapping. +func (ag2fsdsm ADLSGen2FileSystemDataSetMapping) AsBlobDataSetMapping() (*BlobDataSetMapping, bool) { + return nil, false +} + +// AsBlobFolderDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileSystemDataSetMapping. +func (ag2fsdsm ADLSGen2FileSystemDataSetMapping) AsBlobFolderDataSetMapping() (*BlobFolderDataSetMapping, bool) { + return nil, false +} + +// AsBlobContainerDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileSystemDataSetMapping. +func (ag2fsdsm ADLSGen2FileSystemDataSetMapping) AsBlobContainerDataSetMapping() (*BlobContainerDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FileDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileSystemDataSetMapping. +func (ag2fsdsm ADLSGen2FileSystemDataSetMapping) AsADLSGen2FileDataSetMapping() (*ADLSGen2FileDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileSystemDataSetMapping. +func (ag2fsdsm ADLSGen2FileSystemDataSetMapping) AsADLSGen2FolderDataSetMapping() (*ADLSGen2FolderDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileSystemDataSetMapping. +func (ag2fsdsm ADLSGen2FileSystemDataSetMapping) AsADLSGen2FileSystemDataSetMapping() (*ADLSGen2FileSystemDataSetMapping, bool) { + return &ag2fsdsm, true +} + +// AsKustoClusterDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileSystemDataSetMapping. +func (ag2fsdsm ADLSGen2FileSystemDataSetMapping) AsKustoClusterDataSetMapping() (*KustoClusterDataSetMapping, bool) { + return nil, false +} + +// AsKustoDatabaseDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileSystemDataSetMapping. +func (ag2fsdsm ADLSGen2FileSystemDataSetMapping) AsKustoDatabaseDataSetMapping() (*KustoDatabaseDataSetMapping, bool) { + return nil, false +} + +// 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 +} + +// AsBasicDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileSystemDataSetMapping. +func (ag2fsdsm ADLSGen2FileSystemDataSetMapping) AsBasicDataSetMapping() (BasicDataSetMapping, bool) { + return &ag2fsdsm, true +} + +// UnmarshalJSON is the custom unmarshaler for ADLSGen2FileSystemDataSetMapping struct. +func (ag2fsdsm *ADLSGen2FileSystemDataSetMapping) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var aDLSGen2FileSystemDataSetMappingProperties ADLSGen2FileSystemDataSetMappingProperties + err = json.Unmarshal(*v, &aDLSGen2FileSystemDataSetMappingProperties) + if err != nil { + return err + } + ag2fsdsm.ADLSGen2FileSystemDataSetMappingProperties = &aDLSGen2FileSystemDataSetMappingProperties + } + case "kind": + if v != nil { + var kind KindBasicDataSetMapping + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ag2fsdsm.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ag2fsdsm.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ag2fsdsm.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ag2fsdsm.Type = &typeVar + } + } + } + + return nil +} + +// ADLSGen2FileSystemDataSetMappingProperties ADLS Gen 2 file system data set mapping property bag. +type ADLSGen2FileSystemDataSetMappingProperties struct { + // DataSetID - The id of the source data set. + DataSetID *string `json:"dataSetId,omitempty"` + // DataSetMappingStatus - READ-ONLY; Gets the status of the data set mapping. Possible values include: 'Ok', 'Broken' + DataSetMappingStatus DataSetMappingStatus `json:"dataSetMappingStatus,omitempty"` + // FileSystem - The file system name. + FileSystem *string `json:"fileSystem,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the data set mapping. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // ResourceGroup - Resource group of storage account. + ResourceGroup *string `json:"resourceGroup,omitempty"` + // StorageAccountName - Storage account name of the source data set. + StorageAccountName *string `json:"storageAccountName,omitempty"` + // SubscriptionID - Subscription id of storage account. + SubscriptionID *string `json:"subscriptionId,omitempty"` +} + +// ADLSGen2FileSystemProperties properties of the ADLS Gen2 file system data set. +type ADLSGen2FileSystemProperties struct { + // 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"` + // ResourceGroup - Resource group of storage account + ResourceGroup *string `json:"resourceGroup,omitempty"` + // StorageAccountName - Storage account name of the source data set + StorageAccountName *string `json:"storageAccountName,omitempty"` + // SubscriptionID - Subscription id of storage account + SubscriptionID *string `json:"subscriptionId,omitempty"` +} + +// ADLSGen2FolderDataSet an ADLS Gen 2 folder data set. +type ADLSGen2FolderDataSet struct { + // ADLSGen2FolderProperties - ADLS Gen 2 folder data set properties. + *ADLSGen2FolderProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindKustoCluster', 'KindKustoDatabase', '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 ADLSGen2FolderDataSet. +func (ag2fds ADLSGen2FolderDataSet) MarshalJSON() ([]byte, error) { + ag2fds.Kind = KindAdlsGen2Folder + objectMap := make(map[string]interface{}) + if ag2fds.ADLSGen2FolderProperties != nil { + objectMap["properties"] = ag2fds.ADLSGen2FolderProperties + } + if ag2fds.Kind != "" { + objectMap["kind"] = ag2fds.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSet is the BasicDataSet implementation for ADLSGen2FolderDataSet. +func (ag2fds ADLSGen2FolderDataSet) AsBlobDataSet() (*BlobDataSet, bool) { + return nil, false +} + +// AsBlobFolderDataSet is the BasicDataSet implementation for ADLSGen2FolderDataSet. +func (ag2fds ADLSGen2FolderDataSet) AsBlobFolderDataSet() (*BlobFolderDataSet, bool) { + return nil, false +} + +// AsBlobContainerDataSet is the BasicDataSet implementation for ADLSGen2FolderDataSet. +func (ag2fds ADLSGen2FolderDataSet) AsBlobContainerDataSet() (*BlobContainerDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileDataSet is the BasicDataSet implementation for ADLSGen2FolderDataSet. +func (ag2fds ADLSGen2FolderDataSet) AsADLSGen2FileDataSet() (*ADLSGen2FileDataSet, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSet is the BasicDataSet implementation for ADLSGen2FolderDataSet. +func (ag2fds ADLSGen2FolderDataSet) AsADLSGen2FolderDataSet() (*ADLSGen2FolderDataSet, bool) { + return &ag2fds, true +} + +// AsADLSGen2FileSystemDataSet is the BasicDataSet implementation for ADLSGen2FolderDataSet. +func (ag2fds ADLSGen2FolderDataSet) AsADLSGen2FileSystemDataSet() (*ADLSGen2FileSystemDataSet, bool) { + return nil, false +} + +// AsADLSGen1FolderDataSet is the BasicDataSet implementation for ADLSGen2FolderDataSet. +func (ag2fds ADLSGen2FolderDataSet) AsADLSGen1FolderDataSet() (*ADLSGen1FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen1FileDataSet is the BasicDataSet implementation for ADLSGen2FolderDataSet. +func (ag2fds ADLSGen2FolderDataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, bool) { + return nil, false +} + +// AsKustoClusterDataSet is the BasicDataSet implementation for ADLSGen2FolderDataSet. +func (ag2fds ADLSGen2FolderDataSet) AsKustoClusterDataSet() (*KustoClusterDataSet, bool) { + return nil, false +} + +// AsKustoDatabaseDataSet is the BasicDataSet implementation for ADLSGen2FolderDataSet. +func (ag2fds ADLSGen2FolderDataSet) AsKustoDatabaseDataSet() (*KustoDatabaseDataSet, bool) { + 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 +} + +// AsBasicDataSet is the BasicDataSet implementation for ADLSGen2FolderDataSet. +func (ag2fds ADLSGen2FolderDataSet) AsBasicDataSet() (BasicDataSet, bool) { + return &ag2fds, true +} + +// UnmarshalJSON is the custom unmarshaler for ADLSGen2FolderDataSet struct. +func (ag2fds *ADLSGen2FolderDataSet) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var aDLSGen2FolderProperties ADLSGen2FolderProperties + err = json.Unmarshal(*v, &aDLSGen2FolderProperties) + if err != nil { + return err + } + ag2fds.ADLSGen2FolderProperties = &aDLSGen2FolderProperties + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ag2fds.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ag2fds.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ag2fds.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ag2fds.Type = &typeVar + } + } + } + + return nil +} + +// ADLSGen2FolderDataSetMapping an ADLS Gen2 folder data set mapping. +type ADLSGen2FolderDataSetMapping struct { + // ADLSGen2FolderDataSetMappingProperties - ADLS Gen2 folder data set mapping properties. + *ADLSGen2FolderDataSetMappingProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindKustoCluster', 'KindBasicDataSetMappingKindKustoDatabase', '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 ADLSGen2FolderDataSetMapping. +func (ag2fdsm ADLSGen2FolderDataSetMapping) MarshalJSON() ([]byte, error) { + ag2fdsm.Kind = KindBasicDataSetMappingKindAdlsGen2Folder + objectMap := make(map[string]interface{}) + if ag2fdsm.ADLSGen2FolderDataSetMappingProperties != nil { + objectMap["properties"] = ag2fdsm.ADLSGen2FolderDataSetMappingProperties + } + if ag2fdsm.Kind != "" { + objectMap["kind"] = ag2fdsm.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FolderDataSetMapping. +func (ag2fdsm ADLSGen2FolderDataSetMapping) AsBlobDataSetMapping() (*BlobDataSetMapping, bool) { + return nil, false +} + +// AsBlobFolderDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FolderDataSetMapping. +func (ag2fdsm ADLSGen2FolderDataSetMapping) AsBlobFolderDataSetMapping() (*BlobFolderDataSetMapping, bool) { + return nil, false +} + +// AsBlobContainerDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FolderDataSetMapping. +func (ag2fdsm ADLSGen2FolderDataSetMapping) AsBlobContainerDataSetMapping() (*BlobContainerDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FileDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FolderDataSetMapping. +func (ag2fdsm ADLSGen2FolderDataSetMapping) AsADLSGen2FileDataSetMapping() (*ADLSGen2FileDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FolderDataSetMapping. +func (ag2fdsm ADLSGen2FolderDataSetMapping) AsADLSGen2FolderDataSetMapping() (*ADLSGen2FolderDataSetMapping, bool) { + return &ag2fdsm, true +} + +// AsADLSGen2FileSystemDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FolderDataSetMapping. +func (ag2fdsm ADLSGen2FolderDataSetMapping) AsADLSGen2FileSystemDataSetMapping() (*ADLSGen2FileSystemDataSetMapping, bool) { + return nil, false +} + +// AsKustoClusterDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FolderDataSetMapping. +func (ag2fdsm ADLSGen2FolderDataSetMapping) AsKustoClusterDataSetMapping() (*KustoClusterDataSetMapping, bool) { + return nil, false +} + +// AsKustoDatabaseDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FolderDataSetMapping. +func (ag2fdsm ADLSGen2FolderDataSetMapping) AsKustoDatabaseDataSetMapping() (*KustoDatabaseDataSetMapping, bool) { + 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 +} + +// AsBasicDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FolderDataSetMapping. +func (ag2fdsm ADLSGen2FolderDataSetMapping) AsBasicDataSetMapping() (BasicDataSetMapping, bool) { + return &ag2fdsm, true +} + +// UnmarshalJSON is the custom unmarshaler for ADLSGen2FolderDataSetMapping struct. +func (ag2fdsm *ADLSGen2FolderDataSetMapping) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var aDLSGen2FolderDataSetMappingProperties ADLSGen2FolderDataSetMappingProperties + err = json.Unmarshal(*v, &aDLSGen2FolderDataSetMappingProperties) + if err != nil { + return err + } + ag2fdsm.ADLSGen2FolderDataSetMappingProperties = &aDLSGen2FolderDataSetMappingProperties + } + case "kind": + if v != nil { + var kind KindBasicDataSetMapping + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ag2fdsm.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ag2fdsm.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ag2fdsm.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ag2fdsm.Type = &typeVar + } + } + } + + return nil +} + +// ADLSGen2FolderDataSetMappingProperties ADLS Gen 2 folder data set mapping property bag. +type ADLSGen2FolderDataSetMappingProperties struct { + // DataSetID - The id of the source data set. + DataSetID *string `json:"dataSetId,omitempty"` + // DataSetMappingStatus - READ-ONLY; Gets the status of the data set mapping. Possible values include: 'Ok', 'Broken' + DataSetMappingStatus DataSetMappingStatus `json:"dataSetMappingStatus,omitempty"` + // FileSystem - File system to which the folder belongs. + FileSystem *string `json:"fileSystem,omitempty"` + // FolderPath - Folder path within the file system. + FolderPath *string `json:"folderPath,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the data set mapping. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // ResourceGroup - Resource group of storage account. + ResourceGroup *string `json:"resourceGroup,omitempty"` + // StorageAccountName - Storage account name of the source data set. + StorageAccountName *string `json:"storageAccountName,omitempty"` + // SubscriptionID - Subscription id of storage account. + SubscriptionID *string `json:"subscriptionId,omitempty"` +} + +// ADLSGen2FolderProperties properties of the ADLS Gen2 folder data set. +type ADLSGen2FolderProperties struct { + // 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"` + // FolderPath - Folder path within the file system. + FolderPath *string `json:"folderPath,omitempty"` + // ResourceGroup - Resource group of storage account + ResourceGroup *string `json:"resourceGroup,omitempty"` + // StorageAccountName - Storage account name of the source data set + StorageAccountName *string `json:"storageAccountName,omitempty"` + // SubscriptionID - Subscription id of storage account + SubscriptionID *string `json:"subscriptionId,omitempty"` +} + +// BlobContainerDataSet an Azure storage blob container data set. +type BlobContainerDataSet struct { + // BlobContainerProperties - Blob container data set properties. + *BlobContainerProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindKustoCluster', 'KindKustoDatabase', '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 BlobContainerDataSet. +func (bcds BlobContainerDataSet) MarshalJSON() ([]byte, error) { + bcds.Kind = KindContainer + objectMap := make(map[string]interface{}) + if bcds.BlobContainerProperties != nil { + objectMap["properties"] = bcds.BlobContainerProperties + } + if bcds.Kind != "" { + objectMap["kind"] = bcds.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSet is the BasicDataSet implementation for BlobContainerDataSet. +func (bcds BlobContainerDataSet) AsBlobDataSet() (*BlobDataSet, bool) { + return nil, false +} + +// AsBlobFolderDataSet is the BasicDataSet implementation for BlobContainerDataSet. +func (bcds BlobContainerDataSet) AsBlobFolderDataSet() (*BlobFolderDataSet, bool) { + return nil, false +} + +// AsBlobContainerDataSet is the BasicDataSet implementation for BlobContainerDataSet. +func (bcds BlobContainerDataSet) AsBlobContainerDataSet() (*BlobContainerDataSet, bool) { + return &bcds, true +} + +// AsADLSGen2FileDataSet is the BasicDataSet implementation for BlobContainerDataSet. +func (bcds BlobContainerDataSet) AsADLSGen2FileDataSet() (*ADLSGen2FileDataSet, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSet is the BasicDataSet implementation for BlobContainerDataSet. +func (bcds BlobContainerDataSet) AsADLSGen2FolderDataSet() (*ADLSGen2FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSet is the BasicDataSet implementation for BlobContainerDataSet. +func (bcds BlobContainerDataSet) AsADLSGen2FileSystemDataSet() (*ADLSGen2FileSystemDataSet, bool) { + return nil, false +} + +// AsADLSGen1FolderDataSet is the BasicDataSet implementation for BlobContainerDataSet. +func (bcds BlobContainerDataSet) AsADLSGen1FolderDataSet() (*ADLSGen1FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen1FileDataSet is the BasicDataSet implementation for BlobContainerDataSet. +func (bcds BlobContainerDataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, bool) { + return nil, false +} + +// AsKustoClusterDataSet is the BasicDataSet implementation for BlobContainerDataSet. +func (bcds BlobContainerDataSet) AsKustoClusterDataSet() (*KustoClusterDataSet, bool) { + return nil, false +} + +// AsKustoDatabaseDataSet is the BasicDataSet implementation for BlobContainerDataSet. +func (bcds BlobContainerDataSet) AsKustoDatabaseDataSet() (*KustoDatabaseDataSet, bool) { + 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 +} + +// AsBasicDataSet is the BasicDataSet implementation for BlobContainerDataSet. +func (bcds BlobContainerDataSet) AsBasicDataSet() (BasicDataSet, bool) { + return &bcds, true +} + +// UnmarshalJSON is the custom unmarshaler for BlobContainerDataSet struct. +func (bcds *BlobContainerDataSet) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var blobContainerProperties BlobContainerProperties + err = json.Unmarshal(*v, &blobContainerProperties) + if err != nil { + return err + } + bcds.BlobContainerProperties = &blobContainerProperties + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + bcds.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + bcds.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + bcds.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + bcds.Type = &typeVar + } + } + } + + return nil +} + +// BlobContainerDataSetMapping a Blob container data set mapping. +type BlobContainerDataSetMapping struct { + // BlobContainerMappingProperties - Blob container data set mapping properties. + *BlobContainerMappingProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindKustoCluster', 'KindBasicDataSetMappingKindKustoDatabase', '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 BlobContainerDataSetMapping. +func (bcdsm BlobContainerDataSetMapping) MarshalJSON() ([]byte, error) { + bcdsm.Kind = KindBasicDataSetMappingKindContainer + objectMap := make(map[string]interface{}) + if bcdsm.BlobContainerMappingProperties != nil { + objectMap["properties"] = bcdsm.BlobContainerMappingProperties + } + if bcdsm.Kind != "" { + objectMap["kind"] = bcdsm.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSetMapping is the BasicDataSetMapping implementation for BlobContainerDataSetMapping. +func (bcdsm BlobContainerDataSetMapping) AsBlobDataSetMapping() (*BlobDataSetMapping, bool) { + return nil, false +} + +// AsBlobFolderDataSetMapping is the BasicDataSetMapping implementation for BlobContainerDataSetMapping. +func (bcdsm BlobContainerDataSetMapping) AsBlobFolderDataSetMapping() (*BlobFolderDataSetMapping, bool) { + return nil, false +} + +// AsBlobContainerDataSetMapping is the BasicDataSetMapping implementation for BlobContainerDataSetMapping. +func (bcdsm BlobContainerDataSetMapping) AsBlobContainerDataSetMapping() (*BlobContainerDataSetMapping, bool) { + return &bcdsm, true +} + +// AsADLSGen2FileDataSetMapping is the BasicDataSetMapping implementation for BlobContainerDataSetMapping. +func (bcdsm BlobContainerDataSetMapping) AsADLSGen2FileDataSetMapping() (*ADLSGen2FileDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSetMapping is the BasicDataSetMapping implementation for BlobContainerDataSetMapping. +func (bcdsm BlobContainerDataSetMapping) AsADLSGen2FolderDataSetMapping() (*ADLSGen2FolderDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSetMapping is the BasicDataSetMapping implementation for BlobContainerDataSetMapping. +func (bcdsm BlobContainerDataSetMapping) AsADLSGen2FileSystemDataSetMapping() (*ADLSGen2FileSystemDataSetMapping, bool) { + return nil, false +} + +// AsKustoClusterDataSetMapping is the BasicDataSetMapping implementation for BlobContainerDataSetMapping. +func (bcdsm BlobContainerDataSetMapping) AsKustoClusterDataSetMapping() (*KustoClusterDataSetMapping, bool) { + return nil, false +} + +// AsKustoDatabaseDataSetMapping is the BasicDataSetMapping implementation for BlobContainerDataSetMapping. +func (bcdsm BlobContainerDataSetMapping) AsKustoDatabaseDataSetMapping() (*KustoDatabaseDataSetMapping, bool) { + 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 +} + +// AsBasicDataSetMapping is the BasicDataSetMapping implementation for BlobContainerDataSetMapping. +func (bcdsm BlobContainerDataSetMapping) AsBasicDataSetMapping() (BasicDataSetMapping, bool) { + return &bcdsm, true +} + +// UnmarshalJSON is the custom unmarshaler for BlobContainerDataSetMapping struct. +func (bcdsm *BlobContainerDataSetMapping) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var blobContainerMappingProperties BlobContainerMappingProperties + err = json.Unmarshal(*v, &blobContainerMappingProperties) + if err != nil { + return err + } + bcdsm.BlobContainerMappingProperties = &blobContainerMappingProperties + } + case "kind": + if v != nil { + var kind KindBasicDataSetMapping + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + bcdsm.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + bcdsm.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + bcdsm.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + bcdsm.Type = &typeVar + } + } + } + + return nil +} + +// BlobContainerMappingProperties azure storage Blob container data set mapping property bag. +type BlobContainerMappingProperties struct { + // ContainerName - BLOB Container name. + ContainerName *string `json:"containerName,omitempty"` + // DataSetID - The id of the source data set. + DataSetID *string `json:"dataSetId,omitempty"` + // DataSetMappingStatus - READ-ONLY; Gets the status of the data set mapping. Possible values include: 'Ok', 'Broken' + DataSetMappingStatus DataSetMappingStatus `json:"dataSetMappingStatus,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the data set mapping. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // ResourceGroup - Resource group of storage account. + ResourceGroup *string `json:"resourceGroup,omitempty"` + // StorageAccountName - Storage account name of the source data set. + StorageAccountName *string `json:"storageAccountName,omitempty"` + // SubscriptionID - Subscription id of storage account. + SubscriptionID *string `json:"subscriptionId,omitempty"` +} + +// BlobContainerProperties properties of the BLOB container data set. +type BlobContainerProperties struct { + // ContainerName - BLOB Container name. + ContainerName *string `json:"containerName,omitempty"` + // 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"` + // StorageAccountName - Storage account name of the source data set + StorageAccountName *string `json:"storageAccountName,omitempty"` + // SubscriptionID - Subscription id of storage account + SubscriptionID *string `json:"subscriptionId,omitempty"` +} + +// BlobDataSet an Azure storage blob data set. +type BlobDataSet struct { + // BlobProperties - Blob data set properties. + *BlobProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindKustoCluster', 'KindKustoDatabase', '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 BlobDataSet. +func (bds BlobDataSet) MarshalJSON() ([]byte, error) { + bds.Kind = KindBlob + objectMap := make(map[string]interface{}) + if bds.BlobProperties != nil { + objectMap["properties"] = bds.BlobProperties + } + if bds.Kind != "" { + objectMap["kind"] = bds.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSet is the BasicDataSet implementation for BlobDataSet. +func (bds BlobDataSet) AsBlobDataSet() (*BlobDataSet, bool) { + return &bds, true +} + +// AsBlobFolderDataSet is the BasicDataSet implementation for BlobDataSet. +func (bds BlobDataSet) AsBlobFolderDataSet() (*BlobFolderDataSet, bool) { + return nil, false +} + +// AsBlobContainerDataSet is the BasicDataSet implementation for BlobDataSet. +func (bds BlobDataSet) AsBlobContainerDataSet() (*BlobContainerDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileDataSet is the BasicDataSet implementation for BlobDataSet. +func (bds BlobDataSet) AsADLSGen2FileDataSet() (*ADLSGen2FileDataSet, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSet is the BasicDataSet implementation for BlobDataSet. +func (bds BlobDataSet) AsADLSGen2FolderDataSet() (*ADLSGen2FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSet is the BasicDataSet implementation for BlobDataSet. +func (bds BlobDataSet) AsADLSGen2FileSystemDataSet() (*ADLSGen2FileSystemDataSet, bool) { + return nil, false +} + +// AsADLSGen1FolderDataSet is the BasicDataSet implementation for BlobDataSet. +func (bds BlobDataSet) AsADLSGen1FolderDataSet() (*ADLSGen1FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen1FileDataSet is the BasicDataSet implementation for BlobDataSet. +func (bds BlobDataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, bool) { + return nil, false +} + +// AsKustoClusterDataSet is the BasicDataSet implementation for BlobDataSet. +func (bds BlobDataSet) AsKustoClusterDataSet() (*KustoClusterDataSet, bool) { + return nil, false +} + +// AsKustoDatabaseDataSet is the BasicDataSet implementation for BlobDataSet. +func (bds BlobDataSet) AsKustoDatabaseDataSet() (*KustoDatabaseDataSet, 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 +} + +// AsBasicDataSet is the BasicDataSet implementation for BlobDataSet. +func (bds BlobDataSet) AsBasicDataSet() (BasicDataSet, bool) { + return &bds, true +} + +// UnmarshalJSON is the custom unmarshaler for BlobDataSet struct. +func (bds *BlobDataSet) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var blobProperties BlobProperties + err = json.Unmarshal(*v, &blobProperties) + if err != nil { + return err + } + bds.BlobProperties = &blobProperties + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + bds.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + bds.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + bds.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + bds.Type = &typeVar + } + } + } + + return nil +} + +// BlobDataSetMapping a Blob data set mapping. +type BlobDataSetMapping struct { + // BlobMappingProperties - Blob data set mapping properties. + *BlobMappingProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindKustoCluster', 'KindBasicDataSetMappingKindKustoDatabase', '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 BlobDataSetMapping. +func (bdsm BlobDataSetMapping) MarshalJSON() ([]byte, error) { + bdsm.Kind = KindBasicDataSetMappingKindBlob + objectMap := make(map[string]interface{}) + if bdsm.BlobMappingProperties != nil { + objectMap["properties"] = bdsm.BlobMappingProperties + } + if bdsm.Kind != "" { + objectMap["kind"] = bdsm.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSetMapping is the BasicDataSetMapping implementation for BlobDataSetMapping. +func (bdsm BlobDataSetMapping) AsBlobDataSetMapping() (*BlobDataSetMapping, bool) { + return &bdsm, true +} + +// AsBlobFolderDataSetMapping is the BasicDataSetMapping implementation for BlobDataSetMapping. +func (bdsm BlobDataSetMapping) AsBlobFolderDataSetMapping() (*BlobFolderDataSetMapping, bool) { + return nil, false +} + +// AsBlobContainerDataSetMapping is the BasicDataSetMapping implementation for BlobDataSetMapping. +func (bdsm BlobDataSetMapping) AsBlobContainerDataSetMapping() (*BlobContainerDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FileDataSetMapping is the BasicDataSetMapping implementation for BlobDataSetMapping. +func (bdsm BlobDataSetMapping) AsADLSGen2FileDataSetMapping() (*ADLSGen2FileDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSetMapping is the BasicDataSetMapping implementation for BlobDataSetMapping. +func (bdsm BlobDataSetMapping) AsADLSGen2FolderDataSetMapping() (*ADLSGen2FolderDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSetMapping is the BasicDataSetMapping implementation for BlobDataSetMapping. +func (bdsm BlobDataSetMapping) AsADLSGen2FileSystemDataSetMapping() (*ADLSGen2FileSystemDataSetMapping, bool) { + return nil, false +} + +// AsKustoClusterDataSetMapping is the BasicDataSetMapping implementation for BlobDataSetMapping. +func (bdsm BlobDataSetMapping) AsKustoClusterDataSetMapping() (*KustoClusterDataSetMapping, bool) { + return nil, false +} + +// AsKustoDatabaseDataSetMapping is the BasicDataSetMapping implementation for BlobDataSetMapping. +func (bdsm BlobDataSetMapping) AsKustoDatabaseDataSetMapping() (*KustoDatabaseDataSetMapping, bool) { + 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 +} + +// AsBasicDataSetMapping is the BasicDataSetMapping implementation for BlobDataSetMapping. +func (bdsm BlobDataSetMapping) AsBasicDataSetMapping() (BasicDataSetMapping, bool) { + return &bdsm, true +} + +// UnmarshalJSON is the custom unmarshaler for BlobDataSetMapping struct. +func (bdsm *BlobDataSetMapping) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var blobMappingProperties BlobMappingProperties + err = json.Unmarshal(*v, &blobMappingProperties) + if err != nil { + return err + } + bdsm.BlobMappingProperties = &blobMappingProperties + } + case "kind": + if v != nil { + var kind KindBasicDataSetMapping + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + bdsm.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + bdsm.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + bdsm.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + bdsm.Type = &typeVar + } + } + } + + return nil +} + +// BlobFolderDataSet an Azure storage blob folder data set. +type BlobFolderDataSet struct { + // BlobFolderProperties - Blob folder data set properties. + *BlobFolderProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindKustoCluster', 'KindKustoDatabase', '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 BlobFolderDataSet. +func (bfds BlobFolderDataSet) MarshalJSON() ([]byte, error) { + bfds.Kind = KindBlobFolder + objectMap := make(map[string]interface{}) + if bfds.BlobFolderProperties != nil { + objectMap["properties"] = bfds.BlobFolderProperties + } + if bfds.Kind != "" { + objectMap["kind"] = bfds.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSet is the BasicDataSet implementation for BlobFolderDataSet. +func (bfds BlobFolderDataSet) AsBlobDataSet() (*BlobDataSet, bool) { + return nil, false +} + +// AsBlobFolderDataSet is the BasicDataSet implementation for BlobFolderDataSet. +func (bfds BlobFolderDataSet) AsBlobFolderDataSet() (*BlobFolderDataSet, bool) { + return &bfds, true +} + +// AsBlobContainerDataSet is the BasicDataSet implementation for BlobFolderDataSet. +func (bfds BlobFolderDataSet) AsBlobContainerDataSet() (*BlobContainerDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileDataSet is the BasicDataSet implementation for BlobFolderDataSet. +func (bfds BlobFolderDataSet) AsADLSGen2FileDataSet() (*ADLSGen2FileDataSet, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSet is the BasicDataSet implementation for BlobFolderDataSet. +func (bfds BlobFolderDataSet) AsADLSGen2FolderDataSet() (*ADLSGen2FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSet is the BasicDataSet implementation for BlobFolderDataSet. +func (bfds BlobFolderDataSet) AsADLSGen2FileSystemDataSet() (*ADLSGen2FileSystemDataSet, bool) { + return nil, false +} + +// AsADLSGen1FolderDataSet is the BasicDataSet implementation for BlobFolderDataSet. +func (bfds BlobFolderDataSet) AsADLSGen1FolderDataSet() (*ADLSGen1FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen1FileDataSet is the BasicDataSet implementation for BlobFolderDataSet. +func (bfds BlobFolderDataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, bool) { + return nil, false +} + +// AsKustoClusterDataSet is the BasicDataSet implementation for BlobFolderDataSet. +func (bfds BlobFolderDataSet) AsKustoClusterDataSet() (*KustoClusterDataSet, bool) { + return nil, false +} + +// AsKustoDatabaseDataSet is the BasicDataSet implementation for BlobFolderDataSet. +func (bfds BlobFolderDataSet) AsKustoDatabaseDataSet() (*KustoDatabaseDataSet, bool) { + 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 +} + +// AsBasicDataSet is the BasicDataSet implementation for BlobFolderDataSet. +func (bfds BlobFolderDataSet) AsBasicDataSet() (BasicDataSet, bool) { + return &bfds, true +} + +// UnmarshalJSON is the custom unmarshaler for BlobFolderDataSet struct. +func (bfds *BlobFolderDataSet) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var blobFolderProperties BlobFolderProperties + err = json.Unmarshal(*v, &blobFolderProperties) + if err != nil { + return err + } + bfds.BlobFolderProperties = &blobFolderProperties + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + bfds.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + bfds.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + bfds.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + bfds.Type = &typeVar + } + } + } + + return nil +} + +// BlobFolderDataSetMapping a Blob folder data set mapping. +type BlobFolderDataSetMapping struct { + // BlobFolderMappingProperties - Blob folder data set mapping properties. + *BlobFolderMappingProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindKustoCluster', 'KindBasicDataSetMappingKindKustoDatabase', '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 BlobFolderDataSetMapping. +func (bfdsm BlobFolderDataSetMapping) MarshalJSON() ([]byte, error) { + bfdsm.Kind = KindBasicDataSetMappingKindBlobFolder + objectMap := make(map[string]interface{}) + if bfdsm.BlobFolderMappingProperties != nil { + objectMap["properties"] = bfdsm.BlobFolderMappingProperties + } + if bfdsm.Kind != "" { + objectMap["kind"] = bfdsm.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSetMapping is the BasicDataSetMapping implementation for BlobFolderDataSetMapping. +func (bfdsm BlobFolderDataSetMapping) AsBlobDataSetMapping() (*BlobDataSetMapping, bool) { + return nil, false +} + +// AsBlobFolderDataSetMapping is the BasicDataSetMapping implementation for BlobFolderDataSetMapping. +func (bfdsm BlobFolderDataSetMapping) AsBlobFolderDataSetMapping() (*BlobFolderDataSetMapping, bool) { + return &bfdsm, true +} + +// AsBlobContainerDataSetMapping is the BasicDataSetMapping implementation for BlobFolderDataSetMapping. +func (bfdsm BlobFolderDataSetMapping) AsBlobContainerDataSetMapping() (*BlobContainerDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FileDataSetMapping is the BasicDataSetMapping implementation for BlobFolderDataSetMapping. +func (bfdsm BlobFolderDataSetMapping) AsADLSGen2FileDataSetMapping() (*ADLSGen2FileDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSetMapping is the BasicDataSetMapping implementation for BlobFolderDataSetMapping. +func (bfdsm BlobFolderDataSetMapping) AsADLSGen2FolderDataSetMapping() (*ADLSGen2FolderDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSetMapping is the BasicDataSetMapping implementation for BlobFolderDataSetMapping. +func (bfdsm BlobFolderDataSetMapping) AsADLSGen2FileSystemDataSetMapping() (*ADLSGen2FileSystemDataSetMapping, bool) { + return nil, false +} + +// AsKustoClusterDataSetMapping is the BasicDataSetMapping implementation for BlobFolderDataSetMapping. +func (bfdsm BlobFolderDataSetMapping) AsKustoClusterDataSetMapping() (*KustoClusterDataSetMapping, bool) { + return nil, false +} + +// AsKustoDatabaseDataSetMapping is the BasicDataSetMapping implementation for BlobFolderDataSetMapping. +func (bfdsm BlobFolderDataSetMapping) AsKustoDatabaseDataSetMapping() (*KustoDatabaseDataSetMapping, bool) { + 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 +} + +// AsBasicDataSetMapping is the BasicDataSetMapping implementation for BlobFolderDataSetMapping. +func (bfdsm BlobFolderDataSetMapping) AsBasicDataSetMapping() (BasicDataSetMapping, bool) { + return &bfdsm, true +} + +// UnmarshalJSON is the custom unmarshaler for BlobFolderDataSetMapping struct. +func (bfdsm *BlobFolderDataSetMapping) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var blobFolderMappingProperties BlobFolderMappingProperties + err = json.Unmarshal(*v, &blobFolderMappingProperties) + if err != nil { + return err + } + bfdsm.BlobFolderMappingProperties = &blobFolderMappingProperties + } + case "kind": + if v != nil { + var kind KindBasicDataSetMapping + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + bfdsm.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + bfdsm.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + bfdsm.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + bfdsm.Type = &typeVar + } + } + } + + return nil +} + +// BlobFolderMappingProperties azure storage Blob folder data set mapping property bag. +type BlobFolderMappingProperties struct { + // ContainerName - Container that has the file path. + ContainerName *string `json:"containerName,omitempty"` + // DataSetID - The id of the source data set. + DataSetID *string `json:"dataSetId,omitempty"` + // DataSetMappingStatus - READ-ONLY; Gets the status of the data set mapping. Possible values include: 'Ok', 'Broken' + DataSetMappingStatus DataSetMappingStatus `json:"dataSetMappingStatus,omitempty"` + // Prefix - Prefix for blob folder + Prefix *string `json:"prefix,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the data set mapping. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // ResourceGroup - Resource group of storage account. + ResourceGroup *string `json:"resourceGroup,omitempty"` + // StorageAccountName - Storage account name of the source data set. + StorageAccountName *string `json:"storageAccountName,omitempty"` + // SubscriptionID - Subscription id of storage account. + SubscriptionID *string `json:"subscriptionId,omitempty"` +} + +// BlobFolderProperties properties of the blob folder data set. +type BlobFolderProperties struct { + // ContainerName - Container that has the file path. + ContainerName *string `json:"containerName,omitempty"` + // 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"` + // ResourceGroup - Resource group of storage account + ResourceGroup *string `json:"resourceGroup,omitempty"` + // StorageAccountName - Storage account name of the source data set + StorageAccountName *string `json:"storageAccountName,omitempty"` + // SubscriptionID - Subscription id of storage account + SubscriptionID *string `json:"subscriptionId,omitempty"` +} + +// BlobMappingProperties azure storage Blob data set mapping property bag. +type BlobMappingProperties struct { + // ContainerName - Container that has the file path. + ContainerName *string `json:"containerName,omitempty"` + // DataSetID - The id of the source data set. + DataSetID *string `json:"dataSetId,omitempty"` + // DataSetMappingStatus - READ-ONLY; Gets the status of the data set mapping. Possible values include: 'Ok', 'Broken' + 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"` + // ProvisioningState - READ-ONLY; Provisioning state of the data set mapping. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // ResourceGroup - Resource group of storage account. + ResourceGroup *string `json:"resourceGroup,omitempty"` + // StorageAccountName - Storage account name of the source data set. + StorageAccountName *string `json:"storageAccountName,omitempty"` + // SubscriptionID - Subscription id of storage account. + SubscriptionID *string `json:"subscriptionId,omitempty"` +} + +// BlobProperties properties of the blob data set. +type BlobProperties struct { + // ContainerName - Container that has the file path. + ContainerName *string `json:"containerName,omitempty"` + // 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"` + // ResourceGroup - Resource group of storage account + ResourceGroup *string `json:"resourceGroup,omitempty"` + // StorageAccountName - Storage account name of the source data set + StorageAccountName *string `json:"storageAccountName,omitempty"` + // SubscriptionID - Subscription id of storage account + SubscriptionID *string `json:"subscriptionId,omitempty"` +} + +// ConsumerInvitation a consumer Invitation data transfer object. +type ConsumerInvitation struct { + autorest.Response `json:"-"` + // ConsumerInvitationProperties - Properties on the account + *ConsumerInvitationProperties `json:"properties,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 ConsumerInvitation. +func (ci ConsumerInvitation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ci.ConsumerInvitationProperties != nil { + objectMap["properties"] = ci.ConsumerInvitationProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ConsumerInvitation struct. +func (ci *ConsumerInvitation) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var consumerInvitationProperties ConsumerInvitationProperties + err = json.Unmarshal(*v, &consumerInvitationProperties) + if err != nil { + return err + } + ci.ConsumerInvitationProperties = &consumerInvitationProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ci.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ci.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ci.Type = &typeVar + } + } + } + + return nil +} + +// ConsumerInvitationList list response for get InvitationList +type ConsumerInvitationList struct { + autorest.Response `json:"-"` + // NextLink - The Url of next result page. + NextLink *string `json:"nextLink,omitempty"` + // Value - Collection of items of type DataTransferObjects. + Value *[]ConsumerInvitation `json:"value,omitempty"` +} + +// ConsumerInvitationListIterator provides access to a complete listing of ConsumerInvitation values. +type ConsumerInvitationListIterator struct { + i int + page ConsumerInvitationListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ConsumerInvitationListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConsumerInvitationListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ConsumerInvitationListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ConsumerInvitationListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ConsumerInvitationListIterator) Response() ConsumerInvitationList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ConsumerInvitationListIterator) Value() ConsumerInvitation { + if !iter.page.NotDone() { + return ConsumerInvitation{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ConsumerInvitationListIterator type. +func NewConsumerInvitationListIterator(page ConsumerInvitationListPage) ConsumerInvitationListIterator { + return ConsumerInvitationListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (cil ConsumerInvitationList) IsEmpty() bool { + return cil.Value == nil || len(*cil.Value) == 0 +} + +// consumerInvitationListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (cil ConsumerInvitationList) consumerInvitationListPreparer(ctx context.Context) (*http.Request, error) { + if cil.NextLink == nil || len(to.String(cil.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(cil.NextLink))) +} + +// ConsumerInvitationListPage contains a page of ConsumerInvitation values. +type ConsumerInvitationListPage struct { + fn func(context.Context, ConsumerInvitationList) (ConsumerInvitationList, error) + cil ConsumerInvitationList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ConsumerInvitationListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConsumerInvitationListPage.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.cil) + if err != nil { + return err + } + page.cil = 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 *ConsumerInvitationListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ConsumerInvitationListPage) NotDone() bool { + return !page.cil.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ConsumerInvitationListPage) Response() ConsumerInvitationList { + return page.cil +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ConsumerInvitationListPage) Values() []ConsumerInvitation { + if page.cil.IsEmpty() { + return nil + } + return *page.cil.Value +} + +// Creates a new instance of the ConsumerInvitationListPage type. +func NewConsumerInvitationListPage(getNextPage func(context.Context, ConsumerInvitationList) (ConsumerInvitationList, error)) ConsumerInvitationListPage { + return ConsumerInvitationListPage{fn: getNextPage} +} + +// ConsumerInvitationProperties properties of consumer invitation +type ConsumerInvitationProperties struct { + // DataSetCount - READ-ONLY; Number of data sets in a share + DataSetCount *int32 `json:"dataSetCount,omitempty"` + // Description - READ-ONLY; Description shared when the invitation was created + Description *string `json:"description,omitempty"` + // InvitationID - Unique id of the invitation. + InvitationID *string `json:"invitationId,omitempty"` + // InvitationStatus - READ-ONLY; The status of the invitation. Possible values include: 'Pending', 'Accepted', 'Rejected', 'Withdrawn' + InvitationStatus InvitationStatus `json:"invitationStatus,omitempty"` + // Location - READ-ONLY; invitation location + Location *string `json:"location,omitempty"` + // ProviderEmail - READ-ONLY; Email of the provider who created the resource + ProviderEmail *string `json:"providerEmail,omitempty"` + // ProviderName - READ-ONLY; Name of the provider who created the resource + ProviderName *string `json:"providerName,omitempty"` + // ProviderTenantName - READ-ONLY; Tenant name of the provider who created the resource + ProviderTenantName *string `json:"providerTenantName,omitempty"` + // RespondedAt - READ-ONLY; The time the recipient responded to the invitation. + RespondedAt *date.Time `json:"respondedAt,omitempty"` + // SentAt - READ-ONLY; Gets the time at which the invitation was sent. + SentAt *date.Time `json:"sentAt,omitempty"` + // ShareName - READ-ONLY; Gets the source share Name. + ShareName *string `json:"shareName,omitempty"` + // TermsOfUse - READ-ONLY; Terms of use shared when the invitation was created + TermsOfUse *string `json:"termsOfUse,omitempty"` + // UserEmail - READ-ONLY; Email of the user who created the resource + UserEmail *string `json:"userEmail,omitempty"` + // UserName - READ-ONLY; Name of the user who created the resource + UserName *string `json:"userName,omitempty"` +} + +// ConsumerSourceDataSet a consumer side dataSet data transfer object. +type ConsumerSourceDataSet struct { + // ConsumerSourceDataSetProperties - source dataSet properties + *ConsumerSourceDataSetProperties `json:"properties,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 ConsumerSourceDataSet. +func (csds ConsumerSourceDataSet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if csds.ConsumerSourceDataSetProperties != nil { + objectMap["properties"] = csds.ConsumerSourceDataSetProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ConsumerSourceDataSet struct. +func (csds *ConsumerSourceDataSet) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var consumerSourceDataSetProperties ConsumerSourceDataSetProperties + err = json.Unmarshal(*v, &consumerSourceDataSetProperties) + if err != nil { + return err + } + csds.ConsumerSourceDataSetProperties = &consumerSourceDataSetProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + csds.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + csds.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + csds.Type = &typeVar + } + } + } + + return nil +} + +// ConsumerSourceDataSetList a consumer side list of source dataSets +type ConsumerSourceDataSetList struct { + autorest.Response `json:"-"` + // NextLink - The Url of next result page. + NextLink *string `json:"nextLink,omitempty"` + // Value - Collection of items of type DataTransferObjects. + Value *[]ConsumerSourceDataSet `json:"value,omitempty"` +} + +// ConsumerSourceDataSetListIterator provides access to a complete listing of ConsumerSourceDataSet values. +type ConsumerSourceDataSetListIterator struct { + i int + page ConsumerSourceDataSetListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ConsumerSourceDataSetListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConsumerSourceDataSetListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ConsumerSourceDataSetListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ConsumerSourceDataSetListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ConsumerSourceDataSetListIterator) Response() ConsumerSourceDataSetList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ConsumerSourceDataSetListIterator) Value() ConsumerSourceDataSet { + if !iter.page.NotDone() { + return ConsumerSourceDataSet{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ConsumerSourceDataSetListIterator type. +func NewConsumerSourceDataSetListIterator(page ConsumerSourceDataSetListPage) ConsumerSourceDataSetListIterator { + return ConsumerSourceDataSetListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (csdsl ConsumerSourceDataSetList) IsEmpty() bool { + return csdsl.Value == nil || len(*csdsl.Value) == 0 +} + +// consumerSourceDataSetListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (csdsl ConsumerSourceDataSetList) consumerSourceDataSetListPreparer(ctx context.Context) (*http.Request, error) { + if csdsl.NextLink == nil || len(to.String(csdsl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(csdsl.NextLink))) +} + +// ConsumerSourceDataSetListPage contains a page of ConsumerSourceDataSet values. +type ConsumerSourceDataSetListPage struct { + fn func(context.Context, ConsumerSourceDataSetList) (ConsumerSourceDataSetList, error) + csdsl ConsumerSourceDataSetList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ConsumerSourceDataSetListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConsumerSourceDataSetListPage.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.csdsl) + if err != nil { + return err + } + page.csdsl = 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 *ConsumerSourceDataSetListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ConsumerSourceDataSetListPage) NotDone() bool { + return !page.csdsl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ConsumerSourceDataSetListPage) Response() ConsumerSourceDataSetList { + return page.csdsl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ConsumerSourceDataSetListPage) Values() []ConsumerSourceDataSet { + if page.csdsl.IsEmpty() { + return nil + } + return *page.csdsl.Value +} + +// Creates a new instance of the ConsumerSourceDataSetListPage type. +func NewConsumerSourceDataSetListPage(getNextPage func(context.Context, ConsumerSourceDataSetList) (ConsumerSourceDataSetList, error)) ConsumerSourceDataSetListPage { + return ConsumerSourceDataSetListPage{fn: getNextPage} +} + +// ConsumerSourceDataSetProperties properties of consumer source dataSet +type ConsumerSourceDataSetProperties struct { + // DataSetID - READ-ONLY; DataSet Id + DataSetID *string `json:"dataSetId,omitempty"` + // DataSetLocation - READ-ONLY; Location of the data set. + DataSetLocation *string `json:"dataSetLocation,omitempty"` + // DataSetName - READ-ONLY; DataSet name + DataSetName *string `json:"dataSetName,omitempty"` + // DataSetPath - READ-ONLY; DataSet path + DataSetPath *string `json:"dataSetPath,omitempty"` + // DataSetType - READ-ONLY; Type of data set. Possible values include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SQLDBTable', 'SQLDWTable' + DataSetType DataSetType `json:"dataSetType,omitempty"` +} + +// BasicDataSet a DataSet data transfer object. +type BasicDataSet interface { + AsBlobDataSet() (*BlobDataSet, bool) + AsBlobFolderDataSet() (*BlobFolderDataSet, bool) + AsBlobContainerDataSet() (*BlobContainerDataSet, bool) + AsADLSGen2FileDataSet() (*ADLSGen2FileDataSet, bool) + AsADLSGen2FolderDataSet() (*ADLSGen2FolderDataSet, bool) + AsADLSGen2FileSystemDataSet() (*ADLSGen2FileSystemDataSet, bool) + AsADLSGen1FolderDataSet() (*ADLSGen1FolderDataSet, bool) + AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, bool) + AsKustoClusterDataSet() (*KustoClusterDataSet, bool) + AsKustoDatabaseDataSet() (*KustoDatabaseDataSet, 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', 'KindKustoCluster', 'KindKustoDatabase', '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"` +} + +func unmarshalBasicDataSet(body []byte) (BasicDataSet, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["kind"] { + case string(KindBlob): + var bds BlobDataSet + err := json.Unmarshal(body, &bds) + return bds, err + case string(KindBlobFolder): + var bfds BlobFolderDataSet + err := json.Unmarshal(body, &bfds) + return bfds, err + case string(KindContainer): + var bcds BlobContainerDataSet + err := json.Unmarshal(body, &bcds) + return bcds, err + case string(KindAdlsGen2File): + var ag2fds ADLSGen2FileDataSet + err := json.Unmarshal(body, &ag2fds) + return ag2fds, err + case string(KindAdlsGen2Folder): + var ag2fds ADLSGen2FolderDataSet + err := json.Unmarshal(body, &ag2fds) + return ag2fds, err + case string(KindAdlsGen2FileSystem): + var ag2fsds ADLSGen2FileSystemDataSet + err := json.Unmarshal(body, &ag2fsds) + return ag2fsds, err + case string(KindAdlsGen1Folder): + var ag1fds ADLSGen1FolderDataSet + err := json.Unmarshal(body, &ag1fds) + return ag1fds, err + case string(KindAdlsGen1File): + var ag1fds ADLSGen1FileDataSet + err := json.Unmarshal(body, &ag1fds) + return ag1fds, err + case string(KindKustoCluster): + var kcds KustoClusterDataSet + err := json.Unmarshal(body, &kcds) + return kcds, err + case string(KindKustoDatabase): + var kdds KustoDatabaseDataSet + err := json.Unmarshal(body, &kdds) + return kdds, 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) + return ds, err + } +} +func unmarshalBasicDataSetArray(body []byte) ([]BasicDataSet, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + dsArray := make([]BasicDataSet, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ds, err := unmarshalBasicDataSet(*rawMessage) + if err != nil { + return nil, err + } + dsArray[index] = ds + } + return dsArray, nil +} + +// MarshalJSON is the custom marshaler for DataSet. +func (ds DataSet) MarshalJSON() ([]byte, error) { + ds.Kind = KindDataSet + objectMap := make(map[string]interface{}) + if ds.Kind != "" { + objectMap["kind"] = ds.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSet is the BasicDataSet implementation for DataSet. +func (ds DataSet) AsBlobDataSet() (*BlobDataSet, bool) { + return nil, false +} + +// AsBlobFolderDataSet is the BasicDataSet implementation for DataSet. +func (ds DataSet) AsBlobFolderDataSet() (*BlobFolderDataSet, bool) { + return nil, false +} + +// AsBlobContainerDataSet is the BasicDataSet implementation for DataSet. +func (ds DataSet) AsBlobContainerDataSet() (*BlobContainerDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileDataSet is the BasicDataSet implementation for DataSet. +func (ds DataSet) AsADLSGen2FileDataSet() (*ADLSGen2FileDataSet, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSet is the BasicDataSet implementation for DataSet. +func (ds DataSet) AsADLSGen2FolderDataSet() (*ADLSGen2FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSet is the BasicDataSet implementation for DataSet. +func (ds DataSet) AsADLSGen2FileSystemDataSet() (*ADLSGen2FileSystemDataSet, bool) { + return nil, false +} + +// AsADLSGen1FolderDataSet is the BasicDataSet implementation for DataSet. +func (ds DataSet) AsADLSGen1FolderDataSet() (*ADLSGen1FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen1FileDataSet is the BasicDataSet implementation for DataSet. +func (ds DataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, bool) { + return nil, false +} + +// AsKustoClusterDataSet is the BasicDataSet implementation for DataSet. +func (ds DataSet) AsKustoClusterDataSet() (*KustoClusterDataSet, bool) { + return nil, false +} + +// AsKustoDatabaseDataSet is the BasicDataSet implementation for DataSet. +func (ds DataSet) AsKustoDatabaseDataSet() (*KustoDatabaseDataSet, 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 +} + +// AsBasicDataSet is the BasicDataSet implementation for DataSet. +func (ds DataSet) AsBasicDataSet() (BasicDataSet, bool) { + return &ds, true +} + +// DataSetList list response for get DataSets +type DataSetList struct { + autorest.Response `json:"-"` + // NextLink - The Url of next result page. + NextLink *string `json:"nextLink,omitempty"` + // Value - Collection of items of type DataTransferObjects. + Value *[]BasicDataSet `json:"value,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for DataSetList struct. +func (dsl *DataSetList) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "nextLink": + if v != nil { + var nextLink string + err = json.Unmarshal(*v, &nextLink) + if err != nil { + return err + } + dsl.NextLink = &nextLink + } + case "value": + if v != nil { + value, err := unmarshalBasicDataSetArray(*v) + if err != nil { + return err + } + dsl.Value = &value + } + } + } + + return nil +} + +// DataSetListIterator provides access to a complete listing of DataSet values. +type DataSetListIterator struct { + i int + page DataSetListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DataSetListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataSetListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *DataSetListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DataSetListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DataSetListIterator) Response() DataSetList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DataSetListIterator) Value() BasicDataSet { + if !iter.page.NotDone() { + return DataSet{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DataSetListIterator type. +func NewDataSetListIterator(page DataSetListPage) DataSetListIterator { + return DataSetListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (dsl DataSetList) IsEmpty() bool { + return dsl.Value == nil || len(*dsl.Value) == 0 +} + +// dataSetListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dsl DataSetList) dataSetListPreparer(ctx context.Context) (*http.Request, error) { + if dsl.NextLink == nil || len(to.String(dsl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dsl.NextLink))) +} + +// DataSetListPage contains a page of BasicDataSet values. +type DataSetListPage struct { + fn func(context.Context, DataSetList) (DataSetList, error) + dsl DataSetList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DataSetListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataSetListPage.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.dsl) + if err != nil { + return err + } + page.dsl = 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 *DataSetListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DataSetListPage) NotDone() bool { + return !page.dsl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DataSetListPage) Response() DataSetList { + return page.dsl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DataSetListPage) Values() []BasicDataSet { + if page.dsl.IsEmpty() { + return nil + } + return *page.dsl.Value +} + +// Creates a new instance of the DataSetListPage type. +func NewDataSetListPage(getNextPage func(context.Context, DataSetList) (DataSetList, error)) DataSetListPage { + return DataSetListPage{fn: getNextPage} +} + +// BasicDataSetMapping a data set mapping data transfer object. +type BasicDataSetMapping interface { + AsBlobDataSetMapping() (*BlobDataSetMapping, bool) + AsBlobFolderDataSetMapping() (*BlobFolderDataSetMapping, bool) + AsBlobContainerDataSetMapping() (*BlobContainerDataSetMapping, bool) + AsADLSGen2FileDataSetMapping() (*ADLSGen2FileDataSetMapping, bool) + AsADLSGen2FolderDataSetMapping() (*ADLSGen2FolderDataSetMapping, bool) + AsADLSGen2FileSystemDataSetMapping() (*ADLSGen2FileSystemDataSetMapping, bool) + AsKustoClusterDataSetMapping() (*KustoClusterDataSetMapping, bool) + AsKustoDatabaseDataSetMapping() (*KustoDatabaseDataSetMapping, bool) + AsSQLDWTableDataSetMapping() (*SQLDWTableDataSetMapping, bool) + AsSQLDBTableDataSetMapping() (*SQLDBTableDataSetMapping, bool) + AsDataSetMapping() (*DataSetMapping, bool) +} + +// DataSetMapping a data set mapping data transfer object. +type DataSetMapping struct { + autorest.Response `json:"-"` + // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindKustoCluster', 'KindBasicDataSetMappingKindKustoDatabase', '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"` +} + +func unmarshalBasicDataSetMapping(body []byte) (BasicDataSetMapping, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["kind"] { + case string(KindBasicDataSetMappingKindBlob): + var bdsm BlobDataSetMapping + err := json.Unmarshal(body, &bdsm) + return bdsm, err + case string(KindBasicDataSetMappingKindBlobFolder): + var bfdsm BlobFolderDataSetMapping + err := json.Unmarshal(body, &bfdsm) + return bfdsm, err + case string(KindBasicDataSetMappingKindContainer): + var bcdsm BlobContainerDataSetMapping + err := json.Unmarshal(body, &bcdsm) + return bcdsm, err + case string(KindBasicDataSetMappingKindAdlsGen2File): + var ag2fdsm ADLSGen2FileDataSetMapping + err := json.Unmarshal(body, &ag2fdsm) + return ag2fdsm, err + case string(KindBasicDataSetMappingKindAdlsGen2Folder): + var ag2fdsm ADLSGen2FolderDataSetMapping + err := json.Unmarshal(body, &ag2fdsm) + return ag2fdsm, err + case string(KindBasicDataSetMappingKindAdlsGen2FileSystem): + var ag2fsdsm ADLSGen2FileSystemDataSetMapping + err := json.Unmarshal(body, &ag2fsdsm) + return ag2fsdsm, err + case string(KindBasicDataSetMappingKindKustoCluster): + var kcdsm KustoClusterDataSetMapping + err := json.Unmarshal(body, &kcdsm) + return kcdsm, err + case string(KindBasicDataSetMappingKindKustoDatabase): + var kddsm KustoDatabaseDataSetMapping + err := json.Unmarshal(body, &kddsm) + return kddsm, 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) + return dsm, err + } +} +func unmarshalBasicDataSetMappingArray(body []byte) ([]BasicDataSetMapping, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + dsmArray := make([]BasicDataSetMapping, len(rawMessages)) + + for index, rawMessage := range rawMessages { + dsm, err := unmarshalBasicDataSetMapping(*rawMessage) + if err != nil { + return nil, err + } + dsmArray[index] = dsm + } + return dsmArray, nil +} + +// MarshalJSON is the custom marshaler for DataSetMapping. +func (dsm DataSetMapping) MarshalJSON() ([]byte, error) { + dsm.Kind = KindBasicDataSetMappingKindDataSetMapping + objectMap := make(map[string]interface{}) + if dsm.Kind != "" { + objectMap["kind"] = dsm.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSetMapping is the BasicDataSetMapping implementation for DataSetMapping. +func (dsm DataSetMapping) AsBlobDataSetMapping() (*BlobDataSetMapping, bool) { + return nil, false +} + +// AsBlobFolderDataSetMapping is the BasicDataSetMapping implementation for DataSetMapping. +func (dsm DataSetMapping) AsBlobFolderDataSetMapping() (*BlobFolderDataSetMapping, bool) { + return nil, false +} + +// AsBlobContainerDataSetMapping is the BasicDataSetMapping implementation for DataSetMapping. +func (dsm DataSetMapping) AsBlobContainerDataSetMapping() (*BlobContainerDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FileDataSetMapping is the BasicDataSetMapping implementation for DataSetMapping. +func (dsm DataSetMapping) AsADLSGen2FileDataSetMapping() (*ADLSGen2FileDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSetMapping is the BasicDataSetMapping implementation for DataSetMapping. +func (dsm DataSetMapping) AsADLSGen2FolderDataSetMapping() (*ADLSGen2FolderDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSetMapping is the BasicDataSetMapping implementation for DataSetMapping. +func (dsm DataSetMapping) AsADLSGen2FileSystemDataSetMapping() (*ADLSGen2FileSystemDataSetMapping, bool) { + return nil, false +} + +// AsKustoClusterDataSetMapping is the BasicDataSetMapping implementation for DataSetMapping. +func (dsm DataSetMapping) AsKustoClusterDataSetMapping() (*KustoClusterDataSetMapping, bool) { + return nil, false +} + +// AsKustoDatabaseDataSetMapping is the BasicDataSetMapping implementation for DataSetMapping. +func (dsm DataSetMapping) AsKustoDatabaseDataSetMapping() (*KustoDatabaseDataSetMapping, bool) { + 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 +} + +// AsBasicDataSetMapping is the BasicDataSetMapping implementation for DataSetMapping. +func (dsm DataSetMapping) AsBasicDataSetMapping() (BasicDataSetMapping, bool) { + return &dsm, true +} + +// DataSetMappingList list response for get DataSetMappings +type DataSetMappingList struct { + autorest.Response `json:"-"` + // NextLink - The Url of next result page. + NextLink *string `json:"nextLink,omitempty"` + // Value - Collection of items of type DataTransferObjects. + Value *[]BasicDataSetMapping `json:"value,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for DataSetMappingList struct. +func (dsml *DataSetMappingList) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "nextLink": + if v != nil { + var nextLink string + err = json.Unmarshal(*v, &nextLink) + if err != nil { + return err + } + dsml.NextLink = &nextLink + } + case "value": + if v != nil { + value, err := unmarshalBasicDataSetMappingArray(*v) + if err != nil { + return err + } + dsml.Value = &value + } + } + } + + return nil +} + +// DataSetMappingListIterator provides access to a complete listing of DataSetMapping values. +type DataSetMappingListIterator struct { + i int + page DataSetMappingListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DataSetMappingListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataSetMappingListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *DataSetMappingListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DataSetMappingListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DataSetMappingListIterator) Response() DataSetMappingList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DataSetMappingListIterator) Value() BasicDataSetMapping { + if !iter.page.NotDone() { + return DataSetMapping{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DataSetMappingListIterator type. +func NewDataSetMappingListIterator(page DataSetMappingListPage) DataSetMappingListIterator { + return DataSetMappingListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (dsml DataSetMappingList) IsEmpty() bool { + return dsml.Value == nil || len(*dsml.Value) == 0 +} + +// dataSetMappingListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dsml DataSetMappingList) dataSetMappingListPreparer(ctx context.Context) (*http.Request, error) { + if dsml.NextLink == nil || len(to.String(dsml.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dsml.NextLink))) +} + +// DataSetMappingListPage contains a page of BasicDataSetMapping values. +type DataSetMappingListPage struct { + fn func(context.Context, DataSetMappingList) (DataSetMappingList, error) + dsml DataSetMappingList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DataSetMappingListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataSetMappingListPage.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.dsml) + if err != nil { + return err + } + page.dsml = 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 *DataSetMappingListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DataSetMappingListPage) NotDone() bool { + return !page.dsml.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DataSetMappingListPage) Response() DataSetMappingList { + return page.dsml +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DataSetMappingListPage) Values() []BasicDataSetMapping { + if page.dsml.IsEmpty() { + return nil + } + return *page.dsml.Value +} + +// Creates a new instance of the DataSetMappingListPage type. +func NewDataSetMappingListPage(getNextPage func(context.Context, DataSetMappingList) (DataSetMappingList, error)) DataSetMappingListPage { + return DataSetMappingListPage{fn: getNextPage} +} + +// DataSetMappingModel ... +type DataSetMappingModel struct { + autorest.Response `json:"-"` + Value BasicDataSetMapping `json:"value,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for DataSetMappingModel struct. +func (dsmm *DataSetMappingModel) UnmarshalJSON(body []byte) error { + dsm, err := unmarshalBasicDataSetMapping(body) + if err != nil { + return err + } + dsmm.Value = dsm + + return nil +} + +// DataSetModel ... +type DataSetModel struct { + autorest.Response `json:"-"` + Value BasicDataSet `json:"value,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for DataSetModel struct. +func (dsm *DataSetModel) UnmarshalJSON(body []byte) error { + ds, err := unmarshalBasicDataSet(body) + if err != nil { + return err + } + dsm.Value = ds + + return nil +} + +// DataSetsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DataSetsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DataSetsDeleteFuture) Result(client DataSetsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.DataSetsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("datashare.DataSetsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// DefaultDto base data transfer object implementation for default resources. +type DefaultDto struct { + // ID - READ-ONLY; The resource id of the azure resource + ID *string `json:"id,omitempty"` + // Location - Location of the azure resource. + Location *string `json:"location,omitempty"` + // Name - READ-ONLY; Name of the azure resource + Name *string `json:"name,omitempty"` + // Tags - Tags on the azure resource. + Tags map[string]*string `json:"tags"` + // Type - READ-ONLY; Type of the azure resource + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DefaultDto. +func (dd DefaultDto) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dd.Location != nil { + objectMap["location"] = dd.Location + } + if dd.Tags != nil { + objectMap["tags"] = dd.Tags + } + return json.Marshal(objectMap) +} + +// DimensionProperties properties for dimension +type DimensionProperties struct { + // DisplayName - localized display name of the dimension to customer + DisplayName *string `json:"displayName,omitempty"` + // Name - dimension name + Name *string `json:"name,omitempty"` +} + +// Error the data share error model. +type Error struct { + // Error - The data share error body + Error *ErrorInfo `json:"error,omitempty"` +} + +// ErrorInfo the data share error body model. +type ErrorInfo struct { + // Code - Code of the error + Code *string `json:"code,omitempty"` + // Details - Nested details of the error model + Details *[]ErrorInfo `json:"details,omitempty"` + // Message - Message of the error + Message *string `json:"message,omitempty"` + // Target - Target of the error + Target *string `json:"target,omitempty"` +} + +// Identity identity of resource +type Identity struct { + // PrincipalID - READ-ONLY; service principal Id + PrincipalID *string `json:"principalId,omitempty"` + // TenantID - READ-ONLY; Tenant Id + TenantID *string `json:"tenantId,omitempty"` + // Type - Identity Type. Possible values include: 'SystemAssigned' + Type Type `json:"type,omitempty"` +} + +// Invitation a Invitation data transfer object. +type Invitation struct { + autorest.Response `json:"-"` + // InvitationProperties - Properties on the Invitation + *InvitationProperties `json:"properties,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 Invitation. +func (i Invitation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if i.InvitationProperties != nil { + objectMap["properties"] = i.InvitationProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Invitation struct. +func (i *Invitation) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var invitationProperties InvitationProperties + err = json.Unmarshal(*v, &invitationProperties) + if err != nil { + return err + } + i.InvitationProperties = &invitationProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + i.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + i.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + i.Type = &typeVar + } + } + } + + return nil +} + +// InvitationList list response for get InvitationList +type InvitationList struct { + autorest.Response `json:"-"` + // NextLink - The Url of next result page. + NextLink *string `json:"nextLink,omitempty"` + // Value - Collection of items of type DataTransferObjects. + Value *[]Invitation `json:"value,omitempty"` +} + +// InvitationListIterator provides access to a complete listing of Invitation values. +type InvitationListIterator struct { + i int + page InvitationListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *InvitationListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InvitationListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *InvitationListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter InvitationListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter InvitationListIterator) Response() InvitationList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter InvitationListIterator) Value() Invitation { + if !iter.page.NotDone() { + return Invitation{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the InvitationListIterator type. +func NewInvitationListIterator(page InvitationListPage) InvitationListIterator { + return InvitationListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (il InvitationList) IsEmpty() bool { + return il.Value == nil || len(*il.Value) == 0 +} + +// invitationListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (il InvitationList) invitationListPreparer(ctx context.Context) (*http.Request, error) { + if il.NextLink == nil || len(to.String(il.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(il.NextLink))) +} + +// InvitationListPage contains a page of Invitation values. +type InvitationListPage struct { + fn func(context.Context, InvitationList) (InvitationList, error) + il InvitationList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *InvitationListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InvitationListPage.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.il) + if err != nil { + return err + } + page.il = 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 *InvitationListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page InvitationListPage) NotDone() bool { + return !page.il.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page InvitationListPage) Response() InvitationList { + return page.il +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page InvitationListPage) Values() []Invitation { + if page.il.IsEmpty() { + return nil + } + return *page.il.Value +} + +// Creates a new instance of the InvitationListPage type. +func NewInvitationListPage(getNextPage func(context.Context, InvitationList) (InvitationList, error)) InvitationListPage { + return InvitationListPage{fn: getNextPage} +} + +// InvitationProperties invitation property bag. +type InvitationProperties struct { + // InvitationID - READ-ONLY; unique invitation id + InvitationID *string `json:"invitationId,omitempty"` + // InvitationStatus - READ-ONLY; The status of the invitation. Possible values include: 'Pending', 'Accepted', 'Rejected', 'Withdrawn' + InvitationStatus InvitationStatus `json:"invitationStatus,omitempty"` + // RespondedAt - READ-ONLY; The time the recipient responded to the invitation. + RespondedAt *date.Time `json:"respondedAt,omitempty"` + // SentAt - READ-ONLY; Gets the time at which the invitation was sent. + SentAt *date.Time `json:"sentAt,omitempty"` + // TargetActiveDirectoryID - The target Azure AD Id. Can't be combined with email. + TargetActiveDirectoryID *string `json:"targetActiveDirectoryId,omitempty"` + // TargetEmail - The email the invitation is directed to. + TargetEmail *string `json:"targetEmail,omitempty"` + // TargetObjectID - The target user or application Id that invitation is being sent to. + // Must be specified along TargetActiveDirectoryId. This enables sending + // invitations to specific users or applications in an AD tenant. + TargetObjectID *string `json:"targetObjectId,omitempty"` + // UserEmail - READ-ONLY; Email of the user who created the resource + UserEmail *string `json:"userEmail,omitempty"` + // UserName - READ-ONLY; Name of the user who created the resource + UserName *string `json:"userName,omitempty"` +} + +// KustoClusterDataSet a kusto cluster data set. +type KustoClusterDataSet struct { + // KustoClusterDataSetProperties - Kusto cluster data set properties. + *KustoClusterDataSetProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindKustoCluster', 'KindKustoDatabase', '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 KustoClusterDataSet. +func (kcds KustoClusterDataSet) MarshalJSON() ([]byte, error) { + kcds.Kind = KindKustoCluster + objectMap := make(map[string]interface{}) + if kcds.KustoClusterDataSetProperties != nil { + objectMap["properties"] = kcds.KustoClusterDataSetProperties + } + if kcds.Kind != "" { + objectMap["kind"] = kcds.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSet is the BasicDataSet implementation for KustoClusterDataSet. +func (kcds KustoClusterDataSet) AsBlobDataSet() (*BlobDataSet, bool) { + return nil, false +} + +// AsBlobFolderDataSet is the BasicDataSet implementation for KustoClusterDataSet. +func (kcds KustoClusterDataSet) AsBlobFolderDataSet() (*BlobFolderDataSet, bool) { + return nil, false +} + +// AsBlobContainerDataSet is the BasicDataSet implementation for KustoClusterDataSet. +func (kcds KustoClusterDataSet) AsBlobContainerDataSet() (*BlobContainerDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileDataSet is the BasicDataSet implementation for KustoClusterDataSet. +func (kcds KustoClusterDataSet) AsADLSGen2FileDataSet() (*ADLSGen2FileDataSet, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSet is the BasicDataSet implementation for KustoClusterDataSet. +func (kcds KustoClusterDataSet) AsADLSGen2FolderDataSet() (*ADLSGen2FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSet is the BasicDataSet implementation for KustoClusterDataSet. +func (kcds KustoClusterDataSet) AsADLSGen2FileSystemDataSet() (*ADLSGen2FileSystemDataSet, bool) { + return nil, false +} + +// AsADLSGen1FolderDataSet is the BasicDataSet implementation for KustoClusterDataSet. +func (kcds KustoClusterDataSet) AsADLSGen1FolderDataSet() (*ADLSGen1FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen1FileDataSet is the BasicDataSet implementation for KustoClusterDataSet. +func (kcds KustoClusterDataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, bool) { + return nil, false +} + +// AsKustoClusterDataSet is the BasicDataSet implementation for KustoClusterDataSet. +func (kcds KustoClusterDataSet) AsKustoClusterDataSet() (*KustoClusterDataSet, bool) { + return &kcds, true +} + +// AsKustoDatabaseDataSet is the BasicDataSet implementation for KustoClusterDataSet. +func (kcds KustoClusterDataSet) AsKustoDatabaseDataSet() (*KustoDatabaseDataSet, bool) { + return nil, false +} + +// AsSQLDWTableDataSet is the BasicDataSet implementation for KustoClusterDataSet. +func (kcds KustoClusterDataSet) AsSQLDWTableDataSet() (*SQLDWTableDataSet, bool) { + return nil, false +} + +// AsSQLDBTableDataSet is the BasicDataSet implementation for KustoClusterDataSet. +func (kcds KustoClusterDataSet) AsSQLDBTableDataSet() (*SQLDBTableDataSet, bool) { + return nil, false +} + +// AsDataSet is the BasicDataSet implementation for KustoClusterDataSet. +func (kcds KustoClusterDataSet) AsDataSet() (*DataSet, bool) { + return nil, false +} + +// AsBasicDataSet is the BasicDataSet implementation for KustoClusterDataSet. +func (kcds KustoClusterDataSet) AsBasicDataSet() (BasicDataSet, bool) { + return &kcds, true +} + +// UnmarshalJSON is the custom unmarshaler for KustoClusterDataSet struct. +func (kcds *KustoClusterDataSet) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var kustoClusterDataSetProperties KustoClusterDataSetProperties + err = json.Unmarshal(*v, &kustoClusterDataSetProperties) + if err != nil { + return err + } + kcds.KustoClusterDataSetProperties = &kustoClusterDataSetProperties + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + kcds.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + kcds.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + kcds.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + kcds.Type = &typeVar + } + } + } + + return nil +} + +// KustoClusterDataSetMapping a Kusto cluster data set mapping +type KustoClusterDataSetMapping struct { + // KustoClusterDataSetMappingProperties - Kusto cluster data set mapping properties. + *KustoClusterDataSetMappingProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindKustoCluster', 'KindBasicDataSetMappingKindKustoDatabase', '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 KustoClusterDataSetMapping. +func (kcdsm KustoClusterDataSetMapping) MarshalJSON() ([]byte, error) { + kcdsm.Kind = KindBasicDataSetMappingKindKustoCluster + objectMap := make(map[string]interface{}) + if kcdsm.KustoClusterDataSetMappingProperties != nil { + objectMap["properties"] = kcdsm.KustoClusterDataSetMappingProperties + } + if kcdsm.Kind != "" { + objectMap["kind"] = kcdsm.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSetMapping is the BasicDataSetMapping implementation for KustoClusterDataSetMapping. +func (kcdsm KustoClusterDataSetMapping) AsBlobDataSetMapping() (*BlobDataSetMapping, bool) { + return nil, false +} + +// AsBlobFolderDataSetMapping is the BasicDataSetMapping implementation for KustoClusterDataSetMapping. +func (kcdsm KustoClusterDataSetMapping) AsBlobFolderDataSetMapping() (*BlobFolderDataSetMapping, bool) { + return nil, false +} + +// AsBlobContainerDataSetMapping is the BasicDataSetMapping implementation for KustoClusterDataSetMapping. +func (kcdsm KustoClusterDataSetMapping) AsBlobContainerDataSetMapping() (*BlobContainerDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FileDataSetMapping is the BasicDataSetMapping implementation for KustoClusterDataSetMapping. +func (kcdsm KustoClusterDataSetMapping) AsADLSGen2FileDataSetMapping() (*ADLSGen2FileDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSetMapping is the BasicDataSetMapping implementation for KustoClusterDataSetMapping. +func (kcdsm KustoClusterDataSetMapping) AsADLSGen2FolderDataSetMapping() (*ADLSGen2FolderDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSetMapping is the BasicDataSetMapping implementation for KustoClusterDataSetMapping. +func (kcdsm KustoClusterDataSetMapping) AsADLSGen2FileSystemDataSetMapping() (*ADLSGen2FileSystemDataSetMapping, bool) { + return nil, false +} + +// AsKustoClusterDataSetMapping is the BasicDataSetMapping implementation for KustoClusterDataSetMapping. +func (kcdsm KustoClusterDataSetMapping) AsKustoClusterDataSetMapping() (*KustoClusterDataSetMapping, bool) { + return &kcdsm, true +} + +// AsKustoDatabaseDataSetMapping is the BasicDataSetMapping implementation for KustoClusterDataSetMapping. +func (kcdsm KustoClusterDataSetMapping) AsKustoDatabaseDataSetMapping() (*KustoDatabaseDataSetMapping, bool) { + return nil, false +} + +// AsSQLDWTableDataSetMapping is the BasicDataSetMapping implementation for KustoClusterDataSetMapping. +func (kcdsm KustoClusterDataSetMapping) AsSQLDWTableDataSetMapping() (*SQLDWTableDataSetMapping, bool) { + return nil, false +} + +// AsSQLDBTableDataSetMapping is the BasicDataSetMapping implementation for KustoClusterDataSetMapping. +func (kcdsm KustoClusterDataSetMapping) AsSQLDBTableDataSetMapping() (*SQLDBTableDataSetMapping, bool) { + return nil, false +} + +// AsDataSetMapping is the BasicDataSetMapping implementation for KustoClusterDataSetMapping. +func (kcdsm KustoClusterDataSetMapping) AsDataSetMapping() (*DataSetMapping, bool) { + return nil, false +} + +// AsBasicDataSetMapping is the BasicDataSetMapping implementation for KustoClusterDataSetMapping. +func (kcdsm KustoClusterDataSetMapping) AsBasicDataSetMapping() (BasicDataSetMapping, bool) { + return &kcdsm, true +} + +// UnmarshalJSON is the custom unmarshaler for KustoClusterDataSetMapping struct. +func (kcdsm *KustoClusterDataSetMapping) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var kustoClusterDataSetMappingProperties KustoClusterDataSetMappingProperties + err = json.Unmarshal(*v, &kustoClusterDataSetMappingProperties) + if err != nil { + return err + } + kcdsm.KustoClusterDataSetMappingProperties = &kustoClusterDataSetMappingProperties + } + case "kind": + if v != nil { + var kind KindBasicDataSetMapping + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + kcdsm.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + kcdsm.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + kcdsm.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + kcdsm.Type = &typeVar + } + } + } + + return nil +} + +// KustoClusterDataSetMappingProperties properties of the Kusto cluster data set mapping +type KustoClusterDataSetMappingProperties struct { + // DataSetID - The id of the source data set. + DataSetID *string `json:"dataSetId,omitempty"` + // DataSetMappingStatus - READ-ONLY; Gets the status of the data set mapping. Possible values include: 'Ok', 'Broken' + DataSetMappingStatus DataSetMappingStatus `json:"dataSetMappingStatus,omitempty"` + // KustoClusterResourceID - Resource id of the sink kusto cluster. + KustoClusterResourceID *string `json:"kustoClusterResourceId,omitempty"` + // Location - READ-ONLY; Location of the sink kusto cluster. + Location *string `json:"location,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the data set mapping. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// KustoClusterDataSetProperties properties of the kusto cluster data set. +type KustoClusterDataSetProperties struct { + // DataSetID - READ-ONLY; Unique id for identifying a data set resource + DataSetID *string `json:"dataSetId,omitempty"` + // KustoClusterResourceID - Resource id of the kusto cluster. + KustoClusterResourceID *string `json:"kustoClusterResourceId,omitempty"` + // Location - READ-ONLY; Location of the kusto cluster. + Location *string `json:"location,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the kusto cluster data set. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// KustoDatabaseDataSet a kusto database data set. +type KustoDatabaseDataSet struct { + // KustoDatabaseDataSetProperties - Kusto database data set properties. + *KustoDatabaseDataSetProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindKustoCluster', 'KindKustoDatabase', '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 KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) MarshalJSON() ([]byte, error) { + kdds.Kind = KindKustoDatabase + objectMap := make(map[string]interface{}) + if kdds.KustoDatabaseDataSetProperties != nil { + objectMap["properties"] = kdds.KustoDatabaseDataSetProperties + } + if kdds.Kind != "" { + objectMap["kind"] = kdds.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSet is the BasicDataSet implementation for KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) AsBlobDataSet() (*BlobDataSet, bool) { + return nil, false +} + +// AsBlobFolderDataSet is the BasicDataSet implementation for KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) AsBlobFolderDataSet() (*BlobFolderDataSet, bool) { + return nil, false +} + +// AsBlobContainerDataSet is the BasicDataSet implementation for KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) AsBlobContainerDataSet() (*BlobContainerDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileDataSet is the BasicDataSet implementation for KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) AsADLSGen2FileDataSet() (*ADLSGen2FileDataSet, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSet is the BasicDataSet implementation for KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) AsADLSGen2FolderDataSet() (*ADLSGen2FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSet is the BasicDataSet implementation for KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) AsADLSGen2FileSystemDataSet() (*ADLSGen2FileSystemDataSet, bool) { + return nil, false +} + +// AsADLSGen1FolderDataSet is the BasicDataSet implementation for KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) AsADLSGen1FolderDataSet() (*ADLSGen1FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen1FileDataSet is the BasicDataSet implementation for KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, bool) { + return nil, false +} + +// AsKustoClusterDataSet is the BasicDataSet implementation for KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) AsKustoClusterDataSet() (*KustoClusterDataSet, bool) { + return nil, false +} + +// AsKustoDatabaseDataSet is the BasicDataSet implementation for KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) AsKustoDatabaseDataSet() (*KustoDatabaseDataSet, bool) { + return &kdds, true +} + +// AsSQLDWTableDataSet is the BasicDataSet implementation for KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) AsSQLDWTableDataSet() (*SQLDWTableDataSet, bool) { + return nil, false +} + +// AsSQLDBTableDataSet is the BasicDataSet implementation for KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) AsSQLDBTableDataSet() (*SQLDBTableDataSet, bool) { + return nil, false +} + +// AsDataSet is the BasicDataSet implementation for KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) AsDataSet() (*DataSet, bool) { + return nil, false +} + +// AsBasicDataSet is the BasicDataSet implementation for KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) AsBasicDataSet() (BasicDataSet, bool) { + return &kdds, true +} + +// UnmarshalJSON is the custom unmarshaler for KustoDatabaseDataSet struct. +func (kdds *KustoDatabaseDataSet) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var kustoDatabaseDataSetProperties KustoDatabaseDataSetProperties + err = json.Unmarshal(*v, &kustoDatabaseDataSetProperties) + if err != nil { + return err + } + kdds.KustoDatabaseDataSetProperties = &kustoDatabaseDataSetProperties + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + kdds.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + kdds.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + kdds.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + kdds.Type = &typeVar + } + } + } + + return nil +} + +// KustoDatabaseDataSetMapping a Kusto database data set mapping +type KustoDatabaseDataSetMapping struct { + // KustoDatabaseDataSetMappingProperties - Kusto database data set mapping properties. + *KustoDatabaseDataSetMappingProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindKustoCluster', 'KindBasicDataSetMappingKindKustoDatabase', '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 KustoDatabaseDataSetMapping. +func (kddsm KustoDatabaseDataSetMapping) MarshalJSON() ([]byte, error) { + kddsm.Kind = KindBasicDataSetMappingKindKustoDatabase + objectMap := make(map[string]interface{}) + if kddsm.KustoDatabaseDataSetMappingProperties != nil { + objectMap["properties"] = kddsm.KustoDatabaseDataSetMappingProperties + } + if kddsm.Kind != "" { + objectMap["kind"] = kddsm.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSetMapping is the BasicDataSetMapping implementation for KustoDatabaseDataSetMapping. +func (kddsm KustoDatabaseDataSetMapping) AsBlobDataSetMapping() (*BlobDataSetMapping, bool) { + return nil, false +} + +// AsBlobFolderDataSetMapping is the BasicDataSetMapping implementation for KustoDatabaseDataSetMapping. +func (kddsm KustoDatabaseDataSetMapping) AsBlobFolderDataSetMapping() (*BlobFolderDataSetMapping, bool) { + return nil, false +} + +// AsBlobContainerDataSetMapping is the BasicDataSetMapping implementation for KustoDatabaseDataSetMapping. +func (kddsm KustoDatabaseDataSetMapping) AsBlobContainerDataSetMapping() (*BlobContainerDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FileDataSetMapping is the BasicDataSetMapping implementation for KustoDatabaseDataSetMapping. +func (kddsm KustoDatabaseDataSetMapping) AsADLSGen2FileDataSetMapping() (*ADLSGen2FileDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSetMapping is the BasicDataSetMapping implementation for KustoDatabaseDataSetMapping. +func (kddsm KustoDatabaseDataSetMapping) AsADLSGen2FolderDataSetMapping() (*ADLSGen2FolderDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSetMapping is the BasicDataSetMapping implementation for KustoDatabaseDataSetMapping. +func (kddsm KustoDatabaseDataSetMapping) AsADLSGen2FileSystemDataSetMapping() (*ADLSGen2FileSystemDataSetMapping, bool) { + return nil, false +} + +// AsKustoClusterDataSetMapping is the BasicDataSetMapping implementation for KustoDatabaseDataSetMapping. +func (kddsm KustoDatabaseDataSetMapping) AsKustoClusterDataSetMapping() (*KustoClusterDataSetMapping, bool) { + return nil, false +} + +// AsKustoDatabaseDataSetMapping is the BasicDataSetMapping implementation for KustoDatabaseDataSetMapping. +func (kddsm KustoDatabaseDataSetMapping) AsKustoDatabaseDataSetMapping() (*KustoDatabaseDataSetMapping, bool) { + return &kddsm, true +} + +// AsSQLDWTableDataSetMapping is the BasicDataSetMapping implementation for KustoDatabaseDataSetMapping. +func (kddsm KustoDatabaseDataSetMapping) AsSQLDWTableDataSetMapping() (*SQLDWTableDataSetMapping, bool) { + return nil, false +} + +// AsSQLDBTableDataSetMapping is the BasicDataSetMapping implementation for KustoDatabaseDataSetMapping. +func (kddsm KustoDatabaseDataSetMapping) AsSQLDBTableDataSetMapping() (*SQLDBTableDataSetMapping, bool) { + return nil, false +} + +// AsDataSetMapping is the BasicDataSetMapping implementation for KustoDatabaseDataSetMapping. +func (kddsm KustoDatabaseDataSetMapping) AsDataSetMapping() (*DataSetMapping, bool) { + return nil, false +} + +// AsBasicDataSetMapping is the BasicDataSetMapping implementation for KustoDatabaseDataSetMapping. +func (kddsm KustoDatabaseDataSetMapping) AsBasicDataSetMapping() (BasicDataSetMapping, bool) { + return &kddsm, true +} + +// UnmarshalJSON is the custom unmarshaler for KustoDatabaseDataSetMapping struct. +func (kddsm *KustoDatabaseDataSetMapping) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var kustoDatabaseDataSetMappingProperties KustoDatabaseDataSetMappingProperties + err = json.Unmarshal(*v, &kustoDatabaseDataSetMappingProperties) + if err != nil { + return err + } + kddsm.KustoDatabaseDataSetMappingProperties = &kustoDatabaseDataSetMappingProperties + } + case "kind": + if v != nil { + var kind KindBasicDataSetMapping + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + kddsm.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + kddsm.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + kddsm.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + kddsm.Type = &typeVar + } + } + } + + return nil +} + +// KustoDatabaseDataSetMappingProperties properties of the Kusto database data set mapping +type KustoDatabaseDataSetMappingProperties struct { + // DataSetID - The id of the source data set. + DataSetID *string `json:"dataSetId,omitempty"` + // DataSetMappingStatus - READ-ONLY; Gets the status of the data set mapping. Possible values include: 'Ok', 'Broken' + DataSetMappingStatus DataSetMappingStatus `json:"dataSetMappingStatus,omitempty"` + // KustoClusterResourceID - Resource id of the sink kusto cluster. + KustoClusterResourceID *string `json:"kustoClusterResourceId,omitempty"` + // Location - READ-ONLY; Location of the sink kusto cluster. + Location *string `json:"location,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the data set mapping. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// KustoDatabaseDataSetProperties properties of the kusto database data set. +type KustoDatabaseDataSetProperties struct { + // DataSetID - READ-ONLY; Unique id for identifying a data set resource + DataSetID *string `json:"dataSetId,omitempty"` + // KustoDatabaseResourceID - Resource id of the kusto database. + KustoDatabaseResourceID *string `json:"kustoDatabaseResourceId,omitempty"` + // Location - READ-ONLY; Location of the kusto cluster. + Location *string `json:"location,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the kusto database data set. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// OperationList list response for get operations. +type OperationList struct { + autorest.Response `json:"-"` + // NextLink - The Url of next result page. + NextLink *string `json:"nextLink,omitempty"` + // Value - Collection of items of type DataTransferObjects. + Value *[]OperationModel `json:"value,omitempty"` +} + +// OperationListIterator provides access to a complete listing of OperationModel 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() OperationModel { + if !iter.page.NotDone() { + return OperationModel{} + } + 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 OperationModel 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() []OperationModel { + 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} +} + +// OperationMetaLogSpecification log specifications for operation api +type OperationMetaLogSpecification struct { + // BlobDuration - blob duration of the log + BlobDuration *string `json:"blobDuration,omitempty"` + // DisplayName - localized name of the log category + DisplayName *string `json:"displayName,omitempty"` + // Name - name of the log category + Name *string `json:"name,omitempty"` +} + +// OperationMetaMetricSpecification metric specifications for the operation +type OperationMetaMetricSpecification struct { + // AggregationType - aggregation type of metric + AggregationType *string `json:"aggregationType,omitempty"` + // Dimensions - properties for dimension + Dimensions *[]DimensionProperties `json:"dimensions,omitempty"` + // DisplayDescription - description of the metric + DisplayDescription *string `json:"displayDescription,omitempty"` + // DisplayName - localized name of the metric + DisplayName *string `json:"displayName,omitempty"` + // EnableRegionalMdmAccount - enable regional mdm account + EnableRegionalMdmAccount *string `json:"enableRegionalMdmAccount,omitempty"` + // InternalMetricName - internal metric name + InternalMetricName *string `json:"internalMetricName,omitempty"` + // Name - name of the metric + Name *string `json:"name,omitempty"` + // ResourceIDDimensionNameOverride - dimension name use to replace resource id if specified + ResourceIDDimensionNameOverride *string `json:"resourceIdDimensionNameOverride,omitempty"` + // SupportedAggregationTypes - supported aggregation types + SupportedAggregationTypes *[]string `json:"supportedAggregationTypes,omitempty"` + // SupportedTimeGrainTypes - supported time grain types + SupportedTimeGrainTypes *[]string `json:"supportedTimeGrainTypes,omitempty"` + // Unit - units for the metric + Unit *string `json:"unit,omitempty"` +} + +// OperationMetaPropertyInfo properties on meta info +type OperationMetaPropertyInfo struct { + // ServiceSpecification - meta service specification + ServiceSpecification *OperationMetaServiceSpecification `json:"serviceSpecification,omitempty"` +} + +// OperationMetaServiceSpecification the operation meta service specification +type OperationMetaServiceSpecification struct { + // LogSpecifications - log specifications for the operation + LogSpecifications *[]OperationMetaLogSpecification `json:"logSpecifications,omitempty"` + // MetricSpecifications - metric specifications for the operation + MetricSpecifications *[]OperationMetaMetricSpecification `json:"metricSpecifications,omitempty"` +} + +// OperationModel the response model for get operations +type OperationModel struct { + // Display - Properties on the operation + Display *OperationModelProperties `json:"display,omitempty"` + // Name - Operation name for display purposes + Name *string `json:"name,omitempty"` + // Origin - origin of the operation + Origin *string `json:"origin,omitempty"` + // OperationMetaPropertyInfo - properties for the operation meta info + *OperationMetaPropertyInfo `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationModel. +func (om OperationModel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if om.Display != nil { + objectMap["display"] = om.Display + } + if om.Name != nil { + objectMap["name"] = om.Name + } + if om.Origin != nil { + objectMap["origin"] = om.Origin + } + if om.OperationMetaPropertyInfo != nil { + objectMap["properties"] = om.OperationMetaPropertyInfo + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for OperationModel struct. +func (om *OperationModel) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "display": + if v != nil { + var display OperationModelProperties + err = json.Unmarshal(*v, &display) + if err != nil { + return err + } + om.Display = &display + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + om.Name = &name + } + case "origin": + if v != nil { + var origin string + err = json.Unmarshal(*v, &origin) + if err != nil { + return err + } + om.Origin = &origin + } + case "properties": + if v != nil { + var operationMetaPropertyInfo OperationMetaPropertyInfo + err = json.Unmarshal(*v, &operationMetaPropertyInfo) + if err != nil { + return err + } + om.OperationMetaPropertyInfo = &operationMetaPropertyInfo + } + } + } + + return nil +} + +// OperationModelProperties properties on operations +type OperationModelProperties struct { + // Description - Description of the operation for display purposes + Description *string `json:"description,omitempty"` + // Operation - Name of the operation for display purposes + Operation *string `json:"operation,omitempty"` + // Provider - Name of the provider for display purposes + Provider *string `json:"provider,omitempty"` + // Resource - Name of the resource type for display purposes + Resource *string `json:"resource,omitempty"` +} + +// OperationResponse response for long running operation +type OperationResponse struct { + autorest.Response `json:"-"` + // EndTime - start time + EndTime *date.Time `json:"endTime,omitempty"` + // Error - The error property when status is failed. + Error *ErrorInfo `json:"error,omitempty"` + // StartTime - start time + StartTime *date.Time `json:"startTime,omitempty"` + // Status - Operation state of the long running operation. Possible values include: 'StatusAccepted', 'StatusInProgress', 'StatusTransientFailure', 'StatusSucceeded', 'StatusFailed', 'StatusCanceled' + Status Status `json:"status,omitempty"` +} + +// ProviderShareSubscription a provider side share subscription data transfer object. +type ProviderShareSubscription struct { + autorest.Response `json:"-"` + // ProviderShareSubscriptionProperties - properties of providerShareSubscription + *ProviderShareSubscriptionProperties `json:"properties,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 ProviderShareSubscription. +func (pss ProviderShareSubscription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pss.ProviderShareSubscriptionProperties != nil { + objectMap["properties"] = pss.ProviderShareSubscriptionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ProviderShareSubscription struct. +func (pss *ProviderShareSubscription) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var providerShareSubscriptionProperties ProviderShareSubscriptionProperties + err = json.Unmarshal(*v, &providerShareSubscriptionProperties) + if err != nil { + return err + } + pss.ProviderShareSubscriptionProperties = &providerShareSubscriptionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pss.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pss.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pss.Type = &typeVar + } + } + } + + return nil +} + +// ProviderShareSubscriptionList list response for get ShareSubscription. +type ProviderShareSubscriptionList struct { + autorest.Response `json:"-"` + // NextLink - The Url of next result page. + NextLink *string `json:"nextLink,omitempty"` + // Value - Collection of items of type DataTransferObjects. + Value *[]ProviderShareSubscription `json:"value,omitempty"` +} + +// ProviderShareSubscriptionListIterator provides access to a complete listing of ProviderShareSubscription +// values. +type ProviderShareSubscriptionListIterator struct { + i int + page ProviderShareSubscriptionListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ProviderShareSubscriptionListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProviderShareSubscriptionListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ProviderShareSubscriptionListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProviderShareSubscriptionListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ProviderShareSubscriptionListIterator) Response() ProviderShareSubscriptionList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ProviderShareSubscriptionListIterator) Value() ProviderShareSubscription { + if !iter.page.NotDone() { + return ProviderShareSubscription{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProviderShareSubscriptionListIterator type. +func NewProviderShareSubscriptionListIterator(page ProviderShareSubscriptionListPage) ProviderShareSubscriptionListIterator { + return ProviderShareSubscriptionListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pssl ProviderShareSubscriptionList) IsEmpty() bool { + return pssl.Value == nil || len(*pssl.Value) == 0 +} + +// providerShareSubscriptionListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pssl ProviderShareSubscriptionList) providerShareSubscriptionListPreparer(ctx context.Context) (*http.Request, error) { + if pssl.NextLink == nil || len(to.String(pssl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pssl.NextLink))) +} + +// ProviderShareSubscriptionListPage contains a page of ProviderShareSubscription values. +type ProviderShareSubscriptionListPage struct { + fn func(context.Context, ProviderShareSubscriptionList) (ProviderShareSubscriptionList, error) + pssl ProviderShareSubscriptionList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ProviderShareSubscriptionListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProviderShareSubscriptionListPage.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.pssl) + if err != nil { + return err + } + page.pssl = 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 *ProviderShareSubscriptionListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProviderShareSubscriptionListPage) NotDone() bool { + return !page.pssl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProviderShareSubscriptionListPage) Response() ProviderShareSubscriptionList { + return page.pssl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProviderShareSubscriptionListPage) Values() []ProviderShareSubscription { + if page.pssl.IsEmpty() { + return nil + } + return *page.pssl.Value +} + +// Creates a new instance of the ProviderShareSubscriptionListPage type. +func NewProviderShareSubscriptionListPage(getNextPage func(context.Context, ProviderShareSubscriptionList) (ProviderShareSubscriptionList, error)) ProviderShareSubscriptionListPage { + return ProviderShareSubscriptionListPage{fn: getNextPage} +} + +// ProviderShareSubscriptionProperties provider share subscription properties +type ProviderShareSubscriptionProperties struct { + // ConsumerEmail - READ-ONLY; Email of the consumer who created the share subscription + ConsumerEmail *string `json:"consumerEmail,omitempty"` + // ConsumerName - READ-ONLY; Name of the consumer who created the share subscription + ConsumerName *string `json:"consumerName,omitempty"` + // ConsumerTenantName - READ-ONLY; Tenant name of the consumer who created the share subscription + ConsumerTenantName *string `json:"consumerTenantName,omitempty"` + // CreatedAt - READ-ONLY; created at + CreatedAt *date.Time `json:"createdAt,omitempty"` + // ProviderName - READ-ONLY; Name of the provider who created the share + ProviderName *string `json:"providerName,omitempty"` + // SharedAt - READ-ONLY; Shared at + SharedAt *date.Time `json:"sharedAt,omitempty"` + // ShareSubscriptionObjectID - READ-ONLY; share Subscription Object Id + ShareSubscriptionObjectID *string `json:"shareSubscriptionObjectId,omitempty"` + // ShareSubscriptionStatus - READ-ONLY; Gets the status of share subscription. Possible values include: 'Active', 'Revoked', 'SourceDeleted', 'Revoking' + ShareSubscriptionStatus ShareSubscriptionStatus `json:"shareSubscriptionStatus,omitempty"` +} + +// ProviderShareSubscriptionsRevokeFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ProviderShareSubscriptionsRevokeFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ProviderShareSubscriptionsRevokeFuture) Result(client ProviderShareSubscriptionsClient) (pss ProviderShareSubscription, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ProviderShareSubscriptionsRevokeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("datashare.ProviderShareSubscriptionsRevokeFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pss.Response.Response, err = future.GetResult(sender); err == nil && pss.Response.Response.StatusCode != http.StatusNoContent { + pss, err = client.RevokeResponder(pss.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ProviderShareSubscriptionsRevokeFuture", "Result", pss.Response.Response, "Failure responding to request") + } + } + return +} + +// ProxyDto base data transfer object implementation for proxy resources. +type ProxyDto struct { + // 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"` +} + +// ScheduledSourceShareSynchronizationSettingProperties a Scheduled source synchronization setting data +// transfer object. +type ScheduledSourceShareSynchronizationSettingProperties struct { + // RecurrenceInterval - Recurrence Interval. Possible values include: 'Hour', 'Day' + RecurrenceInterval RecurrenceInterval `json:"recurrenceInterval,omitempty"` + // SynchronizationTime - Synchronization time + SynchronizationTime *date.Time `json:"synchronizationTime,omitempty"` +} + +// ScheduledSourceSynchronizationSetting a type of synchronization setting based on schedule +type ScheduledSourceSynchronizationSetting struct { + // ScheduledSourceShareSynchronizationSettingProperties - Properties of scheduled synchronization + *ScheduledSourceShareSynchronizationSettingProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindSourceShareSynchronizationSetting', 'KindScheduleBased' + Kind KindBasicSourceShareSynchronizationSetting `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for ScheduledSourceSynchronizationSetting. +func (ssss ScheduledSourceSynchronizationSetting) MarshalJSON() ([]byte, error) { + ssss.Kind = KindScheduleBased + objectMap := make(map[string]interface{}) + if ssss.ScheduledSourceShareSynchronizationSettingProperties != nil { + objectMap["properties"] = ssss.ScheduledSourceShareSynchronizationSettingProperties + } + if ssss.Kind != "" { + objectMap["kind"] = ssss.Kind + } + return json.Marshal(objectMap) +} + +// AsScheduledSourceSynchronizationSetting is the BasicSourceShareSynchronizationSetting implementation for ScheduledSourceSynchronizationSetting. +func (ssss ScheduledSourceSynchronizationSetting) AsScheduledSourceSynchronizationSetting() (*ScheduledSourceSynchronizationSetting, bool) { + return &ssss, true +} + +// AsSourceShareSynchronizationSetting is the BasicSourceShareSynchronizationSetting implementation for ScheduledSourceSynchronizationSetting. +func (ssss ScheduledSourceSynchronizationSetting) AsSourceShareSynchronizationSetting() (*SourceShareSynchronizationSetting, bool) { + return nil, false +} + +// AsBasicSourceShareSynchronizationSetting is the BasicSourceShareSynchronizationSetting implementation for ScheduledSourceSynchronizationSetting. +func (ssss ScheduledSourceSynchronizationSetting) AsBasicSourceShareSynchronizationSetting() (BasicSourceShareSynchronizationSetting, bool) { + return &ssss, true +} + +// UnmarshalJSON is the custom unmarshaler for ScheduledSourceSynchronizationSetting struct. +func (ssss *ScheduledSourceSynchronizationSetting) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var scheduledSourceShareSynchronizationSettingProperties ScheduledSourceShareSynchronizationSettingProperties + err = json.Unmarshal(*v, &scheduledSourceShareSynchronizationSettingProperties) + if err != nil { + return err + } + ssss.ScheduledSourceShareSynchronizationSettingProperties = &scheduledSourceShareSynchronizationSettingProperties + } + case "kind": + if v != nil { + var kind KindBasicSourceShareSynchronizationSetting + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ssss.Kind = kind + } + } + } + + return nil +} + +// ScheduledSynchronizationSetting a type of synchronization setting based on schedule +type ScheduledSynchronizationSetting struct { + // ScheduledSynchronizationSettingProperties - Properties of scheduled synchronization + *ScheduledSynchronizationSettingProperties `json:"properties,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"` + // Kind - Possible values include: 'KindBasicSynchronizationSettingKindSynchronizationSetting', 'KindBasicSynchronizationSettingKindScheduleBased' + Kind KindBasicSynchronizationSetting `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for ScheduledSynchronizationSetting. +func (sss ScheduledSynchronizationSetting) MarshalJSON() ([]byte, error) { + sss.Kind = KindBasicSynchronizationSettingKindScheduleBased + objectMap := make(map[string]interface{}) + if sss.ScheduledSynchronizationSettingProperties != nil { + objectMap["properties"] = sss.ScheduledSynchronizationSettingProperties + } + if sss.Kind != "" { + objectMap["kind"] = sss.Kind + } + return json.Marshal(objectMap) +} + +// AsScheduledSynchronizationSetting is the BasicSynchronizationSetting implementation for ScheduledSynchronizationSetting. +func (sss ScheduledSynchronizationSetting) AsScheduledSynchronizationSetting() (*ScheduledSynchronizationSetting, bool) { + return &sss, true +} + +// AsSynchronizationSetting is the BasicSynchronizationSetting implementation for ScheduledSynchronizationSetting. +func (sss ScheduledSynchronizationSetting) AsSynchronizationSetting() (*SynchronizationSetting, bool) { + return nil, false +} + +// AsBasicSynchronizationSetting is the BasicSynchronizationSetting implementation for ScheduledSynchronizationSetting. +func (sss ScheduledSynchronizationSetting) AsBasicSynchronizationSetting() (BasicSynchronizationSetting, bool) { + return &sss, true +} + +// UnmarshalJSON is the custom unmarshaler for ScheduledSynchronizationSetting struct. +func (sss *ScheduledSynchronizationSetting) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var scheduledSynchronizationSettingProperties ScheduledSynchronizationSettingProperties + err = json.Unmarshal(*v, &scheduledSynchronizationSettingProperties) + if err != nil { + return err + } + sss.ScheduledSynchronizationSettingProperties = &scheduledSynchronizationSettingProperties + } + case "kind": + if v != nil { + var kind KindBasicSynchronizationSetting + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + sss.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sss.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sss.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sss.Type = &typeVar + } + } + } + + return nil +} + +// ScheduledSynchronizationSettingProperties a Scheduled synchronization setting data transfer object. +type ScheduledSynchronizationSettingProperties struct { + // CreatedAt - READ-ONLY; Time at which the synchronization setting was created. + CreatedAt *date.Time `json:"createdAt,omitempty"` + // ProvisioningState - READ-ONLY; Gets or sets the provisioning state. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // RecurrenceInterval - Recurrence Interval. Possible values include: 'Hour', 'Day' + RecurrenceInterval RecurrenceInterval `json:"recurrenceInterval,omitempty"` + // SynchronizationTime - Synchronization time + SynchronizationTime *date.Time `json:"synchronizationTime,omitempty"` + // UserName - READ-ONLY; Name of the user who created the synchronization setting. + UserName *string `json:"userName,omitempty"` +} + +// ScheduledTrigger a type of trigger based on schedule +type ScheduledTrigger struct { + // ScheduledTriggerProperties - Properties of scheduled synchronization + *ScheduledTriggerProperties `json:"properties,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"` + // Kind - Possible values include: 'KindBasicTriggerKindTrigger', 'KindBasicTriggerKindScheduleBased' + Kind KindBasicTrigger `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for ScheduledTrigger. +func (st ScheduledTrigger) MarshalJSON() ([]byte, error) { + st.Kind = KindBasicTriggerKindScheduleBased + objectMap := make(map[string]interface{}) + if st.ScheduledTriggerProperties != nil { + objectMap["properties"] = st.ScheduledTriggerProperties + } + if st.Kind != "" { + objectMap["kind"] = st.Kind + } + return json.Marshal(objectMap) +} + +// AsScheduledTrigger is the BasicTrigger implementation for ScheduledTrigger. +func (st ScheduledTrigger) AsScheduledTrigger() (*ScheduledTrigger, bool) { + return &st, true +} + +// AsTrigger is the BasicTrigger implementation for ScheduledTrigger. +func (st ScheduledTrigger) AsTrigger() (*Trigger, bool) { + return nil, false +} + +// AsBasicTrigger is the BasicTrigger implementation for ScheduledTrigger. +func (st ScheduledTrigger) AsBasicTrigger() (BasicTrigger, bool) { + return &st, true +} + +// UnmarshalJSON is the custom unmarshaler for ScheduledTrigger struct. +func (st *ScheduledTrigger) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var scheduledTriggerProperties ScheduledTriggerProperties + err = json.Unmarshal(*v, &scheduledTriggerProperties) + if err != nil { + return err + } + st.ScheduledTriggerProperties = &scheduledTriggerProperties + } + case "kind": + if v != nil { + var kind KindBasicTrigger + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + st.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + st.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + st.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + st.Type = &typeVar + } + } + } + + return nil +} + +// ScheduledTriggerProperties a Scheduled trigger data transfer object. +type ScheduledTriggerProperties struct { + // CreatedAt - READ-ONLY; Time at which the trigger was created. + CreatedAt *date.Time `json:"createdAt,omitempty"` + // ProvisioningState - READ-ONLY; Gets the provisioning state. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // RecurrenceInterval - Recurrence Interval. Possible values include: 'Hour', 'Day' + RecurrenceInterval RecurrenceInterval `json:"recurrenceInterval,omitempty"` + // SynchronizationMode - Synchronization mode. Possible values include: 'Incremental', 'FullSync' + SynchronizationMode SynchronizationMode `json:"synchronizationMode,omitempty"` + // SynchronizationTime - Synchronization time + SynchronizationTime *date.Time `json:"synchronizationTime,omitempty"` + // TriggerStatus - READ-ONLY; Gets the trigger state. Possible values include: 'TriggerStatusActive', 'TriggerStatusInactive', 'TriggerStatusSourceSynchronizationSettingDeleted' + TriggerStatus TriggerStatus `json:"triggerStatus,omitempty"` + // UserName - READ-ONLY; Name of the user who created the trigger. + UserName *string `json:"userName,omitempty"` +} + +// Share a share data transfer object. +type Share struct { + autorest.Response `json:"-"` + // ShareProperties - Properties on the share + *ShareProperties `json:"properties,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 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 +} + +// ShareList list response for get Shares. +type ShareList struct { + autorest.Response `json:"-"` + // NextLink - The Url of next result page. + NextLink *string `json:"nextLink,omitempty"` + // Value - Collection of items of type DataTransferObjects. + Value *[]Share `json:"value,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 share property bag. +type ShareProperties struct { + // CreatedAt - READ-ONLY; Time at which the share was created. + CreatedAt *date.Time `json:"createdAt,omitempty"` + // Description - Share description. + Description *string `json:"description,omitempty"` + // ProvisioningState - READ-ONLY; Gets or sets the provisioning state. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // ShareKind - Share kind. Possible values include: 'CopyBased', 'InPlace' + ShareKind ShareKind `json:"shareKind,omitempty"` + // Terms - Share terms. + Terms *string `json:"terms,omitempty"` + // UserEmail - READ-ONLY; Email of the user who created the resource + UserEmail *string `json:"userEmail,omitempty"` + // UserName - READ-ONLY; Name of the user who created the resource + UserName *string `json:"userName,omitempty"` +} + +// 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) (or OperationResponse, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SharesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("datashare.SharesDeleteFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if or.Response.Response, err = future.GetResult(sender); err == nil && or.Response.Response.StatusCode != http.StatusNoContent { + or, err = client.DeleteResponder(or.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SharesDeleteFuture", "Result", or.Response.Response, "Failure responding to request") + } + } + return +} + +// ShareSubscription a share subscription data transfer object. +type ShareSubscription struct { + autorest.Response `json:"-"` + // ShareSubscriptionProperties - Properties on the share subscription + *ShareSubscriptionProperties `json:"properties,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 ShareSubscription. +func (ss ShareSubscription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ss.ShareSubscriptionProperties != nil { + objectMap["properties"] = ss.ShareSubscriptionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ShareSubscription struct. +func (ss *ShareSubscription) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var shareSubscriptionProperties ShareSubscriptionProperties + err = json.Unmarshal(*v, &shareSubscriptionProperties) + if err != nil { + return err + } + ss.ShareSubscriptionProperties = &shareSubscriptionProperties + } + 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 +} + +// ShareSubscriptionList list response for get ShareSubscription. +type ShareSubscriptionList struct { + autorest.Response `json:"-"` + // NextLink - The Url of next result page. + NextLink *string `json:"nextLink,omitempty"` + // Value - Collection of items of type DataTransferObjects. + Value *[]ShareSubscription `json:"value,omitempty"` +} + +// ShareSubscriptionListIterator provides access to a complete listing of ShareSubscription values. +type ShareSubscriptionListIterator struct { + i int + page ShareSubscriptionListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ShareSubscriptionListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ShareSubscriptionListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ShareSubscriptionListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ShareSubscriptionListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ShareSubscriptionListIterator) Response() ShareSubscriptionList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ShareSubscriptionListIterator) Value() ShareSubscription { + if !iter.page.NotDone() { + return ShareSubscription{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ShareSubscriptionListIterator type. +func NewShareSubscriptionListIterator(page ShareSubscriptionListPage) ShareSubscriptionListIterator { + return ShareSubscriptionListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ssl ShareSubscriptionList) IsEmpty() bool { + return ssl.Value == nil || len(*ssl.Value) == 0 +} + +// shareSubscriptionListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ssl ShareSubscriptionList) shareSubscriptionListPreparer(ctx context.Context) (*http.Request, error) { + if ssl.NextLink == nil || len(to.String(ssl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ssl.NextLink))) +} + +// ShareSubscriptionListPage contains a page of ShareSubscription values. +type ShareSubscriptionListPage struct { + fn func(context.Context, ShareSubscriptionList) (ShareSubscriptionList, error) + ssl ShareSubscriptionList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ShareSubscriptionListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ShareSubscriptionListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.ssl) + if err != nil { + return err + } + page.ssl = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ShareSubscriptionListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ShareSubscriptionListPage) NotDone() bool { + return !page.ssl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ShareSubscriptionListPage) Response() ShareSubscriptionList { + return page.ssl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ShareSubscriptionListPage) Values() []ShareSubscription { + if page.ssl.IsEmpty() { + return nil + } + return *page.ssl.Value +} + +// Creates a new instance of the ShareSubscriptionListPage type. +func NewShareSubscriptionListPage(getNextPage func(context.Context, ShareSubscriptionList) (ShareSubscriptionList, error)) ShareSubscriptionListPage { + return ShareSubscriptionListPage{fn: getNextPage} +} + +// ShareSubscriptionProperties share subscription property bag. +type ShareSubscriptionProperties struct { + // CreatedAt - READ-ONLY; Time at which the share subscription was created. + CreatedAt *date.Time `json:"createdAt,omitempty"` + // InvitationID - The invitation id. + InvitationID *string `json:"invitationId,omitempty"` + // ProviderEmail - READ-ONLY; Email of the provider who created the resource + ProviderEmail *string `json:"providerEmail,omitempty"` + // ProviderName - READ-ONLY; Name of the provider who created the resource + ProviderName *string `json:"providerName,omitempty"` + // ProviderTenantName - READ-ONLY; Tenant name of the provider who created the resource + ProviderTenantName *string `json:"providerTenantName,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the share subscription. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // ShareDescription - READ-ONLY; Description of share + ShareDescription *string `json:"shareDescription,omitempty"` + // ShareKind - READ-ONLY; Kind of share. Possible values include: 'CopyBased', 'InPlace' + ShareKind ShareKind `json:"shareKind,omitempty"` + // ShareName - READ-ONLY; Name of the share + ShareName *string `json:"shareName,omitempty"` + // ShareSubscriptionStatus - READ-ONLY; Gets the current status of share subscription. Possible values include: 'Active', 'Revoked', 'SourceDeleted', 'Revoking' + ShareSubscriptionStatus ShareSubscriptionStatus `json:"shareSubscriptionStatus,omitempty"` + // ShareTerms - READ-ONLY; Terms of a share + ShareTerms *string `json:"shareTerms,omitempty"` + // SourceShareLocation - Source share location. + SourceShareLocation *string `json:"sourceShareLocation,omitempty"` + // UserEmail - READ-ONLY; Email of the user who created the resource + UserEmail *string `json:"userEmail,omitempty"` + // UserName - READ-ONLY; Name of the user who created the resource + UserName *string `json:"userName,omitempty"` +} + +// ShareSubscriptionsCancelSynchronizationFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ShareSubscriptionsCancelSynchronizationFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ShareSubscriptionsCancelSynchronizationFuture) Result(client ShareSubscriptionsClient) (sss ShareSubscriptionSynchronization, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsCancelSynchronizationFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("datashare.ShareSubscriptionsCancelSynchronizationFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sss.Response.Response, err = future.GetResult(sender); err == nil && sss.Response.Response.StatusCode != http.StatusNoContent { + sss, err = client.CancelSynchronizationResponder(sss.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsCancelSynchronizationFuture", "Result", sss.Response.Response, "Failure responding to request") + } + } + return +} + +// ShareSubscriptionsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ShareSubscriptionsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ShareSubscriptionsDeleteFuture) Result(client ShareSubscriptionsClient) (or OperationResponse, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("datashare.ShareSubscriptionsDeleteFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if or.Response.Response, err = future.GetResult(sender); err == nil && or.Response.Response.StatusCode != http.StatusNoContent { + or, err = client.DeleteResponder(or.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsDeleteFuture", "Result", or.Response.Response, "Failure responding to request") + } + } + return +} + +// ShareSubscriptionsSynchronizeMethodFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ShareSubscriptionsSynchronizeMethodFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ShareSubscriptionsSynchronizeMethodFuture) Result(client ShareSubscriptionsClient) (sss ShareSubscriptionSynchronization, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsSynchronizeMethodFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("datashare.ShareSubscriptionsSynchronizeMethodFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sss.Response.Response, err = future.GetResult(sender); err == nil && sss.Response.Response.StatusCode != http.StatusNoContent { + sss, err = client.SynchronizeMethodResponder(sss.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsSynchronizeMethodFuture", "Result", sss.Response.Response, "Failure responding to request") + } + } + return +} + +// ShareSubscriptionSynchronization a ShareSubscriptionSynchronization data transfer object. +type ShareSubscriptionSynchronization struct { + autorest.Response `json:"-"` + // DurationMs - READ-ONLY; Synchronization duration + DurationMs *int32 `json:"durationMs,omitempty"` + // EndTime - READ-ONLY; End time of synchronization + EndTime *date.Time `json:"endTime,omitempty"` + // Message - READ-ONLY; message of Synchronization + Message *string `json:"message,omitempty"` + // StartTime - READ-ONLY; start time of synchronization + StartTime *date.Time `json:"startTime,omitempty"` + // Status - READ-ONLY; Raw Status + Status *string `json:"status,omitempty"` + // SynchronizationID - Synchronization id + SynchronizationID *string `json:"synchronizationId,omitempty"` + // SynchronizationMode - READ-ONLY; Synchronization Mode. Possible values include: 'Incremental', 'FullSync' + SynchronizationMode SynchronizationMode `json:"synchronizationMode,omitempty"` +} + +// ShareSubscriptionSynchronizationList a consumer side list of share subscription synchronizations +type ShareSubscriptionSynchronizationList struct { + autorest.Response `json:"-"` + // NextLink - The Url of next result page. + NextLink *string `json:"nextLink,omitempty"` + // Value - Collection of items of type DataTransferObjects. + Value *[]ShareSubscriptionSynchronization `json:"value,omitempty"` +} + +// ShareSubscriptionSynchronizationListIterator provides access to a complete listing of +// ShareSubscriptionSynchronization values. +type ShareSubscriptionSynchronizationListIterator struct { + i int + page ShareSubscriptionSynchronizationListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ShareSubscriptionSynchronizationListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ShareSubscriptionSynchronizationListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ShareSubscriptionSynchronizationListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ShareSubscriptionSynchronizationListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ShareSubscriptionSynchronizationListIterator) Response() ShareSubscriptionSynchronizationList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ShareSubscriptionSynchronizationListIterator) Value() ShareSubscriptionSynchronization { + if !iter.page.NotDone() { + return ShareSubscriptionSynchronization{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ShareSubscriptionSynchronizationListIterator type. +func NewShareSubscriptionSynchronizationListIterator(page ShareSubscriptionSynchronizationListPage) ShareSubscriptionSynchronizationListIterator { + return ShareSubscriptionSynchronizationListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sssl ShareSubscriptionSynchronizationList) IsEmpty() bool { + return sssl.Value == nil || len(*sssl.Value) == 0 +} + +// shareSubscriptionSynchronizationListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sssl ShareSubscriptionSynchronizationList) shareSubscriptionSynchronizationListPreparer(ctx context.Context) (*http.Request, error) { + if sssl.NextLink == nil || len(to.String(sssl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sssl.NextLink))) +} + +// ShareSubscriptionSynchronizationListPage contains a page of ShareSubscriptionSynchronization values. +type ShareSubscriptionSynchronizationListPage struct { + fn func(context.Context, ShareSubscriptionSynchronizationList) (ShareSubscriptionSynchronizationList, error) + sssl ShareSubscriptionSynchronizationList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ShareSubscriptionSynchronizationListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ShareSubscriptionSynchronizationListPage.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.sssl) + if err != nil { + return err + } + page.sssl = 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 *ShareSubscriptionSynchronizationListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ShareSubscriptionSynchronizationListPage) NotDone() bool { + return !page.sssl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ShareSubscriptionSynchronizationListPage) Response() ShareSubscriptionSynchronizationList { + return page.sssl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ShareSubscriptionSynchronizationListPage) Values() []ShareSubscriptionSynchronization { + if page.sssl.IsEmpty() { + return nil + } + return *page.sssl.Value +} + +// Creates a new instance of the ShareSubscriptionSynchronizationListPage type. +func NewShareSubscriptionSynchronizationListPage(getNextPage func(context.Context, ShareSubscriptionSynchronizationList) (ShareSubscriptionSynchronizationList, error)) ShareSubscriptionSynchronizationListPage { + return ShareSubscriptionSynchronizationListPage{fn: getNextPage} +} + +// ShareSynchronization a ShareSynchronization data transfer object. +type ShareSynchronization struct { + // ConsumerEmail - Email of the user who created the synchronization + ConsumerEmail *string `json:"consumerEmail,omitempty"` + // ConsumerName - Name of the user who created the synchronization + ConsumerName *string `json:"consumerName,omitempty"` + // ConsumerTenantName - Tenant name of the consumer who created the synchronization + ConsumerTenantName *string `json:"consumerTenantName,omitempty"` + // DurationMs - synchronization duration + DurationMs *int32 `json:"durationMs,omitempty"` + // EndTime - End time of synchronization + EndTime *date.Time `json:"endTime,omitempty"` + // Message - message of synchronization + Message *string `json:"message,omitempty"` + // StartTime - start time of synchronization + StartTime *date.Time `json:"startTime,omitempty"` + // Status - Raw Status + Status *string `json:"status,omitempty"` + // SynchronizationID - Synchronization id + SynchronizationID *string `json:"synchronizationId,omitempty"` + // SynchronizationMode - READ-ONLY; Synchronization mode. Possible values include: 'Incremental', 'FullSync' + SynchronizationMode SynchronizationMode `json:"synchronizationMode,omitempty"` +} + +// ShareSynchronizationList list response for get ShareSynchronization. +type ShareSynchronizationList struct { + autorest.Response `json:"-"` + // NextLink - The Url of next result page. + NextLink *string `json:"nextLink,omitempty"` + // Value - Collection of items of type DataTransferObjects. + Value *[]ShareSynchronization `json:"value,omitempty"` +} + +// ShareSynchronizationListIterator provides access to a complete listing of ShareSynchronization values. +type ShareSynchronizationListIterator struct { + i int + page ShareSynchronizationListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ShareSynchronizationListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ShareSynchronizationListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ShareSynchronizationListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ShareSynchronizationListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ShareSynchronizationListIterator) Response() ShareSynchronizationList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ShareSynchronizationListIterator) Value() ShareSynchronization { + if !iter.page.NotDone() { + return ShareSynchronization{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ShareSynchronizationListIterator type. +func NewShareSynchronizationListIterator(page ShareSynchronizationListPage) ShareSynchronizationListIterator { + return ShareSynchronizationListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ssl ShareSynchronizationList) IsEmpty() bool { + return ssl.Value == nil || len(*ssl.Value) == 0 +} + +// shareSynchronizationListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ssl ShareSynchronizationList) shareSynchronizationListPreparer(ctx context.Context) (*http.Request, error) { + if ssl.NextLink == nil || len(to.String(ssl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ssl.NextLink))) +} + +// ShareSynchronizationListPage contains a page of ShareSynchronization values. +type ShareSynchronizationListPage struct { + fn func(context.Context, ShareSynchronizationList) (ShareSynchronizationList, error) + ssl ShareSynchronizationList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ShareSynchronizationListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ShareSynchronizationListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.ssl) + if err != nil { + return err + } + page.ssl = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ShareSynchronizationListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ShareSynchronizationListPage) NotDone() bool { + return !page.ssl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ShareSynchronizationListPage) Response() ShareSynchronizationList { + return page.ssl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ShareSynchronizationListPage) Values() []ShareSynchronization { + if page.ssl.IsEmpty() { + return nil + } + return *page.ssl.Value +} + +// Creates a new instance of the ShareSynchronizationListPage type. +func NewShareSynchronizationListPage(getNextPage func(context.Context, ShareSynchronizationList) (ShareSynchronizationList, error)) ShareSynchronizationListPage { + return ShareSynchronizationListPage{fn: getNextPage} +} + +// BasicSourceShareSynchronizationSetting a view of synchronization setting added by the provider +type BasicSourceShareSynchronizationSetting interface { + AsScheduledSourceSynchronizationSetting() (*ScheduledSourceSynchronizationSetting, bool) + AsSourceShareSynchronizationSetting() (*SourceShareSynchronizationSetting, bool) +} + +// SourceShareSynchronizationSetting a view of synchronization setting added by the provider +type SourceShareSynchronizationSetting struct { + // Kind - Possible values include: 'KindSourceShareSynchronizationSetting', 'KindScheduleBased' + Kind KindBasicSourceShareSynchronizationSetting `json:"kind,omitempty"` +} + +func unmarshalBasicSourceShareSynchronizationSetting(body []byte) (BasicSourceShareSynchronizationSetting, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["kind"] { + case string(KindScheduleBased): + var ssss ScheduledSourceSynchronizationSetting + err := json.Unmarshal(body, &ssss) + return ssss, err + default: + var ssss SourceShareSynchronizationSetting + err := json.Unmarshal(body, &ssss) + return ssss, err + } +} +func unmarshalBasicSourceShareSynchronizationSettingArray(body []byte) ([]BasicSourceShareSynchronizationSetting, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ssssArray := make([]BasicSourceShareSynchronizationSetting, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ssss, err := unmarshalBasicSourceShareSynchronizationSetting(*rawMessage) + if err != nil { + return nil, err + } + ssssArray[index] = ssss + } + return ssssArray, nil +} + +// MarshalJSON is the custom marshaler for SourceShareSynchronizationSetting. +func (ssss SourceShareSynchronizationSetting) MarshalJSON() ([]byte, error) { + ssss.Kind = KindSourceShareSynchronizationSetting + objectMap := make(map[string]interface{}) + if ssss.Kind != "" { + objectMap["kind"] = ssss.Kind + } + return json.Marshal(objectMap) +} + +// AsScheduledSourceSynchronizationSetting is the BasicSourceShareSynchronizationSetting implementation for SourceShareSynchronizationSetting. +func (ssss SourceShareSynchronizationSetting) AsScheduledSourceSynchronizationSetting() (*ScheduledSourceSynchronizationSetting, bool) { + return nil, false +} + +// AsSourceShareSynchronizationSetting is the BasicSourceShareSynchronizationSetting implementation for SourceShareSynchronizationSetting. +func (ssss SourceShareSynchronizationSetting) AsSourceShareSynchronizationSetting() (*SourceShareSynchronizationSetting, bool) { + return &ssss, true +} + +// AsBasicSourceShareSynchronizationSetting is the BasicSourceShareSynchronizationSetting implementation for SourceShareSynchronizationSetting. +func (ssss SourceShareSynchronizationSetting) AsBasicSourceShareSynchronizationSetting() (BasicSourceShareSynchronizationSetting, bool) { + return &ssss, true +} + +// SourceShareSynchronizationSettingList list response for get source share Synchronization settings +type SourceShareSynchronizationSettingList struct { + autorest.Response `json:"-"` + // NextLink - The Url of next result page. + NextLink *string `json:"nextLink,omitempty"` + // Value - Collection of items of type DataTransferObjects. + Value *[]BasicSourceShareSynchronizationSetting `json:"value,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SourceShareSynchronizationSettingList struct. +func (ssssl *SourceShareSynchronizationSettingList) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "nextLink": + if v != nil { + var nextLink string + err = json.Unmarshal(*v, &nextLink) + if err != nil { + return err + } + ssssl.NextLink = &nextLink + } + case "value": + if v != nil { + value, err := unmarshalBasicSourceShareSynchronizationSettingArray(*v) + if err != nil { + return err + } + ssssl.Value = &value + } + } + } + + return nil +} + +// SourceShareSynchronizationSettingListIterator provides access to a complete listing of +// SourceShareSynchronizationSetting values. +type SourceShareSynchronizationSettingListIterator struct { + i int + page SourceShareSynchronizationSettingListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *SourceShareSynchronizationSettingListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SourceShareSynchronizationSettingListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *SourceShareSynchronizationSettingListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SourceShareSynchronizationSettingListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter SourceShareSynchronizationSettingListIterator) Response() SourceShareSynchronizationSettingList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter SourceShareSynchronizationSettingListIterator) Value() BasicSourceShareSynchronizationSetting { + if !iter.page.NotDone() { + return SourceShareSynchronizationSetting{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SourceShareSynchronizationSettingListIterator type. +func NewSourceShareSynchronizationSettingListIterator(page SourceShareSynchronizationSettingListPage) SourceShareSynchronizationSettingListIterator { + return SourceShareSynchronizationSettingListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ssssl SourceShareSynchronizationSettingList) IsEmpty() bool { + return ssssl.Value == nil || len(*ssssl.Value) == 0 +} + +// sourceShareSynchronizationSettingListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ssssl SourceShareSynchronizationSettingList) sourceShareSynchronizationSettingListPreparer(ctx context.Context) (*http.Request, error) { + if ssssl.NextLink == nil || len(to.String(ssssl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ssssl.NextLink))) +} + +// SourceShareSynchronizationSettingListPage contains a page of BasicSourceShareSynchronizationSetting +// values. +type SourceShareSynchronizationSettingListPage struct { + fn func(context.Context, SourceShareSynchronizationSettingList) (SourceShareSynchronizationSettingList, error) + ssssl SourceShareSynchronizationSettingList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *SourceShareSynchronizationSettingListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SourceShareSynchronizationSettingListPage.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.ssssl) + if err != nil { + return err + } + page.ssssl = 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 *SourceShareSynchronizationSettingListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SourceShareSynchronizationSettingListPage) NotDone() bool { + return !page.ssssl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SourceShareSynchronizationSettingListPage) Response() SourceShareSynchronizationSettingList { + return page.ssssl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SourceShareSynchronizationSettingListPage) Values() []BasicSourceShareSynchronizationSetting { + if page.ssssl.IsEmpty() { + return nil + } + return *page.ssssl.Value +} + +// Creates a new instance of the SourceShareSynchronizationSettingListPage type. +func NewSourceShareSynchronizationSettingListPage(getNextPage func(context.Context, SourceShareSynchronizationSettingList) (SourceShareSynchronizationSettingList, error)) SourceShareSynchronizationSettingListPage { + return SourceShareSynchronizationSettingListPage{fn: getNextPage} +} + +// SQLDBTableDataSet a SQL DB table data set. +type SQLDBTableDataSet struct { + // SQLDBTableProperties - SQL DB table data set properties. + *SQLDBTableProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindKustoCluster', 'KindKustoDatabase', '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 +} + +// AsKustoClusterDataSet is the BasicDataSet implementation for SQLDBTableDataSet. +func (sdtds SQLDBTableDataSet) AsKustoClusterDataSet() (*KustoClusterDataSet, bool) { + return nil, false +} + +// AsKustoDatabaseDataSet is the BasicDataSet implementation for SQLDBTableDataSet. +func (sdtds SQLDBTableDataSet) AsKustoDatabaseDataSet() (*KustoDatabaseDataSet, 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 data set mapping. +type SQLDBTableDataSetMapping struct { + // SQLDBTableDataSetMappingProperties - Sql DB data set mapping properties. + *SQLDBTableDataSetMappingProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindKustoCluster', 'KindBasicDataSetMappingKindKustoDatabase', '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 +} + +// AsKustoClusterDataSetMapping is the BasicDataSetMapping implementation for SQLDBTableDataSetMapping. +func (sdtdsm SQLDBTableDataSetMapping) AsKustoClusterDataSetMapping() (*KustoClusterDataSetMapping, bool) { + return nil, false +} + +// AsKustoDatabaseDataSetMapping is the BasicDataSetMapping implementation for SQLDBTableDataSetMapping. +func (sdtdsm SQLDBTableDataSetMapping) AsKustoDatabaseDataSetMapping() (*KustoDatabaseDataSetMapping, 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 - The id of the source data set. + DataSetID *string `json:"dataSetId,omitempty"` + // DataSetMappingStatus - READ-ONLY; Gets the status of the data set mapping. Possible values include: 'Ok', 'Broken' + DataSetMappingStatus DataSetMappingStatus `json:"dataSetMappingStatus,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the data set mapping. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // SchemaName - Schema of the table. Default value is dbo. + SchemaName *string `json:"schemaName,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"` + // SchemaName - Schema of the table. Default value is dbo. + SchemaName *string `json:"schemaName,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 data set. +type SQLDWTableDataSet struct { + // SQLDWTableProperties - SQL DW table data set properties. + *SQLDWTableProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindKustoCluster', 'KindKustoDatabase', '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 +} + +// AsKustoClusterDataSet is the BasicDataSet implementation for SQLDWTableDataSet. +func (sdtds SQLDWTableDataSet) AsKustoClusterDataSet() (*KustoClusterDataSet, bool) { + return nil, false +} + +// AsKustoDatabaseDataSet is the BasicDataSet implementation for SQLDWTableDataSet. +func (sdtds SQLDWTableDataSet) AsKustoDatabaseDataSet() (*KustoDatabaseDataSet, 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 data set mapping. +type SQLDWTableDataSetMapping struct { + // SQLDWTableDataSetMappingProperties - Sql DW data set mapping properties. + *SQLDWTableDataSetMappingProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindKustoCluster', 'KindBasicDataSetMappingKindKustoDatabase', '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 +} + +// AsKustoClusterDataSetMapping is the BasicDataSetMapping implementation for SQLDWTableDataSetMapping. +func (sdtdsm SQLDWTableDataSetMapping) AsKustoClusterDataSetMapping() (*KustoClusterDataSetMapping, bool) { + return nil, false +} + +// AsKustoDatabaseDataSetMapping is the BasicDataSetMapping implementation for SQLDWTableDataSetMapping. +func (sdtdsm SQLDWTableDataSetMapping) AsKustoDatabaseDataSetMapping() (*KustoDatabaseDataSetMapping, 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 - The id of the source data set. + DataSetID *string `json:"dataSetId,omitempty"` + // DataSetMappingStatus - READ-ONLY; Gets the status of the data set mapping. Possible values include: 'Ok', 'Broken' + DataSetMappingStatus DataSetMappingStatus `json:"dataSetMappingStatus,omitempty"` + // DataWarehouseName - DataWarehouse name of the source data set + DataWarehouseName *string `json:"dataWarehouseName,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the data set mapping. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // SchemaName - Schema of the table. Default value is dbo. + SchemaName *string `json:"schemaName,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"` + // SchemaName - Schema of the table. Default value is dbo. + SchemaName *string `json:"schemaName,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 data set level +type SynchronizationDetails struct { + // DataSetID - READ-ONLY; Id of data set + DataSetID *string `json:"dataSetId,omitempty"` + // DataSetType - READ-ONLY; Type of the data set. Possible values include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SQLDBTable', 'SQLDWTable' + DataSetType DataSetType `json:"dataSetType,omitempty"` + // DurationMs - READ-ONLY; Duration of data set level copy + DurationMs *int32 `json:"durationMs,omitempty"` + // EndTime - READ-ONLY; End time of data set level copy + EndTime *date.Time `json:"endTime,omitempty"` + // FilesRead - READ-ONLY; The number of files read from the source data set + FilesRead *int64 `json:"filesRead,omitempty"` + // FilesWritten - READ-ONLY; The number of files written into the sink data set + FilesWritten *int64 `json:"filesWritten,omitempty"` + // Message - READ-ONLY; Error message if any + Message *string `json:"message,omitempty"` + // Name - READ-ONLY; Name of the data set + Name *string `json:"name,omitempty"` + // RowsCopied - READ-ONLY; The number of files copied into the sink data set + RowsCopied *int64 `json:"rowsCopied,omitempty"` + // RowsRead - READ-ONLY; The number of rows read from the source data set. + RowsRead *int64 `json:"rowsRead,omitempty"` + // SizeRead - READ-ONLY; The size of the data read from the source data set in bytes + SizeRead *int64 `json:"sizeRead,omitempty"` + // SizeWritten - READ-ONLY; The size of the data written into the sink data set in bytes + SizeWritten *int64 `json:"sizeWritten,omitempty"` + // StartTime - READ-ONLY; Start time of data set level copy + StartTime *date.Time `json:"startTime,omitempty"` + // Status - READ-ONLY; Raw Status + Status *string `json:"status,omitempty"` + // VCore - READ-ONLY; The vCore units consumed for the data set synchronization + VCore *int64 `json:"vCore,omitempty"` +} + +// SynchronizationDetailsList details of synchronization +type SynchronizationDetailsList struct { + autorest.Response `json:"-"` + // NextLink - The Url of next result page. + NextLink *string `json:"nextLink,omitempty"` + // Value - Collection of items of type DataTransferObjects. + Value *[]SynchronizationDetails `json:"value,omitempty"` +} + +// SynchronizationDetailsListIterator provides access to a complete listing of SynchronizationDetails +// values. +type SynchronizationDetailsListIterator struct { + i int + page SynchronizationDetailsListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *SynchronizationDetailsListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SynchronizationDetailsListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *SynchronizationDetailsListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SynchronizationDetailsListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter SynchronizationDetailsListIterator) Response() SynchronizationDetailsList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter SynchronizationDetailsListIterator) Value() SynchronizationDetails { + if !iter.page.NotDone() { + return SynchronizationDetails{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SynchronizationDetailsListIterator type. +func NewSynchronizationDetailsListIterator(page SynchronizationDetailsListPage) SynchronizationDetailsListIterator { + return SynchronizationDetailsListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sdl SynchronizationDetailsList) IsEmpty() bool { + return sdl.Value == nil || len(*sdl.Value) == 0 +} + +// synchronizationDetailsListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sdl SynchronizationDetailsList) synchronizationDetailsListPreparer(ctx context.Context) (*http.Request, error) { + if sdl.NextLink == nil || len(to.String(sdl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sdl.NextLink))) +} + +// SynchronizationDetailsListPage contains a page of SynchronizationDetails values. +type SynchronizationDetailsListPage struct { + fn func(context.Context, SynchronizationDetailsList) (SynchronizationDetailsList, error) + sdl SynchronizationDetailsList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *SynchronizationDetailsListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SynchronizationDetailsListPage.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.sdl) + if err != nil { + return err + } + page.sdl = 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 *SynchronizationDetailsListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SynchronizationDetailsListPage) NotDone() bool { + return !page.sdl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SynchronizationDetailsListPage) Response() SynchronizationDetailsList { + return page.sdl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SynchronizationDetailsListPage) Values() []SynchronizationDetails { + if page.sdl.IsEmpty() { + return nil + } + return *page.sdl.Value +} + +// Creates a new instance of the SynchronizationDetailsListPage type. +func NewSynchronizationDetailsListPage(getNextPage func(context.Context, SynchronizationDetailsList) (SynchronizationDetailsList, error)) SynchronizationDetailsListPage { + return SynchronizationDetailsListPage{fn: getNextPage} +} + +// BasicSynchronizationSetting a Synchronization Setting data transfer object. +type BasicSynchronizationSetting interface { + AsScheduledSynchronizationSetting() (*ScheduledSynchronizationSetting, bool) + AsSynchronizationSetting() (*SynchronizationSetting, bool) +} + +// SynchronizationSetting a Synchronization Setting data transfer object. +type SynchronizationSetting struct { + autorest.Response `json:"-"` + // Kind - Possible values include: 'KindBasicSynchronizationSettingKindSynchronizationSetting', 'KindBasicSynchronizationSettingKindScheduleBased' + Kind KindBasicSynchronizationSetting `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"` +} + +func unmarshalBasicSynchronizationSetting(body []byte) (BasicSynchronizationSetting, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["kind"] { + case string(KindBasicSynchronizationSettingKindScheduleBased): + var sss ScheduledSynchronizationSetting + err := json.Unmarshal(body, &sss) + return sss, err + default: + var ss SynchronizationSetting + err := json.Unmarshal(body, &ss) + return ss, err + } +} +func unmarshalBasicSynchronizationSettingArray(body []byte) ([]BasicSynchronizationSetting, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ssArray := make([]BasicSynchronizationSetting, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ss, err := unmarshalBasicSynchronizationSetting(*rawMessage) + if err != nil { + return nil, err + } + ssArray[index] = ss + } + return ssArray, nil +} + +// MarshalJSON is the custom marshaler for SynchronizationSetting. +func (ss SynchronizationSetting) MarshalJSON() ([]byte, error) { + ss.Kind = KindBasicSynchronizationSettingKindSynchronizationSetting + objectMap := make(map[string]interface{}) + if ss.Kind != "" { + objectMap["kind"] = ss.Kind + } + return json.Marshal(objectMap) +} + +// AsScheduledSynchronizationSetting is the BasicSynchronizationSetting implementation for SynchronizationSetting. +func (ss SynchronizationSetting) AsScheduledSynchronizationSetting() (*ScheduledSynchronizationSetting, bool) { + return nil, false +} + +// AsSynchronizationSetting is the BasicSynchronizationSetting implementation for SynchronizationSetting. +func (ss SynchronizationSetting) AsSynchronizationSetting() (*SynchronizationSetting, bool) { + return &ss, true +} + +// AsBasicSynchronizationSetting is the BasicSynchronizationSetting implementation for SynchronizationSetting. +func (ss SynchronizationSetting) AsBasicSynchronizationSetting() (BasicSynchronizationSetting, bool) { + return &ss, true +} + +// SynchronizationSettingList list response for get Synchronization settings +type SynchronizationSettingList struct { + autorest.Response `json:"-"` + // NextLink - The Url of next result page. + NextLink *string `json:"nextLink,omitempty"` + // Value - Collection of items of type DataTransferObjects. + Value *[]BasicSynchronizationSetting `json:"value,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SynchronizationSettingList struct. +func (ssl *SynchronizationSettingList) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "nextLink": + if v != nil { + var nextLink string + err = json.Unmarshal(*v, &nextLink) + if err != nil { + return err + } + ssl.NextLink = &nextLink + } + case "value": + if v != nil { + value, err := unmarshalBasicSynchronizationSettingArray(*v) + if err != nil { + return err + } + ssl.Value = &value + } + } + } + + return nil +} + +// SynchronizationSettingListIterator provides access to a complete listing of SynchronizationSetting +// values. +type SynchronizationSettingListIterator struct { + i int + page SynchronizationSettingListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *SynchronizationSettingListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SynchronizationSettingListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *SynchronizationSettingListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SynchronizationSettingListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter SynchronizationSettingListIterator) Response() SynchronizationSettingList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter SynchronizationSettingListIterator) Value() BasicSynchronizationSetting { + if !iter.page.NotDone() { + return SynchronizationSetting{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SynchronizationSettingListIterator type. +func NewSynchronizationSettingListIterator(page SynchronizationSettingListPage) SynchronizationSettingListIterator { + return SynchronizationSettingListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ssl SynchronizationSettingList) IsEmpty() bool { + return ssl.Value == nil || len(*ssl.Value) == 0 +} + +// synchronizationSettingListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ssl SynchronizationSettingList) synchronizationSettingListPreparer(ctx context.Context) (*http.Request, error) { + if ssl.NextLink == nil || len(to.String(ssl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ssl.NextLink))) +} + +// SynchronizationSettingListPage contains a page of BasicSynchronizationSetting values. +type SynchronizationSettingListPage struct { + fn func(context.Context, SynchronizationSettingList) (SynchronizationSettingList, error) + ssl SynchronizationSettingList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *SynchronizationSettingListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SynchronizationSettingListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.ssl) + if err != nil { + return err + } + page.ssl = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *SynchronizationSettingListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SynchronizationSettingListPage) NotDone() bool { + return !page.ssl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SynchronizationSettingListPage) Response() SynchronizationSettingList { + return page.ssl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SynchronizationSettingListPage) Values() []BasicSynchronizationSetting { + if page.ssl.IsEmpty() { + return nil + } + return *page.ssl.Value +} + +// Creates a new instance of the SynchronizationSettingListPage type. +func NewSynchronizationSettingListPage(getNextPage func(context.Context, SynchronizationSettingList) (SynchronizationSettingList, error)) SynchronizationSettingListPage { + return SynchronizationSettingListPage{fn: getNextPage} +} + +// SynchronizationSettingModel ... +type SynchronizationSettingModel struct { + autorest.Response `json:"-"` + Value BasicSynchronizationSetting `json:"value,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SynchronizationSettingModel struct. +func (ssm *SynchronizationSettingModel) UnmarshalJSON(body []byte) error { + ss, err := unmarshalBasicSynchronizationSetting(body) + if err != nil { + return err + } + ssm.Value = ss + + return nil +} + +// SynchronizationSettingsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type SynchronizationSettingsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *SynchronizationSettingsDeleteFuture) Result(client SynchronizationSettingsClient) (or OperationResponse, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SynchronizationSettingsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("datashare.SynchronizationSettingsDeleteFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if or.Response.Response, err = future.GetResult(sender); err == nil && or.Response.Response.StatusCode != http.StatusNoContent { + or, err = client.DeleteResponder(or.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SynchronizationSettingsDeleteFuture", "Result", or.Response.Response, "Failure responding to request") + } + } + return +} + +// Synchronize payload for the synchronizing the data. +type Synchronize struct { + // SynchronizationMode - Mode of synchronization used in triggers and snapshot sync. Incremental by default. Possible values include: 'Incremental', 'FullSync' + SynchronizationMode SynchronizationMode `json:"synchronizationMode,omitempty"` +} + +// BasicTrigger a Trigger data transfer object. +type BasicTrigger interface { + AsScheduledTrigger() (*ScheduledTrigger, bool) + AsTrigger() (*Trigger, bool) +} + +// Trigger a Trigger data transfer object. +type Trigger struct { + autorest.Response `json:"-"` + // Kind - Possible values include: 'KindBasicTriggerKindTrigger', 'KindBasicTriggerKindScheduleBased' + Kind KindBasicTrigger `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"` +} + +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(KindBasicTriggerKindScheduleBased): + var st ScheduledTrigger + err := json.Unmarshal(body, &st) + return st, 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 = KindBasicTriggerKindTrigger + objectMap := make(map[string]interface{}) + if t.Kind != "" { + objectMap["kind"] = t.Kind + } + return json.Marshal(objectMap) +} + +// AsScheduledTrigger is the BasicTrigger implementation for Trigger. +func (t Trigger) AsScheduledTrigger() (*ScheduledTrigger, 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 list response for get triggers +type TriggerList struct { + autorest.Response `json:"-"` + // NextLink - The Url of next result page. + NextLink *string `json:"nextLink,omitempty"` + // Value - Collection of items of type DataTransferObjects. + Value *[]BasicTrigger `json:"value,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 "nextLink": + if v != nil { + var nextLink string + err = json.Unmarshal(*v, &nextLink) + if err != nil { + return err + } + tl.NextLink = &nextLink + } + case "value": + if v != nil { + value, err := unmarshalBasicTriggerArray(*v) + if err != nil { + return err + } + tl.Value = &value + } + } + } + + 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 +} + +// TriggersCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type TriggersCreateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *TriggersCreateFuture) Result(client TriggersClient) (tm TriggerModel, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.TriggersCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("datashare.TriggersCreateFuture") + 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.CreateResponder(tm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.TriggersCreateFuture", "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) (or OperationResponse, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.TriggersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("datashare.TriggersDeleteFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if or.Response.Response, err = future.GetResult(sender); err == nil && or.Response.Response.StatusCode != http.StatusNoContent { + or, err = client.DeleteResponder(or.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.TriggersDeleteFuture", "Result", or.Response.Response, "Failure responding to request") + } + } + return +} diff --git a/services/datashare/mgmt/2019-11-01/datashare/operations.go b/services/datashare/mgmt/2019-11-01/datashare/operations.go new file mode 100644 index 000000000000..ea17af90cb0d --- /dev/null +++ b/services/datashare/mgmt/2019-11-01/datashare/operations.go @@ -0,0 +1,147 @@ +package datashare + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if 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 creates a Microsoft.DataShare management 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 list of available 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.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, "datashare.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, "datashare.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.ol, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.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-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.DataShare/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 OperationList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client OperationsClient) listNextResults(ctx context.Context, lastResults OperationList) (result OperationList, err error) { + req, err := lastResults.operationListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "datashare.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, "datashare.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.OperationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client OperationsClient) ListComplete(ctx context.Context) (result OperationListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} diff --git a/services/datashare/mgmt/2019-11-01/datashare/providersharesubscriptions.go b/services/datashare/mgmt/2019-11-01/datashare/providersharesubscriptions.go new file mode 100644 index 000000000000..0eba20ca48b6 --- /dev/null +++ b/services/datashare/mgmt/2019-11-01/datashare/providersharesubscriptions.go @@ -0,0 +1,405 @@ +package datashare + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if 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" +) + +// ProviderShareSubscriptionsClient is the creates a Microsoft.DataShare management client. +type ProviderShareSubscriptionsClient struct { + BaseClient +} + +// NewProviderShareSubscriptionsClient creates an instance of the ProviderShareSubscriptionsClient client. +func NewProviderShareSubscriptionsClient(subscriptionID string) ProviderShareSubscriptionsClient { + return NewProviderShareSubscriptionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewProviderShareSubscriptionsClientWithBaseURI creates an instance of the ProviderShareSubscriptionsClient client. +func NewProviderShareSubscriptionsClientWithBaseURI(baseURI string, subscriptionID string) ProviderShareSubscriptionsClient { + return ProviderShareSubscriptionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// GetByShare get share subscription in a provider share +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareName - the name of the share. +// providerShareSubscriptionID - to locate shareSubscription +func (client ProviderShareSubscriptionsClient) GetByShare(ctx context.Context, resourceGroupName string, accountName string, shareName string, providerShareSubscriptionID string) (result ProviderShareSubscription, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProviderShareSubscriptionsClient.GetByShare") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetBySharePreparer(ctx, resourceGroupName, accountName, shareName, providerShareSubscriptionID) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ProviderShareSubscriptionsClient", "GetByShare", nil, "Failure preparing request") + return + } + + resp, err := client.GetByShareSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.ProviderShareSubscriptionsClient", "GetByShare", resp, "Failure sending request") + return + } + + result, err = client.GetByShareResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ProviderShareSubscriptionsClient", "GetByShare", resp, "Failure responding to request") + } + + return +} + +// GetBySharePreparer prepares the GetByShare request. +func (client ProviderShareSubscriptionsClient) GetBySharePreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, providerShareSubscriptionID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "providerShareSubscriptionId": autorest.Encode("path", providerShareSubscriptionID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareName": autorest.Encode("path", shareName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions/{providerShareSubscriptionId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetByShareSender sends the GetByShare request. The method will close the +// http.Response Body if it receives an error. +func (client ProviderShareSubscriptionsClient) GetByShareSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetByShareResponder handles the response to the GetByShare request. The method always +// closes the http.Response Body. +func (client ProviderShareSubscriptionsClient) GetByShareResponder(resp *http.Response) (result ProviderShareSubscription, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByShare list share subscriptions in a provider share +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareName - the name of the share. +// skipToken - continuation Token +func (client ProviderShareSubscriptionsClient) ListByShare(ctx context.Context, resourceGroupName string, accountName string, shareName string, skipToken string) (result ProviderShareSubscriptionListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProviderShareSubscriptionsClient.ListByShare") + defer func() { + sc := -1 + if result.pssl.Response.Response != nil { + sc = result.pssl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByShareNextResults + req, err := client.ListBySharePreparer(ctx, resourceGroupName, accountName, shareName, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ProviderShareSubscriptionsClient", "ListByShare", nil, "Failure preparing request") + return + } + + resp, err := client.ListByShareSender(req) + if err != nil { + result.pssl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.ProviderShareSubscriptionsClient", "ListByShare", resp, "Failure sending request") + return + } + + result.pssl, err = client.ListByShareResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ProviderShareSubscriptionsClient", "ListByShare", resp, "Failure responding to request") + } + + return +} + +// ListBySharePreparer prepares the ListByShare request. +func (client ProviderShareSubscriptionsClient) ListBySharePreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareName": autorest.Encode("path", shareName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByShareSender sends the ListByShare request. The method will close the +// http.Response Body if it receives an error. +func (client ProviderShareSubscriptionsClient) ListByShareSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByShareResponder handles the response to the ListByShare request. The method always +// closes the http.Response Body. +func (client ProviderShareSubscriptionsClient) ListByShareResponder(resp *http.Response) (result ProviderShareSubscriptionList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByShareNextResults retrieves the next set of results, if any. +func (client ProviderShareSubscriptionsClient) listByShareNextResults(ctx context.Context, lastResults ProviderShareSubscriptionList) (result ProviderShareSubscriptionList, err error) { + req, err := lastResults.providerShareSubscriptionListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "datashare.ProviderShareSubscriptionsClient", "listByShareNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByShareSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "datashare.ProviderShareSubscriptionsClient", "listByShareNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByShareResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ProviderShareSubscriptionsClient", "listByShareNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByShareComplete enumerates all values, automatically crossing page boundaries as required. +func (client ProviderShareSubscriptionsClient) ListByShareComplete(ctx context.Context, resourceGroupName string, accountName string, shareName string, skipToken string) (result ProviderShareSubscriptionListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProviderShareSubscriptionsClient.ListByShare") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByShare(ctx, resourceGroupName, accountName, shareName, skipToken) + return +} + +// Reinstate reinstate share subscription in a provider share +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareName - the name of the share. +// providerShareSubscriptionID - to locate shareSubscription +func (client ProviderShareSubscriptionsClient) Reinstate(ctx context.Context, resourceGroupName string, accountName string, shareName string, providerShareSubscriptionID string) (result ProviderShareSubscription, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProviderShareSubscriptionsClient.Reinstate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ReinstatePreparer(ctx, resourceGroupName, accountName, shareName, providerShareSubscriptionID) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ProviderShareSubscriptionsClient", "Reinstate", nil, "Failure preparing request") + return + } + + resp, err := client.ReinstateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.ProviderShareSubscriptionsClient", "Reinstate", resp, "Failure sending request") + return + } + + result, err = client.ReinstateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ProviderShareSubscriptionsClient", "Reinstate", resp, "Failure responding to request") + } + + return +} + +// ReinstatePreparer prepares the Reinstate request. +func (client ProviderShareSubscriptionsClient) ReinstatePreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, providerShareSubscriptionID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "providerShareSubscriptionId": autorest.Encode("path", providerShareSubscriptionID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareName": autorest.Encode("path", shareName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions/{providerShareSubscriptionId}/reinstate", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReinstateSender sends the Reinstate request. The method will close the +// http.Response Body if it receives an error. +func (client ProviderShareSubscriptionsClient) ReinstateSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ReinstateResponder handles the response to the Reinstate request. The method always +// closes the http.Response Body. +func (client ProviderShareSubscriptionsClient) ReinstateResponder(resp *http.Response) (result ProviderShareSubscription, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Revoke revoke share subscription in a provider share +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareName - the name of the share. +// providerShareSubscriptionID - to locate shareSubscription +func (client ProviderShareSubscriptionsClient) Revoke(ctx context.Context, resourceGroupName string, accountName string, shareName string, providerShareSubscriptionID string) (result ProviderShareSubscriptionsRevokeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProviderShareSubscriptionsClient.Revoke") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RevokePreparer(ctx, resourceGroupName, accountName, shareName, providerShareSubscriptionID) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ProviderShareSubscriptionsClient", "Revoke", nil, "Failure preparing request") + return + } + + result, err = client.RevokeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ProviderShareSubscriptionsClient", "Revoke", result.Response(), "Failure sending request") + return + } + + return +} + +// RevokePreparer prepares the Revoke request. +func (client ProviderShareSubscriptionsClient) RevokePreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, providerShareSubscriptionID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "providerShareSubscriptionId": autorest.Encode("path", providerShareSubscriptionID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareName": autorest.Encode("path", shareName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions/{providerShareSubscriptionId}/revoke", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RevokeSender sends the Revoke request. The method will close the +// http.Response Body if it receives an error. +func (client ProviderShareSubscriptionsClient) RevokeSender(req *http.Request) (future ProviderShareSubscriptionsRevokeFuture, 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 +} + +// RevokeResponder handles the response to the Revoke request. The method always +// closes the http.Response Body. +func (client ProviderShareSubscriptionsClient) RevokeResponder(resp *http.Response) (result ProviderShareSubscription, 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/datashare/mgmt/2019-11-01/datashare/shares.go b/services/datashare/mgmt/2019-11-01/datashare/shares.go new file mode 100644 index 000000000000..124e0dc75a99 --- /dev/null +++ b/services/datashare/mgmt/2019-11-01/datashare/shares.go @@ -0,0 +1,646 @@ +package datashare + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if 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" +) + +// SharesClient is the creates a Microsoft.DataShare management client. +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)} +} + +// Create create a share +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareName - the name of the share. +// share - the share payload +func (client SharesClient) Create(ctx context.Context, resourceGroupName string, accountName string, shareName string, share Share) (result Share, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharesClient.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, accountName, shareName, share) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SharesClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.SharesClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SharesClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client SharesClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, share Share) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareName": autorest.Encode("path", shareName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}", pathParameters), + autorest.WithJSON(share), + 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 SharesClient) 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 SharesClient) CreateResponder(resp *http.Response) (result Share, 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 share +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareName - the name of the share. +func (client SharesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, shareName 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, resourceGroupName, accountName, shareName) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SharesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SharesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client SharesClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareName": autorest.Encode("path", shareName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}", 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 OperationResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get get a share +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareName - the name of the share to retrieve. +func (client SharesClient) Get(ctx context.Context, resourceGroupName string, accountName string, shareName 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, resourceGroupName, accountName, shareName) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.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, "datashare.SharesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SharesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SharesClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareName": autorest.Encode("path", shareName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}", 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 +} + +// ListByAccount list shares in an account +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// skipToken - continuation Token +func (client SharesClient) ListByAccount(ctx context.Context, resourceGroupName string, accountName string, skipToken string) (result ShareListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharesClient.ListByAccount") + defer func() { + sc := -1 + if result.sl.Response.Response != nil { + sc = result.sl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByAccountNextResults + req, err := client.ListByAccountPreparer(ctx, resourceGroupName, accountName, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SharesClient", "ListByAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAccountSender(req) + if err != nil { + result.sl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.SharesClient", "ListByAccount", resp, "Failure sending request") + return + } + + result.sl, err = client.ListByAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SharesClient", "ListByAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAccountPreparer prepares the ListByAccount request. +func (client SharesClient) ListByAccountPreparer(ctx context.Context, resourceGroupName string, accountName string, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.DataShare/accounts/{accountName}/shares", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAccountSender sends the ListByAccount request. The method will close the +// http.Response Body if it receives an error. +func (client SharesClient) ListByAccountSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByAccountResponder handles the response to the ListByAccount request. The method always +// closes the http.Response Body. +func (client SharesClient) ListByAccountResponder(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 +} + +// listByAccountNextResults retrieves the next set of results, if any. +func (client SharesClient) listByAccountNextResults(ctx context.Context, lastResults ShareList) (result ShareList, err error) { + req, err := lastResults.shareListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "datashare.SharesClient", "listByAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "datashare.SharesClient", "listByAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SharesClient", "listByAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client SharesClient) ListByAccountComplete(ctx context.Context, resourceGroupName string, accountName string, skipToken string) (result ShareListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharesClient.ListByAccount") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByAccount(ctx, resourceGroupName, accountName, skipToken) + return +} + +// ListSynchronizationDetails list synchronization details +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareName - the name of the share. +// shareSynchronization - share Synchronization payload. +// skipToken - continuation token +func (client SharesClient) ListSynchronizationDetails(ctx context.Context, resourceGroupName string, accountName string, shareName string, shareSynchronization ShareSynchronization, skipToken string) (result SynchronizationDetailsListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharesClient.ListSynchronizationDetails") + defer func() { + sc := -1 + if result.sdl.Response.Response != nil { + sc = result.sdl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listSynchronizationDetailsNextResults + req, err := client.ListSynchronizationDetailsPreparer(ctx, resourceGroupName, accountName, shareName, shareSynchronization, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SharesClient", "ListSynchronizationDetails", nil, "Failure preparing request") + return + } + + resp, err := client.ListSynchronizationDetailsSender(req) + if err != nil { + result.sdl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.SharesClient", "ListSynchronizationDetails", resp, "Failure sending request") + return + } + + result.sdl, err = client.ListSynchronizationDetailsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SharesClient", "ListSynchronizationDetails", resp, "Failure responding to request") + } + + return +} + +// ListSynchronizationDetailsPreparer prepares the ListSynchronizationDetails request. +func (client SharesClient) ListSynchronizationDetailsPreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, shareSynchronization ShareSynchronization, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareName": autorest.Encode("path", shareName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + shareSynchronization.SynchronizationMode = "" + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/listSynchronizationDetails", pathParameters), + autorest.WithJSON(shareSynchronization), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSynchronizationDetailsSender sends the ListSynchronizationDetails request. The method will close the +// http.Response Body if it receives an error. +func (client SharesClient) ListSynchronizationDetailsSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListSynchronizationDetailsResponder handles the response to the ListSynchronizationDetails request. The method always +// closes the http.Response Body. +func (client SharesClient) ListSynchronizationDetailsResponder(resp *http.Response) (result SynchronizationDetailsList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listSynchronizationDetailsNextResults retrieves the next set of results, if any. +func (client SharesClient) listSynchronizationDetailsNextResults(ctx context.Context, lastResults SynchronizationDetailsList) (result SynchronizationDetailsList, err error) { + req, err := lastResults.synchronizationDetailsListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "datashare.SharesClient", "listSynchronizationDetailsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSynchronizationDetailsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "datashare.SharesClient", "listSynchronizationDetailsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListSynchronizationDetailsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SharesClient", "listSynchronizationDetailsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListSynchronizationDetailsComplete enumerates all values, automatically crossing page boundaries as required. +func (client SharesClient) ListSynchronizationDetailsComplete(ctx context.Context, resourceGroupName string, accountName string, shareName string, shareSynchronization ShareSynchronization, skipToken string) (result SynchronizationDetailsListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharesClient.ListSynchronizationDetails") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListSynchronizationDetails(ctx, resourceGroupName, accountName, shareName, shareSynchronization, skipToken) + return +} + +// ListSynchronizations list synchronizations of a share +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareName - the name of the share. +// skipToken - continuation token +func (client SharesClient) ListSynchronizations(ctx context.Context, resourceGroupName string, accountName string, shareName string, skipToken string) (result ShareSynchronizationListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharesClient.ListSynchronizations") + defer func() { + sc := -1 + if result.ssl.Response.Response != nil { + sc = result.ssl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listSynchronizationsNextResults + req, err := client.ListSynchronizationsPreparer(ctx, resourceGroupName, accountName, shareName, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SharesClient", "ListSynchronizations", nil, "Failure preparing request") + return + } + + resp, err := client.ListSynchronizationsSender(req) + if err != nil { + result.ssl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.SharesClient", "ListSynchronizations", resp, "Failure sending request") + return + } + + result.ssl, err = client.ListSynchronizationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SharesClient", "ListSynchronizations", resp, "Failure responding to request") + } + + return +} + +// ListSynchronizationsPreparer prepares the ListSynchronizations request. +func (client SharesClient) ListSynchronizationsPreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareName": autorest.Encode("path", shareName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/listSynchronizations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSynchronizationsSender sends the ListSynchronizations request. The method will close the +// http.Response Body if it receives an error. +func (client SharesClient) ListSynchronizationsSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListSynchronizationsResponder handles the response to the ListSynchronizations request. The method always +// closes the http.Response Body. +func (client SharesClient) ListSynchronizationsResponder(resp *http.Response) (result ShareSynchronizationList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listSynchronizationsNextResults retrieves the next set of results, if any. +func (client SharesClient) listSynchronizationsNextResults(ctx context.Context, lastResults ShareSynchronizationList) (result ShareSynchronizationList, err error) { + req, err := lastResults.shareSynchronizationListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "datashare.SharesClient", "listSynchronizationsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSynchronizationsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "datashare.SharesClient", "listSynchronizationsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListSynchronizationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SharesClient", "listSynchronizationsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListSynchronizationsComplete enumerates all values, automatically crossing page boundaries as required. +func (client SharesClient) ListSynchronizationsComplete(ctx context.Context, resourceGroupName string, accountName string, shareName string, skipToken string) (result ShareSynchronizationListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharesClient.ListSynchronizations") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListSynchronizations(ctx, resourceGroupName, accountName, shareName, skipToken) + return +} diff --git a/services/datashare/mgmt/2019-11-01/datashare/sharesubscriptions.go b/services/datashare/mgmt/2019-11-01/datashare/sharesubscriptions.go new file mode 100644 index 000000000000..70ef3d859592 --- /dev/null +++ b/services/datashare/mgmt/2019-11-01/datashare/sharesubscriptions.go @@ -0,0 +1,964 @@ +package datashare + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the 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" +) + +// ShareSubscriptionsClient is the creates a Microsoft.DataShare management client. +type ShareSubscriptionsClient struct { + BaseClient +} + +// NewShareSubscriptionsClient creates an instance of the ShareSubscriptionsClient client. +func NewShareSubscriptionsClient(subscriptionID string) ShareSubscriptionsClient { + return NewShareSubscriptionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewShareSubscriptionsClientWithBaseURI creates an instance of the ShareSubscriptionsClient client. +func NewShareSubscriptionsClientWithBaseURI(baseURI string, subscriptionID string) ShareSubscriptionsClient { + return ShareSubscriptionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CancelSynchronization request to cancel a synchronization. +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareSubscriptionName - the name of the shareSubscription. +// shareSubscriptionSynchronization - share Subscription Synchronization payload. +func (client ShareSubscriptionsClient) CancelSynchronization(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, shareSubscriptionSynchronization ShareSubscriptionSynchronization) (result ShareSubscriptionsCancelSynchronizationFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ShareSubscriptionsClient.CancelSynchronization") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: shareSubscriptionSynchronization, + Constraints: []validation.Constraint{{Target: "shareSubscriptionSynchronization.SynchronizationID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("datashare.ShareSubscriptionsClient", "CancelSynchronization", err.Error()) + } + + req, err := client.CancelSynchronizationPreparer(ctx, resourceGroupName, accountName, shareSubscriptionName, shareSubscriptionSynchronization) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "CancelSynchronization", nil, "Failure preparing request") + return + } + + result, err = client.CancelSynchronizationSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "CancelSynchronization", result.Response(), "Failure sending request") + return + } + + return +} + +// CancelSynchronizationPreparer prepares the CancelSynchronization request. +func (client ShareSubscriptionsClient) CancelSynchronizationPreparer(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, shareSubscriptionSynchronization ShareSubscriptionSynchronization) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareSubscriptionName": autorest.Encode("path", shareSubscriptionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + shareSubscriptionSynchronization.DurationMs = nil + shareSubscriptionSynchronization.EndTime = nil + shareSubscriptionSynchronization.Message = nil + shareSubscriptionSynchronization.StartTime = nil + shareSubscriptionSynchronization.Status = nil + shareSubscriptionSynchronization.SynchronizationMode = "" + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/cancelSynchronization", pathParameters), + autorest.WithJSON(shareSubscriptionSynchronization), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CancelSynchronizationSender sends the CancelSynchronization request. The method will close the +// http.Response Body if it receives an error. +func (client ShareSubscriptionsClient) CancelSynchronizationSender(req *http.Request) (future ShareSubscriptionsCancelSynchronizationFuture, 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 +} + +// CancelSynchronizationResponder handles the response to the CancelSynchronization request. The method always +// closes the http.Response Body. +func (client ShareSubscriptionsClient) CancelSynchronizationResponder(resp *http.Response) (result ShareSubscriptionSynchronization, 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 +} + +// Create create a shareSubscription in an account +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareSubscriptionName - the name of the shareSubscription. +// shareSubscription - create parameters for shareSubscription +func (client ShareSubscriptionsClient) Create(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, shareSubscription ShareSubscription) (result ShareSubscription, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ShareSubscriptionsClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: shareSubscription, + Constraints: []validation.Constraint{{Target: "shareSubscription.ShareSubscriptionProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "shareSubscription.ShareSubscriptionProperties.InvitationID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "shareSubscription.ShareSubscriptionProperties.SourceShareLocation", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("datashare.ShareSubscriptionsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, shareSubscriptionName, shareSubscription) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ShareSubscriptionsClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, shareSubscription ShareSubscription) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareSubscriptionName": autorest.Encode("path", shareSubscriptionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}", pathParameters), + autorest.WithJSON(shareSubscription), + 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 ShareSubscriptionsClient) 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 ShareSubscriptionsClient) CreateResponder(resp *http.Response) (result ShareSubscription, 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 shareSubscription in an account +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareSubscriptionName - the name of the shareSubscription. +func (client ShareSubscriptionsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string) (result ShareSubscriptionsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ShareSubscriptionsClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, shareSubscriptionName) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ShareSubscriptionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareSubscriptionName": autorest.Encode("path", shareSubscriptionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}", 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 ShareSubscriptionsClient) DeleteSender(req *http.Request) (future ShareSubscriptionsDeleteFuture, 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 ShareSubscriptionsClient) DeleteResponder(resp *http.Response) (result OperationResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get get a shareSubscription in an account +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareSubscriptionName - the name of the shareSubscription. +func (client ShareSubscriptionsClient) Get(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string) (result ShareSubscription, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ShareSubscriptionsClient.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, accountName, shareSubscriptionName) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ShareSubscriptionsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareSubscriptionName": autorest.Encode("path", shareSubscriptionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}", 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 ShareSubscriptionsClient) 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 ShareSubscriptionsClient) GetResponder(resp *http.Response) (result ShareSubscription, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAccount list share subscriptions in an account +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// skipToken - continuation Token +func (client ShareSubscriptionsClient) ListByAccount(ctx context.Context, resourceGroupName string, accountName string, skipToken string) (result ShareSubscriptionListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ShareSubscriptionsClient.ListByAccount") + defer func() { + sc := -1 + if result.ssl.Response.Response != nil { + sc = result.ssl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByAccountNextResults + req, err := client.ListByAccountPreparer(ctx, resourceGroupName, accountName, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "ListByAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAccountSender(req) + if err != nil { + result.ssl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "ListByAccount", resp, "Failure sending request") + return + } + + result.ssl, err = client.ListByAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "ListByAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAccountPreparer prepares the ListByAccount request. +func (client ShareSubscriptionsClient) ListByAccountPreparer(ctx context.Context, resourceGroupName string, accountName string, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.DataShare/accounts/{accountName}/shareSubscriptions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAccountSender sends the ListByAccount request. The method will close the +// http.Response Body if it receives an error. +func (client ShareSubscriptionsClient) ListByAccountSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByAccountResponder handles the response to the ListByAccount request. The method always +// closes the http.Response Body. +func (client ShareSubscriptionsClient) ListByAccountResponder(resp *http.Response) (result ShareSubscriptionList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAccountNextResults retrieves the next set of results, if any. +func (client ShareSubscriptionsClient) listByAccountNextResults(ctx context.Context, lastResults ShareSubscriptionList) (result ShareSubscriptionList, err error) { + req, err := lastResults.shareSubscriptionListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "listByAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "listByAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "listByAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client ShareSubscriptionsClient) ListByAccountComplete(ctx context.Context, resourceGroupName string, accountName string, skipToken string) (result ShareSubscriptionListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ShareSubscriptionsClient.ListByAccount") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByAccount(ctx, resourceGroupName, accountName, skipToken) + return +} + +// ListSourceShareSynchronizationSettings get synchronization settings set on a share +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareSubscriptionName - the name of the shareSubscription. +// skipToken - continuation token +func (client ShareSubscriptionsClient) ListSourceShareSynchronizationSettings(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, skipToken string) (result SourceShareSynchronizationSettingListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ShareSubscriptionsClient.ListSourceShareSynchronizationSettings") + defer func() { + sc := -1 + if result.ssssl.Response.Response != nil { + sc = result.ssssl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listSourceShareSynchronizationSettingsNextResults + req, err := client.ListSourceShareSynchronizationSettingsPreparer(ctx, resourceGroupName, accountName, shareSubscriptionName, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "ListSourceShareSynchronizationSettings", nil, "Failure preparing request") + return + } + + resp, err := client.ListSourceShareSynchronizationSettingsSender(req) + if err != nil { + result.ssssl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "ListSourceShareSynchronizationSettings", resp, "Failure sending request") + return + } + + result.ssssl, err = client.ListSourceShareSynchronizationSettingsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "ListSourceShareSynchronizationSettings", resp, "Failure responding to request") + } + + return +} + +// ListSourceShareSynchronizationSettingsPreparer prepares the ListSourceShareSynchronizationSettings request. +func (client ShareSubscriptionsClient) ListSourceShareSynchronizationSettingsPreparer(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareSubscriptionName": autorest.Encode("path", shareSubscriptionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/listSourceShareSynchronizationSettings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSourceShareSynchronizationSettingsSender sends the ListSourceShareSynchronizationSettings request. The method will close the +// http.Response Body if it receives an error. +func (client ShareSubscriptionsClient) ListSourceShareSynchronizationSettingsSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListSourceShareSynchronizationSettingsResponder handles the response to the ListSourceShareSynchronizationSettings request. The method always +// closes the http.Response Body. +func (client ShareSubscriptionsClient) ListSourceShareSynchronizationSettingsResponder(resp *http.Response) (result SourceShareSynchronizationSettingList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listSourceShareSynchronizationSettingsNextResults retrieves the next set of results, if any. +func (client ShareSubscriptionsClient) listSourceShareSynchronizationSettingsNextResults(ctx context.Context, lastResults SourceShareSynchronizationSettingList) (result SourceShareSynchronizationSettingList, err error) { + req, err := lastResults.sourceShareSynchronizationSettingListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "listSourceShareSynchronizationSettingsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSourceShareSynchronizationSettingsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "listSourceShareSynchronizationSettingsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListSourceShareSynchronizationSettingsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "listSourceShareSynchronizationSettingsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListSourceShareSynchronizationSettingsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ShareSubscriptionsClient) ListSourceShareSynchronizationSettingsComplete(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, skipToken string) (result SourceShareSynchronizationSettingListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ShareSubscriptionsClient.ListSourceShareSynchronizationSettings") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListSourceShareSynchronizationSettings(ctx, resourceGroupName, accountName, shareSubscriptionName, skipToken) + return +} + +// ListSynchronizationDetails list synchronization details +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareSubscriptionName - the name of the share subscription. +// shareSubscriptionSynchronization - share Subscription Synchronization payload. +// skipToken - continuation token +func (client ShareSubscriptionsClient) ListSynchronizationDetails(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, shareSubscriptionSynchronization ShareSubscriptionSynchronization, skipToken string) (result SynchronizationDetailsListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ShareSubscriptionsClient.ListSynchronizationDetails") + defer func() { + sc := -1 + if result.sdl.Response.Response != nil { + sc = result.sdl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: shareSubscriptionSynchronization, + Constraints: []validation.Constraint{{Target: "shareSubscriptionSynchronization.SynchronizationID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("datashare.ShareSubscriptionsClient", "ListSynchronizationDetails", err.Error()) + } + + result.fn = client.listSynchronizationDetailsNextResults + req, err := client.ListSynchronizationDetailsPreparer(ctx, resourceGroupName, accountName, shareSubscriptionName, shareSubscriptionSynchronization, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "ListSynchronizationDetails", nil, "Failure preparing request") + return + } + + resp, err := client.ListSynchronizationDetailsSender(req) + if err != nil { + result.sdl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "ListSynchronizationDetails", resp, "Failure sending request") + return + } + + result.sdl, err = client.ListSynchronizationDetailsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "ListSynchronizationDetails", resp, "Failure responding to request") + } + + return +} + +// ListSynchronizationDetailsPreparer prepares the ListSynchronizationDetails request. +func (client ShareSubscriptionsClient) ListSynchronizationDetailsPreparer(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, shareSubscriptionSynchronization ShareSubscriptionSynchronization, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareSubscriptionName": autorest.Encode("path", shareSubscriptionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + shareSubscriptionSynchronization.DurationMs = nil + shareSubscriptionSynchronization.EndTime = nil + shareSubscriptionSynchronization.Message = nil + shareSubscriptionSynchronization.StartTime = nil + shareSubscriptionSynchronization.Status = nil + shareSubscriptionSynchronization.SynchronizationMode = "" + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/listSynchronizationDetails", pathParameters), + autorest.WithJSON(shareSubscriptionSynchronization), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSynchronizationDetailsSender sends the ListSynchronizationDetails request. The method will close the +// http.Response Body if it receives an error. +func (client ShareSubscriptionsClient) ListSynchronizationDetailsSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListSynchronizationDetailsResponder handles the response to the ListSynchronizationDetails request. The method always +// closes the http.Response Body. +func (client ShareSubscriptionsClient) ListSynchronizationDetailsResponder(resp *http.Response) (result SynchronizationDetailsList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listSynchronizationDetailsNextResults retrieves the next set of results, if any. +func (client ShareSubscriptionsClient) listSynchronizationDetailsNextResults(ctx context.Context, lastResults SynchronizationDetailsList) (result SynchronizationDetailsList, err error) { + req, err := lastResults.synchronizationDetailsListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "listSynchronizationDetailsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSynchronizationDetailsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "listSynchronizationDetailsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListSynchronizationDetailsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "listSynchronizationDetailsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListSynchronizationDetailsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ShareSubscriptionsClient) ListSynchronizationDetailsComplete(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, shareSubscriptionSynchronization ShareSubscriptionSynchronization, skipToken string) (result SynchronizationDetailsListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ShareSubscriptionsClient.ListSynchronizationDetails") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListSynchronizationDetails(ctx, resourceGroupName, accountName, shareSubscriptionName, shareSubscriptionSynchronization, skipToken) + return +} + +// ListSynchronizations list synchronizations of a share subscription +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareSubscriptionName - the name of the share subscription. +// skipToken - continuation token +func (client ShareSubscriptionsClient) ListSynchronizations(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, skipToken string) (result ShareSubscriptionSynchronizationListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ShareSubscriptionsClient.ListSynchronizations") + defer func() { + sc := -1 + if result.sssl.Response.Response != nil { + sc = result.sssl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listSynchronizationsNextResults + req, err := client.ListSynchronizationsPreparer(ctx, resourceGroupName, accountName, shareSubscriptionName, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "ListSynchronizations", nil, "Failure preparing request") + return + } + + resp, err := client.ListSynchronizationsSender(req) + if err != nil { + result.sssl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "ListSynchronizations", resp, "Failure sending request") + return + } + + result.sssl, err = client.ListSynchronizationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "ListSynchronizations", resp, "Failure responding to request") + } + + return +} + +// ListSynchronizationsPreparer prepares the ListSynchronizations request. +func (client ShareSubscriptionsClient) ListSynchronizationsPreparer(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareSubscriptionName": autorest.Encode("path", shareSubscriptionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/listSynchronizations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSynchronizationsSender sends the ListSynchronizations request. The method will close the +// http.Response Body if it receives an error. +func (client ShareSubscriptionsClient) ListSynchronizationsSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListSynchronizationsResponder handles the response to the ListSynchronizations request. The method always +// closes the http.Response Body. +func (client ShareSubscriptionsClient) ListSynchronizationsResponder(resp *http.Response) (result ShareSubscriptionSynchronizationList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listSynchronizationsNextResults retrieves the next set of results, if any. +func (client ShareSubscriptionsClient) listSynchronizationsNextResults(ctx context.Context, lastResults ShareSubscriptionSynchronizationList) (result ShareSubscriptionSynchronizationList, err error) { + req, err := lastResults.shareSubscriptionSynchronizationListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "listSynchronizationsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSynchronizationsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "listSynchronizationsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListSynchronizationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "listSynchronizationsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListSynchronizationsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ShareSubscriptionsClient) ListSynchronizationsComplete(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, skipToken string) (result ShareSubscriptionSynchronizationListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ShareSubscriptionsClient.ListSynchronizations") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListSynchronizations(ctx, resourceGroupName, accountName, shareSubscriptionName, skipToken) + return +} + +// SynchronizeMethod initiate a copy +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareSubscriptionName - the name of share subscription +// synchronize - synchronize payload +func (client ShareSubscriptionsClient) SynchronizeMethod(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, synchronize Synchronize) (result ShareSubscriptionsSynchronizeMethodFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ShareSubscriptionsClient.SynchronizeMethod") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.SynchronizeMethodPreparer(ctx, resourceGroupName, accountName, shareSubscriptionName, synchronize) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "SynchronizeMethod", nil, "Failure preparing request") + return + } + + result, err = client.SynchronizeMethodSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "SynchronizeMethod", result.Response(), "Failure sending request") + return + } + + return +} + +// SynchronizeMethodPreparer prepares the SynchronizeMethod request. +func (client ShareSubscriptionsClient) SynchronizeMethodPreparer(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, synchronize Synchronize) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareSubscriptionName": autorest.Encode("path", shareSubscriptionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/Synchronize", pathParameters), + autorest.WithJSON(synchronize), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SynchronizeMethodSender sends the SynchronizeMethod request. The method will close the +// http.Response Body if it receives an error. +func (client ShareSubscriptionsClient) SynchronizeMethodSender(req *http.Request) (future ShareSubscriptionsSynchronizeMethodFuture, 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 +} + +// SynchronizeMethodResponder handles the response to the SynchronizeMethod request. The method always +// closes the http.Response Body. +func (client ShareSubscriptionsClient) SynchronizeMethodResponder(resp *http.Response) (result ShareSubscriptionSynchronization, 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/datashare/mgmt/2019-11-01/datashare/synchronizationsettings.go b/services/datashare/mgmt/2019-11-01/datashare/synchronizationsettings.go new file mode 100644 index 000000000000..c37c178511ac --- /dev/null +++ b/services/datashare/mgmt/2019-11-01/datashare/synchronizationsettings.go @@ -0,0 +1,408 @@ +package datashare + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if 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" +) + +// SynchronizationSettingsClient is the creates a Microsoft.DataShare management client. +type SynchronizationSettingsClient struct { + BaseClient +} + +// NewSynchronizationSettingsClient creates an instance of the SynchronizationSettingsClient client. +func NewSynchronizationSettingsClient(subscriptionID string) SynchronizationSettingsClient { + return NewSynchronizationSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSynchronizationSettingsClientWithBaseURI creates an instance of the SynchronizationSettingsClient client. +func NewSynchronizationSettingsClientWithBaseURI(baseURI string, subscriptionID string) SynchronizationSettingsClient { + return SynchronizationSettingsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create create or update a synchronizationSetting +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareName - the name of the share to add the synchronization setting to. +// synchronizationSettingName - the name of the synchronizationSetting. +// synchronizationSetting - the new synchronization setting information. +func (client SynchronizationSettingsClient) Create(ctx context.Context, resourceGroupName string, accountName string, shareName string, synchronizationSettingName string, synchronizationSetting BasicSynchronizationSetting) (result SynchronizationSettingModel, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SynchronizationSettingsClient.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, accountName, shareName, synchronizationSettingName, synchronizationSetting) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SynchronizationSettingsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.SynchronizationSettingsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SynchronizationSettingsClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client SynchronizationSettingsClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, synchronizationSettingName string, synchronizationSetting BasicSynchronizationSetting) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareName": autorest.Encode("path", shareName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "synchronizationSettingName": autorest.Encode("path", synchronizationSettingName), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/synchronizationSettings/{synchronizationSettingName}", pathParameters), + autorest.WithJSON(synchronizationSetting), + 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 SynchronizationSettingsClient) 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 SynchronizationSettingsClient) CreateResponder(resp *http.Response) (result SynchronizationSettingModel, 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 synchronizationSetting in a share +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareName - the name of the share. +// synchronizationSettingName - the name of the synchronizationSetting . +func (client SynchronizationSettingsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, shareName string, synchronizationSettingName string) (result SynchronizationSettingsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SynchronizationSettingsClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, shareName, synchronizationSettingName) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SynchronizationSettingsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SynchronizationSettingsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client SynchronizationSettingsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, synchronizationSettingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareName": autorest.Encode("path", shareName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "synchronizationSettingName": autorest.Encode("path", synchronizationSettingName), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/synchronizationSettings/{synchronizationSettingName}", 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 SynchronizationSettingsClient) DeleteSender(req *http.Request) (future SynchronizationSettingsDeleteFuture, 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 SynchronizationSettingsClient) DeleteResponder(resp *http.Response) (result OperationResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get get a synchronizationSetting in a share +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareName - the name of the share. +// synchronizationSettingName - the name of the synchronizationSetting. +func (client SynchronizationSettingsClient) Get(ctx context.Context, resourceGroupName string, accountName string, shareName string, synchronizationSettingName string) (result SynchronizationSettingModel, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SynchronizationSettingsClient.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, accountName, shareName, synchronizationSettingName) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SynchronizationSettingsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.SynchronizationSettingsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SynchronizationSettingsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SynchronizationSettingsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, synchronizationSettingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareName": autorest.Encode("path", shareName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "synchronizationSettingName": autorest.Encode("path", synchronizationSettingName), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/synchronizationSettings/{synchronizationSettingName}", 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 SynchronizationSettingsClient) 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 SynchronizationSettingsClient) GetResponder(resp *http.Response) (result SynchronizationSettingModel, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByShare list synchronizationSettings in a share +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareName - the name of the share. +// skipToken - continuation token +func (client SynchronizationSettingsClient) ListByShare(ctx context.Context, resourceGroupName string, accountName string, shareName string, skipToken string) (result SynchronizationSettingListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SynchronizationSettingsClient.ListByShare") + defer func() { + sc := -1 + if result.ssl.Response.Response != nil { + sc = result.ssl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByShareNextResults + req, err := client.ListBySharePreparer(ctx, resourceGroupName, accountName, shareName, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SynchronizationSettingsClient", "ListByShare", nil, "Failure preparing request") + return + } + + resp, err := client.ListByShareSender(req) + if err != nil { + result.ssl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.SynchronizationSettingsClient", "ListByShare", resp, "Failure sending request") + return + } + + result.ssl, err = client.ListByShareResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SynchronizationSettingsClient", "ListByShare", resp, "Failure responding to request") + } + + return +} + +// ListBySharePreparer prepares the ListByShare request. +func (client SynchronizationSettingsClient) ListBySharePreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareName": autorest.Encode("path", shareName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.DataShare/accounts/{accountName}/shares/{shareName}/synchronizationSettings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByShareSender sends the ListByShare request. The method will close the +// http.Response Body if it receives an error. +func (client SynchronizationSettingsClient) ListByShareSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByShareResponder handles the response to the ListByShare request. The method always +// closes the http.Response Body. +func (client SynchronizationSettingsClient) ListByShareResponder(resp *http.Response) (result SynchronizationSettingList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByShareNextResults retrieves the next set of results, if any. +func (client SynchronizationSettingsClient) listByShareNextResults(ctx context.Context, lastResults SynchronizationSettingList) (result SynchronizationSettingList, err error) { + req, err := lastResults.synchronizationSettingListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "datashare.SynchronizationSettingsClient", "listByShareNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByShareSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "datashare.SynchronizationSettingsClient", "listByShareNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByShareResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SynchronizationSettingsClient", "listByShareNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByShareComplete enumerates all values, automatically crossing page boundaries as required. +func (client SynchronizationSettingsClient) ListByShareComplete(ctx context.Context, resourceGroupName string, accountName string, shareName string, skipToken string) (result SynchronizationSettingListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SynchronizationSettingsClient.ListByShare") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByShare(ctx, resourceGroupName, accountName, shareName, skipToken) + return +} diff --git a/services/datashare/mgmt/2019-11-01/datashare/triggers.go b/services/datashare/mgmt/2019-11-01/datashare/triggers.go new file mode 100644 index 000000000000..966a9d8695f5 --- /dev/null +++ b/services/datashare/mgmt/2019-11-01/datashare/triggers.go @@ -0,0 +1,408 @@ +package datashare + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if 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 creates a Microsoft.DataShare management client. +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)} +} + +// Create create a Trigger +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareSubscriptionName - the name of the share subscription which will hold the data set sink. +// triggerName - the name of the trigger. +// trigger - trigger details. +func (client TriggersClient) Create(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, triggerName string, trigger BasicTrigger) (result TriggersCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TriggersClient.Create") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, shareSubscriptionName, triggerName, trigger) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.TriggersClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.TriggersClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client TriggersClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, triggerName string, trigger BasicTrigger) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareSubscriptionName": autorest.Encode("path", shareSubscriptionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "triggerName": autorest.Encode("path", triggerName), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers/{triggerName}", pathParameters), + autorest.WithJSON(trigger), + 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 TriggersClient) CreateSender(req *http.Request) (future TriggersCreateFuture, 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 TriggersClient) CreateResponder(resp *http.Response) (result TriggerModel, 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 Trigger in a shareSubscription +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareSubscriptionName - the name of the shareSubscription. +// triggerName - the name of the trigger. +func (client TriggersClient) Delete(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, triggerName 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, resourceGroupName, accountName, shareSubscriptionName, triggerName) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.TriggersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.TriggersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client TriggersClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, triggerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareSubscriptionName": autorest.Encode("path", shareSubscriptionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "triggerName": autorest.Encode("path", triggerName), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers/{triggerName}", 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 OperationResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get get a Trigger in a shareSubscription +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareSubscriptionName - the name of the shareSubscription. +// triggerName - the name of the trigger. +func (client TriggersClient) Get(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, triggerName 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, resourceGroupName, accountName, shareSubscriptionName, triggerName) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.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, "datashare.TriggersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.TriggersClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client TriggersClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, triggerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareSubscriptionName": autorest.Encode("path", shareSubscriptionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "triggerName": autorest.Encode("path", triggerName), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/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 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 +} + +// ListByShareSubscription list Triggers in a share subscription +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareSubscriptionName - the name of the share subscription. +// skipToken - continuation token +func (client TriggersClient) ListByShareSubscription(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, skipToken string) (result TriggerListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TriggersClient.ListByShareSubscription") + defer func() { + sc := -1 + if result.tl.Response.Response != nil { + sc = result.tl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByShareSubscriptionNextResults + req, err := client.ListByShareSubscriptionPreparer(ctx, resourceGroupName, accountName, shareSubscriptionName, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.TriggersClient", "ListByShareSubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListByShareSubscriptionSender(req) + if err != nil { + result.tl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.TriggersClient", "ListByShareSubscription", resp, "Failure sending request") + return + } + + result.tl, err = client.ListByShareSubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.TriggersClient", "ListByShareSubscription", resp, "Failure responding to request") + } + + return +} + +// ListByShareSubscriptionPreparer prepares the ListByShareSubscription request. +func (client TriggersClient) ListByShareSubscriptionPreparer(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareSubscriptionName": autorest.Encode("path", shareSubscriptionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByShareSubscriptionSender sends the ListByShareSubscription request. The method will close the +// http.Response Body if it receives an error. +func (client TriggersClient) ListByShareSubscriptionSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByShareSubscriptionResponder handles the response to the ListByShareSubscription request. The method always +// closes the http.Response Body. +func (client TriggersClient) ListByShareSubscriptionResponder(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 +} + +// listByShareSubscriptionNextResults retrieves the next set of results, if any. +func (client TriggersClient) listByShareSubscriptionNextResults(ctx context.Context, lastResults TriggerList) (result TriggerList, err error) { + req, err := lastResults.triggerListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "datashare.TriggersClient", "listByShareSubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByShareSubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "datashare.TriggersClient", "listByShareSubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByShareSubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.TriggersClient", "listByShareSubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByShareSubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client TriggersClient) ListByShareSubscriptionComplete(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, skipToken string) (result TriggerListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TriggersClient.ListByShareSubscription") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByShareSubscription(ctx, resourceGroupName, accountName, shareSubscriptionName, skipToken) + return +} diff --git a/services/datashare/mgmt/2019-11-01/datashare/version.go b/services/datashare/mgmt/2019-11-01/datashare/version.go new file mode 100644 index 000000000000..5a612e2b6209 --- /dev/null +++ b/services/datashare/mgmt/2019-11-01/datashare/version.go @@ -0,0 +1,30 @@ +package datashare + +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 + " datashare/2019-11-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/domainservices/mgmt/2017-01-01/aad/domainservices.go b/services/domainservices/mgmt/2017-01-01/aad/domainservices.go index dadaae920a30..3b19e52aad80 100644 --- a/services/domainservices/mgmt/2017-01-01/aad/domainservices.go +++ b/services/domainservices/mgmt/2017-01-01/aad/domainservices.go @@ -207,14 +207,13 @@ func (client DomainServicesClient) DeleteSender(req *http.Request) (future Domai // DeleteResponder handles the response to the Delete request. The method always // closes the http.Response Body. -func (client DomainServicesClient) DeleteResponder(resp *http.Response) (result DomainService, err error) { +func (client DomainServicesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} + result.Response = resp return } diff --git a/services/domainservices/mgmt/2017-01-01/aad/models.go b/services/domainservices/mgmt/2017-01-01/aad/models.go index 48023da54fae..e50192f57fb4 100644 --- a/services/domainservices/mgmt/2017-01-01/aad/models.go +++ b/services/domainservices/mgmt/2017-01-01/aad/models.go @@ -491,7 +491,7 @@ type DomainServicesDeleteFuture struct { // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. -func (future *DomainServicesDeleteFuture) Result(client DomainServicesClient) (ds DomainService, err error) { +func (future *DomainServicesDeleteFuture) Result(client DomainServicesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -502,13 +502,7 @@ func (future *DomainServicesDeleteFuture) Result(client DomainServicesClient) (d err = azure.NewAsyncOpIncompleteError("aad.DomainServicesDeleteFuture") return } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ds.Response.Response, err = future.GetResult(sender); err == nil && ds.Response.Response.StatusCode != http.StatusNoContent { - ds, err = client.DeleteResponder(ds.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "aad.DomainServicesDeleteFuture", "Result", ds.Response.Response, "Failure responding to request") - } - } + ar.Response = future.Response() return } diff --git a/services/domainservices/mgmt/2017-06-01/aad/aadapi/interfaces.go b/services/domainservices/mgmt/2017-06-01/aad/aadapi/interfaces.go index 196cfd7a44ed..2fa637e9d9a0 100644 --- a/services/domainservices/mgmt/2017-06-01/aad/aadapi/interfaces.go +++ b/services/domainservices/mgmt/2017-06-01/aad/aadapi/interfaces.go @@ -40,14 +40,3 @@ type DomainServicesClientAPI interface { } var _ DomainServicesClientAPI = (*aad.DomainServicesClient)(nil) - -// ReplicaSetsClientAPI contains the set of methods on the ReplicaSetsClient type. -type ReplicaSetsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, domainServiceName string, replicaSetName string, replicaSet aad.ReplicaSet) (result aad.ReplicaSetsCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, domainServiceName string, replicaSetName string) (result aad.ReplicaSetsDeleteFuture, err error) - Get(ctx context.Context, resourceGroupName string, domainServiceName string, replicaSetName string) (result aad.ReplicaSet, err error) - ListByResourceGroup(ctx context.Context, resourceGroupName string, domainServiceName string) (result aad.ReplicaSetListResultPage, err error) - Update(ctx context.Context, resourceGroupName string, domainServiceName string, replicaSetName string, replicaSet aad.ReplicaSet) (result aad.ReplicaSetsUpdateFuture, err error) -} - -var _ ReplicaSetsClientAPI = (*aad.ReplicaSetsClient)(nil) diff --git a/services/domainservices/mgmt/2017-06-01/aad/domainservices.go b/services/domainservices/mgmt/2017-06-01/aad/domainservices.go index 0587bb6f3ced..9c4e3fc68441 100644 --- a/services/domainservices/mgmt/2017-06-01/aad/domainservices.go +++ b/services/domainservices/mgmt/2017-06-01/aad/domainservices.go @@ -207,14 +207,13 @@ func (client DomainServicesClient) DeleteSender(req *http.Request) (future Domai // DeleteResponder handles the response to the Delete request. The method always // closes the http.Response Body. -func (client DomainServicesClient) DeleteResponder(resp *http.Response) (result DomainService, err error) { +func (client DomainServicesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} + result.Response = resp return } diff --git a/services/domainservices/mgmt/2017-06-01/aad/models.go b/services/domainservices/mgmt/2017-06-01/aad/models.go index 35ec375aaa13..16b51ed456d1 100644 --- a/services/domainservices/mgmt/2017-06-01/aad/models.go +++ b/services/domainservices/mgmt/2017-06-01/aad/models.go @@ -491,7 +491,7 @@ type DomainServicesDeleteFuture struct { // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. -func (future *DomainServicesDeleteFuture) Result(client DomainServicesClient) (ds DomainService, err error) { +func (future *DomainServicesDeleteFuture) Result(client DomainServicesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -502,13 +502,7 @@ func (future *DomainServicesDeleteFuture) Result(client DomainServicesClient) (d err = azure.NewAsyncOpIncompleteError("aad.DomainServicesDeleteFuture") return } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ds.Response.Response, err = future.GetResult(sender); err == nil && ds.Response.Response.StatusCode != http.StatusNoContent { - ds, err = client.DeleteResponder(ds.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "aad.DomainServicesDeleteFuture", "Result", ds.Response.Response, "Failure responding to request") - } - } + ar.Response = future.Response() return } @@ -767,376 +761,6 @@ func NewOperationEntityListResultPage(getNextPage func(context.Context, Operatio return OperationEntityListResultPage{fn: getNextPage} } -// ReplicaSet replica Set. -type ReplicaSet struct { - autorest.Response `json:"-"` - // ReplicaSetProperties - ReplicaSet properties - *ReplicaSetProperties `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"` - // Etag - Resource etag - Etag *string `json:"etag,omitempty"` -} - -// MarshalJSON is the custom marshaler for ReplicaSet. -func (rs ReplicaSet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rs.ReplicaSetProperties != nil { - objectMap["properties"] = rs.ReplicaSetProperties - } - if rs.Location != nil { - objectMap["location"] = rs.Location - } - if rs.Tags != nil { - objectMap["tags"] = rs.Tags - } - if rs.Etag != nil { - objectMap["etag"] = rs.Etag - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ReplicaSet struct. -func (rs *ReplicaSet) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var replicaSetProperties ReplicaSetProperties - err = json.Unmarshal(*v, &replicaSetProperties) - if err != nil { - return err - } - rs.ReplicaSetProperties = &replicaSetProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - rs.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - rs.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - rs.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - rs.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - rs.Tags = tags - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - rs.Etag = &etag - } - } - } - - return nil -} - -// ReplicaSetListResult the response from the List ReplicaSets operation. -type ReplicaSetListResult struct { - autorest.Response `json:"-"` - // Value - the list of ReplicaSet. - Value *[]ReplicaSet `json:"value,omitempty"` - // NextLink - READ-ONLY; The continuation token for the next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ReplicaSetListResultIterator provides access to a complete listing of ReplicaSet values. -type ReplicaSetListResultIterator struct { - i int - page ReplicaSetListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ReplicaSetListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ReplicaSetListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ReplicaSetListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ReplicaSetListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ReplicaSetListResultIterator) Response() ReplicaSetListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ReplicaSetListResultIterator) Value() ReplicaSet { - if !iter.page.NotDone() { - return ReplicaSet{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ReplicaSetListResultIterator type. -func NewReplicaSetListResultIterator(page ReplicaSetListResultPage) ReplicaSetListResultIterator { - return ReplicaSetListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rslr ReplicaSetListResult) IsEmpty() bool { - return rslr.Value == nil || len(*rslr.Value) == 0 -} - -// replicaSetListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rslr ReplicaSetListResult) replicaSetListResultPreparer(ctx context.Context) (*http.Request, error) { - if rslr.NextLink == nil || len(to.String(rslr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rslr.NextLink))) -} - -// ReplicaSetListResultPage contains a page of ReplicaSet values. -type ReplicaSetListResultPage struct { - fn func(context.Context, ReplicaSetListResult) (ReplicaSetListResult, error) - rslr ReplicaSetListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ReplicaSetListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ReplicaSetListResultPage.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.rslr) - if err != nil { - return err - } - page.rslr = 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 *ReplicaSetListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ReplicaSetListResultPage) NotDone() bool { - return !page.rslr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ReplicaSetListResultPage) Response() ReplicaSetListResult { - return page.rslr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ReplicaSetListResultPage) Values() []ReplicaSet { - if page.rslr.IsEmpty() { - return nil - } - return *page.rslr.Value -} - -// Creates a new instance of the ReplicaSetListResultPage type. -func NewReplicaSetListResultPage(getNextPage func(context.Context, ReplicaSetListResult) (ReplicaSetListResult, error)) ReplicaSetListResultPage { - return ReplicaSetListResultPage{fn: getNextPage} -} - -// ReplicaSetProperties properties of the ReplicaSet. -type ReplicaSetProperties struct { - // ReplicaSetID - READ-ONLY; ReplicaSet Id - ReplicaSetID *string `json:"replicaSetId,omitempty"` - // SubnetID - The name of the virtual network that ReplicaSets will be deployed on. /virtualNetwork/vnetName/subnets/subnetName. - SubnetID *string `json:"subnetId,omitempty"` - // HealthLastEvaluated - READ-ONLY; Last domain evaluation run DateTime - HealthLastEvaluated *date.Time `json:"healthLastEvaluated,omitempty"` - // HealthMonitors - READ-ONLY; List of Domain Health Monitors - HealthMonitors *[]HealthMonitor `json:"healthMonitors,omitempty"` - // HealthAlerts - READ-ONLY; List of Domain Health Alerts - HealthAlerts *[]HealthAlert `json:"healthAlerts,omitempty"` - // DomainControllerIPAddress - READ-ONLY; List of Domain Controller IP Address - DomainControllerIPAddress *[]string `json:"domainControllerIpAddress,omitempty"` - // ServiceStatus - READ-ONLY; Status of Domain Service instance - ServiceStatus *string `json:"serviceStatus,omitempty"` - // ProvisioningState - READ-ONLY; the current deployment or provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty"` - // ExternalAccessIPAddress - READ-ONLY; External access ip address. - ExternalAccessIPAddress *string `json:"externalAccessIpAddress,omitempty"` -} - -// ReplicaSetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ReplicaSetsCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ReplicaSetsCreateOrUpdateFuture) Result(client ReplicaSetsClient) (rs ReplicaSet, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "aad.ReplicaSetsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("aad.ReplicaSetsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if rs.Response.Response, err = future.GetResult(sender); err == nil && rs.Response.Response.StatusCode != http.StatusNoContent { - rs, err = client.CreateOrUpdateResponder(rs.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "aad.ReplicaSetsCreateOrUpdateFuture", "Result", rs.Response.Response, "Failure responding to request") - } - } - return -} - -// ReplicaSetsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ReplicaSetsDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ReplicaSetsDeleteFuture) Result(client ReplicaSetsClient) (rs ReplicaSet, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "aad.ReplicaSetsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("aad.ReplicaSetsDeleteFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if rs.Response.Response, err = future.GetResult(sender); err == nil && rs.Response.Response.StatusCode != http.StatusNoContent { - rs, err = client.DeleteResponder(rs.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "aad.ReplicaSetsDeleteFuture", "Result", rs.Response.Response, "Failure responding to request") - } - } - return -} - -// ReplicaSetsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ReplicaSetsUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ReplicaSetsUpdateFuture) Result(client ReplicaSetsClient) (rs ReplicaSet, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "aad.ReplicaSetsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("aad.ReplicaSetsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if rs.Response.Response, err = future.GetResult(sender); err == nil && rs.Response.Response.StatusCode != http.StatusNoContent { - rs, err = client.UpdateResponder(rs.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "aad.ReplicaSetsUpdateFuture", "Result", rs.Response.Response, "Failure responding to request") - } - } - return -} - // Resource the Resource model definition. type Resource struct { // ID - READ-ONLY; Resource Id diff --git a/services/domainservices/mgmt/2017-06-01/aad/replicasets.go b/services/domainservices/mgmt/2017-06-01/aad/replicasets.go deleted file mode 100644 index 9e2b7b2a1074..000000000000 --- a/services/domainservices/mgmt/2017-06-01/aad/replicasets.go +++ /dev/null @@ -1,526 +0,0 @@ -package aad - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the 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" -) - -// ReplicaSetsClient is the the AAD Domain Services API. -type ReplicaSetsClient struct { - BaseClient -} - -// NewReplicaSetsClient creates an instance of the ReplicaSetsClient client. -func NewReplicaSetsClient(subscriptionID string) ReplicaSetsClient { - return NewReplicaSetsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewReplicaSetsClientWithBaseURI creates an instance of the ReplicaSetsClient client. -func NewReplicaSetsClientWithBaseURI(baseURI string, subscriptionID string) ReplicaSetsClient { - return ReplicaSetsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate the Create ReplicaSet operation creates a new domain service with the specified parameters. -// Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// domainServiceName - the name of the domain service. -// replicaSetName - the name of the replica set. -// replicaSet - properties supplied to the Create ReplicaSet operation. -func (client ReplicaSetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, domainServiceName string, replicaSetName string, replicaSet ReplicaSet) (result ReplicaSetsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ReplicaSetsClient.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}}}}); err != nil { - return result, validation.NewError("aad.ReplicaSetsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, domainServiceName, replicaSetName, replicaSet) - if err != nil { - err = autorest.NewErrorWithError(err, "aad.ReplicaSetsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "aad.ReplicaSetsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ReplicaSetsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, domainServiceName string, replicaSetName string, replicaSet ReplicaSet) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "domainServiceName": autorest.Encode("path", domainServiceName), - "replicaSetName": autorest.Encode("path", replicaSetName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-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.AAD/domainServices/{domainServiceName}/replicaSets/{replicaSetName}", pathParameters), - autorest.WithJSON(replicaSet), - 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 ReplicaSetsClient) CreateOrUpdateSender(req *http.Request) (future ReplicaSetsCreateOrUpdateFuture, 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 ReplicaSetsClient) CreateOrUpdateResponder(resp *http.Response) (result ReplicaSet, 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 the Delete ReplicaSet operation deletes an existing ReplicaSet. -// Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// domainServiceName - the name of the domain service. -// replicaSetName - the name of the replica set. -func (client ReplicaSetsClient) Delete(ctx context.Context, resourceGroupName string, domainServiceName string, replicaSetName string) (result ReplicaSetsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ReplicaSetsClient.Delete") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("aad.ReplicaSetsClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, domainServiceName, replicaSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "aad.ReplicaSetsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "aad.ReplicaSetsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ReplicaSetsClient) DeletePreparer(ctx context.Context, resourceGroupName string, domainServiceName string, replicaSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "domainServiceName": autorest.Encode("path", domainServiceName), - "replicaSetName": autorest.Encode("path", replicaSetName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-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.AAD/domainServices/{domainServiceName}/replicaSets/{replicaSetName}", 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 ReplicaSetsClient) DeleteSender(req *http.Request) (future ReplicaSetsDeleteFuture, 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 ReplicaSetsClient) DeleteResponder(resp *http.Response) (result ReplicaSet, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get the Get ReplicaSet operation retrieves a json representation of the ReplicaSet. -// Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// domainServiceName - the name of the domain service. -// replicaSetName - the name of the replica set. -func (client ReplicaSetsClient) Get(ctx context.Context, resourceGroupName string, domainServiceName string, replicaSetName string) (result ReplicaSet, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ReplicaSetsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("aad.ReplicaSetsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, domainServiceName, replicaSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "aad.ReplicaSetsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "aad.ReplicaSetsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "aad.ReplicaSetsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ReplicaSetsClient) GetPreparer(ctx context.Context, resourceGroupName string, domainServiceName string, replicaSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "domainServiceName": autorest.Encode("path", domainServiceName), - "replicaSetName": autorest.Encode("path", replicaSetName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-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.AAD/domainServices/{domainServiceName}/replicaSets/{replicaSetName}", 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 ReplicaSetsClient) 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 ReplicaSetsClient) GetResponder(resp *http.Response) (result ReplicaSet, 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 the List ReplicaSets in Resource Group operation lists all the domain services available under -// the given resource group. -// Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// domainServiceName - the name of the domain service. -func (client ReplicaSetsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, domainServiceName string) (result ReplicaSetListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ReplicaSetsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.rslr.Response.Response != nil { - sc = result.rslr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("aad.ReplicaSetsClient", "ListByResourceGroup", err.Error()) - } - - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, domainServiceName) - if err != nil { - err = autorest.NewErrorWithError(err, "aad.ReplicaSetsClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.rslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "aad.ReplicaSetsClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.rslr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "aad.ReplicaSetsClient", "ListByResourceGroup", resp, "Failure responding to request") - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client ReplicaSetsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, domainServiceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "domainServiceName": autorest.Encode("path", domainServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-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.AAD/domainServices/{domainServiceName}/replicaSets", 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 ReplicaSetsClient) 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 ReplicaSetsClient) ListByResourceGroupResponder(resp *http.Response) (result ReplicaSetListResult, 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 ReplicaSetsClient) listByResourceGroupNextResults(ctx context.Context, lastResults ReplicaSetListResult) (result ReplicaSetListResult, err error) { - req, err := lastResults.replicaSetListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "aad.ReplicaSetsClient", "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, "aad.ReplicaSetsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "aad.ReplicaSetsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client ReplicaSetsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, domainServiceName string) (result ReplicaSetListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ReplicaSetsClient.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, domainServiceName) - return -} - -// Update the Update ReplicaSet operation can be used to update the existing deployment. The update call only supports -// the properties listed in the PATCH body. -// Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// domainServiceName - the name of the domain service. -// replicaSetName - the name of the replica set. -// replicaSet - properties supplied to the Update a ReplicaSet operation. -func (client ReplicaSetsClient) Update(ctx context.Context, resourceGroupName string, domainServiceName string, replicaSetName string, replicaSet ReplicaSet) (result ReplicaSetsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ReplicaSetsClient.Update") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("aad.ReplicaSetsClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, resourceGroupName, domainServiceName, replicaSetName, replicaSet) - if err != nil { - err = autorest.NewErrorWithError(err, "aad.ReplicaSetsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "aad.ReplicaSetsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client ReplicaSetsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, domainServiceName string, replicaSetName string, replicaSet ReplicaSet) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "domainServiceName": autorest.Encode("path", domainServiceName), - "replicaSetName": autorest.Encode("path", replicaSetName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AAD/domainServices/{domainServiceName}/replicaSets/{replicaSetName}", pathParameters), - autorest.WithJSON(replicaSet), - 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 ReplicaSetsClient) UpdateSender(req *http.Request) (future ReplicaSetsUpdateFuture, 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 ReplicaSetsClient) UpdateResponder(resp *http.Response) (result ReplicaSet, 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/eventgrid/2018-01-01/eventgrid/models.go b/services/eventgrid/2018-01-01/eventgrid/models.go index 22409444354c..2880fc15d397 100644 --- a/services/eventgrid/2018-01-01/eventgrid/models.go +++ b/services/eventgrid/2018-01-01/eventgrid/models.go @@ -721,6 +721,72 @@ type KeyVaultSecretNewVersionCreatedEventData struct { Exp *float64 `json:"exp,omitempty"` } +// MachineLearningServicesDatasetDriftDetectedEventData schema of the Data property of an EventGridEvent +// for an Microsoft.MachineLearningServices.DatasetDriftDetected event. +type MachineLearningServicesDatasetDriftDetectedEventData struct { + // DataDriftID - The ID of the data drift monitor that triggered the event. + DataDriftID *string `json:"dataDriftId,omitempty"` + // DataDriftName - The name of the data drift monitor that triggered the event. + DataDriftName *string `json:"dataDriftName,omitempty"` + // RunID - The ID of the Run that detected data drift. + RunID *string `json:"runId,omitempty"` + // BaseDatasetID - The ID of the base Dataset used to detect drift. + BaseDatasetID *string `json:"baseDatasetId,omitempty"` + // TargetDatasetID - The ID of the target Dataset used to detect drift. + TargetDatasetID *string `json:"targetDatasetId,omitempty"` + // DriftCoefficient - The coefficient result that triggered the event. + DriftCoefficient *float64 `json:"driftCoefficient,omitempty"` + // StartTime - The start time of the target dataset time series that resulted in drift detection. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time of the target dataset time series that resulted in drift detection. + EndTime *date.Time `json:"endTime,omitempty"` +} + +// MachineLearningServicesModelDeployedEventData schema of the Data property of an EventGridEvent for an +// Microsoft.MachineLearningServices.ModelDeployed event. +type MachineLearningServicesModelDeployedEventData struct { + // ServiceName - The name of the deployed service. + ServiceName *string `json:"serviceName,omitempty"` + // ServiceComputeType - The compute type (e.g. ACI, AKS) of the deployed service. + ServiceComputeType *string `json:"serviceComputeType,omitempty"` + // ModelIds - A common separated list of model IDs. The IDs of the models deployed in the service. + ModelIds *string `json:"modelIds,omitempty"` + // ServiceTags - The tags of the deployed service. + ServiceTags interface{} `json:"serviceTags,omitempty"` + // ServiceProperties - The properties of the deployed service. + ServiceProperties interface{} `json:"serviceProperties,omitempty"` +} + +// MachineLearningServicesModelRegisteredEventData schema of the Data property of an EventGridEvent for an +// Microsoft.MachineLearningServices.ModelRegistered event. +type MachineLearningServicesModelRegisteredEventData struct { + // ModelName - The name of the model that was registered. + ModelName *string `json:"modelName,omitempty"` + // ModelVersion - The version of the model that was registered. + ModelVersion *int32 `json:"modelVersion,omitempty"` + // ModelTags - The tags of the model that was registered. + ModelTags interface{} `json:"modelTags,omitempty"` + // ModelProperties - The properties of the model that was registered. + ModelProperties interface{} `json:"modelProperties,omitempty"` +} + +// MachineLearningServicesRunCompletedEventData schema of the Data property of an EventGridEvent for an +// Microsoft.MachineLearningServices.RunCompleted event. +type MachineLearningServicesRunCompletedEventData struct { + // ExperimentID - The ID of the experiment that the run belongs to. + ExperimentID *string `json:"experimentId,omitempty"` + // ExperimentName - The name of the experiment that the run belongs to. + ExperimentName *string `json:"experimentName,omitempty"` + // RunID - The ID of the Run that was completed. + RunID *string `json:"runId,omitempty"` + // RunType - The Run Type of the completed Run. + RunType *string `json:"runType,omitempty"` + // RunTags - The tags of the completed Run. + RunTags interface{} `json:"runTags,omitempty"` + // RunProperties - The properties of the completed Run. + RunProperties interface{} `json:"runProperties,omitempty"` +} + // MapsGeofenceEnteredEventData schema of the Data property of an EventGridEvent for a // Microsoft.Maps.GeofenceEntered event. type MapsGeofenceEnteredEventData struct { @@ -2188,18 +2254,22 @@ type StorageBlobCreatedEventData struct { ClientRequestID *string `json:"clientRequestId,omitempty"` // RequestID - The request id generated by the Storage service for the storage API operation that triggered this event. RequestID *string `json:"requestId,omitempty"` - // ETag - The etag of the object at the time this event was triggered. + // ETag - The etag of the blob at the time this event was triggered. ETag *string `json:"eTag,omitempty"` // ContentType - The content type of the blob. This is the same as what would be returned in the Content-Type header from the blob. ContentType *string `json:"contentType,omitempty"` // ContentLength - The size of the blob in bytes. This is the same as what would be returned in the Content-Length header from the blob. ContentLength *int64 `json:"contentLength,omitempty"` + // ContentOffset - The offset of the blob in bytes. + ContentOffset *int64 `json:"contentOffset,omitempty"` // BlobType - The type of blob. BlobType *string `json:"blobType,omitempty"` // URL - The path to the blob. URL *string `json:"url,omitempty"` // Sequencer - An opaque string value representing the logical sequence of events for any particular blob name. Users can use standard string comparison to understand the relative sequence of two events on the same blob name. Sequencer *string `json:"sequencer,omitempty"` + // Identity - The identity of the requester that triggered this event. + Identity *string `json:"identity,omitempty"` // StorageDiagnostics - For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. StorageDiagnostics interface{} `json:"storageDiagnostics,omitempty"` } @@ -2221,6 +2291,92 @@ type StorageBlobDeletedEventData struct { URL *string `json:"url,omitempty"` // Sequencer - An opaque string value representing the logical sequence of events for any particular blob name. Users can use standard string comparison to understand the relative sequence of two events on the same blob name. Sequencer *string `json:"sequencer,omitempty"` + // Identity - The identity of the requester that triggered this event. + Identity *string `json:"identity,omitempty"` + // StorageDiagnostics - For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. + StorageDiagnostics interface{} `json:"storageDiagnostics,omitempty"` +} + +// StorageBlobRenamedEventData schema of the Data property of an EventGridEvent for an +// Microsoft.Storage.BlobRenamed event. +type StorageBlobRenamedEventData struct { + // API - The name of the API/operation that triggered this event. + API *string `json:"api,omitempty"` + // ClientRequestID - A request id provided by the client of the storage API operation that triggered this event. + ClientRequestID *string `json:"clientRequestId,omitempty"` + // RequestID - The request id generated by the storage service for the storage API operation that triggered this event. + RequestID *string `json:"requestId,omitempty"` + // SourceURL - The path to the blob that was renamed. + SourceURL *string `json:"sourceUrl,omitempty"` + // DestinationURL - The new path to the blob after the rename operation. + DestinationURL *string `json:"destinationUrl,omitempty"` + // Sequencer - An opaque string value representing the logical sequence of events for any particular blob name. Users can use standard string comparison to understand the relative sequence of two events on the same blob name. + Sequencer *string `json:"sequencer,omitempty"` + // Identity - The identity of the requester that triggered this event. + Identity *string `json:"identity,omitempty"` + // StorageDiagnostics - For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. + StorageDiagnostics interface{} `json:"storageDiagnostics,omitempty"` +} + +// StorageDirectoryCreatedEventData schema of the Data property of an EventGridEvent for an +// Microsoft.Storage.DirectoryCreated event. +type StorageDirectoryCreatedEventData struct { + // API - The name of the API/operation that triggered this event. + API *string `json:"api,omitempty"` + // ClientRequestID - A request id provided by the client of the storage API operation that triggered this event. + ClientRequestID *string `json:"clientRequestId,omitempty"` + // RequestID - The request id generated by the storage service for the storage API operation that triggered this event. + RequestID *string `json:"requestId,omitempty"` + // ETag - The etag of the directory at the time this event was triggered. + ETag *string `json:"eTag,omitempty"` + // URL - The path to the directory. + URL *string `json:"url,omitempty"` + // Sequencer - An opaque string value representing the logical sequence of events for any particular directory name. Users can use standard string comparison to understand the relative sequence of two events on the same directory name. + Sequencer *string `json:"sequencer,omitempty"` + // Identity - The identity of the requester that triggered this event. + Identity *string `json:"identity,omitempty"` + // StorageDiagnostics - For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. + StorageDiagnostics interface{} `json:"storageDiagnostics,omitempty"` +} + +// StorageDirectoryDeletedEventData schema of the Data property of an EventGridEvent for an +// Microsoft.Storage.DirectoryDeleted event. +type StorageDirectoryDeletedEventData struct { + // API - The name of the API/operation that triggered this event. + API *string `json:"api,omitempty"` + // ClientRequestID - A request id provided by the client of the storage API operation that triggered this event. + ClientRequestID *string `json:"clientRequestId,omitempty"` + // RequestID - The request id generated by the storage service for the storage API operation that triggered this event. + RequestID *string `json:"requestId,omitempty"` + // URL - The path to the deleted directory. + URL *string `json:"url,omitempty"` + // Recursive - Is this event for a recursive delete operation. + Recursive *bool `json:"recursive,omitempty"` + // Sequencer - An opaque string value representing the logical sequence of events for any particular directory name. Users can use standard string comparison to understand the relative sequence of two events on the same directory name. + Sequencer *string `json:"sequencer,omitempty"` + // Identity - The identity of the requester that triggered this event. + Identity *string `json:"identity,omitempty"` + // StorageDiagnostics - For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. + StorageDiagnostics interface{} `json:"storageDiagnostics,omitempty"` +} + +// StorageDirectoryRenamedEventData schema of the Data property of an EventGridEvent for an +// Microsoft.Storage.DirectoryRenamed event. +type StorageDirectoryRenamedEventData struct { + // API - The name of the API/operation that triggered this event. + API *string `json:"api,omitempty"` + // ClientRequestID - A request id provided by the client of the storage API operation that triggered this event. + ClientRequestID *string `json:"clientRequestId,omitempty"` + // RequestID - The request id generated by the storage service for the storage API operation that triggered this event. + RequestID *string `json:"requestId,omitempty"` + // SourceURL - The path to the directory that was renamed. + SourceURL *string `json:"sourceUrl,omitempty"` + // DestinationURL - The new path to the directory after the rename operation. + DestinationURL *string `json:"destinationUrl,omitempty"` + // Sequencer - An opaque string value representing the logical sequence of events for any particular directory name. Users can use standard string comparison to understand the relative sequence of two events on the same directory name. + Sequencer *string `json:"sequencer,omitempty"` + // Identity - The identity of the requester that triggered this event. + Identity *string `json:"identity,omitempty"` // StorageDiagnostics - For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. StorageDiagnostics interface{} `json:"storageDiagnostics,omitempty"` } diff --git a/services/maps/mgmt/2017-01-01-preview/maps/models.go b/services/maps/mgmt/2017-01-01-preview/maps/models.go index b498e124ed7d..626217a93580 100644 --- a/services/maps/mgmt/2017-01-01-preview/maps/models.go +++ b/services/maps/mgmt/2017-01-01-preview/maps/models.go @@ -49,6 +49,8 @@ type Account struct { Tags map[string]*string `json:"tags"` // Sku - READ-ONLY; The SKU of this account. Sku *Sku `json:"sku,omitempty"` + // Properties - READ-ONLY; The map account properties. + Properties *AccountProperties `json:"properties,omitempty"` // ID - READ-ONLY; The fully qualified Maps Account resource identifier. ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the Maps Account, which is unique within a Resource Group. @@ -100,6 +102,12 @@ type AccountKeys struct { SecondaryKey *string `json:"secondaryKey,omitempty"` } +// AccountProperties additional Map account properties +type AccountProperties struct { + // XMsClientID - A unique identifier for the maps account + XMsClientID *string `json:"x-ms-client-id,omitempty"` +} + // Accounts a list of Maps Accounts. type Accounts struct { autorest.Response `json:"-"` diff --git a/services/operationalinsights/mgmt/2015-03-20/operationalinsights/models.go b/services/operationalinsights/mgmt/2015-03-20/operationalinsights/models.go index 53135ebcbfaa..1e5b422a5761 100644 --- a/services/operationalinsights/mgmt/2015-03-20/operationalinsights/models.go +++ b/services/operationalinsights/mgmt/2015-03-20/operationalinsights/models.go @@ -21,7 +21,6 @@ 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" @@ -264,7 +263,7 @@ func (ss *SavedSearch) UnmarshalJSON(body []byte) error { // SavedSearchesListResult the saved search list operation response. type SavedSearchesListResult struct { autorest.Response `json:"-"` - // Metadata - The metadata from search results. + // Metadata - Unused legacy property, kept here for backward compatibility. Metadata *SearchMetadata `json:"__metadata,omitempty"` // Value - The array of result values. Value *[]SavedSearch `json:"value,omitempty"` @@ -284,14 +283,6 @@ type SavedSearchProperties struct { Tags *[]Tag `json:"tags,omitempty"` } -// SearchError details for a search error. -type SearchError struct { - // Type - The error type. - Type *string `json:"type,omitempty"` - // Message - The error message. - Message *string `json:"message,omitempty"` -} - // SearchGetSchemaResponse the get schema operation response. type SearchGetSchemaResponse struct { autorest.Response `json:"-"` @@ -301,14 +292,6 @@ type SearchGetSchemaResponse struct { Value *[]SearchSchemaValue `json:"value,omitempty"` } -// SearchHighlight highlight details. -type SearchHighlight struct { - // Pre - The string that is put before a matched result. - Pre *string `json:"pre,omitempty"` - // Post - The string that is put after a matched result. - Post *string `json:"post,omitempty"` -} - // SearchMetadata metadata for search results. type SearchMetadata struct { // SearchID - The request id of the search. @@ -355,33 +338,6 @@ type SearchMetadataSchema struct { Version *int32 `json:"version,omitempty"` } -// SearchParameters parameters specifying the search query and range. -type SearchParameters struct { - // Top - The number to get from the top. - Top *int64 `json:"top,omitempty"` - // Highlight - The highlight that looks for all occurrences of a string. - Highlight *SearchHighlight `json:"highlight,omitempty"` - // Query - The query to search. - Query *string `json:"query,omitempty"` - // Start - The start date filter, so the only query results returned are after this date. - Start *date.Time `json:"start,omitempty"` - // End - The end date filter, so the only query results returned are before this date. - End *date.Time `json:"end,omitempty"` -} - -// SearchResultsResponse the get search result operation response. -type SearchResultsResponse struct { - autorest.Response `json:"-"` - // ID - READ-ONLY; The id of the search, which includes the full url. - ID *string `json:"id,omitempty"` - // Metadata - The metadata from search results. - Metadata *SearchMetadata `json:"metaData,omitempty"` - // Value - The array of result values. - Value *[]interface{} `json:"value,omitempty"` - // Error - The error. - Error *SearchError `json:"error,omitempty"` -} - // SearchSchemaValue value object for schema results. type SearchSchemaValue struct { // Name - The name of the schema. @@ -733,32 +689,3 @@ type WorkspacePurgeStatusResponse struct { // Status - Status of the operation represented by the requested Id. Possible values include: 'Pending', 'Completed' Status PurgeState `json:"status,omitempty"` } - -// WorkspacesGetSearchResultsFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type WorkspacesGetSearchResultsFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *WorkspacesGetSearchResultsFuture) Result(client WorkspacesClient) (srr SearchResultsResponse, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesGetSearchResultsFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("operationalinsights.WorkspacesGetSearchResultsFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if srr.Response.Response, err = future.GetResult(sender); err == nil && srr.Response.Response.StatusCode != http.StatusNoContent { - srr, err = client.GetSearchResultsResponder(srr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesGetSearchResultsFuture", "Result", srr.Response.Response, "Failure responding to request") - } - } - return -} diff --git a/services/operationalinsights/mgmt/2015-03-20/operationalinsights/operationalinsightsapi/interfaces.go b/services/operationalinsights/mgmt/2015-03-20/operationalinsights/operationalinsightsapi/interfaces.go index 659bb6cffd24..7db515a6cbbd 100644 --- a/services/operationalinsights/mgmt/2015-03-20/operationalinsights/operationalinsightsapi/interfaces.go +++ b/services/operationalinsights/mgmt/2015-03-20/operationalinsights/operationalinsightsapi/interfaces.go @@ -38,12 +38,10 @@ type WorkspacesClientAPI interface { DeleteGateways(ctx context.Context, resourceGroupName string, workspaceName string, gatewayID string) (result autorest.Response, err error) GetPurgeStatus(ctx context.Context, resourceGroupName string, workspaceName string) (result operationalinsights.WorkspacePurgeStatusResponse, err error) GetSchema(ctx context.Context, resourceGroupName string, workspaceName string) (result operationalinsights.SearchGetSchemaResponse, err error) - GetSearchResults(ctx context.Context, resourceGroupName string, workspaceName string, parameters operationalinsights.SearchParameters) (result operationalinsights.WorkspacesGetSearchResultsFuture, err error) ListKeys(ctx context.Context, resourceGroupName string, workspaceName string) (result operationalinsights.SharedKeys, err error) ListLinkTargets(ctx context.Context) (result operationalinsights.ListLinkTarget, err error) Purge(ctx context.Context, resourceGroupName string, workspaceName string, body operationalinsights.WorkspacePurgeBody) (result operationalinsights.WorkspacePurgeResponse, err error) RegenerateSharedKeys(ctx context.Context, resourceGroupName string, workspaceName string) (result operationalinsights.SharedKeys, err error) - UpdateSearchResults(ctx context.Context, resourceGroupName string, workspaceName string, ID string) (result operationalinsights.SearchResultsResponse, err error) } var _ WorkspacesClientAPI = (*operationalinsights.WorkspacesClient)(nil) @@ -53,7 +51,6 @@ type SavedSearchesClientAPI interface { CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, savedSearchID string, parameters operationalinsights.SavedSearch) (result operationalinsights.SavedSearch, err error) Delete(ctx context.Context, resourceGroupName string, workspaceName string, savedSearchID string) (result autorest.Response, err error) Get(ctx context.Context, resourceGroupName string, workspaceName string, savedSearchID string) (result operationalinsights.SavedSearch, err error) - GetResults(ctx context.Context, resourceGroupName string, workspaceName string, savedSearchID string) (result operationalinsights.SearchResultsResponse, err error) ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string) (result operationalinsights.SavedSearchesListResult, err error) } diff --git a/services/operationalinsights/mgmt/2015-03-20/operationalinsights/savedsearches.go b/services/operationalinsights/mgmt/2015-03-20/operationalinsights/savedsearches.go index 62b89f840ccc..c14989217454 100644 --- a/services/operationalinsights/mgmt/2015-03-20/operationalinsights/savedsearches.go +++ b/services/operationalinsights/mgmt/2015-03-20/operationalinsights/savedsearches.go @@ -317,93 +317,6 @@ func (client SavedSearchesClient) GetResponder(resp *http.Response) (result Save return } -// GetResults gets the results from a saved search for a given workspace. -// Parameters: -// resourceGroupName - the Resource Group name. -// workspaceName - the Log Analytics Workspace name. -// savedSearchID - the id of the saved search. -func (client SavedSearchesClient) GetResults(ctx context.Context, resourceGroupName string, workspaceName string, savedSearchID string) (result SearchResultsResponse, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SavedSearchesClient.GetResults") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("operationalinsights.SavedSearchesClient", "GetResults", err.Error()) - } - - req, err := client.GetResultsPreparer(ctx, resourceGroupName, workspaceName, savedSearchID) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.SavedSearchesClient", "GetResults", nil, "Failure preparing request") - return - } - - resp, err := client.GetResultsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "operationalinsights.SavedSearchesClient", "GetResults", resp, "Failure sending request") - return - } - - result, err = client.GetResultsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.SavedSearchesClient", "GetResults", resp, "Failure responding to request") - } - - return -} - -// GetResultsPreparer prepares the GetResults request. -func (client SavedSearchesClient) GetResultsPreparer(ctx context.Context, resourceGroupName string, workspaceName string, savedSearchID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "savedSearchId": autorest.Encode("path", savedSearchID), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2015-03-20" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}/results", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetResultsSender sends the GetResults request. The method will close the -// http.Response Body if it receives an error. -func (client SavedSearchesClient) GetResultsSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// GetResultsResponder handles the response to the GetResults request. The method always -// closes the http.Response Body. -func (client SavedSearchesClient) GetResultsResponder(resp *http.Response) (result SearchResultsResponse, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - // ListByWorkspace gets the saved searches for a given Log Analytics Workspace // Parameters: // resourceGroupName - the Resource Group name. diff --git a/services/operationalinsights/mgmt/2015-03-20/operationalinsights/workspaces.go b/services/operationalinsights/mgmt/2015-03-20/operationalinsights/workspaces.go index 151d5fdd4ca0..26f9a8aa6db7 100644 --- a/services/operationalinsights/mgmt/2015-03-20/operationalinsights/workspaces.go +++ b/services/operationalinsights/mgmt/2015-03-20/operationalinsights/workspaces.go @@ -298,98 +298,6 @@ func (client WorkspacesClient) GetSchemaResponder(resp *http.Response) (result S return } -// GetSearchResults submit a search for a given workspace. The response will contain an id to track the search. User -// can use the id to poll the search status and get the full search result later if the search takes long time to -// finish. -// Parameters: -// resourceGroupName - the Resource Group name. -// workspaceName - the Log Analytics Workspace name. -// parameters - the parameters required to execute a search query. -func (client WorkspacesClient) GetSearchResults(ctx context.Context, resourceGroupName string, workspaceName string, parameters SearchParameters) (result WorkspacesGetSearchResultsFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.GetSearchResults") - 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: parameters, - Constraints: []validation.Constraint{{Target: "parameters.Query", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("operationalinsights.WorkspacesClient", "GetSearchResults", err.Error()) - } - - req, err := client.GetSearchResultsPreparer(ctx, resourceGroupName, workspaceName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesClient", "GetSearchResults", nil, "Failure preparing request") - return - } - - result, err = client.GetSearchResultsSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesClient", "GetSearchResults", result.Response(), "Failure sending request") - return - } - - return -} - -// GetSearchResultsPreparer prepares the GetSearchResults request. -func (client WorkspacesClient) GetSearchResultsPreparer(ctx context.Context, resourceGroupName string, workspaceName string, parameters SearchParameters) (*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 = "2015-03-20" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/search", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSearchResultsSender sends the GetSearchResults request. The method will close the -// http.Response Body if it receives an error. -func (client WorkspacesClient) GetSearchResultsSender(req *http.Request) (future WorkspacesGetSearchResultsFuture, 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 -} - -// GetSearchResultsResponder handles the response to the GetSearchResults request. The method always -// closes the http.Response Body. -func (client WorkspacesClient) GetSearchResultsResponder(resp *http.Response) (result SearchResultsResponse, 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 -} - // ListKeys gets the shared keys for a Log Analytics Workspace. These keys are used to connect Microsoft Operational // Insights agents to the workspace. // Parameters: @@ -550,6 +458,11 @@ func (client WorkspacesClient) ListLinkTargetsResponder(resp *http.Response) (re } // Purge purges data in an Log Analytics workspace by a set of user-defined filters. +// +// In order to manage system resources, purge requests are throttled at 50 requests per hour. You should batch the +// execution of purge requests by sending a single command whose predicate includes all user identities that require +// purging. Use the in operator to specify multiple identities. You should run the query prior to using for a purge +// request to verify that the results are expected. // Parameters: // resourceGroupName - the Resource Group name. // workspaceName - the Log Analytics Workspace name. @@ -725,91 +638,3 @@ func (client WorkspacesClient) RegenerateSharedKeysResponder(resp *http.Response result.Response = autorest.Response{Response: resp} return } - -// UpdateSearchResults gets updated search results for a given search query. -// Parameters: -// resourceGroupName - the Resource Group name. -// workspaceName - the Log Analytics Workspace name. -// ID - the id of the search that will have results updated. You can get the id from the response of the -// GetResults call. -func (client WorkspacesClient) UpdateSearchResults(ctx context.Context, resourceGroupName string, workspaceName string, ID string) (result SearchResultsResponse, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.UpdateSearchResults") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("operationalinsights.WorkspacesClient", "UpdateSearchResults", err.Error()) - } - - req, err := client.UpdateSearchResultsPreparer(ctx, resourceGroupName, workspaceName, ID) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesClient", "UpdateSearchResults", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSearchResultsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesClient", "UpdateSearchResults", resp, "Failure sending request") - return - } - - result, err = client.UpdateSearchResultsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesClient", "UpdateSearchResults", resp, "Failure responding to request") - } - - return -} - -// UpdateSearchResultsPreparer prepares the UpdateSearchResults request. -func (client WorkspacesClient) UpdateSearchResultsPreparer(ctx context.Context, resourceGroupName string, workspaceName string, ID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "id": autorest.Encode("path", ID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2015-03-20" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/search/{id}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSearchResultsSender sends the UpdateSearchResults request. The method will close the -// http.Response Body if it receives an error. -func (client WorkspacesClient) UpdateSearchResultsSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// UpdateSearchResultsResponder handles the response to the UpdateSearchResults request. The method always -// closes the http.Response Body. -func (client WorkspacesClient) UpdateSearchResultsResponder(resp *http.Response) (result SearchResultsResponse, 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/policyinsights/mgmt/2019-10-01/policyinsights/client.go b/services/policyinsights/mgmt/2019-10-01/policyinsights/client.go new file mode 100644 index 000000000000..4687a8ef8675 --- /dev/null +++ b/services/policyinsights/mgmt/2019-10-01/policyinsights/client.go @@ -0,0 +1,49 @@ +// Package policyinsights implements the Azure ARM Policyinsights service API version . +// +// +package policyinsights + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the 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 Policyinsights + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Policyinsights. +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/policyinsights/mgmt/2019-10-01/policyinsights/models.go b/services/policyinsights/mgmt/2019-10-01/policyinsights/models.go new file mode 100644 index 000000000000..214dcc0b1605 --- /dev/null +++ b/services/policyinsights/mgmt/2019-10-01/policyinsights/models.go @@ -0,0 +1,1777 @@ +package policyinsights + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/policyinsights/mgmt/2019-10-01/policyinsights" + +// PolicyStatesResource enumerates the values for policy states resource. +type PolicyStatesResource string + +const ( + // Default ... + Default PolicyStatesResource = "default" + // Latest ... + Latest PolicyStatesResource = "latest" +) + +// PossiblePolicyStatesResourceValues returns an array of possible values for the PolicyStatesResource const type. +func PossiblePolicyStatesResourceValues() []PolicyStatesResource { + return []PolicyStatesResource{Default, Latest} +} + +// ComplianceDetail the compliance state rollup. +type ComplianceDetail struct { + // ComplianceState - The compliance state. + ComplianceState *string `json:"complianceState,omitempty"` + // Count - Summarized count value for this compliance state. + Count *int32 `json:"count,omitempty"` +} + +// 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"` + // Target - READ-ONLY; The target of the error. + Target *string `json:"target,omitempty"` + // Details - READ-ONLY; Internal error details. + Details *[]ErrorDefinition `json:"details,omitempty"` + // AdditionalInfo - READ-ONLY; Additional scenario specific error details. + AdditionalInfo *[]TypedErrorInfo `json:"additionalInfo,omitempty"` +} + +// ErrorResponse error response. +type ErrorResponse struct { + // Error - The error details. + Error *ErrorDefinition `json:"error,omitempty"` +} + +// ExpressionEvaluationDetails evaluation details of policy language expressions. +type ExpressionEvaluationDetails struct { + // Result - Evaluation result. + Result *string `json:"result,omitempty"` + // Expression - Expression evaluated. + Expression *string `json:"expression,omitempty"` + // Path - Property path if the expression is a field or an alias. + Path *string `json:"path,omitempty"` + // ExpressionValue - Value of the expression. + ExpressionValue interface{} `json:"expressionValue,omitempty"` + // TargetValue - Target value to be compared with the expression value. + TargetValue interface{} `json:"targetValue,omitempty"` + // Operator - Operator to compare the expression value and the target value. + Operator *string `json:"operator,omitempty"` +} + +// IfNotExistsEvaluationDetails evaluation details of IfNotExists effect. +type IfNotExistsEvaluationDetails struct { + // ResourceID - ID of the last evaluated resource for IfNotExists effect. + ResourceID *string `json:"resourceId,omitempty"` + // TotalResources - Total number of resources to which the existence condition is applicable. + TotalResources *int32 `json:"totalResources,omitempty"` +} + +// Operation operation definition. +type Operation struct { + // Name - Operation name. + Name *string `json:"name,omitempty"` + // Display - Display metadata associated with the operation. + Display *OperationDisplay `json:"display,omitempty"` +} + +// OperationDisplay display metadata associated with the operation. +type OperationDisplay struct { + // Provider - Resource provider name. + Provider *string `json:"provider,omitempty"` + // Resource - Resource name on which the operation is performed. + Resource *string `json:"resource,omitempty"` + // Operation - Operation name. + Operation *string `json:"operation,omitempty"` + // Description - Operation description. + Description *string `json:"description,omitempty"` +} + +// OperationsListResults list of available operations. +type OperationsListResults struct { + autorest.Response `json:"-"` + // OdataCount - OData entity count; represents the number of operations returned. + OdataCount *int32 `json:"@odata.count,omitempty"` + // Value - List of available operations. + Value *[]Operation `json:"value,omitempty"` +} + +// PolicyAssignmentSummary policy assignment summary. +type PolicyAssignmentSummary struct { + // PolicyAssignmentID - Policy assignment ID. + PolicyAssignmentID *string `json:"policyAssignmentId,omitempty"` + // PolicySetDefinitionID - Policy set definition ID, if the policy assignment is for a policy set. + PolicySetDefinitionID *string `json:"policySetDefinitionId,omitempty"` + // Results - Compliance summary for the policy assignment. + Results *SummaryResults `json:"results,omitempty"` + // PolicyDefinitions - Policy definitions summary. + PolicyDefinitions *[]PolicyDefinitionSummary `json:"policyDefinitions,omitempty"` + // PolicyGroups - Policy definition group summary. + PolicyGroups *[]PolicyGroupSummary `json:"policyGroups,omitempty"` +} + +// PolicyDefinitionSummary policy definition summary. +type PolicyDefinitionSummary struct { + // PolicyDefinitionID - Policy definition ID. + PolicyDefinitionID *string `json:"policyDefinitionId,omitempty"` + // PolicyDefinitionReferenceID - Policy definition reference ID. + PolicyDefinitionReferenceID *string `json:"policyDefinitionReferenceId,omitempty"` + // PolicyDefinitionGroupNames - Policy definition group names. + PolicyDefinitionGroupNames *[]string `json:"policyDefinitionGroupNames,omitempty"` + // Effect - Policy effect, i.e. policy definition action. + Effect *string `json:"effect,omitempty"` + // Results - Compliance summary for the policy definition. + Results *SummaryResults `json:"results,omitempty"` +} + +// PolicyDetails the policy details. +type PolicyDetails struct { + // PolicyDefinitionID - READ-ONLY; The ID of the policy definition. + PolicyDefinitionID *string `json:"policyDefinitionId,omitempty"` + // PolicyAssignmentID - READ-ONLY; The ID of the policy assignment. + PolicyAssignmentID *string `json:"policyAssignmentId,omitempty"` + // PolicyAssignmentDisplayName - READ-ONLY; The display name of the policy assignment. + PolicyAssignmentDisplayName *string `json:"policyAssignmentDisplayName,omitempty"` + // PolicyAssignmentScope - READ-ONLY; The scope of the policy assignment. + PolicyAssignmentScope *string `json:"policyAssignmentScope,omitempty"` + // PolicySetDefinitionID - READ-ONLY; The ID of the policy set definition. + PolicySetDefinitionID *string `json:"policySetDefinitionId,omitempty"` + // PolicyDefinitionReferenceID - READ-ONLY; The policy definition reference ID within the policy set definition. + PolicyDefinitionReferenceID *string `json:"policyDefinitionReferenceId,omitempty"` +} + +// PolicyEvaluationDetails policy evaluation details. +type PolicyEvaluationDetails struct { + // EvaluatedExpressions - Details of the evaluated expressions. + EvaluatedExpressions *[]ExpressionEvaluationDetails `json:"evaluatedExpressions,omitempty"` + // IfNotExistsDetails - Evaluation details of IfNotExists effect. + IfNotExistsDetails *IfNotExistsEvaluationDetails `json:"ifNotExistsDetails,omitempty"` +} + +// PolicyEvent policy event record. +type PolicyEvent struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // OdataID - OData entity ID; always set to null since policy event records do not have an entity ID. + OdataID *string `json:"@odata.id,omitempty"` + // OdataContext - OData context string; used by OData clients to resolve type information based on metadata. + OdataContext *string `json:"@odata.context,omitempty"` + // Timestamp - Timestamp for the policy event record. + Timestamp *date.Time `json:"timestamp,omitempty"` + // ResourceID - Resource ID. + ResourceID *string `json:"resourceId,omitempty"` + // PolicyAssignmentID - Policy assignment ID. + PolicyAssignmentID *string `json:"policyAssignmentId,omitempty"` + // PolicyDefinitionID - Policy definition ID. + PolicyDefinitionID *string `json:"policyDefinitionId,omitempty"` + // EffectiveParameters - Effective parameters for the policy assignment. + EffectiveParameters *string `json:"effectiveParameters,omitempty"` + // IsCompliant - Flag which states whether the resource is compliant against the policy assignment it was evaluated against. + IsCompliant *bool `json:"isCompliant,omitempty"` + // SubscriptionID - Subscription ID. + SubscriptionID *string `json:"subscriptionId,omitempty"` + // ResourceType - Resource type. + ResourceType *string `json:"resourceType,omitempty"` + // ResourceLocation - Resource location. + ResourceLocation *string `json:"resourceLocation,omitempty"` + // ResourceGroup - Resource group name. + ResourceGroup *string `json:"resourceGroup,omitempty"` + // ResourceTags - List of resource tags. + ResourceTags *string `json:"resourceTags,omitempty"` + // PolicyAssignmentName - Policy assignment name. + PolicyAssignmentName *string `json:"policyAssignmentName,omitempty"` + // PolicyAssignmentOwner - Policy assignment owner. + PolicyAssignmentOwner *string `json:"policyAssignmentOwner,omitempty"` + // PolicyAssignmentParameters - Policy assignment parameters. + PolicyAssignmentParameters *string `json:"policyAssignmentParameters,omitempty"` + // PolicyAssignmentScope - Policy assignment scope. + PolicyAssignmentScope *string `json:"policyAssignmentScope,omitempty"` + // PolicyDefinitionName - Policy definition name. + PolicyDefinitionName *string `json:"policyDefinitionName,omitempty"` + // PolicyDefinitionAction - Policy definition action, i.e. effect. + PolicyDefinitionAction *string `json:"policyDefinitionAction,omitempty"` + // PolicyDefinitionCategory - Policy definition category. + PolicyDefinitionCategory *string `json:"policyDefinitionCategory,omitempty"` + // PolicySetDefinitionID - Policy set definition ID, if the policy assignment is for a policy set. + PolicySetDefinitionID *string `json:"policySetDefinitionId,omitempty"` + // PolicySetDefinitionName - Policy set definition name, if the policy assignment is for a policy set. + PolicySetDefinitionName *string `json:"policySetDefinitionName,omitempty"` + // PolicySetDefinitionOwner - Policy set definition owner, if the policy assignment is for a policy set. + PolicySetDefinitionOwner *string `json:"policySetDefinitionOwner,omitempty"` + // PolicySetDefinitionCategory - Policy set definition category, if the policy assignment is for a policy set. + PolicySetDefinitionCategory *string `json:"policySetDefinitionCategory,omitempty"` + // PolicySetDefinitionParameters - Policy set definition parameters, if the policy assignment is for a policy set. + PolicySetDefinitionParameters *string `json:"policySetDefinitionParameters,omitempty"` + // ManagementGroupIds - Comma separated list of management group IDs, which represent the hierarchy of the management groups the resource is under. + ManagementGroupIds *string `json:"managementGroupIds,omitempty"` + // PolicyDefinitionReferenceID - Reference ID for the policy definition inside the policy set, if the policy assignment is for a policy set. + PolicyDefinitionReferenceID *string `json:"policyDefinitionReferenceId,omitempty"` + // TenantID - Tenant ID for the policy event record. + TenantID *string `json:"tenantId,omitempty"` + // PrincipalOid - Principal object ID for the user who initiated the resource operation that triggered the policy event. + PrincipalOid *string `json:"principalOid,omitempty"` +} + +// MarshalJSON is the custom marshaler for PolicyEvent. +func (peVar PolicyEvent) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if peVar.OdataID != nil { + objectMap["@odata.id"] = peVar.OdataID + } + if peVar.OdataContext != nil { + objectMap["@odata.context"] = peVar.OdataContext + } + if peVar.Timestamp != nil { + objectMap["timestamp"] = peVar.Timestamp + } + if peVar.ResourceID != nil { + objectMap["resourceId"] = peVar.ResourceID + } + if peVar.PolicyAssignmentID != nil { + objectMap["policyAssignmentId"] = peVar.PolicyAssignmentID + } + if peVar.PolicyDefinitionID != nil { + objectMap["policyDefinitionId"] = peVar.PolicyDefinitionID + } + if peVar.EffectiveParameters != nil { + objectMap["effectiveParameters"] = peVar.EffectiveParameters + } + if peVar.IsCompliant != nil { + objectMap["isCompliant"] = peVar.IsCompliant + } + if peVar.SubscriptionID != nil { + objectMap["subscriptionId"] = peVar.SubscriptionID + } + if peVar.ResourceType != nil { + objectMap["resourceType"] = peVar.ResourceType + } + if peVar.ResourceLocation != nil { + objectMap["resourceLocation"] = peVar.ResourceLocation + } + if peVar.ResourceGroup != nil { + objectMap["resourceGroup"] = peVar.ResourceGroup + } + if peVar.ResourceTags != nil { + objectMap["resourceTags"] = peVar.ResourceTags + } + if peVar.PolicyAssignmentName != nil { + objectMap["policyAssignmentName"] = peVar.PolicyAssignmentName + } + if peVar.PolicyAssignmentOwner != nil { + objectMap["policyAssignmentOwner"] = peVar.PolicyAssignmentOwner + } + if peVar.PolicyAssignmentParameters != nil { + objectMap["policyAssignmentParameters"] = peVar.PolicyAssignmentParameters + } + if peVar.PolicyAssignmentScope != nil { + objectMap["policyAssignmentScope"] = peVar.PolicyAssignmentScope + } + if peVar.PolicyDefinitionName != nil { + objectMap["policyDefinitionName"] = peVar.PolicyDefinitionName + } + if peVar.PolicyDefinitionAction != nil { + objectMap["policyDefinitionAction"] = peVar.PolicyDefinitionAction + } + if peVar.PolicyDefinitionCategory != nil { + objectMap["policyDefinitionCategory"] = peVar.PolicyDefinitionCategory + } + if peVar.PolicySetDefinitionID != nil { + objectMap["policySetDefinitionId"] = peVar.PolicySetDefinitionID + } + if peVar.PolicySetDefinitionName != nil { + objectMap["policySetDefinitionName"] = peVar.PolicySetDefinitionName + } + if peVar.PolicySetDefinitionOwner != nil { + objectMap["policySetDefinitionOwner"] = peVar.PolicySetDefinitionOwner + } + if peVar.PolicySetDefinitionCategory != nil { + objectMap["policySetDefinitionCategory"] = peVar.PolicySetDefinitionCategory + } + if peVar.PolicySetDefinitionParameters != nil { + objectMap["policySetDefinitionParameters"] = peVar.PolicySetDefinitionParameters + } + if peVar.ManagementGroupIds != nil { + objectMap["managementGroupIds"] = peVar.ManagementGroupIds + } + if peVar.PolicyDefinitionReferenceID != nil { + objectMap["policyDefinitionReferenceId"] = peVar.PolicyDefinitionReferenceID + } + if peVar.TenantID != nil { + objectMap["tenantId"] = peVar.TenantID + } + if peVar.PrincipalOid != nil { + objectMap["principalOid"] = peVar.PrincipalOid + } + for k, v := range peVar.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PolicyEvent struct. +func (peVar *PolicyEvent) UnmarshalJSON(body []byte) 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 peVar.AdditionalProperties == nil { + peVar.AdditionalProperties = make(map[string]interface{}) + } + peVar.AdditionalProperties[k] = additionalProperties + } + case "@odata.id": + if v != nil { + var odataID string + err = json.Unmarshal(*v, &odataID) + if err != nil { + return err + } + peVar.OdataID = &odataID + } + case "@odata.context": + if v != nil { + var odataContext string + err = json.Unmarshal(*v, &odataContext) + if err != nil { + return err + } + peVar.OdataContext = &odataContext + } + case "timestamp": + if v != nil { + var timestamp date.Time + err = json.Unmarshal(*v, ×tamp) + if err != nil { + return err + } + peVar.Timestamp = ×tamp + } + case "resourceId": + if v != nil { + var resourceID string + err = json.Unmarshal(*v, &resourceID) + if err != nil { + return err + } + peVar.ResourceID = &resourceID + } + case "policyAssignmentId": + if v != nil { + var policyAssignmentID string + err = json.Unmarshal(*v, &policyAssignmentID) + if err != nil { + return err + } + peVar.PolicyAssignmentID = &policyAssignmentID + } + case "policyDefinitionId": + if v != nil { + var policyDefinitionID string + err = json.Unmarshal(*v, &policyDefinitionID) + if err != nil { + return err + } + peVar.PolicyDefinitionID = &policyDefinitionID + } + case "effectiveParameters": + if v != nil { + var effectiveParameters string + err = json.Unmarshal(*v, &effectiveParameters) + if err != nil { + return err + } + peVar.EffectiveParameters = &effectiveParameters + } + case "isCompliant": + if v != nil { + var isCompliant bool + err = json.Unmarshal(*v, &isCompliant) + if err != nil { + return err + } + peVar.IsCompliant = &isCompliant + } + case "subscriptionId": + if v != nil { + var subscriptionID string + err = json.Unmarshal(*v, &subscriptionID) + if err != nil { + return err + } + peVar.SubscriptionID = &subscriptionID + } + case "resourceType": + if v != nil { + var resourceType string + err = json.Unmarshal(*v, &resourceType) + if err != nil { + return err + } + peVar.ResourceType = &resourceType + } + case "resourceLocation": + if v != nil { + var resourceLocation string + err = json.Unmarshal(*v, &resourceLocation) + if err != nil { + return err + } + peVar.ResourceLocation = &resourceLocation + } + case "resourceGroup": + if v != nil { + var resourceGroup string + err = json.Unmarshal(*v, &resourceGroup) + if err != nil { + return err + } + peVar.ResourceGroup = &resourceGroup + } + case "resourceTags": + if v != nil { + var resourceTags string + err = json.Unmarshal(*v, &resourceTags) + if err != nil { + return err + } + peVar.ResourceTags = &resourceTags + } + case "policyAssignmentName": + if v != nil { + var policyAssignmentName string + err = json.Unmarshal(*v, &policyAssignmentName) + if err != nil { + return err + } + peVar.PolicyAssignmentName = &policyAssignmentName + } + case "policyAssignmentOwner": + if v != nil { + var policyAssignmentOwner string + err = json.Unmarshal(*v, &policyAssignmentOwner) + if err != nil { + return err + } + peVar.PolicyAssignmentOwner = &policyAssignmentOwner + } + case "policyAssignmentParameters": + if v != nil { + var policyAssignmentParameters string + err = json.Unmarshal(*v, &policyAssignmentParameters) + if err != nil { + return err + } + peVar.PolicyAssignmentParameters = &policyAssignmentParameters + } + case "policyAssignmentScope": + if v != nil { + var policyAssignmentScope string + err = json.Unmarshal(*v, &policyAssignmentScope) + if err != nil { + return err + } + peVar.PolicyAssignmentScope = &policyAssignmentScope + } + case "policyDefinitionName": + if v != nil { + var policyDefinitionName string + err = json.Unmarshal(*v, &policyDefinitionName) + if err != nil { + return err + } + peVar.PolicyDefinitionName = &policyDefinitionName + } + case "policyDefinitionAction": + if v != nil { + var policyDefinitionAction string + err = json.Unmarshal(*v, &policyDefinitionAction) + if err != nil { + return err + } + peVar.PolicyDefinitionAction = &policyDefinitionAction + } + case "policyDefinitionCategory": + if v != nil { + var policyDefinitionCategory string + err = json.Unmarshal(*v, &policyDefinitionCategory) + if err != nil { + return err + } + peVar.PolicyDefinitionCategory = &policyDefinitionCategory + } + case "policySetDefinitionId": + if v != nil { + var policySetDefinitionID string + err = json.Unmarshal(*v, &policySetDefinitionID) + if err != nil { + return err + } + peVar.PolicySetDefinitionID = &policySetDefinitionID + } + case "policySetDefinitionName": + if v != nil { + var policySetDefinitionName string + err = json.Unmarshal(*v, &policySetDefinitionName) + if err != nil { + return err + } + peVar.PolicySetDefinitionName = &policySetDefinitionName + } + case "policySetDefinitionOwner": + if v != nil { + var policySetDefinitionOwner string + err = json.Unmarshal(*v, &policySetDefinitionOwner) + if err != nil { + return err + } + peVar.PolicySetDefinitionOwner = &policySetDefinitionOwner + } + case "policySetDefinitionCategory": + if v != nil { + var policySetDefinitionCategory string + err = json.Unmarshal(*v, &policySetDefinitionCategory) + if err != nil { + return err + } + peVar.PolicySetDefinitionCategory = &policySetDefinitionCategory + } + case "policySetDefinitionParameters": + if v != nil { + var policySetDefinitionParameters string + err = json.Unmarshal(*v, &policySetDefinitionParameters) + if err != nil { + return err + } + peVar.PolicySetDefinitionParameters = &policySetDefinitionParameters + } + case "managementGroupIds": + if v != nil { + var managementGroupIds string + err = json.Unmarshal(*v, &managementGroupIds) + if err != nil { + return err + } + peVar.ManagementGroupIds = &managementGroupIds + } + case "policyDefinitionReferenceId": + if v != nil { + var policyDefinitionReferenceID string + err = json.Unmarshal(*v, &policyDefinitionReferenceID) + if err != nil { + return err + } + peVar.PolicyDefinitionReferenceID = &policyDefinitionReferenceID + } + case "tenantId": + if v != nil { + var tenantID string + err = json.Unmarshal(*v, &tenantID) + if err != nil { + return err + } + peVar.TenantID = &tenantID + } + case "principalOid": + if v != nil { + var principalOid string + err = json.Unmarshal(*v, &principalOid) + if err != nil { + return err + } + peVar.PrincipalOid = &principalOid + } + } + } + + return nil +} + +// PolicyEventsQueryResults query results. +type PolicyEventsQueryResults struct { + autorest.Response `json:"-"` + // OdataContext - OData context string; used by OData clients to resolve type information based on metadata. + OdataContext *string `json:"@odata.context,omitempty"` + // OdataCount - OData entity count; represents the number of policy event records returned. + OdataCount *int32 `json:"@odata.count,omitempty"` + // Value - Query results. + Value *[]PolicyEvent `json:"value,omitempty"` +} + +// PolicyGroupSummary policy definition group summary. +type PolicyGroupSummary struct { + // PolicyGroupName - Policy group name. + PolicyGroupName *string `json:"policyGroupName,omitempty"` + // Results - Compliance summary for the policy definition group. + Results *SummaryResults `json:"results,omitempty"` +} + +// PolicyState policy state record. +type PolicyState struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // OdataID - OData entity ID; always set to null since policy state records do not have an entity ID. + OdataID *string `json:"@odata.id,omitempty"` + // OdataContext - OData context string; used by OData clients to resolve type information based on metadata. + OdataContext *string `json:"@odata.context,omitempty"` + // Timestamp - Timestamp for the policy state record. + Timestamp *date.Time `json:"timestamp,omitempty"` + // ResourceID - Resource ID. + ResourceID *string `json:"resourceId,omitempty"` + // PolicyAssignmentID - Policy assignment ID. + PolicyAssignmentID *string `json:"policyAssignmentId,omitempty"` + // PolicyDefinitionID - Policy definition ID. + PolicyDefinitionID *string `json:"policyDefinitionId,omitempty"` + // EffectiveParameters - Effective parameters for the policy assignment. + EffectiveParameters *string `json:"effectiveParameters,omitempty"` + // IsCompliant - Flag which states whether the resource is compliant against the policy assignment it was evaluated against. This property is deprecated; please use ComplianceState instead. + IsCompliant *bool `json:"isCompliant,omitempty"` + // SubscriptionID - Subscription ID. + SubscriptionID *string `json:"subscriptionId,omitempty"` + // ResourceType - Resource type. + ResourceType *string `json:"resourceType,omitempty"` + // ResourceLocation - Resource location. + ResourceLocation *string `json:"resourceLocation,omitempty"` + // ResourceGroup - Resource group name. + ResourceGroup *string `json:"resourceGroup,omitempty"` + // ResourceTags - List of resource tags. + ResourceTags *string `json:"resourceTags,omitempty"` + // PolicyAssignmentName - Policy assignment name. + PolicyAssignmentName *string `json:"policyAssignmentName,omitempty"` + // PolicyAssignmentOwner - Policy assignment owner. + PolicyAssignmentOwner *string `json:"policyAssignmentOwner,omitempty"` + // PolicyAssignmentParameters - Policy assignment parameters. + PolicyAssignmentParameters *string `json:"policyAssignmentParameters,omitempty"` + // PolicyAssignmentScope - Policy assignment scope. + PolicyAssignmentScope *string `json:"policyAssignmentScope,omitempty"` + // PolicyDefinitionName - Policy definition name. + PolicyDefinitionName *string `json:"policyDefinitionName,omitempty"` + // PolicyDefinitionAction - Policy definition action, i.e. effect. + PolicyDefinitionAction *string `json:"policyDefinitionAction,omitempty"` + // PolicyDefinitionCategory - Policy definition category. + PolicyDefinitionCategory *string `json:"policyDefinitionCategory,omitempty"` + // PolicySetDefinitionID - Policy set definition ID, if the policy assignment is for a policy set. + PolicySetDefinitionID *string `json:"policySetDefinitionId,omitempty"` + // PolicySetDefinitionName - Policy set definition name, if the policy assignment is for a policy set. + PolicySetDefinitionName *string `json:"policySetDefinitionName,omitempty"` + // PolicySetDefinitionOwner - Policy set definition owner, if the policy assignment is for a policy set. + PolicySetDefinitionOwner *string `json:"policySetDefinitionOwner,omitempty"` + // PolicySetDefinitionCategory - Policy set definition category, if the policy assignment is for a policy set. + PolicySetDefinitionCategory *string `json:"policySetDefinitionCategory,omitempty"` + // PolicySetDefinitionParameters - Policy set definition parameters, if the policy assignment is for a policy set. + PolicySetDefinitionParameters *string `json:"policySetDefinitionParameters,omitempty"` + // ManagementGroupIds - Comma separated list of management group IDs, which represent the hierarchy of the management groups the resource is under. + ManagementGroupIds *string `json:"managementGroupIds,omitempty"` + // PolicyDefinitionReferenceID - Reference ID for the policy definition inside the policy set, if the policy assignment is for a policy set. + PolicyDefinitionReferenceID *string `json:"policyDefinitionReferenceId,omitempty"` + // ComplianceState - Compliance state of the resource. + ComplianceState *string `json:"complianceState,omitempty"` + // PolicyEvaluationDetails - Policy evaluation details. + PolicyEvaluationDetails *PolicyEvaluationDetails `json:"policyEvaluationDetails,omitempty"` + // PolicyDefinitionGroupNames - Policy definition group names. + PolicyDefinitionGroupNames *[]string `json:"policyDefinitionGroupNames,omitempty"` +} + +// MarshalJSON is the custom marshaler for PolicyState. +func (ps PolicyState) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ps.OdataID != nil { + objectMap["@odata.id"] = ps.OdataID + } + if ps.OdataContext != nil { + objectMap["@odata.context"] = ps.OdataContext + } + if ps.Timestamp != nil { + objectMap["timestamp"] = ps.Timestamp + } + if ps.ResourceID != nil { + objectMap["resourceId"] = ps.ResourceID + } + if ps.PolicyAssignmentID != nil { + objectMap["policyAssignmentId"] = ps.PolicyAssignmentID + } + if ps.PolicyDefinitionID != nil { + objectMap["policyDefinitionId"] = ps.PolicyDefinitionID + } + if ps.EffectiveParameters != nil { + objectMap["effectiveParameters"] = ps.EffectiveParameters + } + if ps.IsCompliant != nil { + objectMap["isCompliant"] = ps.IsCompliant + } + if ps.SubscriptionID != nil { + objectMap["subscriptionId"] = ps.SubscriptionID + } + if ps.ResourceType != nil { + objectMap["resourceType"] = ps.ResourceType + } + if ps.ResourceLocation != nil { + objectMap["resourceLocation"] = ps.ResourceLocation + } + if ps.ResourceGroup != nil { + objectMap["resourceGroup"] = ps.ResourceGroup + } + if ps.ResourceTags != nil { + objectMap["resourceTags"] = ps.ResourceTags + } + if ps.PolicyAssignmentName != nil { + objectMap["policyAssignmentName"] = ps.PolicyAssignmentName + } + if ps.PolicyAssignmentOwner != nil { + objectMap["policyAssignmentOwner"] = ps.PolicyAssignmentOwner + } + if ps.PolicyAssignmentParameters != nil { + objectMap["policyAssignmentParameters"] = ps.PolicyAssignmentParameters + } + if ps.PolicyAssignmentScope != nil { + objectMap["policyAssignmentScope"] = ps.PolicyAssignmentScope + } + if ps.PolicyDefinitionName != nil { + objectMap["policyDefinitionName"] = ps.PolicyDefinitionName + } + if ps.PolicyDefinitionAction != nil { + objectMap["policyDefinitionAction"] = ps.PolicyDefinitionAction + } + if ps.PolicyDefinitionCategory != nil { + objectMap["policyDefinitionCategory"] = ps.PolicyDefinitionCategory + } + if ps.PolicySetDefinitionID != nil { + objectMap["policySetDefinitionId"] = ps.PolicySetDefinitionID + } + if ps.PolicySetDefinitionName != nil { + objectMap["policySetDefinitionName"] = ps.PolicySetDefinitionName + } + if ps.PolicySetDefinitionOwner != nil { + objectMap["policySetDefinitionOwner"] = ps.PolicySetDefinitionOwner + } + if ps.PolicySetDefinitionCategory != nil { + objectMap["policySetDefinitionCategory"] = ps.PolicySetDefinitionCategory + } + if ps.PolicySetDefinitionParameters != nil { + objectMap["policySetDefinitionParameters"] = ps.PolicySetDefinitionParameters + } + if ps.ManagementGroupIds != nil { + objectMap["managementGroupIds"] = ps.ManagementGroupIds + } + if ps.PolicyDefinitionReferenceID != nil { + objectMap["policyDefinitionReferenceId"] = ps.PolicyDefinitionReferenceID + } + if ps.ComplianceState != nil { + objectMap["complianceState"] = ps.ComplianceState + } + if ps.PolicyEvaluationDetails != nil { + objectMap["policyEvaluationDetails"] = ps.PolicyEvaluationDetails + } + if ps.PolicyDefinitionGroupNames != nil { + objectMap["policyDefinitionGroupNames"] = ps.PolicyDefinitionGroupNames + } + for k, v := range ps.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PolicyState struct. +func (ps *PolicyState) UnmarshalJSON(body []byte) 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 ps.AdditionalProperties == nil { + ps.AdditionalProperties = make(map[string]interface{}) + } + ps.AdditionalProperties[k] = additionalProperties + } + case "@odata.id": + if v != nil { + var odataID string + err = json.Unmarshal(*v, &odataID) + if err != nil { + return err + } + ps.OdataID = &odataID + } + case "@odata.context": + if v != nil { + var odataContext string + err = json.Unmarshal(*v, &odataContext) + if err != nil { + return err + } + ps.OdataContext = &odataContext + } + case "timestamp": + if v != nil { + var timestamp date.Time + err = json.Unmarshal(*v, ×tamp) + if err != nil { + return err + } + ps.Timestamp = ×tamp + } + case "resourceId": + if v != nil { + var resourceID string + err = json.Unmarshal(*v, &resourceID) + if err != nil { + return err + } + ps.ResourceID = &resourceID + } + case "policyAssignmentId": + if v != nil { + var policyAssignmentID string + err = json.Unmarshal(*v, &policyAssignmentID) + if err != nil { + return err + } + ps.PolicyAssignmentID = &policyAssignmentID + } + case "policyDefinitionId": + if v != nil { + var policyDefinitionID string + err = json.Unmarshal(*v, &policyDefinitionID) + if err != nil { + return err + } + ps.PolicyDefinitionID = &policyDefinitionID + } + case "effectiveParameters": + if v != nil { + var effectiveParameters string + err = json.Unmarshal(*v, &effectiveParameters) + if err != nil { + return err + } + ps.EffectiveParameters = &effectiveParameters + } + case "isCompliant": + if v != nil { + var isCompliant bool + err = json.Unmarshal(*v, &isCompliant) + if err != nil { + return err + } + ps.IsCompliant = &isCompliant + } + case "subscriptionId": + if v != nil { + var subscriptionID string + err = json.Unmarshal(*v, &subscriptionID) + if err != nil { + return err + } + ps.SubscriptionID = &subscriptionID + } + case "resourceType": + if v != nil { + var resourceType string + err = json.Unmarshal(*v, &resourceType) + if err != nil { + return err + } + ps.ResourceType = &resourceType + } + case "resourceLocation": + if v != nil { + var resourceLocation string + err = json.Unmarshal(*v, &resourceLocation) + if err != nil { + return err + } + ps.ResourceLocation = &resourceLocation + } + case "resourceGroup": + if v != nil { + var resourceGroup string + err = json.Unmarshal(*v, &resourceGroup) + if err != nil { + return err + } + ps.ResourceGroup = &resourceGroup + } + case "resourceTags": + if v != nil { + var resourceTags string + err = json.Unmarshal(*v, &resourceTags) + if err != nil { + return err + } + ps.ResourceTags = &resourceTags + } + case "policyAssignmentName": + if v != nil { + var policyAssignmentName string + err = json.Unmarshal(*v, &policyAssignmentName) + if err != nil { + return err + } + ps.PolicyAssignmentName = &policyAssignmentName + } + case "policyAssignmentOwner": + if v != nil { + var policyAssignmentOwner string + err = json.Unmarshal(*v, &policyAssignmentOwner) + if err != nil { + return err + } + ps.PolicyAssignmentOwner = &policyAssignmentOwner + } + case "policyAssignmentParameters": + if v != nil { + var policyAssignmentParameters string + err = json.Unmarshal(*v, &policyAssignmentParameters) + if err != nil { + return err + } + ps.PolicyAssignmentParameters = &policyAssignmentParameters + } + case "policyAssignmentScope": + if v != nil { + var policyAssignmentScope string + err = json.Unmarshal(*v, &policyAssignmentScope) + if err != nil { + return err + } + ps.PolicyAssignmentScope = &policyAssignmentScope + } + case "policyDefinitionName": + if v != nil { + var policyDefinitionName string + err = json.Unmarshal(*v, &policyDefinitionName) + if err != nil { + return err + } + ps.PolicyDefinitionName = &policyDefinitionName + } + case "policyDefinitionAction": + if v != nil { + var policyDefinitionAction string + err = json.Unmarshal(*v, &policyDefinitionAction) + if err != nil { + return err + } + ps.PolicyDefinitionAction = &policyDefinitionAction + } + case "policyDefinitionCategory": + if v != nil { + var policyDefinitionCategory string + err = json.Unmarshal(*v, &policyDefinitionCategory) + if err != nil { + return err + } + ps.PolicyDefinitionCategory = &policyDefinitionCategory + } + case "policySetDefinitionId": + if v != nil { + var policySetDefinitionID string + err = json.Unmarshal(*v, &policySetDefinitionID) + if err != nil { + return err + } + ps.PolicySetDefinitionID = &policySetDefinitionID + } + case "policySetDefinitionName": + if v != nil { + var policySetDefinitionName string + err = json.Unmarshal(*v, &policySetDefinitionName) + if err != nil { + return err + } + ps.PolicySetDefinitionName = &policySetDefinitionName + } + case "policySetDefinitionOwner": + if v != nil { + var policySetDefinitionOwner string + err = json.Unmarshal(*v, &policySetDefinitionOwner) + if err != nil { + return err + } + ps.PolicySetDefinitionOwner = &policySetDefinitionOwner + } + case "policySetDefinitionCategory": + if v != nil { + var policySetDefinitionCategory string + err = json.Unmarshal(*v, &policySetDefinitionCategory) + if err != nil { + return err + } + ps.PolicySetDefinitionCategory = &policySetDefinitionCategory + } + case "policySetDefinitionParameters": + if v != nil { + var policySetDefinitionParameters string + err = json.Unmarshal(*v, &policySetDefinitionParameters) + if err != nil { + return err + } + ps.PolicySetDefinitionParameters = &policySetDefinitionParameters + } + case "managementGroupIds": + if v != nil { + var managementGroupIds string + err = json.Unmarshal(*v, &managementGroupIds) + if err != nil { + return err + } + ps.ManagementGroupIds = &managementGroupIds + } + case "policyDefinitionReferenceId": + if v != nil { + var policyDefinitionReferenceID string + err = json.Unmarshal(*v, &policyDefinitionReferenceID) + if err != nil { + return err + } + ps.PolicyDefinitionReferenceID = &policyDefinitionReferenceID + } + case "complianceState": + if v != nil { + var complianceState string + err = json.Unmarshal(*v, &complianceState) + if err != nil { + return err + } + ps.ComplianceState = &complianceState + } + case "policyEvaluationDetails": + if v != nil { + var policyEvaluationDetails PolicyEvaluationDetails + err = json.Unmarshal(*v, &policyEvaluationDetails) + if err != nil { + return err + } + ps.PolicyEvaluationDetails = &policyEvaluationDetails + } + case "policyDefinitionGroupNames": + if v != nil { + var policyDefinitionGroupNames []string + err = json.Unmarshal(*v, &policyDefinitionGroupNames) + if err != nil { + return err + } + ps.PolicyDefinitionGroupNames = &policyDefinitionGroupNames + } + } + } + + return nil +} + +// PolicyStatesQueryResults query results. +type PolicyStatesQueryResults struct { + autorest.Response `json:"-"` + // OdataContext - OData context string; used by OData clients to resolve type information based on metadata. + OdataContext *string `json:"@odata.context,omitempty"` + // OdataCount - OData entity count; represents the number of policy state records returned. + OdataCount *int32 `json:"@odata.count,omitempty"` + // Value - Query results. + Value *[]PolicyState `json:"value,omitempty"` +} + +// PolicyTrackedResource policy tracked resource record. +type PolicyTrackedResource struct { + // TrackedResourceID - READ-ONLY; The ID of the policy tracked resource. + TrackedResourceID *string `json:"trackedResourceId,omitempty"` + // PolicyDetails - READ-ONLY; The details of the policy that require the tracked resource. + PolicyDetails *PolicyDetails `json:"policyDetails,omitempty"` + // CreatedBy - READ-ONLY; The details of the policy triggered deployment that created the tracked resource. + CreatedBy *TrackedResourceModificationDetails `json:"createdBy,omitempty"` + // LastModifiedBy - READ-ONLY; The details of the policy triggered deployment that modified the tracked resource. + LastModifiedBy *TrackedResourceModificationDetails `json:"lastModifiedBy,omitempty"` + // LastUpdateUtc - READ-ONLY; Timestamp of the last update to the tracked resource. + LastUpdateUtc *date.Time `json:"lastUpdateUtc,omitempty"` +} + +// PolicyTrackedResourcesQueryResults query results. +type PolicyTrackedResourcesQueryResults struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Query results. + Value *[]PolicyTrackedResource `json:"value,omitempty"` + // NextLink - READ-ONLY; The URL to get the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// PolicyTrackedResourcesQueryResultsIterator provides access to a complete listing of +// PolicyTrackedResource values. +type PolicyTrackedResourcesQueryResultsIterator struct { + i int + page PolicyTrackedResourcesQueryResultsPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *PolicyTrackedResourcesQueryResultsIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyTrackedResourcesQueryResultsIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *PolicyTrackedResourcesQueryResultsIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PolicyTrackedResourcesQueryResultsIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter PolicyTrackedResourcesQueryResultsIterator) Response() PolicyTrackedResourcesQueryResults { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter PolicyTrackedResourcesQueryResultsIterator) Value() PolicyTrackedResource { + if !iter.page.NotDone() { + return PolicyTrackedResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PolicyTrackedResourcesQueryResultsIterator type. +func NewPolicyTrackedResourcesQueryResultsIterator(page PolicyTrackedResourcesQueryResultsPage) PolicyTrackedResourcesQueryResultsIterator { + return PolicyTrackedResourcesQueryResultsIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ptrqr PolicyTrackedResourcesQueryResults) IsEmpty() bool { + return ptrqr.Value == nil || len(*ptrqr.Value) == 0 +} + +// policyTrackedResourcesQueryResultsPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ptrqr PolicyTrackedResourcesQueryResults) policyTrackedResourcesQueryResultsPreparer(ctx context.Context) (*http.Request, error) { + if ptrqr.NextLink == nil || len(to.String(ptrqr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ptrqr.NextLink))) +} + +// PolicyTrackedResourcesQueryResultsPage contains a page of PolicyTrackedResource values. +type PolicyTrackedResourcesQueryResultsPage struct { + fn func(context.Context, PolicyTrackedResourcesQueryResults) (PolicyTrackedResourcesQueryResults, error) + ptrqr PolicyTrackedResourcesQueryResults +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *PolicyTrackedResourcesQueryResultsPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyTrackedResourcesQueryResultsPage.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.ptrqr) + if err != nil { + return err + } + page.ptrqr = 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 *PolicyTrackedResourcesQueryResultsPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PolicyTrackedResourcesQueryResultsPage) NotDone() bool { + return !page.ptrqr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PolicyTrackedResourcesQueryResultsPage) Response() PolicyTrackedResourcesQueryResults { + return page.ptrqr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PolicyTrackedResourcesQueryResultsPage) Values() []PolicyTrackedResource { + if page.ptrqr.IsEmpty() { + return nil + } + return *page.ptrqr.Value +} + +// Creates a new instance of the PolicyTrackedResourcesQueryResultsPage type. +func NewPolicyTrackedResourcesQueryResultsPage(getNextPage func(context.Context, PolicyTrackedResourcesQueryResults) (PolicyTrackedResourcesQueryResults, error)) PolicyTrackedResourcesQueryResultsPage { + return PolicyTrackedResourcesQueryResultsPage{fn: getNextPage} +} + +// QueryFailure error response. +type QueryFailure struct { + // Error - Error definition. + Error *QueryFailureError `json:"error,omitempty"` +} + +// QueryFailureError error definition. +type QueryFailureError 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"` +} + +// Remediation the remediation definition. +type Remediation struct { + autorest.Response `json:"-"` + // RemediationProperties - Properties for the remediation. + *RemediationProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The ID of the remediation. + ID *string `json:"id,omitempty"` + // Type - READ-ONLY; The type of the remediation. + Type *string `json:"type,omitempty"` + // Name - READ-ONLY; The name of the remediation. + Name *string `json:"name,omitempty"` +} + +// MarshalJSON is the custom marshaler for Remediation. +func (r Remediation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.RemediationProperties != nil { + objectMap["properties"] = r.RemediationProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Remediation struct. +func (r *Remediation) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var remediationProperties RemediationProperties + err = json.Unmarshal(*v, &remediationProperties) + if err != nil { + return err + } + r.RemediationProperties = &remediationProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + r.ID = &ID + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + r.Type = &typeVar + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + r.Name = &name + } + } + } + + return nil +} + +// RemediationDeployment details of a single deployment created by the remediation. +type RemediationDeployment struct { + // RemediatedResourceID - READ-ONLY; Resource ID of the resource that is being remediated by the deployment. + RemediatedResourceID *string `json:"remediatedResourceId,omitempty"` + // DeploymentID - READ-ONLY; Resource ID of the template deployment that will remediate the resource. + DeploymentID *string `json:"deploymentId,omitempty"` + // Status - READ-ONLY; Status of the remediation deployment. + Status *string `json:"status,omitempty"` + // ResourceLocation - READ-ONLY; Location of the resource that is being remediated. + ResourceLocation *string `json:"resourceLocation,omitempty"` + // Error - READ-ONLY; Error encountered while remediated the resource. + Error *ErrorDefinition `json:"error,omitempty"` + // CreatedOn - READ-ONLY; The time at which the remediation was created. + CreatedOn *date.Time `json:"createdOn,omitempty"` + // LastUpdatedOn - READ-ONLY; The time at which the remediation deployment was last updated. + LastUpdatedOn *date.Time `json:"lastUpdatedOn,omitempty"` +} + +// RemediationDeploymentsListResult list of deployments for a remediation. +type RemediationDeploymentsListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Array of deployments for the remediation. + Value *[]RemediationDeployment `json:"value,omitempty"` + // NextLink - READ-ONLY; The URL to get the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// RemediationDeploymentsListResultIterator provides access to a complete listing of RemediationDeployment +// values. +type RemediationDeploymentsListResultIterator struct { + i int + page RemediationDeploymentsListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *RemediationDeploymentsListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemediationDeploymentsListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *RemediationDeploymentsListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RemediationDeploymentsListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter RemediationDeploymentsListResultIterator) Response() RemediationDeploymentsListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter RemediationDeploymentsListResultIterator) Value() RemediationDeployment { + if !iter.page.NotDone() { + return RemediationDeployment{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RemediationDeploymentsListResultIterator type. +func NewRemediationDeploymentsListResultIterator(page RemediationDeploymentsListResultPage) RemediationDeploymentsListResultIterator { + return RemediationDeploymentsListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rdlr RemediationDeploymentsListResult) IsEmpty() bool { + return rdlr.Value == nil || len(*rdlr.Value) == 0 +} + +// remediationDeploymentsListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rdlr RemediationDeploymentsListResult) remediationDeploymentsListResultPreparer(ctx context.Context) (*http.Request, error) { + if rdlr.NextLink == nil || len(to.String(rdlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rdlr.NextLink))) +} + +// RemediationDeploymentsListResultPage contains a page of RemediationDeployment values. +type RemediationDeploymentsListResultPage struct { + fn func(context.Context, RemediationDeploymentsListResult) (RemediationDeploymentsListResult, error) + rdlr RemediationDeploymentsListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *RemediationDeploymentsListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemediationDeploymentsListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.rdlr) + if err != nil { + return err + } + page.rdlr = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *RemediationDeploymentsListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RemediationDeploymentsListResultPage) NotDone() bool { + return !page.rdlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RemediationDeploymentsListResultPage) Response() RemediationDeploymentsListResult { + return page.rdlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RemediationDeploymentsListResultPage) Values() []RemediationDeployment { + if page.rdlr.IsEmpty() { + return nil + } + return *page.rdlr.Value +} + +// Creates a new instance of the RemediationDeploymentsListResultPage type. +func NewRemediationDeploymentsListResultPage(getNextPage func(context.Context, RemediationDeploymentsListResult) (RemediationDeploymentsListResult, error)) RemediationDeploymentsListResultPage { + return RemediationDeploymentsListResultPage{fn: getNextPage} +} + +// RemediationDeploymentSummary the deployment status summary for all deployments created by the +// remediation. +type RemediationDeploymentSummary struct { + // TotalDeployments - The number of deployments required by the remediation. + TotalDeployments *int32 `json:"totalDeployments,omitempty"` + // SuccessfulDeployments - The number of deployments required by the remediation that have succeeded. + SuccessfulDeployments *int32 `json:"successfulDeployments,omitempty"` + // FailedDeployments - The number of deployments required by the remediation that have failed. + FailedDeployments *int32 `json:"failedDeployments,omitempty"` +} + +// RemediationFilters the filters that will be applied to determine which resources to remediate. +type RemediationFilters struct { + // Locations - The resource locations that will be remediated. + Locations *[]string `json:"locations,omitempty"` +} + +// RemediationListResult list of remediations. +type RemediationListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Array of remediation definitions. + Value *[]Remediation `json:"value,omitempty"` + // NextLink - READ-ONLY; The URL to get the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// RemediationListResultIterator provides access to a complete listing of Remediation values. +type RemediationListResultIterator struct { + i int + page RemediationListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *RemediationListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemediationListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *RemediationListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RemediationListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter RemediationListResultIterator) Response() RemediationListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter RemediationListResultIterator) Value() Remediation { + if !iter.page.NotDone() { + return Remediation{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RemediationListResultIterator type. +func NewRemediationListResultIterator(page RemediationListResultPage) RemediationListResultIterator { + return RemediationListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rlr RemediationListResult) IsEmpty() bool { + return rlr.Value == nil || len(*rlr.Value) == 0 +} + +// remediationListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rlr RemediationListResult) remediationListResultPreparer(ctx context.Context) (*http.Request, error) { + if rlr.NextLink == nil || len(to.String(rlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rlr.NextLink))) +} + +// RemediationListResultPage contains a page of Remediation values. +type RemediationListResultPage struct { + fn func(context.Context, RemediationListResult) (RemediationListResult, error) + rlr RemediationListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *RemediationListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemediationListResultPage.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.rlr) + if err != nil { + return err + } + page.rlr = 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 *RemediationListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RemediationListResultPage) NotDone() bool { + return !page.rlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RemediationListResultPage) Response() RemediationListResult { + return page.rlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RemediationListResultPage) Values() []Remediation { + if page.rlr.IsEmpty() { + return nil + } + return *page.rlr.Value +} + +// Creates a new instance of the RemediationListResultPage type. +func NewRemediationListResultPage(getNextPage func(context.Context, RemediationListResult) (RemediationListResult, error)) RemediationListResultPage { + return RemediationListResultPage{fn: getNextPage} +} + +// RemediationProperties the remediation properties. +type RemediationProperties struct { + // PolicyAssignmentID - The resource ID of the policy assignment that should be remediated. + PolicyAssignmentID *string `json:"policyAssignmentId,omitempty"` + // PolicyDefinitionReferenceID - The policy definition reference ID of the individual definition that should be remediated. Required when the policy assignment being remediated assigns a policy set definition. + PolicyDefinitionReferenceID *string `json:"policyDefinitionReferenceId,omitempty"` + // ProvisioningState - READ-ONLY; The status of the remediation. + ProvisioningState *string `json:"provisioningState,omitempty"` + // CreatedOn - READ-ONLY; The time at which the remediation was created. + CreatedOn *date.Time `json:"createdOn,omitempty"` + // LastUpdatedOn - READ-ONLY; The time at which the remediation was last updated. + LastUpdatedOn *date.Time `json:"lastUpdatedOn,omitempty"` + // Filters - The filters that will be applied to determine which resources to remediate. + Filters *RemediationFilters `json:"filters,omitempty"` + // DeploymentStatus - The deployment status summary for all deployments created by the remediation. + DeploymentStatus *RemediationDeploymentSummary `json:"deploymentStatus,omitempty"` +} + +// String ... +type String struct { + autorest.Response `json:"-"` + Value *string `json:"value,omitempty"` +} + +// SummarizeResults summarize action results. +type SummarizeResults struct { + autorest.Response `json:"-"` + // OdataContext - OData context string; used by OData clients to resolve type information based on metadata. + OdataContext *string `json:"@odata.context,omitempty"` + // OdataCount - OData entity count; represents the number of summaries returned; always set to 1. + OdataCount *int32 `json:"@odata.count,omitempty"` + // Value - Summarize action results. + Value *[]Summary `json:"value,omitempty"` +} + +// Summary summary results. +type Summary struct { + // OdataID - OData entity ID; always set to null since summaries do not have an entity ID. + OdataID *string `json:"@odata.id,omitempty"` + // OdataContext - OData context string; used by OData clients to resolve type information based on metadata. + OdataContext *string `json:"@odata.context,omitempty"` + // Results - Compliance summary for all policy assignments. + Results *SummaryResults `json:"results,omitempty"` + // PolicyAssignments - Policy assignments summary. + PolicyAssignments *[]PolicyAssignmentSummary `json:"policyAssignments,omitempty"` +} + +// SummaryResults compliance summary on a particular summary level. +type SummaryResults struct { + // QueryResultsURI - HTTP POST URI for queryResults action on Microsoft.PolicyInsights to retrieve raw results for the compliance summary. This property will not be available by default in future API versions, but could be queried explicitly. + QueryResultsURI *string `json:"queryResultsUri,omitempty"` + // NonCompliantResources - Number of non-compliant resources. + NonCompliantResources *int32 `json:"nonCompliantResources,omitempty"` + // NonCompliantPolicies - Number of non-compliant policies. + NonCompliantPolicies *int32 `json:"nonCompliantPolicies,omitempty"` + // ResourceDetails - The resources summary at this level. + ResourceDetails *[]ComplianceDetail `json:"resourceDetails,omitempty"` + // PolicyDetails - The policy artifact summary at this level. For query scope level, it represents policy assignment summary. For policy assignment level, it represents policy definitions summary. + PolicyDetails *[]ComplianceDetail `json:"policyDetails,omitempty"` + // PolicyGroupDetails - The policy definition group summary at this level. + PolicyGroupDetails *[]ComplianceDetail `json:"policyGroupDetails,omitempty"` +} + +// TrackedResourceModificationDetails the details of the policy triggered deployment that created or +// modified the tracked resource. +type TrackedResourceModificationDetails struct { + // PolicyDetails - READ-ONLY; The details of the policy that created or modified the tracked resource. + PolicyDetails *PolicyDetails `json:"policyDetails,omitempty"` + // DeploymentID - READ-ONLY; The ID of the deployment that created or modified the tracked resource. + DeploymentID *string `json:"deploymentId,omitempty"` + // DeploymentTime - READ-ONLY; Timestamp of the deployment that created or modified the tracked resource. + DeploymentTime *date.Time `json:"deploymentTime,omitempty"` +} + +// TypedErrorInfo scenario specific error details. +type TypedErrorInfo struct { + // Type - READ-ONLY; The type of included error details. + Type *string `json:"type,omitempty"` + // Info - READ-ONLY; The scenario specific error details. + Info interface{} `json:"info,omitempty"` +} diff --git a/services/policyinsights/mgmt/2019-10-01/policyinsights/operations.go b/services/policyinsights/mgmt/2019-10-01/policyinsights/operations.go new file mode 100644 index 000000000000..3b7784383db2 --- /dev/null +++ b/services/policyinsights/mgmt/2019-10-01/policyinsights/operations.go @@ -0,0 +1,109 @@ +package policyinsights + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if 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 Policyinsights service. +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 available operations. +func (client OperationsClient) List(ctx context.Context) (result OperationsListResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.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, "policyinsights.OperationsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.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-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.PolicyInsights/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 OperationsListResults, 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/policyinsights/mgmt/2019-10-01/policyinsights/policyevents.go b/services/policyinsights/mgmt/2019-10-01/policyinsights/policyevents.go new file mode 100644 index 000000000000..d4c4421f66e2 --- /dev/null +++ b/services/policyinsights/mgmt/2019-10-01/policyinsights/policyevents.go @@ -0,0 +1,1049 @@ +package policyinsights + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// PolicyEventsClient is the client for the PolicyEvents methods of the Policyinsights service. +type PolicyEventsClient struct { + BaseClient +} + +// NewPolicyEventsClient creates an instance of the PolicyEventsClient client. +func NewPolicyEventsClient() PolicyEventsClient { + return NewPolicyEventsClientWithBaseURI(DefaultBaseURI) +} + +// NewPolicyEventsClientWithBaseURI creates an instance of the PolicyEventsClient client. +func NewPolicyEventsClientWithBaseURI(baseURI string) PolicyEventsClient { + return PolicyEventsClient{NewWithBaseURI(baseURI)} +} + +// GetMetadata gets OData metadata XML document. +// Parameters: +// scope - a valid scope, i.e. management group, subscription, resource group, or resource ID. Scope used has +// no effect on metadata returned. +func (client PolicyEventsClient) GetMetadata(ctx context.Context, scope string) (result String, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsClient.GetMetadata") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetMetadataPreparer(ctx, scope) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "GetMetadata", nil, "Failure preparing request") + return + } + + resp, err := client.GetMetadataSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "GetMetadata", resp, "Failure sending request") + return + } + + result, err = client.GetMetadataResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "GetMetadata", resp, "Failure responding to request") + } + + return +} + +// GetMetadataPreparer prepares the GetMetadata request. +func (client PolicyEventsClient) GetMetadataPreparer(ctx context.Context, scope string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "scope": scope, + } + + const APIVersion = "2018-04-04" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{scope}/providers/Microsoft.PolicyInsights/policyEvents/$metadata", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetMetadataSender sends the GetMetadata request. The method will close the +// http.Response Body if it receives an error. +func (client PolicyEventsClient) GetMetadataSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetMetadataResponder handles the response to the GetMetadata request. The method always +// closes the http.Response Body. +func (client PolicyEventsClient) GetMetadataResponder(resp *http.Response) (result String, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListQueryResultsForManagementGroup queries policy events for the resources under the management group. +// Parameters: +// managementGroupName - management group name. +// top - maximum number of records to return. +// orderBy - ordering expression using OData notation. One or more comma-separated column names with an +// optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, ResourceId asc". +// selectParameter - select expression using OData notation. Limits the columns on each record to just those +// requested, e.g. "$select=PolicyAssignmentId, ResourceId". +// from - ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, +// the service uses ($to - 1-day). +// toParameter - ISO 8601 formatted timestamp specifying the end time of the interval to query. When not +// specified, the service uses request time. +// filter - oData filter expression. +// apply - oData apply expression for aggregations. +func (client PolicyEventsClient) ListQueryResultsForManagementGroup(ctx context.Context, managementGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result PolicyEventsQueryResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsClient.ListQueryResultsForManagementGroup") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("policyinsights.PolicyEventsClient", "ListQueryResultsForManagementGroup", err.Error()) + } + + req, err := client.ListQueryResultsForManagementGroupPreparer(ctx, managementGroupName, top, orderBy, selectParameter, from, toParameter, filter, apply) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForManagementGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListQueryResultsForManagementGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForManagementGroup", resp, "Failure sending request") + return + } + + result, err = client.ListQueryResultsForManagementGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForManagementGroup", resp, "Failure responding to request") + } + + return +} + +// ListQueryResultsForManagementGroupPreparer prepares the ListQueryResultsForManagementGroup request. +func (client PolicyEventsClient) ListQueryResultsForManagementGroupPreparer(ctx context.Context, managementGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "managementGroupName": autorest.Encode("path", managementGroupName), + "managementGroupsNamespace": autorest.Encode("path", "Microsoft.Management"), + "policyEventsResource": autorest.Encode("path", "default"), + } + + const APIVersion = "2018-04-04" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(orderBy) > 0 { + queryParameters["$orderby"] = autorest.Encode("query", orderBy) + } + if len(selectParameter) > 0 { + queryParameters["$select"] = autorest.Encode("query", selectParameter) + } + if from != nil { + queryParameters["$from"] = autorest.Encode("query", *from) + } + if toParameter != nil { + queryParameters["$to"] = autorest.Encode("query", *toParameter) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(apply) > 0 { + queryParameters["$apply"] = autorest.Encode("query", apply) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/{managementGroupsNamespace}/managementGroups/{managementGroupName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListQueryResultsForManagementGroupSender sends the ListQueryResultsForManagementGroup request. The method will close the +// http.Response Body if it receives an error. +func (client PolicyEventsClient) ListQueryResultsForManagementGroupSender(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...) +} + +// ListQueryResultsForManagementGroupResponder handles the response to the ListQueryResultsForManagementGroup request. The method always +// closes the http.Response Body. +func (client PolicyEventsClient) ListQueryResultsForManagementGroupResponder(resp *http.Response) (result PolicyEventsQueryResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListQueryResultsForPolicyDefinition queries policy events for the subscription level policy definition. +// Parameters: +// subscriptionID - microsoft Azure subscription ID. +// policyDefinitionName - policy definition name. +// top - maximum number of records to return. +// orderBy - ordering expression using OData notation. One or more comma-separated column names with an +// optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, ResourceId asc". +// selectParameter - select expression using OData notation. Limits the columns on each record to just those +// requested, e.g. "$select=PolicyAssignmentId, ResourceId". +// from - ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, +// the service uses ($to - 1-day). +// toParameter - ISO 8601 formatted timestamp specifying the end time of the interval to query. When not +// specified, the service uses request time. +// filter - oData filter expression. +// apply - oData apply expression for aggregations. +func (client PolicyEventsClient) ListQueryResultsForPolicyDefinition(ctx context.Context, subscriptionID string, policyDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result PolicyEventsQueryResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsClient.ListQueryResultsForPolicyDefinition") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("policyinsights.PolicyEventsClient", "ListQueryResultsForPolicyDefinition", err.Error()) + } + + req, err := client.ListQueryResultsForPolicyDefinitionPreparer(ctx, subscriptionID, policyDefinitionName, top, orderBy, selectParameter, from, toParameter, filter, apply) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForPolicyDefinition", nil, "Failure preparing request") + return + } + + resp, err := client.ListQueryResultsForPolicyDefinitionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForPolicyDefinition", resp, "Failure sending request") + return + } + + result, err = client.ListQueryResultsForPolicyDefinitionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForPolicyDefinition", resp, "Failure responding to request") + } + + return +} + +// ListQueryResultsForPolicyDefinitionPreparer prepares the ListQueryResultsForPolicyDefinition request. +func (client PolicyEventsClient) ListQueryResultsForPolicyDefinitionPreparer(ctx context.Context, subscriptionID string, policyDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "authorizationNamespace": autorest.Encode("path", "Microsoft.Authorization"), + "policyDefinitionName": autorest.Encode("path", policyDefinitionName), + "policyEventsResource": autorest.Encode("path", "default"), + "subscriptionId": autorest.Encode("path", subscriptionID), + } + + const APIVersion = "2018-04-04" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(orderBy) > 0 { + queryParameters["$orderby"] = autorest.Encode("query", orderBy) + } + if len(selectParameter) > 0 { + queryParameters["$select"] = autorest.Encode("query", selectParameter) + } + if from != nil { + queryParameters["$from"] = autorest.Encode("query", *from) + } + if toParameter != nil { + queryParameters["$to"] = autorest.Encode("query", *toParameter) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(apply) > 0 { + queryParameters["$apply"] = autorest.Encode("query", apply) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyDefinitions/{policyDefinitionName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListQueryResultsForPolicyDefinitionSender sends the ListQueryResultsForPolicyDefinition request. The method will close the +// http.Response Body if it receives an error. +func (client PolicyEventsClient) ListQueryResultsForPolicyDefinitionSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListQueryResultsForPolicyDefinitionResponder handles the response to the ListQueryResultsForPolicyDefinition request. The method always +// closes the http.Response Body. +func (client PolicyEventsClient) ListQueryResultsForPolicyDefinitionResponder(resp *http.Response) (result PolicyEventsQueryResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListQueryResultsForPolicySetDefinition queries policy events for the subscription level policy set definition. +// Parameters: +// subscriptionID - microsoft Azure subscription ID. +// policySetDefinitionName - policy set definition name. +// top - maximum number of records to return. +// orderBy - ordering expression using OData notation. One or more comma-separated column names with an +// optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, ResourceId asc". +// selectParameter - select expression using OData notation. Limits the columns on each record to just those +// requested, e.g. "$select=PolicyAssignmentId, ResourceId". +// from - ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, +// the service uses ($to - 1-day). +// toParameter - ISO 8601 formatted timestamp specifying the end time of the interval to query. When not +// specified, the service uses request time. +// filter - oData filter expression. +// apply - oData apply expression for aggregations. +func (client PolicyEventsClient) ListQueryResultsForPolicySetDefinition(ctx context.Context, subscriptionID string, policySetDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result PolicyEventsQueryResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsClient.ListQueryResultsForPolicySetDefinition") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("policyinsights.PolicyEventsClient", "ListQueryResultsForPolicySetDefinition", err.Error()) + } + + req, err := client.ListQueryResultsForPolicySetDefinitionPreparer(ctx, subscriptionID, policySetDefinitionName, top, orderBy, selectParameter, from, toParameter, filter, apply) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForPolicySetDefinition", nil, "Failure preparing request") + return + } + + resp, err := client.ListQueryResultsForPolicySetDefinitionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForPolicySetDefinition", resp, "Failure sending request") + return + } + + result, err = client.ListQueryResultsForPolicySetDefinitionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForPolicySetDefinition", resp, "Failure responding to request") + } + + return +} + +// ListQueryResultsForPolicySetDefinitionPreparer prepares the ListQueryResultsForPolicySetDefinition request. +func (client PolicyEventsClient) ListQueryResultsForPolicySetDefinitionPreparer(ctx context.Context, subscriptionID string, policySetDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "authorizationNamespace": autorest.Encode("path", "Microsoft.Authorization"), + "policyEventsResource": autorest.Encode("path", "default"), + "policySetDefinitionName": autorest.Encode("path", policySetDefinitionName), + "subscriptionId": autorest.Encode("path", subscriptionID), + } + + const APIVersion = "2018-04-04" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(orderBy) > 0 { + queryParameters["$orderby"] = autorest.Encode("query", orderBy) + } + if len(selectParameter) > 0 { + queryParameters["$select"] = autorest.Encode("query", selectParameter) + } + if from != nil { + queryParameters["$from"] = autorest.Encode("query", *from) + } + if toParameter != nil { + queryParameters["$to"] = autorest.Encode("query", *toParameter) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(apply) > 0 { + queryParameters["$apply"] = autorest.Encode("query", apply) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policySetDefinitions/{policySetDefinitionName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListQueryResultsForPolicySetDefinitionSender sends the ListQueryResultsForPolicySetDefinition request. The method will close the +// http.Response Body if it receives an error. +func (client PolicyEventsClient) ListQueryResultsForPolicySetDefinitionSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListQueryResultsForPolicySetDefinitionResponder handles the response to the ListQueryResultsForPolicySetDefinition request. The method always +// closes the http.Response Body. +func (client PolicyEventsClient) ListQueryResultsForPolicySetDefinitionResponder(resp *http.Response) (result PolicyEventsQueryResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListQueryResultsForResource queries policy events for the resource. +// Parameters: +// resourceID - resource ID. +// top - maximum number of records to return. +// orderBy - ordering expression using OData notation. One or more comma-separated column names with an +// optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, ResourceId asc". +// selectParameter - select expression using OData notation. Limits the columns on each record to just those +// requested, e.g. "$select=PolicyAssignmentId, ResourceId". +// from - ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, +// the service uses ($to - 1-day). +// toParameter - ISO 8601 formatted timestamp specifying the end time of the interval to query. When not +// specified, the service uses request time. +// filter - oData filter expression. +// apply - oData apply expression for aggregations. +func (client PolicyEventsClient) ListQueryResultsForResource(ctx context.Context, resourceID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result PolicyEventsQueryResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsClient.ListQueryResultsForResource") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("policyinsights.PolicyEventsClient", "ListQueryResultsForResource", err.Error()) + } + + req, err := client.ListQueryResultsForResourcePreparer(ctx, resourceID, top, orderBy, selectParameter, from, toParameter, filter, apply) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForResource", nil, "Failure preparing request") + return + } + + resp, err := client.ListQueryResultsForResourceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForResource", resp, "Failure sending request") + return + } + + result, err = client.ListQueryResultsForResourceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForResource", resp, "Failure responding to request") + } + + return +} + +// ListQueryResultsForResourcePreparer prepares the ListQueryResultsForResource request. +func (client PolicyEventsClient) ListQueryResultsForResourcePreparer(ctx context.Context, resourceID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyEventsResource": autorest.Encode("path", "default"), + "resourceId": resourceID, + } + + const APIVersion = "2018-04-04" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(orderBy) > 0 { + queryParameters["$orderby"] = autorest.Encode("query", orderBy) + } + if len(selectParameter) > 0 { + queryParameters["$select"] = autorest.Encode("query", selectParameter) + } + if from != nil { + queryParameters["$from"] = autorest.Encode("query", *from) + } + if toParameter != nil { + queryParameters["$to"] = autorest.Encode("query", *toParameter) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(apply) > 0 { + queryParameters["$apply"] = autorest.Encode("query", apply) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{resourceId}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListQueryResultsForResourceSender sends the ListQueryResultsForResource request. The method will close the +// http.Response Body if it receives an error. +func (client PolicyEventsClient) ListQueryResultsForResourceSender(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...) +} + +// ListQueryResultsForResourceResponder handles the response to the ListQueryResultsForResource request. The method always +// closes the http.Response Body. +func (client PolicyEventsClient) ListQueryResultsForResourceResponder(resp *http.Response) (result PolicyEventsQueryResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListQueryResultsForResourceGroup queries policy events for the resources under the resource group. +// Parameters: +// subscriptionID - microsoft Azure subscription ID. +// resourceGroupName - resource group name. +// top - maximum number of records to return. +// orderBy - ordering expression using OData notation. One or more comma-separated column names with an +// optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, ResourceId asc". +// selectParameter - select expression using OData notation. Limits the columns on each record to just those +// requested, e.g. "$select=PolicyAssignmentId, ResourceId". +// from - ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, +// the service uses ($to - 1-day). +// toParameter - ISO 8601 formatted timestamp specifying the end time of the interval to query. When not +// specified, the service uses request time. +// filter - oData filter expression. +// apply - oData apply expression for aggregations. +func (client PolicyEventsClient) ListQueryResultsForResourceGroup(ctx context.Context, subscriptionID string, resourceGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result PolicyEventsQueryResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsClient.ListQueryResultsForResourceGroup") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("policyinsights.PolicyEventsClient", "ListQueryResultsForResourceGroup", err.Error()) + } + + req, err := client.ListQueryResultsForResourceGroupPreparer(ctx, subscriptionID, resourceGroupName, top, orderBy, selectParameter, from, toParameter, filter, apply) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListQueryResultsForResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForResourceGroup", resp, "Failure sending request") + return + } + + result, err = client.ListQueryResultsForResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListQueryResultsForResourceGroupPreparer prepares the ListQueryResultsForResourceGroup request. +func (client PolicyEventsClient) ListQueryResultsForResourceGroupPreparer(ctx context.Context, subscriptionID string, resourceGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyEventsResource": autorest.Encode("path", "default"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", subscriptionID), + } + + const APIVersion = "2018-04-04" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(orderBy) > 0 { + queryParameters["$orderby"] = autorest.Encode("query", orderBy) + } + if len(selectParameter) > 0 { + queryParameters["$select"] = autorest.Encode("query", selectParameter) + } + if from != nil { + queryParameters["$from"] = autorest.Encode("query", *from) + } + if toParameter != nil { + queryParameters["$to"] = autorest.Encode("query", *toParameter) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(apply) > 0 { + queryParameters["$apply"] = autorest.Encode("query", apply) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListQueryResultsForResourceGroupSender sends the ListQueryResultsForResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client PolicyEventsClient) ListQueryResultsForResourceGroupSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListQueryResultsForResourceGroupResponder handles the response to the ListQueryResultsForResourceGroup request. The method always +// closes the http.Response Body. +func (client PolicyEventsClient) ListQueryResultsForResourceGroupResponder(resp *http.Response) (result PolicyEventsQueryResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListQueryResultsForResourceGroupLevelPolicyAssignment queries policy events for the resource group level policy +// assignment. +// Parameters: +// subscriptionID - microsoft Azure subscription ID. +// resourceGroupName - resource group name. +// policyAssignmentName - policy assignment name. +// top - maximum number of records to return. +// orderBy - ordering expression using OData notation. One or more comma-separated column names with an +// optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, ResourceId asc". +// selectParameter - select expression using OData notation. Limits the columns on each record to just those +// requested, e.g. "$select=PolicyAssignmentId, ResourceId". +// from - ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, +// the service uses ($to - 1-day). +// toParameter - ISO 8601 formatted timestamp specifying the end time of the interval to query. When not +// specified, the service uses request time. +// filter - oData filter expression. +// apply - oData apply expression for aggregations. +func (client PolicyEventsClient) ListQueryResultsForResourceGroupLevelPolicyAssignment(ctx context.Context, subscriptionID string, resourceGroupName string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result PolicyEventsQueryResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsClient.ListQueryResultsForResourceGroupLevelPolicyAssignment") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("policyinsights.PolicyEventsClient", "ListQueryResultsForResourceGroupLevelPolicyAssignment", err.Error()) + } + + req, err := client.ListQueryResultsForResourceGroupLevelPolicyAssignmentPreparer(ctx, subscriptionID, resourceGroupName, policyAssignmentName, top, orderBy, selectParameter, from, toParameter, filter, apply) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForResourceGroupLevelPolicyAssignment", nil, "Failure preparing request") + return + } + + resp, err := client.ListQueryResultsForResourceGroupLevelPolicyAssignmentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForResourceGroupLevelPolicyAssignment", resp, "Failure sending request") + return + } + + result, err = client.ListQueryResultsForResourceGroupLevelPolicyAssignmentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForResourceGroupLevelPolicyAssignment", resp, "Failure responding to request") + } + + return +} + +// ListQueryResultsForResourceGroupLevelPolicyAssignmentPreparer prepares the ListQueryResultsForResourceGroupLevelPolicyAssignment request. +func (client PolicyEventsClient) ListQueryResultsForResourceGroupLevelPolicyAssignmentPreparer(ctx context.Context, subscriptionID string, resourceGroupName string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "authorizationNamespace": autorest.Encode("path", "Microsoft.Authorization"), + "policyAssignmentName": autorest.Encode("path", policyAssignmentName), + "policyEventsResource": autorest.Encode("path", "default"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", subscriptionID), + } + + const APIVersion = "2018-04-04" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(orderBy) > 0 { + queryParameters["$orderby"] = autorest.Encode("query", orderBy) + } + if len(selectParameter) > 0 { + queryParameters["$select"] = autorest.Encode("query", selectParameter) + } + if from != nil { + queryParameters["$from"] = autorest.Encode("query", *from) + } + if toParameter != nil { + queryParameters["$to"] = autorest.Encode("query", *toParameter) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(apply) > 0 { + queryParameters["$apply"] = autorest.Encode("query", apply) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListQueryResultsForResourceGroupLevelPolicyAssignmentSender sends the ListQueryResultsForResourceGroupLevelPolicyAssignment request. The method will close the +// http.Response Body if it receives an error. +func (client PolicyEventsClient) ListQueryResultsForResourceGroupLevelPolicyAssignmentSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListQueryResultsForResourceGroupLevelPolicyAssignmentResponder handles the response to the ListQueryResultsForResourceGroupLevelPolicyAssignment request. The method always +// closes the http.Response Body. +func (client PolicyEventsClient) ListQueryResultsForResourceGroupLevelPolicyAssignmentResponder(resp *http.Response) (result PolicyEventsQueryResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListQueryResultsForSubscription queries policy events for the resources under the subscription. +// Parameters: +// subscriptionID - microsoft Azure subscription ID. +// top - maximum number of records to return. +// orderBy - ordering expression using OData notation. One or more comma-separated column names with an +// optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, ResourceId asc". +// selectParameter - select expression using OData notation. Limits the columns on each record to just those +// requested, e.g. "$select=PolicyAssignmentId, ResourceId". +// from - ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, +// the service uses ($to - 1-day). +// toParameter - ISO 8601 formatted timestamp specifying the end time of the interval to query. When not +// specified, the service uses request time. +// filter - oData filter expression. +// apply - oData apply expression for aggregations. +func (client PolicyEventsClient) ListQueryResultsForSubscription(ctx context.Context, subscriptionID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result PolicyEventsQueryResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsClient.ListQueryResultsForSubscription") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("policyinsights.PolicyEventsClient", "ListQueryResultsForSubscription", err.Error()) + } + + req, err := client.ListQueryResultsForSubscriptionPreparer(ctx, subscriptionID, top, orderBy, selectParameter, from, toParameter, filter, apply) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForSubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListQueryResultsForSubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForSubscription", resp, "Failure sending request") + return + } + + result, err = client.ListQueryResultsForSubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForSubscription", resp, "Failure responding to request") + } + + return +} + +// ListQueryResultsForSubscriptionPreparer prepares the ListQueryResultsForSubscription request. +func (client PolicyEventsClient) ListQueryResultsForSubscriptionPreparer(ctx context.Context, subscriptionID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyEventsResource": autorest.Encode("path", "default"), + "subscriptionId": autorest.Encode("path", subscriptionID), + } + + const APIVersion = "2018-04-04" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(orderBy) > 0 { + queryParameters["$orderby"] = autorest.Encode("query", orderBy) + } + if len(selectParameter) > 0 { + queryParameters["$select"] = autorest.Encode("query", selectParameter) + } + if from != nil { + queryParameters["$from"] = autorest.Encode("query", *from) + } + if toParameter != nil { + queryParameters["$to"] = autorest.Encode("query", *toParameter) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(apply) > 0 { + queryParameters["$apply"] = autorest.Encode("query", apply) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListQueryResultsForSubscriptionSender sends the ListQueryResultsForSubscription request. The method will close the +// http.Response Body if it receives an error. +func (client PolicyEventsClient) ListQueryResultsForSubscriptionSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListQueryResultsForSubscriptionResponder handles the response to the ListQueryResultsForSubscription request. The method always +// closes the http.Response Body. +func (client PolicyEventsClient) ListQueryResultsForSubscriptionResponder(resp *http.Response) (result PolicyEventsQueryResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListQueryResultsForSubscriptionLevelPolicyAssignment queries policy events for the subscription level policy +// assignment. +// Parameters: +// subscriptionID - microsoft Azure subscription ID. +// policyAssignmentName - policy assignment name. +// top - maximum number of records to return. +// orderBy - ordering expression using OData notation. One or more comma-separated column names with an +// optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, ResourceId asc". +// selectParameter - select expression using OData notation. Limits the columns on each record to just those +// requested, e.g. "$select=PolicyAssignmentId, ResourceId". +// from - ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, +// the service uses ($to - 1-day). +// toParameter - ISO 8601 formatted timestamp specifying the end time of the interval to query. When not +// specified, the service uses request time. +// filter - oData filter expression. +// apply - oData apply expression for aggregations. +func (client PolicyEventsClient) ListQueryResultsForSubscriptionLevelPolicyAssignment(ctx context.Context, subscriptionID string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result PolicyEventsQueryResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsClient.ListQueryResultsForSubscriptionLevelPolicyAssignment") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("policyinsights.PolicyEventsClient", "ListQueryResultsForSubscriptionLevelPolicyAssignment", err.Error()) + } + + req, err := client.ListQueryResultsForSubscriptionLevelPolicyAssignmentPreparer(ctx, subscriptionID, policyAssignmentName, top, orderBy, selectParameter, from, toParameter, filter, apply) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForSubscriptionLevelPolicyAssignment", nil, "Failure preparing request") + return + } + + resp, err := client.ListQueryResultsForSubscriptionLevelPolicyAssignmentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForSubscriptionLevelPolicyAssignment", resp, "Failure sending request") + return + } + + result, err = client.ListQueryResultsForSubscriptionLevelPolicyAssignmentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForSubscriptionLevelPolicyAssignment", resp, "Failure responding to request") + } + + return +} + +// ListQueryResultsForSubscriptionLevelPolicyAssignmentPreparer prepares the ListQueryResultsForSubscriptionLevelPolicyAssignment request. +func (client PolicyEventsClient) ListQueryResultsForSubscriptionLevelPolicyAssignmentPreparer(ctx context.Context, subscriptionID string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "authorizationNamespace": autorest.Encode("path", "Microsoft.Authorization"), + "policyAssignmentName": autorest.Encode("path", policyAssignmentName), + "policyEventsResource": autorest.Encode("path", "default"), + "subscriptionId": autorest.Encode("path", subscriptionID), + } + + const APIVersion = "2018-04-04" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(orderBy) > 0 { + queryParameters["$orderby"] = autorest.Encode("query", orderBy) + } + if len(selectParameter) > 0 { + queryParameters["$select"] = autorest.Encode("query", selectParameter) + } + if from != nil { + queryParameters["$from"] = autorest.Encode("query", *from) + } + if toParameter != nil { + queryParameters["$to"] = autorest.Encode("query", *toParameter) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(apply) > 0 { + queryParameters["$apply"] = autorest.Encode("query", apply) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListQueryResultsForSubscriptionLevelPolicyAssignmentSender sends the ListQueryResultsForSubscriptionLevelPolicyAssignment request. The method will close the +// http.Response Body if it receives an error. +func (client PolicyEventsClient) ListQueryResultsForSubscriptionLevelPolicyAssignmentSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListQueryResultsForSubscriptionLevelPolicyAssignmentResponder handles the response to the ListQueryResultsForSubscriptionLevelPolicyAssignment request. The method always +// closes the http.Response Body. +func (client PolicyEventsClient) ListQueryResultsForSubscriptionLevelPolicyAssignmentResponder(resp *http.Response) (result PolicyEventsQueryResults, 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/policyinsights/mgmt/2019-10-01/policyinsights/policyinsightsapi/interfaces.go b/services/policyinsights/mgmt/2019-10-01/policyinsights/policyinsightsapi/interfaces.go new file mode 100644 index 000000000000..aeb5b3244156 --- /dev/null +++ b/services/policyinsights/mgmt/2019-10-01/policyinsights/policyinsightsapi/interfaces.go @@ -0,0 +1,108 @@ +package policyinsightsapi + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by 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/policyinsights/mgmt/2019-10-01/policyinsights" + "github.com/Azure/go-autorest/autorest/date" +) + +// PolicyTrackedResourcesClientAPI contains the set of methods on the PolicyTrackedResourcesClient type. +type PolicyTrackedResourcesClientAPI interface { + ListQueryResultsForManagementGroup(ctx context.Context, managementGroupName string, top *int32, filter string) (result policyinsights.PolicyTrackedResourcesQueryResultsPage, err error) + ListQueryResultsForResource(ctx context.Context, resourceID string, top *int32, filter string) (result policyinsights.PolicyTrackedResourcesQueryResultsPage, err error) + ListQueryResultsForResourceGroup(ctx context.Context, resourceGroupName string, subscriptionID string, top *int32, filter string) (result policyinsights.PolicyTrackedResourcesQueryResultsPage, err error) + ListQueryResultsForSubscription(ctx context.Context, subscriptionID string, top *int32, filter string) (result policyinsights.PolicyTrackedResourcesQueryResultsPage, err error) +} + +var _ PolicyTrackedResourcesClientAPI = (*policyinsights.PolicyTrackedResourcesClient)(nil) + +// RemediationsClientAPI contains the set of methods on the RemediationsClient type. +type RemediationsClientAPI interface { + CancelAtManagementGroup(ctx context.Context, managementGroupID string, remediationName string) (result policyinsights.Remediation, err error) + CancelAtResource(ctx context.Context, resourceID string, remediationName string) (result policyinsights.Remediation, err error) + CancelAtResourceGroup(ctx context.Context, subscriptionID string, resourceGroupName string, remediationName string) (result policyinsights.Remediation, err error) + CancelAtSubscription(ctx context.Context, subscriptionID string, remediationName string) (result policyinsights.Remediation, err error) + CreateOrUpdateAtManagementGroup(ctx context.Context, managementGroupID string, remediationName string, parameters policyinsights.Remediation) (result policyinsights.Remediation, err error) + CreateOrUpdateAtResource(ctx context.Context, resourceID string, remediationName string, parameters policyinsights.Remediation) (result policyinsights.Remediation, err error) + CreateOrUpdateAtResourceGroup(ctx context.Context, subscriptionID string, resourceGroupName string, remediationName string, parameters policyinsights.Remediation) (result policyinsights.Remediation, err error) + CreateOrUpdateAtSubscription(ctx context.Context, subscriptionID string, remediationName string, parameters policyinsights.Remediation) (result policyinsights.Remediation, err error) + DeleteAtManagementGroup(ctx context.Context, managementGroupID string, remediationName string) (result policyinsights.Remediation, err error) + DeleteAtResource(ctx context.Context, resourceID string, remediationName string) (result policyinsights.Remediation, err error) + DeleteAtResourceGroup(ctx context.Context, subscriptionID string, resourceGroupName string, remediationName string) (result policyinsights.Remediation, err error) + DeleteAtSubscription(ctx context.Context, subscriptionID string, remediationName string) (result policyinsights.Remediation, err error) + GetAtManagementGroup(ctx context.Context, managementGroupID string, remediationName string) (result policyinsights.Remediation, err error) + GetAtResource(ctx context.Context, resourceID string, remediationName string) (result policyinsights.Remediation, err error) + GetAtResourceGroup(ctx context.Context, subscriptionID string, resourceGroupName string, remediationName string) (result policyinsights.Remediation, err error) + GetAtSubscription(ctx context.Context, subscriptionID string, remediationName string) (result policyinsights.Remediation, err error) + ListDeploymentsAtManagementGroup(ctx context.Context, managementGroupID string, remediationName string, top *int32) (result policyinsights.RemediationDeploymentsListResultPage, err error) + ListDeploymentsAtResource(ctx context.Context, resourceID string, remediationName string, top *int32) (result policyinsights.RemediationDeploymentsListResultPage, err error) + ListDeploymentsAtResourceGroup(ctx context.Context, subscriptionID string, resourceGroupName string, remediationName string, top *int32) (result policyinsights.RemediationDeploymentsListResultPage, err error) + ListDeploymentsAtSubscription(ctx context.Context, subscriptionID string, remediationName string, top *int32) (result policyinsights.RemediationDeploymentsListResultPage, err error) + ListForManagementGroup(ctx context.Context, managementGroupID string, top *int32, filter string) (result policyinsights.RemediationListResultPage, err error) + ListForResource(ctx context.Context, resourceID string, top *int32, filter string) (result policyinsights.RemediationListResultPage, err error) + ListForResourceGroup(ctx context.Context, subscriptionID string, resourceGroupName string, top *int32, filter string) (result policyinsights.RemediationListResultPage, err error) + ListForSubscription(ctx context.Context, subscriptionID string, top *int32, filter string) (result policyinsights.RemediationListResultPage, err error) +} + +var _ RemediationsClientAPI = (*policyinsights.RemediationsClient)(nil) + +// PolicyEventsClientAPI contains the set of methods on the PolicyEventsClient type. +type PolicyEventsClientAPI interface { + GetMetadata(ctx context.Context, scope string) (result policyinsights.String, err error) + ListQueryResultsForManagementGroup(ctx context.Context, managementGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result policyinsights.PolicyEventsQueryResults, err error) + ListQueryResultsForPolicyDefinition(ctx context.Context, subscriptionID string, policyDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result policyinsights.PolicyEventsQueryResults, err error) + ListQueryResultsForPolicySetDefinition(ctx context.Context, subscriptionID string, policySetDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result policyinsights.PolicyEventsQueryResults, err error) + ListQueryResultsForResource(ctx context.Context, resourceID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result policyinsights.PolicyEventsQueryResults, err error) + ListQueryResultsForResourceGroup(ctx context.Context, subscriptionID string, resourceGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result policyinsights.PolicyEventsQueryResults, err error) + ListQueryResultsForResourceGroupLevelPolicyAssignment(ctx context.Context, subscriptionID string, resourceGroupName string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result policyinsights.PolicyEventsQueryResults, err error) + ListQueryResultsForSubscription(ctx context.Context, subscriptionID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result policyinsights.PolicyEventsQueryResults, err error) + ListQueryResultsForSubscriptionLevelPolicyAssignment(ctx context.Context, subscriptionID string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result policyinsights.PolicyEventsQueryResults, err error) +} + +var _ PolicyEventsClientAPI = (*policyinsights.PolicyEventsClient)(nil) + +// PolicyStatesClientAPI contains the set of methods on the PolicyStatesClient type. +type PolicyStatesClientAPI interface { + ListQueryResultsForManagementGroup(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, managementGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result policyinsights.PolicyStatesQueryResults, err error) + ListQueryResultsForPolicyDefinition(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, subscriptionID string, policyDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result policyinsights.PolicyStatesQueryResults, err error) + ListQueryResultsForPolicySetDefinition(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, subscriptionID string, policySetDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result policyinsights.PolicyStatesQueryResults, err error) + ListQueryResultsForResource(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, resourceID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, expand string) (result policyinsights.PolicyStatesQueryResults, err error) + ListQueryResultsForResourceGroup(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, subscriptionID string, resourceGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result policyinsights.PolicyStatesQueryResults, err error) + ListQueryResultsForResourceGroupLevelPolicyAssignment(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, subscriptionID string, resourceGroupName string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result policyinsights.PolicyStatesQueryResults, err error) + ListQueryResultsForSubscription(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, subscriptionID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result policyinsights.PolicyStatesQueryResults, err error) + ListQueryResultsForSubscriptionLevelPolicyAssignment(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, subscriptionID string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result policyinsights.PolicyStatesQueryResults, err error) + SummarizeForManagementGroup(ctx context.Context, managementGroupName string, top *int32, from *date.Time, toParameter *date.Time, filter string) (result policyinsights.SummarizeResults, err error) + SummarizeForPolicyDefinition(ctx context.Context, subscriptionID string, policyDefinitionName string, top *int32, from *date.Time, toParameter *date.Time, filter string) (result policyinsights.SummarizeResults, err error) + SummarizeForPolicySetDefinition(ctx context.Context, subscriptionID string, policySetDefinitionName string, top *int32, from *date.Time, toParameter *date.Time, filter string) (result policyinsights.SummarizeResults, err error) + SummarizeForResource(ctx context.Context, resourceID string, top *int32, from *date.Time, toParameter *date.Time, filter string) (result policyinsights.SummarizeResults, err error) + SummarizeForResourceGroup(ctx context.Context, subscriptionID string, resourceGroupName string, top *int32, from *date.Time, toParameter *date.Time, filter string) (result policyinsights.SummarizeResults, err error) + SummarizeForResourceGroupLevelPolicyAssignment(ctx context.Context, subscriptionID string, resourceGroupName string, policyAssignmentName string, top *int32, from *date.Time, toParameter *date.Time, filter string) (result policyinsights.SummarizeResults, err error) + SummarizeForSubscription(ctx context.Context, subscriptionID string, top *int32, from *date.Time, toParameter *date.Time, filter string) (result policyinsights.SummarizeResults, err error) + SummarizeForSubscriptionLevelPolicyAssignment(ctx context.Context, subscriptionID string, policyAssignmentName string, top *int32, from *date.Time, toParameter *date.Time, filter string) (result policyinsights.SummarizeResults, err error) +} + +var _ PolicyStatesClientAPI = (*policyinsights.PolicyStatesClient)(nil) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result policyinsights.OperationsListResults, err error) +} + +var _ OperationsClientAPI = (*policyinsights.OperationsClient)(nil) diff --git a/services/policyinsights/mgmt/2019-10-01/policyinsights/policystates.go b/services/policyinsights/mgmt/2019-10-01/policyinsights/policystates.go new file mode 100644 index 000000000000..3ddb69eb24dc --- /dev/null +++ b/services/policyinsights/mgmt/2019-10-01/policyinsights/policystates.go @@ -0,0 +1,1813 @@ +package policyinsights + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// PolicyStatesClient is the client for the PolicyStates methods of the Policyinsights service. +type PolicyStatesClient struct { + BaseClient +} + +// NewPolicyStatesClient creates an instance of the PolicyStatesClient client. +func NewPolicyStatesClient() PolicyStatesClient { + return NewPolicyStatesClientWithBaseURI(DefaultBaseURI) +} + +// NewPolicyStatesClientWithBaseURI creates an instance of the PolicyStatesClient client. +func NewPolicyStatesClientWithBaseURI(baseURI string) PolicyStatesClient { + return PolicyStatesClient{NewWithBaseURI(baseURI)} +} + +// ListQueryResultsForManagementGroup queries policy states for the resources under the management group. +// Parameters: +// policyStatesResource - the virtual resource under PolicyStates resource type. In a given time range, +// 'latest' represents the latest policy state(s), whereas 'default' represents all policy state(s). +// managementGroupName - management group name. +// top - maximum number of records to return. +// orderBy - ordering expression using OData notation. One or more comma-separated column names with an +// optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, ResourceId asc". +// selectParameter - select expression using OData notation. Limits the columns on each record to just those +// requested, e.g. "$select=PolicyAssignmentId, ResourceId". +// from - ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, +// the service uses ($to - 1-day). +// toParameter - ISO 8601 formatted timestamp specifying the end time of the interval to query. When not +// specified, the service uses request time. +// filter - oData filter expression. +// apply - oData apply expression for aggregations. +func (client PolicyStatesClient) ListQueryResultsForManagementGroup(ctx context.Context, policyStatesResource PolicyStatesResource, managementGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result PolicyStatesQueryResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.ListQueryResultsForManagementGroup") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("policyinsights.PolicyStatesClient", "ListQueryResultsForManagementGroup", err.Error()) + } + + req, err := client.ListQueryResultsForManagementGroupPreparer(ctx, policyStatesResource, managementGroupName, top, orderBy, selectParameter, from, toParameter, filter, apply) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForManagementGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListQueryResultsForManagementGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForManagementGroup", resp, "Failure sending request") + return + } + + result, err = client.ListQueryResultsForManagementGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForManagementGroup", resp, "Failure responding to request") + } + + return +} + +// ListQueryResultsForManagementGroupPreparer prepares the ListQueryResultsForManagementGroup request. +func (client PolicyStatesClient) ListQueryResultsForManagementGroupPreparer(ctx context.Context, policyStatesResource PolicyStatesResource, managementGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "managementGroupName": autorest.Encode("path", managementGroupName), + "managementGroupsNamespace": autorest.Encode("path", "Microsoft.Management"), + "policyStatesResource": autorest.Encode("path", policyStatesResource), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(orderBy) > 0 { + queryParameters["$orderby"] = autorest.Encode("query", orderBy) + } + if len(selectParameter) > 0 { + queryParameters["$select"] = autorest.Encode("query", selectParameter) + } + if from != nil { + queryParameters["$from"] = autorest.Encode("query", *from) + } + if toParameter != nil { + queryParameters["$to"] = autorest.Encode("query", *toParameter) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(apply) > 0 { + queryParameters["$apply"] = autorest.Encode("query", apply) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/{managementGroupsNamespace}/managementGroups/{managementGroupName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListQueryResultsForManagementGroupSender sends the ListQueryResultsForManagementGroup request. The method will close the +// http.Response Body if it receives an error. +func (client PolicyStatesClient) ListQueryResultsForManagementGroupSender(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...) +} + +// ListQueryResultsForManagementGroupResponder handles the response to the ListQueryResultsForManagementGroup request. The method always +// closes the http.Response Body. +func (client PolicyStatesClient) ListQueryResultsForManagementGroupResponder(resp *http.Response) (result PolicyStatesQueryResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListQueryResultsForPolicyDefinition queries policy states for the subscription level policy definition. +// Parameters: +// policyStatesResource - the virtual resource under PolicyStates resource type. In a given time range, +// 'latest' represents the latest policy state(s), whereas 'default' represents all policy state(s). +// subscriptionID - microsoft Azure subscription ID. +// policyDefinitionName - policy definition name. +// top - maximum number of records to return. +// orderBy - ordering expression using OData notation. One or more comma-separated column names with an +// optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, ResourceId asc". +// selectParameter - select expression using OData notation. Limits the columns on each record to just those +// requested, e.g. "$select=PolicyAssignmentId, ResourceId". +// from - ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, +// the service uses ($to - 1-day). +// toParameter - ISO 8601 formatted timestamp specifying the end time of the interval to query. When not +// specified, the service uses request time. +// filter - oData filter expression. +// apply - oData apply expression for aggregations. +func (client PolicyStatesClient) ListQueryResultsForPolicyDefinition(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, policyDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result PolicyStatesQueryResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.ListQueryResultsForPolicyDefinition") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("policyinsights.PolicyStatesClient", "ListQueryResultsForPolicyDefinition", err.Error()) + } + + req, err := client.ListQueryResultsForPolicyDefinitionPreparer(ctx, policyStatesResource, subscriptionID, policyDefinitionName, top, orderBy, selectParameter, from, toParameter, filter, apply) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForPolicyDefinition", nil, "Failure preparing request") + return + } + + resp, err := client.ListQueryResultsForPolicyDefinitionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForPolicyDefinition", resp, "Failure sending request") + return + } + + result, err = client.ListQueryResultsForPolicyDefinitionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForPolicyDefinition", resp, "Failure responding to request") + } + + return +} + +// ListQueryResultsForPolicyDefinitionPreparer prepares the ListQueryResultsForPolicyDefinition request. +func (client PolicyStatesClient) ListQueryResultsForPolicyDefinitionPreparer(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, policyDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "authorizationNamespace": autorest.Encode("path", "Microsoft.Authorization"), + "policyDefinitionName": autorest.Encode("path", policyDefinitionName), + "policyStatesResource": autorest.Encode("path", policyStatesResource), + "subscriptionId": autorest.Encode("path", subscriptionID), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(orderBy) > 0 { + queryParameters["$orderby"] = autorest.Encode("query", orderBy) + } + if len(selectParameter) > 0 { + queryParameters["$select"] = autorest.Encode("query", selectParameter) + } + if from != nil { + queryParameters["$from"] = autorest.Encode("query", *from) + } + if toParameter != nil { + queryParameters["$to"] = autorest.Encode("query", *toParameter) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(apply) > 0 { + queryParameters["$apply"] = autorest.Encode("query", apply) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyDefinitions/{policyDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListQueryResultsForPolicyDefinitionSender sends the ListQueryResultsForPolicyDefinition request. The method will close the +// http.Response Body if it receives an error. +func (client PolicyStatesClient) ListQueryResultsForPolicyDefinitionSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListQueryResultsForPolicyDefinitionResponder handles the response to the ListQueryResultsForPolicyDefinition request. The method always +// closes the http.Response Body. +func (client PolicyStatesClient) ListQueryResultsForPolicyDefinitionResponder(resp *http.Response) (result PolicyStatesQueryResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListQueryResultsForPolicySetDefinition queries policy states for the subscription level policy set definition. +// Parameters: +// policyStatesResource - the virtual resource under PolicyStates resource type. In a given time range, +// 'latest' represents the latest policy state(s), whereas 'default' represents all policy state(s). +// subscriptionID - microsoft Azure subscription ID. +// policySetDefinitionName - policy set definition name. +// top - maximum number of records to return. +// orderBy - ordering expression using OData notation. One or more comma-separated column names with an +// optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, ResourceId asc". +// selectParameter - select expression using OData notation. Limits the columns on each record to just those +// requested, e.g. "$select=PolicyAssignmentId, ResourceId". +// from - ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, +// the service uses ($to - 1-day). +// toParameter - ISO 8601 formatted timestamp specifying the end time of the interval to query. When not +// specified, the service uses request time. +// filter - oData filter expression. +// apply - oData apply expression for aggregations. +func (client PolicyStatesClient) ListQueryResultsForPolicySetDefinition(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, policySetDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result PolicyStatesQueryResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.ListQueryResultsForPolicySetDefinition") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("policyinsights.PolicyStatesClient", "ListQueryResultsForPolicySetDefinition", err.Error()) + } + + req, err := client.ListQueryResultsForPolicySetDefinitionPreparer(ctx, policyStatesResource, subscriptionID, policySetDefinitionName, top, orderBy, selectParameter, from, toParameter, filter, apply) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForPolicySetDefinition", nil, "Failure preparing request") + return + } + + resp, err := client.ListQueryResultsForPolicySetDefinitionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForPolicySetDefinition", resp, "Failure sending request") + return + } + + result, err = client.ListQueryResultsForPolicySetDefinitionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForPolicySetDefinition", resp, "Failure responding to request") + } + + return +} + +// ListQueryResultsForPolicySetDefinitionPreparer prepares the ListQueryResultsForPolicySetDefinition request. +func (client PolicyStatesClient) ListQueryResultsForPolicySetDefinitionPreparer(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, policySetDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "authorizationNamespace": autorest.Encode("path", "Microsoft.Authorization"), + "policySetDefinitionName": autorest.Encode("path", policySetDefinitionName), + "policyStatesResource": autorest.Encode("path", policyStatesResource), + "subscriptionId": autorest.Encode("path", subscriptionID), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(orderBy) > 0 { + queryParameters["$orderby"] = autorest.Encode("query", orderBy) + } + if len(selectParameter) > 0 { + queryParameters["$select"] = autorest.Encode("query", selectParameter) + } + if from != nil { + queryParameters["$from"] = autorest.Encode("query", *from) + } + if toParameter != nil { + queryParameters["$to"] = autorest.Encode("query", *toParameter) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(apply) > 0 { + queryParameters["$apply"] = autorest.Encode("query", apply) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policySetDefinitions/{policySetDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListQueryResultsForPolicySetDefinitionSender sends the ListQueryResultsForPolicySetDefinition request. The method will close the +// http.Response Body if it receives an error. +func (client PolicyStatesClient) ListQueryResultsForPolicySetDefinitionSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListQueryResultsForPolicySetDefinitionResponder handles the response to the ListQueryResultsForPolicySetDefinition request. The method always +// closes the http.Response Body. +func (client PolicyStatesClient) ListQueryResultsForPolicySetDefinitionResponder(resp *http.Response) (result PolicyStatesQueryResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListQueryResultsForResource queries policy states for the resource. +// Parameters: +// policyStatesResource - the virtual resource under PolicyStates resource type. In a given time range, +// 'latest' represents the latest policy state(s), whereas 'default' represents all policy state(s). +// resourceID - resource ID. +// top - maximum number of records to return. +// orderBy - ordering expression using OData notation. One or more comma-separated column names with an +// optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, ResourceId asc". +// selectParameter - select expression using OData notation. Limits the columns on each record to just those +// requested, e.g. "$select=PolicyAssignmentId, ResourceId". +// from - ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, +// the service uses ($to - 1-day). +// toParameter - ISO 8601 formatted timestamp specifying the end time of the interval to query. When not +// specified, the service uses request time. +// filter - oData filter expression. +// apply - oData apply expression for aggregations. +// expand - the $expand query parameter. For example, to expand policyEvaluationDetails, use +// $expand=policyEvaluationDetails +func (client PolicyStatesClient) ListQueryResultsForResource(ctx context.Context, policyStatesResource PolicyStatesResource, resourceID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, expand string) (result PolicyStatesQueryResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.ListQueryResultsForResource") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("policyinsights.PolicyStatesClient", "ListQueryResultsForResource", err.Error()) + } + + req, err := client.ListQueryResultsForResourcePreparer(ctx, policyStatesResource, resourceID, top, orderBy, selectParameter, from, toParameter, filter, apply, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForResource", nil, "Failure preparing request") + return + } + + resp, err := client.ListQueryResultsForResourceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForResource", resp, "Failure sending request") + return + } + + result, err = client.ListQueryResultsForResourceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForResource", resp, "Failure responding to request") + } + + return +} + +// ListQueryResultsForResourcePreparer prepares the ListQueryResultsForResource request. +func (client PolicyStatesClient) ListQueryResultsForResourcePreparer(ctx context.Context, policyStatesResource PolicyStatesResource, resourceID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, expand string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyStatesResource": autorest.Encode("path", policyStatesResource), + "resourceId": resourceID, + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(orderBy) > 0 { + queryParameters["$orderby"] = autorest.Encode("query", orderBy) + } + if len(selectParameter) > 0 { + queryParameters["$select"] = autorest.Encode("query", selectParameter) + } + if from != nil { + queryParameters["$from"] = autorest.Encode("query", *from) + } + if toParameter != nil { + queryParameters["$to"] = autorest.Encode("query", *toParameter) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(apply) > 0 { + queryParameters["$apply"] = autorest.Encode("query", apply) + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{resourceId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListQueryResultsForResourceSender sends the ListQueryResultsForResource request. The method will close the +// http.Response Body if it receives an error. +func (client PolicyStatesClient) ListQueryResultsForResourceSender(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...) +} + +// ListQueryResultsForResourceResponder handles the response to the ListQueryResultsForResource request. The method always +// closes the http.Response Body. +func (client PolicyStatesClient) ListQueryResultsForResourceResponder(resp *http.Response) (result PolicyStatesQueryResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListQueryResultsForResourceGroup queries policy states for the resources under the resource group. +// Parameters: +// policyStatesResource - the virtual resource under PolicyStates resource type. In a given time range, +// 'latest' represents the latest policy state(s), whereas 'default' represents all policy state(s). +// subscriptionID - microsoft Azure subscription ID. +// resourceGroupName - resource group name. +// top - maximum number of records to return. +// orderBy - ordering expression using OData notation. One or more comma-separated column names with an +// optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, ResourceId asc". +// selectParameter - select expression using OData notation. Limits the columns on each record to just those +// requested, e.g. "$select=PolicyAssignmentId, ResourceId". +// from - ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, +// the service uses ($to - 1-day). +// toParameter - ISO 8601 formatted timestamp specifying the end time of the interval to query. When not +// specified, the service uses request time. +// filter - oData filter expression. +// apply - oData apply expression for aggregations. +func (client PolicyStatesClient) ListQueryResultsForResourceGroup(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, resourceGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result PolicyStatesQueryResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.ListQueryResultsForResourceGroup") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("policyinsights.PolicyStatesClient", "ListQueryResultsForResourceGroup", err.Error()) + } + + req, err := client.ListQueryResultsForResourceGroupPreparer(ctx, policyStatesResource, subscriptionID, resourceGroupName, top, orderBy, selectParameter, from, toParameter, filter, apply) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListQueryResultsForResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForResourceGroup", resp, "Failure sending request") + return + } + + result, err = client.ListQueryResultsForResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListQueryResultsForResourceGroupPreparer prepares the ListQueryResultsForResourceGroup request. +func (client PolicyStatesClient) ListQueryResultsForResourceGroupPreparer(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, resourceGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyStatesResource": autorest.Encode("path", policyStatesResource), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", subscriptionID), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(orderBy) > 0 { + queryParameters["$orderby"] = autorest.Encode("query", orderBy) + } + if len(selectParameter) > 0 { + queryParameters["$select"] = autorest.Encode("query", selectParameter) + } + if from != nil { + queryParameters["$from"] = autorest.Encode("query", *from) + } + if toParameter != nil { + queryParameters["$to"] = autorest.Encode("query", *toParameter) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(apply) > 0 { + queryParameters["$apply"] = autorest.Encode("query", apply) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListQueryResultsForResourceGroupSender sends the ListQueryResultsForResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client PolicyStatesClient) ListQueryResultsForResourceGroupSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListQueryResultsForResourceGroupResponder handles the response to the ListQueryResultsForResourceGroup request. The method always +// closes the http.Response Body. +func (client PolicyStatesClient) ListQueryResultsForResourceGroupResponder(resp *http.Response) (result PolicyStatesQueryResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListQueryResultsForResourceGroupLevelPolicyAssignment queries policy states for the resource group level policy +// assignment. +// Parameters: +// policyStatesResource - the virtual resource under PolicyStates resource type. In a given time range, +// 'latest' represents the latest policy state(s), whereas 'default' represents all policy state(s). +// subscriptionID - microsoft Azure subscription ID. +// resourceGroupName - resource group name. +// policyAssignmentName - policy assignment name. +// top - maximum number of records to return. +// orderBy - ordering expression using OData notation. One or more comma-separated column names with an +// optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, ResourceId asc". +// selectParameter - select expression using OData notation. Limits the columns on each record to just those +// requested, e.g. "$select=PolicyAssignmentId, ResourceId". +// from - ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, +// the service uses ($to - 1-day). +// toParameter - ISO 8601 formatted timestamp specifying the end time of the interval to query. When not +// specified, the service uses request time. +// filter - oData filter expression. +// apply - oData apply expression for aggregations. +func (client PolicyStatesClient) ListQueryResultsForResourceGroupLevelPolicyAssignment(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, resourceGroupName string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result PolicyStatesQueryResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.ListQueryResultsForResourceGroupLevelPolicyAssignment") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("policyinsights.PolicyStatesClient", "ListQueryResultsForResourceGroupLevelPolicyAssignment", err.Error()) + } + + req, err := client.ListQueryResultsForResourceGroupLevelPolicyAssignmentPreparer(ctx, policyStatesResource, subscriptionID, resourceGroupName, policyAssignmentName, top, orderBy, selectParameter, from, toParameter, filter, apply) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForResourceGroupLevelPolicyAssignment", nil, "Failure preparing request") + return + } + + resp, err := client.ListQueryResultsForResourceGroupLevelPolicyAssignmentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForResourceGroupLevelPolicyAssignment", resp, "Failure sending request") + return + } + + result, err = client.ListQueryResultsForResourceGroupLevelPolicyAssignmentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForResourceGroupLevelPolicyAssignment", resp, "Failure responding to request") + } + + return +} + +// ListQueryResultsForResourceGroupLevelPolicyAssignmentPreparer prepares the ListQueryResultsForResourceGroupLevelPolicyAssignment request. +func (client PolicyStatesClient) ListQueryResultsForResourceGroupLevelPolicyAssignmentPreparer(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, resourceGroupName string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "authorizationNamespace": autorest.Encode("path", "Microsoft.Authorization"), + "policyAssignmentName": autorest.Encode("path", policyAssignmentName), + "policyStatesResource": autorest.Encode("path", policyStatesResource), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", subscriptionID), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(orderBy) > 0 { + queryParameters["$orderby"] = autorest.Encode("query", orderBy) + } + if len(selectParameter) > 0 { + queryParameters["$select"] = autorest.Encode("query", selectParameter) + } + if from != nil { + queryParameters["$from"] = autorest.Encode("query", *from) + } + if toParameter != nil { + queryParameters["$to"] = autorest.Encode("query", *toParameter) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(apply) > 0 { + queryParameters["$apply"] = autorest.Encode("query", apply) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListQueryResultsForResourceGroupLevelPolicyAssignmentSender sends the ListQueryResultsForResourceGroupLevelPolicyAssignment request. The method will close the +// http.Response Body if it receives an error. +func (client PolicyStatesClient) ListQueryResultsForResourceGroupLevelPolicyAssignmentSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListQueryResultsForResourceGroupLevelPolicyAssignmentResponder handles the response to the ListQueryResultsForResourceGroupLevelPolicyAssignment request. The method always +// closes the http.Response Body. +func (client PolicyStatesClient) ListQueryResultsForResourceGroupLevelPolicyAssignmentResponder(resp *http.Response) (result PolicyStatesQueryResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListQueryResultsForSubscription queries policy states for the resources under the subscription. +// Parameters: +// policyStatesResource - the virtual resource under PolicyStates resource type. In a given time range, +// 'latest' represents the latest policy state(s), whereas 'default' represents all policy state(s). +// subscriptionID - microsoft Azure subscription ID. +// top - maximum number of records to return. +// orderBy - ordering expression using OData notation. One or more comma-separated column names with an +// optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, ResourceId asc". +// selectParameter - select expression using OData notation. Limits the columns on each record to just those +// requested, e.g. "$select=PolicyAssignmentId, ResourceId". +// from - ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, +// the service uses ($to - 1-day). +// toParameter - ISO 8601 formatted timestamp specifying the end time of the interval to query. When not +// specified, the service uses request time. +// filter - oData filter expression. +// apply - oData apply expression for aggregations. +func (client PolicyStatesClient) ListQueryResultsForSubscription(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result PolicyStatesQueryResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.ListQueryResultsForSubscription") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("policyinsights.PolicyStatesClient", "ListQueryResultsForSubscription", err.Error()) + } + + req, err := client.ListQueryResultsForSubscriptionPreparer(ctx, policyStatesResource, subscriptionID, top, orderBy, selectParameter, from, toParameter, filter, apply) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForSubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListQueryResultsForSubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForSubscription", resp, "Failure sending request") + return + } + + result, err = client.ListQueryResultsForSubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForSubscription", resp, "Failure responding to request") + } + + return +} + +// ListQueryResultsForSubscriptionPreparer prepares the ListQueryResultsForSubscription request. +func (client PolicyStatesClient) ListQueryResultsForSubscriptionPreparer(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyStatesResource": autorest.Encode("path", policyStatesResource), + "subscriptionId": autorest.Encode("path", subscriptionID), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(orderBy) > 0 { + queryParameters["$orderby"] = autorest.Encode("query", orderBy) + } + if len(selectParameter) > 0 { + queryParameters["$select"] = autorest.Encode("query", selectParameter) + } + if from != nil { + queryParameters["$from"] = autorest.Encode("query", *from) + } + if toParameter != nil { + queryParameters["$to"] = autorest.Encode("query", *toParameter) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(apply) > 0 { + queryParameters["$apply"] = autorest.Encode("query", apply) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListQueryResultsForSubscriptionSender sends the ListQueryResultsForSubscription request. The method will close the +// http.Response Body if it receives an error. +func (client PolicyStatesClient) ListQueryResultsForSubscriptionSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListQueryResultsForSubscriptionResponder handles the response to the ListQueryResultsForSubscription request. The method always +// closes the http.Response Body. +func (client PolicyStatesClient) ListQueryResultsForSubscriptionResponder(resp *http.Response) (result PolicyStatesQueryResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListQueryResultsForSubscriptionLevelPolicyAssignment queries policy states for the subscription level policy +// assignment. +// Parameters: +// policyStatesResource - the virtual resource under PolicyStates resource type. In a given time range, +// 'latest' represents the latest policy state(s), whereas 'default' represents all policy state(s). +// subscriptionID - microsoft Azure subscription ID. +// policyAssignmentName - policy assignment name. +// top - maximum number of records to return. +// orderBy - ordering expression using OData notation. One or more comma-separated column names with an +// optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, ResourceId asc". +// selectParameter - select expression using OData notation. Limits the columns on each record to just those +// requested, e.g. "$select=PolicyAssignmentId, ResourceId". +// from - ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, +// the service uses ($to - 1-day). +// toParameter - ISO 8601 formatted timestamp specifying the end time of the interval to query. When not +// specified, the service uses request time. +// filter - oData filter expression. +// apply - oData apply expression for aggregations. +func (client PolicyStatesClient) ListQueryResultsForSubscriptionLevelPolicyAssignment(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result PolicyStatesQueryResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.ListQueryResultsForSubscriptionLevelPolicyAssignment") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("policyinsights.PolicyStatesClient", "ListQueryResultsForSubscriptionLevelPolicyAssignment", err.Error()) + } + + req, err := client.ListQueryResultsForSubscriptionLevelPolicyAssignmentPreparer(ctx, policyStatesResource, subscriptionID, policyAssignmentName, top, orderBy, selectParameter, from, toParameter, filter, apply) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForSubscriptionLevelPolicyAssignment", nil, "Failure preparing request") + return + } + + resp, err := client.ListQueryResultsForSubscriptionLevelPolicyAssignmentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForSubscriptionLevelPolicyAssignment", resp, "Failure sending request") + return + } + + result, err = client.ListQueryResultsForSubscriptionLevelPolicyAssignmentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForSubscriptionLevelPolicyAssignment", resp, "Failure responding to request") + } + + return +} + +// ListQueryResultsForSubscriptionLevelPolicyAssignmentPreparer prepares the ListQueryResultsForSubscriptionLevelPolicyAssignment request. +func (client PolicyStatesClient) ListQueryResultsForSubscriptionLevelPolicyAssignmentPreparer(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "authorizationNamespace": autorest.Encode("path", "Microsoft.Authorization"), + "policyAssignmentName": autorest.Encode("path", policyAssignmentName), + "policyStatesResource": autorest.Encode("path", policyStatesResource), + "subscriptionId": autorest.Encode("path", subscriptionID), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(orderBy) > 0 { + queryParameters["$orderby"] = autorest.Encode("query", orderBy) + } + if len(selectParameter) > 0 { + queryParameters["$select"] = autorest.Encode("query", selectParameter) + } + if from != nil { + queryParameters["$from"] = autorest.Encode("query", *from) + } + if toParameter != nil { + queryParameters["$to"] = autorest.Encode("query", *toParameter) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(apply) > 0 { + queryParameters["$apply"] = autorest.Encode("query", apply) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListQueryResultsForSubscriptionLevelPolicyAssignmentSender sends the ListQueryResultsForSubscriptionLevelPolicyAssignment request. The method will close the +// http.Response Body if it receives an error. +func (client PolicyStatesClient) ListQueryResultsForSubscriptionLevelPolicyAssignmentSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListQueryResultsForSubscriptionLevelPolicyAssignmentResponder handles the response to the ListQueryResultsForSubscriptionLevelPolicyAssignment request. The method always +// closes the http.Response Body. +func (client PolicyStatesClient) ListQueryResultsForSubscriptionLevelPolicyAssignmentResponder(resp *http.Response) (result PolicyStatesQueryResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// SummarizeForManagementGroup summarizes policy states for the resources under the management group. +// Parameters: +// managementGroupName - management group name. +// top - maximum number of records to return. +// from - ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, +// the service uses ($to - 1-day). +// toParameter - ISO 8601 formatted timestamp specifying the end time of the interval to query. When not +// specified, the service uses request time. +// filter - oData filter expression. +func (client PolicyStatesClient) SummarizeForManagementGroup(ctx context.Context, managementGroupName string, top *int32, from *date.Time, toParameter *date.Time, filter string) (result SummarizeResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.SummarizeForManagementGroup") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("policyinsights.PolicyStatesClient", "SummarizeForManagementGroup", err.Error()) + } + + req, err := client.SummarizeForManagementGroupPreparer(ctx, managementGroupName, top, from, toParameter, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "SummarizeForManagementGroup", nil, "Failure preparing request") + return + } + + resp, err := client.SummarizeForManagementGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "SummarizeForManagementGroup", resp, "Failure sending request") + return + } + + result, err = client.SummarizeForManagementGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "SummarizeForManagementGroup", resp, "Failure responding to request") + } + + return +} + +// SummarizeForManagementGroupPreparer prepares the SummarizeForManagementGroup request. +func (client PolicyStatesClient) SummarizeForManagementGroupPreparer(ctx context.Context, managementGroupName string, top *int32, from *date.Time, toParameter *date.Time, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "managementGroupName": autorest.Encode("path", managementGroupName), + "managementGroupsNamespace": autorest.Encode("path", "Microsoft.Management"), + "policyStatesSummaryResource": autorest.Encode("path", "latest"), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if from != nil { + queryParameters["$from"] = autorest.Encode("query", *from) + } + if toParameter != nil { + queryParameters["$to"] = autorest.Encode("query", *toParameter) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/{managementGroupsNamespace}/managementGroups/{managementGroupName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SummarizeForManagementGroupSender sends the SummarizeForManagementGroup request. The method will close the +// http.Response Body if it receives an error. +func (client PolicyStatesClient) SummarizeForManagementGroupSender(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...) +} + +// SummarizeForManagementGroupResponder handles the response to the SummarizeForManagementGroup request. The method always +// closes the http.Response Body. +func (client PolicyStatesClient) SummarizeForManagementGroupResponder(resp *http.Response) (result SummarizeResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// SummarizeForPolicyDefinition summarizes policy states for the subscription level policy definition. +// Parameters: +// subscriptionID - microsoft Azure subscription ID. +// policyDefinitionName - policy definition name. +// top - maximum number of records to return. +// from - ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, +// the service uses ($to - 1-day). +// toParameter - ISO 8601 formatted timestamp specifying the end time of the interval to query. When not +// specified, the service uses request time. +// filter - oData filter expression. +func (client PolicyStatesClient) SummarizeForPolicyDefinition(ctx context.Context, subscriptionID string, policyDefinitionName string, top *int32, from *date.Time, toParameter *date.Time, filter string) (result SummarizeResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.SummarizeForPolicyDefinition") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("policyinsights.PolicyStatesClient", "SummarizeForPolicyDefinition", err.Error()) + } + + req, err := client.SummarizeForPolicyDefinitionPreparer(ctx, subscriptionID, policyDefinitionName, top, from, toParameter, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "SummarizeForPolicyDefinition", nil, "Failure preparing request") + return + } + + resp, err := client.SummarizeForPolicyDefinitionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "SummarizeForPolicyDefinition", resp, "Failure sending request") + return + } + + result, err = client.SummarizeForPolicyDefinitionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "SummarizeForPolicyDefinition", resp, "Failure responding to request") + } + + return +} + +// SummarizeForPolicyDefinitionPreparer prepares the SummarizeForPolicyDefinition request. +func (client PolicyStatesClient) SummarizeForPolicyDefinitionPreparer(ctx context.Context, subscriptionID string, policyDefinitionName string, top *int32, from *date.Time, toParameter *date.Time, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "authorizationNamespace": autorest.Encode("path", "Microsoft.Authorization"), + "policyDefinitionName": autorest.Encode("path", policyDefinitionName), + "policyStatesSummaryResource": autorest.Encode("path", "latest"), + "subscriptionId": autorest.Encode("path", subscriptionID), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if from != nil { + queryParameters["$from"] = autorest.Encode("query", *from) + } + if toParameter != nil { + queryParameters["$to"] = autorest.Encode("query", *toParameter) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyDefinitions/{policyDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SummarizeForPolicyDefinitionSender sends the SummarizeForPolicyDefinition request. The method will close the +// http.Response Body if it receives an error. +func (client PolicyStatesClient) SummarizeForPolicyDefinitionSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// SummarizeForPolicyDefinitionResponder handles the response to the SummarizeForPolicyDefinition request. The method always +// closes the http.Response Body. +func (client PolicyStatesClient) SummarizeForPolicyDefinitionResponder(resp *http.Response) (result SummarizeResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// SummarizeForPolicySetDefinition summarizes policy states for the subscription level policy set definition. +// Parameters: +// subscriptionID - microsoft Azure subscription ID. +// policySetDefinitionName - policy set definition name. +// top - maximum number of records to return. +// from - ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, +// the service uses ($to - 1-day). +// toParameter - ISO 8601 formatted timestamp specifying the end time of the interval to query. When not +// specified, the service uses request time. +// filter - oData filter expression. +func (client PolicyStatesClient) SummarizeForPolicySetDefinition(ctx context.Context, subscriptionID string, policySetDefinitionName string, top *int32, from *date.Time, toParameter *date.Time, filter string) (result SummarizeResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.SummarizeForPolicySetDefinition") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("policyinsights.PolicyStatesClient", "SummarizeForPolicySetDefinition", err.Error()) + } + + req, err := client.SummarizeForPolicySetDefinitionPreparer(ctx, subscriptionID, policySetDefinitionName, top, from, toParameter, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "SummarizeForPolicySetDefinition", nil, "Failure preparing request") + return + } + + resp, err := client.SummarizeForPolicySetDefinitionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "SummarizeForPolicySetDefinition", resp, "Failure sending request") + return + } + + result, err = client.SummarizeForPolicySetDefinitionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "SummarizeForPolicySetDefinition", resp, "Failure responding to request") + } + + return +} + +// SummarizeForPolicySetDefinitionPreparer prepares the SummarizeForPolicySetDefinition request. +func (client PolicyStatesClient) SummarizeForPolicySetDefinitionPreparer(ctx context.Context, subscriptionID string, policySetDefinitionName string, top *int32, from *date.Time, toParameter *date.Time, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "authorizationNamespace": autorest.Encode("path", "Microsoft.Authorization"), + "policySetDefinitionName": autorest.Encode("path", policySetDefinitionName), + "policyStatesSummaryResource": autorest.Encode("path", "latest"), + "subscriptionId": autorest.Encode("path", subscriptionID), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if from != nil { + queryParameters["$from"] = autorest.Encode("query", *from) + } + if toParameter != nil { + queryParameters["$to"] = autorest.Encode("query", *toParameter) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policySetDefinitions/{policySetDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SummarizeForPolicySetDefinitionSender sends the SummarizeForPolicySetDefinition request. The method will close the +// http.Response Body if it receives an error. +func (client PolicyStatesClient) SummarizeForPolicySetDefinitionSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// SummarizeForPolicySetDefinitionResponder handles the response to the SummarizeForPolicySetDefinition request. The method always +// closes the http.Response Body. +func (client PolicyStatesClient) SummarizeForPolicySetDefinitionResponder(resp *http.Response) (result SummarizeResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// SummarizeForResource summarizes policy states for the resource. +// Parameters: +// resourceID - resource ID. +// top - maximum number of records to return. +// from - ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, +// the service uses ($to - 1-day). +// toParameter - ISO 8601 formatted timestamp specifying the end time of the interval to query. When not +// specified, the service uses request time. +// filter - oData filter expression. +func (client PolicyStatesClient) SummarizeForResource(ctx context.Context, resourceID string, top *int32, from *date.Time, toParameter *date.Time, filter string) (result SummarizeResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.SummarizeForResource") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("policyinsights.PolicyStatesClient", "SummarizeForResource", err.Error()) + } + + req, err := client.SummarizeForResourcePreparer(ctx, resourceID, top, from, toParameter, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "SummarizeForResource", nil, "Failure preparing request") + return + } + + resp, err := client.SummarizeForResourceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "SummarizeForResource", resp, "Failure sending request") + return + } + + result, err = client.SummarizeForResourceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "SummarizeForResource", resp, "Failure responding to request") + } + + return +} + +// SummarizeForResourcePreparer prepares the SummarizeForResource request. +func (client PolicyStatesClient) SummarizeForResourcePreparer(ctx context.Context, resourceID string, top *int32, from *date.Time, toParameter *date.Time, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyStatesSummaryResource": autorest.Encode("path", "latest"), + "resourceId": resourceID, + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if from != nil { + queryParameters["$from"] = autorest.Encode("query", *from) + } + if toParameter != nil { + queryParameters["$to"] = autorest.Encode("query", *toParameter) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{resourceId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SummarizeForResourceSender sends the SummarizeForResource request. The method will close the +// http.Response Body if it receives an error. +func (client PolicyStatesClient) SummarizeForResourceSender(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...) +} + +// SummarizeForResourceResponder handles the response to the SummarizeForResource request. The method always +// closes the http.Response Body. +func (client PolicyStatesClient) SummarizeForResourceResponder(resp *http.Response) (result SummarizeResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// SummarizeForResourceGroup summarizes policy states for the resources under the resource group. +// Parameters: +// subscriptionID - microsoft Azure subscription ID. +// resourceGroupName - resource group name. +// top - maximum number of records to return. +// from - ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, +// the service uses ($to - 1-day). +// toParameter - ISO 8601 formatted timestamp specifying the end time of the interval to query. When not +// specified, the service uses request time. +// filter - oData filter expression. +func (client PolicyStatesClient) SummarizeForResourceGroup(ctx context.Context, subscriptionID string, resourceGroupName string, top *int32, from *date.Time, toParameter *date.Time, filter string) (result SummarizeResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.SummarizeForResourceGroup") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("policyinsights.PolicyStatesClient", "SummarizeForResourceGroup", err.Error()) + } + + req, err := client.SummarizeForResourceGroupPreparer(ctx, subscriptionID, resourceGroupName, top, from, toParameter, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "SummarizeForResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.SummarizeForResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "SummarizeForResourceGroup", resp, "Failure sending request") + return + } + + result, err = client.SummarizeForResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "SummarizeForResourceGroup", resp, "Failure responding to request") + } + + return +} + +// SummarizeForResourceGroupPreparer prepares the SummarizeForResourceGroup request. +func (client PolicyStatesClient) SummarizeForResourceGroupPreparer(ctx context.Context, subscriptionID string, resourceGroupName string, top *int32, from *date.Time, toParameter *date.Time, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyStatesSummaryResource": autorest.Encode("path", "latest"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", subscriptionID), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if from != nil { + queryParameters["$from"] = autorest.Encode("query", *from) + } + if toParameter != nil { + queryParameters["$to"] = autorest.Encode("query", *toParameter) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SummarizeForResourceGroupSender sends the SummarizeForResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client PolicyStatesClient) SummarizeForResourceGroupSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// SummarizeForResourceGroupResponder handles the response to the SummarizeForResourceGroup request. The method always +// closes the http.Response Body. +func (client PolicyStatesClient) SummarizeForResourceGroupResponder(resp *http.Response) (result SummarizeResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// SummarizeForResourceGroupLevelPolicyAssignment summarizes policy states for the resource group level policy +// assignment. +// Parameters: +// subscriptionID - microsoft Azure subscription ID. +// resourceGroupName - resource group name. +// policyAssignmentName - policy assignment name. +// top - maximum number of records to return. +// from - ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, +// the service uses ($to - 1-day). +// toParameter - ISO 8601 formatted timestamp specifying the end time of the interval to query. When not +// specified, the service uses request time. +// filter - oData filter expression. +func (client PolicyStatesClient) SummarizeForResourceGroupLevelPolicyAssignment(ctx context.Context, subscriptionID string, resourceGroupName string, policyAssignmentName string, top *int32, from *date.Time, toParameter *date.Time, filter string) (result SummarizeResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.SummarizeForResourceGroupLevelPolicyAssignment") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("policyinsights.PolicyStatesClient", "SummarizeForResourceGroupLevelPolicyAssignment", err.Error()) + } + + req, err := client.SummarizeForResourceGroupLevelPolicyAssignmentPreparer(ctx, subscriptionID, resourceGroupName, policyAssignmentName, top, from, toParameter, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "SummarizeForResourceGroupLevelPolicyAssignment", nil, "Failure preparing request") + return + } + + resp, err := client.SummarizeForResourceGroupLevelPolicyAssignmentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "SummarizeForResourceGroupLevelPolicyAssignment", resp, "Failure sending request") + return + } + + result, err = client.SummarizeForResourceGroupLevelPolicyAssignmentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "SummarizeForResourceGroupLevelPolicyAssignment", resp, "Failure responding to request") + } + + return +} + +// SummarizeForResourceGroupLevelPolicyAssignmentPreparer prepares the SummarizeForResourceGroupLevelPolicyAssignment request. +func (client PolicyStatesClient) SummarizeForResourceGroupLevelPolicyAssignmentPreparer(ctx context.Context, subscriptionID string, resourceGroupName string, policyAssignmentName string, top *int32, from *date.Time, toParameter *date.Time, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "authorizationNamespace": autorest.Encode("path", "Microsoft.Authorization"), + "policyAssignmentName": autorest.Encode("path", policyAssignmentName), + "policyStatesSummaryResource": autorest.Encode("path", "latest"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", subscriptionID), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if from != nil { + queryParameters["$from"] = autorest.Encode("query", *from) + } + if toParameter != nil { + queryParameters["$to"] = autorest.Encode("query", *toParameter) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SummarizeForResourceGroupLevelPolicyAssignmentSender sends the SummarizeForResourceGroupLevelPolicyAssignment request. The method will close the +// http.Response Body if it receives an error. +func (client PolicyStatesClient) SummarizeForResourceGroupLevelPolicyAssignmentSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// SummarizeForResourceGroupLevelPolicyAssignmentResponder handles the response to the SummarizeForResourceGroupLevelPolicyAssignment request. The method always +// closes the http.Response Body. +func (client PolicyStatesClient) SummarizeForResourceGroupLevelPolicyAssignmentResponder(resp *http.Response) (result SummarizeResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// SummarizeForSubscription summarizes policy states for the resources under the subscription. +// Parameters: +// subscriptionID - microsoft Azure subscription ID. +// top - maximum number of records to return. +// from - ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, +// the service uses ($to - 1-day). +// toParameter - ISO 8601 formatted timestamp specifying the end time of the interval to query. When not +// specified, the service uses request time. +// filter - oData filter expression. +func (client PolicyStatesClient) SummarizeForSubscription(ctx context.Context, subscriptionID string, top *int32, from *date.Time, toParameter *date.Time, filter string) (result SummarizeResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.SummarizeForSubscription") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("policyinsights.PolicyStatesClient", "SummarizeForSubscription", err.Error()) + } + + req, err := client.SummarizeForSubscriptionPreparer(ctx, subscriptionID, top, from, toParameter, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "SummarizeForSubscription", nil, "Failure preparing request") + return + } + + resp, err := client.SummarizeForSubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "SummarizeForSubscription", resp, "Failure sending request") + return + } + + result, err = client.SummarizeForSubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "SummarizeForSubscription", resp, "Failure responding to request") + } + + return +} + +// SummarizeForSubscriptionPreparer prepares the SummarizeForSubscription request. +func (client PolicyStatesClient) SummarizeForSubscriptionPreparer(ctx context.Context, subscriptionID string, top *int32, from *date.Time, toParameter *date.Time, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyStatesSummaryResource": autorest.Encode("path", "latest"), + "subscriptionId": autorest.Encode("path", subscriptionID), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if from != nil { + queryParameters["$from"] = autorest.Encode("query", *from) + } + if toParameter != nil { + queryParameters["$to"] = autorest.Encode("query", *toParameter) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SummarizeForSubscriptionSender sends the SummarizeForSubscription request. The method will close the +// http.Response Body if it receives an error. +func (client PolicyStatesClient) SummarizeForSubscriptionSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// SummarizeForSubscriptionResponder handles the response to the SummarizeForSubscription request. The method always +// closes the http.Response Body. +func (client PolicyStatesClient) SummarizeForSubscriptionResponder(resp *http.Response) (result SummarizeResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// SummarizeForSubscriptionLevelPolicyAssignment summarizes policy states for the subscription level policy assignment. +// Parameters: +// subscriptionID - microsoft Azure subscription ID. +// policyAssignmentName - policy assignment name. +// top - maximum number of records to return. +// from - ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, +// the service uses ($to - 1-day). +// toParameter - ISO 8601 formatted timestamp specifying the end time of the interval to query. When not +// specified, the service uses request time. +// filter - oData filter expression. +func (client PolicyStatesClient) SummarizeForSubscriptionLevelPolicyAssignment(ctx context.Context, subscriptionID string, policyAssignmentName string, top *int32, from *date.Time, toParameter *date.Time, filter string) (result SummarizeResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.SummarizeForSubscriptionLevelPolicyAssignment") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("policyinsights.PolicyStatesClient", "SummarizeForSubscriptionLevelPolicyAssignment", err.Error()) + } + + req, err := client.SummarizeForSubscriptionLevelPolicyAssignmentPreparer(ctx, subscriptionID, policyAssignmentName, top, from, toParameter, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "SummarizeForSubscriptionLevelPolicyAssignment", nil, "Failure preparing request") + return + } + + resp, err := client.SummarizeForSubscriptionLevelPolicyAssignmentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "SummarizeForSubscriptionLevelPolicyAssignment", resp, "Failure sending request") + return + } + + result, err = client.SummarizeForSubscriptionLevelPolicyAssignmentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "SummarizeForSubscriptionLevelPolicyAssignment", resp, "Failure responding to request") + } + + return +} + +// SummarizeForSubscriptionLevelPolicyAssignmentPreparer prepares the SummarizeForSubscriptionLevelPolicyAssignment request. +func (client PolicyStatesClient) SummarizeForSubscriptionLevelPolicyAssignmentPreparer(ctx context.Context, subscriptionID string, policyAssignmentName string, top *int32, from *date.Time, toParameter *date.Time, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "authorizationNamespace": autorest.Encode("path", "Microsoft.Authorization"), + "policyAssignmentName": autorest.Encode("path", policyAssignmentName), + "policyStatesSummaryResource": autorest.Encode("path", "latest"), + "subscriptionId": autorest.Encode("path", subscriptionID), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if from != nil { + queryParameters["$from"] = autorest.Encode("query", *from) + } + if toParameter != nil { + queryParameters["$to"] = autorest.Encode("query", *toParameter) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SummarizeForSubscriptionLevelPolicyAssignmentSender sends the SummarizeForSubscriptionLevelPolicyAssignment request. The method will close the +// http.Response Body if it receives an error. +func (client PolicyStatesClient) SummarizeForSubscriptionLevelPolicyAssignmentSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// SummarizeForSubscriptionLevelPolicyAssignmentResponder handles the response to the SummarizeForSubscriptionLevelPolicyAssignment request. The method always +// closes the http.Response Body. +func (client PolicyStatesClient) SummarizeForSubscriptionLevelPolicyAssignmentResponder(resp *http.Response) (result SummarizeResults, 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/policyinsights/mgmt/2019-10-01/policyinsights/policytrackedresources.go b/services/policyinsights/mgmt/2019-10-01/policyinsights/policytrackedresources.go new file mode 100644 index 000000000000..cfcb71c32715 --- /dev/null +++ b/services/policyinsights/mgmt/2019-10-01/policyinsights/policytrackedresources.go @@ -0,0 +1,557 @@ +package policyinsights + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the 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" +) + +// PolicyTrackedResourcesClient is the client for the PolicyTrackedResources methods of the Policyinsights service. +type PolicyTrackedResourcesClient struct { + BaseClient +} + +// NewPolicyTrackedResourcesClient creates an instance of the PolicyTrackedResourcesClient client. +func NewPolicyTrackedResourcesClient() PolicyTrackedResourcesClient { + return NewPolicyTrackedResourcesClientWithBaseURI(DefaultBaseURI) +} + +// NewPolicyTrackedResourcesClientWithBaseURI creates an instance of the PolicyTrackedResourcesClient client. +func NewPolicyTrackedResourcesClientWithBaseURI(baseURI string) PolicyTrackedResourcesClient { + return PolicyTrackedResourcesClient{NewWithBaseURI(baseURI)} +} + +// ListQueryResultsForManagementGroup queries policy tracked resources under the management group. +// Parameters: +// managementGroupName - management group name. +// top - maximum number of records to return. +// filter - oData filter expression. +func (client PolicyTrackedResourcesClient) ListQueryResultsForManagementGroup(ctx context.Context, managementGroupName string, top *int32, filter string) (result PolicyTrackedResourcesQueryResultsPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyTrackedResourcesClient.ListQueryResultsForManagementGroup") + defer func() { + sc := -1 + if result.ptrqr.Response.Response != nil { + sc = result.ptrqr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("policyinsights.PolicyTrackedResourcesClient", "ListQueryResultsForManagementGroup", err.Error()) + } + + result.fn = client.listQueryResultsForManagementGroupNextResults + req, err := client.ListQueryResultsForManagementGroupPreparer(ctx, managementGroupName, top, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyTrackedResourcesClient", "ListQueryResultsForManagementGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListQueryResultsForManagementGroupSender(req) + if err != nil { + result.ptrqr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.PolicyTrackedResourcesClient", "ListQueryResultsForManagementGroup", resp, "Failure sending request") + return + } + + result.ptrqr, err = client.ListQueryResultsForManagementGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyTrackedResourcesClient", "ListQueryResultsForManagementGroup", resp, "Failure responding to request") + } + + return +} + +// ListQueryResultsForManagementGroupPreparer prepares the ListQueryResultsForManagementGroup request. +func (client PolicyTrackedResourcesClient) ListQueryResultsForManagementGroupPreparer(ctx context.Context, managementGroupName string, top *int32, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "managementGroupName": autorest.Encode("path", managementGroupName), + "managementGroupsNamespace": autorest.Encode("path", "Microsoft.Management"), + "policyTrackedResourcesResource": autorest.Encode("path", "default"), + } + + const APIVersion = "2018-07-01-preview" + 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.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/{managementGroupsNamespace}/managementGroups/{managementGroupName}/providers/Microsoft.PolicyInsights/policyTrackedResources/{policyTrackedResourcesResource}/queryResults", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListQueryResultsForManagementGroupSender sends the ListQueryResultsForManagementGroup request. The method will close the +// http.Response Body if it receives an error. +func (client PolicyTrackedResourcesClient) ListQueryResultsForManagementGroupSender(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...) +} + +// ListQueryResultsForManagementGroupResponder handles the response to the ListQueryResultsForManagementGroup request. The method always +// closes the http.Response Body. +func (client PolicyTrackedResourcesClient) ListQueryResultsForManagementGroupResponder(resp *http.Response) (result PolicyTrackedResourcesQueryResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listQueryResultsForManagementGroupNextResults retrieves the next set of results, if any. +func (client PolicyTrackedResourcesClient) listQueryResultsForManagementGroupNextResults(ctx context.Context, lastResults PolicyTrackedResourcesQueryResults) (result PolicyTrackedResourcesQueryResults, err error) { + req, err := lastResults.policyTrackedResourcesQueryResultsPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyTrackedResourcesClient", "listQueryResultsForManagementGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListQueryResultsForManagementGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyTrackedResourcesClient", "listQueryResultsForManagementGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListQueryResultsForManagementGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyTrackedResourcesClient", "listQueryResultsForManagementGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListQueryResultsForManagementGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client PolicyTrackedResourcesClient) ListQueryResultsForManagementGroupComplete(ctx context.Context, managementGroupName string, top *int32, filter string) (result PolicyTrackedResourcesQueryResultsIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyTrackedResourcesClient.ListQueryResultsForManagementGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListQueryResultsForManagementGroup(ctx, managementGroupName, top, filter) + return +} + +// ListQueryResultsForResource queries policy tracked resources under the resource. +// Parameters: +// resourceID - resource ID. +// top - maximum number of records to return. +// filter - oData filter expression. +func (client PolicyTrackedResourcesClient) ListQueryResultsForResource(ctx context.Context, resourceID string, top *int32, filter string) (result PolicyTrackedResourcesQueryResultsPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyTrackedResourcesClient.ListQueryResultsForResource") + defer func() { + sc := -1 + if result.ptrqr.Response.Response != nil { + sc = result.ptrqr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("policyinsights.PolicyTrackedResourcesClient", "ListQueryResultsForResource", err.Error()) + } + + result.fn = client.listQueryResultsForResourceNextResults + req, err := client.ListQueryResultsForResourcePreparer(ctx, resourceID, top, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyTrackedResourcesClient", "ListQueryResultsForResource", nil, "Failure preparing request") + return + } + + resp, err := client.ListQueryResultsForResourceSender(req) + if err != nil { + result.ptrqr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.PolicyTrackedResourcesClient", "ListQueryResultsForResource", resp, "Failure sending request") + return + } + + result.ptrqr, err = client.ListQueryResultsForResourceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyTrackedResourcesClient", "ListQueryResultsForResource", resp, "Failure responding to request") + } + + return +} + +// ListQueryResultsForResourcePreparer prepares the ListQueryResultsForResource request. +func (client PolicyTrackedResourcesClient) ListQueryResultsForResourcePreparer(ctx context.Context, resourceID string, top *int32, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyTrackedResourcesResource": autorest.Encode("path", "default"), + "resourceId": resourceID, + } + + const APIVersion = "2018-07-01-preview" + 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.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{resourceId}/providers/Microsoft.PolicyInsights/policyTrackedResources/{policyTrackedResourcesResource}/queryResults", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListQueryResultsForResourceSender sends the ListQueryResultsForResource request. The method will close the +// http.Response Body if it receives an error. +func (client PolicyTrackedResourcesClient) ListQueryResultsForResourceSender(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...) +} + +// ListQueryResultsForResourceResponder handles the response to the ListQueryResultsForResource request. The method always +// closes the http.Response Body. +func (client PolicyTrackedResourcesClient) ListQueryResultsForResourceResponder(resp *http.Response) (result PolicyTrackedResourcesQueryResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listQueryResultsForResourceNextResults retrieves the next set of results, if any. +func (client PolicyTrackedResourcesClient) listQueryResultsForResourceNextResults(ctx context.Context, lastResults PolicyTrackedResourcesQueryResults) (result PolicyTrackedResourcesQueryResults, err error) { + req, err := lastResults.policyTrackedResourcesQueryResultsPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyTrackedResourcesClient", "listQueryResultsForResourceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListQueryResultsForResourceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyTrackedResourcesClient", "listQueryResultsForResourceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListQueryResultsForResourceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyTrackedResourcesClient", "listQueryResultsForResourceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListQueryResultsForResourceComplete enumerates all values, automatically crossing page boundaries as required. +func (client PolicyTrackedResourcesClient) ListQueryResultsForResourceComplete(ctx context.Context, resourceID string, top *int32, filter string) (result PolicyTrackedResourcesQueryResultsIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyTrackedResourcesClient.ListQueryResultsForResource") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListQueryResultsForResource(ctx, resourceID, top, filter) + return +} + +// ListQueryResultsForResourceGroup queries policy tracked resources under the resource group. +// Parameters: +// resourceGroupName - resource group name. +// subscriptionID - microsoft Azure subscription ID. +// top - maximum number of records to return. +// filter - oData filter expression. +func (client PolicyTrackedResourcesClient) ListQueryResultsForResourceGroup(ctx context.Context, resourceGroupName string, subscriptionID string, top *int32, filter string) (result PolicyTrackedResourcesQueryResultsPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyTrackedResourcesClient.ListQueryResultsForResourceGroup") + defer func() { + sc := -1 + if result.ptrqr.Response.Response != nil { + sc = result.ptrqr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("policyinsights.PolicyTrackedResourcesClient", "ListQueryResultsForResourceGroup", err.Error()) + } + + result.fn = client.listQueryResultsForResourceGroupNextResults + req, err := client.ListQueryResultsForResourceGroupPreparer(ctx, resourceGroupName, subscriptionID, top, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyTrackedResourcesClient", "ListQueryResultsForResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListQueryResultsForResourceGroupSender(req) + if err != nil { + result.ptrqr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.PolicyTrackedResourcesClient", "ListQueryResultsForResourceGroup", resp, "Failure sending request") + return + } + + result.ptrqr, err = client.ListQueryResultsForResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyTrackedResourcesClient", "ListQueryResultsForResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListQueryResultsForResourceGroupPreparer prepares the ListQueryResultsForResourceGroup request. +func (client PolicyTrackedResourcesClient) ListQueryResultsForResourceGroupPreparer(ctx context.Context, resourceGroupName string, subscriptionID string, top *int32, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyTrackedResourcesResource": autorest.Encode("path", "default"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", subscriptionID), + } + + const APIVersion = "2018-07-01-preview" + 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.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyTrackedResources/{policyTrackedResourcesResource}/queryResults", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListQueryResultsForResourceGroupSender sends the ListQueryResultsForResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client PolicyTrackedResourcesClient) ListQueryResultsForResourceGroupSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListQueryResultsForResourceGroupResponder handles the response to the ListQueryResultsForResourceGroup request. The method always +// closes the http.Response Body. +func (client PolicyTrackedResourcesClient) ListQueryResultsForResourceGroupResponder(resp *http.Response) (result PolicyTrackedResourcesQueryResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listQueryResultsForResourceGroupNextResults retrieves the next set of results, if any. +func (client PolicyTrackedResourcesClient) listQueryResultsForResourceGroupNextResults(ctx context.Context, lastResults PolicyTrackedResourcesQueryResults) (result PolicyTrackedResourcesQueryResults, err error) { + req, err := lastResults.policyTrackedResourcesQueryResultsPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyTrackedResourcesClient", "listQueryResultsForResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListQueryResultsForResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyTrackedResourcesClient", "listQueryResultsForResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListQueryResultsForResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyTrackedResourcesClient", "listQueryResultsForResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListQueryResultsForResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client PolicyTrackedResourcesClient) ListQueryResultsForResourceGroupComplete(ctx context.Context, resourceGroupName string, subscriptionID string, top *int32, filter string) (result PolicyTrackedResourcesQueryResultsIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyTrackedResourcesClient.ListQueryResultsForResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListQueryResultsForResourceGroup(ctx, resourceGroupName, subscriptionID, top, filter) + return +} + +// ListQueryResultsForSubscription queries policy tracked resources under the subscription. +// Parameters: +// subscriptionID - microsoft Azure subscription ID. +// top - maximum number of records to return. +// filter - oData filter expression. +func (client PolicyTrackedResourcesClient) ListQueryResultsForSubscription(ctx context.Context, subscriptionID string, top *int32, filter string) (result PolicyTrackedResourcesQueryResultsPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyTrackedResourcesClient.ListQueryResultsForSubscription") + defer func() { + sc := -1 + if result.ptrqr.Response.Response != nil { + sc = result.ptrqr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("policyinsights.PolicyTrackedResourcesClient", "ListQueryResultsForSubscription", err.Error()) + } + + result.fn = client.listQueryResultsForSubscriptionNextResults + req, err := client.ListQueryResultsForSubscriptionPreparer(ctx, subscriptionID, top, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyTrackedResourcesClient", "ListQueryResultsForSubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListQueryResultsForSubscriptionSender(req) + if err != nil { + result.ptrqr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.PolicyTrackedResourcesClient", "ListQueryResultsForSubscription", resp, "Failure sending request") + return + } + + result.ptrqr, err = client.ListQueryResultsForSubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyTrackedResourcesClient", "ListQueryResultsForSubscription", resp, "Failure responding to request") + } + + return +} + +// ListQueryResultsForSubscriptionPreparer prepares the ListQueryResultsForSubscription request. +func (client PolicyTrackedResourcesClient) ListQueryResultsForSubscriptionPreparer(ctx context.Context, subscriptionID string, top *int32, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyTrackedResourcesResource": autorest.Encode("path", "default"), + "subscriptionId": autorest.Encode("path", subscriptionID), + } + + const APIVersion = "2018-07-01-preview" + 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.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyTrackedResources/{policyTrackedResourcesResource}/queryResults", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListQueryResultsForSubscriptionSender sends the ListQueryResultsForSubscription request. The method will close the +// http.Response Body if it receives an error. +func (client PolicyTrackedResourcesClient) ListQueryResultsForSubscriptionSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListQueryResultsForSubscriptionResponder handles the response to the ListQueryResultsForSubscription request. The method always +// closes the http.Response Body. +func (client PolicyTrackedResourcesClient) ListQueryResultsForSubscriptionResponder(resp *http.Response) (result PolicyTrackedResourcesQueryResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listQueryResultsForSubscriptionNextResults retrieves the next set of results, if any. +func (client PolicyTrackedResourcesClient) listQueryResultsForSubscriptionNextResults(ctx context.Context, lastResults PolicyTrackedResourcesQueryResults) (result PolicyTrackedResourcesQueryResults, err error) { + req, err := lastResults.policyTrackedResourcesQueryResultsPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyTrackedResourcesClient", "listQueryResultsForSubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListQueryResultsForSubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyTrackedResourcesClient", "listQueryResultsForSubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListQueryResultsForSubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyTrackedResourcesClient", "listQueryResultsForSubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListQueryResultsForSubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client PolicyTrackedResourcesClient) ListQueryResultsForSubscriptionComplete(ctx context.Context, subscriptionID string, top *int32, filter string) (result PolicyTrackedResourcesQueryResultsIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyTrackedResourcesClient.ListQueryResultsForSubscription") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListQueryResultsForSubscription(ctx, subscriptionID, top, filter) + return +} diff --git a/services/policyinsights/mgmt/2019-10-01/policyinsights/remediations.go b/services/policyinsights/mgmt/2019-10-01/policyinsights/remediations.go new file mode 100644 index 000000000000..84f777ab2c87 --- /dev/null +++ b/services/policyinsights/mgmt/2019-10-01/policyinsights/remediations.go @@ -0,0 +1,2308 @@ +package policyinsights + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the 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" +) + +// RemediationsClient is the client for the Remediations methods of the Policyinsights service. +type RemediationsClient struct { + BaseClient +} + +// NewRemediationsClient creates an instance of the RemediationsClient client. +func NewRemediationsClient() RemediationsClient { + return NewRemediationsClientWithBaseURI(DefaultBaseURI) +} + +// NewRemediationsClientWithBaseURI creates an instance of the RemediationsClient client. +func NewRemediationsClientWithBaseURI(baseURI string) RemediationsClient { + return RemediationsClient{NewWithBaseURI(baseURI)} +} + +// CancelAtManagementGroup cancels a remediation at management group scope. +// Parameters: +// managementGroupID - management group ID. +// remediationName - the name of the remediation. +func (client RemediationsClient) CancelAtManagementGroup(ctx context.Context, managementGroupID string, remediationName string) (result Remediation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemediationsClient.CancelAtManagementGroup") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CancelAtManagementGroupPreparer(ctx, managementGroupID, remediationName) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "CancelAtManagementGroup", nil, "Failure preparing request") + return + } + + resp, err := client.CancelAtManagementGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "CancelAtManagementGroup", resp, "Failure sending request") + return + } + + result, err = client.CancelAtManagementGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "CancelAtManagementGroup", resp, "Failure responding to request") + } + + return +} + +// CancelAtManagementGroupPreparer prepares the CancelAtManagementGroup request. +func (client RemediationsClient) CancelAtManagementGroupPreparer(ctx context.Context, managementGroupID string, remediationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "managementGroupId": autorest.Encode("path", managementGroupID), + "managementGroupsNamespace": autorest.Encode("path", "Microsoft.Management"), + "remediationName": autorest.Encode("path", remediationName), + } + + const APIVersion = "2018-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/{managementGroupsNamespace}/managementGroups/{managementGroupId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/cancel", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CancelAtManagementGroupSender sends the CancelAtManagementGroup request. The method will close the +// http.Response Body if it receives an error. +func (client RemediationsClient) CancelAtManagementGroupSender(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...) +} + +// CancelAtManagementGroupResponder handles the response to the CancelAtManagementGroup request. The method always +// closes the http.Response Body. +func (client RemediationsClient) CancelAtManagementGroupResponder(resp *http.Response) (result Remediation, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CancelAtResource cancel a remediation at resource scope. +// Parameters: +// resourceID - resource ID. +// remediationName - the name of the remediation. +func (client RemediationsClient) CancelAtResource(ctx context.Context, resourceID string, remediationName string) (result Remediation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemediationsClient.CancelAtResource") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CancelAtResourcePreparer(ctx, resourceID, remediationName) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "CancelAtResource", nil, "Failure preparing request") + return + } + + resp, err := client.CancelAtResourceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "CancelAtResource", resp, "Failure sending request") + return + } + + result, err = client.CancelAtResourceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "CancelAtResource", resp, "Failure responding to request") + } + + return +} + +// CancelAtResourcePreparer prepares the CancelAtResource request. +func (client RemediationsClient) CancelAtResourcePreparer(ctx context.Context, resourceID string, remediationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "remediationName": autorest.Encode("path", remediationName), + "resourceId": resourceID, + } + + const APIVersion = "2018-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{resourceId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/cancel", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CancelAtResourceSender sends the CancelAtResource request. The method will close the +// http.Response Body if it receives an error. +func (client RemediationsClient) CancelAtResourceSender(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...) +} + +// CancelAtResourceResponder handles the response to the CancelAtResource request. The method always +// closes the http.Response Body. +func (client RemediationsClient) CancelAtResourceResponder(resp *http.Response) (result Remediation, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CancelAtResourceGroup cancels a remediation at resource group scope. +// Parameters: +// subscriptionID - microsoft Azure subscription ID. +// resourceGroupName - resource group name. +// remediationName - the name of the remediation. +func (client RemediationsClient) CancelAtResourceGroup(ctx context.Context, subscriptionID string, resourceGroupName string, remediationName string) (result Remediation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemediationsClient.CancelAtResourceGroup") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CancelAtResourceGroupPreparer(ctx, subscriptionID, resourceGroupName, remediationName) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "CancelAtResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.CancelAtResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "CancelAtResourceGroup", resp, "Failure sending request") + return + } + + result, err = client.CancelAtResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "CancelAtResourceGroup", resp, "Failure responding to request") + } + + return +} + +// CancelAtResourceGroupPreparer prepares the CancelAtResourceGroup request. +func (client RemediationsClient) CancelAtResourceGroupPreparer(ctx context.Context, subscriptionID string, resourceGroupName string, remediationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "remediationName": autorest.Encode("path", remediationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", subscriptionID), + } + + const APIVersion = "2018-07-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.PolicyInsights/remediations/{remediationName}/cancel", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CancelAtResourceGroupSender sends the CancelAtResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client RemediationsClient) CancelAtResourceGroupSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// CancelAtResourceGroupResponder handles the response to the CancelAtResourceGroup request. The method always +// closes the http.Response Body. +func (client RemediationsClient) CancelAtResourceGroupResponder(resp *http.Response) (result Remediation, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CancelAtSubscription cancels a remediation at subscription scope. +// Parameters: +// subscriptionID - microsoft Azure subscription ID. +// remediationName - the name of the remediation. +func (client RemediationsClient) CancelAtSubscription(ctx context.Context, subscriptionID string, remediationName string) (result Remediation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemediationsClient.CancelAtSubscription") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CancelAtSubscriptionPreparer(ctx, subscriptionID, remediationName) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "CancelAtSubscription", nil, "Failure preparing request") + return + } + + resp, err := client.CancelAtSubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "CancelAtSubscription", resp, "Failure sending request") + return + } + + result, err = client.CancelAtSubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "CancelAtSubscription", resp, "Failure responding to request") + } + + return +} + +// CancelAtSubscriptionPreparer prepares the CancelAtSubscription request. +func (client RemediationsClient) CancelAtSubscriptionPreparer(ctx context.Context, subscriptionID string, remediationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "remediationName": autorest.Encode("path", remediationName), + "subscriptionId": autorest.Encode("path", subscriptionID), + } + + const APIVersion = "2018-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/cancel", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CancelAtSubscriptionSender sends the CancelAtSubscription request. The method will close the +// http.Response Body if it receives an error. +func (client RemediationsClient) CancelAtSubscriptionSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// CancelAtSubscriptionResponder handles the response to the CancelAtSubscription request. The method always +// closes the http.Response Body. +func (client RemediationsClient) CancelAtSubscriptionResponder(resp *http.Response) (result Remediation, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateAtManagementGroup creates or updates a remediation at management group scope. +// Parameters: +// managementGroupID - management group ID. +// remediationName - the name of the remediation. +// parameters - the remediation parameters. +func (client RemediationsClient) CreateOrUpdateAtManagementGroup(ctx context.Context, managementGroupID string, remediationName string, parameters Remediation) (result Remediation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemediationsClient.CreateOrUpdateAtManagementGroup") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdateAtManagementGroupPreparer(ctx, managementGroupID, remediationName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "CreateOrUpdateAtManagementGroup", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateAtManagementGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "CreateOrUpdateAtManagementGroup", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateAtManagementGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "CreateOrUpdateAtManagementGroup", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdateAtManagementGroupPreparer prepares the CreateOrUpdateAtManagementGroup request. +func (client RemediationsClient) CreateOrUpdateAtManagementGroupPreparer(ctx context.Context, managementGroupID string, remediationName string, parameters Remediation) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "managementGroupId": autorest.Encode("path", managementGroupID), + "managementGroupsNamespace": autorest.Encode("path", "Microsoft.Management"), + "remediationName": autorest.Encode("path", remediationName), + } + + const APIVersion = "2018-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + parameters.ID = nil + parameters.Type = nil + parameters.Name = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/{managementGroupsNamespace}/managementGroups/{managementGroupId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateAtManagementGroupSender sends the CreateOrUpdateAtManagementGroup request. The method will close the +// http.Response Body if it receives an error. +func (client RemediationsClient) CreateOrUpdateAtManagementGroupSender(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...) +} + +// CreateOrUpdateAtManagementGroupResponder handles the response to the CreateOrUpdateAtManagementGroup request. The method always +// closes the http.Response Body. +func (client RemediationsClient) CreateOrUpdateAtManagementGroupResponder(resp *http.Response) (result Remediation, 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 +} + +// CreateOrUpdateAtResource creates or updates a remediation at resource scope. +// Parameters: +// resourceID - resource ID. +// remediationName - the name of the remediation. +// parameters - the remediation parameters. +func (client RemediationsClient) CreateOrUpdateAtResource(ctx context.Context, resourceID string, remediationName string, parameters Remediation) (result Remediation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemediationsClient.CreateOrUpdateAtResource") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdateAtResourcePreparer(ctx, resourceID, remediationName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "CreateOrUpdateAtResource", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateAtResourceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "CreateOrUpdateAtResource", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateAtResourceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "CreateOrUpdateAtResource", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdateAtResourcePreparer prepares the CreateOrUpdateAtResource request. +func (client RemediationsClient) CreateOrUpdateAtResourcePreparer(ctx context.Context, resourceID string, remediationName string, parameters Remediation) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "remediationName": autorest.Encode("path", remediationName), + "resourceId": resourceID, + } + + const APIVersion = "2018-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + parameters.ID = nil + parameters.Type = nil + parameters.Name = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{resourceId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateAtResourceSender sends the CreateOrUpdateAtResource request. The method will close the +// http.Response Body if it receives an error. +func (client RemediationsClient) CreateOrUpdateAtResourceSender(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...) +} + +// CreateOrUpdateAtResourceResponder handles the response to the CreateOrUpdateAtResource request. The method always +// closes the http.Response Body. +func (client RemediationsClient) CreateOrUpdateAtResourceResponder(resp *http.Response) (result Remediation, 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 +} + +// CreateOrUpdateAtResourceGroup creates or updates a remediation at resource group scope. +// Parameters: +// subscriptionID - microsoft Azure subscription ID. +// resourceGroupName - resource group name. +// remediationName - the name of the remediation. +// parameters - the remediation parameters. +func (client RemediationsClient) CreateOrUpdateAtResourceGroup(ctx context.Context, subscriptionID string, resourceGroupName string, remediationName string, parameters Remediation) (result Remediation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemediationsClient.CreateOrUpdateAtResourceGroup") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdateAtResourceGroupPreparer(ctx, subscriptionID, resourceGroupName, remediationName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "CreateOrUpdateAtResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateAtResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "CreateOrUpdateAtResourceGroup", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateAtResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "CreateOrUpdateAtResourceGroup", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdateAtResourceGroupPreparer prepares the CreateOrUpdateAtResourceGroup request. +func (client RemediationsClient) CreateOrUpdateAtResourceGroupPreparer(ctx context.Context, subscriptionID string, resourceGroupName string, remediationName string, parameters Remediation) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "remediationName": autorest.Encode("path", remediationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", subscriptionID), + } + + const APIVersion = "2018-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + parameters.ID = nil + parameters.Type = nil + parameters.Name = 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.PolicyInsights/remediations/{remediationName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateAtResourceGroupSender sends the CreateOrUpdateAtResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client RemediationsClient) CreateOrUpdateAtResourceGroupSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// CreateOrUpdateAtResourceGroupResponder handles the response to the CreateOrUpdateAtResourceGroup request. The method always +// closes the http.Response Body. +func (client RemediationsClient) CreateOrUpdateAtResourceGroupResponder(resp *http.Response) (result Remediation, 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 +} + +// CreateOrUpdateAtSubscription creates or updates a remediation at subscription scope. +// Parameters: +// subscriptionID - microsoft Azure subscription ID. +// remediationName - the name of the remediation. +// parameters - the remediation parameters. +func (client RemediationsClient) CreateOrUpdateAtSubscription(ctx context.Context, subscriptionID string, remediationName string, parameters Remediation) (result Remediation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemediationsClient.CreateOrUpdateAtSubscription") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdateAtSubscriptionPreparer(ctx, subscriptionID, remediationName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "CreateOrUpdateAtSubscription", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateAtSubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "CreateOrUpdateAtSubscription", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateAtSubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "CreateOrUpdateAtSubscription", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdateAtSubscriptionPreparer prepares the CreateOrUpdateAtSubscription request. +func (client RemediationsClient) CreateOrUpdateAtSubscriptionPreparer(ctx context.Context, subscriptionID string, remediationName string, parameters Remediation) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "remediationName": autorest.Encode("path", remediationName), + "subscriptionId": autorest.Encode("path", subscriptionID), + } + + const APIVersion = "2018-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + parameters.ID = nil + parameters.Type = nil + parameters.Name = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateAtSubscriptionSender sends the CreateOrUpdateAtSubscription request. The method will close the +// http.Response Body if it receives an error. +func (client RemediationsClient) CreateOrUpdateAtSubscriptionSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// CreateOrUpdateAtSubscriptionResponder handles the response to the CreateOrUpdateAtSubscription request. The method always +// closes the http.Response Body. +func (client RemediationsClient) CreateOrUpdateAtSubscriptionResponder(resp *http.Response) (result Remediation, 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 +} + +// DeleteAtManagementGroup deletes an existing remediation at management group scope. +// Parameters: +// managementGroupID - management group ID. +// remediationName - the name of the remediation. +func (client RemediationsClient) DeleteAtManagementGroup(ctx context.Context, managementGroupID string, remediationName string) (result Remediation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemediationsClient.DeleteAtManagementGroup") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeleteAtManagementGroupPreparer(ctx, managementGroupID, remediationName) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "DeleteAtManagementGroup", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteAtManagementGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "DeleteAtManagementGroup", resp, "Failure sending request") + return + } + + result, err = client.DeleteAtManagementGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "DeleteAtManagementGroup", resp, "Failure responding to request") + } + + return +} + +// DeleteAtManagementGroupPreparer prepares the DeleteAtManagementGroup request. +func (client RemediationsClient) DeleteAtManagementGroupPreparer(ctx context.Context, managementGroupID string, remediationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "managementGroupId": autorest.Encode("path", managementGroupID), + "managementGroupsNamespace": autorest.Encode("path", "Microsoft.Management"), + "remediationName": autorest.Encode("path", remediationName), + } + + const APIVersion = "2018-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/{managementGroupsNamespace}/managementGroups/{managementGroupId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteAtManagementGroupSender sends the DeleteAtManagementGroup request. The method will close the +// http.Response Body if it receives an error. +func (client RemediationsClient) DeleteAtManagementGroupSender(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...) +} + +// DeleteAtManagementGroupResponder handles the response to the DeleteAtManagementGroup request. The method always +// closes the http.Response Body. +func (client RemediationsClient) DeleteAtManagementGroupResponder(resp *http.Response) (result Remediation, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DeleteAtResource deletes an existing remediation at individual resource scope. +// Parameters: +// resourceID - resource ID. +// remediationName - the name of the remediation. +func (client RemediationsClient) DeleteAtResource(ctx context.Context, resourceID string, remediationName string) (result Remediation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemediationsClient.DeleteAtResource") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeleteAtResourcePreparer(ctx, resourceID, remediationName) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "DeleteAtResource", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteAtResourceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "DeleteAtResource", resp, "Failure sending request") + return + } + + result, err = client.DeleteAtResourceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "DeleteAtResource", resp, "Failure responding to request") + } + + return +} + +// DeleteAtResourcePreparer prepares the DeleteAtResource request. +func (client RemediationsClient) DeleteAtResourcePreparer(ctx context.Context, resourceID string, remediationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "remediationName": autorest.Encode("path", remediationName), + "resourceId": resourceID, + } + + const APIVersion = "2018-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{resourceId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteAtResourceSender sends the DeleteAtResource request. The method will close the +// http.Response Body if it receives an error. +func (client RemediationsClient) DeleteAtResourceSender(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...) +} + +// DeleteAtResourceResponder handles the response to the DeleteAtResource request. The method always +// closes the http.Response Body. +func (client RemediationsClient) DeleteAtResourceResponder(resp *http.Response) (result Remediation, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DeleteAtResourceGroup deletes an existing remediation at resource group scope. +// Parameters: +// subscriptionID - microsoft Azure subscription ID. +// resourceGroupName - resource group name. +// remediationName - the name of the remediation. +func (client RemediationsClient) DeleteAtResourceGroup(ctx context.Context, subscriptionID string, resourceGroupName string, remediationName string) (result Remediation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemediationsClient.DeleteAtResourceGroup") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeleteAtResourceGroupPreparer(ctx, subscriptionID, resourceGroupName, remediationName) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "DeleteAtResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteAtResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "DeleteAtResourceGroup", resp, "Failure sending request") + return + } + + result, err = client.DeleteAtResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "DeleteAtResourceGroup", resp, "Failure responding to request") + } + + return +} + +// DeleteAtResourceGroupPreparer prepares the DeleteAtResourceGroup request. +func (client RemediationsClient) DeleteAtResourceGroupPreparer(ctx context.Context, subscriptionID string, resourceGroupName string, remediationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "remediationName": autorest.Encode("path", remediationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", subscriptionID), + } + + const APIVersion = "2018-07-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.PolicyInsights/remediations/{remediationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteAtResourceGroupSender sends the DeleteAtResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client RemediationsClient) DeleteAtResourceGroupSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// DeleteAtResourceGroupResponder handles the response to the DeleteAtResourceGroup request. The method always +// closes the http.Response Body. +func (client RemediationsClient) DeleteAtResourceGroupResponder(resp *http.Response) (result Remediation, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DeleteAtSubscription deletes an existing remediation at subscription scope. +// Parameters: +// subscriptionID - microsoft Azure subscription ID. +// remediationName - the name of the remediation. +func (client RemediationsClient) DeleteAtSubscription(ctx context.Context, subscriptionID string, remediationName string) (result Remediation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemediationsClient.DeleteAtSubscription") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeleteAtSubscriptionPreparer(ctx, subscriptionID, remediationName) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "DeleteAtSubscription", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteAtSubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "DeleteAtSubscription", resp, "Failure sending request") + return + } + + result, err = client.DeleteAtSubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "DeleteAtSubscription", resp, "Failure responding to request") + } + + return +} + +// DeleteAtSubscriptionPreparer prepares the DeleteAtSubscription request. +func (client RemediationsClient) DeleteAtSubscriptionPreparer(ctx context.Context, subscriptionID string, remediationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "remediationName": autorest.Encode("path", remediationName), + "subscriptionId": autorest.Encode("path", subscriptionID), + } + + const APIVersion = "2018-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteAtSubscriptionSender sends the DeleteAtSubscription request. The method will close the +// http.Response Body if it receives an error. +func (client RemediationsClient) DeleteAtSubscriptionSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// DeleteAtSubscriptionResponder handles the response to the DeleteAtSubscription request. The method always +// closes the http.Response Body. +func (client RemediationsClient) DeleteAtSubscriptionResponder(resp *http.Response) (result Remediation, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetAtManagementGroup gets an existing remediation at management group scope. +// Parameters: +// managementGroupID - management group ID. +// remediationName - the name of the remediation. +func (client RemediationsClient) GetAtManagementGroup(ctx context.Context, managementGroupID string, remediationName string) (result Remediation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemediationsClient.GetAtManagementGroup") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetAtManagementGroupPreparer(ctx, managementGroupID, remediationName) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "GetAtManagementGroup", nil, "Failure preparing request") + return + } + + resp, err := client.GetAtManagementGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "GetAtManagementGroup", resp, "Failure sending request") + return + } + + result, err = client.GetAtManagementGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "GetAtManagementGroup", resp, "Failure responding to request") + } + + return +} + +// GetAtManagementGroupPreparer prepares the GetAtManagementGroup request. +func (client RemediationsClient) GetAtManagementGroupPreparer(ctx context.Context, managementGroupID string, remediationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "managementGroupId": autorest.Encode("path", managementGroupID), + "managementGroupsNamespace": autorest.Encode("path", "Microsoft.Management"), + "remediationName": autorest.Encode("path", remediationName), + } + + const APIVersion = "2018-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/{managementGroupsNamespace}/managementGroups/{managementGroupId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetAtManagementGroupSender sends the GetAtManagementGroup request. The method will close the +// http.Response Body if it receives an error. +func (client RemediationsClient) GetAtManagementGroupSender(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...) +} + +// GetAtManagementGroupResponder handles the response to the GetAtManagementGroup request. The method always +// closes the http.Response Body. +func (client RemediationsClient) GetAtManagementGroupResponder(resp *http.Response) (result Remediation, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetAtResource gets an existing remediation at resource scope. +// Parameters: +// resourceID - resource ID. +// remediationName - the name of the remediation. +func (client RemediationsClient) GetAtResource(ctx context.Context, resourceID string, remediationName string) (result Remediation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemediationsClient.GetAtResource") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetAtResourcePreparer(ctx, resourceID, remediationName) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "GetAtResource", nil, "Failure preparing request") + return + } + + resp, err := client.GetAtResourceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "GetAtResource", resp, "Failure sending request") + return + } + + result, err = client.GetAtResourceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "GetAtResource", resp, "Failure responding to request") + } + + return +} + +// GetAtResourcePreparer prepares the GetAtResource request. +func (client RemediationsClient) GetAtResourcePreparer(ctx context.Context, resourceID string, remediationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "remediationName": autorest.Encode("path", remediationName), + "resourceId": resourceID, + } + + const APIVersion = "2018-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{resourceId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetAtResourceSender sends the GetAtResource request. The method will close the +// http.Response Body if it receives an error. +func (client RemediationsClient) GetAtResourceSender(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...) +} + +// GetAtResourceResponder handles the response to the GetAtResource request. The method always +// closes the http.Response Body. +func (client RemediationsClient) GetAtResourceResponder(resp *http.Response) (result Remediation, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetAtResourceGroup gets an existing remediation at resource group scope. +// Parameters: +// subscriptionID - microsoft Azure subscription ID. +// resourceGroupName - resource group name. +// remediationName - the name of the remediation. +func (client RemediationsClient) GetAtResourceGroup(ctx context.Context, subscriptionID string, resourceGroupName string, remediationName string) (result Remediation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemediationsClient.GetAtResourceGroup") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetAtResourceGroupPreparer(ctx, subscriptionID, resourceGroupName, remediationName) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "GetAtResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.GetAtResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "GetAtResourceGroup", resp, "Failure sending request") + return + } + + result, err = client.GetAtResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "GetAtResourceGroup", resp, "Failure responding to request") + } + + return +} + +// GetAtResourceGroupPreparer prepares the GetAtResourceGroup request. +func (client RemediationsClient) GetAtResourceGroupPreparer(ctx context.Context, subscriptionID string, resourceGroupName string, remediationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "remediationName": autorest.Encode("path", remediationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", subscriptionID), + } + + const APIVersion = "2018-07-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.PolicyInsights/remediations/{remediationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetAtResourceGroupSender sends the GetAtResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client RemediationsClient) GetAtResourceGroupSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetAtResourceGroupResponder handles the response to the GetAtResourceGroup request. The method always +// closes the http.Response Body. +func (client RemediationsClient) GetAtResourceGroupResponder(resp *http.Response) (result Remediation, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetAtSubscription gets an existing remediation at subscription scope. +// Parameters: +// subscriptionID - microsoft Azure subscription ID. +// remediationName - the name of the remediation. +func (client RemediationsClient) GetAtSubscription(ctx context.Context, subscriptionID string, remediationName string) (result Remediation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemediationsClient.GetAtSubscription") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetAtSubscriptionPreparer(ctx, subscriptionID, remediationName) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "GetAtSubscription", nil, "Failure preparing request") + return + } + + resp, err := client.GetAtSubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "GetAtSubscription", resp, "Failure sending request") + return + } + + result, err = client.GetAtSubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "GetAtSubscription", resp, "Failure responding to request") + } + + return +} + +// GetAtSubscriptionPreparer prepares the GetAtSubscription request. +func (client RemediationsClient) GetAtSubscriptionPreparer(ctx context.Context, subscriptionID string, remediationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "remediationName": autorest.Encode("path", remediationName), + "subscriptionId": autorest.Encode("path", subscriptionID), + } + + const APIVersion = "2018-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetAtSubscriptionSender sends the GetAtSubscription request. The method will close the +// http.Response Body if it receives an error. +func (client RemediationsClient) GetAtSubscriptionSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetAtSubscriptionResponder handles the response to the GetAtSubscription request. The method always +// closes the http.Response Body. +func (client RemediationsClient) GetAtSubscriptionResponder(resp *http.Response) (result Remediation, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListDeploymentsAtManagementGroup gets all deployments for a remediation at management group scope. +// Parameters: +// managementGroupID - management group ID. +// remediationName - the name of the remediation. +// top - maximum number of records to return. +func (client RemediationsClient) ListDeploymentsAtManagementGroup(ctx context.Context, managementGroupID string, remediationName string, top *int32) (result RemediationDeploymentsListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemediationsClient.ListDeploymentsAtManagementGroup") + defer func() { + sc := -1 + if result.rdlr.Response.Response != nil { + sc = result.rdlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("policyinsights.RemediationsClient", "ListDeploymentsAtManagementGroup", err.Error()) + } + + result.fn = client.listDeploymentsAtManagementGroupNextResults + req, err := client.ListDeploymentsAtManagementGroupPreparer(ctx, managementGroupID, remediationName, top) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "ListDeploymentsAtManagementGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListDeploymentsAtManagementGroupSender(req) + if err != nil { + result.rdlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "ListDeploymentsAtManagementGroup", resp, "Failure sending request") + return + } + + result.rdlr, err = client.ListDeploymentsAtManagementGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "ListDeploymentsAtManagementGroup", resp, "Failure responding to request") + } + + return +} + +// ListDeploymentsAtManagementGroupPreparer prepares the ListDeploymentsAtManagementGroup request. +func (client RemediationsClient) ListDeploymentsAtManagementGroupPreparer(ctx context.Context, managementGroupID string, remediationName string, top *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "managementGroupId": autorest.Encode("path", managementGroupID), + "managementGroupsNamespace": autorest.Encode("path", "Microsoft.Management"), + "remediationName": autorest.Encode("path", remediationName), + } + + const APIVersion = "2018-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/{managementGroupsNamespace}/managementGroups/{managementGroupId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/listDeployments", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListDeploymentsAtManagementGroupSender sends the ListDeploymentsAtManagementGroup request. The method will close the +// http.Response Body if it receives an error. +func (client RemediationsClient) ListDeploymentsAtManagementGroupSender(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...) +} + +// ListDeploymentsAtManagementGroupResponder handles the response to the ListDeploymentsAtManagementGroup request. The method always +// closes the http.Response Body. +func (client RemediationsClient) ListDeploymentsAtManagementGroupResponder(resp *http.Response) (result RemediationDeploymentsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listDeploymentsAtManagementGroupNextResults retrieves the next set of results, if any. +func (client RemediationsClient) listDeploymentsAtManagementGroupNextResults(ctx context.Context, lastResults RemediationDeploymentsListResult) (result RemediationDeploymentsListResult, err error) { + req, err := lastResults.remediationDeploymentsListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "listDeploymentsAtManagementGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListDeploymentsAtManagementGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "listDeploymentsAtManagementGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListDeploymentsAtManagementGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "listDeploymentsAtManagementGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListDeploymentsAtManagementGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client RemediationsClient) ListDeploymentsAtManagementGroupComplete(ctx context.Context, managementGroupID string, remediationName string, top *int32) (result RemediationDeploymentsListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemediationsClient.ListDeploymentsAtManagementGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListDeploymentsAtManagementGroup(ctx, managementGroupID, remediationName, top) + return +} + +// ListDeploymentsAtResource gets all deployments for a remediation at resource scope. +// Parameters: +// resourceID - resource ID. +// remediationName - the name of the remediation. +// top - maximum number of records to return. +func (client RemediationsClient) ListDeploymentsAtResource(ctx context.Context, resourceID string, remediationName string, top *int32) (result RemediationDeploymentsListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemediationsClient.ListDeploymentsAtResource") + defer func() { + sc := -1 + if result.rdlr.Response.Response != nil { + sc = result.rdlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("policyinsights.RemediationsClient", "ListDeploymentsAtResource", err.Error()) + } + + result.fn = client.listDeploymentsAtResourceNextResults + req, err := client.ListDeploymentsAtResourcePreparer(ctx, resourceID, remediationName, top) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "ListDeploymentsAtResource", nil, "Failure preparing request") + return + } + + resp, err := client.ListDeploymentsAtResourceSender(req) + if err != nil { + result.rdlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "ListDeploymentsAtResource", resp, "Failure sending request") + return + } + + result.rdlr, err = client.ListDeploymentsAtResourceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "ListDeploymentsAtResource", resp, "Failure responding to request") + } + + return +} + +// ListDeploymentsAtResourcePreparer prepares the ListDeploymentsAtResource request. +func (client RemediationsClient) ListDeploymentsAtResourcePreparer(ctx context.Context, resourceID string, remediationName string, top *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "remediationName": autorest.Encode("path", remediationName), + "resourceId": resourceID, + } + + const APIVersion = "2018-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{resourceId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/listDeployments", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListDeploymentsAtResourceSender sends the ListDeploymentsAtResource request. The method will close the +// http.Response Body if it receives an error. +func (client RemediationsClient) ListDeploymentsAtResourceSender(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...) +} + +// ListDeploymentsAtResourceResponder handles the response to the ListDeploymentsAtResource request. The method always +// closes the http.Response Body. +func (client RemediationsClient) ListDeploymentsAtResourceResponder(resp *http.Response) (result RemediationDeploymentsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listDeploymentsAtResourceNextResults retrieves the next set of results, if any. +func (client RemediationsClient) listDeploymentsAtResourceNextResults(ctx context.Context, lastResults RemediationDeploymentsListResult) (result RemediationDeploymentsListResult, err error) { + req, err := lastResults.remediationDeploymentsListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "listDeploymentsAtResourceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListDeploymentsAtResourceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "listDeploymentsAtResourceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListDeploymentsAtResourceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "listDeploymentsAtResourceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListDeploymentsAtResourceComplete enumerates all values, automatically crossing page boundaries as required. +func (client RemediationsClient) ListDeploymentsAtResourceComplete(ctx context.Context, resourceID string, remediationName string, top *int32) (result RemediationDeploymentsListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemediationsClient.ListDeploymentsAtResource") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListDeploymentsAtResource(ctx, resourceID, remediationName, top) + return +} + +// ListDeploymentsAtResourceGroup gets all deployments for a remediation at resource group scope. +// Parameters: +// subscriptionID - microsoft Azure subscription ID. +// resourceGroupName - resource group name. +// remediationName - the name of the remediation. +// top - maximum number of records to return. +func (client RemediationsClient) ListDeploymentsAtResourceGroup(ctx context.Context, subscriptionID string, resourceGroupName string, remediationName string, top *int32) (result RemediationDeploymentsListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemediationsClient.ListDeploymentsAtResourceGroup") + defer func() { + sc := -1 + if result.rdlr.Response.Response != nil { + sc = result.rdlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("policyinsights.RemediationsClient", "ListDeploymentsAtResourceGroup", err.Error()) + } + + result.fn = client.listDeploymentsAtResourceGroupNextResults + req, err := client.ListDeploymentsAtResourceGroupPreparer(ctx, subscriptionID, resourceGroupName, remediationName, top) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "ListDeploymentsAtResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListDeploymentsAtResourceGroupSender(req) + if err != nil { + result.rdlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "ListDeploymentsAtResourceGroup", resp, "Failure sending request") + return + } + + result.rdlr, err = client.ListDeploymentsAtResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "ListDeploymentsAtResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListDeploymentsAtResourceGroupPreparer prepares the ListDeploymentsAtResourceGroup request. +func (client RemediationsClient) ListDeploymentsAtResourceGroupPreparer(ctx context.Context, subscriptionID string, resourceGroupName string, remediationName string, top *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "remediationName": autorest.Encode("path", remediationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", subscriptionID), + } + + const APIVersion = "2018-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/listDeployments", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListDeploymentsAtResourceGroupSender sends the ListDeploymentsAtResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client RemediationsClient) ListDeploymentsAtResourceGroupSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListDeploymentsAtResourceGroupResponder handles the response to the ListDeploymentsAtResourceGroup request. The method always +// closes the http.Response Body. +func (client RemediationsClient) ListDeploymentsAtResourceGroupResponder(resp *http.Response) (result RemediationDeploymentsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listDeploymentsAtResourceGroupNextResults retrieves the next set of results, if any. +func (client RemediationsClient) listDeploymentsAtResourceGroupNextResults(ctx context.Context, lastResults RemediationDeploymentsListResult) (result RemediationDeploymentsListResult, err error) { + req, err := lastResults.remediationDeploymentsListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "listDeploymentsAtResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListDeploymentsAtResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "listDeploymentsAtResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListDeploymentsAtResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "listDeploymentsAtResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListDeploymentsAtResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client RemediationsClient) ListDeploymentsAtResourceGroupComplete(ctx context.Context, subscriptionID string, resourceGroupName string, remediationName string, top *int32) (result RemediationDeploymentsListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemediationsClient.ListDeploymentsAtResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListDeploymentsAtResourceGroup(ctx, subscriptionID, resourceGroupName, remediationName, top) + return +} + +// ListDeploymentsAtSubscription gets all deployments for a remediation at subscription scope. +// Parameters: +// subscriptionID - microsoft Azure subscription ID. +// remediationName - the name of the remediation. +// top - maximum number of records to return. +func (client RemediationsClient) ListDeploymentsAtSubscription(ctx context.Context, subscriptionID string, remediationName string, top *int32) (result RemediationDeploymentsListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemediationsClient.ListDeploymentsAtSubscription") + defer func() { + sc := -1 + if result.rdlr.Response.Response != nil { + sc = result.rdlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("policyinsights.RemediationsClient", "ListDeploymentsAtSubscription", err.Error()) + } + + result.fn = client.listDeploymentsAtSubscriptionNextResults + req, err := client.ListDeploymentsAtSubscriptionPreparer(ctx, subscriptionID, remediationName, top) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "ListDeploymentsAtSubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListDeploymentsAtSubscriptionSender(req) + if err != nil { + result.rdlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "ListDeploymentsAtSubscription", resp, "Failure sending request") + return + } + + result.rdlr, err = client.ListDeploymentsAtSubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "ListDeploymentsAtSubscription", resp, "Failure responding to request") + } + + return +} + +// ListDeploymentsAtSubscriptionPreparer prepares the ListDeploymentsAtSubscription request. +func (client RemediationsClient) ListDeploymentsAtSubscriptionPreparer(ctx context.Context, subscriptionID string, remediationName string, top *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "remediationName": autorest.Encode("path", remediationName), + "subscriptionId": autorest.Encode("path", subscriptionID), + } + + const APIVersion = "2018-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/listDeployments", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListDeploymentsAtSubscriptionSender sends the ListDeploymentsAtSubscription request. The method will close the +// http.Response Body if it receives an error. +func (client RemediationsClient) ListDeploymentsAtSubscriptionSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListDeploymentsAtSubscriptionResponder handles the response to the ListDeploymentsAtSubscription request. The method always +// closes the http.Response Body. +func (client RemediationsClient) ListDeploymentsAtSubscriptionResponder(resp *http.Response) (result RemediationDeploymentsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listDeploymentsAtSubscriptionNextResults retrieves the next set of results, if any. +func (client RemediationsClient) listDeploymentsAtSubscriptionNextResults(ctx context.Context, lastResults RemediationDeploymentsListResult) (result RemediationDeploymentsListResult, err error) { + req, err := lastResults.remediationDeploymentsListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "listDeploymentsAtSubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListDeploymentsAtSubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "listDeploymentsAtSubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListDeploymentsAtSubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "listDeploymentsAtSubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListDeploymentsAtSubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client RemediationsClient) ListDeploymentsAtSubscriptionComplete(ctx context.Context, subscriptionID string, remediationName string, top *int32) (result RemediationDeploymentsListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemediationsClient.ListDeploymentsAtSubscription") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListDeploymentsAtSubscription(ctx, subscriptionID, remediationName, top) + return +} + +// ListForManagementGroup gets all remediations for the management group. +// Parameters: +// managementGroupID - management group ID. +// top - maximum number of records to return. +// filter - oData filter expression. +func (client RemediationsClient) ListForManagementGroup(ctx context.Context, managementGroupID string, top *int32, filter string) (result RemediationListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemediationsClient.ListForManagementGroup") + defer func() { + sc := -1 + if result.rlr.Response.Response != nil { + sc = result.rlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("policyinsights.RemediationsClient", "ListForManagementGroup", err.Error()) + } + + result.fn = client.listForManagementGroupNextResults + req, err := client.ListForManagementGroupPreparer(ctx, managementGroupID, top, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "ListForManagementGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListForManagementGroupSender(req) + if err != nil { + result.rlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "ListForManagementGroup", resp, "Failure sending request") + return + } + + result.rlr, err = client.ListForManagementGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "ListForManagementGroup", resp, "Failure responding to request") + } + + return +} + +// ListForManagementGroupPreparer prepares the ListForManagementGroup request. +func (client RemediationsClient) ListForManagementGroupPreparer(ctx context.Context, managementGroupID string, top *int32, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "managementGroupId": autorest.Encode("path", managementGroupID), + "managementGroupsNamespace": autorest.Encode("path", "Microsoft.Management"), + } + + const APIVersion = "2018-07-01-preview" + 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("/providers/{managementGroupsNamespace}/managementGroups/{managementGroupId}/providers/Microsoft.PolicyInsights/remediations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListForManagementGroupSender sends the ListForManagementGroup request. The method will close the +// http.Response Body if it receives an error. +func (client RemediationsClient) ListForManagementGroupSender(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...) +} + +// ListForManagementGroupResponder handles the response to the ListForManagementGroup request. The method always +// closes the http.Response Body. +func (client RemediationsClient) ListForManagementGroupResponder(resp *http.Response) (result RemediationListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listForManagementGroupNextResults retrieves the next set of results, if any. +func (client RemediationsClient) listForManagementGroupNextResults(ctx context.Context, lastResults RemediationListResult) (result RemediationListResult, err error) { + req, err := lastResults.remediationListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "listForManagementGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListForManagementGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "listForManagementGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListForManagementGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "listForManagementGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListForManagementGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client RemediationsClient) ListForManagementGroupComplete(ctx context.Context, managementGroupID string, top *int32, filter string) (result RemediationListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemediationsClient.ListForManagementGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListForManagementGroup(ctx, managementGroupID, top, filter) + return +} + +// ListForResource gets all remediations for a resource. +// Parameters: +// resourceID - resource ID. +// top - maximum number of records to return. +// filter - oData filter expression. +func (client RemediationsClient) ListForResource(ctx context.Context, resourceID string, top *int32, filter string) (result RemediationListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemediationsClient.ListForResource") + defer func() { + sc := -1 + if result.rlr.Response.Response != nil { + sc = result.rlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("policyinsights.RemediationsClient", "ListForResource", err.Error()) + } + + result.fn = client.listForResourceNextResults + req, err := client.ListForResourcePreparer(ctx, resourceID, top, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "ListForResource", nil, "Failure preparing request") + return + } + + resp, err := client.ListForResourceSender(req) + if err != nil { + result.rlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "ListForResource", resp, "Failure sending request") + return + } + + result.rlr, err = client.ListForResourceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "ListForResource", resp, "Failure responding to request") + } + + return +} + +// ListForResourcePreparer prepares the ListForResource request. +func (client RemediationsClient) ListForResourcePreparer(ctx context.Context, resourceID string, top *int32, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceId": resourceID, + } + + const APIVersion = "2018-07-01-preview" + 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("/{resourceId}/providers/Microsoft.PolicyInsights/remediations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListForResourceSender sends the ListForResource request. The method will close the +// http.Response Body if it receives an error. +func (client RemediationsClient) ListForResourceSender(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...) +} + +// ListForResourceResponder handles the response to the ListForResource request. The method always +// closes the http.Response Body. +func (client RemediationsClient) ListForResourceResponder(resp *http.Response) (result RemediationListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listForResourceNextResults retrieves the next set of results, if any. +func (client RemediationsClient) listForResourceNextResults(ctx context.Context, lastResults RemediationListResult) (result RemediationListResult, err error) { + req, err := lastResults.remediationListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "listForResourceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListForResourceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "listForResourceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListForResourceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "listForResourceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListForResourceComplete enumerates all values, automatically crossing page boundaries as required. +func (client RemediationsClient) ListForResourceComplete(ctx context.Context, resourceID string, top *int32, filter string) (result RemediationListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemediationsClient.ListForResource") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListForResource(ctx, resourceID, top, filter) + return +} + +// ListForResourceGroup gets all remediations for the subscription. +// Parameters: +// subscriptionID - microsoft Azure subscription ID. +// resourceGroupName - resource group name. +// top - maximum number of records to return. +// filter - oData filter expression. +func (client RemediationsClient) ListForResourceGroup(ctx context.Context, subscriptionID string, resourceGroupName string, top *int32, filter string) (result RemediationListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemediationsClient.ListForResourceGroup") + defer func() { + sc := -1 + if result.rlr.Response.Response != nil { + sc = result.rlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("policyinsights.RemediationsClient", "ListForResourceGroup", err.Error()) + } + + result.fn = client.listForResourceGroupNextResults + req, err := client.ListForResourceGroupPreparer(ctx, subscriptionID, resourceGroupName, top, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "ListForResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListForResourceGroupSender(req) + if err != nil { + result.rlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "ListForResourceGroup", resp, "Failure sending request") + return + } + + result.rlr, err = client.ListForResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "ListForResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListForResourceGroupPreparer prepares the ListForResourceGroup request. +func (client RemediationsClient) ListForResourceGroupPreparer(ctx context.Context, subscriptionID string, resourceGroupName string, top *int32, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", subscriptionID), + } + + const APIVersion = "2018-07-01-preview" + 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.PolicyInsights/remediations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListForResourceGroupSender sends the ListForResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client RemediationsClient) ListForResourceGroupSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListForResourceGroupResponder handles the response to the ListForResourceGroup request. The method always +// closes the http.Response Body. +func (client RemediationsClient) ListForResourceGroupResponder(resp *http.Response) (result RemediationListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listForResourceGroupNextResults retrieves the next set of results, if any. +func (client RemediationsClient) listForResourceGroupNextResults(ctx context.Context, lastResults RemediationListResult) (result RemediationListResult, err error) { + req, err := lastResults.remediationListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "listForResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListForResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "listForResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListForResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "listForResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListForResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client RemediationsClient) ListForResourceGroupComplete(ctx context.Context, subscriptionID string, resourceGroupName string, top *int32, filter string) (result RemediationListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemediationsClient.ListForResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListForResourceGroup(ctx, subscriptionID, resourceGroupName, top, filter) + return +} + +// ListForSubscription gets all remediations for the subscription. +// Parameters: +// subscriptionID - microsoft Azure subscription ID. +// top - maximum number of records to return. +// filter - oData filter expression. +func (client RemediationsClient) ListForSubscription(ctx context.Context, subscriptionID string, top *int32, filter string) (result RemediationListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemediationsClient.ListForSubscription") + defer func() { + sc := -1 + if result.rlr.Response.Response != nil { + sc = result.rlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("policyinsights.RemediationsClient", "ListForSubscription", err.Error()) + } + + result.fn = client.listForSubscriptionNextResults + req, err := client.ListForSubscriptionPreparer(ctx, subscriptionID, top, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "ListForSubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListForSubscriptionSender(req) + if err != nil { + result.rlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "ListForSubscription", resp, "Failure sending request") + return + } + + result.rlr, err = client.ListForSubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "ListForSubscription", resp, "Failure responding to request") + } + + return +} + +// ListForSubscriptionPreparer prepares the ListForSubscription request. +func (client RemediationsClient) ListForSubscriptionPreparer(ctx context.Context, subscriptionID string, top *int32, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", subscriptionID), + } + + const APIVersion = "2018-07-01-preview" + 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.PolicyInsights/remediations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListForSubscriptionSender sends the ListForSubscription request. The method will close the +// http.Response Body if it receives an error. +func (client RemediationsClient) ListForSubscriptionSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListForSubscriptionResponder handles the response to the ListForSubscription request. The method always +// closes the http.Response Body. +func (client RemediationsClient) ListForSubscriptionResponder(resp *http.Response) (result RemediationListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listForSubscriptionNextResults retrieves the next set of results, if any. +func (client RemediationsClient) listForSubscriptionNextResults(ctx context.Context, lastResults RemediationListResult) (result RemediationListResult, err error) { + req, err := lastResults.remediationListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "listForSubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListForSubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "listForSubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListForSubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.RemediationsClient", "listForSubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListForSubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client RemediationsClient) ListForSubscriptionComplete(ctx context.Context, subscriptionID string, top *int32, filter string) (result RemediationListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemediationsClient.ListForSubscription") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListForSubscription(ctx, subscriptionID, top, filter) + return +} diff --git a/services/policyinsights/mgmt/2019-10-01/policyinsights/version.go b/services/policyinsights/mgmt/2019-10-01/policyinsights/version.go new file mode 100644 index 000000000000..18cce08f4d74 --- /dev/null +++ b/services/policyinsights/mgmt/2019-10-01/policyinsights/version.go @@ -0,0 +1,30 @@ +package policyinsights + +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 + " policyinsights/2019-10-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/preview/appinsights/v1/insights/version.go b/services/preview/appinsights/v1/insights/version.go index 83744b85fd40..2123a7972af4 100644 --- a/services/preview/appinsights/v1/insights/version.go +++ b/services/preview/appinsights/v1/insights/version.go @@ -18,13 +18,12 @@ import "github.com/Azure/azure-sdk-for-go/version" // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/appinsights/v1/insights instead. + // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { return "Azure-SDK-For-Go/" + version.Number + " insights/v1" } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/appinsights/v1/insights instead. // Version returns the semantic version (see http://semver.org) of the client. func Version() string { return version.Number diff --git a/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/appplatformapi/interfaces.go b/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/appplatformapi/interfaces.go index 3c3a7feb6811..db69e51e29ce 100644 --- a/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/appplatformapi/interfaces.go +++ b/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/appplatformapi/interfaces.go @@ -42,12 +42,12 @@ var _ ServicesClientAPI = (*appplatform.ServicesClient)(nil) // AppsClientAPI contains the set of methods on the AppsClient type. type AppsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, appName string, appResource *appplatform.AppResource) (result appplatform.AppResource, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, appName string, appResource *appplatform.AppResource) (result appplatform.AppsCreateOrUpdateFuture, err error) Delete(ctx context.Context, resourceGroupName string, serviceName string, appName string) (result autorest.Response, err error) Get(ctx context.Context, resourceGroupName string, serviceName string, appName string, syncStatus string) (result appplatform.AppResource, err error) GetResourceUploadURL(ctx context.Context, resourceGroupName string, serviceName string, appName string) (result appplatform.ResourceUploadDefinition, err error) List(ctx context.Context, resourceGroupName string, serviceName string) (result appplatform.AppResourceCollectionPage, err error) - Update(ctx context.Context, resourceGroupName string, serviceName string, appName string, appResource *appplatform.AppResource) (result appplatform.AppResource, err error) + Update(ctx context.Context, resourceGroupName string, serviceName string, appName string, appResource *appplatform.AppResource) (result appplatform.AppsUpdateFuture, err error) } var _ AppsClientAPI = (*appplatform.AppsClient)(nil) diff --git a/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/apps.go b/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/apps.go index 69d6141f9fb0..decc2c25efcc 100644 --- a/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/apps.go +++ b/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/apps.go @@ -48,13 +48,13 @@ func NewAppsClientWithBaseURI(baseURI string, subscriptionID string) AppsClient // serviceName - the name of the Service resource. // appName - the name of the App resource. // appResource - parameters for the create or update operation -func (client AppsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, appName string, appResource *AppResource) (result AppResource, err error) { +func (client AppsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, appName string, appResource *AppResource) (result AppsCreateOrUpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.Response() != nil { + sc = result.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -90,18 +90,12 @@ func (client AppsClient) CreateOrUpdate(ctx context.Context, resourceGroupName s return } - resp, err := client.CreateOrUpdateSender(req) + result, err = client.CreateOrUpdateSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "appplatform.AppsClient", "CreateOrUpdate", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "appplatform.AppsClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "appplatform.AppsClient", "CreateOrUpdate", resp, "Failure responding to request") - } - return } @@ -134,9 +128,15 @@ func (client AppsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGro // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) CreateOrUpdateSender(req *http.Request) (future AppsCreateOrUpdateFuture, err error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + 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 @@ -145,7 +145,7 @@ func (client AppsClient) CreateOrUpdateResponder(resp *http.Response) (result Ap err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} @@ -518,13 +518,13 @@ func (client AppsClient) ListComplete(ctx context.Context, resourceGroupName str // serviceName - the name of the Service resource. // appName - the name of the App resource. // appResource - parameters for the update operation -func (client AppsClient) Update(ctx context.Context, resourceGroupName string, serviceName string, appName string, appResource *AppResource) (result AppResource, err error) { +func (client AppsClient) Update(ctx context.Context, resourceGroupName string, serviceName string, appName string, appResource *AppResource) (result AppsUpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.Update") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.Response() != nil { + sc = result.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -535,18 +535,12 @@ func (client AppsClient) Update(ctx context.Context, resourceGroupName string, s return } - resp, err := client.UpdateSender(req) + result, err = client.UpdateSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "appplatform.AppsClient", "Update", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "appplatform.AppsClient", "Update", result.Response(), "Failure sending request") return } - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "appplatform.AppsClient", "Update", resp, "Failure responding to request") - } - return } @@ -579,9 +573,15 @@ func (client AppsClient) UpdatePreparer(ctx context.Context, resourceGroupName s // 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) { +func (client AppsClient) UpdateSender(req *http.Request) (future AppsUpdateFuture, err error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + 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 @@ -590,7 +590,7 @@ func (client AppsClient) UpdateResponder(resp *http.Response) (result AppResourc err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} diff --git a/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/models.go b/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/models.go index 5a94eb8e7f3b..cf8d8d68fd8a 100644 --- a/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/models.go +++ b/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/models.go @@ -35,15 +35,19 @@ const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/appplatform/mgm type AppResourceProvisioningState string const ( + // Creating ... + Creating AppResourceProvisioningState = "Creating" // Failed ... Failed AppResourceProvisioningState = "Failed" // Succeeded ... Succeeded AppResourceProvisioningState = "Succeeded" + // Updating ... + Updating AppResourceProvisioningState = "Updating" ) // PossibleAppResourceProvisioningStateValues returns an array of possible values for the AppResourceProvisioningState const type. func PossibleAppResourceProvisioningStateValues() []AppResourceProvisioningState { - return []AppResourceProvisioningState{Failed, Succeeded} + return []AppResourceProvisioningState{Creating, Failed, Succeeded, Updating} } // ConfigServerState enumerates the values for config server state. @@ -75,15 +79,15 @@ const ( DeploymentResourceProvisioningStateCreating DeploymentResourceProvisioningState = "Creating" // DeploymentResourceProvisioningStateFailed ... DeploymentResourceProvisioningStateFailed DeploymentResourceProvisioningState = "Failed" - // DeploymentResourceProvisioningStateProcessing ... - DeploymentResourceProvisioningStateProcessing DeploymentResourceProvisioningState = "Processing" // DeploymentResourceProvisioningStateSucceeded ... DeploymentResourceProvisioningStateSucceeded DeploymentResourceProvisioningState = "Succeeded" + // DeploymentResourceProvisioningStateUpdating ... + DeploymentResourceProvisioningStateUpdating DeploymentResourceProvisioningState = "Updating" ) // PossibleDeploymentResourceProvisioningStateValues returns an array of possible values for the DeploymentResourceProvisioningState const type. func PossibleDeploymentResourceProvisioningStateValues() []DeploymentResourceProvisioningState { - return []DeploymentResourceProvisioningState{DeploymentResourceProvisioningStateCreating, DeploymentResourceProvisioningStateFailed, DeploymentResourceProvisioningStateProcessing, DeploymentResourceProvisioningStateSucceeded} + return []DeploymentResourceProvisioningState{DeploymentResourceProvisioningStateCreating, DeploymentResourceProvisioningStateFailed, DeploymentResourceProvisioningStateSucceeded, DeploymentResourceProvisioningStateUpdating} } // DeploymentResourceStatus enumerates the values for deployment resource status. @@ -96,8 +100,6 @@ const ( DeploymentResourceStatusCompiling DeploymentResourceStatus = "Compiling" // DeploymentResourceStatusFailed ... DeploymentResourceStatusFailed DeploymentResourceStatus = "Failed" - // DeploymentResourceStatusProcessing ... - DeploymentResourceStatusProcessing DeploymentResourceStatus = "Processing" // DeploymentResourceStatusRunning ... DeploymentResourceStatusRunning DeploymentResourceStatus = "Running" // DeploymentResourceStatusStopped ... @@ -110,7 +112,7 @@ const ( // PossibleDeploymentResourceStatusValues returns an array of possible values for the DeploymentResourceStatus const type. func PossibleDeploymentResourceStatusValues() []DeploymentResourceStatus { - return []DeploymentResourceStatus{DeploymentResourceStatusAllocating, DeploymentResourceStatusCompiling, DeploymentResourceStatusFailed, DeploymentResourceStatusProcessing, DeploymentResourceStatusRunning, DeploymentResourceStatusStopped, DeploymentResourceStatusUnknown, DeploymentResourceStatusUpgrading} + return []DeploymentResourceStatus{DeploymentResourceStatusAllocating, DeploymentResourceStatusCompiling, DeploymentResourceStatusFailed, DeploymentResourceStatusRunning, DeploymentResourceStatusStopped, DeploymentResourceStatusUnknown, DeploymentResourceStatusUpgrading} } // ProvisioningState enumerates the values for provisioning state. @@ -372,7 +374,7 @@ type AppResourceProperties struct { Public *bool `json:"public,omitempty"` // URL - READ-ONLY; URL of the App URL *string `json:"url,omitempty"` - // ProvisioningState - READ-ONLY; Provisioning state of the App. Possible values include: 'Succeeded', 'Failed' + // ProvisioningState - READ-ONLY; Provisioning state of the App. Possible values include: 'Succeeded', 'Failed', 'Creating', 'Updating' ProvisioningState AppResourceProvisioningState `json:"provisioningState,omitempty"` // ActiveDeploymentName - Name of the active deployment of the App ActiveDeploymentName *string `json:"activeDeploymentName,omitempty"` @@ -384,6 +386,63 @@ type AppResourceProperties struct { PersistentDisk *PersistentDisk `json:"persistentDisk,omitempty"` } +// AppsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type AppsCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *AppsCreateOrUpdateFuture) Result(client AppsClient) (ar AppResource, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "appplatform.AppsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("appplatform.AppsCreateOrUpdateFuture") + 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.CreateOrUpdateResponder(ar.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "appplatform.AppsCreateOrUpdateFuture", "Result", ar.Response.Response, "Failure responding to request") + } + } + return +} + +// AppsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type AppsUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *AppsUpdateFuture) Result(client AppsClient) (ar AppResource, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "appplatform.AppsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("appplatform.AppsUpdateFuture") + 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, "appplatform.AppsUpdateFuture", "Result", ar.Response.Response, "Failure responding to request") + } + } + return +} + // AvailableOperations available operations of the service type AvailableOperations struct { autorest.Response `json:"-"` @@ -983,11 +1042,11 @@ type DeploymentResourceProperties struct { Source *UserSourceInfo `json:"source,omitempty"` // AppName - READ-ONLY; App name of the deployment AppName *string `json:"appName,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the Deployment. Possible values include: 'DeploymentResourceProvisioningStateCreating', 'DeploymentResourceProvisioningStateUpdating', 'DeploymentResourceProvisioningStateSucceeded', 'DeploymentResourceProvisioningStateFailed' + ProvisioningState DeploymentResourceProvisioningState `json:"provisioningState,omitempty"` // DeploymentSettings - Deployment settings of the Deployment DeploymentSettings *DeploymentSettings `json:"deploymentSettings,omitempty"` - // ProvisioningState - READ-ONLY; Provisioning state of the Deployment. Possible values include: 'DeploymentResourceProvisioningStateCreating', 'DeploymentResourceProvisioningStateProcessing', 'DeploymentResourceProvisioningStateSucceeded', 'DeploymentResourceProvisioningStateFailed' - ProvisioningState DeploymentResourceProvisioningState `json:"provisioningState,omitempty"` - // Status - READ-ONLY; Status of the Deployment. Possible values include: 'DeploymentResourceStatusUnknown', 'DeploymentResourceStatusStopped', 'DeploymentResourceStatusRunning', 'DeploymentResourceStatusFailed', 'DeploymentResourceStatusProcessing', 'DeploymentResourceStatusAllocating', 'DeploymentResourceStatusUpgrading', 'DeploymentResourceStatusCompiling' + // Status - READ-ONLY; Status of the Deployment. Possible values include: 'DeploymentResourceStatusUnknown', 'DeploymentResourceStatusStopped', 'DeploymentResourceStatusRunning', 'DeploymentResourceStatusFailed', 'DeploymentResourceStatusAllocating', 'DeploymentResourceStatusUpgrading', 'DeploymentResourceStatusCompiling' Status DeploymentResourceStatus `json:"status,omitempty"` // Active - READ-ONLY; Indicates whether the Deployment is active Active *bool `json:"active,omitempty"` diff --git a/services/preview/cognitiveservices/v1.0/visualsearch/client.go b/services/preview/cognitiveservices/v1.0/visualsearch/client.go index 2cc469810959..b966e318fad9 100644 --- a/services/preview/cognitiveservices/v1.0/visualsearch/client.go +++ b/services/preview/cognitiveservices/v1.0/visualsearch/client.go @@ -3,7 +3,11 @@ // Visual Search API lets you discover insights about an image such as visually similar images, shopping sources, and // related searches. The API can also perform text recognition, identify entities (people, places, things), return // other topical content for the user to explore, and more. For more information, see [Visual Search -// Overview](https://docs.microsoft.com/azure/cognitive-services/bing-visual-search/overview). +// Overview](https://docs.microsoft.com/azure/cognitive-services/bing-visual-search/overview). **NOTE:** To comply +// with the new EU Copyright Directive in France, the Bing Visual Search API must omit some content from certain EU +// News sources for French users. The removed content may include thumbnail images and videos, video previews, and +// snippets which accompany search results from these sources. As a consequence, the Bing APIs may serve fewer results +// with thumbnail images and videos, video previews, and snippets to French users. package visualsearch // Copyright (c) Microsoft and contributors. All rights reserved. diff --git a/services/preview/cognitiveservices/v1.0/visualsearch/images.go b/services/preview/cognitiveservices/v1.0/visualsearch/images.go index 6fa85f62882e..321798492946 100644 --- a/services/preview/cognitiveservices/v1.0/visualsearch/images.go +++ b/services/preview/cognitiveservices/v1.0/visualsearch/images.go @@ -29,7 +29,11 @@ import ( // ImagesClient is the visual Search API lets you discover insights about an image such as visually similar images, // shopping sources, and related searches. The API can also perform text recognition, identify entities (people, // places, things), return other topical content for the user to explore, and more. For more information, see [Visual -// Search Overview](https://docs.microsoft.com/azure/cognitive-services/bing-visual-search/overview). +// Search Overview](https://docs.microsoft.com/azure/cognitive-services/bing-visual-search/overview). **NOTE:** To +// comply with the new EU Copyright Directive in France, the Bing Visual Search API must omit some content from certain +// EU News sources for French users. The removed content may include thumbnail images and videos, video previews, and +// snippets which accompany search results from these sources. As a consequence, the Bing APIs may serve fewer results +// with thumbnail images and videos, video previews, and snippets to French users. type ImagesClient struct { BaseClient } diff --git a/services/preview/cognitiveservices/v3.0/luis/authoring/apps.go b/services/preview/cognitiveservices/v3.0/luis/authoring/apps.go new file mode 100644 index 000000000000..13de58e56cf0 --- /dev/null +++ b/services/preview/cognitiveservices/v3.0/luis/authoring/apps.go @@ -0,0 +1,1650 @@ +package authoring + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "github.com/satori/go.uuid" + "net/http" +) + +// AppsClient is the client for the Apps methods of the Authoring service. +type AppsClient struct { + BaseClient +} + +// NewAppsClient creates an instance of the AppsClient client. +func NewAppsClient(endpoint string) AppsClient { + return AppsClient{New(endpoint)} +} + +// Add creates a new LUIS app. +// Parameters: +// applicationCreateObject - an application 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 tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.Add") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + 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("authoring.AppsClient", "Add", err.Error()) + } + + req, err := client.AddPreparer(ctx, applicationCreateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.AppsClient", "Add", resp, "Failure sending request") + return + } + + result, err = client.AddResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 intent and entity 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.AddCustomPrebuiltDomain") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.AddCustomPrebuiltDomainPreparer(ctx, prebuiltDomainCreateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.AppsClient", "AddCustomPrebuiltDomain", resp, "Failure sending request") + return + } + + result, err = client.AddCustomPrebuiltDomainResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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. +// force - a flag to indicate whether to force an operation. +func (client AppsClient) Delete(ctx context.Context, appID uuid.UUID, force *bool) (result OperationStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.Delete") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, appID, force) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.AppsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.AppsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client AppsClient) DeletePreparer(ctx context.Context, appID uuid.UUID, force *bool) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "appId": autorest.Encode("path", appID), + } + + queryParameters := map[string]interface{}{} + if force != nil { + queryParameters["force"] = autorest.Encode("query", *force) + } else { + queryParameters["force"] = autorest.Encode("query", false) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithPathParameters("/apps/{appId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeleteSender(req *http.Request) (*http.Response, error) { + 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 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 logs of the past month's endpoint queries for the application. +// Parameters: +// appID - the application ID. +func (client AppsClient) DownloadQueryLogs(ctx context.Context, appID uuid.UUID) (result ReadCloser, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DownloadQueryLogs") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DownloadQueryLogsPreparer(ctx, appID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.AppsClient", "DownloadQueryLogs", resp, "Failure sending request") + return + } + + result, err = client.DownloadQueryLogsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "appId": autorest.Encode("path", appID), + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, appID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.AppsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "appId": autorest.Encode("path", appID), + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", 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) { + 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 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 +} + +// GetPublishSettings get the application publish settings including 'UseAllTrainingData'. +// Parameters: +// appID - the application ID. +func (client AppsClient) GetPublishSettings(ctx context.Context, appID uuid.UUID) (result PublishSettings, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetPublishSettings") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPublishSettingsPreparer(ctx, appID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.AppsClient", "GetPublishSettings", nil, "Failure preparing request") + return + } + + resp, err := client.GetPublishSettingsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "authoring.AppsClient", "GetPublishSettings", resp, "Failure sending request") + return + } + + result, err = client.GetPublishSettingsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.AppsClient", "GetPublishSettings", resp, "Failure responding to request") + } + + return +} + +// GetPublishSettingsPreparer prepares the GetPublishSettings request. +func (client AppsClient) GetPublishSettingsPreparer(ctx context.Context, appID uuid.UUID) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "appId": autorest.Encode("path", appID), + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithPathParameters("/apps/{appId}/publishsettings", pathParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetPublishSettingsSender sends the GetPublishSettings request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetPublishSettingsSender(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...) +} + +// GetPublishSettingsResponder handles the response to the GetPublishSettings request. The method always +// closes the http.Response Body. +func (client AppsClient) GetPublishSettingsResponder(resp *http.Response) (result PublishSettings, 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 including 'UseAllTrainingData'. +// Parameters: +// appID - the application ID. +func (client AppsClient) GetSettings(ctx context.Context, appID uuid.UUID) (result ApplicationSettings, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetSettings") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetSettingsPreparer(ctx, appID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.AppsClient", "GetSettings", resp, "Failure sending request") + return + } + + result, err = client.GetSettingsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "appId": autorest.Encode("path", appID), + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 is included 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. If the application name already exists, an error is returned. +func (client AppsClient) Import(ctx context.Context, luisApp LuisApp, appName string) (result UUID, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.Import") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ImportPreparer(ctx, luisApp, appName) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.AppsClient", "Import", resp, "Failure sending request") + return + } + + result, err = client.ImportResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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's 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 tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.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: 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: int64(500), Chain: nil}, + {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("authoring.AppsClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, skip, take) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.AppsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + 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 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListAvailableCustomPrebuiltDomains") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListAvailableCustomPrebuiltDomainsPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.AppsClient", "ListAvailableCustomPrebuiltDomains", resp, "Failure sending request") + return + } + + result, err = client.ListAvailableCustomPrebuiltDomainsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 prebuilt domains for a specific culture. +// Parameters: +// culture - culture. +func (client AppsClient) ListAvailableCustomPrebuiltDomainsForCulture(ctx context.Context, culture string) (result ListPrebuiltDomain, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListAvailableCustomPrebuiltDomainsForCulture") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListAvailableCustomPrebuiltDomainsForCulturePreparer(ctx, culture) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.AppsClient", "ListAvailableCustomPrebuiltDomainsForCulture", resp, "Failure sending request") + return + } + + result, err = client.ListAvailableCustomPrebuiltDomainsForCultureResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "culture": autorest.Encode("path", culture), + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListCortanaEndpoints") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListCortanaEndpointsPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.AppsClient", "ListCortanaEndpoints", resp, "Failure sending request") + return + } + + result, err = client.ListCortanaEndpointsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListDomains") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListDomainsPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.AppsClient", "ListDomains", resp, "Failure sending request") + return + } + + result, err = client.ListDomainsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListEndpoints") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListEndpointsPreparer(ctx, appID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.AppsClient", "ListEndpoints", resp, "Failure sending request") + return + } + + result, err = client.ListEndpointsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "appId": autorest.Encode("path", appID), + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 a list of supported cultures. Cultures are equivalent to the written language and locale. +// For example,"en-us" represents the U.S. variation of English. +func (client AppsClient) ListSupportedCultures(ctx context.Context) (result ListAvailableCulture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListSupportedCultures") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListSupportedCulturesPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.AppsClient", "ListSupportedCultures", resp, "Failure sending request") + return + } + + result, err = client.ListSupportedCulturesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListUsageScenarios") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListUsageScenariosPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.AppsClient", "ListUsageScenarios", resp, "Failure sending request") + return + } + + result, err = client.ListUsageScenariosResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 +} + +// PackagePublishedApplicationAsGzip packages a published LUIS application as a GZip file to be used in the LUIS +// container. +// Parameters: +// appID - the application ID. +// slotName - the publishing slot name. +func (client AppsClient) PackagePublishedApplicationAsGzip(ctx context.Context, appID uuid.UUID, slotName string) (result ReadCloser, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.PackagePublishedApplicationAsGzip") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PackagePublishedApplicationAsGzipPreparer(ctx, appID, slotName) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.AppsClient", "PackagePublishedApplicationAsGzip", nil, "Failure preparing request") + return + } + + resp, err := client.PackagePublishedApplicationAsGzipSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "authoring.AppsClient", "PackagePublishedApplicationAsGzip", resp, "Failure sending request") + return + } + + result, err = client.PackagePublishedApplicationAsGzipResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.AppsClient", "PackagePublishedApplicationAsGzip", resp, "Failure responding to request") + } + + return +} + +// PackagePublishedApplicationAsGzipPreparer prepares the PackagePublishedApplicationAsGzip request. +func (client AppsClient) PackagePublishedApplicationAsGzipPreparer(ctx context.Context, appID uuid.UUID, slotName string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "appId": autorest.Encode("path", appID), + "slotName": autorest.Encode("path", slotName), + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithPathParameters("/package/{appId}/slot/{slotName}/gzip", pathParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PackagePublishedApplicationAsGzipSender sends the PackagePublishedApplicationAsGzip request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) PackagePublishedApplicationAsGzipSender(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...) +} + +// PackagePublishedApplicationAsGzipResponder handles the response to the PackagePublishedApplicationAsGzip request. The method always +// closes the http.Response Body. +func (client AppsClient) PackagePublishedApplicationAsGzipResponder(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 +} + +// PackageTrainedApplicationAsGzip packages trained LUIS application as GZip file to be used in the LUIS container. +// Parameters: +// appID - the application ID. +// versionID - the version ID. +func (client AppsClient) PackageTrainedApplicationAsGzip(ctx context.Context, appID uuid.UUID, versionID string) (result ReadCloser, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.PackageTrainedApplicationAsGzip") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PackageTrainedApplicationAsGzipPreparer(ctx, appID, versionID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.AppsClient", "PackageTrainedApplicationAsGzip", nil, "Failure preparing request") + return + } + + resp, err := client.PackageTrainedApplicationAsGzipSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "authoring.AppsClient", "PackageTrainedApplicationAsGzip", resp, "Failure sending request") + return + } + + result, err = client.PackageTrainedApplicationAsGzipResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.AppsClient", "PackageTrainedApplicationAsGzip", resp, "Failure responding to request") + } + + return +} + +// PackageTrainedApplicationAsGzipPreparer prepares the PackageTrainedApplicationAsGzip request. +func (client AppsClient) PackageTrainedApplicationAsGzipPreparer(ctx context.Context, appID uuid.UUID, versionID string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "appId": autorest.Encode("path", appID), + "versionId": autorest.Encode("path", versionID), + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithPathParameters("/package/{appId}/versions/{versionId}/gzip", pathParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PackageTrainedApplicationAsGzipSender sends the PackageTrainedApplicationAsGzip request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) PackageTrainedApplicationAsGzipSender(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...) +} + +// PackageTrainedApplicationAsGzipResponder handles the response to the PackageTrainedApplicationAsGzip request. The method always +// closes the http.Response Body. +func (client AppsClient) PackageTrainedApplicationAsGzipResponder(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 +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.Publish") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PublishPreparer(ctx, appID, applicationPublishObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.AppsClient", "Publish", resp, "Failure sending request") + return + } + + result, err = client.PublishResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "appId": autorest.Encode("path", appID), + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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, http.StatusMultiStatus), + 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, appID, applicationUpdateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.AppsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "appId": autorest.Encode("path", appID), + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", 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) { + 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 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 +} + +// UpdatePublishSettings updates the application publish settings including 'UseAllTrainingData'. +// Parameters: +// appID - the application ID. +// publishSettingUpdateObject - an object containing the new publish application settings. +func (client AppsClient) UpdatePublishSettings(ctx context.Context, appID uuid.UUID, publishSettingUpdateObject PublishSettingUpdateObject) (result OperationStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.UpdatePublishSettings") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePublishSettingsPreparer(ctx, appID, publishSettingUpdateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.AppsClient", "UpdatePublishSettings", nil, "Failure preparing request") + return + } + + resp, err := client.UpdatePublishSettingsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "authoring.AppsClient", "UpdatePublishSettings", resp, "Failure sending request") + return + } + + result, err = client.UpdatePublishSettingsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.AppsClient", "UpdatePublishSettings", resp, "Failure responding to request") + } + + return +} + +// UpdatePublishSettingsPreparer prepares the UpdatePublishSettings request. +func (client AppsClient) UpdatePublishSettingsPreparer(ctx context.Context, appID uuid.UUID, publishSettingUpdateObject PublishSettingUpdateObject) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "appId": autorest.Encode("path", appID), + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithPathParameters("/apps/{appId}/publishsettings", pathParameters), + autorest.WithJSON(publishSettingUpdateObject)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdatePublishSettingsSender sends the UpdatePublishSettings request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) UpdatePublishSettingsSender(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...) +} + +// UpdatePublishSettingsResponder handles the response to the UpdatePublishSettings request. The method always +// closes the http.Response Body. +func (client AppsClient) UpdatePublishSettingsResponder(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 including 'UseAllTrainingData'. +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.UpdateSettings") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdateSettingsPreparer(ctx, appID, applicationSettingUpdateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.AppsClient", "UpdateSettings", resp, "Failure sending request") + return + } + + result, err = client.UpdateSettingsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "appId": autorest.Encode("path", appID), + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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/preview/cognitiveservices/v3.0/luis/authoring/authoringapi/interfaces.go b/services/preview/cognitiveservices/v3.0/luis/authoring/authoringapi/interfaces.go new file mode 100644 index 000000000000..004c989ed5ed --- /dev/null +++ b/services/preview/cognitiveservices/v3.0/luis/authoring/authoringapi/interfaces.go @@ -0,0 +1,256 @@ +package authoringapi + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by 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/cognitiveservices/v3.0/luis/authoring" + "github.com/satori/go.uuid" +) + +// FeaturesClientAPI contains the set of methods on the FeaturesClient type. +type FeaturesClientAPI interface { + AddEntityFeature(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, featureRelationCreateObject authoring.ModelFeatureInformation) (result authoring.OperationStatus, err error) + AddIntentFeature(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID, featureRelationCreateObject authoring.ModelFeatureInformation) (result authoring.OperationStatus, err error) + AddPhraseList(ctx context.Context, appID uuid.UUID, versionID string, phraselistCreateObject authoring.PhraselistCreateObject) (result authoring.Int32, err error) + DeletePhraseList(ctx context.Context, appID uuid.UUID, versionID string, phraselistID int32) (result authoring.OperationStatus, err error) + GetPhraseList(ctx context.Context, appID uuid.UUID, versionID string, phraselistID int32) (result authoring.PhraseListFeatureInfo, err error) + List(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result authoring.FeaturesResponseObject, err error) + ListPhraseLists(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result authoring.ListPhraseListFeatureInfo, err error) + UpdatePhraseList(ctx context.Context, appID uuid.UUID, versionID string, phraselistID int32, phraselistUpdateObject *authoring.PhraselistUpdateObject) (result authoring.OperationStatus, err error) +} + +var _ FeaturesClientAPI = (*authoring.FeaturesClient)(nil) + +// ExamplesClientAPI contains the set of methods on the ExamplesClient type. +type ExamplesClientAPI interface { + Add(ctx context.Context, appID uuid.UUID, versionID string, exampleLabelObject authoring.ExampleLabelObject) (result authoring.LabelExampleResponse, err error) + Batch(ctx context.Context, appID uuid.UUID, versionID string, exampleLabelObjectArray []authoring.ExampleLabelObject) (result authoring.ListBatchLabelExample, err error) + Delete(ctx context.Context, appID uuid.UUID, versionID string, exampleID int32) (result authoring.OperationStatus, err error) + List(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result authoring.ListLabeledUtterance, err error) +} + +var _ ExamplesClientAPI = (*authoring.ExamplesClient)(nil) + +// ModelClientAPI contains the set of methods on the ModelClient type. +type ModelClientAPI interface { + AddClosedList(ctx context.Context, appID uuid.UUID, versionID string, closedListModelCreateObject authoring.ClosedListModelCreateObject) (result authoring.UUID, err error) + AddCompositeEntityChild(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID, compositeChildModelCreateObject authoring.CompositeChildModelCreateObject) (result authoring.UUID, err error) + AddCustomPrebuiltDomain(ctx context.Context, appID uuid.UUID, versionID string, prebuiltDomainObject authoring.PrebuiltDomainCreateBaseObject) (result authoring.ListUUID, err error) + AddCustomPrebuiltEntity(ctx context.Context, appID uuid.UUID, versionID string, prebuiltDomainModelCreateObject authoring.PrebuiltDomainModelCreateObject) (result authoring.UUID, err error) + AddCustomPrebuiltIntent(ctx context.Context, appID uuid.UUID, versionID string, prebuiltDomainModelCreateObject authoring.PrebuiltDomainModelCreateObject) (result authoring.UUID, err error) + AddEntity(ctx context.Context, appID uuid.UUID, versionID string, entityModelCreateObject authoring.EntityModelCreateObject) (result authoring.UUID, err error) + AddEntityChild(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, childEntityModelCreateObject authoring.ChildEntityModelCreateObject) (result authoring.UUID, err error) + AddExplicitListItem(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, item authoring.ExplicitListItemCreateObject) (result authoring.Int32, err error) + AddIntent(ctx context.Context, appID uuid.UUID, versionID string, intentCreateObject authoring.ModelCreateObject) (result authoring.UUID, err error) + AddPrebuilt(ctx context.Context, appID uuid.UUID, versionID string, prebuiltExtractorNames []string) (result authoring.ListPrebuiltEntityExtractor, err error) + AddSubList(ctx context.Context, appID uuid.UUID, versionID string, clEntityID uuid.UUID, wordListCreateObject authoring.WordListObject) (result authoring.Int64, err error) + CreateClosedListEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, entityRoleCreateObject authoring.EntityRoleCreateObject) (result authoring.UUID, err error) + CreateCompositeEntityRole(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID, entityRoleCreateObject authoring.EntityRoleCreateObject) (result authoring.UUID, err error) + CreateCustomPrebuiltEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, entityRoleCreateObject authoring.EntityRoleCreateObject) (result authoring.UUID, err error) + CreateEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, entityRoleCreateObject authoring.EntityRoleCreateObject) (result authoring.UUID, err error) + CreateHierarchicalEntityRole(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, entityRoleCreateObject authoring.EntityRoleCreateObject) (result authoring.UUID, err error) + CreatePatternAnyEntityModel(ctx context.Context, appID uuid.UUID, versionID string, extractorCreateObject authoring.PatternAnyModelCreateObject) (result authoring.UUID, err error) + CreatePatternAnyEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, entityRoleCreateObject authoring.EntityRoleCreateObject) (result authoring.UUID, err error) + CreatePrebuiltEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, entityRoleCreateObject authoring.EntityRoleCreateObject) (result authoring.UUID, err error) + CreateRegexEntityModel(ctx context.Context, appID uuid.UUID, versionID string, regexEntityExtractorCreateObj authoring.RegexModelCreateObject) (result authoring.UUID, err error) + CreateRegexEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, entityRoleCreateObject authoring.EntityRoleCreateObject) (result authoring.UUID, err error) + DeleteClosedList(ctx context.Context, appID uuid.UUID, versionID string, clEntityID uuid.UUID) (result authoring.OperationStatus, err error) + DeleteClosedListEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (result authoring.OperationStatus, err error) + DeleteCompositeEntity(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID) (result authoring.OperationStatus, err error) + DeleteCompositeEntityChild(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID, cChildID uuid.UUID) (result authoring.OperationStatus, err error) + DeleteCompositeEntityRole(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID, roleID uuid.UUID) (result authoring.OperationStatus, err error) + DeleteCustomEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (result authoring.OperationStatus, err error) + DeleteCustomPrebuiltDomain(ctx context.Context, appID uuid.UUID, versionID string, domainName string) (result authoring.OperationStatus, err error) + DeleteEntity(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (result authoring.OperationStatus, err error) + DeleteEntityFeature(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, featureRelationDeleteObject authoring.ModelFeatureInformation) (result authoring.OperationStatus, err error) + DeleteEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (result authoring.OperationStatus, err error) + DeleteExplicitListItem(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, itemID int64) (result authoring.OperationStatus, err error) + DeleteHierarchicalEntity(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID) (result authoring.OperationStatus, err error) + DeleteHierarchicalEntityChild(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, hChildID uuid.UUID) (result authoring.OperationStatus, err error) + DeleteHierarchicalEntityRole(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, roleID uuid.UUID) (result authoring.OperationStatus, err error) + DeleteIntent(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID, deleteUtterances *bool) (result authoring.OperationStatus, err error) + DeleteIntentFeature(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID, featureRelationDeleteObject authoring.ModelFeatureInformation) (result authoring.OperationStatus, err error) + DeletePatternAnyEntityModel(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (result authoring.OperationStatus, err error) + DeletePatternAnyEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (result authoring.OperationStatus, err error) + DeletePrebuilt(ctx context.Context, appID uuid.UUID, versionID string, prebuiltID uuid.UUID) (result authoring.OperationStatus, err error) + DeletePrebuiltEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (result authoring.OperationStatus, err error) + DeleteRegexEntityModel(ctx context.Context, appID uuid.UUID, versionID string, regexEntityID uuid.UUID) (result authoring.OperationStatus, err error) + DeleteRegexEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (result authoring.OperationStatus, err error) + DeleteSubList(ctx context.Context, appID uuid.UUID, versionID string, clEntityID uuid.UUID, subListID int64) (result authoring.OperationStatus, err error) + ExamplesMethod(ctx context.Context, appID uuid.UUID, versionID string, modelID string, skip *int32, take *int32) (result authoring.ListLabelTextObject, err error) + GetClosedList(ctx context.Context, appID uuid.UUID, versionID string, clEntityID uuid.UUID) (result authoring.ClosedListEntityExtractor, err error) + GetClosedListEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (result authoring.EntityRole, err error) + GetCompositeEntity(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID) (result authoring.CompositeEntityExtractor, err error) + GetCompositeEntityRole(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID, roleID uuid.UUID) (result authoring.EntityRole, err error) + GetCustomEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (result authoring.EntityRole, err error) + GetEntity(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (result authoring.NDepthEntityExtractor, err error) + GetEntityFeatures(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (result authoring.ListModelFeatureInformation, err error) + GetEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (result authoring.EntityRole, err error) + GetExplicitList(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (result authoring.ListExplicitListItem, err error) + GetExplicitListItem(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, itemID int64) (result authoring.ExplicitListItem, err error) + GetHierarchicalEntity(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID) (result authoring.HierarchicalEntityExtractor, err error) + GetHierarchicalEntityChild(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, hChildID uuid.UUID) (result authoring.HierarchicalChildEntity, err error) + GetHierarchicalEntityRole(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, roleID uuid.UUID) (result authoring.EntityRole, err error) + GetIntent(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID) (result authoring.IntentClassifier, err error) + GetIntentFeatures(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID) (result authoring.ListModelFeatureInformation, err error) + GetPatternAnyEntityInfo(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (result authoring.PatternAnyEntityExtractor, err error) + GetPatternAnyEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (result authoring.EntityRole, err error) + GetPrebuilt(ctx context.Context, appID uuid.UUID, versionID string, prebuiltID uuid.UUID) (result authoring.PrebuiltEntityExtractor, err error) + GetPrebuiltEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (result authoring.EntityRole, err error) + GetRegexEntityEntityInfo(ctx context.Context, appID uuid.UUID, versionID string, regexEntityID uuid.UUID) (result authoring.RegexEntityExtractor, err error) + GetRegexEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (result authoring.EntityRole, err error) + ListClosedListEntityRoles(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (result authoring.ListEntityRole, err error) + ListClosedLists(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result authoring.ListClosedListEntityExtractor, err error) + ListCompositeEntities(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result authoring.ListCompositeEntityExtractor, err error) + ListCompositeEntityRoles(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID) (result authoring.ListEntityRole, err error) + ListCustomPrebuiltEntities(ctx context.Context, appID uuid.UUID, versionID string) (result authoring.ListEntityExtractor, err error) + ListCustomPrebuiltEntityRoles(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (result authoring.ListEntityRole, err error) + ListCustomPrebuiltIntents(ctx context.Context, appID uuid.UUID, versionID string) (result authoring.ListIntentClassifier, err error) + ListCustomPrebuiltModels(ctx context.Context, appID uuid.UUID, versionID string) (result authoring.ListCustomPrebuiltModel, err error) + ListEntities(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result authoring.ListNDepthEntityExtractor, err error) + ListEntityRoles(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (result authoring.ListEntityRole, err error) + ListEntitySuggestions(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, take *int32) (result authoring.ListEntitiesSuggestionExample, err error) + ListHierarchicalEntities(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result authoring.ListHierarchicalEntityExtractor, err error) + ListHierarchicalEntityRoles(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID) (result authoring.ListEntityRole, err error) + ListIntents(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result authoring.ListIntentClassifier, err error) + ListIntentSuggestions(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID, take *int32) (result authoring.ListIntentsSuggestionExample, err error) + ListModels(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result authoring.ListModelInfoResponse, err error) + ListPatternAnyEntityInfos(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result authoring.ListPatternAnyEntityExtractor, err error) + ListPatternAnyEntityRoles(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (result authoring.ListEntityRole, err error) + ListPrebuiltEntities(ctx context.Context, appID uuid.UUID, versionID string) (result authoring.ListAvailablePrebuiltEntityModel, err error) + ListPrebuiltEntityRoles(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (result authoring.ListEntityRole, err error) + ListPrebuilts(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result authoring.ListPrebuiltEntityExtractor, err error) + ListRegexEntityInfos(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result authoring.ListRegexEntityExtractor, err error) + ListRegexEntityRoles(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (result authoring.ListEntityRole, err error) + PatchClosedList(ctx context.Context, appID uuid.UUID, versionID string, clEntityID uuid.UUID, closedListModelPatchObject authoring.ClosedListModelPatchObject) (result authoring.OperationStatus, err error) + ReplaceEntityFeatures(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, featureRelationsUpdateObject []authoring.ModelFeatureInformation) (result authoring.OperationStatus, err error) + ReplaceIntentFeatures(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID, featureRelationsUpdateObject []authoring.ModelFeatureInformation) (result authoring.OperationStatus, err error) + UpdateClosedList(ctx context.Context, appID uuid.UUID, versionID string, clEntityID uuid.UUID, closedListModelUpdateObject authoring.ClosedListModelUpdateObject) (result authoring.OperationStatus, err error) + UpdateClosedListEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID, entityRoleUpdateObject authoring.EntityRoleUpdateObject) (result authoring.OperationStatus, err error) + UpdateCompositeEntity(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID, compositeModelUpdateObject authoring.CompositeEntityModel) (result authoring.OperationStatus, err error) + UpdateCompositeEntityRole(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID, roleID uuid.UUID, entityRoleUpdateObject authoring.EntityRoleUpdateObject) (result authoring.OperationStatus, err error) + UpdateCustomPrebuiltEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID, entityRoleUpdateObject authoring.EntityRoleUpdateObject) (result authoring.OperationStatus, err error) + UpdateEntityChild(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, entityModelUpdateObject authoring.EntityModelUpdateObject) (result authoring.OperationStatus, err error) + UpdateEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID, entityRoleUpdateObject authoring.EntityRoleUpdateObject) (result authoring.OperationStatus, err error) + UpdateExplicitListItem(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, itemID int64, item authoring.ExplicitListItemUpdateObject) (result authoring.OperationStatus, err error) + UpdateHierarchicalEntity(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, modelUpdateObject authoring.ModelUpdateObject) (result authoring.OperationStatus, err error) + UpdateHierarchicalEntityChild(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, hChildID uuid.UUID, hierarchicalChildModelUpdateObject authoring.HierarchicalChildModelUpdateObject) (result authoring.OperationStatus, err error) + UpdateHierarchicalEntityRole(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, roleID uuid.UUID, entityRoleUpdateObject authoring.EntityRoleUpdateObject) (result authoring.OperationStatus, err error) + UpdateIntent(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID, modelUpdateObject authoring.ModelUpdateObject) (result authoring.OperationStatus, err error) + UpdatePatternAnyEntityModel(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, patternAnyUpdateObject authoring.PatternAnyModelUpdateObject) (result authoring.OperationStatus, err error) + UpdatePatternAnyEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID, entityRoleUpdateObject authoring.EntityRoleUpdateObject) (result authoring.OperationStatus, err error) + UpdatePrebuiltEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID, entityRoleUpdateObject authoring.EntityRoleUpdateObject) (result authoring.OperationStatus, err error) + UpdateRegexEntityModel(ctx context.Context, appID uuid.UUID, versionID string, regexEntityID uuid.UUID, regexEntityUpdateObject authoring.RegexModelUpdateObject) (result authoring.OperationStatus, err error) + UpdateRegexEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID, entityRoleUpdateObject authoring.EntityRoleUpdateObject) (result authoring.OperationStatus, err error) + UpdateSubList(ctx context.Context, appID uuid.UUID, versionID string, clEntityID uuid.UUID, subListID int64, wordListBaseUpdateObject authoring.WordListBaseUpdateObject) (result authoring.OperationStatus, err error) +} + +var _ ModelClientAPI = (*authoring.ModelClient)(nil) + +// AppsClientAPI contains the set of methods on the AppsClient type. +type AppsClientAPI interface { + Add(ctx context.Context, applicationCreateObject authoring.ApplicationCreateObject) (result authoring.UUID, err error) + AddCustomPrebuiltDomain(ctx context.Context, prebuiltDomainCreateObject authoring.PrebuiltDomainCreateObject) (result authoring.UUID, err error) + Delete(ctx context.Context, appID uuid.UUID, force *bool) (result authoring.OperationStatus, err error) + DownloadQueryLogs(ctx context.Context, appID uuid.UUID) (result authoring.ReadCloser, err error) + Get(ctx context.Context, appID uuid.UUID) (result authoring.ApplicationInfoResponse, err error) + GetPublishSettings(ctx context.Context, appID uuid.UUID) (result authoring.PublishSettings, err error) + GetSettings(ctx context.Context, appID uuid.UUID) (result authoring.ApplicationSettings, err error) + Import(ctx context.Context, luisApp authoring.LuisApp, appName string) (result authoring.UUID, err error) + List(ctx context.Context, skip *int32, take *int32) (result authoring.ListApplicationInfoResponse, err error) + ListAvailableCustomPrebuiltDomains(ctx context.Context) (result authoring.ListPrebuiltDomain, err error) + ListAvailableCustomPrebuiltDomainsForCulture(ctx context.Context, culture string) (result authoring.ListPrebuiltDomain, err error) + ListCortanaEndpoints(ctx context.Context) (result authoring.PersonalAssistantsResponse, err error) + ListDomains(ctx context.Context) (result authoring.ListString, err error) + ListEndpoints(ctx context.Context, appID uuid.UUID) (result authoring.SetString, err error) + ListSupportedCultures(ctx context.Context) (result authoring.ListAvailableCulture, err error) + ListUsageScenarios(ctx context.Context) (result authoring.ListString, err error) + PackagePublishedApplicationAsGzip(ctx context.Context, appID uuid.UUID, slotName string) (result authoring.ReadCloser, err error) + PackageTrainedApplicationAsGzip(ctx context.Context, appID uuid.UUID, versionID string) (result authoring.ReadCloser, err error) + Publish(ctx context.Context, appID uuid.UUID, applicationPublishObject authoring.ApplicationPublishObject) (result authoring.ProductionOrStagingEndpointInfo, err error) + Update(ctx context.Context, appID uuid.UUID, applicationUpdateObject authoring.ApplicationUpdateObject) (result authoring.OperationStatus, err error) + UpdatePublishSettings(ctx context.Context, appID uuid.UUID, publishSettingUpdateObject authoring.PublishSettingUpdateObject) (result authoring.OperationStatus, err error) + UpdateSettings(ctx context.Context, appID uuid.UUID, applicationSettingUpdateObject authoring.ApplicationSettingUpdateObject) (result authoring.OperationStatus, err error) +} + +var _ AppsClientAPI = (*authoring.AppsClient)(nil) + +// VersionsClientAPI contains the set of methods on the VersionsClient type. +type VersionsClientAPI interface { + Clone(ctx context.Context, appID uuid.UUID, versionID string, versionCloneObject authoring.TaskUpdateObject) (result authoring.String, err error) + Delete(ctx context.Context, appID uuid.UUID, versionID string) (result authoring.OperationStatus, err error) + DeleteUnlabelledUtterance(ctx context.Context, appID uuid.UUID, versionID string, utterance string) (result authoring.OperationStatus, err error) + Export(ctx context.Context, appID uuid.UUID, versionID string) (result authoring.LuisApp, err error) + Get(ctx context.Context, appID uuid.UUID, versionID string) (result authoring.VersionInfo, err error) + Import(ctx context.Context, appID uuid.UUID, luisApp authoring.LuisApp, versionID string) (result authoring.String, err error) + List(ctx context.Context, appID uuid.UUID, skip *int32, take *int32) (result authoring.ListVersionInfo, err error) + Update(ctx context.Context, appID uuid.UUID, versionID string, versionUpdateObject authoring.TaskUpdateObject) (result authoring.OperationStatus, err error) +} + +var _ VersionsClientAPI = (*authoring.VersionsClient)(nil) + +// TrainClientAPI contains the set of methods on the TrainClient type. +type TrainClientAPI interface { + GetStatus(ctx context.Context, appID uuid.UUID, versionID string) (result authoring.ListModelTrainingInfo, err error) + TrainVersion(ctx context.Context, appID uuid.UUID, versionID string) (result authoring.EnqueueTrainingResponse, err error) +} + +var _ TrainClientAPI = (*authoring.TrainClient)(nil) + +// PermissionsClientAPI contains the set of methods on the PermissionsClient type. +type PermissionsClientAPI interface { + Add(ctx context.Context, appID uuid.UUID, userToAdd authoring.UserCollaborator) (result authoring.OperationStatus, err error) + Delete(ctx context.Context, appID uuid.UUID, userToDelete authoring.UserCollaborator) (result authoring.OperationStatus, err error) + List(ctx context.Context, appID uuid.UUID) (result authoring.UserAccessList, err error) + Update(ctx context.Context, appID uuid.UUID, collaborators authoring.CollaboratorsArray) (result authoring.OperationStatus, err error) +} + +var _ PermissionsClientAPI = (*authoring.PermissionsClient)(nil) + +// PatternClientAPI contains the set of methods on the PatternClient type. +type PatternClientAPI interface { + AddPattern(ctx context.Context, appID uuid.UUID, versionID string, pattern authoring.PatternRuleCreateObject) (result authoring.PatternRuleInfo, err error) + BatchAddPatterns(ctx context.Context, appID uuid.UUID, versionID string, patterns []authoring.PatternRuleCreateObject) (result authoring.ListPatternRuleInfo, err error) + DeletePattern(ctx context.Context, appID uuid.UUID, versionID string, patternID uuid.UUID) (result authoring.OperationStatus, err error) + DeletePatterns(ctx context.Context, appID uuid.UUID, versionID string, patternIds []uuid.UUID) (result authoring.OperationStatus, err error) + ListIntentPatterns(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID, skip *int32, take *int32) (result authoring.ListPatternRuleInfo, err error) + ListPatterns(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result authoring.ListPatternRuleInfo, err error) + UpdatePattern(ctx context.Context, appID uuid.UUID, versionID string, patternID uuid.UUID, pattern authoring.PatternRuleUpdateObject) (result authoring.PatternRuleInfo, err error) + UpdatePatterns(ctx context.Context, appID uuid.UUID, versionID string, patterns []authoring.PatternRuleUpdateObject) (result authoring.ListPatternRuleInfo, err error) +} + +var _ PatternClientAPI = (*authoring.PatternClient)(nil) + +// SettingsClientAPI contains the set of methods on the SettingsClient type. +type SettingsClientAPI interface { + List(ctx context.Context, appID uuid.UUID, versionID string) (result authoring.ListAppVersionSettingObject, err error) + Update(ctx context.Context, appID uuid.UUID, versionID string, listOfAppVersionSettingObject []authoring.AppVersionSettingObject) (result authoring.OperationStatus, err error) +} + +var _ SettingsClientAPI = (*authoring.SettingsClient)(nil) + +// AzureAccountsClientAPI contains the set of methods on the AzureAccountsClient type. +type AzureAccountsClientAPI interface { + AssignToApp(ctx context.Context, appID uuid.UUID, azureAccountInfoObject *authoring.AzureAccountInfoObject) (result authoring.OperationStatus, err error) + GetAssigned(ctx context.Context, appID uuid.UUID) (result authoring.ListAzureAccountInfoObject, err error) + ListUserLUISAccounts(ctx context.Context) (result authoring.ListAzureAccountInfoObject, err error) + RemoveFromApp(ctx context.Context, appID uuid.UUID, azureAccountInfoObject *authoring.AzureAccountInfoObject) (result authoring.OperationStatus, err error) +} + +var _ AzureAccountsClientAPI = (*authoring.AzureAccountsClient)(nil) diff --git a/services/preview/cognitiveservices/v3.0/luis/authoring/azureaccounts.go b/services/preview/cognitiveservices/v3.0/luis/authoring/azureaccounts.go new file mode 100644 index 000000000000..0839f2f501f3 --- /dev/null +++ b/services/preview/cognitiveservices/v3.0/luis/authoring/azureaccounts.go @@ -0,0 +1,352 @@ +package authoring + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "github.com/satori/go.uuid" + "net/http" +) + +// AzureAccountsClient is the client for the AzureAccounts methods of the Authoring service. +type AzureAccountsClient struct { + BaseClient +} + +// NewAzureAccountsClient creates an instance of the AzureAccountsClient client. +func NewAzureAccountsClient(endpoint string) AzureAccountsClient { + return AzureAccountsClient{New(endpoint)} +} + +// AssignToApp assigns an Azure account to the application. +// Parameters: +// appID - the application ID. +// azureAccountInfoObject - the Azure account information object. +func (client AzureAccountsClient) AssignToApp(ctx context.Context, appID uuid.UUID, azureAccountInfoObject *AzureAccountInfoObject) (result OperationStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AzureAccountsClient.AssignToApp") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: azureAccountInfoObject, + Constraints: []validation.Constraint{{Target: "azureAccountInfoObject", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "azureAccountInfoObject.AzureSubscriptionID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "azureAccountInfoObject.ResourceGroup", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "azureAccountInfoObject.AccountName", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("authoring.AzureAccountsClient", "AssignToApp", err.Error()) + } + + req, err := client.AssignToAppPreparer(ctx, appID, azureAccountInfoObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.AzureAccountsClient", "AssignToApp", nil, "Failure preparing request") + return + } + + resp, err := client.AssignToAppSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "authoring.AzureAccountsClient", "AssignToApp", resp, "Failure sending request") + return + } + + result, err = client.AssignToAppResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.AzureAccountsClient", "AssignToApp", resp, "Failure responding to request") + } + + return +} + +// AssignToAppPreparer prepares the AssignToApp request. +func (client AzureAccountsClient) AssignToAppPreparer(ctx context.Context, appID uuid.UUID, azureAccountInfoObject *AzureAccountInfoObject) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "appId": autorest.Encode("path", appID), + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithPathParameters("/apps/{appId}/azureaccounts", pathParameters)) + if azureAccountInfoObject != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(azureAccountInfoObject)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AssignToAppSender sends the AssignToApp request. The method will close the +// http.Response Body if it receives an error. +func (client AzureAccountsClient) AssignToAppSender(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...) +} + +// AssignToAppResponder handles the response to the AssignToApp request. The method always +// closes the http.Response Body. +func (client AzureAccountsClient) AssignToAppResponder(resp *http.Response) (result OperationStatus, 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 +} + +// GetAssigned gets the LUIS Azure accounts assigned to the application for the user using his ARM token. +// Parameters: +// appID - the application ID. +func (client AzureAccountsClient) GetAssigned(ctx context.Context, appID uuid.UUID) (result ListAzureAccountInfoObject, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AzureAccountsClient.GetAssigned") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetAssignedPreparer(ctx, appID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.AzureAccountsClient", "GetAssigned", nil, "Failure preparing request") + return + } + + resp, err := client.GetAssignedSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "authoring.AzureAccountsClient", "GetAssigned", resp, "Failure sending request") + return + } + + result, err = client.GetAssignedResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.AzureAccountsClient", "GetAssigned", resp, "Failure responding to request") + } + + return +} + +// GetAssignedPreparer prepares the GetAssigned request. +func (client AzureAccountsClient) GetAssignedPreparer(ctx context.Context, appID uuid.UUID) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "appId": autorest.Encode("path", appID), + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithPathParameters("/apps/{appId}/azureaccounts", pathParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetAssignedSender sends the GetAssigned request. The method will close the +// http.Response Body if it receives an error. +func (client AzureAccountsClient) GetAssignedSender(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...) +} + +// GetAssignedResponder handles the response to the GetAssigned request. The method always +// closes the http.Response Body. +func (client AzureAccountsClient) GetAssignedResponder(resp *http.Response) (result ListAzureAccountInfoObject, 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 +} + +// ListUserLUISAccounts gets the LUIS Azure accounts for the user using his ARM token. +func (client AzureAccountsClient) ListUserLUISAccounts(ctx context.Context) (result ListAzureAccountInfoObject, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AzureAccountsClient.ListUserLUISAccounts") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListUserLUISAccountsPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.AzureAccountsClient", "ListUserLUISAccounts", nil, "Failure preparing request") + return + } + + resp, err := client.ListUserLUISAccountsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "authoring.AzureAccountsClient", "ListUserLUISAccounts", resp, "Failure sending request") + return + } + + result, err = client.ListUserLUISAccountsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.AzureAccountsClient", "ListUserLUISAccounts", resp, "Failure responding to request") + } + + return +} + +// ListUserLUISAccountsPreparer prepares the ListUserLUISAccounts request. +func (client AzureAccountsClient) ListUserLUISAccountsPreparer(ctx context.Context) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithPath("/azureaccounts")) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListUserLUISAccountsSender sends the ListUserLUISAccounts request. The method will close the +// http.Response Body if it receives an error. +func (client AzureAccountsClient) ListUserLUISAccountsSender(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...) +} + +// ListUserLUISAccountsResponder handles the response to the ListUserLUISAccounts request. The method always +// closes the http.Response Body. +func (client AzureAccountsClient) ListUserLUISAccountsResponder(resp *http.Response) (result ListAzureAccountInfoObject, 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 +} + +// RemoveFromApp removes assigned Azure account from the application. +// Parameters: +// appID - the application ID. +// azureAccountInfoObject - the Azure account information object. +func (client AzureAccountsClient) RemoveFromApp(ctx context.Context, appID uuid.UUID, azureAccountInfoObject *AzureAccountInfoObject) (result OperationStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AzureAccountsClient.RemoveFromApp") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: azureAccountInfoObject, + Constraints: []validation.Constraint{{Target: "azureAccountInfoObject", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "azureAccountInfoObject.AzureSubscriptionID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "azureAccountInfoObject.ResourceGroup", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "azureAccountInfoObject.AccountName", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("authoring.AzureAccountsClient", "RemoveFromApp", err.Error()) + } + + req, err := client.RemoveFromAppPreparer(ctx, appID, azureAccountInfoObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.AzureAccountsClient", "RemoveFromApp", nil, "Failure preparing request") + return + } + + resp, err := client.RemoveFromAppSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "authoring.AzureAccountsClient", "RemoveFromApp", resp, "Failure sending request") + return + } + + result, err = client.RemoveFromAppResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.AzureAccountsClient", "RemoveFromApp", resp, "Failure responding to request") + } + + return +} + +// RemoveFromAppPreparer prepares the RemoveFromApp request. +func (client AzureAccountsClient) RemoveFromAppPreparer(ctx context.Context, appID uuid.UUID, azureAccountInfoObject *AzureAccountInfoObject) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "appId": autorest.Encode("path", appID), + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithPathParameters("/apps/{appId}/azureaccounts", pathParameters)) + if azureAccountInfoObject != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(azureAccountInfoObject)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RemoveFromAppSender sends the RemoveFromApp request. The method will close the +// http.Response Body if it receives an error. +func (client AzureAccountsClient) RemoveFromAppSender(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...) +} + +// RemoveFromAppResponder handles the response to the RemoveFromApp request. The method always +// closes the http.Response Body. +func (client AzureAccountsClient) RemoveFromAppResponder(resp *http.Response) (result OperationStatus, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/cognitiveservices/v3.0/luis/authoring/client.go b/services/preview/cognitiveservices/v3.0/luis/authoring/client.go new file mode 100644 index 000000000000..52070803a823 --- /dev/null +++ b/services/preview/cognitiveservices/v3.0/luis/authoring/client.go @@ -0,0 +1,44 @@ +// Package authoring implements the Azure ARM Authoring service API version 3.0-preview. +// +// +package authoring + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +// BaseClient is the base client for Authoring. +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, + } +} diff --git a/services/preview/cognitiveservices/v3.0/luis/authoring/examples.go b/services/preview/cognitiveservices/v3.0/luis/authoring/examples.go new file mode 100644 index 000000000000..8fe2b086e25c --- /dev/null +++ b/services/preview/cognitiveservices/v3.0/luis/authoring/examples.go @@ -0,0 +1,375 @@ +package authoring + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "github.com/satori/go.uuid" + "net/http" +) + +// ExamplesClient is the client for the Examples methods of the Authoring service. +type ExamplesClient struct { + BaseClient +} + +// NewExamplesClient creates an instance of the ExamplesClient client. +func NewExamplesClient(endpoint string) ExamplesClient { + return ExamplesClient{New(endpoint)} +} + +// Add adds a labeled example utterance in a version of the application. +// Parameters: +// appID - the application ID. +// versionID - the version ID. +// exampleLabelObject - a labeled example utterance with the expected intent and entities. +func (client ExamplesClient) Add(ctx context.Context, appID uuid.UUID, versionID string, exampleLabelObject ExampleLabelObject) (result LabelExampleResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExamplesClient.Add") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.AddPreparer(ctx, appID, versionID, exampleLabelObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ExamplesClient", "Add", resp, "Failure sending request") + return + } + + result, err = client.AddResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 example utterances to a version of the application. +// Parameters: +// appID - the application ID. +// versionID - the version ID. +// exampleLabelObjectArray - array of example utterances. +func (client ExamplesClient) Batch(ctx context.Context, appID uuid.UUID, versionID string, exampleLabelObjectArray []ExampleLabelObject) (result ListBatchLabelExample, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExamplesClient.Batch") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + 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("authoring.ExamplesClient", "Batch", err.Error()) + } + + req, err := client.BatchPreparer(ctx, appID, versionID, exampleLabelObjectArray) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ExamplesClient", "Batch", resp, "Failure sending request") + return + } + + result, err = client.BatchResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 utterances with the specified ID from a version of the application. +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExamplesClient.Delete") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, appID, versionID, exampleID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ExamplesClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + 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 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 example utterances to be reviewed from a version of the application. +// 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 tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExamplesClient.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: 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: int64(500), Chain: nil}, + {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("authoring.ExamplesClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, appID, versionID, skip, take) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ExamplesClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + 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 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/preview/cognitiveservices/v3.0/luis/authoring/features.go b/services/preview/cognitiveservices/v3.0/luis/authoring/features.go new file mode 100644 index 000000000000..58c6067d6245 --- /dev/null +++ b/services/preview/cognitiveservices/v3.0/luis/authoring/features.go @@ -0,0 +1,712 @@ +package authoring + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "github.com/satori/go.uuid" + "net/http" +) + +// FeaturesClient is the client for the Features methods of the Authoring service. +type FeaturesClient struct { + BaseClient +} + +// NewFeaturesClient creates an instance of the FeaturesClient client. +func NewFeaturesClient(endpoint string) FeaturesClient { + return FeaturesClient{New(endpoint)} +} + +// AddEntityFeature adds a new feature relation to be used by the entity in a version of the application. +// Parameters: +// appID - the application ID. +// versionID - the version ID. +// entityID - the entity extractor ID. +// featureRelationCreateObject - a Feature relation information object. +func (client FeaturesClient) AddEntityFeature(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, featureRelationCreateObject ModelFeatureInformation) (result OperationStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FeaturesClient.AddEntityFeature") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.AddEntityFeaturePreparer(ctx, appID, versionID, entityID, featureRelationCreateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.FeaturesClient", "AddEntityFeature", nil, "Failure preparing request") + return + } + + resp, err := client.AddEntityFeatureSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "authoring.FeaturesClient", "AddEntityFeature", resp, "Failure sending request") + return + } + + result, err = client.AddEntityFeatureResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.FeaturesClient", "AddEntityFeature", resp, "Failure responding to request") + } + + return +} + +// AddEntityFeaturePreparer prepares the AddEntityFeature request. +func (client FeaturesClient) AddEntityFeaturePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, featureRelationCreateObject ModelFeatureInformation) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities/{entityId}/features", pathParameters), + autorest.WithJSON(featureRelationCreateObject)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AddEntityFeatureSender sends the AddEntityFeature request. The method will close the +// http.Response Body if it receives an error. +func (client FeaturesClient) AddEntityFeatureSender(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...) +} + +// AddEntityFeatureResponder handles the response to the AddEntityFeature request. The method always +// closes the http.Response Body. +func (client FeaturesClient) AddEntityFeatureResponder(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 +} + +// AddIntentFeature adds a new feature relation to be used by the intent in a version of the application. +// Parameters: +// appID - the application ID. +// versionID - the version ID. +// intentID - the intent classifier ID. +// featureRelationCreateObject - a Feature relation information object. +func (client FeaturesClient) AddIntentFeature(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID, featureRelationCreateObject ModelFeatureInformation) (result OperationStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FeaturesClient.AddIntentFeature") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.AddIntentFeaturePreparer(ctx, appID, versionID, intentID, featureRelationCreateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.FeaturesClient", "AddIntentFeature", nil, "Failure preparing request") + return + } + + resp, err := client.AddIntentFeatureSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "authoring.FeaturesClient", "AddIntentFeature", resp, "Failure sending request") + return + } + + result, err = client.AddIntentFeatureResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.FeaturesClient", "AddIntentFeature", resp, "Failure responding to request") + } + + return +} + +// AddIntentFeaturePreparer prepares the AddIntentFeature request. +func (client FeaturesClient) AddIntentFeaturePreparer(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID, featureRelationCreateObject ModelFeatureInformation) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + 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.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/intents/{intentId}/features", pathParameters), + autorest.WithJSON(featureRelationCreateObject)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AddIntentFeatureSender sends the AddIntentFeature request. The method will close the +// http.Response Body if it receives an error. +func (client FeaturesClient) AddIntentFeatureSender(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...) +} + +// AddIntentFeatureResponder handles the response to the AddIntentFeature request. The method always +// closes the http.Response Body. +func (client FeaturesClient) AddIntentFeatureResponder(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 +} + +// AddPhraseList creates a new phraselist feature in a version of the application. +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FeaturesClient.AddPhraseList") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.AddPhraseListPreparer(ctx, appID, versionID, phraselistCreateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.FeaturesClient", "AddPhraseList", resp, "Failure sending request") + return + } + + result, err = client.AddPhraseListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 from a version of the application. +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FeaturesClient.DeletePhraseList") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePhraseListPreparer(ctx, appID, versionID, phraselistID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.FeaturesClient", "DeletePhraseList", resp, "Failure sending request") + return + } + + result, err = client.DeletePhraseListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 in a version of the application. +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FeaturesClient.GetPhraseList") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPhraseListPreparer(ctx, appID, versionID, phraselistID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.FeaturesClient", "GetPhraseList", resp, "Failure sending request") + return + } + + result, err = client.GetPhraseListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 phraselist and pattern features in a version of the application. +// 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 tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FeaturesClient.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: 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: int64(500), Chain: nil}, + {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("authoring.FeaturesClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, appID, versionID, skip, take) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.FeaturesClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + 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 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 in a version of the application. +// 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 tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FeaturesClient.ListPhraseLists") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + 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: int64(500), Chain: nil}, + {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("authoring.FeaturesClient", "ListPhraseLists", err.Error()) + } + + req, err := client.ListPhraseListsPreparer(ctx, appID, versionID, skip, take) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.FeaturesClient", "ListPhraseLists", resp, "Failure sending request") + return + } + + result, err = client.ListPhraseListsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 in a version of the +// application. +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FeaturesClient.UpdatePhraseList") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePhraseListPreparer(ctx, appID, versionID, phraselistID, phraselistUpdateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.FeaturesClient", "UpdatePhraseList", resp, "Failure sending request") + return + } + + result, err = client.UpdatePhraseListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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/preview/cognitiveservices/v3.0/luis/authoring/model.go b/services/preview/cognitiveservices/v3.0/luis/authoring/model.go new file mode 100644 index 000000000000..eebc34e1e621 --- /dev/null +++ b/services/preview/cognitiveservices/v3.0/luis/authoring/model.go @@ -0,0 +1,8902 @@ +package authoring + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "github.com/satori/go.uuid" + "net/http" +) + +// ModelClient is the client for the Model methods of the Authoring service. +type ModelClient struct { + BaseClient +} + +// NewModelClient creates an instance of the ModelClient client. +func NewModelClient(endpoint string) ModelClient { + return ModelClient{New(endpoint)} +} + +// AddClosedList adds a list entity model to a version of the application. +// Parameters: +// appID - the application ID. +// versionID - the version ID. +// closedListModelCreateObject - a model containing the name and words for the new list entity extractor. +func (client ModelClient) AddClosedList(ctx context.Context, appID uuid.UUID, versionID string, closedListModelCreateObject ClosedListModelCreateObject) (result UUID, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.AddClosedList") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.AddClosedListPreparer(ctx, appID, versionID, closedListModelCreateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "AddClosedList", resp, "Failure sending request") + return + } + + result, err = client.AddClosedListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 +} + +// AddCompositeEntityChild creates a single child in an existing composite entity model in a version of the +// application. +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.AddCompositeEntityChild") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.AddCompositeEntityChildPreparer(ctx, appID, versionID, cEntityID, compositeChildModelCreateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "AddCompositeEntityChild", resp, "Failure sending request") + return + } + + result, err = client.AddCompositeEntityChildResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 intent and entity models in a +// version of the 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.AddCustomPrebuiltDomain") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.AddCustomPrebuiltDomainPreparer(ctx, appID, versionID, prebuiltDomainObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "AddCustomPrebuiltDomain", resp, "Failure sending request") + return + } + + result, err = client.AddCustomPrebuiltDomainResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 prebuilt entity model to a version of the application. +// Parameters: +// appID - the application ID. +// versionID - the version ID. +// prebuiltDomainModelCreateObject - a model object containing the name of the 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.AddCustomPrebuiltEntity") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.AddCustomPrebuiltEntityPreparer(ctx, appID, versionID, prebuiltDomainModelCreateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "AddCustomPrebuiltEntity", resp, "Failure sending request") + return + } + + result, err = client.AddCustomPrebuiltEntityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 customizable prebuilt intent model to a version of the application. +// Parameters: +// appID - the application ID. +// versionID - the version ID. +// prebuiltDomainModelCreateObject - a model object containing the name of the customizable 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.AddCustomPrebuiltIntent") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.AddCustomPrebuiltIntentPreparer(ctx, appID, versionID, prebuiltDomainModelCreateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "AddCustomPrebuiltIntent", resp, "Failure sending request") + return + } + + result, err = client.AddCustomPrebuiltIntentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 a version of the application. +// Parameters: +// appID - the application ID. +// versionID - the version ID. +// entityModelCreateObject - a model object containing the name of the new entity extractor and its children. +func (client ModelClient) AddEntity(ctx context.Context, appID uuid.UUID, versionID string, entityModelCreateObject EntityModelCreateObject) (result UUID, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.AddEntity") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.AddEntityPreparer(ctx, appID, versionID, entityModelCreateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "AddEntity", resp, "Failure sending request") + return + } + + result, err = client.AddEntityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, entityModelCreateObject EntityModelCreateObject) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities", pathParameters), + autorest.WithJSON(entityModelCreateObject)) + 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 +} + +// AddEntityChild creates a single child in an existing entity model hierarchy in a version of the application. +// Parameters: +// appID - the application ID. +// versionID - the version ID. +// entityID - the entity extractor ID. +// childEntityModelCreateObject - a model object containing the name of the new child model and its children. +func (client ModelClient) AddEntityChild(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, childEntityModelCreateObject ChildEntityModelCreateObject) (result UUID, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.AddEntityChild") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.AddEntityChildPreparer(ctx, appID, versionID, entityID, childEntityModelCreateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "AddEntityChild", nil, "Failure preparing request") + return + } + + resp, err := client.AddEntityChildSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "AddEntityChild", resp, "Failure sending request") + return + } + + result, err = client.AddEntityChildResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "AddEntityChild", resp, "Failure responding to request") + } + + return +} + +// AddEntityChildPreparer prepares the AddEntityChild request. +func (client ModelClient) AddEntityChildPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, childEntityModelCreateObject ChildEntityModelCreateObject) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities/{entityId}/children", pathParameters), + autorest.WithJSON(childEntityModelCreateObject)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AddEntityChildSender sends the AddEntityChild request. The method will close the +// http.Response Body if it receives an error. +func (client ModelClient) AddEntityChildSender(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...) +} + +// AddEntityChildResponder handles the response to the AddEntityChild request. The method always +// closes the http.Response Body. +func (client ModelClient) AddEntityChildResponder(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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.AddExplicitListItem") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.AddExplicitListItemPreparer(ctx, appID, versionID, entityID, item) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "AddExplicitListItem", resp, "Failure sending request") + return + } + + result, err = client.AddExplicitListItemResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 +} + +// AddIntent adds an intent to a version of the application. +// Parameters: +// appID - the application ID. +// versionID - the version ID. +// intentCreateObject - a model object containing the name of the new intent. +func (client ModelClient) AddIntent(ctx context.Context, appID uuid.UUID, versionID string, intentCreateObject ModelCreateObject) (result UUID, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.AddIntent") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.AddIntentPreparer(ctx, appID, versionID, intentCreateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "AddIntent", resp, "Failure sending request") + return + } + + result, err = client.AddIntentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 entities to a version of 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 tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.AddPrebuilt") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + 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("authoring.ModelClient", "AddPrebuilt", err.Error()) + } + + req, err := client.AddPrebuiltPreparer(ctx, appID, versionID, prebuiltExtractorNames) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "AddPrebuilt", resp, "Failure sending request") + return + } + + result, err = client.AddPrebuiltResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 sublist to an existing list entity in a version of the application. +// Parameters: +// appID - the application ID. +// versionID - the version ID. +// clEntityID - the 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 Int64, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.AddSubList") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.AddSubListPreparer(ctx, appID, versionID, clEntityID, wordListCreateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "AddSubList", resp, "Failure sending request") + return + } + + result, err = client.AddSubListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// AddSubListResponder handles the response to the AddSubList request. The method always +// closes the http.Response Body. +func (client ModelClient) AddSubListResponder(resp *http.Response) (result Int64, 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.CreateClosedListEntityRole") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateClosedListEntityRolePreparer(ctx, appID, versionID, entityID, entityRoleCreateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "CreateClosedListEntityRole", resp, "Failure sending request") + return + } + + result, err = client.CreateClosedListEntityRoleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.CreateCompositeEntityRole") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateCompositeEntityRolePreparer(ctx, appID, versionID, cEntityID, entityRoleCreateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "CreateCompositeEntityRole", resp, "Failure sending request") + return + } + + result, err = client.CreateCompositeEntityRoleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.CreateCustomPrebuiltEntityRole") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateCustomPrebuiltEntityRolePreparer(ctx, appID, versionID, entityID, entityRoleCreateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "CreateCustomPrebuiltEntityRole", resp, "Failure sending request") + return + } + + result, err = client.CreateCustomPrebuiltEntityRoleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.CreateEntityRole") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateEntityRolePreparer(ctx, appID, versionID, entityID, entityRoleCreateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "CreateEntityRole", resp, "Failure sending request") + return + } + + result, err = client.CreateEntityRoleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.CreateHierarchicalEntityRole") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateHierarchicalEntityRolePreparer(ctx, appID, versionID, hEntityID, entityRoleCreateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "CreateHierarchicalEntityRole", resp, "Failure sending request") + return + } + + result, err = client.CreateHierarchicalEntityRoleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.CreatePatternAnyEntityModel") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePatternAnyEntityModelPreparer(ctx, appID, versionID, extractorCreateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "CreatePatternAnyEntityModel", resp, "Failure sending request") + return + } + + result, err = client.CreatePatternAnyEntityModelResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.CreatePatternAnyEntityRole") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePatternAnyEntityRolePreparer(ctx, appID, versionID, entityID, entityRoleCreateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "CreatePatternAnyEntityRole", resp, "Failure sending request") + return + } + + result, err = client.CreatePatternAnyEntityRoleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.CreatePrebuiltEntityRole") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePrebuiltEntityRolePreparer(ctx, appID, versionID, entityID, entityRoleCreateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "CreatePrebuiltEntityRole", resp, "Failure sending request") + return + } + + result, err = client.CreatePrebuiltEntityRoleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 regular +// expression entity extractor. +func (client ModelClient) CreateRegexEntityModel(ctx context.Context, appID uuid.UUID, versionID string, regexEntityExtractorCreateObj RegexModelCreateObject) (result UUID, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.CreateRegexEntityModel") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateRegexEntityModelPreparer(ctx, appID, versionID, regexEntityExtractorCreateObj) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "CreateRegexEntityModel", resp, "Failure sending request") + return + } + + result, err = client.CreateRegexEntityModelResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.CreateRegexEntityRole") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateRegexEntityRolePreparer(ctx, appID, versionID, entityID, entityRoleCreateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "CreateRegexEntityRole", resp, "Failure sending request") + return + } + + result, err = client.CreateRegexEntityRoleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 list entity model from a version of the application. +// Parameters: +// appID - the application ID. +// versionID - the version ID. +// clEntityID - the list entity model ID. +func (client ModelClient) DeleteClosedList(ctx context.Context, appID uuid.UUID, versionID string, clEntityID uuid.UUID) (result OperationStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.DeleteClosedList") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeleteClosedListPreparer(ctx, appID, versionID, clEntityID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "DeleteClosedList", resp, "Failure sending request") + return + } + + result, err = client.DeleteClosedListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.DeleteClosedListEntityRole") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeleteClosedListEntityRolePreparer(ctx, appID, versionID, entityID, roleID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "DeleteClosedListEntityRole", resp, "Failure sending request") + return + } + + result, err = client.DeleteClosedListEntityRoleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 from a version of 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.DeleteCompositeEntity") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeleteCompositeEntityPreparer(ctx, appID, versionID, cEntityID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "DeleteCompositeEntity", resp, "Failure sending request") + return + } + + result, err = client.DeleteCompositeEntityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 a version of 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.DeleteCompositeEntityChild") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeleteCompositeEntityChildPreparer(ctx, appID, versionID, cEntityID, cChildID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "DeleteCompositeEntityChild", resp, "Failure sending request") + return + } + + result, err = client.DeleteCompositeEntityChildResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.DeleteCompositeEntityRole") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeleteCompositeEntityRolePreparer(ctx, appID, versionID, cEntityID, roleID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "DeleteCompositeEntityRole", resp, "Failure sending request") + return + } + + result, err = client.DeleteCompositeEntityRoleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.DeleteCustomEntityRole") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeleteCustomEntityRolePreparer(ctx, appID, versionID, entityID, roleID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "DeleteCustomEntityRole", resp, "Failure sending request") + return + } + + result, err = client.DeleteCustomEntityRoleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 in a version of 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.DeleteCustomPrebuiltDomain") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeleteCustomPrebuiltDomainPreparer(ctx, appID, versionID, domainName) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "DeleteCustomPrebuiltDomain", resp, "Failure sending request") + return + } + + result, err = client.DeleteCustomPrebuiltDomainResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 or a child from a version of the application. +// Parameters: +// appID - the application ID. +// versionID - the version ID. +// entityID - the entity extractor or the child entity extractor ID. +func (client ModelClient) DeleteEntity(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (result OperationStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.DeleteEntity") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeleteEntityPreparer(ctx, appID, versionID, entityID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "DeleteEntity", resp, "Failure sending request") + return + } + + result, err = client.DeleteEntityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 +} + +// DeleteEntityFeature deletes a relation from the feature relations used by the entity in a version of the +// application. +// Parameters: +// appID - the application ID. +// versionID - the version ID. +// entityID - the entity extractor ID. +// featureRelationDeleteObject - a feature information object containing the feature relation to delete. +func (client ModelClient) DeleteEntityFeature(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, featureRelationDeleteObject ModelFeatureInformation) (result OperationStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.DeleteEntityFeature") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeleteEntityFeaturePreparer(ctx, appID, versionID, entityID, featureRelationDeleteObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "DeleteEntityFeature", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteEntityFeatureSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "DeleteEntityFeature", resp, "Failure sending request") + return + } + + result, err = client.DeleteEntityFeatureResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "DeleteEntityFeature", resp, "Failure responding to request") + } + + return +} + +// DeleteEntityFeaturePreparer prepares the DeleteEntityFeature request. +func (client ModelClient) DeleteEntityFeaturePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, featureRelationDeleteObject ModelFeatureInformation) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + 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.AsDelete(), + autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities/{entityId}/features", pathParameters), + autorest.WithJSON(featureRelationDeleteObject)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteEntityFeatureSender sends the DeleteEntityFeature request. The method will close the +// http.Response Body if it receives an error. +func (client ModelClient) DeleteEntityFeatureSender(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...) +} + +// DeleteEntityFeatureResponder handles the response to the DeleteEntityFeature request. The method always +// closes the http.Response Body. +func (client ModelClient) DeleteEntityFeatureResponder(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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.DeleteEntityRole") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeleteEntityRolePreparer(ctx, appID, versionID, entityID, roleID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "DeleteEntityRole", resp, "Failure sending request") + return + } + + result, err = client.DeleteEntityRoleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.DeleteExplicitListItem") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeleteExplicitListItemPreparer(ctx, appID, versionID, entityID, itemID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "DeleteExplicitListItem", resp, "Failure sending request") + return + } + + result, err = client.DeleteExplicitListItemResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 from a version of the application. +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.DeleteHierarchicalEntity") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeleteHierarchicalEntityPreparer(ctx, appID, versionID, hEntityID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "DeleteHierarchicalEntity", resp, "Failure sending request") + return + } + + result, err = client.DeleteHierarchicalEntityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 in a version of 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.DeleteHierarchicalEntityChild") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeleteHierarchicalEntityChildPreparer(ctx, appID, versionID, hEntityID, hChildID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "DeleteHierarchicalEntityChild", resp, "Failure sending request") + return + } + + result, err = client.DeleteHierarchicalEntityChildResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.DeleteHierarchicalEntityRole") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeleteHierarchicalEntityRolePreparer(ctx, appID, versionID, hEntityID, roleID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "DeleteHierarchicalEntityRole", resp, "Failure sending request") + return + } + + result, err = client.DeleteHierarchicalEntityRoleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 from a version of the application. +// Parameters: +// appID - the application ID. +// versionID - the version ID. +// intentID - the intent classifier ID. +// deleteUtterances - if true, deletes the intent's example utterances. If false, moves the example utterances +// to the None intent. The default value is false. +func (client ModelClient) DeleteIntent(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID, deleteUtterances *bool) (result OperationStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.DeleteIntent") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeleteIntentPreparer(ctx, appID, versionID, intentID, deleteUtterances) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "DeleteIntent", resp, "Failure sending request") + return + } + + result, err = client.DeleteIntentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 +} + +// DeleteIntentFeature deletes a relation from the feature relations used by the intent in a version of the +// application. +// Parameters: +// appID - the application ID. +// versionID - the version ID. +// intentID - the intent classifier ID. +// featureRelationDeleteObject - a feature information object containing the feature relation to delete. +func (client ModelClient) DeleteIntentFeature(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID, featureRelationDeleteObject ModelFeatureInformation) (result OperationStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.DeleteIntentFeature") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeleteIntentFeaturePreparer(ctx, appID, versionID, intentID, featureRelationDeleteObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "DeleteIntentFeature", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteIntentFeatureSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "DeleteIntentFeature", resp, "Failure sending request") + return + } + + result, err = client.DeleteIntentFeatureResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "DeleteIntentFeature", resp, "Failure responding to request") + } + + return +} + +// DeleteIntentFeaturePreparer prepares the DeleteIntentFeature request. +func (client ModelClient) DeleteIntentFeaturePreparer(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID, featureRelationDeleteObject ModelFeatureInformation) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + 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.AsDelete(), + autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/intents/{intentId}/features", pathParameters), + autorest.WithJSON(featureRelationDeleteObject)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteIntentFeatureSender sends the DeleteIntentFeature request. The method will close the +// http.Response Body if it receives an error. +func (client ModelClient) DeleteIntentFeatureSender(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...) +} + +// DeleteIntentFeatureResponder handles the response to the DeleteIntentFeature request. The method always +// closes the http.Response Body. +func (client ModelClient) DeleteIntentFeatureResponder(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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.DeletePatternAnyEntityModel") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePatternAnyEntityModelPreparer(ctx, appID, versionID, entityID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "DeletePatternAnyEntityModel", resp, "Failure sending request") + return + } + + result, err = client.DeletePatternAnyEntityModelResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.DeletePatternAnyEntityRole") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePatternAnyEntityRolePreparer(ctx, appID, versionID, entityID, roleID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "DeletePatternAnyEntityRole", resp, "Failure sending request") + return + } + + result, err = client.DeletePatternAnyEntityRoleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 a version of 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.DeletePrebuilt") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePrebuiltPreparer(ctx, appID, versionID, prebuiltID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "DeletePrebuilt", resp, "Failure sending request") + return + } + + result, err = client.DeletePrebuiltResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.DeletePrebuiltEntityRole") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePrebuiltEntityRolePreparer(ctx, appID, versionID, entityID, roleID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "DeletePrebuiltEntityRole", resp, "Failure sending request") + return + } + + result, err = client.DeletePrebuiltEntityRoleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 regular expression entity extractor ID. +func (client ModelClient) DeleteRegexEntityModel(ctx context.Context, appID uuid.UUID, versionID string, regexEntityID uuid.UUID) (result OperationStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.DeleteRegexEntityModel") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeleteRegexEntityModelPreparer(ctx, appID, versionID, regexEntityID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "DeleteRegexEntityModel", resp, "Failure sending request") + return + } + + result, err = client.DeleteRegexEntityModelResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.DeleteRegexEntityRole") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeleteRegexEntityRolePreparer(ctx, appID, versionID, entityID, roleID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "DeleteRegexEntityRole", resp, "Failure sending request") + return + } + + result, err = client.DeleteRegexEntityRoleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 list entity model from a version of the application. +// Parameters: +// appID - the application ID. +// versionID - the version ID. +// clEntityID - the list entity extractor ID. +// subListID - the sublist ID. +func (client ModelClient) DeleteSubList(ctx context.Context, appID uuid.UUID, versionID string, clEntityID uuid.UUID, subListID int64) (result OperationStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.DeleteSubList") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeleteSubListPreparer(ctx, appID, versionID, clEntityID, subListID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "DeleteSubList", resp, "Failure sending request") + return + } + + result, err = client.DeleteSubListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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 int64) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 +} + +// ExamplesMethod gets the example utterances for the given intent or entity model in a version of the application. +// Parameters: +// appID - the application ID. +// versionID - the version ID. +// modelID - the ID (GUID) of the model. +// 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) ExamplesMethod(ctx context.Context, appID uuid.UUID, versionID string, modelID string, skip *int32, take *int32) (result ListLabelTextObject, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.ExamplesMethod") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + 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: int64(500), Chain: nil}, + {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("authoring.ModelClient", "ExamplesMethod", err.Error()) + } + + req, err := client.ExamplesMethodPreparer(ctx, appID, versionID, modelID, skip, take) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ExamplesMethod", nil, "Failure preparing request") + return + } + + resp, err := client.ExamplesMethodSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ExamplesMethod", resp, "Failure sending request") + return + } + + result, err = client.ExamplesMethodResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ExamplesMethod", resp, "Failure responding to request") + } + + return +} + +// ExamplesMethodPreparer prepares the ExamplesMethod request. +func (client ModelClient) ExamplesMethodPreparer(ctx context.Context, appID uuid.UUID, versionID string, modelID string, skip *int32, take *int32) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "appId": autorest.Encode("path", appID), + "modelId": autorest.Encode("path", modelID), + "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("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/models/{modelId}/examples", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ExamplesMethodSender sends the ExamplesMethod request. The method will close the +// http.Response Body if it receives an error. +func (client ModelClient) ExamplesMethodSender(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...) +} + +// ExamplesMethodResponder handles the response to the ExamplesMethod request. The method always +// closes the http.Response Body. +func (client ModelClient) ExamplesMethodResponder(resp *http.Response) (result ListLabelTextObject, 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 +} + +// GetClosedList gets information about a list entity in a version of the application. +// Parameters: +// appID - the application ID. +// versionID - the version ID. +// clEntityID - the list model ID. +func (client ModelClient) GetClosedList(ctx context.Context, appID uuid.UUID, versionID string, clEntityID uuid.UUID) (result ClosedListEntityExtractor, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.GetClosedList") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetClosedListPreparer(ctx, appID, versionID, clEntityID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "GetClosedList", resp, "Failure sending request") + return + } + + result, err = client.GetClosedListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.GetClosedListEntityRole") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetClosedListEntityRolePreparer(ctx, appID, versionID, entityID, roleID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "GetClosedListEntityRole", resp, "Failure sending request") + return + } + + result, err = client.GetClosedListEntityRoleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 +} + +// GetCompositeEntity gets information about a composite entity in a version of the application. +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.GetCompositeEntity") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetCompositeEntityPreparer(ctx, appID, versionID, cEntityID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "GetCompositeEntity", resp, "Failure sending request") + return + } + + result, err = client.GetCompositeEntityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.GetCompositeEntityRole") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetCompositeEntityRolePreparer(ctx, appID, versionID, cEntityID, roleID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "GetCompositeEntityRole", resp, "Failure sending request") + return + } + + result, err = client.GetCompositeEntityRoleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.GetCustomEntityRole") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetCustomEntityRolePreparer(ctx, appID, versionID, entityID, roleID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "GetCustomEntityRole", resp, "Failure sending request") + return + } + + result, err = client.GetCustomEntityRoleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 +} + +// GetEntity gets information about an entity model in a version of the application. +// 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 NDepthEntityExtractor, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.GetEntity") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetEntityPreparer(ctx, appID, versionID, entityID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "GetEntity", resp, "Failure sending request") + return + } + + result, err = client.GetEntityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetEntityResponder handles the response to the GetEntity request. The method always +// closes the http.Response Body. +func (client ModelClient) GetEntityResponder(resp *http.Response) (result NDepthEntityExtractor, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetEntityFeatures gets the information of the features used by the entity in a version of the application. +// Parameters: +// appID - the application ID. +// versionID - the version ID. +// entityID - the entity extractor ID. +func (client ModelClient) GetEntityFeatures(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (result ListModelFeatureInformation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.GetEntityFeatures") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetEntityFeaturesPreparer(ctx, appID, versionID, entityID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "GetEntityFeatures", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityFeaturesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "GetEntityFeatures", resp, "Failure sending request") + return + } + + result, err = client.GetEntityFeaturesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "GetEntityFeatures", resp, "Failure responding to request") + } + + return +} + +// GetEntityFeaturesPreparer prepares the GetEntityFeatures request. +func (client ModelClient) GetEntityFeaturesPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities/{entityId}/features", pathParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityFeaturesSender sends the GetEntityFeatures request. The method will close the +// http.Response Body if it receives an error. +func (client ModelClient) GetEntityFeaturesSender(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...) +} + +// GetEntityFeaturesResponder handles the response to the GetEntityFeatures request. The method always +// closes the http.Response Body. +func (client ModelClient) GetEntityFeaturesResponder(resp *http.Response) (result ListModelFeatureInformation, 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 +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.GetEntityRole") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetEntityRolePreparer(ctx, appID, versionID, entityID, roleID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "GetEntityRole", resp, "Failure sending request") + return + } + + result, err = client.GetEntityRoleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.GetExplicitList") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetExplicitListPreparer(ctx, appID, versionID, entityID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "GetExplicitList", resp, "Failure sending request") + return + } + + result, err = client.GetExplicitListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.GetExplicitListItem") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetExplicitListItemPreparer(ctx, appID, versionID, entityID, itemID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "GetExplicitListItem", resp, "Failure sending request") + return + } + + result, err = client.GetExplicitListItemResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 a hierarchical entity in a version of the application. +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.GetHierarchicalEntity") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetHierarchicalEntityPreparer(ctx, appID, versionID, hEntityID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "GetHierarchicalEntity", resp, "Failure sending request") + return + } + + result, err = client.GetHierarchicalEntityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 child's model contained in an hierarchical entity child model +// in a version of 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) GetHierarchicalEntityChild(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, hChildID uuid.UUID) (result HierarchicalChildEntity, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.GetHierarchicalEntityChild") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetHierarchicalEntityChildPreparer(ctx, appID, versionID, hEntityID, hChildID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "GetHierarchicalEntityChild", resp, "Failure sending request") + return + } + + result, err = client.GetHierarchicalEntityChildResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.GetHierarchicalEntityRole") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetHierarchicalEntityRolePreparer(ctx, appID, versionID, hEntityID, roleID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "GetHierarchicalEntityRole", resp, "Failure sending request") + return + } + + result, err = client.GetHierarchicalEntityRoleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 +} + +// GetIntent gets information about the intent model in a version of the application. +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.GetIntent") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetIntentPreparer(ctx, appID, versionID, intentID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "GetIntent", resp, "Failure sending request") + return + } + + result, err = client.GetIntentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 +} + +// GetIntentFeatures gets the information of the features used by the intent in a version of the application. +// Parameters: +// appID - the application ID. +// versionID - the version ID. +// intentID - the intent classifier ID. +func (client ModelClient) GetIntentFeatures(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID) (result ListModelFeatureInformation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.GetIntentFeatures") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetIntentFeaturesPreparer(ctx, appID, versionID, intentID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "GetIntentFeatures", nil, "Failure preparing request") + return + } + + resp, err := client.GetIntentFeaturesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "GetIntentFeatures", resp, "Failure sending request") + return + } + + result, err = client.GetIntentFeaturesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "GetIntentFeatures", resp, "Failure responding to request") + } + + return +} + +// GetIntentFeaturesPreparer prepares the GetIntentFeatures request. +func (client ModelClient) GetIntentFeaturesPreparer(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/intents/{intentId}/features", pathParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetIntentFeaturesSender sends the GetIntentFeatures request. The method will close the +// http.Response Body if it receives an error. +func (client ModelClient) GetIntentFeaturesSender(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...) +} + +// GetIntentFeaturesResponder handles the response to the GetIntentFeatures request. The method always +// closes the http.Response Body. +func (client ModelClient) GetIntentFeaturesResponder(resp *http.Response) (result ListModelFeatureInformation, 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.GetPatternAnyEntityInfo") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPatternAnyEntityInfoPreparer(ctx, appID, versionID, entityID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "GetPatternAnyEntityInfo", resp, "Failure sending request") + return + } + + result, err = client.GetPatternAnyEntityInfoResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.GetPatternAnyEntityRole") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPatternAnyEntityRolePreparer(ctx, appID, versionID, entityID, roleID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "GetPatternAnyEntityRole", resp, "Failure sending request") + return + } + + result, err = client.GetPatternAnyEntityRoleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 +} + +// GetPrebuilt gets information about a prebuilt entity model in a version of the application. +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.GetPrebuilt") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPrebuiltPreparer(ctx, appID, versionID, prebuiltID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "GetPrebuilt", resp, "Failure sending request") + return + } + + result, err = client.GetPrebuiltResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.GetPrebuiltEntityRole") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPrebuiltEntityRolePreparer(ctx, appID, versionID, entityID, roleID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "GetPrebuiltEntityRole", resp, "Failure sending request") + return + } + + result, err = client.GetPrebuiltEntityRoleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 +} + +// GetRegexEntityEntityInfo sends the get regex entity entity info request. +// Parameters: +// appID - the application ID. +// versionID - the version ID. +// regexEntityID - the regular expression entity model ID. +func (client ModelClient) GetRegexEntityEntityInfo(ctx context.Context, appID uuid.UUID, versionID string, regexEntityID uuid.UUID) (result RegexEntityExtractor, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.GetRegexEntityEntityInfo") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetRegexEntityEntityInfoPreparer(ctx, appID, versionID, regexEntityID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "GetRegexEntityEntityInfo", resp, "Failure sending request") + return + } + + result, err = client.GetRegexEntityEntityInfoResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.GetRegexEntityRole") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetRegexEntityRolePreparer(ctx, appID, versionID, entityID, roleID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "GetRegexEntityRole", resp, "Failure sending request") + return + } + + result, err = client.GetRegexEntityRoleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 +} + +// ListClosedListEntityRoles sends the list closed list entity roles request. +// Parameters: +// appID - the application ID. +// versionID - the version ID. +// entityID - entity Id +func (client ModelClient) ListClosedListEntityRoles(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (result ListEntityRole, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.ListClosedListEntityRoles") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListClosedListEntityRolesPreparer(ctx, appID, versionID, entityID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ListClosedListEntityRoles", nil, "Failure preparing request") + return + } + + resp, err := client.ListClosedListEntityRolesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ListClosedListEntityRoles", resp, "Failure sending request") + return + } + + result, err = client.ListClosedListEntityRolesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ListClosedListEntityRoles", resp, "Failure responding to request") + } + + return +} + +// ListClosedListEntityRolesPreparer prepares the ListClosedListEntityRoles request. +func (client ModelClient) ListClosedListEntityRolesPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/closedlists/{entityId}/roles", pathParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListClosedListEntityRolesSender sends the ListClosedListEntityRoles request. The method will close the +// http.Response Body if it receives an error. +func (client ModelClient) ListClosedListEntityRolesSender(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...) +} + +// ListClosedListEntityRolesResponder handles the response to the ListClosedListEntityRoles request. The method always +// closes the http.Response Body. +func (client ModelClient) ListClosedListEntityRolesResponder(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 all the list entity models in a version of the application. +// 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 tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.ListClosedLists") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + 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: int64(500), Chain: nil}, + {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("authoring.ModelClient", "ListClosedLists", err.Error()) + } + + req, err := client.ListClosedListsPreparer(ctx, appID, versionID, skip, take) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "ListClosedLists", resp, "Failure sending request") + return + } + + result, err = client.ListClosedListsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 all the composite entity models in a version of the application. +// 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 tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.ListCompositeEntities") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + 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: int64(500), Chain: nil}, + {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("authoring.ModelClient", "ListCompositeEntities", err.Error()) + } + + req, err := client.ListCompositeEntitiesPreparer(ctx, appID, versionID, skip, take) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "ListCompositeEntities", resp, "Failure sending request") + return + } + + result, err = client.ListCompositeEntitiesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 +} + +// ListCompositeEntityRoles sends the list composite entity roles request. +// Parameters: +// appID - the application ID. +// versionID - the version ID. +// cEntityID - the composite entity extractor ID. +func (client ModelClient) ListCompositeEntityRoles(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID) (result ListEntityRole, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.ListCompositeEntityRoles") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListCompositeEntityRolesPreparer(ctx, appID, versionID, cEntityID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ListCompositeEntityRoles", nil, "Failure preparing request") + return + } + + resp, err := client.ListCompositeEntityRolesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ListCompositeEntityRoles", resp, "Failure sending request") + return + } + + result, err = client.ListCompositeEntityRolesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ListCompositeEntityRoles", resp, "Failure responding to request") + } + + return +} + +// ListCompositeEntityRolesPreparer prepares the ListCompositeEntityRoles request. +func (client ModelClient) ListCompositeEntityRolesPreparer(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/roles", pathParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListCompositeEntityRolesSender sends the ListCompositeEntityRoles request. The method will close the +// http.Response Body if it receives an error. +func (client ModelClient) ListCompositeEntityRolesSender(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...) +} + +// ListCompositeEntityRolesResponder handles the response to the ListCompositeEntityRoles request. The method always +// closes the http.Response Body. +func (client ModelClient) ListCompositeEntityRolesResponder(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 +} + +// ListCustomPrebuiltEntities gets all prebuilt entities used in a version of the 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.ListCustomPrebuiltEntities") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListCustomPrebuiltEntitiesPreparer(ctx, appID, versionID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "ListCustomPrebuiltEntities", resp, "Failure sending request") + return + } + + result, err = client.ListCustomPrebuiltEntitiesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "appId": autorest.Encode("path", appID), + "versionId": autorest.Encode("path", versionID), + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 +} + +// ListCustomPrebuiltEntityRoles sends the list custom prebuilt entity roles request. +// Parameters: +// appID - the application ID. +// versionID - the version ID. +// entityID - entity Id +func (client ModelClient) ListCustomPrebuiltEntityRoles(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (result ListEntityRole, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.ListCustomPrebuiltEntityRoles") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListCustomPrebuiltEntityRolesPreparer(ctx, appID, versionID, entityID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ListCustomPrebuiltEntityRoles", nil, "Failure preparing request") + return + } + + resp, err := client.ListCustomPrebuiltEntityRolesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ListCustomPrebuiltEntityRoles", resp, "Failure sending request") + return + } + + result, err = client.ListCustomPrebuiltEntityRolesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ListCustomPrebuiltEntityRoles", resp, "Failure responding to request") + } + + return +} + +// ListCustomPrebuiltEntityRolesPreparer prepares the ListCustomPrebuiltEntityRoles request. +func (client ModelClient) ListCustomPrebuiltEntityRolesPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/customprebuiltentities/{entityId}/roles", pathParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListCustomPrebuiltEntityRolesSender sends the ListCustomPrebuiltEntityRoles request. The method will close the +// http.Response Body if it receives an error. +func (client ModelClient) ListCustomPrebuiltEntityRolesSender(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...) +} + +// ListCustomPrebuiltEntityRolesResponder handles the response to the ListCustomPrebuiltEntityRoles request. The method always +// closes the http.Response Body. +func (client ModelClient) ListCustomPrebuiltEntityRolesResponder(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 +} + +// ListCustomPrebuiltIntents gets information about customizable prebuilt intents added to a version of the +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.ListCustomPrebuiltIntents") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListCustomPrebuiltIntentsPreparer(ctx, appID, versionID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "ListCustomPrebuiltIntents", resp, "Failure sending request") + return + } + + result, err = client.ListCustomPrebuiltIntentsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "appId": autorest.Encode("path", appID), + "versionId": autorest.Encode("path", versionID), + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 prebuilt intent and entity model information used in a version 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.ListCustomPrebuiltModels") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListCustomPrebuiltModelsPreparer(ctx, appID, versionID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "ListCustomPrebuiltModels", resp, "Failure sending request") + return + } + + result, err = client.ListCustomPrebuiltModelsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "appId": autorest.Encode("path", appID), + "versionId": autorest.Encode("path", versionID), + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 all the simple entity models in a version of the application. +// 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 ListNDepthEntityExtractor, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.ListEntities") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + 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: int64(500), Chain: nil}, + {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("authoring.ModelClient", "ListEntities", err.Error()) + } + + req, err := client.ListEntitiesPreparer(ctx, appID, versionID, skip, take) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "ListEntities", resp, "Failure sending request") + return + } + + result, err = client.ListEntitiesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListEntitiesResponder handles the response to the ListEntities request. The method always +// closes the http.Response Body. +func (client ModelClient) ListEntitiesResponder(resp *http.Response) (result ListNDepthEntityExtractor, 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 +} + +// ListEntityRoles sends the list entity roles request. +// Parameters: +// appID - the application ID. +// versionID - the version ID. +// entityID - entity Id +func (client ModelClient) ListEntityRoles(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (result ListEntityRole, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.ListEntityRoles") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListEntityRolesPreparer(ctx, appID, versionID, entityID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ListEntityRoles", nil, "Failure preparing request") + return + } + + resp, err := client.ListEntityRolesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ListEntityRoles", resp, "Failure sending request") + return + } + + result, err = client.ListEntityRolesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ListEntityRoles", resp, "Failure responding to request") + } + + return +} + +// ListEntityRolesPreparer prepares the ListEntityRoles request. +func (client ModelClient) ListEntityRolesPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities/{entityId}/roles", pathParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListEntityRolesSender sends the ListEntityRoles request. The method will close the +// http.Response Body if it receives an error. +func (client ModelClient) ListEntityRolesSender(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...) +} + +// ListEntityRolesResponder handles the response to the ListEntityRoles request. The method always +// closes the http.Response Body. +func (client ModelClient) ListEntityRolesResponder(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 +} + +// ListEntitySuggestions get suggested example utterances that would improve the accuracy of the entity model in a +// version of the application. +// 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) ListEntitySuggestions(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, take *int32) (result ListEntitiesSuggestionExample, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.ListEntitySuggestions") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + 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: int64(500), Chain: nil}, + {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("authoring.ModelClient", "ListEntitySuggestions", err.Error()) + } + + req, err := client.ListEntitySuggestionsPreparer(ctx, appID, versionID, entityID, take) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ListEntitySuggestions", nil, "Failure preparing request") + return + } + + resp, err := client.ListEntitySuggestionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ListEntitySuggestions", resp, "Failure sending request") + return + } + + result, err = client.ListEntitySuggestionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ListEntitySuggestions", resp, "Failure responding to request") + } + + return +} + +// ListEntitySuggestionsPreparer prepares the ListEntitySuggestions request. +func (client ModelClient) ListEntitySuggestionsPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, take *int32) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities/{entityId}/suggest", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListEntitySuggestionsSender sends the ListEntitySuggestions request. The method will close the +// http.Response Body if it receives an error. +func (client ModelClient) ListEntitySuggestionsSender(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...) +} + +// ListEntitySuggestionsResponder handles the response to the ListEntitySuggestions request. The method always +// closes the http.Response Body. +func (client ModelClient) ListEntitySuggestionsResponder(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 +} + +// ListHierarchicalEntities gets information about all the hierarchical entity models in a version of the application. +// 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 tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.ListHierarchicalEntities") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + 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: int64(500), Chain: nil}, + {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("authoring.ModelClient", "ListHierarchicalEntities", err.Error()) + } + + req, err := client.ListHierarchicalEntitiesPreparer(ctx, appID, versionID, skip, take) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "ListHierarchicalEntities", resp, "Failure sending request") + return + } + + result, err = client.ListHierarchicalEntitiesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 +} + +// ListHierarchicalEntityRoles sends the list hierarchical entity roles request. +// Parameters: +// appID - the application ID. +// versionID - the version ID. +// hEntityID - the hierarchical entity extractor ID. +func (client ModelClient) ListHierarchicalEntityRoles(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID) (result ListEntityRole, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.ListHierarchicalEntityRoles") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListHierarchicalEntityRolesPreparer(ctx, appID, versionID, hEntityID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ListHierarchicalEntityRoles", nil, "Failure preparing request") + return + } + + resp, err := client.ListHierarchicalEntityRolesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ListHierarchicalEntityRoles", resp, "Failure sending request") + return + } + + result, err = client.ListHierarchicalEntityRolesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ListHierarchicalEntityRoles", resp, "Failure responding to request") + } + + return +} + +// ListHierarchicalEntityRolesPreparer prepares the ListHierarchicalEntityRoles request. +func (client ModelClient) ListHierarchicalEntityRolesPreparer(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/roles", pathParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListHierarchicalEntityRolesSender sends the ListHierarchicalEntityRoles request. The method will close the +// http.Response Body if it receives an error. +func (client ModelClient) ListHierarchicalEntityRolesSender(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...) +} + +// ListHierarchicalEntityRolesResponder handles the response to the ListHierarchicalEntityRoles request. The method always +// closes the http.Response Body. +func (client ModelClient) ListHierarchicalEntityRolesResponder(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 +} + +// ListIntents gets information about the intent models in a version of the application. +// 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 tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.ListIntents") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + 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: int64(500), Chain: nil}, + {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("authoring.ModelClient", "ListIntents", err.Error()) + } + + req, err := client.ListIntentsPreparer(ctx, appID, versionID, skip, take) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "ListIntents", resp, "Failure sending request") + return + } + + result, err = client.ListIntentsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 +} + +// ListIntentSuggestions suggests example utterances that would improve the accuracy of the intent model in a version +// of the application. +// 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) ListIntentSuggestions(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID, take *int32) (result ListIntentsSuggestionExample, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.ListIntentSuggestions") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + 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: int64(500), Chain: nil}, + {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("authoring.ModelClient", "ListIntentSuggestions", err.Error()) + } + + req, err := client.ListIntentSuggestionsPreparer(ctx, appID, versionID, intentID, take) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ListIntentSuggestions", nil, "Failure preparing request") + return + } + + resp, err := client.ListIntentSuggestionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ListIntentSuggestions", resp, "Failure sending request") + return + } + + result, err = client.ListIntentSuggestionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ListIntentSuggestions", resp, "Failure responding to request") + } + + return +} + +// ListIntentSuggestionsPreparer prepares the ListIntentSuggestions request. +func (client ModelClient) ListIntentSuggestionsPreparer(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID, take *int32) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/intents/{intentId}/suggest", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListIntentSuggestionsSender sends the ListIntentSuggestions request. The method will close the +// http.Response Body if it receives an error. +func (client ModelClient) ListIntentSuggestionsSender(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...) +} + +// ListIntentSuggestionsResponder handles the response to the ListIntentSuggestions request. The method always +// closes the http.Response Body. +func (client ModelClient) ListIntentSuggestionsResponder(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 +} + +// ListModels gets information about all the intent and entity models in a version of the application. +// 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 tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.ListModels") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + 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: int64(500), Chain: nil}, + {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("authoring.ModelClient", "ListModels", err.Error()) + } + + req, err := client.ListModelsPreparer(ctx, appID, versionID, skip, take) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "ListModels", resp, "Failure sending request") + return + } + + result, err = client.ListModelsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 +} + +// ListPatternAnyEntityInfos sends the list 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) ListPatternAnyEntityInfos(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result ListPatternAnyEntityExtractor, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.ListPatternAnyEntityInfos") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + 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: int64(500), Chain: nil}, + {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("authoring.ModelClient", "ListPatternAnyEntityInfos", err.Error()) + } + + req, err := client.ListPatternAnyEntityInfosPreparer(ctx, appID, versionID, skip, take) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ListPatternAnyEntityInfos", nil, "Failure preparing request") + return + } + + resp, err := client.ListPatternAnyEntityInfosSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ListPatternAnyEntityInfos", resp, "Failure sending request") + return + } + + result, err = client.ListPatternAnyEntityInfosResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ListPatternAnyEntityInfos", resp, "Failure responding to request") + } + + return +} + +// ListPatternAnyEntityInfosPreparer prepares the ListPatternAnyEntityInfos request. +func (client ModelClient) ListPatternAnyEntityInfosPreparer(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListPatternAnyEntityInfosSender sends the ListPatternAnyEntityInfos request. The method will close the +// http.Response Body if it receives an error. +func (client ModelClient) ListPatternAnyEntityInfosSender(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...) +} + +// ListPatternAnyEntityInfosResponder handles the response to the ListPatternAnyEntityInfos request. The method always +// closes the http.Response Body. +func (client ModelClient) ListPatternAnyEntityInfosResponder(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 +} + +// ListPatternAnyEntityRoles sends the list pattern any entity roles request. +// Parameters: +// appID - the application ID. +// versionID - the version ID. +// entityID - entity Id +func (client ModelClient) ListPatternAnyEntityRoles(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (result ListEntityRole, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.ListPatternAnyEntityRoles") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPatternAnyEntityRolesPreparer(ctx, appID, versionID, entityID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ListPatternAnyEntityRoles", nil, "Failure preparing request") + return + } + + resp, err := client.ListPatternAnyEntityRolesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ListPatternAnyEntityRoles", resp, "Failure sending request") + return + } + + result, err = client.ListPatternAnyEntityRolesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ListPatternAnyEntityRoles", resp, "Failure responding to request") + } + + return +} + +// ListPatternAnyEntityRolesPreparer prepares the ListPatternAnyEntityRoles request. +func (client ModelClient) ListPatternAnyEntityRolesPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/roles", pathParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListPatternAnyEntityRolesSender sends the ListPatternAnyEntityRoles request. The method will close the +// http.Response Body if it receives an error. +func (client ModelClient) ListPatternAnyEntityRolesSender(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...) +} + +// ListPatternAnyEntityRolesResponder handles the response to the ListPatternAnyEntityRoles request. The method always +// closes the http.Response Body. +func (client ModelClient) ListPatternAnyEntityRolesResponder(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 +} + +// ListPrebuiltEntities gets all the available prebuilt entities in a version of 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.ListPrebuiltEntities") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPrebuiltEntitiesPreparer(ctx, appID, versionID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "ListPrebuiltEntities", resp, "Failure sending request") + return + } + + result, err = client.ListPrebuiltEntitiesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "appId": autorest.Encode("path", appID), + "versionId": autorest.Encode("path", versionID), + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 +} + +// ListPrebuiltEntityRoles sends the list prebuilt entity roles request. +// Parameters: +// appID - the application ID. +// versionID - the version ID. +// entityID - entity Id +func (client ModelClient) ListPrebuiltEntityRoles(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (result ListEntityRole, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.ListPrebuiltEntityRoles") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPrebuiltEntityRolesPreparer(ctx, appID, versionID, entityID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ListPrebuiltEntityRoles", nil, "Failure preparing request") + return + } + + resp, err := client.ListPrebuiltEntityRolesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ListPrebuiltEntityRoles", resp, "Failure sending request") + return + } + + result, err = client.ListPrebuiltEntityRolesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ListPrebuiltEntityRoles", resp, "Failure responding to request") + } + + return +} + +// ListPrebuiltEntityRolesPreparer prepares the ListPrebuiltEntityRoles request. +func (client ModelClient) ListPrebuiltEntityRolesPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/prebuilts/{entityId}/roles", pathParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListPrebuiltEntityRolesSender sends the ListPrebuiltEntityRoles request. The method will close the +// http.Response Body if it receives an error. +func (client ModelClient) ListPrebuiltEntityRolesSender(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...) +} + +// ListPrebuiltEntityRolesResponder handles the response to the ListPrebuiltEntityRoles request. The method always +// closes the http.Response Body. +func (client ModelClient) ListPrebuiltEntityRolesResponder(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 +} + +// ListPrebuilts gets information about all the prebuilt entities in a version of the application. +// 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 tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.ListPrebuilts") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + 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: int64(500), Chain: nil}, + {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("authoring.ModelClient", "ListPrebuilts", err.Error()) + } + + req, err := client.ListPrebuiltsPreparer(ctx, appID, versionID, skip, take) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "ListPrebuilts", resp, "Failure sending request") + return + } + + result, err = client.ListPrebuiltsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 +} + +// ListRegexEntityInfos sends the list 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) ListRegexEntityInfos(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result ListRegexEntityExtractor, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.ListRegexEntityInfos") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + 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: int64(500), Chain: nil}, + {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("authoring.ModelClient", "ListRegexEntityInfos", err.Error()) + } + + req, err := client.ListRegexEntityInfosPreparer(ctx, appID, versionID, skip, take) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ListRegexEntityInfos", nil, "Failure preparing request") + return + } + + resp, err := client.ListRegexEntityInfosSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ListRegexEntityInfos", resp, "Failure sending request") + return + } + + result, err = client.ListRegexEntityInfosResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ListRegexEntityInfos", resp, "Failure responding to request") + } + + return +} + +// ListRegexEntityInfosPreparer prepares the ListRegexEntityInfos request. +func (client ModelClient) ListRegexEntityInfosPreparer(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/regexentities", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListRegexEntityInfosSender sends the ListRegexEntityInfos request. The method will close the +// http.Response Body if it receives an error. +func (client ModelClient) ListRegexEntityInfosSender(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...) +} + +// ListRegexEntityInfosResponder handles the response to the ListRegexEntityInfos request. The method always +// closes the http.Response Body. +func (client ModelClient) ListRegexEntityInfosResponder(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 +} + +// ListRegexEntityRoles sends the list regex entity roles request. +// Parameters: +// appID - the application ID. +// versionID - the version ID. +// entityID - entity Id +func (client ModelClient) ListRegexEntityRoles(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (result ListEntityRole, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.ListRegexEntityRoles") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListRegexEntityRolesPreparer(ctx, appID, versionID, entityID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ListRegexEntityRoles", nil, "Failure preparing request") + return + } + + resp, err := client.ListRegexEntityRolesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ListRegexEntityRoles", resp, "Failure sending request") + return + } + + result, err = client.ListRegexEntityRolesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ListRegexEntityRoles", resp, "Failure responding to request") + } + + return +} + +// ListRegexEntityRolesPreparer prepares the ListRegexEntityRoles request. +func (client ModelClient) ListRegexEntityRolesPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/regexentities/{entityId}/roles", pathParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListRegexEntityRolesSender sends the ListRegexEntityRoles request. The method will close the +// http.Response Body if it receives an error. +func (client ModelClient) ListRegexEntityRolesSender(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...) +} + +// ListRegexEntityRolesResponder handles the response to the ListRegexEntityRoles request. The method always +// closes the http.Response Body. +func (client ModelClient) ListRegexEntityRolesResponder(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 +} + +// PatchClosedList adds a batch of sublists to an existing list entity in a version of the application. +// Parameters: +// appID - the application ID. +// versionID - the version ID. +// clEntityID - the list entity 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.PatchClosedList") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PatchClosedListPreparer(ctx, appID, versionID, clEntityID, closedListModelPatchObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "PatchClosedList", resp, "Failure sending request") + return + } + + result, err = client.PatchClosedListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 +} + +// ReplaceEntityFeatures updates the information of the features used by the entity in a version of the application. +// Parameters: +// appID - the application ID. +// versionID - the version ID. +// entityID - the entity extractor ID. +// featureRelationsUpdateObject - a list of feature information objects containing the new feature relations. +func (client ModelClient) ReplaceEntityFeatures(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, featureRelationsUpdateObject []ModelFeatureInformation) (result OperationStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.ReplaceEntityFeatures") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: featureRelationsUpdateObject, + Constraints: []validation.Constraint{{Target: "featureRelationsUpdateObject", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("authoring.ModelClient", "ReplaceEntityFeatures", err.Error()) + } + + req, err := client.ReplaceEntityFeaturesPreparer(ctx, appID, versionID, entityID, featureRelationsUpdateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ReplaceEntityFeatures", nil, "Failure preparing request") + return + } + + resp, err := client.ReplaceEntityFeaturesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ReplaceEntityFeatures", resp, "Failure sending request") + return + } + + result, err = client.ReplaceEntityFeaturesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ReplaceEntityFeatures", resp, "Failure responding to request") + } + + return +} + +// ReplaceEntityFeaturesPreparer prepares the ReplaceEntityFeatures request. +func (client ModelClient) ReplaceEntityFeaturesPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, featureRelationsUpdateObject []ModelFeatureInformation) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities/{entityId}/features", pathParameters), + autorest.WithJSON(featureRelationsUpdateObject)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReplaceEntityFeaturesSender sends the ReplaceEntityFeatures request. The method will close the +// http.Response Body if it receives an error. +func (client ModelClient) ReplaceEntityFeaturesSender(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...) +} + +// ReplaceEntityFeaturesResponder handles the response to the ReplaceEntityFeatures request. The method always +// closes the http.Response Body. +func (client ModelClient) ReplaceEntityFeaturesResponder(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 +} + +// ReplaceIntentFeatures updates the information of the features used by the intent in a version of the application. +// Parameters: +// appID - the application ID. +// versionID - the version ID. +// intentID - the intent classifier ID. +// featureRelationsUpdateObject - a list of feature information objects containing the new feature relations. +func (client ModelClient) ReplaceIntentFeatures(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID, featureRelationsUpdateObject []ModelFeatureInformation) (result OperationStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.ReplaceIntentFeatures") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: featureRelationsUpdateObject, + Constraints: []validation.Constraint{{Target: "featureRelationsUpdateObject", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("authoring.ModelClient", "ReplaceIntentFeatures", err.Error()) + } + + req, err := client.ReplaceIntentFeaturesPreparer(ctx, appID, versionID, intentID, featureRelationsUpdateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ReplaceIntentFeatures", nil, "Failure preparing request") + return + } + + resp, err := client.ReplaceIntentFeaturesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ReplaceIntentFeatures", resp, "Failure sending request") + return + } + + result, err = client.ReplaceIntentFeaturesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ReplaceIntentFeatures", resp, "Failure responding to request") + } + + return +} + +// ReplaceIntentFeaturesPreparer prepares the ReplaceIntentFeatures request. +func (client ModelClient) ReplaceIntentFeaturesPreparer(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID, featureRelationsUpdateObject []ModelFeatureInformation) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/intents/{intentId}/features", pathParameters), + autorest.WithJSON(featureRelationsUpdateObject)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReplaceIntentFeaturesSender sends the ReplaceIntentFeatures request. The method will close the +// http.Response Body if it receives an error. +func (client ModelClient) ReplaceIntentFeaturesSender(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...) +} + +// ReplaceIntentFeaturesResponder handles the response to the ReplaceIntentFeatures request. The method always +// closes the http.Response Body. +func (client ModelClient) ReplaceIntentFeaturesResponder(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 list entity in a version of the application. +// Parameters: +// appID - the application ID. +// versionID - the version ID. +// clEntityID - the list model ID. +// closedListModelUpdateObject - the new list 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.UpdateClosedList") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdateClosedListPreparer(ctx, appID, versionID, clEntityID, closedListModelUpdateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "UpdateClosedList", resp, "Failure sending request") + return + } + + result, err = client.UpdateClosedListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.UpdateClosedListEntityRole") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdateClosedListEntityRolePreparer(ctx, appID, versionID, entityID, roleID, entityRoleUpdateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "UpdateClosedListEntityRole", resp, "Failure sending request") + return + } + + result, err = client.UpdateClosedListEntityRoleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 a composite entity in a version of the application. +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.UpdateCompositeEntity") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdateCompositeEntityPreparer(ctx, appID, versionID, cEntityID, compositeModelUpdateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "UpdateCompositeEntity", resp, "Failure sending request") + return + } + + result, err = client.UpdateCompositeEntityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.UpdateCompositeEntityRole") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdateCompositeEntityRolePreparer(ctx, appID, versionID, cEntityID, roleID, entityRoleUpdateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "UpdateCompositeEntityRole", resp, "Failure sending request") + return + } + + result, err = client.UpdateCompositeEntityRoleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.UpdateCustomPrebuiltEntityRole") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdateCustomPrebuiltEntityRolePreparer(ctx, appID, versionID, entityID, roleID, entityRoleUpdateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "UpdateCustomPrebuiltEntityRole", resp, "Failure sending request") + return + } + + result, err = client.UpdateCustomPrebuiltEntityRoleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 +} + +// UpdateEntityChild updates the name of an entity extractor or the name and instanceOf model of a child entity +// extractor. +// Parameters: +// appID - the application ID. +// versionID - the version ID. +// entityID - the entity extractor or the child entity extractor ID. +// entityModelUpdateObject - a model object containing the name new entity extractor or the name and instance +// of model of a child entity extractor +func (client ModelClient) UpdateEntityChild(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, entityModelUpdateObject EntityModelUpdateObject) (result OperationStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.UpdateEntityChild") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdateEntityChildPreparer(ctx, appID, versionID, entityID, entityModelUpdateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "UpdateEntityChild", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateEntityChildSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "UpdateEntityChild", resp, "Failure sending request") + return + } + + result, err = client.UpdateEntityChildResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.ModelClient", "UpdateEntityChild", resp, "Failure responding to request") + } + + return +} + +// UpdateEntityChildPreparer prepares the UpdateEntityChild request. +func (client ModelClient) UpdateEntityChildPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, entityModelUpdateObject EntityModelUpdateObject) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + 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.AsPatch(), + autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities/{entityId}", pathParameters), + autorest.WithJSON(entityModelUpdateObject)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateEntityChildSender sends the UpdateEntityChild request. The method will close the +// http.Response Body if it receives an error. +func (client ModelClient) UpdateEntityChildSender(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...) +} + +// UpdateEntityChildResponder handles the response to the UpdateEntityChild request. The method always +// closes the http.Response Body. +func (client ModelClient) UpdateEntityChildResponder(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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.UpdateEntityRole") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdateEntityRolePreparer(ctx, appID, versionID, entityID, roleID, entityRoleUpdateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "UpdateEntityRole", resp, "Failure sending request") + return + } + + result, err = client.UpdateEntityRoleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.UpdateExplicitListItem") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdateExplicitListItemPreparer(ctx, appID, versionID, entityID, itemID, item) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "UpdateExplicitListItem", resp, "Failure sending request") + return + } + + result, err = client.UpdateExplicitListItemResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 of a hierarchical entity model in a version of the application. +// Parameters: +// appID - the application ID. +// versionID - the version ID. +// hEntityID - the hierarchical entity extractor ID. +// modelUpdateObject - model containing names of the hierarchical entity. +func (client ModelClient) UpdateHierarchicalEntity(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, modelUpdateObject ModelUpdateObject) (result OperationStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.UpdateHierarchicalEntity") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdateHierarchicalEntityPreparer(ctx, appID, versionID, hEntityID, modelUpdateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "UpdateHierarchicalEntity", resp, "Failure sending request") + return + } + + result, err = client.UpdateHierarchicalEntityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, modelUpdateObject ModelUpdateObject) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + 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.AsPatch(), + autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}", pathParameters), + autorest.WithJSON(modelUpdateObject)) + 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 in a version of the +// application. +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.UpdateHierarchicalEntityChild") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdateHierarchicalEntityChildPreparer(ctx, appID, versionID, hEntityID, hChildID, hierarchicalChildModelUpdateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "UpdateHierarchicalEntityChild", resp, "Failure sending request") + return + } + + result, err = client.UpdateHierarchicalEntityChildResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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.AsPatch(), + autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.UpdateHierarchicalEntityRole") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdateHierarchicalEntityRolePreparer(ctx, appID, versionID, hEntityID, roleID, entityRoleUpdateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "UpdateHierarchicalEntityRole", resp, "Failure sending request") + return + } + + result, err = client.UpdateHierarchicalEntityRoleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 in a version of the application. +// Parameters: +// appID - the application ID. +// versionID - the version ID. +// intentID - the intent classifier ID. +// modelUpdateObject - a model object containing the new intent name. +func (client ModelClient) UpdateIntent(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID, modelUpdateObject ModelUpdateObject) (result OperationStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.UpdateIntent") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdateIntentPreparer(ctx, appID, versionID, intentID, modelUpdateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "UpdateIntent", resp, "Failure sending request") + return + } + + result, err = client.UpdateIntentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.UpdatePatternAnyEntityModel") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePatternAnyEntityModelPreparer(ctx, appID, versionID, entityID, patternAnyUpdateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "UpdatePatternAnyEntityModel", resp, "Failure sending request") + return + } + + result, err = client.UpdatePatternAnyEntityModelResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.UpdatePatternAnyEntityRole") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePatternAnyEntityRolePreparer(ctx, appID, versionID, entityID, roleID, entityRoleUpdateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "UpdatePatternAnyEntityRole", resp, "Failure sending request") + return + } + + result, err = client.UpdatePatternAnyEntityRoleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.UpdatePrebuiltEntityRole") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePrebuiltEntityRolePreparer(ctx, appID, versionID, entityID, roleID, entityRoleUpdateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "UpdatePrebuiltEntityRole", resp, "Failure sending request") + return + } + + result, err = client.UpdatePrebuiltEntityRoleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 regular expression 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.UpdateRegexEntityModel") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdateRegexEntityModelPreparer(ctx, appID, versionID, regexEntityID, regexEntityUpdateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "UpdateRegexEntityModel", resp, "Failure sending request") + return + } + + result, err = client.UpdateRegexEntityModelResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.UpdateRegexEntityRole") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdateRegexEntityRolePreparer(ctx, appID, versionID, entityID, roleID, entityRoleUpdateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "UpdateRegexEntityRole", resp, "Failure sending request") + return + } + + result, err = client.UpdateRegexEntityRoleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 list entity's sublists in a version of the application. +// Parameters: +// appID - the application ID. +// versionID - the version ID. +// clEntityID - the 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 int64, wordListBaseUpdateObject WordListBaseUpdateObject) (result OperationStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.UpdateSubList") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdateSubListPreparer(ctx, appID, versionID, clEntityID, subListID, wordListBaseUpdateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.ModelClient", "UpdateSubList", resp, "Failure sending request") + return + } + + result, err = client.UpdateSubListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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 int64, wordListBaseUpdateObject WordListBaseUpdateObject) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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/preview/cognitiveservices/v3.0/luis/authoring/models.go b/services/preview/cognitiveservices/v3.0/luis/authoring/models.go new file mode 100644 index 000000000000..64d7ab0da5b2 --- /dev/null +++ b/services/preview/cognitiveservices/v3.0/luis/authoring/models.go @@ -0,0 +1,2178 @@ +package authoring + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/date" + "github.com/satori/go.uuid" + "io" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/cognitiveservices/v3.0/luis/authoring" + +// 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 ( + // ReadableTypeChildEntityExtractor ... + ReadableTypeChildEntityExtractor ReadableType = "Child Entity Extractor" + // 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" + // ReadableTypeListEntityExtractor ... + ReadableTypeListEntityExtractor ReadableType = "List Entity Extractor" + // 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{ReadableTypeChildEntityExtractor, ReadableTypeClosedListEntityExtractor, ReadableTypeCompositeEntityExtractor, ReadableTypeEntityExtractor, ReadableTypeHierarchicalChildEntityExtractor, ReadableTypeHierarchicalEntityExtractor, ReadableTypeIntentClassifier, ReadableTypeListEntityExtractor, ReadableTypePatternAnyEntityExtractor, ReadableTypePrebuiltEntityExtractor, ReadableTypeRegexEntityExtractor} +} + +// ReadableType1 enumerates the values for readable type 1. +type ReadableType1 string + +const ( + // ReadableType1ChildEntityExtractor ... + ReadableType1ChildEntityExtractor ReadableType1 = "Child Entity Extractor" + // 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" + // ReadableType1ListEntityExtractor ... + ReadableType1ListEntityExtractor ReadableType1 = "List Entity Extractor" + // 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{ReadableType1ChildEntityExtractor, ReadableType1ClosedListEntityExtractor, ReadableType1CompositeEntityExtractor, ReadableType1EntityExtractor, ReadableType1HierarchicalChildEntityExtractor, ReadableType1HierarchicalEntityExtractor, ReadableType1IntentClassifier, ReadableType1ListEntityExtractor, ReadableType1PatternAnyEntityExtractor, ReadableType1PrebuiltEntityExtractor, ReadableType1RegexEntityExtractor} +} + +// ReadableType10 enumerates the values for readable type 10. +type ReadableType10 string + +const ( + // ReadableType10ChildEntityExtractor ... + ReadableType10ChildEntityExtractor ReadableType10 = "Child Entity Extractor" + // 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" + // ReadableType10ListEntityExtractor ... + ReadableType10ListEntityExtractor ReadableType10 = "List Entity Extractor" + // 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{ReadableType10ChildEntityExtractor, ReadableType10ClosedListEntityExtractor, ReadableType10CompositeEntityExtractor, ReadableType10EntityExtractor, ReadableType10HierarchicalChildEntityExtractor, ReadableType10HierarchicalEntityExtractor, ReadableType10IntentClassifier, ReadableType10ListEntityExtractor, ReadableType10PatternAnyEntityExtractor, ReadableType10PrebuiltEntityExtractor, ReadableType10RegexEntityExtractor} +} + +// ReadableType11 enumerates the values for readable type 11. +type ReadableType11 string + +const ( + // ReadableType11ChildEntityExtractor ... + ReadableType11ChildEntityExtractor ReadableType11 = "Child Entity Extractor" + // ReadableType11ClosedListEntityExtractor ... + ReadableType11ClosedListEntityExtractor ReadableType11 = "Closed List Entity Extractor" + // ReadableType11CompositeEntityExtractor ... + ReadableType11CompositeEntityExtractor ReadableType11 = "Composite Entity Extractor" + // ReadableType11EntityExtractor ... + ReadableType11EntityExtractor ReadableType11 = "Entity Extractor" + // ReadableType11HierarchicalChildEntityExtractor ... + ReadableType11HierarchicalChildEntityExtractor ReadableType11 = "Hierarchical Child Entity Extractor" + // ReadableType11HierarchicalEntityExtractor ... + ReadableType11HierarchicalEntityExtractor ReadableType11 = "Hierarchical Entity Extractor" + // ReadableType11IntentClassifier ... + ReadableType11IntentClassifier ReadableType11 = "Intent Classifier" + // ReadableType11ListEntityExtractor ... + ReadableType11ListEntityExtractor ReadableType11 = "List Entity Extractor" + // ReadableType11PatternAnyEntityExtractor ... + ReadableType11PatternAnyEntityExtractor ReadableType11 = "Pattern.Any Entity Extractor" + // ReadableType11PrebuiltEntityExtractor ... + ReadableType11PrebuiltEntityExtractor ReadableType11 = "Prebuilt Entity Extractor" + // ReadableType11RegexEntityExtractor ... + ReadableType11RegexEntityExtractor ReadableType11 = "Regex Entity Extractor" +) + +// PossibleReadableType11Values returns an array of possible values for the ReadableType11 const type. +func PossibleReadableType11Values() []ReadableType11 { + return []ReadableType11{ReadableType11ChildEntityExtractor, ReadableType11ClosedListEntityExtractor, ReadableType11CompositeEntityExtractor, ReadableType11EntityExtractor, ReadableType11HierarchicalChildEntityExtractor, ReadableType11HierarchicalEntityExtractor, ReadableType11IntentClassifier, ReadableType11ListEntityExtractor, ReadableType11PatternAnyEntityExtractor, ReadableType11PrebuiltEntityExtractor, ReadableType11RegexEntityExtractor} +} + +// ReadableType2 enumerates the values for readable type 2. +type ReadableType2 string + +const ( + // ReadableType2ChildEntityExtractor ... + ReadableType2ChildEntityExtractor ReadableType2 = "Child Entity Extractor" + // 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" + // ReadableType2ListEntityExtractor ... + ReadableType2ListEntityExtractor ReadableType2 = "List Entity Extractor" + // 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{ReadableType2ChildEntityExtractor, ReadableType2ClosedListEntityExtractor, ReadableType2CompositeEntityExtractor, ReadableType2EntityExtractor, ReadableType2HierarchicalChildEntityExtractor, ReadableType2HierarchicalEntityExtractor, ReadableType2IntentClassifier, ReadableType2ListEntityExtractor, ReadableType2PatternAnyEntityExtractor, ReadableType2PrebuiltEntityExtractor, ReadableType2RegexEntityExtractor} +} + +// ReadableType3 enumerates the values for readable type 3. +type ReadableType3 string + +const ( + // ReadableType3ChildEntityExtractor ... + ReadableType3ChildEntityExtractor ReadableType3 = "Child Entity Extractor" + // 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" + // ReadableType3ListEntityExtractor ... + ReadableType3ListEntityExtractor ReadableType3 = "List Entity Extractor" + // 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{ReadableType3ChildEntityExtractor, ReadableType3ClosedListEntityExtractor, ReadableType3CompositeEntityExtractor, ReadableType3EntityExtractor, ReadableType3HierarchicalChildEntityExtractor, ReadableType3HierarchicalEntityExtractor, ReadableType3IntentClassifier, ReadableType3ListEntityExtractor, ReadableType3PatternAnyEntityExtractor, ReadableType3PrebuiltEntityExtractor, ReadableType3RegexEntityExtractor} +} + +// ReadableType4 enumerates the values for readable type 4. +type ReadableType4 string + +const ( + // ReadableType4ChildEntityExtractor ... + ReadableType4ChildEntityExtractor ReadableType4 = "Child Entity Extractor" + // 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" + // ReadableType4ListEntityExtractor ... + ReadableType4ListEntityExtractor ReadableType4 = "List Entity Extractor" + // 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{ReadableType4ChildEntityExtractor, ReadableType4ClosedListEntityExtractor, ReadableType4CompositeEntityExtractor, ReadableType4EntityExtractor, ReadableType4HierarchicalChildEntityExtractor, ReadableType4HierarchicalEntityExtractor, ReadableType4IntentClassifier, ReadableType4ListEntityExtractor, ReadableType4PatternAnyEntityExtractor, ReadableType4PrebuiltEntityExtractor, ReadableType4RegexEntityExtractor} +} + +// ReadableType5 enumerates the values for readable type 5. +type ReadableType5 string + +const ( + // ReadableType5ChildEntityExtractor ... + ReadableType5ChildEntityExtractor ReadableType5 = "Child Entity Extractor" + // 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" + // ReadableType5ListEntityExtractor ... + ReadableType5ListEntityExtractor ReadableType5 = "List Entity Extractor" + // 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{ReadableType5ChildEntityExtractor, ReadableType5ClosedListEntityExtractor, ReadableType5CompositeEntityExtractor, ReadableType5EntityExtractor, ReadableType5HierarchicalChildEntityExtractor, ReadableType5HierarchicalEntityExtractor, ReadableType5IntentClassifier, ReadableType5ListEntityExtractor, ReadableType5PatternAnyEntityExtractor, ReadableType5PrebuiltEntityExtractor, ReadableType5RegexEntityExtractor} +} + +// ReadableType6 enumerates the values for readable type 6. +type ReadableType6 string + +const ( + // ReadableType6ChildEntityExtractor ... + ReadableType6ChildEntityExtractor ReadableType6 = "Child Entity Extractor" + // 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" + // ReadableType6ListEntityExtractor ... + ReadableType6ListEntityExtractor ReadableType6 = "List Entity Extractor" + // 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{ReadableType6ChildEntityExtractor, ReadableType6ClosedListEntityExtractor, ReadableType6CompositeEntityExtractor, ReadableType6EntityExtractor, ReadableType6HierarchicalChildEntityExtractor, ReadableType6HierarchicalEntityExtractor, ReadableType6IntentClassifier, ReadableType6ListEntityExtractor, ReadableType6PatternAnyEntityExtractor, ReadableType6PrebuiltEntityExtractor, ReadableType6RegexEntityExtractor} +} + +// ReadableType7 enumerates the values for readable type 7. +type ReadableType7 string + +const ( + // ReadableType7ChildEntityExtractor ... + ReadableType7ChildEntityExtractor ReadableType7 = "Child Entity Extractor" + // 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" + // ReadableType7ListEntityExtractor ... + ReadableType7ListEntityExtractor ReadableType7 = "List Entity Extractor" + // 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{ReadableType7ChildEntityExtractor, ReadableType7ClosedListEntityExtractor, ReadableType7CompositeEntityExtractor, ReadableType7EntityExtractor, ReadableType7HierarchicalChildEntityExtractor, ReadableType7HierarchicalEntityExtractor, ReadableType7IntentClassifier, ReadableType7ListEntityExtractor, ReadableType7PatternAnyEntityExtractor, ReadableType7PrebuiltEntityExtractor, ReadableType7RegexEntityExtractor} +} + +// ReadableType8 enumerates the values for readable type 8. +type ReadableType8 string + +const ( + // ReadableType8ChildEntityExtractor ... + ReadableType8ChildEntityExtractor ReadableType8 = "Child Entity Extractor" + // 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" + // ReadableType8ListEntityExtractor ... + ReadableType8ListEntityExtractor ReadableType8 = "List Entity Extractor" + // 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{ReadableType8ChildEntityExtractor, ReadableType8ClosedListEntityExtractor, ReadableType8CompositeEntityExtractor, ReadableType8EntityExtractor, ReadableType8HierarchicalChildEntityExtractor, ReadableType8HierarchicalEntityExtractor, ReadableType8IntentClassifier, ReadableType8ListEntityExtractor, ReadableType8PatternAnyEntityExtractor, ReadableType8PrebuiltEntityExtractor, ReadableType8RegexEntityExtractor} +} + +// ReadableType9 enumerates the values for readable type 9. +type ReadableType9 string + +const ( + // ReadableType9ChildEntityExtractor ... + ReadableType9ChildEntityExtractor ReadableType9 = "Child Entity Extractor" + // 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" + // ReadableType9ListEntityExtractor ... + ReadableType9ListEntityExtractor ReadableType9 = "List Entity Extractor" + // 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{ReadableType9ChildEntityExtractor, ReadableType9ClosedListEntityExtractor, ReadableType9CompositeEntityExtractor, ReadableType9EntityExtractor, ReadableType9HierarchicalChildEntityExtractor, ReadableType9HierarchicalEntityExtractor, ReadableType9IntentClassifier, ReadableType9ListEntityExtractor, 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. For example, "en-us". + Culture *string `json:"culture,omitempty"` + // UsageScenario - Defines the scenario for the new application. Optional. For example, IoT. + UsageScenario *string `json:"usageScenario,omitempty"` + // Domain - The domain for the new application. Optional. For example, 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"` +} + +// 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 for billing purposes. + IsPublic *bool `json:"public,omitempty"` +} + +// ApplicationSettingUpdateObject object model for updating an application's settings. +type ApplicationSettingUpdateObject struct { + // IsPublic - Setting your application as public allows other people to use your application's endpoint using their own keys. + IsPublic *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"` +} + +// AppVersionSettingObject object model of an application version setting. +type AppVersionSettingObject struct { + // Name - The application version setting name. + Name *string `json:"name,omitempty"` + // Value - The application version setting value. + Value *string `json:"value,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"` +} + +// AzureAccountInfoObject defines the Azure account information object. +type AzureAccountInfoObject struct { + // AzureSubscriptionID - The id for the Azure subscription. + AzureSubscriptionID *string `json:"azureSubscriptionId,omitempty"` + // ResourceGroup - The Azure resource group name. + ResourceGroup *string `json:"resourceGroup,omitempty"` + // AccountName - The Azure account name. + AccountName *string `json:"accountName,omitempty"` +} + +// BatchLabelExample response when adding a batch of labeled example utterances. +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"` + // InstanceOf - Instance of Model. + InstanceOf *string `json:"instanceOf,omitempty"` + // TypeID - The type ID of the Entity Model. + TypeID *int32 `json:"typeId,omitempty"` + // ReadableType - Possible values include: 'ReadableType1EntityExtractor', 'ReadableType1ChildEntityExtractor', 'ReadableType1HierarchicalEntityExtractor', 'ReadableType1HierarchicalChildEntityExtractor', 'ReadableType1CompositeEntityExtractor', 'ReadableType1ListEntityExtractor', 'ReadableType1PrebuiltEntityExtractor', 'ReadableType1IntentClassifier', 'ReadableType1PatternAnyEntityExtractor', 'ReadableType1ClosedListEntityExtractor', 'ReadableType1RegexEntityExtractor' + ReadableType ReadableType1 `json:"readableType,omitempty"` + // Children - List of children + Children *[]ChildEntity `json:"children,omitempty"` +} + +// ChildEntityModelCreateObject a child entity extractor create object. +type ChildEntityModelCreateObject struct { + // Children - Child entities. + Children *[]ChildEntityModelCreateObject `json:"children,omitempty"` + // Name - Entity name. + Name *string `json:"name,omitempty"` + // InstanceOf - The instance of model name + InstanceOf *string `json:"instanceOf,omitempty"` +} + +// ClosedList exported Model - A list entity. +type ClosedList struct { + // Name - Name of the list entity. + Name *string `json:"name,omitempty"` + // SubLists - Sublists for the list entity. + SubLists *[]SubClosedList `json:"subLists,omitempty"` + Roles *[]string `json:"roles,omitempty"` +} + +// ClosedListEntityExtractor 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: 'ReadableType5EntityExtractor', 'ReadableType5ChildEntityExtractor', 'ReadableType5HierarchicalEntityExtractor', 'ReadableType5HierarchicalChildEntityExtractor', 'ReadableType5CompositeEntityExtractor', 'ReadableType5ListEntityExtractor', 'ReadableType5PrebuiltEntityExtractor', 'ReadableType5IntentClassifier', 'ReadableType5PatternAnyEntityExtractor', 'ReadableType5ClosedListEntityExtractor', 'ReadableType5RegexEntityExtractor' + ReadableType ReadableType5 `json:"readableType,omitempty"` + Roles *[]EntityRole `json:"roles,omitempty"` + // SubLists - List of sublists. + SubLists *[]SubClosedListResponse `json:"subLists,omitempty"` +} + +// ClosedListModelCreateObject object model for creating a list entity. +type ClosedListModelCreateObject struct { + // SubLists - Sublists for the feature. + SubLists *[]WordListObject `json:"subLists,omitempty"` + // Name - Name of the list entity. + Name *string `json:"name,omitempty"` +} + +// ClosedListModelPatchObject object model for adding a batch of sublists to an existing list entity. +type ClosedListModelPatchObject struct { + // SubLists - Sublists to add. + SubLists *[]WordListObject `json:"subLists,omitempty"` +} + +// ClosedListModelUpdateObject object model for updating a list entity. +type ClosedListModelUpdateObject struct { + // SubLists - The new sublists for the feature. + SubLists *[]WordListObject `json:"subLists,omitempty"` + // Name - The new name of the list entity. + 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: 'ReadableType4EntityExtractor', 'ReadableType4ChildEntityExtractor', 'ReadableType4HierarchicalEntityExtractor', 'ReadableType4HierarchicalChildEntityExtractor', 'ReadableType4CompositeEntityExtractor', 'ReadableType4ListEntityExtractor', 'ReadableType4PrebuiltEntityExtractor', 'ReadableType4IntentClassifier', 'ReadableType4PatternAnyEntityExtractor', 'ReadableType4ClosedListEntityExtractor', 'ReadableType4RegexEntityExtractor' + ReadableType ReadableType4 `json:"readableType,omitempty"` + Roles *[]EntityRole `json:"roles,omitempty"` + // Children - List of child entities. + Children *[]ChildEntity `json:"children,omitempty"` +} + +// CompositeEntityModel a composite entity extractor. +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', 'ReadableType7ChildEntityExtractor', 'ReadableType7HierarchicalEntityExtractor', 'ReadableType7HierarchicalChildEntityExtractor', 'ReadableType7CompositeEntityExtractor', 'ReadableType7ListEntityExtractor', 'ReadableType7PrebuiltEntityExtractor', 'ReadableType7IntentClassifier', 'ReadableType7PatternAnyEntityExtractor', 'ReadableType7ClosedListEntityExtractor', '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"` + // FailedRegions - Regions where publishing failed. + FailedRegions *string `json:"failedRegions,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. For example, "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 { + // 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', 'ReadableType8ChildEntityExtractor', 'ReadableType8HierarchicalEntityExtractor', 'ReadableType8HierarchicalChildEntityExtractor', 'ReadableType8CompositeEntityExtractor', 'ReadableType8ListEntityExtractor', 'ReadableType8PrebuiltEntityExtractor', 'ReadableType8IntentClassifier', 'ReadableType8PatternAnyEntityExtractor', 'ReadableType8ClosedListEntityExtractor', '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"` + // Role - The role of the predicted entity. + Role *string `json:"role,omitempty"` + // RoleID - The role id for the predicted entity. + RoleID *uuid.UUID `json:"roleId,omitempty"` +} + +// 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"` + // Role - The role the entity plays in the utterance. + Role *string `json:"role,omitempty"` +} + +// EntityModelCreateObject an entity extractor create object. +type EntityModelCreateObject struct { + // Children - Child entities. + Children *[]ChildEntityModelCreateObject `json:"children,omitempty"` + // Name - Entity name. + Name *string `json:"name,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', 'ReadableTypeChildEntityExtractor', 'ReadableTypeHierarchicalEntityExtractor', 'ReadableTypeHierarchicalChildEntityExtractor', 'ReadableTypeCompositeEntityExtractor', 'ReadableTypeListEntityExtractor', 'ReadableTypePrebuiltEntityExtractor', 'ReadableTypeIntentClassifier', 'ReadableTypePatternAnyEntityExtractor', 'ReadableTypeClosedListEntityExtractor', 'ReadableTypeRegexEntityExtractor' + ReadableType ReadableType `json:"readableType,omitempty"` +} + +// EntityModelUpdateObject an entity extractor update object. +type EntityModelUpdateObject struct { + // Name - Entity name. + Name *string `json:"name,omitempty"` + // InstanceOf - The instance of model name + InstanceOf *string `json:"instanceOf,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) +} + +// UnmarshalJSON is the custom unmarshaler for ErrorResponse struct. +func (er *ErrorResponse) UnmarshalJSON(body []byte) 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 er.AdditionalProperties == nil { + er.AdditionalProperties = make(map[string]interface{}) + } + er.AdditionalProperties[k] = additionalProperties + } + case "errorType": + if v != nil { + var errorType string + err = json.Unmarshal(*v, &errorType) + if err != nil { + return err + } + er.ErrorType = &errorType + } + } + } + + return nil +} + +// ExampleLabelObject a labeled example utterance. +type ExampleLabelObject struct { + // Text - The example utterance. + Text *string `json:"text,omitempty"` + // EntityLabels - The identified entities within the example utterance. + EntityLabels *[]EntityLabelObject `json:"entityLabels,omitempty"` + // IntentName - The identified intent representing the example utterance. + IntentName *string `json:"intentName,omitempty"` +} + +// ExplicitListItem explicit (exception) 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 (exception) list item. +type ExplicitListItemCreateObject struct { + // ExplicitListItem - The explicit list item. + ExplicitListItem *string `json:"explicitListItem,omitempty"` +} + +// ExplicitListItemUpdateObject model object for updating an explicit (exception) 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"` + // EnabledForAllModels - Indicates if the feature is enabled for all models in the application. + EnabledForAllModels *bool `json:"enabledForAllModels,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:"-"` + // 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"` + // InstanceOf - Instance of Model. + InstanceOf *string `json:"instanceOf,omitempty"` + // TypeID - The type ID of the Entity Model. + TypeID *int32 `json:"typeId,omitempty"` + // ReadableType - Possible values include: 'ReadableType1EntityExtractor', 'ReadableType1ChildEntityExtractor', 'ReadableType1HierarchicalEntityExtractor', 'ReadableType1HierarchicalChildEntityExtractor', 'ReadableType1CompositeEntityExtractor', 'ReadableType1ListEntityExtractor', 'ReadableType1PrebuiltEntityExtractor', 'ReadableType1IntentClassifier', 'ReadableType1PatternAnyEntityExtractor', 'ReadableType1ClosedListEntityExtractor', 'ReadableType1RegexEntityExtractor' + ReadableType ReadableType1 `json:"readableType,omitempty"` + // Children - List of children + Children *[]ChildEntity `json:"children,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: 'ReadableType3EntityExtractor', 'ReadableType3ChildEntityExtractor', 'ReadableType3HierarchicalEntityExtractor', 'ReadableType3HierarchicalChildEntityExtractor', 'ReadableType3CompositeEntityExtractor', 'ReadableType3ListEntityExtractor', 'ReadableType3PrebuiltEntityExtractor', 'ReadableType3IntentClassifier', 'ReadableType3PatternAnyEntityExtractor', 'ReadableType3ClosedListEntityExtractor', 'ReadableType3RegexEntityExtractor' + ReadableType ReadableType3 `json:"readableType,omitempty"` + Roles *[]EntityRole `json:"roles,omitempty"` + // Children - List of child entities. + Children *[]ChildEntity `json:"children,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"` +} + +// Int64 ... +type Int64 struct { + autorest.Response `json:"-"` + Value *int64 `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', 'ReadableTypeChildEntityExtractor', 'ReadableTypeHierarchicalEntityExtractor', 'ReadableTypeHierarchicalChildEntityExtractor', 'ReadableTypeCompositeEntityExtractor', 'ReadableTypeListEntityExtractor', 'ReadableTypePrebuiltEntityExtractor', 'ReadableTypeIntentClassifier', 'ReadableTypePatternAnyEntityExtractor', 'ReadableTypeClosedListEntityExtractor', '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. For example, "What's the weather like in seattle?" + Text *string `json:"text,omitempty"` + // TokenizedText - The tokenized utterance. + 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"` + // Role - The role the entity plays in the utterance. + Role *string `json:"role,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 interchangeable phrase list feature serves as a list of synonyms for training. A non-exchangeable phrase list serves as separate features for training. So, if your non-interchangeable phrase list contains 5 phrases, they will be mapped to 5 separate features. You can think of the non-interchangeable phrase list as an additional bag of words to add to LUIS existing vocabulary features. 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. 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. For example, "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 utterance. +type LabelExampleResponse struct { + autorest.Response `json:"-"` + // UtteranceText - The example utterance. + UtteranceText *string `json:"UtteranceText,omitempty"` + // ExampleID - The newly created sample ID. + ExampleID *int32 `json:"ExampleId,omitempty"` +} + +// LabelTextObject an object containing the example utterance's text. +type LabelTextObject struct { + // ID - The ID of the Label. + ID *int32 `json:"id,omitempty"` + // Text - The text of the label. + Text *string `json:"text,omitempty"` +} + +// ListApplicationInfoResponse ... +type ListApplicationInfoResponse struct { + autorest.Response `json:"-"` + Value *[]ApplicationInfoResponse `json:"value,omitempty"` +} + +// ListAppVersionSettingObject ... +type ListAppVersionSettingObject struct { + autorest.Response `json:"-"` + Value *[]AppVersionSettingObject `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"` +} + +// ListAzureAccountInfoObject ... +type ListAzureAccountInfoObject struct { + autorest.Response `json:"-"` + Value *[]AzureAccountInfoObject `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"` +} + +// ListLabelTextObject ... +type ListLabelTextObject struct { + autorest.Response `json:"-"` + Value *[]LabelTextObject `json:"value,omitempty"` +} + +// ListModelFeatureInformation ... +type ListModelFeatureInformation struct { + autorest.Response `json:"-"` + Value *[]ModelFeatureInformation `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"` +} + +// ListNDepthEntityExtractor ... +type ListNDepthEntityExtractor struct { + autorest.Response `json:"-"` + Value *[]NDepthEntityExtractor `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 list entities. + 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 example 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) +} + +// UnmarshalJSON is the custom unmarshaler for LuisApp struct. +func (la *LuisApp) UnmarshalJSON(body []byte) 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 la.AdditionalProperties == nil { + la.AdditionalProperties = make(map[string]interface{}) + } + la.AdditionalProperties[k] = additionalProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + la.Name = &name + } + case "versionId": + if v != nil { + var versionID string + err = json.Unmarshal(*v, &versionID) + if err != nil { + return err + } + la.VersionID = &versionID + } + case "desc": + if v != nil { + var desc string + err = json.Unmarshal(*v, &desc) + if err != nil { + return err + } + la.Desc = &desc + } + case "culture": + if v != nil { + var culture string + err = json.Unmarshal(*v, &culture) + if err != nil { + return err + } + la.Culture = &culture + } + case "intents": + if v != nil { + var intents []HierarchicalModel + err = json.Unmarshal(*v, &intents) + if err != nil { + return err + } + la.Intents = &intents + } + case "entities": + if v != nil { + var entities []HierarchicalModel + err = json.Unmarshal(*v, &entities) + if err != nil { + return err + } + la.Entities = &entities + } + case "closedLists": + if v != nil { + var closedLists []ClosedList + err = json.Unmarshal(*v, &closedLists) + if err != nil { + return err + } + la.ClosedLists = &closedLists + } + case "composites": + if v != nil { + var composites []HierarchicalModel + err = json.Unmarshal(*v, &composites) + if err != nil { + return err + } + la.Composites = &composites + } + case "patternAnyEntities": + if v != nil { + var patternAnyEntities []PatternAny + err = json.Unmarshal(*v, &patternAnyEntities) + if err != nil { + return err + } + la.PatternAnyEntities = &patternAnyEntities + } + case "regex_entities": + if v != nil { + var regexEntities []RegexEntity + err = json.Unmarshal(*v, ®exEntities) + if err != nil { + return err + } + la.RegexEntities = ®exEntities + } + case "prebuiltEntities": + if v != nil { + var prebuiltEntities []PrebuiltEntity + err = json.Unmarshal(*v, &prebuiltEntities) + if err != nil { + return err + } + la.PrebuiltEntities = &prebuiltEntities + } + case "regex_features": + if v != nil { + var regexFeatures []JSONRegexFeature + err = json.Unmarshal(*v, ®exFeatures) + if err != nil { + return err + } + la.RegexFeatures = ®exFeatures + } + case "model_features": + if v != nil { + var modelFeatures []JSONModelFeature + err = json.Unmarshal(*v, &modelFeatures) + if err != nil { + return err + } + la.ModelFeatures = &modelFeatures + } + case "patterns": + if v != nil { + var patterns []PatternRule + err = json.Unmarshal(*v, &patterns) + if err != nil { + return err + } + la.Patterns = &patterns + } + case "utterances": + if v != nil { + var utterances []JSONUtterance + err = json.Unmarshal(*v, &utterances) + if err != nil { + return err + } + la.Utterances = &utterances + } + } + } + + return nil +} + +// ModelCreateObject object model for creating a new entity extractor. +type ModelCreateObject struct { + // Name - Name of the new entity extractor. + Name *string `json:"name,omitempty"` +} + +// ModelFeatureInformation an object containing the model feature information either the model name or +// feature name. +type ModelFeatureInformation struct { + // ModelName - The name of the model used. + ModelName *string `json:"modelName,omitempty"` + // FeatureName - The name of the feature used. + FeatureName *string `json:"featureName,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', 'ReadableTypeChildEntityExtractor', 'ReadableTypeHierarchicalEntityExtractor', 'ReadableTypeHierarchicalChildEntityExtractor', 'ReadableTypeCompositeEntityExtractor', 'ReadableTypeListEntityExtractor', 'ReadableTypePrebuiltEntityExtractor', 'ReadableTypeIntentClassifier', 'ReadableTypePatternAnyEntityExtractor', 'ReadableTypeClosedListEntityExtractor', '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: 'ReadableType2EntityExtractor', 'ReadableType2ChildEntityExtractor', 'ReadableType2HierarchicalEntityExtractor', 'ReadableType2HierarchicalChildEntityExtractor', 'ReadableType2CompositeEntityExtractor', 'ReadableType2ListEntityExtractor', 'ReadableType2PrebuiltEntityExtractor', 'ReadableType2IntentClassifier', 'ReadableType2PatternAnyEntityExtractor', 'ReadableType2ClosedListEntityExtractor', 'ReadableType2RegexEntityExtractor' + ReadableType ReadableType2 `json:"readableType,omitempty"` + Roles *[]EntityRole `json:"roles,omitempty"` + // Children - List of child entities. + Children *[]ChildEntity `json:"children,omitempty"` + // SubLists - List of sublists. + 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 Regular Expression 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"` +} + +// NDepthEntityExtractor n-Depth Entity Extractor. +type NDepthEntityExtractor 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', 'ReadableType9ChildEntityExtractor', 'ReadableType9HierarchicalEntityExtractor', 'ReadableType9HierarchicalChildEntityExtractor', 'ReadableType9CompositeEntityExtractor', 'ReadableType9ListEntityExtractor', 'ReadableType9PrebuiltEntityExtractor', 'ReadableType9IntentClassifier', 'ReadableType9PatternAnyEntityExtractor', 'ReadableType9ClosedListEntityExtractor', 'ReadableType9RegexEntityExtractor' + ReadableType ReadableType9 `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"` + Children *[]ChildEntity `json:"children,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: 'ReadableType11EntityExtractor', 'ReadableType11ChildEntityExtractor', 'ReadableType11HierarchicalEntityExtractor', 'ReadableType11HierarchicalChildEntityExtractor', 'ReadableType11CompositeEntityExtractor', 'ReadableType11ListEntityExtractor', 'ReadableType11PrebuiltEntityExtractor', 'ReadableType11IntentClassifier', 'ReadableType11PatternAnyEntityExtractor', 'ReadableType11ClosedListEntityExtractor', 'ReadableType11RegexEntityExtractor' + ReadableType ReadableType11 `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"` +} + +// 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"` + // EnabledForAllModels - Indicates if the feature is enabled for all models in the application. + EnabledForAllModels *bool `json:"enabledForAllModels,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"` +} + +// 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 interchangeable phrase list feature serves as a list of synonyms for training. A non-exchangeable phrase list serves as separate features for training. So, if your non-interchangeable phrase list contains 5 phrases, they will be mapped to 5 separate features. You can think of the non-interchangeable phrase list as an additional bag of words to add to LUIS existing vocabulary features. 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. 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"` + // EnabledForAllModels - Indicates if the feature is enabled for all models in the application. + EnabledForAllModels *bool `json:"enabledForAllModels,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"` + // EnabledForAllModels - Indicates if the Phraselist is enabled for all models in the application. + EnabledForAllModels *bool `json:"enabledForAllModels,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: 'ReadableType6EntityExtractor', 'ReadableType6ChildEntityExtractor', 'ReadableType6HierarchicalEntityExtractor', 'ReadableType6HierarchicalChildEntityExtractor', 'ReadableType6CompositeEntityExtractor', 'ReadableType6ListEntityExtractor', 'ReadableType6PrebuiltEntityExtractor', 'ReadableType6IntentClassifier', 'ReadableType6PatternAnyEntityExtractor', 'ReadableType6ClosedListEntityExtractor', 'ReadableType6RegexEntityExtractor' + ReadableType ReadableType6 `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"` + // FailedRegions - Regions where publishing failed. + FailedRegions *string `json:"failedRegions,omitempty"` + // PublishedDateTime - Timestamp when was last published. + PublishedDateTime *string `json:"publishedDateTime,omitempty"` +} + +// PublishSettings the application publish settings. +type PublishSettings struct { + autorest.Response `json:"-"` + // ID - The application ID. + ID *uuid.UUID `json:"id,omitempty"` + // IsSentimentAnalysisEnabled - Setting sentiment analysis as true returns the sentiment of the input utterance along with the response + IsSentimentAnalysisEnabled *bool `json:"sentimentAnalysis,omitempty"` + // IsSpeechEnabled - Enables speech priming in your app + IsSpeechEnabled *bool `json:"speech,omitempty"` + // IsSpellCheckerEnabled - Enables spell checking of the utterance. + IsSpellCheckerEnabled *bool `json:"spellChecker,omitempty"` +} + +// PublishSettingUpdateObject object model for updating an application's publish settings. +type PublishSettingUpdateObject struct { + // SentimentAnalysis - Setting sentiment analysis as true returns the Sentiment of the input utterance along with the response + SentimentAnalysis *bool `json:"sentimentAnalysis,omitempty"` + // Speech - Setting speech as public enables speech priming in your app + Speech *bool `json:"speech,omitempty"` + // SpellChecker - Setting spell checker as public enables spell checking the input utterance. + SpellChecker *bool `json:"spellChecker,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 regular Expression 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: 'ReadableType10EntityExtractor', 'ReadableType10ChildEntityExtractor', 'ReadableType10HierarchicalEntityExtractor', 'ReadableType10HierarchicalChildEntityExtractor', 'ReadableType10CompositeEntityExtractor', 'ReadableType10ListEntityExtractor', 'ReadableType10PrebuiltEntityExtractor', 'ReadableType10IntentClassifier', 'ReadableType10PatternAnyEntityExtractor', 'ReadableType10ClosedListEntityExtractor', 'ReadableType10RegexEntityExtractor' + ReadableType ReadableType10 `json:"readableType,omitempty"` + Roles *[]EntityRole `json:"roles,omitempty"` + // RegexPattern - The Regular Expression entity pattern. + RegexPattern *string `json:"regexPattern,omitempty"` +} + +// RegexModelCreateObject model object for creating a regular expression entity model. +type RegexModelCreateObject struct { + // RegexPattern - The regular expression entity pattern. + RegexPattern *string `json:"regexPattern,omitempty"` + // Name - The model name. + Name *string `json:"name,omitempty"` +} + +// RegexModelUpdateObject model object for updating a regular expression entity model. +type RegexModelUpdateObject struct { + // RegexPattern - The regular expression 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 list entity. +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 list entity. +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 + } + if vi.ExternalAPIKeys != nil { + 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 list entity'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 list entity. +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/preview/cognitiveservices/v3.0/luis/authoring/pattern.go b/services/preview/cognitiveservices/v3.0/luis/authoring/pattern.go new file mode 100644 index 000000000000..d827805145dc --- /dev/null +++ b/services/preview/cognitiveservices/v3.0/luis/authoring/pattern.go @@ -0,0 +1,723 @@ +package authoring + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "github.com/satori/go.uuid" + "net/http" +) + +// PatternClient is the client for the Pattern methods of the Authoring service. +type PatternClient struct { + BaseClient +} + +// NewPatternClient creates an instance of the PatternClient client. +func NewPatternClient(endpoint string) PatternClient { + return PatternClient{New(endpoint)} +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PatternClient.AddPattern") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.AddPatternPreparer(ctx, appID, versionID, pattern) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.PatternClient", "AddPattern", resp, "Failure sending request") + return + } + + result, err = client.AddPatternResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PatternClient.BatchAddPatterns") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + 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("authoring.PatternClient", "BatchAddPatterns", err.Error()) + } + + req, err := client.BatchAddPatternsPreparer(ctx, appID, versionID, patterns) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.PatternClient", "BatchAddPatterns", resp, "Failure sending request") + return + } + + result, err = client.BatchAddPatternsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PatternClient.DeletePattern") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePatternPreparer(ctx, appID, versionID, patternID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.PatternClient", "DeletePattern", resp, "Failure sending request") + return + } + + result, err = client.DeletePatternResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PatternClient.DeletePatterns") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + 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("authoring.PatternClient", "DeletePatterns", err.Error()) + } + + req, err := client.DeletePatternsPreparer(ctx, appID, versionID, patternIds) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.PatternClient", "DeletePatterns", resp, "Failure sending request") + return + } + + result, err = client.DeletePatternsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 +} + +// ListIntentPatterns sends the list 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) ListIntentPatterns(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID, skip *int32, take *int32) (result ListPatternRuleInfo, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PatternClient.ListIntentPatterns") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + 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: int64(500), Chain: nil}, + {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("authoring.PatternClient", "ListIntentPatterns", err.Error()) + } + + req, err := client.ListIntentPatternsPreparer(ctx, appID, versionID, intentID, skip, take) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.PatternClient", "ListIntentPatterns", nil, "Failure preparing request") + return + } + + resp, err := client.ListIntentPatternsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "authoring.PatternClient", "ListIntentPatterns", resp, "Failure sending request") + return + } + + result, err = client.ListIntentPatternsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.PatternClient", "ListIntentPatterns", resp, "Failure responding to request") + } + + return +} + +// ListIntentPatternsPreparer prepares the ListIntentPatterns request. +func (client PatternClient) ListIntentPatternsPreparer(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID, skip *int32, take *int32) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/intents/{intentId}/patternrules", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListIntentPatternsSender sends the ListIntentPatterns request. The method will close the +// http.Response Body if it receives an error. +func (client PatternClient) ListIntentPatternsSender(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...) +} + +// ListIntentPatternsResponder handles the response to the ListIntentPatterns request. The method always +// closes the http.Response Body. +func (client PatternClient) ListIntentPatternsResponder(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 +} + +// ListPatterns sends the list 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) ListPatterns(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result ListPatternRuleInfo, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PatternClient.ListPatterns") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + 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: int64(500), Chain: nil}, + {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("authoring.PatternClient", "ListPatterns", err.Error()) + } + + req, err := client.ListPatternsPreparer(ctx, appID, versionID, skip, take) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.PatternClient", "ListPatterns", nil, "Failure preparing request") + return + } + + resp, err := client.ListPatternsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "authoring.PatternClient", "ListPatterns", resp, "Failure sending request") + return + } + + result, err = client.ListPatternsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.PatternClient", "ListPatterns", resp, "Failure responding to request") + } + + return +} + +// ListPatternsPreparer prepares the ListPatterns request. +func (client PatternClient) ListPatternsPreparer(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternrules", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListPatternsSender sends the ListPatterns request. The method will close the +// http.Response Body if it receives an error. +func (client PatternClient) ListPatternsSender(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...) +} + +// ListPatternsResponder handles the response to the ListPatterns request. The method always +// closes the http.Response Body. +func (client PatternClient) ListPatternsResponder(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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PatternClient.UpdatePattern") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePatternPreparer(ctx, appID, versionID, patternID, pattern) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.PatternClient", "UpdatePattern", resp, "Failure sending request") + return + } + + result, err = client.UpdatePatternResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PatternClient.UpdatePatterns") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + 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("authoring.PatternClient", "UpdatePatterns", err.Error()) + } + + req, err := client.UpdatePatternsPreparer(ctx, appID, versionID, patterns) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.PatternClient", "UpdatePatterns", resp, "Failure sending request") + return + } + + result, err = client.UpdatePatternsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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/preview/cognitiveservices/v3.0/luis/authoring/permissions.go b/services/preview/cognitiveservices/v3.0/luis/authoring/permissions.go new file mode 100644 index 000000000000..f502cfb640e0 --- /dev/null +++ b/services/preview/cognitiveservices/v3.0/luis/authoring/permissions.go @@ -0,0 +1,337 @@ +package authoring + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "github.com/satori/go.uuid" + "net/http" +) + +// PermissionsClient is the client for the Permissions methods of the Authoring service. +type PermissionsClient struct { + BaseClient +} + +// NewPermissionsClient creates an instance of the PermissionsClient client. +func NewPermissionsClient(endpoint string) PermissionsClient { + return PermissionsClient{New(endpoint)} +} + +// Add adds a user to the allowed list of users to access this LUIS application. Users are added using their email +// address. +// Parameters: +// appID - the application ID. +// userToAdd - a model containing the user's email address. +func (client PermissionsClient) Add(ctx context.Context, appID uuid.UUID, userToAdd UserCollaborator) (result OperationStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PermissionsClient.Add") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.AddPreparer(ctx, appID, userToAdd) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.PermissionsClient", "Add", nil, "Failure preparing request") + return + } + + resp, err := client.AddSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "authoring.PermissionsClient", "Add", resp, "Failure sending request") + return + } + + result, err = client.AddResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.PermissionsClient", "Add", resp, "Failure responding to request") + } + + return +} + +// AddPreparer prepares the Add request. +func (client PermissionsClient) AddPreparer(ctx context.Context, appID uuid.UUID, userToAdd UserCollaborator) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "appId": autorest.Encode("path", appID), + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithPathParameters("/apps/{appId}/permissions", pathParameters), + autorest.WithJSON(userToAdd)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AddSender sends the Add request. The method will close the +// http.Response Body if it receives an error. +func (client PermissionsClient) AddSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// AddResponder handles the response to the Add request. The method always +// closes the http.Response Body. +func (client PermissionsClient) AddResponder(resp *http.Response) (result OperationStatus, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete removes a user from the allowed list of users to access this LUIS application. Users are removed using their +// email address. +// Parameters: +// appID - the application ID. +// userToDelete - a model containing the user's email address. +func (client PermissionsClient) Delete(ctx context.Context, appID uuid.UUID, userToDelete UserCollaborator) (result OperationStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PermissionsClient.Delete") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, appID, userToDelete) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.PermissionsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "authoring.PermissionsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.PermissionsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client PermissionsClient) DeletePreparer(ctx context.Context, appID uuid.UUID, userToDelete UserCollaborator) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "appId": autorest.Encode("path", appID), + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithPathParameters("/apps/{appId}/permissions", pathParameters), + autorest.WithJSON(userToDelete)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client PermissionsClient) DeleteSender(req *http.Request) (*http.Response, error) { + 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 PermissionsClient) DeleteResponder(resp *http.Response) (result OperationStatus, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of user emails that have permissions to access your application. +// Parameters: +// appID - the application ID. +func (client PermissionsClient) List(ctx context.Context, appID uuid.UUID) (result UserAccessList, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PermissionsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPreparer(ctx, appID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.PermissionsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "authoring.PermissionsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.PermissionsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client PermissionsClient) ListPreparer(ctx context.Context, appID uuid.UUID) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "appId": autorest.Encode("path", appID), + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithPathParameters("/apps/{appId}/permissions", pathParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client PermissionsClient) ListSender(req *http.Request) (*http.Response, error) { + 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 PermissionsClient) ListResponder(resp *http.Response) (result UserAccessList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update replaces the current user access list with the new list sent in the body. If an empty list is sent, all +// access to other users will be removed. +// Parameters: +// appID - the application ID. +// collaborators - a model containing a list of user email addresses. +func (client PermissionsClient) Update(ctx context.Context, appID uuid.UUID, collaborators CollaboratorsArray) (result OperationStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PermissionsClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, appID, collaborators) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.PermissionsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "authoring.PermissionsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.PermissionsClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client PermissionsClient) UpdatePreparer(ctx context.Context, appID uuid.UUID, collaborators CollaboratorsArray) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "appId": autorest.Encode("path", appID), + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithPathParameters("/apps/{appId}/permissions", pathParameters), + autorest.WithJSON(collaborators)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client PermissionsClient) UpdateSender(req *http.Request) (*http.Response, error) { + 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 PermissionsClient) UpdateResponder(resp *http.Response) (result OperationStatus, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/cognitiveservices/v3.0/luis/authoring/settings.go b/services/preview/cognitiveservices/v3.0/luis/authoring/settings.go new file mode 100644 index 000000000000..f5a254b06f0b --- /dev/null +++ b/services/preview/cognitiveservices/v3.0/luis/authoring/settings.go @@ -0,0 +1,195 @@ +package authoring + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "github.com/satori/go.uuid" + "net/http" +) + +// SettingsClient is the client for the Settings methods of the Authoring service. +type SettingsClient struct { + BaseClient +} + +// NewSettingsClient creates an instance of the SettingsClient client. +func NewSettingsClient(endpoint string) SettingsClient { + return SettingsClient{New(endpoint)} +} + +// List gets the settings in a version of the application. +// Parameters: +// appID - the application ID. +// versionID - the version ID. +func (client SettingsClient) List(ctx context.Context, appID uuid.UUID, versionID string) (result ListAppVersionSettingObject, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SettingsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPreparer(ctx, appID, versionID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.SettingsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "authoring.SettingsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.SettingsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client SettingsClient) ListPreparer(ctx context.Context, appID uuid.UUID, versionID string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "appId": autorest.Encode("path", appID), + "versionId": autorest.Encode("path", versionID), + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/settings", 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 SettingsClient) 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 SettingsClient) ListResponder(resp *http.Response) (result ListAppVersionSettingObject, 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 settings in a version of the application. +// Parameters: +// appID - the application ID. +// versionID - the version ID. +// listOfAppVersionSettingObject - a list of the updated application version settings. +func (client SettingsClient) Update(ctx context.Context, appID uuid.UUID, versionID string, listOfAppVersionSettingObject []AppVersionSettingObject) (result OperationStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SettingsClient.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: listOfAppVersionSettingObject, + Constraints: []validation.Constraint{{Target: "listOfAppVersionSettingObject", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("authoring.SettingsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, appID, versionID, listOfAppVersionSettingObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.SettingsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "authoring.SettingsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.SettingsClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client SettingsClient) UpdatePreparer(ctx context.Context, appID uuid.UUID, versionID string, listOfAppVersionSettingObject []AppVersionSettingObject) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/settings", pathParameters), + autorest.WithJSON(listOfAppVersionSettingObject)) + 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 SettingsClient) 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 SettingsClient) UpdateResponder(resp *http.Response) (result OperationStatus, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/cognitiveservices/v3.0/luis/authoring/train.go b/services/preview/cognitiveservices/v3.0/luis/authoring/train.go new file mode 100644 index 000000000000..aaba41df3efc --- /dev/null +++ b/services/preview/cognitiveservices/v3.0/luis/authoring/train.go @@ -0,0 +1,191 @@ +package authoring + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "github.com/satori/go.uuid" + "net/http" +) + +// TrainClient is the client for the Train methods of the Authoring service. +type TrainClient struct { + BaseClient +} + +// NewTrainClient creates an instance of the TrainClient client. +func NewTrainClient(endpoint string) TrainClient { + return TrainClient{New(endpoint)} +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TrainClient.GetStatus") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetStatusPreparer(ctx, appID, versionID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.TrainClient", "GetStatus", resp, "Failure sending request") + return + } + + result, err = client.GetStatusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "appId": autorest.Encode("path", appID), + "versionId": autorest.Encode("path", versionID), + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TrainClient.TrainVersion") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.TrainVersionPreparer(ctx, appID, versionID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.TrainClient", "TrainVersion", resp, "Failure sending request") + return + } + + result, err = client.TrainVersionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "appId": autorest.Encode("path", appID), + "versionId": autorest.Encode("path", versionID), + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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/preview/cognitiveservices/v3.0/luis/authoring/version.go b/services/preview/cognitiveservices/v3.0/luis/authoring/version.go new file mode 100644 index 000000000000..5621f83fc771 --- /dev/null +++ b/services/preview/cognitiveservices/v3.0/luis/authoring/version.go @@ -0,0 +1,30 @@ +package authoring + +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 + " authoring/3.0-preview" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/preview/cognitiveservices/v3.0/luis/authoring/versions.go b/services/preview/cognitiveservices/v3.0/luis/authoring/versions.go new file mode 100644 index 000000000000..bfb400e04767 --- /dev/null +++ b/services/preview/cognitiveservices/v3.0/luis/authoring/versions.go @@ -0,0 +1,674 @@ +package authoring + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "github.com/satori/go.uuid" + "net/http" +) + +// VersionsClient is the client for the Versions methods of the Authoring service. +type VersionsClient struct { + BaseClient +} + +// NewVersionsClient creates an instance of the VersionsClient client. +func NewVersionsClient(endpoint string) VersionsClient { + return VersionsClient{New(endpoint)} +} + +// Clone creates a new version from the selected 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VersionsClient.Clone") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ClonePreparer(ctx, appID, versionID, versionCloneObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.VersionsClient", "Clone", resp, "Failure sending request") + return + } + + result, err = client.CloneResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/clone", pathParameters), + 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VersionsClient.Delete") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, appID, versionID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.VersionsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "appId": autorest.Encode("path", appID), + "versionId": autorest.Encode("path", versionID), + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", 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) { + 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 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 in a version of the application. +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VersionsClient.DeleteUnlabelledUtterance") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeleteUnlabelledUtterancePreparer(ctx, appID, versionID, utterance) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.VersionsClient", "DeleteUnlabelledUtterance", resp, "Failure sending request") + return + } + + result, err = client.DeleteUnlabelledUtteranceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VersionsClient.Export") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ExportPreparer(ctx, appID, versionID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.VersionsClient", "Export", resp, "Failure sending request") + return + } + + result, err = client.ExportResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "appId": autorest.Encode("path", appID), + "versionId": autorest.Encode("path", versionID), + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 information such as date created, last modified date, endpoint URL, count of intents and +// entities, training and publishing status. +// 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VersionsClient.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, versionID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.VersionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "appId": autorest.Encode("path", appID), + "versionId": autorest.Encode("path", versionID), + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", 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) { + 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 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VersionsClient.Import") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ImportPreparer(ctx, appID, luisApp, versionID) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.VersionsClient", "Import", resp, "Failure sending request") + return + } + + result, err = client.ImportResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// 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 a list of versions for this application ID. +// 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 tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VersionsClient.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: 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: int64(500), Chain: nil}, + {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("authoring.VersionsClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, appID, skip, take) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.VersionsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + 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 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) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VersionsClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, appID, versionID, versionUpdateObject) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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, "authoring.VersionsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "authoring.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{}{ + "Endpoint": client.Endpoint, + } + + 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("{Endpoint}/luis/api/v3.0-preview", 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) { + 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 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/preview/containerregistry/mgmt/2018-02-01/containerregistry/models.go b/services/preview/containerregistry/mgmt/2018-02-01/containerregistry/models.go index 82c442d86055..7935c26a8cbc 100644 --- a/services/preview/containerregistry/mgmt/2018-02-01/containerregistry/models.go +++ b/services/preview/containerregistry/mgmt/2018-02-01/containerregistry/models.go @@ -3008,8 +3008,6 @@ type Registry struct { autorest.Response `json:"-"` // Sku - The SKU of the container registry. Sku *Sku `json:"sku,omitempty"` - // Identity - The identity of the container registry. - Identity *RegistryIdentity `json:"identity,omitempty"` // RegistryProperties - The properties of the container registry. *RegistryProperties `json:"properties,omitempty"` // ID - READ-ONLY; The resource ID. @@ -3030,9 +3028,6 @@ func (r Registry) MarshalJSON() ([]byte, error) { if r.Sku != nil { objectMap["sku"] = r.Sku } - if r.Identity != nil { - objectMap["identity"] = r.Identity - } if r.RegistryProperties != nil { objectMap["properties"] = r.RegistryProperties } @@ -3063,15 +3058,6 @@ func (r *Registry) UnmarshalJSON(body []byte) error { } r.Sku = &sku } - case "identity": - if v != nil { - var identity RegistryIdentity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - r.Identity = &identity - } case "properties": if v != nil { var registryProperties RegistryProperties @@ -3132,16 +3118,6 @@ func (r *Registry) UnmarshalJSON(body []byte) error { return nil } -// RegistryIdentity the identity of the container registry. -type RegistryIdentity struct { - // Type - The type of identity used for the registry. - Type *string `json:"type,omitempty"` - // PrincipalID - The principal ID of registry identity. - PrincipalID *string `json:"principalId,omitempty"` - // TenantID - The tenant ID associated with the registry. - TenantID *string `json:"tenantId,omitempty"` -} - // RegistryListCredentialsResult the response from the ListCredentials operation. type RegistryListCredentialsResult struct { autorest.Response `json:"-"` @@ -3367,8 +3343,6 @@ type RegistryUpdateParameters struct { Tags map[string]*string `json:"tags"` // Sku - The SKU of the container registry. Sku *Sku `json:"sku,omitempty"` - // Identity - The identity of the container registry. - Identity *RegistryIdentity `json:"identity,omitempty"` // RegistryPropertiesUpdateParameters - The properties that the container registry will be updated with. *RegistryPropertiesUpdateParameters `json:"properties,omitempty"` } @@ -3382,9 +3356,6 @@ func (rup RegistryUpdateParameters) MarshalJSON() ([]byte, error) { if rup.Sku != nil { objectMap["sku"] = rup.Sku } - if rup.Identity != nil { - objectMap["identity"] = rup.Identity - } if rup.RegistryPropertiesUpdateParameters != nil { objectMap["properties"] = rup.RegistryPropertiesUpdateParameters } @@ -3418,15 +3389,6 @@ func (rup *RegistryUpdateParameters) UnmarshalJSON(body []byte) error { } rup.Sku = &sku } - case "identity": - if v != nil { - var identity RegistryIdentity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - rup.Identity = &identity - } case "properties": if v != nil { var registryPropertiesUpdateParameters RegistryPropertiesUpdateParameters diff --git a/services/preview/containerservice/mgmt/2019-09-30-preview/containerservice/agentpools.go b/services/preview/containerservice/mgmt/2019-09-30-preview/containerservice/agentpools.go new file mode 100644 index 000000000000..0deeb2385425 --- /dev/null +++ b/services/preview/containerservice/mgmt/2019-09-30-preview/containerservice/agentpools.go @@ -0,0 +1,621 @@ +package containerservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// AgentPoolsClient is the the Container Service Client. +type AgentPoolsClient struct { + BaseClient +} + +// NewAgentPoolsClient creates an instance of the AgentPoolsClient client. +func NewAgentPoolsClient(subscriptionID string) AgentPoolsClient { + return NewAgentPoolsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAgentPoolsClientWithBaseURI creates an instance of the AgentPoolsClient client. +func NewAgentPoolsClientWithBaseURI(baseURI string, subscriptionID string) AgentPoolsClient { + return AgentPoolsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates an agent pool in the specified managed cluster. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +// agentPoolName - the name of the agent pool. +// parameters - parameters supplied to the Create or Update an agent pool operation. +func (client AgentPoolsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, parameters AgentPool) (result AgentPoolsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.ManagedClusterAgentPoolProfileProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterAgentPoolProfileProperties.Count", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterAgentPoolProfileProperties.Count", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, + {Target: "parameters.ManagedClusterAgentPoolProfileProperties.Count", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("containerservice.AgentPoolsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceName, agentPoolName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client AgentPoolsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, parameters AgentPool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "agentPoolName": autorest.Encode("path", agentPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client AgentPoolsClient) CreateOrUpdateSender(req *http.Request) (future AgentPoolsCreateOrUpdateFuture, err error) { + 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 AgentPoolsClient) CreateOrUpdateResponder(resp *http.Response) (result AgentPool, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the agent pool in the specified managed cluster. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +// agentPoolName - the name of the agent pool. +func (client AgentPoolsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (result AgentPoolsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolsClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.AgentPoolsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName, agentPoolName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client AgentPoolsClient) DeletePreparer(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "agentPoolName": autorest.Encode("path", agentPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client AgentPoolsClient) DeleteSender(req *http.Request) (future AgentPoolsDeleteFuture, err error) { + 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 AgentPoolsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of the agent pool by managed cluster and resource group. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +// agentPoolName - the name of the agent pool. +func (client AgentPoolsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (result AgentPool, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.AgentPoolsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName, agentPoolName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client AgentPoolsClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "agentPoolName": autorest.Encode("path", agentPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client AgentPoolsClient) GetSender(req *http.Request) (*http.Response, error) { + 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 AgentPoolsClient) GetResponder(resp *http.Response) (result AgentPool, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetAvailableAgentPoolVersions gets a list of supported versions for the specified agent pool. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +func (client AgentPoolsClient) GetAvailableAgentPoolVersions(ctx context.Context, resourceGroupName string, resourceName string) (result AgentPoolAvailableVersions, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolsClient.GetAvailableAgentPoolVersions") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.AgentPoolsClient", "GetAvailableAgentPoolVersions", err.Error()) + } + + req, err := client.GetAvailableAgentPoolVersionsPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "GetAvailableAgentPoolVersions", nil, "Failure preparing request") + return + } + + resp, err := client.GetAvailableAgentPoolVersionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "GetAvailableAgentPoolVersions", resp, "Failure sending request") + return + } + + result, err = client.GetAvailableAgentPoolVersionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "GetAvailableAgentPoolVersions", resp, "Failure responding to request") + } + + return +} + +// GetAvailableAgentPoolVersionsPreparer prepares the GetAvailableAgentPoolVersions request. +func (client AgentPoolsClient) GetAvailableAgentPoolVersionsPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "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.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetAvailableAgentPoolVersionsSender sends the GetAvailableAgentPoolVersions request. The method will close the +// http.Response Body if it receives an error. +func (client AgentPoolsClient) GetAvailableAgentPoolVersionsSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetAvailableAgentPoolVersionsResponder handles the response to the GetAvailableAgentPoolVersions request. The method always +// closes the http.Response Body. +func (client AgentPoolsClient) GetAvailableAgentPoolVersionsResponder(resp *http.Response) (result AgentPoolAvailableVersions, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetUpgradeProfile gets the details of the upgrade profile for an agent pool with a specified resource group and +// managed cluster name. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +// agentPoolName - the name of the agent pool. +func (client AgentPoolsClient) GetUpgradeProfile(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (result AgentPoolUpgradeProfile, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolsClient.GetUpgradeProfile") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.AgentPoolsClient", "GetUpgradeProfile", err.Error()) + } + + req, err := client.GetUpgradeProfilePreparer(ctx, resourceGroupName, resourceName, agentPoolName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "GetUpgradeProfile", nil, "Failure preparing request") + return + } + + resp, err := client.GetUpgradeProfileSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "GetUpgradeProfile", resp, "Failure sending request") + return + } + + result, err = client.GetUpgradeProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "GetUpgradeProfile", resp, "Failure responding to request") + } + + return +} + +// GetUpgradeProfilePreparer prepares the GetUpgradeProfile request. +func (client AgentPoolsClient) GetUpgradeProfilePreparer(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "agentPoolName": autorest.Encode("path", agentPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetUpgradeProfileSender sends the GetUpgradeProfile request. The method will close the +// http.Response Body if it receives an error. +func (client AgentPoolsClient) GetUpgradeProfileSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetUpgradeProfileResponder handles the response to the GetUpgradeProfile request. The method always +// closes the http.Response Body. +func (client AgentPoolsClient) GetUpgradeProfileResponder(resp *http.Response) (result AgentPoolUpgradeProfile, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets a list of agent pools in the specified managed cluster. The operation returns properties of each agent +// pool. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +func (client AgentPoolsClient) List(ctx context.Context, resourceGroupName string, resourceName string) (result AgentPoolListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolsClient.List") + defer func() { + sc := -1 + if result.aplr.Response.Response != nil { + sc = result.aplr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.AgentPoolsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.aplr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "List", resp, "Failure sending request") + return + } + + result.aplr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client AgentPoolsClient) ListPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "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.ContainerService/managedClusters/{resourceName}/agentPools", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client AgentPoolsClient) ListSender(req *http.Request) (*http.Response, error) { + 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 AgentPoolsClient) ListResponder(resp *http.Response) (result AgentPoolListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client AgentPoolsClient) listNextResults(ctx context.Context, lastResults AgentPoolListResult) (result AgentPoolListResult, err error) { + req, err := lastResults.agentPoolListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client AgentPoolsClient) ListComplete(ctx context.Context, resourceGroupName string, resourceName string) (result AgentPoolListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, resourceName) + return +} diff --git a/services/preview/containerservice/mgmt/2019-09-30-preview/containerservice/client.go b/services/preview/containerservice/mgmt/2019-09-30-preview/containerservice/client.go new file mode 100644 index 000000000000..09a36def717c --- /dev/null +++ b/services/preview/containerservice/mgmt/2019-09-30-preview/containerservice/client.go @@ -0,0 +1,51 @@ +// Package containerservice implements the Azure ARM Containerservice service API version . +// +// The Container Service Client. +package containerservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Containerservice + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Containerservice. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the BaseClient client. +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} diff --git a/services/preview/containerservice/mgmt/2019-09-30-preview/containerservice/containerserviceapi/interfaces.go b/services/preview/containerservice/mgmt/2019-09-30-preview/containerservice/containerserviceapi/interfaces.go new file mode 100644 index 000000000000..48d8fcad7f57 --- /dev/null +++ b/services/preview/containerservice/mgmt/2019-09-30-preview/containerservice/containerserviceapi/interfaces.go @@ -0,0 +1,85 @@ +package containerserviceapi + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/services/preview/containerservice/mgmt/2019-09-30-preview/containerservice" +) + +// OpenShiftManagedClustersClientAPI contains the set of methods on the OpenShiftManagedClustersClient type. +type OpenShiftManagedClustersClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters containerservice.OpenShiftManagedCluster) (result containerservice.OpenShiftManagedClustersCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.OpenShiftManagedClustersDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.OpenShiftManagedCluster, err error) + List(ctx context.Context) (result containerservice.OpenShiftManagedClusterListResultPage, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result containerservice.OpenShiftManagedClusterListResultPage, err error) + UpdateTags(ctx context.Context, resourceGroupName string, resourceName string, parameters containerservice.TagsObject) (result containerservice.OpenShiftManagedClustersUpdateTagsFuture, err error) +} + +var _ OpenShiftManagedClustersClientAPI = (*containerservice.OpenShiftManagedClustersClient)(nil) + +// ContainerServicesClientAPI contains the set of methods on the ContainerServicesClient type. +type ContainerServicesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, containerServiceName string, parameters containerservice.ContainerService) (result containerservice.ContainerServicesCreateOrUpdateFutureType, err error) + Delete(ctx context.Context, resourceGroupName string, containerServiceName string) (result containerservice.ContainerServicesDeleteFutureType, err error) + Get(ctx context.Context, resourceGroupName string, containerServiceName string) (result containerservice.ContainerService, err error) + List(ctx context.Context) (result containerservice.ListResultPage, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result containerservice.ListResultPage, err error) + ListOrchestrators(ctx context.Context, location string, resourceType string) (result containerservice.OrchestratorVersionProfileListResult, err error) +} + +var _ ContainerServicesClientAPI = (*containerservice.ContainerServicesClient)(nil) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result containerservice.OperationListResult, err error) +} + +var _ OperationsClientAPI = (*containerservice.OperationsClient)(nil) + +// ManagedClustersClientAPI contains the set of methods on the ManagedClustersClient type. +type ManagedClustersClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters containerservice.ManagedCluster) (result containerservice.ManagedClustersCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.ManagedClustersDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.ManagedCluster, err error) + GetAccessProfile(ctx context.Context, resourceGroupName string, resourceName string, roleName string) (result containerservice.ManagedClusterAccessProfile, err error) + GetUpgradeProfile(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.ManagedClusterUpgradeProfile, err error) + List(ctx context.Context) (result containerservice.ManagedClusterListResultPage, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result containerservice.ManagedClusterListResultPage, err error) + ListClusterAdminCredentials(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.CredentialResults, err error) + ListClusterUserCredentials(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.CredentialResults, err error) + ResetAADProfile(ctx context.Context, resourceGroupName string, resourceName string, parameters containerservice.ManagedClusterAADProfile) (result containerservice.ManagedClustersResetAADProfileFuture, err error) + ResetServicePrincipalProfile(ctx context.Context, resourceGroupName string, resourceName string, parameters containerservice.ManagedClusterServicePrincipalProfile) (result containerservice.ManagedClustersResetServicePrincipalProfileFuture, err error) + RotateClusterCertificates(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.ManagedClustersRotateClusterCertificatesFuture, err error) + UpdateTags(ctx context.Context, resourceGroupName string, resourceName string, parameters containerservice.TagsObject) (result containerservice.ManagedClustersUpdateTagsFuture, err error) +} + +var _ ManagedClustersClientAPI = (*containerservice.ManagedClustersClient)(nil) + +// AgentPoolsClientAPI contains the set of methods on the AgentPoolsClient type. +type AgentPoolsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, parameters containerservice.AgentPool) (result containerservice.AgentPoolsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (result containerservice.AgentPoolsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (result containerservice.AgentPool, err error) + GetAvailableAgentPoolVersions(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.AgentPoolAvailableVersions, err error) + GetUpgradeProfile(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (result containerservice.AgentPoolUpgradeProfile, err error) + List(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.AgentPoolListResultPage, err error) +} + +var _ AgentPoolsClientAPI = (*containerservice.AgentPoolsClient)(nil) diff --git a/services/preview/containerservice/mgmt/2019-09-30-preview/containerservice/containerservices.go b/services/preview/containerservice/mgmt/2019-09-30-preview/containerservice/containerservices.go new file mode 100644 index 000000000000..1bd2a37eec45 --- /dev/null +++ b/services/preview/containerservice/mgmt/2019-09-30-preview/containerservice/containerservices.go @@ -0,0 +1,622 @@ +package containerservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ContainerServicesClient is the the Container Service Client. +type ContainerServicesClient struct { + BaseClient +} + +// NewContainerServicesClient creates an instance of the ContainerServicesClient client. +func NewContainerServicesClient(subscriptionID string) ContainerServicesClient { + return NewContainerServicesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewContainerServicesClientWithBaseURI creates an instance of the ContainerServicesClient client. +func NewContainerServicesClientWithBaseURI(baseURI string, subscriptionID string) ContainerServicesClient { + return ContainerServicesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a container service with the specified configuration of orchestrator, masters, and +// agents. +// Parameters: +// resourceGroupName - the name of the resource group. +// containerServiceName - the name of the container service in the specified subscription and resource group. +// parameters - parameters supplied to the Create or Update a Container Service operation. +func (client ContainerServicesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, containerServiceName string, parameters ContainerService) (result ContainerServicesCreateOrUpdateFutureType, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Properties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Properties.OrchestratorProfile", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.Properties.CustomProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Properties.CustomProfile.Orchestrator", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.Properties.ServicePrincipalProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Properties.ServicePrincipalProfile.ClientID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.Properties.ServicePrincipalProfile.KeyVaultSecretRef", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Properties.ServicePrincipalProfile.KeyVaultSecretRef.VaultID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.Properties.ServicePrincipalProfile.KeyVaultSecretRef.SecretName", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + {Target: "parameters.Properties.MasterProfile", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Properties.MasterProfile.DNSPrefix", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.Properties.WindowsProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Properties.WindowsProfile.AdminUsername", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Properties.WindowsProfile.AdminUsername", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([._]?[a-zA-Z0-9]+)*$`, Chain: nil}}}, + {Target: "parameters.Properties.WindowsProfile.AdminPassword", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "parameters.Properties.LinuxProfile", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Properties.LinuxProfile.AdminUsername", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Properties.LinuxProfile.AdminUsername", Name: validation.Pattern, Rule: `^[A-Za-z][-A-Za-z0-9_]*$`, Chain: nil}}}, + {Target: "parameters.Properties.LinuxProfile.SSH", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Properties.LinuxProfile.SSH.PublicKeys", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + {Target: "parameters.Properties.DiagnosticsProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Properties.DiagnosticsProfile.VMDiagnostics", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Properties.DiagnosticsProfile.VMDiagnostics.Enabled", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + }}}}}); err != nil { + return result, validation.NewError("containerservice.ContainerServicesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, containerServiceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ContainerServicesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, containerServiceName string, parameters ContainerService) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerServiceName": autorest.Encode("path", containerServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerServicesClient) CreateOrUpdateSender(req *http.Request) (future ContainerServicesCreateOrUpdateFutureType, err error) { + 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 ContainerServicesClient) CreateOrUpdateResponder(resp *http.Response) (result ContainerService, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the specified container service in the specified subscription and resource group. The operation does +// not delete other resources created as part of creating a container service, including storage accounts, VMs, and +// availability sets. All the other resources created with the container service are part of the same resource group +// and can be deleted individually. +// Parameters: +// resourceGroupName - the name of the resource group. +// containerServiceName - the name of the container service in the specified subscription and resource group. +func (client ContainerServicesClient) Delete(ctx context.Context, resourceGroupName string, containerServiceName string) (result ContainerServicesDeleteFutureType, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, containerServiceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ContainerServicesClient) DeletePreparer(ctx context.Context, resourceGroupName string, containerServiceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerServiceName": autorest.Encode("path", containerServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerServicesClient) DeleteSender(req *http.Request) (future ContainerServicesDeleteFutureType, err error) { + 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 ContainerServicesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the properties of the specified container service in the specified subscription and resource group. The +// operation returns the properties including state, orchestrator, number of masters and agents, and FQDNs of masters +// and agents. +// Parameters: +// resourceGroupName - the name of the resource group. +// containerServiceName - the name of the container service in the specified subscription and resource group. +func (client ContainerServicesClient) Get(ctx context.Context, resourceGroupName string, containerServiceName string) (result ContainerService, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, containerServiceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ContainerServicesClient) GetPreparer(ctx context.Context, resourceGroupName string, containerServiceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerServiceName": autorest.Encode("path", containerServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerServicesClient) GetSender(req *http.Request) (*http.Response, error) { + 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 ContainerServicesClient) GetResponder(resp *http.Response) (result ContainerService, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets a list of container services in the specified subscription. The operation returns properties of each +// container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. +func (client ContainerServicesClient) List(ctx context.Context) (result ListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.List") + defer func() { + sc := -1 + if result.lr.Response.Response != nil { + sc = result.lr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.lr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "List", resp, "Failure sending request") + return + } + + result.lr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ContainerServicesClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/containerServices", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerServicesClient) ListSender(req *http.Request) (*http.Response, error) { + 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 ContainerServicesClient) ListResponder(resp *http.Response) (result ListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ContainerServicesClient) listNextResults(ctx context.Context, lastResults ListResult) (result ListResult, err error) { + req, err := lastResults.listResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ContainerServicesClient) ListComplete(ctx context.Context) (result ListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByResourceGroup gets a list of container services in the specified subscription and resource group. The +// operation returns properties of each container service including state, orchestrator, number of masters and agents, +// and FQDNs of masters and agents. +// Parameters: +// resourceGroupName - the name of the resource group. +func (client ContainerServicesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.lr.Response.Response != nil { + sc = result.lr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.lr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.lr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client ContainerServicesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerServicesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + 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 ContainerServicesClient) ListByResourceGroupResponder(resp *http.Response) (result ListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client ContainerServicesClient) listByResourceGroupNextResults(ctx context.Context, lastResults ListResult) (result ListResult, err error) { + req, err := lastResults.listResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client ContainerServicesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// ListOrchestrators gets a list of supported orchestrators in the specified subscription. The operation returns +// properties of each orchestrator including version, available upgrades and whether that version or upgrades are in +// preview. +// Parameters: +// location - the name of a supported Azure region. +// resourceType - resource type for which the list of orchestrators needs to be returned +func (client ContainerServicesClient) ListOrchestrators(ctx context.Context, location string, resourceType string) (result OrchestratorVersionProfileListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.ListOrchestrators") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListOrchestratorsPreparer(ctx, location, resourceType) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "ListOrchestrators", nil, "Failure preparing request") + return + } + + resp, err := client.ListOrchestratorsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "ListOrchestrators", resp, "Failure sending request") + return + } + + result, err = client.ListOrchestratorsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "ListOrchestrators", resp, "Failure responding to request") + } + + return +} + +// ListOrchestratorsPreparer prepares the ListOrchestrators request. +func (client ContainerServicesClient) ListOrchestratorsPreparer(ctx context.Context, location string, resourceType string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(resourceType) > 0 { + queryParameters["resource-type"] = autorest.Encode("query", resourceType) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/orchestrators", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListOrchestratorsSender sends the ListOrchestrators request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerServicesClient) ListOrchestratorsSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListOrchestratorsResponder handles the response to the ListOrchestrators request. The method always +// closes the http.Response Body. +func (client ContainerServicesClient) ListOrchestratorsResponder(resp *http.Response) (result OrchestratorVersionProfileListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/containerservice/mgmt/2019-09-30-preview/containerservice/managedclusters.go b/services/preview/containerservice/mgmt/2019-09-30-preview/containerservice/managedclusters.go new file mode 100644 index 000000000000..a58266d7e18a --- /dev/null +++ b/services/preview/containerservice/mgmt/2019-09-30-preview/containerservice/managedclusters.go @@ -0,0 +1,1287 @@ +package containerservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ManagedClustersClient is the the Container Service Client. +type ManagedClustersClient struct { + BaseClient +} + +// NewManagedClustersClient creates an instance of the ManagedClustersClient client. +func NewManagedClustersClient(subscriptionID string) ManagedClustersClient { + return NewManagedClustersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewManagedClustersClientWithBaseURI creates an instance of the ManagedClustersClient client. +func NewManagedClustersClientWithBaseURI(baseURI string, subscriptionID string) ManagedClustersClient { + return ManagedClustersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a managed cluster with the specified configuration for agents and Kubernetes +// version. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +// parameters - parameters supplied to the Create or Update a Managed Cluster operation. +func (client ManagedClustersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedCluster) (result ManagedClustersCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.ManagedClusterProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.LinuxProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.LinuxProfile.AdminUsername", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.LinuxProfile.AdminUsername", Name: validation.Pattern, Rule: `^[A-Za-z][-A-Za-z0-9_]*$`, Chain: nil}}}, + {Target: "parameters.ManagedClusterProperties.LinuxProfile.SSH", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.LinuxProfile.SSH.PublicKeys", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + {Target: "parameters.ManagedClusterProperties.WindowsProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.WindowsProfile.AdminUsername", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.WindowsProfile.AdminUsername", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([._]?[a-zA-Z0-9]+)*$`, Chain: nil}}}, + }}, + {Target: "parameters.ManagedClusterProperties.ServicePrincipalProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.ServicePrincipalProfile.ClientID", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.PodCidr", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.PodCidr", Name: validation.Pattern, Rule: `^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$`, Chain: nil}}}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.ServiceCidr", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.ServiceCidr", Name: validation.Pattern, Rule: `^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$`, Chain: nil}}}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.DNSServiceIP", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.DNSServiceIP", Name: validation.Pattern, Rule: `^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$`, Chain: nil}}}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.DockerBridgeCidr", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.DockerBridgeCidr", Name: validation.Pattern, Rule: `^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$`, Chain: nil}}}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile.ManagedOutboundIPs", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile.ManagedOutboundIPs.Count", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile.ManagedOutboundIPs.Count", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile.ManagedOutboundIPs.Count", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}, + }}, + }}, + }}, + {Target: "parameters.ManagedClusterProperties.AadProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.AadProfile.ClientAppID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ManagedClusterProperties.AadProfile.ServerAppID", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ManagedClustersClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedCluster) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) CreateOrUpdateSender(req *http.Request) (future ManagedClustersCreateOrUpdateFuture, err error) { + 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 ManagedClustersClient) CreateOrUpdateResponder(resp *http.Response) (result ManagedCluster, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the managed cluster with a specified resource group and name. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +func (client ManagedClustersClient) Delete(ctx context.Context, resourceGroupName string, resourceName string) (result ManagedClustersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ManagedClustersClient) DeletePreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-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.ContainerService/managedClusters/{resourceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) DeleteSender(req *http.Request) (future ManagedClustersDeleteFuture, err error) { + 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 ManagedClustersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of the managed cluster with a specified resource group and name. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +func (client ManagedClustersClient) Get(ctx context.Context, resourceGroupName string, resourceName string) (result ManagedCluster, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ManagedClustersClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "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.ContainerService/managedClusters/{resourceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) GetSender(req *http.Request) (*http.Response, error) { + 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 ManagedClustersClient) GetResponder(resp *http.Response) (result ManagedCluster, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetAccessProfile gets the accessProfile for the specified role name of the managed cluster with a specified resource +// group and name. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +// roleName - the name of the role for managed cluster accessProfile resource. +func (client ManagedClustersClient) GetAccessProfile(ctx context.Context, resourceGroupName string, resourceName string, roleName string) (result ManagedClusterAccessProfile, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.GetAccessProfile") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "GetAccessProfile", err.Error()) + } + + req, err := client.GetAccessProfilePreparer(ctx, resourceGroupName, resourceName, roleName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "GetAccessProfile", nil, "Failure preparing request") + return + } + + resp, err := client.GetAccessProfileSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "GetAccessProfile", resp, "Failure sending request") + return + } + + result, err = client.GetAccessProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "GetAccessProfile", resp, "Failure responding to request") + } + + return +} + +// GetAccessProfilePreparer prepares the GetAccessProfile request. +func (client ManagedClustersClient) GetAccessProfilePreparer(ctx context.Context, resourceGroupName string, resourceName string, roleName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "roleName": autorest.Encode("path", roleName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetAccessProfileSender sends the GetAccessProfile request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) GetAccessProfileSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetAccessProfileResponder handles the response to the GetAccessProfile request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) GetAccessProfileResponder(resp *http.Response) (result ManagedClusterAccessProfile, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetUpgradeProfile gets the details of the upgrade profile for a managed cluster with a specified resource group and +// name. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +func (client ManagedClustersClient) GetUpgradeProfile(ctx context.Context, resourceGroupName string, resourceName string) (result ManagedClusterUpgradeProfile, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.GetUpgradeProfile") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "GetUpgradeProfile", err.Error()) + } + + req, err := client.GetUpgradeProfilePreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "GetUpgradeProfile", nil, "Failure preparing request") + return + } + + resp, err := client.GetUpgradeProfileSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "GetUpgradeProfile", resp, "Failure sending request") + return + } + + result, err = client.GetUpgradeProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "GetUpgradeProfile", resp, "Failure responding to request") + } + + return +} + +// GetUpgradeProfilePreparer prepares the GetUpgradeProfile request. +func (client ManagedClustersClient) GetUpgradeProfilePreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "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.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetUpgradeProfileSender sends the GetUpgradeProfile request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) GetUpgradeProfileSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetUpgradeProfileResponder handles the response to the GetUpgradeProfile request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) GetUpgradeProfileResponder(resp *http.Response) (result ManagedClusterUpgradeProfile, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets a list of managed clusters in the specified subscription. The operation returns properties of each managed +// cluster. +func (client ManagedClustersClient) List(ctx context.Context) (result ManagedClusterListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.List") + defer func() { + sc := -1 + if result.mclr.Response.Response != nil { + sc = result.mclr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.mclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "List", resp, "Failure sending request") + return + } + + result.mclr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ManagedClustersClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) ListSender(req *http.Request) (*http.Response, error) { + 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 ManagedClustersClient) ListResponder(resp *http.Response) (result ManagedClusterListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ManagedClustersClient) listNextResults(ctx context.Context, lastResults ManagedClusterListResult) (result ManagedClusterListResult, err error) { + req, err := lastResults.managedClusterListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ManagedClustersClient) ListComplete(ctx context.Context) (result ManagedClusterListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByResourceGroup lists managed clusters in the specified subscription and resource group. The operation returns +// properties of each managed cluster. +// Parameters: +// resourceGroupName - the name of the resource group. +func (client ManagedClustersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ManagedClusterListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.mclr.Response.Response != nil { + sc = result.mclr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.mclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.mclr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client ManagedClustersClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "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.ContainerService/managedClusters", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + 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 ManagedClustersClient) ListByResourceGroupResponder(resp *http.Response) (result ManagedClusterListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client ManagedClustersClient) listByResourceGroupNextResults(ctx context.Context, lastResults ManagedClusterListResult) (result ManagedClusterListResult, err error) { + req, err := lastResults.managedClusterListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client ManagedClustersClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ManagedClusterListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// ListClusterAdminCredentials gets cluster admin credential of the managed cluster with a specified resource group and +// name. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +func (client ManagedClustersClient) ListClusterAdminCredentials(ctx context.Context, resourceGroupName string, resourceName string) (result CredentialResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.ListClusterAdminCredentials") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "ListClusterAdminCredentials", err.Error()) + } + + req, err := client.ListClusterAdminCredentialsPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListClusterAdminCredentials", nil, "Failure preparing request") + return + } + + resp, err := client.ListClusterAdminCredentialsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListClusterAdminCredentials", resp, "Failure sending request") + return + } + + result, err = client.ListClusterAdminCredentialsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListClusterAdminCredentials", resp, "Failure responding to request") + } + + return +} + +// ListClusterAdminCredentialsPreparer prepares the ListClusterAdminCredentials request. +func (client ManagedClustersClient) ListClusterAdminCredentialsPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListClusterAdminCredentialsSender sends the ListClusterAdminCredentials request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) ListClusterAdminCredentialsSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListClusterAdminCredentialsResponder handles the response to the ListClusterAdminCredentials request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) ListClusterAdminCredentialsResponder(resp *http.Response) (result CredentialResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListClusterUserCredentials gets cluster user credential of the managed cluster with a specified resource group and +// name. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +func (client ManagedClustersClient) ListClusterUserCredentials(ctx context.Context, resourceGroupName string, resourceName string) (result CredentialResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.ListClusterUserCredentials") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "ListClusterUserCredentials", err.Error()) + } + + req, err := client.ListClusterUserCredentialsPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListClusterUserCredentials", nil, "Failure preparing request") + return + } + + resp, err := client.ListClusterUserCredentialsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListClusterUserCredentials", resp, "Failure sending request") + return + } + + result, err = client.ListClusterUserCredentialsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListClusterUserCredentials", resp, "Failure responding to request") + } + + return +} + +// ListClusterUserCredentialsPreparer prepares the ListClusterUserCredentials request. +func (client ManagedClustersClient) ListClusterUserCredentialsPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListClusterUserCredentialsSender sends the ListClusterUserCredentials request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) ListClusterUserCredentialsSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListClusterUserCredentialsResponder handles the response to the ListClusterUserCredentials request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) ListClusterUserCredentialsResponder(resp *http.Response) (result CredentialResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ResetAADProfile update the AAD Profile for a managed cluster. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +// parameters - parameters supplied to the Reset AAD Profile operation for a Managed Cluster. +func (client ManagedClustersClient) ResetAADProfile(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedClusterAADProfile) (result ManagedClustersResetAADProfileFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.ResetAADProfile") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.ClientAppID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ServerAppID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "ResetAADProfile", err.Error()) + } + + req, err := client.ResetAADProfilePreparer(ctx, resourceGroupName, resourceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ResetAADProfile", nil, "Failure preparing request") + return + } + + result, err = client.ResetAADProfileSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ResetAADProfile", result.Response(), "Failure sending request") + return + } + + return +} + +// ResetAADProfilePreparer prepares the ResetAADProfile request. +func (client ManagedClustersClient) ResetAADProfilePreparer(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedClusterAADProfile) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResetAADProfileSender sends the ResetAADProfile request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) ResetAADProfileSender(req *http.Request) (future ManagedClustersResetAADProfileFuture, err error) { + 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 +} + +// ResetAADProfileResponder handles the response to the ResetAADProfile request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) ResetAADProfileResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// ResetServicePrincipalProfile update the service principal Profile for a managed cluster. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +// parameters - parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. +func (client ManagedClustersClient) ResetServicePrincipalProfile(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedClusterServicePrincipalProfile) (result ManagedClustersResetServicePrincipalProfileFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.ResetServicePrincipalProfile") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.ClientID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "ResetServicePrincipalProfile", err.Error()) + } + + req, err := client.ResetServicePrincipalProfilePreparer(ctx, resourceGroupName, resourceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ResetServicePrincipalProfile", nil, "Failure preparing request") + return + } + + result, err = client.ResetServicePrincipalProfileSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ResetServicePrincipalProfile", result.Response(), "Failure sending request") + return + } + + return +} + +// ResetServicePrincipalProfilePreparer prepares the ResetServicePrincipalProfile request. +func (client ManagedClustersClient) ResetServicePrincipalProfilePreparer(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedClusterServicePrincipalProfile) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResetServicePrincipalProfileSender sends the ResetServicePrincipalProfile request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) ResetServicePrincipalProfileSender(req *http.Request) (future ManagedClustersResetServicePrincipalProfileFuture, err error) { + 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 +} + +// ResetServicePrincipalProfileResponder handles the response to the ResetServicePrincipalProfile request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) ResetServicePrincipalProfileResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// RotateClusterCertificates rotate certificates of a managed cluster. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +func (client ManagedClustersClient) RotateClusterCertificates(ctx context.Context, resourceGroupName string, resourceName string) (result ManagedClustersRotateClusterCertificatesFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.RotateClusterCertificates") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "RotateClusterCertificates", err.Error()) + } + + req, err := client.RotateClusterCertificatesPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "RotateClusterCertificates", nil, "Failure preparing request") + return + } + + result, err = client.RotateClusterCertificatesSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "RotateClusterCertificates", result.Response(), "Failure sending request") + return + } + + return +} + +// RotateClusterCertificatesPreparer prepares the RotateClusterCertificates request. +func (client ManagedClustersClient) RotateClusterCertificatesPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RotateClusterCertificatesSender sends the RotateClusterCertificates request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) RotateClusterCertificatesSender(req *http.Request) (future ManagedClustersRotateClusterCertificatesFuture, err error) { + 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 +} + +// RotateClusterCertificatesResponder handles the response to the RotateClusterCertificates request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) RotateClusterCertificatesResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// UpdateTags updates a managed cluster with the specified tags. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +// parameters - parameters supplied to the Update Managed Cluster Tags operation. +func (client ManagedClustersClient) UpdateTags(ctx context.Context, resourceGroupName string, resourceName string, parameters TagsObject) (result ManagedClustersUpdateTagsFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.UpdateTags") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "UpdateTags", err.Error()) + } + + req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, resourceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "UpdateTags", nil, "Failure preparing request") + return + } + + result, err = client.UpdateTagsSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "UpdateTags", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateTagsPreparer prepares the UpdateTags request. +func (client ManagedClustersClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, resourceName string, parameters TagsObject) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateTagsSender sends the UpdateTags request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) UpdateTagsSender(req *http.Request) (future ManagedClustersUpdateTagsFuture, err error) { + 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 +} + +// UpdateTagsResponder handles the response to the UpdateTags request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) UpdateTagsResponder(resp *http.Response) (result ManagedCluster, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/containerservice/mgmt/2019-09-30-preview/containerservice/models.go b/services/preview/containerservice/mgmt/2019-09-30-preview/containerservice/models.go new file mode 100644 index 000000000000..6e005b696506 --- /dev/null +++ b/services/preview/containerservice/mgmt/2019-09-30-preview/containerservice/models.go @@ -0,0 +1,3330 @@ +package containerservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/containerservice/mgmt/2019-09-30-preview/containerservice" + +// AgentPoolType enumerates the values for agent pool type. +type AgentPoolType string + +const ( + // AvailabilitySet ... + AvailabilitySet AgentPoolType = "AvailabilitySet" + // VirtualMachineScaleSets ... + VirtualMachineScaleSets AgentPoolType = "VirtualMachineScaleSets" +) + +// PossibleAgentPoolTypeValues returns an array of possible values for the AgentPoolType const type. +func PossibleAgentPoolTypeValues() []AgentPoolType { + return []AgentPoolType{AvailabilitySet, VirtualMachineScaleSets} +} + +// Kind enumerates the values for kind. +type Kind string + +const ( + // KindAADIdentityProvider ... + KindAADIdentityProvider Kind = "AADIdentityProvider" + // KindOpenShiftManagedClusterBaseIdentityProvider ... + KindOpenShiftManagedClusterBaseIdentityProvider Kind = "OpenShiftManagedClusterBaseIdentityProvider" +) + +// PossibleKindValues returns an array of possible values for the Kind const type. +func PossibleKindValues() []Kind { + return []Kind{KindAADIdentityProvider, KindOpenShiftManagedClusterBaseIdentityProvider} +} + +// LoadBalancerSku enumerates the values for load balancer sku. +type LoadBalancerSku string + +const ( + // Basic ... + Basic LoadBalancerSku = "basic" + // Standard ... + Standard LoadBalancerSku = "standard" +) + +// PossibleLoadBalancerSkuValues returns an array of possible values for the LoadBalancerSku const type. +func PossibleLoadBalancerSkuValues() []LoadBalancerSku { + return []LoadBalancerSku{Basic, Standard} +} + +// NetworkPlugin enumerates the values for network plugin. +type NetworkPlugin string + +const ( + // Azure ... + Azure NetworkPlugin = "azure" + // Kubenet ... + Kubenet NetworkPlugin = "kubenet" +) + +// PossibleNetworkPluginValues returns an array of possible values for the NetworkPlugin const type. +func PossibleNetworkPluginValues() []NetworkPlugin { + return []NetworkPlugin{Azure, Kubenet} +} + +// NetworkPolicy enumerates the values for network policy. +type NetworkPolicy string + +const ( + // NetworkPolicyAzure ... + NetworkPolicyAzure NetworkPolicy = "azure" + // NetworkPolicyCalico ... + NetworkPolicyCalico NetworkPolicy = "calico" +) + +// PossibleNetworkPolicyValues returns an array of possible values for the NetworkPolicy const type. +func PossibleNetworkPolicyValues() []NetworkPolicy { + return []NetworkPolicy{NetworkPolicyAzure, NetworkPolicyCalico} +} + +// OpenShiftAgentPoolProfileRole enumerates the values for open shift agent pool profile role. +type OpenShiftAgentPoolProfileRole string + +const ( + // Compute ... + Compute OpenShiftAgentPoolProfileRole = "compute" + // Infra ... + Infra OpenShiftAgentPoolProfileRole = "infra" +) + +// PossibleOpenShiftAgentPoolProfileRoleValues returns an array of possible values for the OpenShiftAgentPoolProfileRole const type. +func PossibleOpenShiftAgentPoolProfileRoleValues() []OpenShiftAgentPoolProfileRole { + return []OpenShiftAgentPoolProfileRole{Compute, Infra} +} + +// OpenShiftContainerServiceVMSize enumerates the values for open shift container service vm size. +type OpenShiftContainerServiceVMSize string + +const ( + // StandardD16sV3 ... + StandardD16sV3 OpenShiftContainerServiceVMSize = "Standard_D16s_v3" + // StandardD2sV3 ... + StandardD2sV3 OpenShiftContainerServiceVMSize = "Standard_D2s_v3" + // StandardD32sV3 ... + StandardD32sV3 OpenShiftContainerServiceVMSize = "Standard_D32s_v3" + // StandardD4sV3 ... + StandardD4sV3 OpenShiftContainerServiceVMSize = "Standard_D4s_v3" + // StandardD64sV3 ... + StandardD64sV3 OpenShiftContainerServiceVMSize = "Standard_D64s_v3" + // StandardD8sV3 ... + StandardD8sV3 OpenShiftContainerServiceVMSize = "Standard_D8s_v3" + // StandardDS12V2 ... + StandardDS12V2 OpenShiftContainerServiceVMSize = "Standard_DS12_v2" + // StandardDS13V2 ... + StandardDS13V2 OpenShiftContainerServiceVMSize = "Standard_DS13_v2" + // StandardDS14V2 ... + StandardDS14V2 OpenShiftContainerServiceVMSize = "Standard_DS14_v2" + // StandardDS15V2 ... + StandardDS15V2 OpenShiftContainerServiceVMSize = "Standard_DS15_v2" + // StandardDS4V2 ... + StandardDS4V2 OpenShiftContainerServiceVMSize = "Standard_DS4_v2" + // StandardDS5V2 ... + StandardDS5V2 OpenShiftContainerServiceVMSize = "Standard_DS5_v2" + // StandardE16sV3 ... + StandardE16sV3 OpenShiftContainerServiceVMSize = "Standard_E16s_v3" + // StandardE20sV3 ... + StandardE20sV3 OpenShiftContainerServiceVMSize = "Standard_E20s_v3" + // StandardE32sV3 ... + StandardE32sV3 OpenShiftContainerServiceVMSize = "Standard_E32s_v3" + // StandardE4sV3 ... + StandardE4sV3 OpenShiftContainerServiceVMSize = "Standard_E4s_v3" + // StandardE64sV3 ... + StandardE64sV3 OpenShiftContainerServiceVMSize = "Standard_E64s_v3" + // StandardE8sV3 ... + StandardE8sV3 OpenShiftContainerServiceVMSize = "Standard_E8s_v3" + // StandardF16s ... + StandardF16s OpenShiftContainerServiceVMSize = "Standard_F16s" + // StandardF16sV2 ... + StandardF16sV2 OpenShiftContainerServiceVMSize = "Standard_F16s_v2" + // StandardF32sV2 ... + StandardF32sV2 OpenShiftContainerServiceVMSize = "Standard_F32s_v2" + // StandardF64sV2 ... + StandardF64sV2 OpenShiftContainerServiceVMSize = "Standard_F64s_v2" + // StandardF72sV2 ... + StandardF72sV2 OpenShiftContainerServiceVMSize = "Standard_F72s_v2" + // StandardF8s ... + StandardF8s OpenShiftContainerServiceVMSize = "Standard_F8s" + // StandardF8sV2 ... + StandardF8sV2 OpenShiftContainerServiceVMSize = "Standard_F8s_v2" + // StandardGS2 ... + StandardGS2 OpenShiftContainerServiceVMSize = "Standard_GS2" + // StandardGS3 ... + StandardGS3 OpenShiftContainerServiceVMSize = "Standard_GS3" + // StandardGS4 ... + StandardGS4 OpenShiftContainerServiceVMSize = "Standard_GS4" + // StandardGS5 ... + StandardGS5 OpenShiftContainerServiceVMSize = "Standard_GS5" + // StandardL16s ... + StandardL16s OpenShiftContainerServiceVMSize = "Standard_L16s" + // StandardL32s ... + StandardL32s OpenShiftContainerServiceVMSize = "Standard_L32s" + // StandardL4s ... + StandardL4s OpenShiftContainerServiceVMSize = "Standard_L4s" + // StandardL8s ... + StandardL8s OpenShiftContainerServiceVMSize = "Standard_L8s" +) + +// PossibleOpenShiftContainerServiceVMSizeValues returns an array of possible values for the OpenShiftContainerServiceVMSize const type. +func PossibleOpenShiftContainerServiceVMSizeValues() []OpenShiftContainerServiceVMSize { + return []OpenShiftContainerServiceVMSize{StandardD16sV3, StandardD2sV3, StandardD32sV3, StandardD4sV3, StandardD64sV3, StandardD8sV3, StandardDS12V2, StandardDS13V2, StandardDS14V2, StandardDS15V2, StandardDS4V2, StandardDS5V2, StandardE16sV3, StandardE20sV3, StandardE32sV3, StandardE4sV3, StandardE64sV3, StandardE8sV3, StandardF16s, StandardF16sV2, StandardF32sV2, StandardF64sV2, StandardF72sV2, StandardF8s, StandardF8sV2, StandardGS2, StandardGS3, StandardGS4, StandardGS5, StandardL16s, StandardL32s, StandardL4s, StandardL8s} +} + +// OrchestratorTypes enumerates the values for orchestrator types. +type OrchestratorTypes string + +const ( + // Custom ... + Custom OrchestratorTypes = "Custom" + // DCOS ... + DCOS OrchestratorTypes = "DCOS" + // DockerCE ... + DockerCE OrchestratorTypes = "DockerCE" + // Kubernetes ... + Kubernetes OrchestratorTypes = "Kubernetes" + // Swarm ... + Swarm OrchestratorTypes = "Swarm" +) + +// PossibleOrchestratorTypesValues returns an array of possible values for the OrchestratorTypes const type. +func PossibleOrchestratorTypesValues() []OrchestratorTypes { + return []OrchestratorTypes{Custom, DCOS, DockerCE, Kubernetes, Swarm} +} + +// OSType enumerates the values for os type. +type OSType string + +const ( + // Linux ... + Linux OSType = "Linux" + // Windows ... + Windows OSType = "Windows" +) + +// PossibleOSTypeValues returns an array of possible values for the OSType const type. +func PossibleOSTypeValues() []OSType { + return []OSType{Linux, Windows} +} + +// ResourceIdentityType enumerates the values for resource identity type. +type ResourceIdentityType string + +const ( + // None ... + None ResourceIdentityType = "None" + // SystemAssigned ... + SystemAssigned ResourceIdentityType = "SystemAssigned" +) + +// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. +func PossibleResourceIdentityTypeValues() []ResourceIdentityType { + return []ResourceIdentityType{None, SystemAssigned} +} + +// ScaleSetEvictionPolicy enumerates the values for scale set eviction policy. +type ScaleSetEvictionPolicy string + +const ( + // Deallocate ... + Deallocate ScaleSetEvictionPolicy = "Deallocate" + // Delete ... + Delete ScaleSetEvictionPolicy = "Delete" +) + +// PossibleScaleSetEvictionPolicyValues returns an array of possible values for the ScaleSetEvictionPolicy const type. +func PossibleScaleSetEvictionPolicyValues() []ScaleSetEvictionPolicy { + return []ScaleSetEvictionPolicy{Deallocate, Delete} +} + +// ScaleSetPriority enumerates the values for scale set priority. +type ScaleSetPriority string + +const ( + // Low ... + Low ScaleSetPriority = "Low" + // Regular ... + Regular ScaleSetPriority = "Regular" +) + +// PossibleScaleSetPriorityValues returns an array of possible values for the ScaleSetPriority const type. +func PossibleScaleSetPriorityValues() []ScaleSetPriority { + return []ScaleSetPriority{Low, Regular} +} + +// StorageProfileTypes enumerates the values for storage profile types. +type StorageProfileTypes string + +const ( + // ManagedDisks ... + ManagedDisks StorageProfileTypes = "ManagedDisks" + // StorageAccount ... + StorageAccount StorageProfileTypes = "StorageAccount" +) + +// PossibleStorageProfileTypesValues returns an array of possible values for the StorageProfileTypes const type. +func PossibleStorageProfileTypesValues() []StorageProfileTypes { + return []StorageProfileTypes{ManagedDisks, StorageAccount} +} + +// VMSizeTypes enumerates the values for vm size types. +type VMSizeTypes string + +const ( + // VMSizeTypesStandardA1 ... + VMSizeTypesStandardA1 VMSizeTypes = "Standard_A1" + // VMSizeTypesStandardA10 ... + VMSizeTypesStandardA10 VMSizeTypes = "Standard_A10" + // VMSizeTypesStandardA11 ... + VMSizeTypesStandardA11 VMSizeTypes = "Standard_A11" + // VMSizeTypesStandardA1V2 ... + VMSizeTypesStandardA1V2 VMSizeTypes = "Standard_A1_v2" + // VMSizeTypesStandardA2 ... + VMSizeTypesStandardA2 VMSizeTypes = "Standard_A2" + // VMSizeTypesStandardA2mV2 ... + VMSizeTypesStandardA2mV2 VMSizeTypes = "Standard_A2m_v2" + // VMSizeTypesStandardA2V2 ... + VMSizeTypesStandardA2V2 VMSizeTypes = "Standard_A2_v2" + // VMSizeTypesStandardA3 ... + VMSizeTypesStandardA3 VMSizeTypes = "Standard_A3" + // VMSizeTypesStandardA4 ... + VMSizeTypesStandardA4 VMSizeTypes = "Standard_A4" + // VMSizeTypesStandardA4mV2 ... + VMSizeTypesStandardA4mV2 VMSizeTypes = "Standard_A4m_v2" + // VMSizeTypesStandardA4V2 ... + VMSizeTypesStandardA4V2 VMSizeTypes = "Standard_A4_v2" + // VMSizeTypesStandardA5 ... + VMSizeTypesStandardA5 VMSizeTypes = "Standard_A5" + // VMSizeTypesStandardA6 ... + VMSizeTypesStandardA6 VMSizeTypes = "Standard_A6" + // VMSizeTypesStandardA7 ... + VMSizeTypesStandardA7 VMSizeTypes = "Standard_A7" + // VMSizeTypesStandardA8 ... + VMSizeTypesStandardA8 VMSizeTypes = "Standard_A8" + // VMSizeTypesStandardA8mV2 ... + VMSizeTypesStandardA8mV2 VMSizeTypes = "Standard_A8m_v2" + // VMSizeTypesStandardA8V2 ... + VMSizeTypesStandardA8V2 VMSizeTypes = "Standard_A8_v2" + // VMSizeTypesStandardA9 ... + VMSizeTypesStandardA9 VMSizeTypes = "Standard_A9" + // VMSizeTypesStandardB2ms ... + VMSizeTypesStandardB2ms VMSizeTypes = "Standard_B2ms" + // VMSizeTypesStandardB2s ... + VMSizeTypesStandardB2s VMSizeTypes = "Standard_B2s" + // VMSizeTypesStandardB4ms ... + VMSizeTypesStandardB4ms VMSizeTypes = "Standard_B4ms" + // VMSizeTypesStandardB8ms ... + VMSizeTypesStandardB8ms VMSizeTypes = "Standard_B8ms" + // VMSizeTypesStandardD1 ... + VMSizeTypesStandardD1 VMSizeTypes = "Standard_D1" + // VMSizeTypesStandardD11 ... + VMSizeTypesStandardD11 VMSizeTypes = "Standard_D11" + // VMSizeTypesStandardD11V2 ... + VMSizeTypesStandardD11V2 VMSizeTypes = "Standard_D11_v2" + // VMSizeTypesStandardD11V2Promo ... + VMSizeTypesStandardD11V2Promo VMSizeTypes = "Standard_D11_v2_Promo" + // VMSizeTypesStandardD12 ... + VMSizeTypesStandardD12 VMSizeTypes = "Standard_D12" + // VMSizeTypesStandardD12V2 ... + VMSizeTypesStandardD12V2 VMSizeTypes = "Standard_D12_v2" + // VMSizeTypesStandardD12V2Promo ... + VMSizeTypesStandardD12V2Promo VMSizeTypes = "Standard_D12_v2_Promo" + // VMSizeTypesStandardD13 ... + VMSizeTypesStandardD13 VMSizeTypes = "Standard_D13" + // VMSizeTypesStandardD13V2 ... + VMSizeTypesStandardD13V2 VMSizeTypes = "Standard_D13_v2" + // VMSizeTypesStandardD13V2Promo ... + VMSizeTypesStandardD13V2Promo VMSizeTypes = "Standard_D13_v2_Promo" + // VMSizeTypesStandardD14 ... + VMSizeTypesStandardD14 VMSizeTypes = "Standard_D14" + // VMSizeTypesStandardD14V2 ... + VMSizeTypesStandardD14V2 VMSizeTypes = "Standard_D14_v2" + // VMSizeTypesStandardD14V2Promo ... + VMSizeTypesStandardD14V2Promo VMSizeTypes = "Standard_D14_v2_Promo" + // VMSizeTypesStandardD15V2 ... + VMSizeTypesStandardD15V2 VMSizeTypes = "Standard_D15_v2" + // VMSizeTypesStandardD16sV3 ... + VMSizeTypesStandardD16sV3 VMSizeTypes = "Standard_D16s_v3" + // VMSizeTypesStandardD16V3 ... + VMSizeTypesStandardD16V3 VMSizeTypes = "Standard_D16_v3" + // VMSizeTypesStandardD1V2 ... + VMSizeTypesStandardD1V2 VMSizeTypes = "Standard_D1_v2" + // VMSizeTypesStandardD2 ... + VMSizeTypesStandardD2 VMSizeTypes = "Standard_D2" + // VMSizeTypesStandardD2sV3 ... + VMSizeTypesStandardD2sV3 VMSizeTypes = "Standard_D2s_v3" + // VMSizeTypesStandardD2V2 ... + VMSizeTypesStandardD2V2 VMSizeTypes = "Standard_D2_v2" + // VMSizeTypesStandardD2V2Promo ... + VMSizeTypesStandardD2V2Promo VMSizeTypes = "Standard_D2_v2_Promo" + // VMSizeTypesStandardD2V3 ... + VMSizeTypesStandardD2V3 VMSizeTypes = "Standard_D2_v3" + // VMSizeTypesStandardD3 ... + VMSizeTypesStandardD3 VMSizeTypes = "Standard_D3" + // VMSizeTypesStandardD32sV3 ... + VMSizeTypesStandardD32sV3 VMSizeTypes = "Standard_D32s_v3" + // VMSizeTypesStandardD32V3 ... + VMSizeTypesStandardD32V3 VMSizeTypes = "Standard_D32_v3" + // VMSizeTypesStandardD3V2 ... + VMSizeTypesStandardD3V2 VMSizeTypes = "Standard_D3_v2" + // VMSizeTypesStandardD3V2Promo ... + VMSizeTypesStandardD3V2Promo VMSizeTypes = "Standard_D3_v2_Promo" + // VMSizeTypesStandardD4 ... + VMSizeTypesStandardD4 VMSizeTypes = "Standard_D4" + // VMSizeTypesStandardD4sV3 ... + VMSizeTypesStandardD4sV3 VMSizeTypes = "Standard_D4s_v3" + // VMSizeTypesStandardD4V2 ... + VMSizeTypesStandardD4V2 VMSizeTypes = "Standard_D4_v2" + // VMSizeTypesStandardD4V2Promo ... + VMSizeTypesStandardD4V2Promo VMSizeTypes = "Standard_D4_v2_Promo" + // VMSizeTypesStandardD4V3 ... + VMSizeTypesStandardD4V3 VMSizeTypes = "Standard_D4_v3" + // VMSizeTypesStandardD5V2 ... + VMSizeTypesStandardD5V2 VMSizeTypes = "Standard_D5_v2" + // VMSizeTypesStandardD5V2Promo ... + VMSizeTypesStandardD5V2Promo VMSizeTypes = "Standard_D5_v2_Promo" + // VMSizeTypesStandardD64sV3 ... + VMSizeTypesStandardD64sV3 VMSizeTypes = "Standard_D64s_v3" + // VMSizeTypesStandardD64V3 ... + VMSizeTypesStandardD64V3 VMSizeTypes = "Standard_D64_v3" + // VMSizeTypesStandardD8sV3 ... + VMSizeTypesStandardD8sV3 VMSizeTypes = "Standard_D8s_v3" + // VMSizeTypesStandardD8V3 ... + VMSizeTypesStandardD8V3 VMSizeTypes = "Standard_D8_v3" + // VMSizeTypesStandardDS1 ... + VMSizeTypesStandardDS1 VMSizeTypes = "Standard_DS1" + // VMSizeTypesStandardDS11 ... + VMSizeTypesStandardDS11 VMSizeTypes = "Standard_DS11" + // VMSizeTypesStandardDS11V2 ... + VMSizeTypesStandardDS11V2 VMSizeTypes = "Standard_DS11_v2" + // VMSizeTypesStandardDS11V2Promo ... + VMSizeTypesStandardDS11V2Promo VMSizeTypes = "Standard_DS11_v2_Promo" + // VMSizeTypesStandardDS12 ... + VMSizeTypesStandardDS12 VMSizeTypes = "Standard_DS12" + // VMSizeTypesStandardDS12V2 ... + VMSizeTypesStandardDS12V2 VMSizeTypes = "Standard_DS12_v2" + // VMSizeTypesStandardDS12V2Promo ... + VMSizeTypesStandardDS12V2Promo VMSizeTypes = "Standard_DS12_v2_Promo" + // VMSizeTypesStandardDS13 ... + VMSizeTypesStandardDS13 VMSizeTypes = "Standard_DS13" + // VMSizeTypesStandardDS132V2 ... + VMSizeTypesStandardDS132V2 VMSizeTypes = "Standard_DS13-2_v2" + // VMSizeTypesStandardDS134V2 ... + VMSizeTypesStandardDS134V2 VMSizeTypes = "Standard_DS13-4_v2" + // VMSizeTypesStandardDS13V2 ... + VMSizeTypesStandardDS13V2 VMSizeTypes = "Standard_DS13_v2" + // VMSizeTypesStandardDS13V2Promo ... + VMSizeTypesStandardDS13V2Promo VMSizeTypes = "Standard_DS13_v2_Promo" + // VMSizeTypesStandardDS14 ... + VMSizeTypesStandardDS14 VMSizeTypes = "Standard_DS14" + // VMSizeTypesStandardDS144V2 ... + VMSizeTypesStandardDS144V2 VMSizeTypes = "Standard_DS14-4_v2" + // VMSizeTypesStandardDS148V2 ... + VMSizeTypesStandardDS148V2 VMSizeTypes = "Standard_DS14-8_v2" + // VMSizeTypesStandardDS14V2 ... + VMSizeTypesStandardDS14V2 VMSizeTypes = "Standard_DS14_v2" + // VMSizeTypesStandardDS14V2Promo ... + VMSizeTypesStandardDS14V2Promo VMSizeTypes = "Standard_DS14_v2_Promo" + // VMSizeTypesStandardDS15V2 ... + VMSizeTypesStandardDS15V2 VMSizeTypes = "Standard_DS15_v2" + // VMSizeTypesStandardDS1V2 ... + VMSizeTypesStandardDS1V2 VMSizeTypes = "Standard_DS1_v2" + // VMSizeTypesStandardDS2 ... + VMSizeTypesStandardDS2 VMSizeTypes = "Standard_DS2" + // VMSizeTypesStandardDS2V2 ... + VMSizeTypesStandardDS2V2 VMSizeTypes = "Standard_DS2_v2" + // VMSizeTypesStandardDS2V2Promo ... + VMSizeTypesStandardDS2V2Promo VMSizeTypes = "Standard_DS2_v2_Promo" + // VMSizeTypesStandardDS3 ... + VMSizeTypesStandardDS3 VMSizeTypes = "Standard_DS3" + // VMSizeTypesStandardDS3V2 ... + VMSizeTypesStandardDS3V2 VMSizeTypes = "Standard_DS3_v2" + // VMSizeTypesStandardDS3V2Promo ... + VMSizeTypesStandardDS3V2Promo VMSizeTypes = "Standard_DS3_v2_Promo" + // VMSizeTypesStandardDS4 ... + VMSizeTypesStandardDS4 VMSizeTypes = "Standard_DS4" + // VMSizeTypesStandardDS4V2 ... + VMSizeTypesStandardDS4V2 VMSizeTypes = "Standard_DS4_v2" + // VMSizeTypesStandardDS4V2Promo ... + VMSizeTypesStandardDS4V2Promo VMSizeTypes = "Standard_DS4_v2_Promo" + // VMSizeTypesStandardDS5V2 ... + VMSizeTypesStandardDS5V2 VMSizeTypes = "Standard_DS5_v2" + // VMSizeTypesStandardDS5V2Promo ... + VMSizeTypesStandardDS5V2Promo VMSizeTypes = "Standard_DS5_v2_Promo" + // VMSizeTypesStandardE16sV3 ... + VMSizeTypesStandardE16sV3 VMSizeTypes = "Standard_E16s_v3" + // VMSizeTypesStandardE16V3 ... + VMSizeTypesStandardE16V3 VMSizeTypes = "Standard_E16_v3" + // VMSizeTypesStandardE2sV3 ... + VMSizeTypesStandardE2sV3 VMSizeTypes = "Standard_E2s_v3" + // VMSizeTypesStandardE2V3 ... + VMSizeTypesStandardE2V3 VMSizeTypes = "Standard_E2_v3" + // VMSizeTypesStandardE3216sV3 ... + VMSizeTypesStandardE3216sV3 VMSizeTypes = "Standard_E32-16s_v3" + // VMSizeTypesStandardE328sV3 ... + VMSizeTypesStandardE328sV3 VMSizeTypes = "Standard_E32-8s_v3" + // VMSizeTypesStandardE32sV3 ... + VMSizeTypesStandardE32sV3 VMSizeTypes = "Standard_E32s_v3" + // VMSizeTypesStandardE32V3 ... + VMSizeTypesStandardE32V3 VMSizeTypes = "Standard_E32_v3" + // VMSizeTypesStandardE4sV3 ... + VMSizeTypesStandardE4sV3 VMSizeTypes = "Standard_E4s_v3" + // VMSizeTypesStandardE4V3 ... + VMSizeTypesStandardE4V3 VMSizeTypes = "Standard_E4_v3" + // VMSizeTypesStandardE6416sV3 ... + VMSizeTypesStandardE6416sV3 VMSizeTypes = "Standard_E64-16s_v3" + // VMSizeTypesStandardE6432sV3 ... + VMSizeTypesStandardE6432sV3 VMSizeTypes = "Standard_E64-32s_v3" + // VMSizeTypesStandardE64sV3 ... + VMSizeTypesStandardE64sV3 VMSizeTypes = "Standard_E64s_v3" + // VMSizeTypesStandardE64V3 ... + VMSizeTypesStandardE64V3 VMSizeTypes = "Standard_E64_v3" + // VMSizeTypesStandardE8sV3 ... + VMSizeTypesStandardE8sV3 VMSizeTypes = "Standard_E8s_v3" + // VMSizeTypesStandardE8V3 ... + VMSizeTypesStandardE8V3 VMSizeTypes = "Standard_E8_v3" + // VMSizeTypesStandardF1 ... + VMSizeTypesStandardF1 VMSizeTypes = "Standard_F1" + // VMSizeTypesStandardF16 ... + VMSizeTypesStandardF16 VMSizeTypes = "Standard_F16" + // VMSizeTypesStandardF16s ... + VMSizeTypesStandardF16s VMSizeTypes = "Standard_F16s" + // VMSizeTypesStandardF16sV2 ... + VMSizeTypesStandardF16sV2 VMSizeTypes = "Standard_F16s_v2" + // VMSizeTypesStandardF1s ... + VMSizeTypesStandardF1s VMSizeTypes = "Standard_F1s" + // VMSizeTypesStandardF2 ... + VMSizeTypesStandardF2 VMSizeTypes = "Standard_F2" + // VMSizeTypesStandardF2s ... + VMSizeTypesStandardF2s VMSizeTypes = "Standard_F2s" + // VMSizeTypesStandardF2sV2 ... + VMSizeTypesStandardF2sV2 VMSizeTypes = "Standard_F2s_v2" + // VMSizeTypesStandardF32sV2 ... + VMSizeTypesStandardF32sV2 VMSizeTypes = "Standard_F32s_v2" + // VMSizeTypesStandardF4 ... + VMSizeTypesStandardF4 VMSizeTypes = "Standard_F4" + // VMSizeTypesStandardF4s ... + VMSizeTypesStandardF4s VMSizeTypes = "Standard_F4s" + // VMSizeTypesStandardF4sV2 ... + VMSizeTypesStandardF4sV2 VMSizeTypes = "Standard_F4s_v2" + // VMSizeTypesStandardF64sV2 ... + VMSizeTypesStandardF64sV2 VMSizeTypes = "Standard_F64s_v2" + // VMSizeTypesStandardF72sV2 ... + VMSizeTypesStandardF72sV2 VMSizeTypes = "Standard_F72s_v2" + // VMSizeTypesStandardF8 ... + VMSizeTypesStandardF8 VMSizeTypes = "Standard_F8" + // VMSizeTypesStandardF8s ... + VMSizeTypesStandardF8s VMSizeTypes = "Standard_F8s" + // VMSizeTypesStandardF8sV2 ... + VMSizeTypesStandardF8sV2 VMSizeTypes = "Standard_F8s_v2" + // VMSizeTypesStandardG1 ... + VMSizeTypesStandardG1 VMSizeTypes = "Standard_G1" + // VMSizeTypesStandardG2 ... + VMSizeTypesStandardG2 VMSizeTypes = "Standard_G2" + // VMSizeTypesStandardG3 ... + VMSizeTypesStandardG3 VMSizeTypes = "Standard_G3" + // VMSizeTypesStandardG4 ... + VMSizeTypesStandardG4 VMSizeTypes = "Standard_G4" + // VMSizeTypesStandardG5 ... + VMSizeTypesStandardG5 VMSizeTypes = "Standard_G5" + // VMSizeTypesStandardGS1 ... + VMSizeTypesStandardGS1 VMSizeTypes = "Standard_GS1" + // VMSizeTypesStandardGS2 ... + VMSizeTypesStandardGS2 VMSizeTypes = "Standard_GS2" + // VMSizeTypesStandardGS3 ... + VMSizeTypesStandardGS3 VMSizeTypes = "Standard_GS3" + // VMSizeTypesStandardGS4 ... + VMSizeTypesStandardGS4 VMSizeTypes = "Standard_GS4" + // VMSizeTypesStandardGS44 ... + VMSizeTypesStandardGS44 VMSizeTypes = "Standard_GS4-4" + // VMSizeTypesStandardGS48 ... + VMSizeTypesStandardGS48 VMSizeTypes = "Standard_GS4-8" + // VMSizeTypesStandardGS5 ... + VMSizeTypesStandardGS5 VMSizeTypes = "Standard_GS5" + // VMSizeTypesStandardGS516 ... + VMSizeTypesStandardGS516 VMSizeTypes = "Standard_GS5-16" + // VMSizeTypesStandardGS58 ... + VMSizeTypesStandardGS58 VMSizeTypes = "Standard_GS5-8" + // VMSizeTypesStandardH16 ... + VMSizeTypesStandardH16 VMSizeTypes = "Standard_H16" + // VMSizeTypesStandardH16m ... + VMSizeTypesStandardH16m VMSizeTypes = "Standard_H16m" + // VMSizeTypesStandardH16mr ... + VMSizeTypesStandardH16mr VMSizeTypes = "Standard_H16mr" + // VMSizeTypesStandardH16r ... + VMSizeTypesStandardH16r VMSizeTypes = "Standard_H16r" + // VMSizeTypesStandardH8 ... + VMSizeTypesStandardH8 VMSizeTypes = "Standard_H8" + // VMSizeTypesStandardH8m ... + VMSizeTypesStandardH8m VMSizeTypes = "Standard_H8m" + // VMSizeTypesStandardL16s ... + VMSizeTypesStandardL16s VMSizeTypes = "Standard_L16s" + // VMSizeTypesStandardL32s ... + VMSizeTypesStandardL32s VMSizeTypes = "Standard_L32s" + // VMSizeTypesStandardL4s ... + VMSizeTypesStandardL4s VMSizeTypes = "Standard_L4s" + // VMSizeTypesStandardL8s ... + VMSizeTypesStandardL8s VMSizeTypes = "Standard_L8s" + // VMSizeTypesStandardM12832ms ... + VMSizeTypesStandardM12832ms VMSizeTypes = "Standard_M128-32ms" + // VMSizeTypesStandardM12864ms ... + VMSizeTypesStandardM12864ms VMSizeTypes = "Standard_M128-64ms" + // VMSizeTypesStandardM128ms ... + VMSizeTypesStandardM128ms VMSizeTypes = "Standard_M128ms" + // VMSizeTypesStandardM128s ... + VMSizeTypesStandardM128s VMSizeTypes = "Standard_M128s" + // VMSizeTypesStandardM6416ms ... + VMSizeTypesStandardM6416ms VMSizeTypes = "Standard_M64-16ms" + // VMSizeTypesStandardM6432ms ... + VMSizeTypesStandardM6432ms VMSizeTypes = "Standard_M64-32ms" + // VMSizeTypesStandardM64ms ... + VMSizeTypesStandardM64ms VMSizeTypes = "Standard_M64ms" + // VMSizeTypesStandardM64s ... + VMSizeTypesStandardM64s VMSizeTypes = "Standard_M64s" + // VMSizeTypesStandardNC12 ... + VMSizeTypesStandardNC12 VMSizeTypes = "Standard_NC12" + // VMSizeTypesStandardNC12sV2 ... + VMSizeTypesStandardNC12sV2 VMSizeTypes = "Standard_NC12s_v2" + // VMSizeTypesStandardNC12sV3 ... + VMSizeTypesStandardNC12sV3 VMSizeTypes = "Standard_NC12s_v3" + // VMSizeTypesStandardNC24 ... + VMSizeTypesStandardNC24 VMSizeTypes = "Standard_NC24" + // VMSizeTypesStandardNC24r ... + VMSizeTypesStandardNC24r VMSizeTypes = "Standard_NC24r" + // VMSizeTypesStandardNC24rsV2 ... + VMSizeTypesStandardNC24rsV2 VMSizeTypes = "Standard_NC24rs_v2" + // VMSizeTypesStandardNC24rsV3 ... + VMSizeTypesStandardNC24rsV3 VMSizeTypes = "Standard_NC24rs_v3" + // VMSizeTypesStandardNC24sV2 ... + VMSizeTypesStandardNC24sV2 VMSizeTypes = "Standard_NC24s_v2" + // VMSizeTypesStandardNC24sV3 ... + VMSizeTypesStandardNC24sV3 VMSizeTypes = "Standard_NC24s_v3" + // VMSizeTypesStandardNC6 ... + VMSizeTypesStandardNC6 VMSizeTypes = "Standard_NC6" + // VMSizeTypesStandardNC6sV2 ... + VMSizeTypesStandardNC6sV2 VMSizeTypes = "Standard_NC6s_v2" + // VMSizeTypesStandardNC6sV3 ... + VMSizeTypesStandardNC6sV3 VMSizeTypes = "Standard_NC6s_v3" + // VMSizeTypesStandardND12s ... + VMSizeTypesStandardND12s VMSizeTypes = "Standard_ND12s" + // VMSizeTypesStandardND24rs ... + VMSizeTypesStandardND24rs VMSizeTypes = "Standard_ND24rs" + // VMSizeTypesStandardND24s ... + VMSizeTypesStandardND24s VMSizeTypes = "Standard_ND24s" + // VMSizeTypesStandardND6s ... + VMSizeTypesStandardND6s VMSizeTypes = "Standard_ND6s" + // VMSizeTypesStandardNV12 ... + VMSizeTypesStandardNV12 VMSizeTypes = "Standard_NV12" + // VMSizeTypesStandardNV24 ... + VMSizeTypesStandardNV24 VMSizeTypes = "Standard_NV24" + // VMSizeTypesStandardNV6 ... + VMSizeTypesStandardNV6 VMSizeTypes = "Standard_NV6" +) + +// PossibleVMSizeTypesValues returns an array of possible values for the VMSizeTypes const type. +func PossibleVMSizeTypesValues() []VMSizeTypes { + return []VMSizeTypes{VMSizeTypesStandardA1, VMSizeTypesStandardA10, VMSizeTypesStandardA11, VMSizeTypesStandardA1V2, VMSizeTypesStandardA2, VMSizeTypesStandardA2mV2, VMSizeTypesStandardA2V2, VMSizeTypesStandardA3, VMSizeTypesStandardA4, VMSizeTypesStandardA4mV2, VMSizeTypesStandardA4V2, VMSizeTypesStandardA5, VMSizeTypesStandardA6, VMSizeTypesStandardA7, VMSizeTypesStandardA8, VMSizeTypesStandardA8mV2, VMSizeTypesStandardA8V2, VMSizeTypesStandardA9, VMSizeTypesStandardB2ms, VMSizeTypesStandardB2s, VMSizeTypesStandardB4ms, VMSizeTypesStandardB8ms, VMSizeTypesStandardD1, VMSizeTypesStandardD11, VMSizeTypesStandardD11V2, VMSizeTypesStandardD11V2Promo, VMSizeTypesStandardD12, VMSizeTypesStandardD12V2, VMSizeTypesStandardD12V2Promo, VMSizeTypesStandardD13, VMSizeTypesStandardD13V2, VMSizeTypesStandardD13V2Promo, VMSizeTypesStandardD14, VMSizeTypesStandardD14V2, VMSizeTypesStandardD14V2Promo, VMSizeTypesStandardD15V2, VMSizeTypesStandardD16sV3, VMSizeTypesStandardD16V3, VMSizeTypesStandardD1V2, VMSizeTypesStandardD2, VMSizeTypesStandardD2sV3, VMSizeTypesStandardD2V2, VMSizeTypesStandardD2V2Promo, VMSizeTypesStandardD2V3, VMSizeTypesStandardD3, VMSizeTypesStandardD32sV3, VMSizeTypesStandardD32V3, VMSizeTypesStandardD3V2, VMSizeTypesStandardD3V2Promo, VMSizeTypesStandardD4, VMSizeTypesStandardD4sV3, VMSizeTypesStandardD4V2, VMSizeTypesStandardD4V2Promo, VMSizeTypesStandardD4V3, VMSizeTypesStandardD5V2, VMSizeTypesStandardD5V2Promo, VMSizeTypesStandardD64sV3, VMSizeTypesStandardD64V3, VMSizeTypesStandardD8sV3, VMSizeTypesStandardD8V3, VMSizeTypesStandardDS1, VMSizeTypesStandardDS11, VMSizeTypesStandardDS11V2, VMSizeTypesStandardDS11V2Promo, VMSizeTypesStandardDS12, VMSizeTypesStandardDS12V2, VMSizeTypesStandardDS12V2Promo, VMSizeTypesStandardDS13, VMSizeTypesStandardDS132V2, VMSizeTypesStandardDS134V2, VMSizeTypesStandardDS13V2, VMSizeTypesStandardDS13V2Promo, VMSizeTypesStandardDS14, VMSizeTypesStandardDS144V2, VMSizeTypesStandardDS148V2, VMSizeTypesStandardDS14V2, VMSizeTypesStandardDS14V2Promo, VMSizeTypesStandardDS15V2, VMSizeTypesStandardDS1V2, VMSizeTypesStandardDS2, VMSizeTypesStandardDS2V2, VMSizeTypesStandardDS2V2Promo, VMSizeTypesStandardDS3, VMSizeTypesStandardDS3V2, VMSizeTypesStandardDS3V2Promo, VMSizeTypesStandardDS4, VMSizeTypesStandardDS4V2, VMSizeTypesStandardDS4V2Promo, VMSizeTypesStandardDS5V2, VMSizeTypesStandardDS5V2Promo, VMSizeTypesStandardE16sV3, VMSizeTypesStandardE16V3, VMSizeTypesStandardE2sV3, VMSizeTypesStandardE2V3, VMSizeTypesStandardE3216sV3, VMSizeTypesStandardE328sV3, VMSizeTypesStandardE32sV3, VMSizeTypesStandardE32V3, VMSizeTypesStandardE4sV3, VMSizeTypesStandardE4V3, VMSizeTypesStandardE6416sV3, VMSizeTypesStandardE6432sV3, VMSizeTypesStandardE64sV3, VMSizeTypesStandardE64V3, VMSizeTypesStandardE8sV3, VMSizeTypesStandardE8V3, VMSizeTypesStandardF1, VMSizeTypesStandardF16, VMSizeTypesStandardF16s, VMSizeTypesStandardF16sV2, VMSizeTypesStandardF1s, VMSizeTypesStandardF2, VMSizeTypesStandardF2s, VMSizeTypesStandardF2sV2, VMSizeTypesStandardF32sV2, VMSizeTypesStandardF4, VMSizeTypesStandardF4s, VMSizeTypesStandardF4sV2, VMSizeTypesStandardF64sV2, VMSizeTypesStandardF72sV2, VMSizeTypesStandardF8, VMSizeTypesStandardF8s, VMSizeTypesStandardF8sV2, VMSizeTypesStandardG1, VMSizeTypesStandardG2, VMSizeTypesStandardG3, VMSizeTypesStandardG4, VMSizeTypesStandardG5, VMSizeTypesStandardGS1, VMSizeTypesStandardGS2, VMSizeTypesStandardGS3, VMSizeTypesStandardGS4, VMSizeTypesStandardGS44, VMSizeTypesStandardGS48, VMSizeTypesStandardGS5, VMSizeTypesStandardGS516, VMSizeTypesStandardGS58, VMSizeTypesStandardH16, VMSizeTypesStandardH16m, VMSizeTypesStandardH16mr, VMSizeTypesStandardH16r, VMSizeTypesStandardH8, VMSizeTypesStandardH8m, VMSizeTypesStandardL16s, VMSizeTypesStandardL32s, VMSizeTypesStandardL4s, VMSizeTypesStandardL8s, VMSizeTypesStandardM12832ms, VMSizeTypesStandardM12864ms, VMSizeTypesStandardM128ms, VMSizeTypesStandardM128s, VMSizeTypesStandardM6416ms, VMSizeTypesStandardM6432ms, VMSizeTypesStandardM64ms, VMSizeTypesStandardM64s, VMSizeTypesStandardNC12, VMSizeTypesStandardNC12sV2, VMSizeTypesStandardNC12sV3, VMSizeTypesStandardNC24, VMSizeTypesStandardNC24r, VMSizeTypesStandardNC24rsV2, VMSizeTypesStandardNC24rsV3, VMSizeTypesStandardNC24sV2, VMSizeTypesStandardNC24sV3, VMSizeTypesStandardNC6, VMSizeTypesStandardNC6sV2, VMSizeTypesStandardNC6sV3, VMSizeTypesStandardND12s, VMSizeTypesStandardND24rs, VMSizeTypesStandardND24s, VMSizeTypesStandardND6s, VMSizeTypesStandardNV12, VMSizeTypesStandardNV24, VMSizeTypesStandardNV6} +} + +// AccessProfile profile for enabling a user to access a managed cluster. +type AccessProfile struct { + // KubeConfig - Base64-encoded Kubernetes configuration file. + KubeConfig *[]byte `json:"kubeConfig,omitempty"` +} + +// AgentPool agent Pool. +type AgentPool struct { + autorest.Response `json:"-"` + // ManagedClusterAgentPoolProfileProperties - Properties of an agent pool. + *ManagedClusterAgentPoolProfileProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AgentPool. +func (ap AgentPool) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ap.ManagedClusterAgentPoolProfileProperties != nil { + objectMap["properties"] = ap.ManagedClusterAgentPoolProfileProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AgentPool struct. +func (ap *AgentPool) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var managedClusterAgentPoolProfileProperties ManagedClusterAgentPoolProfileProperties + err = json.Unmarshal(*v, &managedClusterAgentPoolProfileProperties) + if err != nil { + return err + } + ap.ManagedClusterAgentPoolProfileProperties = &managedClusterAgentPoolProfileProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ap.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ap.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ap.Type = &typeVar + } + } + } + + return nil +} + +// AgentPoolAvailableVersions the list of available versions for an agent pool. +type AgentPoolAvailableVersions struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Id of the agent pool available versions. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the agent pool available versions. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the agent pool available versions. + Type *string `json:"type,omitempty"` + // AgentPoolAvailableVersionsProperties - Properties of agent pool available versions. + *AgentPoolAvailableVersionsProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for AgentPoolAvailableVersions. +func (apav AgentPoolAvailableVersions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if apav.AgentPoolAvailableVersionsProperties != nil { + objectMap["properties"] = apav.AgentPoolAvailableVersionsProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AgentPoolAvailableVersions struct. +func (apav *AgentPoolAvailableVersions) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + apav.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + apav.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + apav.Type = &typeVar + } + case "properties": + if v != nil { + var agentPoolAvailableVersionsProperties AgentPoolAvailableVersionsProperties + err = json.Unmarshal(*v, &agentPoolAvailableVersionsProperties) + if err != nil { + return err + } + apav.AgentPoolAvailableVersionsProperties = &agentPoolAvailableVersionsProperties + } + } + } + + return nil +} + +// AgentPoolAvailableVersionsProperties the list of available agent pool versions. +type AgentPoolAvailableVersionsProperties struct { + // AgentPoolVersions - List of versions available for agent pool. + AgentPoolVersions *[]AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem `json:"agentPoolVersions,omitempty"` +} + +// AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem ... +type AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem struct { + // Default - Whether this version is the default agent pool version. + Default *bool `json:"default,omitempty"` + // KubernetesVersion - Kubernetes version (major, minor, patch). + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` + // IsPreview - Whether Kubernetes version is currently in preview. + IsPreview *bool `json:"isPreview,omitempty"` +} + +// AgentPoolListResult the response from the List Agent Pools operation. +type AgentPoolListResult struct { + autorest.Response `json:"-"` + // Value - The list of agent pools. + Value *[]AgentPool `json:"value,omitempty"` + // NextLink - READ-ONLY; The URL to get the next set of agent pool results. + NextLink *string `json:"nextLink,omitempty"` +} + +// AgentPoolListResultIterator provides access to a complete listing of AgentPool values. +type AgentPoolListResultIterator struct { + i int + page AgentPoolListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *AgentPoolListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *AgentPoolListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AgentPoolListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter AgentPoolListResultIterator) Response() AgentPoolListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter AgentPoolListResultIterator) Value() AgentPool { + if !iter.page.NotDone() { + return AgentPool{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AgentPoolListResultIterator type. +func NewAgentPoolListResultIterator(page AgentPoolListResultPage) AgentPoolListResultIterator { + return AgentPoolListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (aplr AgentPoolListResult) IsEmpty() bool { + return aplr.Value == nil || len(*aplr.Value) == 0 +} + +// agentPoolListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (aplr AgentPoolListResult) agentPoolListResultPreparer(ctx context.Context) (*http.Request, error) { + if aplr.NextLink == nil || len(to.String(aplr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(aplr.NextLink))) +} + +// AgentPoolListResultPage contains a page of AgentPool values. +type AgentPoolListResultPage struct { + fn func(context.Context, AgentPoolListResult) (AgentPoolListResult, error) + aplr AgentPoolListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *AgentPoolListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.aplr) + if err != nil { + return err + } + page.aplr = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *AgentPoolListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AgentPoolListResultPage) NotDone() bool { + return !page.aplr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AgentPoolListResultPage) Response() AgentPoolListResult { + return page.aplr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AgentPoolListResultPage) Values() []AgentPool { + if page.aplr.IsEmpty() { + return nil + } + return *page.aplr.Value +} + +// Creates a new instance of the AgentPoolListResultPage type. +func NewAgentPoolListResultPage(getNextPage func(context.Context, AgentPoolListResult) (AgentPoolListResult, error)) AgentPoolListResultPage { + return AgentPoolListResultPage{fn: getNextPage} +} + +// AgentPoolProfile profile for the container service agent pool. +type AgentPoolProfile struct { + // Name - Unique name of the agent pool profile in the context of the subscription and resource group. + Name *string `json:"name,omitempty"` + // Count - Number of agents (VMs) to host docker containers. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. + Count *int32 `json:"count,omitempty"` + // VMSize - Size of agent VMs. Possible values include: 'VMSizeTypesStandardA1', 'VMSizeTypesStandardA10', 'VMSizeTypesStandardA11', 'VMSizeTypesStandardA1V2', 'VMSizeTypesStandardA2', 'VMSizeTypesStandardA2V2', 'VMSizeTypesStandardA2mV2', 'VMSizeTypesStandardA3', 'VMSizeTypesStandardA4', 'VMSizeTypesStandardA4V2', 'VMSizeTypesStandardA4mV2', 'VMSizeTypesStandardA5', 'VMSizeTypesStandardA6', 'VMSizeTypesStandardA7', 'VMSizeTypesStandardA8', 'VMSizeTypesStandardA8V2', 'VMSizeTypesStandardA8mV2', 'VMSizeTypesStandardA9', 'VMSizeTypesStandardB2ms', 'VMSizeTypesStandardB2s', 'VMSizeTypesStandardB4ms', 'VMSizeTypesStandardB8ms', 'VMSizeTypesStandardD1', 'VMSizeTypesStandardD11', 'VMSizeTypesStandardD11V2', 'VMSizeTypesStandardD11V2Promo', 'VMSizeTypesStandardD12', 'VMSizeTypesStandardD12V2', 'VMSizeTypesStandardD12V2Promo', 'VMSizeTypesStandardD13', 'VMSizeTypesStandardD13V2', 'VMSizeTypesStandardD13V2Promo', 'VMSizeTypesStandardD14', 'VMSizeTypesStandardD14V2', 'VMSizeTypesStandardD14V2Promo', 'VMSizeTypesStandardD15V2', 'VMSizeTypesStandardD16V3', 'VMSizeTypesStandardD16sV3', 'VMSizeTypesStandardD1V2', 'VMSizeTypesStandardD2', 'VMSizeTypesStandardD2V2', 'VMSizeTypesStandardD2V2Promo', 'VMSizeTypesStandardD2V3', 'VMSizeTypesStandardD2sV3', 'VMSizeTypesStandardD3', 'VMSizeTypesStandardD32V3', 'VMSizeTypesStandardD32sV3', 'VMSizeTypesStandardD3V2', 'VMSizeTypesStandardD3V2Promo', 'VMSizeTypesStandardD4', 'VMSizeTypesStandardD4V2', 'VMSizeTypesStandardD4V2Promo', 'VMSizeTypesStandardD4V3', 'VMSizeTypesStandardD4sV3', 'VMSizeTypesStandardD5V2', 'VMSizeTypesStandardD5V2Promo', 'VMSizeTypesStandardD64V3', 'VMSizeTypesStandardD64sV3', 'VMSizeTypesStandardD8V3', 'VMSizeTypesStandardD8sV3', 'VMSizeTypesStandardDS1', 'VMSizeTypesStandardDS11', 'VMSizeTypesStandardDS11V2', 'VMSizeTypesStandardDS11V2Promo', 'VMSizeTypesStandardDS12', 'VMSizeTypesStandardDS12V2', 'VMSizeTypesStandardDS12V2Promo', 'VMSizeTypesStandardDS13', 'VMSizeTypesStandardDS132V2', 'VMSizeTypesStandardDS134V2', 'VMSizeTypesStandardDS13V2', 'VMSizeTypesStandardDS13V2Promo', 'VMSizeTypesStandardDS14', 'VMSizeTypesStandardDS144V2', 'VMSizeTypesStandardDS148V2', 'VMSizeTypesStandardDS14V2', 'VMSizeTypesStandardDS14V2Promo', 'VMSizeTypesStandardDS15V2', 'VMSizeTypesStandardDS1V2', 'VMSizeTypesStandardDS2', 'VMSizeTypesStandardDS2V2', 'VMSizeTypesStandardDS2V2Promo', 'VMSizeTypesStandardDS3', 'VMSizeTypesStandardDS3V2', 'VMSizeTypesStandardDS3V2Promo', 'VMSizeTypesStandardDS4', 'VMSizeTypesStandardDS4V2', 'VMSizeTypesStandardDS4V2Promo', 'VMSizeTypesStandardDS5V2', 'VMSizeTypesStandardDS5V2Promo', 'VMSizeTypesStandardE16V3', 'VMSizeTypesStandardE16sV3', 'VMSizeTypesStandardE2V3', 'VMSizeTypesStandardE2sV3', 'VMSizeTypesStandardE3216sV3', 'VMSizeTypesStandardE328sV3', 'VMSizeTypesStandardE32V3', 'VMSizeTypesStandardE32sV3', 'VMSizeTypesStandardE4V3', 'VMSizeTypesStandardE4sV3', 'VMSizeTypesStandardE6416sV3', 'VMSizeTypesStandardE6432sV3', 'VMSizeTypesStandardE64V3', 'VMSizeTypesStandardE64sV3', 'VMSizeTypesStandardE8V3', 'VMSizeTypesStandardE8sV3', 'VMSizeTypesStandardF1', 'VMSizeTypesStandardF16', 'VMSizeTypesStandardF16s', 'VMSizeTypesStandardF16sV2', 'VMSizeTypesStandardF1s', 'VMSizeTypesStandardF2', 'VMSizeTypesStandardF2s', 'VMSizeTypesStandardF2sV2', 'VMSizeTypesStandardF32sV2', 'VMSizeTypesStandardF4', 'VMSizeTypesStandardF4s', 'VMSizeTypesStandardF4sV2', 'VMSizeTypesStandardF64sV2', 'VMSizeTypesStandardF72sV2', 'VMSizeTypesStandardF8', 'VMSizeTypesStandardF8s', 'VMSizeTypesStandardF8sV2', 'VMSizeTypesStandardG1', 'VMSizeTypesStandardG2', 'VMSizeTypesStandardG3', 'VMSizeTypesStandardG4', 'VMSizeTypesStandardG5', 'VMSizeTypesStandardGS1', 'VMSizeTypesStandardGS2', 'VMSizeTypesStandardGS3', 'VMSizeTypesStandardGS4', 'VMSizeTypesStandardGS44', 'VMSizeTypesStandardGS48', 'VMSizeTypesStandardGS5', 'VMSizeTypesStandardGS516', 'VMSizeTypesStandardGS58', 'VMSizeTypesStandardH16', 'VMSizeTypesStandardH16m', 'VMSizeTypesStandardH16mr', 'VMSizeTypesStandardH16r', 'VMSizeTypesStandardH8', 'VMSizeTypesStandardH8m', 'VMSizeTypesStandardL16s', 'VMSizeTypesStandardL32s', 'VMSizeTypesStandardL4s', 'VMSizeTypesStandardL8s', 'VMSizeTypesStandardM12832ms', 'VMSizeTypesStandardM12864ms', 'VMSizeTypesStandardM128ms', 'VMSizeTypesStandardM128s', 'VMSizeTypesStandardM6416ms', 'VMSizeTypesStandardM6432ms', 'VMSizeTypesStandardM64ms', 'VMSizeTypesStandardM64s', 'VMSizeTypesStandardNC12', 'VMSizeTypesStandardNC12sV2', 'VMSizeTypesStandardNC12sV3', 'VMSizeTypesStandardNC24', 'VMSizeTypesStandardNC24r', 'VMSizeTypesStandardNC24rsV2', 'VMSizeTypesStandardNC24rsV3', 'VMSizeTypesStandardNC24sV2', 'VMSizeTypesStandardNC24sV3', 'VMSizeTypesStandardNC6', 'VMSizeTypesStandardNC6sV2', 'VMSizeTypesStandardNC6sV3', 'VMSizeTypesStandardND12s', 'VMSizeTypesStandardND24rs', 'VMSizeTypesStandardND24s', 'VMSizeTypesStandardND6s', 'VMSizeTypesStandardNV12', 'VMSizeTypesStandardNV24', 'VMSizeTypesStandardNV6' + VMSize VMSizeTypes `json:"vmSize,omitempty"` + // OsDiskSizeGB - OS Disk Size in GB to be used to specify the disk size for every machine in this master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. + OsDiskSizeGB *int32 `json:"osDiskSizeGB,omitempty"` + // DNSPrefix - DNS prefix to be used to create the FQDN for the agent pool. + DNSPrefix *string `json:"dnsPrefix,omitempty"` + // Fqdn - READ-ONLY; FQDN for the agent pool. + Fqdn *string `json:"fqdn,omitempty"` + // Ports - Ports number array used to expose on this agent pool. The default opened ports are different based on your choice of orchestrator. + Ports *[]int32 `json:"ports,omitempty"` + // StorageProfile - Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. Possible values include: 'StorageAccount', 'ManagedDisks' + StorageProfile StorageProfileTypes `json:"storageProfile,omitempty"` + // VnetSubnetID - VNet SubnetID specifies the VNet's subnet identifier. + VnetSubnetID *string `json:"vnetSubnetID,omitempty"` + // OsType - OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: 'Linux', 'Windows' + OsType OSType `json:"osType,omitempty"` +} + +// AgentPoolsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type AgentPoolsCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *AgentPoolsCreateOrUpdateFuture) Result(client AgentPoolsClient) (ap AgentPool, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerservice.AgentPoolsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ap.Response.Response, err = future.GetResult(sender); err == nil && ap.Response.Response.StatusCode != http.StatusNoContent { + ap, err = client.CreateOrUpdateResponder(ap.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsCreateOrUpdateFuture", "Result", ap.Response.Response, "Failure responding to request") + } + } + return +} + +// AgentPoolsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type AgentPoolsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *AgentPoolsDeleteFuture) Result(client AgentPoolsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerservice.AgentPoolsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// AgentPoolUpgradeProfile the list of available upgrades for an agent pool. +type AgentPoolUpgradeProfile struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Id of the agent pool upgrade profile. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the agent pool upgrade profile. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the agent pool upgrade profile. + Type *string `json:"type,omitempty"` + // AgentPoolUpgradeProfileProperties - Properties of agent pool upgrade profile. + *AgentPoolUpgradeProfileProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for AgentPoolUpgradeProfile. +func (apup AgentPoolUpgradeProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if apup.AgentPoolUpgradeProfileProperties != nil { + objectMap["properties"] = apup.AgentPoolUpgradeProfileProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AgentPoolUpgradeProfile struct. +func (apup *AgentPoolUpgradeProfile) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + apup.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + apup.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + apup.Type = &typeVar + } + case "properties": + if v != nil { + var agentPoolUpgradeProfileProperties AgentPoolUpgradeProfileProperties + err = json.Unmarshal(*v, &agentPoolUpgradeProfileProperties) + if err != nil { + return err + } + apup.AgentPoolUpgradeProfileProperties = &agentPoolUpgradeProfileProperties + } + } + } + + return nil +} + +// AgentPoolUpgradeProfileProperties the list of available upgrade versions. +type AgentPoolUpgradeProfileProperties struct { + // KubernetesVersion - Kubernetes version (major, minor, patch). + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` + // OsType - OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: 'Linux', 'Windows' + OsType OSType `json:"osType,omitempty"` + // Upgrades - List of orchestrator types and versions available for upgrade. + Upgrades *[]AgentPoolUpgradeProfilePropertiesUpgradesItem `json:"upgrades,omitempty"` +} + +// AgentPoolUpgradeProfilePropertiesUpgradesItem ... +type AgentPoolUpgradeProfilePropertiesUpgradesItem struct { + // KubernetesVersion - Kubernetes version (major, minor, patch). + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` + // IsPreview - Whether Kubernetes version is currently in preview. + IsPreview *bool `json:"isPreview,omitempty"` +} + +// CloudError an error response from the Container service. +type CloudError struct { + // Error - Details about the error. + Error *CloudErrorBody `json:"error,omitempty"` +} + +// CloudErrorBody an error response from the Container service. +type CloudErrorBody struct { + // Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + Code *string `json:"code,omitempty"` + // Message - A message describing the error, intended to be suitable for display in a user interface. + Message *string `json:"message,omitempty"` + // Target - The target of the particular error. For example, the name of the property in error. + Target *string `json:"target,omitempty"` + // Details - A list of additional details about the error. + Details *[]CloudErrorBody `json:"details,omitempty"` +} + +// ContainerService container service. +type ContainerService struct { + autorest.Response `json:"-"` + // Properties - Properties of the container service. + *Properties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ContainerService. +func (cs ContainerService) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cs.Properties != nil { + objectMap["properties"] = cs.Properties + } + if cs.Location != nil { + objectMap["location"] = cs.Location + } + if cs.Tags != nil { + objectMap["tags"] = cs.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ContainerService struct. +func (cs *ContainerService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var properties Properties + err = json.Unmarshal(*v, &properties) + if err != nil { + return err + } + cs.Properties = &properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + cs.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cs.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cs.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + cs.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + cs.Tags = tags + } + } + } + + return nil +} + +// ContainerServicesCreateOrUpdateFutureType an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ContainerServicesCreateOrUpdateFutureType struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ContainerServicesCreateOrUpdateFutureType) Result(client ContainerServicesClient) (cs ContainerService, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesCreateOrUpdateFutureType", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerservice.ContainerServicesCreateOrUpdateFutureType") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if cs.Response.Response, err = future.GetResult(sender); err == nil && cs.Response.Response.StatusCode != http.StatusNoContent { + cs, err = client.CreateOrUpdateResponder(cs.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesCreateOrUpdateFutureType", "Result", cs.Response.Response, "Failure responding to request") + } + } + return +} + +// ContainerServicesDeleteFutureType an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ContainerServicesDeleteFutureType struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ContainerServicesDeleteFutureType) Result(client ContainerServicesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesDeleteFutureType", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerservice.ContainerServicesDeleteFutureType") + return + } + ar.Response = future.Response() + return +} + +// CredentialResult the credential result response. +type CredentialResult struct { + // Name - READ-ONLY; The name of the credential. + Name *string `json:"name,omitempty"` + // Value - READ-ONLY; Base64-encoded Kubernetes configuration file. + Value *[]byte `json:"value,omitempty"` +} + +// CredentialResults the list of credential result response. +type CredentialResults struct { + autorest.Response `json:"-"` + // Kubeconfigs - READ-ONLY; Base64-encoded Kubernetes configuration file. + Kubeconfigs *[]CredentialResult `json:"kubeconfigs,omitempty"` +} + +// CustomProfile properties to configure a custom container service cluster. +type CustomProfile struct { + // Orchestrator - The name of the custom orchestrator to use. + Orchestrator *string `json:"orchestrator,omitempty"` +} + +// DiagnosticsProfile profile for diagnostics on the container service cluster. +type DiagnosticsProfile struct { + // VMDiagnostics - Profile for diagnostics on the container service VMs. + VMDiagnostics *VMDiagnostics `json:"vmDiagnostics,omitempty"` +} + +// KeyVaultSecretRef reference to a secret stored in Azure Key Vault. +type KeyVaultSecretRef struct { + // VaultID - Key vault identifier. + VaultID *string `json:"vaultID,omitempty"` + // SecretName - The secret name. + SecretName *string `json:"secretName,omitempty"` + // Version - The secret version. + Version *string `json:"version,omitempty"` +} + +// LinuxProfile profile for Linux VMs in the container service cluster. +type LinuxProfile struct { + // AdminUsername - The administrator username to use for Linux VMs. + AdminUsername *string `json:"adminUsername,omitempty"` + // SSH - SSH configuration for Linux-based VMs running on Azure. + SSH *SSHConfiguration `json:"ssh,omitempty"` +} + +// ListResult the response from the List Container Services operation. +type ListResult struct { + autorest.Response `json:"-"` + // Value - The list of container services. + Value *[]ContainerService `json:"value,omitempty"` + // NextLink - READ-ONLY; The URL to get the next set of container service results. + NextLink *string `json:"nextLink,omitempty"` +} + +// ListResultIterator provides access to a complete listing of ContainerService values. +type ListResultIterator struct { + i int + page ListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ListResultIterator) Response() ListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ListResultIterator) Value() ContainerService { + if !iter.page.NotDone() { + return ContainerService{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ListResultIterator type. +func NewListResultIterator(page ListResultPage) ListResultIterator { + return ListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (lr ListResult) IsEmpty() bool { + return lr.Value == nil || len(*lr.Value) == 0 +} + +// listResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lr ListResult) listResultPreparer(ctx context.Context) (*http.Request, error) { + if lr.NextLink == nil || len(to.String(lr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lr.NextLink))) +} + +// ListResultPage contains a page of ContainerService values. +type ListResultPage struct { + fn func(context.Context, ListResult) (ListResult, error) + lr ListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.lr) + if err != nil { + return err + } + page.lr = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ListResultPage) NotDone() bool { + return !page.lr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ListResultPage) Response() ListResult { + return page.lr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ListResultPage) Values() []ContainerService { + if page.lr.IsEmpty() { + return nil + } + return *page.lr.Value +} + +// Creates a new instance of the ListResultPage type. +func NewListResultPage(getNextPage func(context.Context, ListResult) (ListResult, error)) ListResultPage { + return ListResultPage{fn: getNextPage} +} + +// ManagedCluster managed cluster. +type ManagedCluster struct { + autorest.Response `json:"-"` + // ManagedClusterProperties - Properties of a managed cluster. + *ManagedClusterProperties `json:"properties,omitempty"` + // Identity - The identity of the managed cluster, if configured. + Identity *ManagedClusterIdentity `json:"identity,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ManagedCluster. +func (mc ManagedCluster) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mc.ManagedClusterProperties != nil { + objectMap["properties"] = mc.ManagedClusterProperties + } + if mc.Identity != nil { + objectMap["identity"] = mc.Identity + } + if mc.Location != nil { + objectMap["location"] = mc.Location + } + if mc.Tags != nil { + objectMap["tags"] = mc.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ManagedCluster struct. +func (mc *ManagedCluster) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var managedClusterProperties ManagedClusterProperties + err = json.Unmarshal(*v, &managedClusterProperties) + if err != nil { + return err + } + mc.ManagedClusterProperties = &managedClusterProperties + } + case "identity": + if v != nil { + var identity ManagedClusterIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + mc.Identity = &identity + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mc.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + mc.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + mc.Tags = tags + } + } + } + + return nil +} + +// ManagedClusterAADProfile aADProfile specifies attributes for Azure Active Directory integration. +type ManagedClusterAADProfile struct { + // ClientAppID - The client AAD application ID. + ClientAppID *string `json:"clientAppID,omitempty"` + // ServerAppID - The server AAD application ID. + ServerAppID *string `json:"serverAppID,omitempty"` + // ServerAppSecret - The server AAD application secret. + ServerAppSecret *string `json:"serverAppSecret,omitempty"` + // TenantID - The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. + TenantID *string `json:"tenantID,omitempty"` +} + +// ManagedClusterAccessProfile managed cluster Access Profile. +type ManagedClusterAccessProfile struct { + autorest.Response `json:"-"` + // AccessProfile - AccessProfile of a managed cluster. + *AccessProfile `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ManagedClusterAccessProfile. +func (mcap ManagedClusterAccessProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mcap.AccessProfile != nil { + objectMap["properties"] = mcap.AccessProfile + } + if mcap.Location != nil { + objectMap["location"] = mcap.Location + } + if mcap.Tags != nil { + objectMap["tags"] = mcap.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ManagedClusterAccessProfile struct. +func (mcap *ManagedClusterAccessProfile) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var accessProfile AccessProfile + err = json.Unmarshal(*v, &accessProfile) + if err != nil { + return err + } + mcap.AccessProfile = &accessProfile + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mcap.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mcap.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mcap.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + mcap.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + mcap.Tags = tags + } + } + } + + return nil +} + +// ManagedClusterAddonProfile a Kubernetes add-on profile for a managed cluster. +type ManagedClusterAddonProfile struct { + // Enabled - Whether the add-on is enabled or not. + Enabled *bool `json:"enabled,omitempty"` + // Config - Key-value pairs for configuring an add-on. + Config map[string]*string `json:"config"` +} + +// MarshalJSON is the custom marshaler for ManagedClusterAddonProfile. +func (mcap ManagedClusterAddonProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mcap.Enabled != nil { + objectMap["enabled"] = mcap.Enabled + } + if mcap.Config != nil { + objectMap["config"] = mcap.Config + } + return json.Marshal(objectMap) +} + +// ManagedClusterAgentPoolProfile profile for the container service agent pool. +type ManagedClusterAgentPoolProfile struct { + // Name - Unique name of the agent pool profile in the context of the subscription and resource group. + Name *string `json:"name,omitempty"` + // Count - Number of agents (VMs) to host docker containers. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. + Count *int32 `json:"count,omitempty"` + // VMSize - Size of agent VMs. Possible values include: 'VMSizeTypesStandardA1', 'VMSizeTypesStandardA10', 'VMSizeTypesStandardA11', 'VMSizeTypesStandardA1V2', 'VMSizeTypesStandardA2', 'VMSizeTypesStandardA2V2', 'VMSizeTypesStandardA2mV2', 'VMSizeTypesStandardA3', 'VMSizeTypesStandardA4', 'VMSizeTypesStandardA4V2', 'VMSizeTypesStandardA4mV2', 'VMSizeTypesStandardA5', 'VMSizeTypesStandardA6', 'VMSizeTypesStandardA7', 'VMSizeTypesStandardA8', 'VMSizeTypesStandardA8V2', 'VMSizeTypesStandardA8mV2', 'VMSizeTypesStandardA9', 'VMSizeTypesStandardB2ms', 'VMSizeTypesStandardB2s', 'VMSizeTypesStandardB4ms', 'VMSizeTypesStandardB8ms', 'VMSizeTypesStandardD1', 'VMSizeTypesStandardD11', 'VMSizeTypesStandardD11V2', 'VMSizeTypesStandardD11V2Promo', 'VMSizeTypesStandardD12', 'VMSizeTypesStandardD12V2', 'VMSizeTypesStandardD12V2Promo', 'VMSizeTypesStandardD13', 'VMSizeTypesStandardD13V2', 'VMSizeTypesStandardD13V2Promo', 'VMSizeTypesStandardD14', 'VMSizeTypesStandardD14V2', 'VMSizeTypesStandardD14V2Promo', 'VMSizeTypesStandardD15V2', 'VMSizeTypesStandardD16V3', 'VMSizeTypesStandardD16sV3', 'VMSizeTypesStandardD1V2', 'VMSizeTypesStandardD2', 'VMSizeTypesStandardD2V2', 'VMSizeTypesStandardD2V2Promo', 'VMSizeTypesStandardD2V3', 'VMSizeTypesStandardD2sV3', 'VMSizeTypesStandardD3', 'VMSizeTypesStandardD32V3', 'VMSizeTypesStandardD32sV3', 'VMSizeTypesStandardD3V2', 'VMSizeTypesStandardD3V2Promo', 'VMSizeTypesStandardD4', 'VMSizeTypesStandardD4V2', 'VMSizeTypesStandardD4V2Promo', 'VMSizeTypesStandardD4V3', 'VMSizeTypesStandardD4sV3', 'VMSizeTypesStandardD5V2', 'VMSizeTypesStandardD5V2Promo', 'VMSizeTypesStandardD64V3', 'VMSizeTypesStandardD64sV3', 'VMSizeTypesStandardD8V3', 'VMSizeTypesStandardD8sV3', 'VMSizeTypesStandardDS1', 'VMSizeTypesStandardDS11', 'VMSizeTypesStandardDS11V2', 'VMSizeTypesStandardDS11V2Promo', 'VMSizeTypesStandardDS12', 'VMSizeTypesStandardDS12V2', 'VMSizeTypesStandardDS12V2Promo', 'VMSizeTypesStandardDS13', 'VMSizeTypesStandardDS132V2', 'VMSizeTypesStandardDS134V2', 'VMSizeTypesStandardDS13V2', 'VMSizeTypesStandardDS13V2Promo', 'VMSizeTypesStandardDS14', 'VMSizeTypesStandardDS144V2', 'VMSizeTypesStandardDS148V2', 'VMSizeTypesStandardDS14V2', 'VMSizeTypesStandardDS14V2Promo', 'VMSizeTypesStandardDS15V2', 'VMSizeTypesStandardDS1V2', 'VMSizeTypesStandardDS2', 'VMSizeTypesStandardDS2V2', 'VMSizeTypesStandardDS2V2Promo', 'VMSizeTypesStandardDS3', 'VMSizeTypesStandardDS3V2', 'VMSizeTypesStandardDS3V2Promo', 'VMSizeTypesStandardDS4', 'VMSizeTypesStandardDS4V2', 'VMSizeTypesStandardDS4V2Promo', 'VMSizeTypesStandardDS5V2', 'VMSizeTypesStandardDS5V2Promo', 'VMSizeTypesStandardE16V3', 'VMSizeTypesStandardE16sV3', 'VMSizeTypesStandardE2V3', 'VMSizeTypesStandardE2sV3', 'VMSizeTypesStandardE3216sV3', 'VMSizeTypesStandardE328sV3', 'VMSizeTypesStandardE32V3', 'VMSizeTypesStandardE32sV3', 'VMSizeTypesStandardE4V3', 'VMSizeTypesStandardE4sV3', 'VMSizeTypesStandardE6416sV3', 'VMSizeTypesStandardE6432sV3', 'VMSizeTypesStandardE64V3', 'VMSizeTypesStandardE64sV3', 'VMSizeTypesStandardE8V3', 'VMSizeTypesStandardE8sV3', 'VMSizeTypesStandardF1', 'VMSizeTypesStandardF16', 'VMSizeTypesStandardF16s', 'VMSizeTypesStandardF16sV2', 'VMSizeTypesStandardF1s', 'VMSizeTypesStandardF2', 'VMSizeTypesStandardF2s', 'VMSizeTypesStandardF2sV2', 'VMSizeTypesStandardF32sV2', 'VMSizeTypesStandardF4', 'VMSizeTypesStandardF4s', 'VMSizeTypesStandardF4sV2', 'VMSizeTypesStandardF64sV2', 'VMSizeTypesStandardF72sV2', 'VMSizeTypesStandardF8', 'VMSizeTypesStandardF8s', 'VMSizeTypesStandardF8sV2', 'VMSizeTypesStandardG1', 'VMSizeTypesStandardG2', 'VMSizeTypesStandardG3', 'VMSizeTypesStandardG4', 'VMSizeTypesStandardG5', 'VMSizeTypesStandardGS1', 'VMSizeTypesStandardGS2', 'VMSizeTypesStandardGS3', 'VMSizeTypesStandardGS4', 'VMSizeTypesStandardGS44', 'VMSizeTypesStandardGS48', 'VMSizeTypesStandardGS5', 'VMSizeTypesStandardGS516', 'VMSizeTypesStandardGS58', 'VMSizeTypesStandardH16', 'VMSizeTypesStandardH16m', 'VMSizeTypesStandardH16mr', 'VMSizeTypesStandardH16r', 'VMSizeTypesStandardH8', 'VMSizeTypesStandardH8m', 'VMSizeTypesStandardL16s', 'VMSizeTypesStandardL32s', 'VMSizeTypesStandardL4s', 'VMSizeTypesStandardL8s', 'VMSizeTypesStandardM12832ms', 'VMSizeTypesStandardM12864ms', 'VMSizeTypesStandardM128ms', 'VMSizeTypesStandardM128s', 'VMSizeTypesStandardM6416ms', 'VMSizeTypesStandardM6432ms', 'VMSizeTypesStandardM64ms', 'VMSizeTypesStandardM64s', 'VMSizeTypesStandardNC12', 'VMSizeTypesStandardNC12sV2', 'VMSizeTypesStandardNC12sV3', 'VMSizeTypesStandardNC24', 'VMSizeTypesStandardNC24r', 'VMSizeTypesStandardNC24rsV2', 'VMSizeTypesStandardNC24rsV3', 'VMSizeTypesStandardNC24sV2', 'VMSizeTypesStandardNC24sV3', 'VMSizeTypesStandardNC6', 'VMSizeTypesStandardNC6sV2', 'VMSizeTypesStandardNC6sV3', 'VMSizeTypesStandardND12s', 'VMSizeTypesStandardND24rs', 'VMSizeTypesStandardND24s', 'VMSizeTypesStandardND6s', 'VMSizeTypesStandardNV12', 'VMSizeTypesStandardNV24', 'VMSizeTypesStandardNV6' + VMSize VMSizeTypes `json:"vmSize,omitempty"` + // OsDiskSizeGB - OS Disk Size in GB to be used to specify the disk size for every machine in this master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. + OsDiskSizeGB *int32 `json:"osDiskSizeGB,omitempty"` + // VnetSubnetID - VNet SubnetID specifies the VNet's subnet identifier. + VnetSubnetID *string `json:"vnetSubnetID,omitempty"` + // MaxPods - Maximum number of pods that can run on a node. + MaxPods *int32 `json:"maxPods,omitempty"` + // OsType - OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: 'Linux', 'Windows' + OsType OSType `json:"osType,omitempty"` + // MaxCount - Maximum number of nodes for auto-scaling + MaxCount *int32 `json:"maxCount,omitempty"` + // MinCount - Minimum number of nodes for auto-scaling + MinCount *int32 `json:"minCount,omitempty"` + // EnableAutoScaling - Whether to enable auto-scaler + EnableAutoScaling *bool `json:"enableAutoScaling,omitempty"` + // Type - AgentPoolType represents types of an agent pool. Possible values include: 'VirtualMachineScaleSets', 'AvailabilitySet' + Type AgentPoolType `json:"type,omitempty"` + // OrchestratorVersion - Version of orchestrator specified when creating the managed cluster. + OrchestratorVersion *string `json:"orchestratorVersion,omitempty"` + // ProvisioningState - READ-ONLY; The current deployment or provisioning state, which only appears in the response. + ProvisioningState *string `json:"provisioningState,omitempty"` + // AvailabilityZones - (PREVIEW) Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. + AvailabilityZones *[]string `json:"availabilityZones,omitempty"` + // EnableNodePublicIP - Enable public IP for nodes + EnableNodePublicIP *bool `json:"enableNodePublicIP,omitempty"` + // ScaleSetPriority - ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: 'Low', 'Regular' + ScaleSetPriority ScaleSetPriority `json:"scaleSetPriority,omitempty"` + // ScaleSetEvictionPolicy - ScaleSetEvictionPolicy to be used to specify eviction policy for low priority virtual machine scale set. Default to Delete. Possible values include: 'Delete', 'Deallocate' + ScaleSetEvictionPolicy ScaleSetEvictionPolicy `json:"scaleSetEvictionPolicy,omitempty"` + // NodeTaints - Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. + NodeTaints *[]string `json:"nodeTaints,omitempty"` +} + +// ManagedClusterAgentPoolProfileProperties properties for the container service agent pool profile. +type ManagedClusterAgentPoolProfileProperties struct { + // Count - Number of agents (VMs) to host docker containers. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. + Count *int32 `json:"count,omitempty"` + // VMSize - Size of agent VMs. Possible values include: 'VMSizeTypesStandardA1', 'VMSizeTypesStandardA10', 'VMSizeTypesStandardA11', 'VMSizeTypesStandardA1V2', 'VMSizeTypesStandardA2', 'VMSizeTypesStandardA2V2', 'VMSizeTypesStandardA2mV2', 'VMSizeTypesStandardA3', 'VMSizeTypesStandardA4', 'VMSizeTypesStandardA4V2', 'VMSizeTypesStandardA4mV2', 'VMSizeTypesStandardA5', 'VMSizeTypesStandardA6', 'VMSizeTypesStandardA7', 'VMSizeTypesStandardA8', 'VMSizeTypesStandardA8V2', 'VMSizeTypesStandardA8mV2', 'VMSizeTypesStandardA9', 'VMSizeTypesStandardB2ms', 'VMSizeTypesStandardB2s', 'VMSizeTypesStandardB4ms', 'VMSizeTypesStandardB8ms', 'VMSizeTypesStandardD1', 'VMSizeTypesStandardD11', 'VMSizeTypesStandardD11V2', 'VMSizeTypesStandardD11V2Promo', 'VMSizeTypesStandardD12', 'VMSizeTypesStandardD12V2', 'VMSizeTypesStandardD12V2Promo', 'VMSizeTypesStandardD13', 'VMSizeTypesStandardD13V2', 'VMSizeTypesStandardD13V2Promo', 'VMSizeTypesStandardD14', 'VMSizeTypesStandardD14V2', 'VMSizeTypesStandardD14V2Promo', 'VMSizeTypesStandardD15V2', 'VMSizeTypesStandardD16V3', 'VMSizeTypesStandardD16sV3', 'VMSizeTypesStandardD1V2', 'VMSizeTypesStandardD2', 'VMSizeTypesStandardD2V2', 'VMSizeTypesStandardD2V2Promo', 'VMSizeTypesStandardD2V3', 'VMSizeTypesStandardD2sV3', 'VMSizeTypesStandardD3', 'VMSizeTypesStandardD32V3', 'VMSizeTypesStandardD32sV3', 'VMSizeTypesStandardD3V2', 'VMSizeTypesStandardD3V2Promo', 'VMSizeTypesStandardD4', 'VMSizeTypesStandardD4V2', 'VMSizeTypesStandardD4V2Promo', 'VMSizeTypesStandardD4V3', 'VMSizeTypesStandardD4sV3', 'VMSizeTypesStandardD5V2', 'VMSizeTypesStandardD5V2Promo', 'VMSizeTypesStandardD64V3', 'VMSizeTypesStandardD64sV3', 'VMSizeTypesStandardD8V3', 'VMSizeTypesStandardD8sV3', 'VMSizeTypesStandardDS1', 'VMSizeTypesStandardDS11', 'VMSizeTypesStandardDS11V2', 'VMSizeTypesStandardDS11V2Promo', 'VMSizeTypesStandardDS12', 'VMSizeTypesStandardDS12V2', 'VMSizeTypesStandardDS12V2Promo', 'VMSizeTypesStandardDS13', 'VMSizeTypesStandardDS132V2', 'VMSizeTypesStandardDS134V2', 'VMSizeTypesStandardDS13V2', 'VMSizeTypesStandardDS13V2Promo', 'VMSizeTypesStandardDS14', 'VMSizeTypesStandardDS144V2', 'VMSizeTypesStandardDS148V2', 'VMSizeTypesStandardDS14V2', 'VMSizeTypesStandardDS14V2Promo', 'VMSizeTypesStandardDS15V2', 'VMSizeTypesStandardDS1V2', 'VMSizeTypesStandardDS2', 'VMSizeTypesStandardDS2V2', 'VMSizeTypesStandardDS2V2Promo', 'VMSizeTypesStandardDS3', 'VMSizeTypesStandardDS3V2', 'VMSizeTypesStandardDS3V2Promo', 'VMSizeTypesStandardDS4', 'VMSizeTypesStandardDS4V2', 'VMSizeTypesStandardDS4V2Promo', 'VMSizeTypesStandardDS5V2', 'VMSizeTypesStandardDS5V2Promo', 'VMSizeTypesStandardE16V3', 'VMSizeTypesStandardE16sV3', 'VMSizeTypesStandardE2V3', 'VMSizeTypesStandardE2sV3', 'VMSizeTypesStandardE3216sV3', 'VMSizeTypesStandardE328sV3', 'VMSizeTypesStandardE32V3', 'VMSizeTypesStandardE32sV3', 'VMSizeTypesStandardE4V3', 'VMSizeTypesStandardE4sV3', 'VMSizeTypesStandardE6416sV3', 'VMSizeTypesStandardE6432sV3', 'VMSizeTypesStandardE64V3', 'VMSizeTypesStandardE64sV3', 'VMSizeTypesStandardE8V3', 'VMSizeTypesStandardE8sV3', 'VMSizeTypesStandardF1', 'VMSizeTypesStandardF16', 'VMSizeTypesStandardF16s', 'VMSizeTypesStandardF16sV2', 'VMSizeTypesStandardF1s', 'VMSizeTypesStandardF2', 'VMSizeTypesStandardF2s', 'VMSizeTypesStandardF2sV2', 'VMSizeTypesStandardF32sV2', 'VMSizeTypesStandardF4', 'VMSizeTypesStandardF4s', 'VMSizeTypesStandardF4sV2', 'VMSizeTypesStandardF64sV2', 'VMSizeTypesStandardF72sV2', 'VMSizeTypesStandardF8', 'VMSizeTypesStandardF8s', 'VMSizeTypesStandardF8sV2', 'VMSizeTypesStandardG1', 'VMSizeTypesStandardG2', 'VMSizeTypesStandardG3', 'VMSizeTypesStandardG4', 'VMSizeTypesStandardG5', 'VMSizeTypesStandardGS1', 'VMSizeTypesStandardGS2', 'VMSizeTypesStandardGS3', 'VMSizeTypesStandardGS4', 'VMSizeTypesStandardGS44', 'VMSizeTypesStandardGS48', 'VMSizeTypesStandardGS5', 'VMSizeTypesStandardGS516', 'VMSizeTypesStandardGS58', 'VMSizeTypesStandardH16', 'VMSizeTypesStandardH16m', 'VMSizeTypesStandardH16mr', 'VMSizeTypesStandardH16r', 'VMSizeTypesStandardH8', 'VMSizeTypesStandardH8m', 'VMSizeTypesStandardL16s', 'VMSizeTypesStandardL32s', 'VMSizeTypesStandardL4s', 'VMSizeTypesStandardL8s', 'VMSizeTypesStandardM12832ms', 'VMSizeTypesStandardM12864ms', 'VMSizeTypesStandardM128ms', 'VMSizeTypesStandardM128s', 'VMSizeTypesStandardM6416ms', 'VMSizeTypesStandardM6432ms', 'VMSizeTypesStandardM64ms', 'VMSizeTypesStandardM64s', 'VMSizeTypesStandardNC12', 'VMSizeTypesStandardNC12sV2', 'VMSizeTypesStandardNC12sV3', 'VMSizeTypesStandardNC24', 'VMSizeTypesStandardNC24r', 'VMSizeTypesStandardNC24rsV2', 'VMSizeTypesStandardNC24rsV3', 'VMSizeTypesStandardNC24sV2', 'VMSizeTypesStandardNC24sV3', 'VMSizeTypesStandardNC6', 'VMSizeTypesStandardNC6sV2', 'VMSizeTypesStandardNC6sV3', 'VMSizeTypesStandardND12s', 'VMSizeTypesStandardND24rs', 'VMSizeTypesStandardND24s', 'VMSizeTypesStandardND6s', 'VMSizeTypesStandardNV12', 'VMSizeTypesStandardNV24', 'VMSizeTypesStandardNV6' + VMSize VMSizeTypes `json:"vmSize,omitempty"` + // OsDiskSizeGB - OS Disk Size in GB to be used to specify the disk size for every machine in this master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. + OsDiskSizeGB *int32 `json:"osDiskSizeGB,omitempty"` + // VnetSubnetID - VNet SubnetID specifies the VNet's subnet identifier. + VnetSubnetID *string `json:"vnetSubnetID,omitempty"` + // MaxPods - Maximum number of pods that can run on a node. + MaxPods *int32 `json:"maxPods,omitempty"` + // OsType - OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: 'Linux', 'Windows' + OsType OSType `json:"osType,omitempty"` + // MaxCount - Maximum number of nodes for auto-scaling + MaxCount *int32 `json:"maxCount,omitempty"` + // MinCount - Minimum number of nodes for auto-scaling + MinCount *int32 `json:"minCount,omitempty"` + // EnableAutoScaling - Whether to enable auto-scaler + EnableAutoScaling *bool `json:"enableAutoScaling,omitempty"` + // Type - AgentPoolType represents types of an agent pool. Possible values include: 'VirtualMachineScaleSets', 'AvailabilitySet' + Type AgentPoolType `json:"type,omitempty"` + // OrchestratorVersion - Version of orchestrator specified when creating the managed cluster. + OrchestratorVersion *string `json:"orchestratorVersion,omitempty"` + // ProvisioningState - READ-ONLY; The current deployment or provisioning state, which only appears in the response. + ProvisioningState *string `json:"provisioningState,omitempty"` + // AvailabilityZones - (PREVIEW) Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. + AvailabilityZones *[]string `json:"availabilityZones,omitempty"` + // EnableNodePublicIP - Enable public IP for nodes + EnableNodePublicIP *bool `json:"enableNodePublicIP,omitempty"` + // ScaleSetPriority - ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: 'Low', 'Regular' + ScaleSetPriority ScaleSetPriority `json:"scaleSetPriority,omitempty"` + // ScaleSetEvictionPolicy - ScaleSetEvictionPolicy to be used to specify eviction policy for low priority virtual machine scale set. Default to Delete. Possible values include: 'Delete', 'Deallocate' + ScaleSetEvictionPolicy ScaleSetEvictionPolicy `json:"scaleSetEvictionPolicy,omitempty"` + // NodeTaints - Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. + NodeTaints *[]string `json:"nodeTaints,omitempty"` +} + +// ManagedClusterAPIServerAccessProfile access profile for managed cluster API server. +type ManagedClusterAPIServerAccessProfile struct { + // AuthorizedIPRanges - Authorized IP Ranges to kubernetes API server. + AuthorizedIPRanges *[]string `json:"authorizedIPRanges,omitempty"` + // EnablePrivateCluster - Whether to create the cluster as a private cluster or not. + EnablePrivateCluster *bool `json:"enablePrivateCluster,omitempty"` +} + +// ManagedClusterIdentity identity for the managed cluster. +type ManagedClusterIdentity struct { + // PrincipalID - READ-ONLY; The principal id of the system assigned identity which is used by master components. + PrincipalID *string `json:"principalId,omitempty"` + // TenantID - READ-ONLY; The tenant id of the system assigned identity which is used by master components. + TenantID *string `json:"tenantId,omitempty"` + // Type - The type of identity used for the managed cluster. Type 'SystemAssigned' will use an implicitly created identity in master components and an auto-created user assigned identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, service principal will be used instead. Possible values include: 'SystemAssigned', 'None' + Type ResourceIdentityType `json:"type,omitempty"` +} + +// ManagedClusterListResult the response from the List Managed Clusters operation. +type ManagedClusterListResult struct { + autorest.Response `json:"-"` + // Value - The list of managed clusters. + Value *[]ManagedCluster `json:"value,omitempty"` + // NextLink - READ-ONLY; The URL to get the next set of managed cluster results. + NextLink *string `json:"nextLink,omitempty"` +} + +// ManagedClusterListResultIterator provides access to a complete listing of ManagedCluster values. +type ManagedClusterListResultIterator struct { + i int + page ManagedClusterListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ManagedClusterListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClusterListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ManagedClusterListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ManagedClusterListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ManagedClusterListResultIterator) Response() ManagedClusterListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ManagedClusterListResultIterator) Value() ManagedCluster { + if !iter.page.NotDone() { + return ManagedCluster{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ManagedClusterListResultIterator type. +func NewManagedClusterListResultIterator(page ManagedClusterListResultPage) ManagedClusterListResultIterator { + return ManagedClusterListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (mclr ManagedClusterListResult) IsEmpty() bool { + return mclr.Value == nil || len(*mclr.Value) == 0 +} + +// managedClusterListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (mclr ManagedClusterListResult) managedClusterListResultPreparer(ctx context.Context) (*http.Request, error) { + if mclr.NextLink == nil || len(to.String(mclr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(mclr.NextLink))) +} + +// ManagedClusterListResultPage contains a page of ManagedCluster values. +type ManagedClusterListResultPage struct { + fn func(context.Context, ManagedClusterListResult) (ManagedClusterListResult, error) + mclr ManagedClusterListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ManagedClusterListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClusterListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.mclr) + if err != nil { + return err + } + page.mclr = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ManagedClusterListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ManagedClusterListResultPage) NotDone() bool { + return !page.mclr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ManagedClusterListResultPage) Response() ManagedClusterListResult { + return page.mclr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ManagedClusterListResultPage) Values() []ManagedCluster { + if page.mclr.IsEmpty() { + return nil + } + return *page.mclr.Value +} + +// Creates a new instance of the ManagedClusterListResultPage type. +func NewManagedClusterListResultPage(getNextPage func(context.Context, ManagedClusterListResult) (ManagedClusterListResult, error)) ManagedClusterListResultPage { + return ManagedClusterListResultPage{fn: getNextPage} +} + +// ManagedClusterLoadBalancerProfile profile of the managed cluster load balancer +type ManagedClusterLoadBalancerProfile struct { + // ManagedOutboundIPs - Desired managed outbound IPs for the cluster load balancer. + ManagedOutboundIPs *ManagedClusterLoadBalancerProfileManagedOutboundIPs `json:"managedOutboundIPs,omitempty"` + // OutboundIPPrefixes - Desired outbound IP Prefix resources for the cluster load balancer. + OutboundIPPrefixes *ManagedClusterLoadBalancerProfileOutboundIPPrefixes `json:"outboundIPPrefixes,omitempty"` + // OutboundIPs - Desired outbound IP resources for the cluster load balancer. + OutboundIPs *ManagedClusterLoadBalancerProfileOutboundIPs `json:"outboundIPs,omitempty"` + // EffectiveOutboundIPs - The effective outbound IP resources of the cluster load balancer. + EffectiveOutboundIPs *[]ResourceReference `json:"effectiveOutboundIPs,omitempty"` +} + +// ManagedClusterLoadBalancerProfileManagedOutboundIPs desired managed outbound IPs for the cluster load +// balancer. +type ManagedClusterLoadBalancerProfileManagedOutboundIPs struct { + // Count - Desired number of outbound IP created/managed by Azure for the cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. + Count *int32 `json:"count,omitempty"` +} + +// ManagedClusterLoadBalancerProfileOutboundIPPrefixes desired outbound IP Prefix resources for the cluster +// load balancer. +type ManagedClusterLoadBalancerProfileOutboundIPPrefixes struct { + // PublicIPPrefixes - A list of public IP prefix resources. + PublicIPPrefixes *[]ResourceReference `json:"publicIPPrefixes,omitempty"` +} + +// ManagedClusterLoadBalancerProfileOutboundIPs desired outbound IP resources for the cluster load +// balancer. +type ManagedClusterLoadBalancerProfileOutboundIPs struct { + // PublicIPs - A list of public IP resources. + PublicIPs *[]ResourceReference `json:"publicIPs,omitempty"` +} + +// ManagedClusterPoolUpgradeProfile the list of available upgrade versions. +type ManagedClusterPoolUpgradeProfile struct { + // KubernetesVersion - Kubernetes version (major, minor, patch). + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` + // Name - Pool name. + Name *string `json:"name,omitempty"` + // OsType - OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: 'Linux', 'Windows' + OsType OSType `json:"osType,omitempty"` + // Upgrades - List of orchestrator types and versions available for upgrade. + Upgrades *[]ManagedClusterPoolUpgradeProfileUpgradesItem `json:"upgrades,omitempty"` +} + +// ManagedClusterPoolUpgradeProfileUpgradesItem ... +type ManagedClusterPoolUpgradeProfileUpgradesItem struct { + // KubernetesVersion - Kubernetes version (major, minor, patch). + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` + // IsPreview - Whether Kubernetes version is currently in preview. + IsPreview *bool `json:"isPreview,omitempty"` +} + +// ManagedClusterProperties properties of the managed cluster. +type ManagedClusterProperties struct { + // ProvisioningState - READ-ONLY; The current deployment or provisioning state, which only appears in the response. + ProvisioningState *string `json:"provisioningState,omitempty"` + // MaxAgentPools - READ-ONLY; The max number of agent pools for the managed cluster. + MaxAgentPools *int32 `json:"maxAgentPools,omitempty"` + // KubernetesVersion - Version of Kubernetes specified when creating the managed cluster. + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` + // DNSPrefix - DNS prefix specified when creating the managed cluster. + DNSPrefix *string `json:"dnsPrefix,omitempty"` + // Fqdn - READ-ONLY; FQDN for the master pool. + Fqdn *string `json:"fqdn,omitempty"` + // AgentPoolProfiles - Properties of the agent pool. + AgentPoolProfiles *[]ManagedClusterAgentPoolProfile `json:"agentPoolProfiles,omitempty"` + // LinuxProfile - Profile for Linux VMs in the container service cluster. + LinuxProfile *LinuxProfile `json:"linuxProfile,omitempty"` + // WindowsProfile - Profile for Windows VMs in the container service cluster. + WindowsProfile *ManagedClusterWindowsProfile `json:"windowsProfile,omitempty"` + // ServicePrincipalProfile - Information about a service principal identity for the cluster to use for manipulating Azure APIs. + ServicePrincipalProfile *ManagedClusterServicePrincipalProfile `json:"servicePrincipalProfile,omitempty"` + // AddonProfiles - Profile of managed cluster add-on. + AddonProfiles map[string]*ManagedClusterAddonProfile `json:"addonProfiles"` + // NodeResourceGroup - Name of the resource group containing agent pool nodes. + NodeResourceGroup *string `json:"nodeResourceGroup,omitempty"` + // EnableRBAC - Whether to enable Kubernetes Role-Based Access Control. + EnableRBAC *bool `json:"enableRBAC,omitempty"` + // EnablePodSecurityPolicy - (PREVIEW) Whether to enable Kubernetes Pod security policy. + EnablePodSecurityPolicy *bool `json:"enablePodSecurityPolicy,omitempty"` + // NetworkProfile - Profile of network configuration. + NetworkProfile *NetworkProfileType `json:"networkProfile,omitempty"` + // AadProfile - Profile of Azure Active Directory configuration. + AadProfile *ManagedClusterAADProfile `json:"aadProfile,omitempty"` + // APIServerAccessProfile - Access profile for managed cluster API server. + APIServerAccessProfile *ManagedClusterAPIServerAccessProfile `json:"apiServerAccessProfile,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManagedClusterProperties. +func (mcp ManagedClusterProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mcp.KubernetesVersion != nil { + objectMap["kubernetesVersion"] = mcp.KubernetesVersion + } + if mcp.DNSPrefix != nil { + objectMap["dnsPrefix"] = mcp.DNSPrefix + } + if mcp.AgentPoolProfiles != nil { + objectMap["agentPoolProfiles"] = mcp.AgentPoolProfiles + } + if mcp.LinuxProfile != nil { + objectMap["linuxProfile"] = mcp.LinuxProfile + } + if mcp.WindowsProfile != nil { + objectMap["windowsProfile"] = mcp.WindowsProfile + } + if mcp.ServicePrincipalProfile != nil { + objectMap["servicePrincipalProfile"] = mcp.ServicePrincipalProfile + } + if mcp.AddonProfiles != nil { + objectMap["addonProfiles"] = mcp.AddonProfiles + } + if mcp.NodeResourceGroup != nil { + objectMap["nodeResourceGroup"] = mcp.NodeResourceGroup + } + if mcp.EnableRBAC != nil { + objectMap["enableRBAC"] = mcp.EnableRBAC + } + if mcp.EnablePodSecurityPolicy != nil { + objectMap["enablePodSecurityPolicy"] = mcp.EnablePodSecurityPolicy + } + if mcp.NetworkProfile != nil { + objectMap["networkProfile"] = mcp.NetworkProfile + } + if mcp.AadProfile != nil { + objectMap["aadProfile"] = mcp.AadProfile + } + if mcp.APIServerAccessProfile != nil { + objectMap["apiServerAccessProfile"] = mcp.APIServerAccessProfile + } + return json.Marshal(objectMap) +} + +// ManagedClustersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ManagedClustersCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ManagedClustersCreateOrUpdateFuture) Result(client ManagedClustersClient) (mc ManagedCluster, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mc.Response.Response, err = future.GetResult(sender); err == nil && mc.Response.Response.StatusCode != http.StatusNoContent { + mc, err = client.CreateOrUpdateResponder(mc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersCreateOrUpdateFuture", "Result", mc.Response.Response, "Failure responding to request") + } + } + return +} + +// ManagedClustersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ManagedClustersDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ManagedClustersDeleteFuture) Result(client ManagedClustersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ManagedClusterServicePrincipalProfile information about a service principal identity for the cluster to +// use for manipulating Azure APIs. +type ManagedClusterServicePrincipalProfile struct { + // ClientID - The ID for the service principal. + ClientID *string `json:"clientId,omitempty"` + // Secret - The secret password associated with the service principal in plain text. + Secret *string `json:"secret,omitempty"` +} + +// ManagedClustersResetAADProfileFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ManagedClustersResetAADProfileFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ManagedClustersResetAADProfileFuture) Result(client ManagedClustersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersResetAADProfileFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersResetAADProfileFuture") + return + } + ar.Response = future.Response() + return +} + +// ManagedClustersResetServicePrincipalProfileFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ManagedClustersResetServicePrincipalProfileFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ManagedClustersResetServicePrincipalProfileFuture) Result(client ManagedClustersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersResetServicePrincipalProfileFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersResetServicePrincipalProfileFuture") + return + } + ar.Response = future.Response() + return +} + +// ManagedClustersRotateClusterCertificatesFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ManagedClustersRotateClusterCertificatesFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ManagedClustersRotateClusterCertificatesFuture) Result(client ManagedClustersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersRotateClusterCertificatesFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersRotateClusterCertificatesFuture") + return + } + ar.Response = future.Response() + return +} + +// ManagedClustersUpdateTagsFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ManagedClustersUpdateTagsFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ManagedClustersUpdateTagsFuture) Result(client ManagedClustersClient) (mc ManagedCluster, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersUpdateTagsFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersUpdateTagsFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mc.Response.Response, err = future.GetResult(sender); err == nil && mc.Response.Response.StatusCode != http.StatusNoContent { + mc, err = client.UpdateTagsResponder(mc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersUpdateTagsFuture", "Result", mc.Response.Response, "Failure responding to request") + } + } + return +} + +// ManagedClusterUpgradeProfile the list of available upgrades for compute pools. +type ManagedClusterUpgradeProfile struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Id of upgrade profile. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of upgrade profile. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of upgrade profile. + Type *string `json:"type,omitempty"` + // ManagedClusterUpgradeProfileProperties - Properties of upgrade profile. + *ManagedClusterUpgradeProfileProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManagedClusterUpgradeProfile. +func (mcup ManagedClusterUpgradeProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mcup.ManagedClusterUpgradeProfileProperties != nil { + objectMap["properties"] = mcup.ManagedClusterUpgradeProfileProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ManagedClusterUpgradeProfile struct. +func (mcup *ManagedClusterUpgradeProfile) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mcup.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mcup.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mcup.Type = &typeVar + } + case "properties": + if v != nil { + var managedClusterUpgradeProfileProperties ManagedClusterUpgradeProfileProperties + err = json.Unmarshal(*v, &managedClusterUpgradeProfileProperties) + if err != nil { + return err + } + mcup.ManagedClusterUpgradeProfileProperties = &managedClusterUpgradeProfileProperties + } + } + } + + return nil +} + +// ManagedClusterUpgradeProfileProperties control plane and agent pool upgrade profiles. +type ManagedClusterUpgradeProfileProperties struct { + // ControlPlaneProfile - The list of available upgrade versions for the control plane. + ControlPlaneProfile *ManagedClusterPoolUpgradeProfile `json:"controlPlaneProfile,omitempty"` + // AgentPoolProfiles - The list of available upgrade versions for agent pools. + AgentPoolProfiles *[]ManagedClusterPoolUpgradeProfile `json:"agentPoolProfiles,omitempty"` +} + +// ManagedClusterWindowsProfile profile for Windows VMs in the container service cluster. +type ManagedClusterWindowsProfile struct { + // AdminUsername - The administrator username to use for Windows VMs. + AdminUsername *string `json:"adminUsername,omitempty"` + // AdminPassword - The administrator password to use for Windows VMs. + AdminPassword *string `json:"adminPassword,omitempty"` +} + +// MasterProfile profile for the container service master. +type MasterProfile struct { + // Count - Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. + Count *int32 `json:"count,omitempty"` + // DNSPrefix - DNS prefix to be used to create the FQDN for the master pool. + DNSPrefix *string `json:"dnsPrefix,omitempty"` + // VMSize - Size of agent VMs. Possible values include: 'VMSizeTypesStandardA1', 'VMSizeTypesStandardA10', 'VMSizeTypesStandardA11', 'VMSizeTypesStandardA1V2', 'VMSizeTypesStandardA2', 'VMSizeTypesStandardA2V2', 'VMSizeTypesStandardA2mV2', 'VMSizeTypesStandardA3', 'VMSizeTypesStandardA4', 'VMSizeTypesStandardA4V2', 'VMSizeTypesStandardA4mV2', 'VMSizeTypesStandardA5', 'VMSizeTypesStandardA6', 'VMSizeTypesStandardA7', 'VMSizeTypesStandardA8', 'VMSizeTypesStandardA8V2', 'VMSizeTypesStandardA8mV2', 'VMSizeTypesStandardA9', 'VMSizeTypesStandardB2ms', 'VMSizeTypesStandardB2s', 'VMSizeTypesStandardB4ms', 'VMSizeTypesStandardB8ms', 'VMSizeTypesStandardD1', 'VMSizeTypesStandardD11', 'VMSizeTypesStandardD11V2', 'VMSizeTypesStandardD11V2Promo', 'VMSizeTypesStandardD12', 'VMSizeTypesStandardD12V2', 'VMSizeTypesStandardD12V2Promo', 'VMSizeTypesStandardD13', 'VMSizeTypesStandardD13V2', 'VMSizeTypesStandardD13V2Promo', 'VMSizeTypesStandardD14', 'VMSizeTypesStandardD14V2', 'VMSizeTypesStandardD14V2Promo', 'VMSizeTypesStandardD15V2', 'VMSizeTypesStandardD16V3', 'VMSizeTypesStandardD16sV3', 'VMSizeTypesStandardD1V2', 'VMSizeTypesStandardD2', 'VMSizeTypesStandardD2V2', 'VMSizeTypesStandardD2V2Promo', 'VMSizeTypesStandardD2V3', 'VMSizeTypesStandardD2sV3', 'VMSizeTypesStandardD3', 'VMSizeTypesStandardD32V3', 'VMSizeTypesStandardD32sV3', 'VMSizeTypesStandardD3V2', 'VMSizeTypesStandardD3V2Promo', 'VMSizeTypesStandardD4', 'VMSizeTypesStandardD4V2', 'VMSizeTypesStandardD4V2Promo', 'VMSizeTypesStandardD4V3', 'VMSizeTypesStandardD4sV3', 'VMSizeTypesStandardD5V2', 'VMSizeTypesStandardD5V2Promo', 'VMSizeTypesStandardD64V3', 'VMSizeTypesStandardD64sV3', 'VMSizeTypesStandardD8V3', 'VMSizeTypesStandardD8sV3', 'VMSizeTypesStandardDS1', 'VMSizeTypesStandardDS11', 'VMSizeTypesStandardDS11V2', 'VMSizeTypesStandardDS11V2Promo', 'VMSizeTypesStandardDS12', 'VMSizeTypesStandardDS12V2', 'VMSizeTypesStandardDS12V2Promo', 'VMSizeTypesStandardDS13', 'VMSizeTypesStandardDS132V2', 'VMSizeTypesStandardDS134V2', 'VMSizeTypesStandardDS13V2', 'VMSizeTypesStandardDS13V2Promo', 'VMSizeTypesStandardDS14', 'VMSizeTypesStandardDS144V2', 'VMSizeTypesStandardDS148V2', 'VMSizeTypesStandardDS14V2', 'VMSizeTypesStandardDS14V2Promo', 'VMSizeTypesStandardDS15V2', 'VMSizeTypesStandardDS1V2', 'VMSizeTypesStandardDS2', 'VMSizeTypesStandardDS2V2', 'VMSizeTypesStandardDS2V2Promo', 'VMSizeTypesStandardDS3', 'VMSizeTypesStandardDS3V2', 'VMSizeTypesStandardDS3V2Promo', 'VMSizeTypesStandardDS4', 'VMSizeTypesStandardDS4V2', 'VMSizeTypesStandardDS4V2Promo', 'VMSizeTypesStandardDS5V2', 'VMSizeTypesStandardDS5V2Promo', 'VMSizeTypesStandardE16V3', 'VMSizeTypesStandardE16sV3', 'VMSizeTypesStandardE2V3', 'VMSizeTypesStandardE2sV3', 'VMSizeTypesStandardE3216sV3', 'VMSizeTypesStandardE328sV3', 'VMSizeTypesStandardE32V3', 'VMSizeTypesStandardE32sV3', 'VMSizeTypesStandardE4V3', 'VMSizeTypesStandardE4sV3', 'VMSizeTypesStandardE6416sV3', 'VMSizeTypesStandardE6432sV3', 'VMSizeTypesStandardE64V3', 'VMSizeTypesStandardE64sV3', 'VMSizeTypesStandardE8V3', 'VMSizeTypesStandardE8sV3', 'VMSizeTypesStandardF1', 'VMSizeTypesStandardF16', 'VMSizeTypesStandardF16s', 'VMSizeTypesStandardF16sV2', 'VMSizeTypesStandardF1s', 'VMSizeTypesStandardF2', 'VMSizeTypesStandardF2s', 'VMSizeTypesStandardF2sV2', 'VMSizeTypesStandardF32sV2', 'VMSizeTypesStandardF4', 'VMSizeTypesStandardF4s', 'VMSizeTypesStandardF4sV2', 'VMSizeTypesStandardF64sV2', 'VMSizeTypesStandardF72sV2', 'VMSizeTypesStandardF8', 'VMSizeTypesStandardF8s', 'VMSizeTypesStandardF8sV2', 'VMSizeTypesStandardG1', 'VMSizeTypesStandardG2', 'VMSizeTypesStandardG3', 'VMSizeTypesStandardG4', 'VMSizeTypesStandardG5', 'VMSizeTypesStandardGS1', 'VMSizeTypesStandardGS2', 'VMSizeTypesStandardGS3', 'VMSizeTypesStandardGS4', 'VMSizeTypesStandardGS44', 'VMSizeTypesStandardGS48', 'VMSizeTypesStandardGS5', 'VMSizeTypesStandardGS516', 'VMSizeTypesStandardGS58', 'VMSizeTypesStandardH16', 'VMSizeTypesStandardH16m', 'VMSizeTypesStandardH16mr', 'VMSizeTypesStandardH16r', 'VMSizeTypesStandardH8', 'VMSizeTypesStandardH8m', 'VMSizeTypesStandardL16s', 'VMSizeTypesStandardL32s', 'VMSizeTypesStandardL4s', 'VMSizeTypesStandardL8s', 'VMSizeTypesStandardM12832ms', 'VMSizeTypesStandardM12864ms', 'VMSizeTypesStandardM128ms', 'VMSizeTypesStandardM128s', 'VMSizeTypesStandardM6416ms', 'VMSizeTypesStandardM6432ms', 'VMSizeTypesStandardM64ms', 'VMSizeTypesStandardM64s', 'VMSizeTypesStandardNC12', 'VMSizeTypesStandardNC12sV2', 'VMSizeTypesStandardNC12sV3', 'VMSizeTypesStandardNC24', 'VMSizeTypesStandardNC24r', 'VMSizeTypesStandardNC24rsV2', 'VMSizeTypesStandardNC24rsV3', 'VMSizeTypesStandardNC24sV2', 'VMSizeTypesStandardNC24sV3', 'VMSizeTypesStandardNC6', 'VMSizeTypesStandardNC6sV2', 'VMSizeTypesStandardNC6sV3', 'VMSizeTypesStandardND12s', 'VMSizeTypesStandardND24rs', 'VMSizeTypesStandardND24s', 'VMSizeTypesStandardND6s', 'VMSizeTypesStandardNV12', 'VMSizeTypesStandardNV24', 'VMSizeTypesStandardNV6' + VMSize VMSizeTypes `json:"vmSize,omitempty"` + // OsDiskSizeGB - OS Disk Size in GB to be used to specify the disk size for every machine in this master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. + OsDiskSizeGB *int32 `json:"osDiskSizeGB,omitempty"` + // VnetSubnetID - VNet SubnetID specifies the VNet's subnet identifier. + VnetSubnetID *string `json:"vnetSubnetID,omitempty"` + // FirstConsecutiveStaticIP - FirstConsecutiveStaticIP used to specify the first static ip of masters. + FirstConsecutiveStaticIP *string `json:"firstConsecutiveStaticIP,omitempty"` + // StorageProfile - Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. Possible values include: 'StorageAccount', 'ManagedDisks' + StorageProfile StorageProfileTypes `json:"storageProfile,omitempty"` + // Fqdn - READ-ONLY; FQDN for the master pool. + Fqdn *string `json:"fqdn,omitempty"` +} + +// NetworkProfile represents the OpenShift networking configuration +type NetworkProfile struct { + // VnetCidr - CIDR for the OpenShift Vnet. + VnetCidr *string `json:"vnetCidr,omitempty"` + // PeerVnetID - CIDR of the Vnet to peer. + PeerVnetID *string `json:"peerVnetId,omitempty"` + // VnetID - ID of the Vnet created for OSA cluster. + VnetID *string `json:"vnetId,omitempty"` +} + +// NetworkProfileType profile of network configuration. +type NetworkProfileType struct { + // NetworkPlugin - Network plugin used for building Kubernetes network. Possible values include: 'Azure', 'Kubenet' + NetworkPlugin NetworkPlugin `json:"networkPlugin,omitempty"` + // NetworkPolicy - Network policy used for building Kubernetes network. Possible values include: 'NetworkPolicyCalico', 'NetworkPolicyAzure' + NetworkPolicy NetworkPolicy `json:"networkPolicy,omitempty"` + // PodCidr - A CIDR notation IP range from which to assign pod IPs when kubenet is used. + PodCidr *string `json:"podCidr,omitempty"` + // ServiceCidr - A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. + ServiceCidr *string `json:"serviceCidr,omitempty"` + // DNSServiceIP - An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. + DNSServiceIP *string `json:"dnsServiceIP,omitempty"` + // DockerBridgeCidr - A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes service address range. + DockerBridgeCidr *string `json:"dockerBridgeCidr,omitempty"` + // LoadBalancerSku - The load balancer sku for the managed cluster. Possible values include: 'Standard', 'Basic' + LoadBalancerSku LoadBalancerSku `json:"loadBalancerSku,omitempty"` + // LoadBalancerProfile - Profile of the cluster load balancer. + LoadBalancerProfile *ManagedClusterLoadBalancerProfile `json:"loadBalancerProfile,omitempty"` +} + +// OpenShiftManagedCluster openShift Managed cluster. +type OpenShiftManagedCluster struct { + autorest.Response `json:"-"` + // Plan - Define the resource plan as required by ARM for billing purposes + Plan *PurchasePlan `json:"plan,omitempty"` + // OpenShiftManagedClusterProperties - Properties of a OpenShift managed cluster. + *OpenShiftManagedClusterProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for OpenShiftManagedCluster. +func (osmc OpenShiftManagedCluster) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if osmc.Plan != nil { + objectMap["plan"] = osmc.Plan + } + if osmc.OpenShiftManagedClusterProperties != nil { + objectMap["properties"] = osmc.OpenShiftManagedClusterProperties + } + if osmc.Location != nil { + objectMap["location"] = osmc.Location + } + if osmc.Tags != nil { + objectMap["tags"] = osmc.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for OpenShiftManagedCluster struct. +func (osmc *OpenShiftManagedCluster) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "plan": + if v != nil { + var plan PurchasePlan + err = json.Unmarshal(*v, &plan) + if err != nil { + return err + } + osmc.Plan = &plan + } + case "properties": + if v != nil { + var openShiftManagedClusterProperties OpenShiftManagedClusterProperties + err = json.Unmarshal(*v, &openShiftManagedClusterProperties) + if err != nil { + return err + } + osmc.OpenShiftManagedClusterProperties = &openShiftManagedClusterProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + osmc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + osmc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + osmc.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + osmc.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + osmc.Tags = tags + } + } + } + + return nil +} + +// OpenShiftManagedClusterAADIdentityProvider defines the Identity provider for MS AAD. +type OpenShiftManagedClusterAADIdentityProvider struct { + // ClientID - The clientId password associated with the provider. + ClientID *string `json:"clientId,omitempty"` + // Secret - The secret password associated with the provider. + Secret *string `json:"secret,omitempty"` + // TenantID - The tenantId associated with the provider. + TenantID *string `json:"tenantId,omitempty"` + // CustomerAdminGroupID - The groupId to be granted cluster admin role. + CustomerAdminGroupID *string `json:"customerAdminGroupId,omitempty"` + // Kind - Possible values include: 'KindOpenShiftManagedClusterBaseIdentityProvider', 'KindAADIdentityProvider' + Kind Kind `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for OpenShiftManagedClusterAADIdentityProvider. +func (osmcaip OpenShiftManagedClusterAADIdentityProvider) MarshalJSON() ([]byte, error) { + osmcaip.Kind = KindAADIdentityProvider + objectMap := make(map[string]interface{}) + if osmcaip.ClientID != nil { + objectMap["clientId"] = osmcaip.ClientID + } + if osmcaip.Secret != nil { + objectMap["secret"] = osmcaip.Secret + } + if osmcaip.TenantID != nil { + objectMap["tenantId"] = osmcaip.TenantID + } + if osmcaip.CustomerAdminGroupID != nil { + objectMap["customerAdminGroupId"] = osmcaip.CustomerAdminGroupID + } + if osmcaip.Kind != "" { + objectMap["kind"] = osmcaip.Kind + } + return json.Marshal(objectMap) +} + +// AsOpenShiftManagedClusterAADIdentityProvider is the BasicOpenShiftManagedClusterBaseIdentityProvider implementation for OpenShiftManagedClusterAADIdentityProvider. +func (osmcaip OpenShiftManagedClusterAADIdentityProvider) AsOpenShiftManagedClusterAADIdentityProvider() (*OpenShiftManagedClusterAADIdentityProvider, bool) { + return &osmcaip, true +} + +// AsOpenShiftManagedClusterBaseIdentityProvider is the BasicOpenShiftManagedClusterBaseIdentityProvider implementation for OpenShiftManagedClusterAADIdentityProvider. +func (osmcaip OpenShiftManagedClusterAADIdentityProvider) AsOpenShiftManagedClusterBaseIdentityProvider() (*OpenShiftManagedClusterBaseIdentityProvider, bool) { + return nil, false +} + +// AsBasicOpenShiftManagedClusterBaseIdentityProvider is the BasicOpenShiftManagedClusterBaseIdentityProvider implementation for OpenShiftManagedClusterAADIdentityProvider. +func (osmcaip OpenShiftManagedClusterAADIdentityProvider) AsBasicOpenShiftManagedClusterBaseIdentityProvider() (BasicOpenShiftManagedClusterBaseIdentityProvider, bool) { + return &osmcaip, true +} + +// OpenShiftManagedClusterAgentPoolProfile defines the configuration of the OpenShift cluster VMs. +type OpenShiftManagedClusterAgentPoolProfile struct { + // Name - Unique name of the pool profile in the context of the subscription and resource group. + Name *string `json:"name,omitempty"` + // Count - Number of agents (VMs) to host docker containers. + Count *int32 `json:"count,omitempty"` + // VMSize - Size of agent VMs. Possible values include: 'StandardD2sV3', 'StandardD4sV3', 'StandardD8sV3', 'StandardD16sV3', 'StandardD32sV3', 'StandardD64sV3', 'StandardDS4V2', 'StandardDS5V2', 'StandardF8sV2', 'StandardF16sV2', 'StandardF32sV2', 'StandardF64sV2', 'StandardF72sV2', 'StandardF8s', 'StandardF16s', 'StandardE4sV3', 'StandardE8sV3', 'StandardE16sV3', 'StandardE20sV3', 'StandardE32sV3', 'StandardE64sV3', 'StandardGS2', 'StandardGS3', 'StandardGS4', 'StandardGS5', 'StandardDS12V2', 'StandardDS13V2', 'StandardDS14V2', 'StandardDS15V2', 'StandardL4s', 'StandardL8s', 'StandardL16s', 'StandardL32s' + VMSize OpenShiftContainerServiceVMSize `json:"vmSize,omitempty"` + // SubnetCidr - Subnet CIDR for the peering. + SubnetCidr *string `json:"subnetCidr,omitempty"` + // OsType - OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: 'Linux', 'Windows' + OsType OSType `json:"osType,omitempty"` + // Role - Define the role of the AgentPoolProfile. Possible values include: 'Compute', 'Infra' + Role OpenShiftAgentPoolProfileRole `json:"role,omitempty"` +} + +// OpenShiftManagedClusterAuthProfile defines all possible authentication profiles for the OpenShift +// cluster. +type OpenShiftManagedClusterAuthProfile struct { + // IdentityProviders - Type of authentication profile to use. + IdentityProviders *[]OpenShiftManagedClusterIdentityProvider `json:"identityProviders,omitempty"` +} + +// BasicOpenShiftManagedClusterBaseIdentityProvider structure for any Identity provider. +type BasicOpenShiftManagedClusterBaseIdentityProvider interface { + AsOpenShiftManagedClusterAADIdentityProvider() (*OpenShiftManagedClusterAADIdentityProvider, bool) + AsOpenShiftManagedClusterBaseIdentityProvider() (*OpenShiftManagedClusterBaseIdentityProvider, bool) +} + +// OpenShiftManagedClusterBaseIdentityProvider structure for any Identity provider. +type OpenShiftManagedClusterBaseIdentityProvider struct { + // Kind - Possible values include: 'KindOpenShiftManagedClusterBaseIdentityProvider', 'KindAADIdentityProvider' + Kind Kind `json:"kind,omitempty"` +} + +func unmarshalBasicOpenShiftManagedClusterBaseIdentityProvider(body []byte) (BasicOpenShiftManagedClusterBaseIdentityProvider, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["kind"] { + case string(KindAADIdentityProvider): + var osmcaip OpenShiftManagedClusterAADIdentityProvider + err := json.Unmarshal(body, &osmcaip) + return osmcaip, err + default: + var osmcbip OpenShiftManagedClusterBaseIdentityProvider + err := json.Unmarshal(body, &osmcbip) + return osmcbip, err + } +} +func unmarshalBasicOpenShiftManagedClusterBaseIdentityProviderArray(body []byte) ([]BasicOpenShiftManagedClusterBaseIdentityProvider, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + osmcbipArray := make([]BasicOpenShiftManagedClusterBaseIdentityProvider, len(rawMessages)) + + for index, rawMessage := range rawMessages { + osmcbip, err := unmarshalBasicOpenShiftManagedClusterBaseIdentityProvider(*rawMessage) + if err != nil { + return nil, err + } + osmcbipArray[index] = osmcbip + } + return osmcbipArray, nil +} + +// MarshalJSON is the custom marshaler for OpenShiftManagedClusterBaseIdentityProvider. +func (osmcbip OpenShiftManagedClusterBaseIdentityProvider) MarshalJSON() ([]byte, error) { + osmcbip.Kind = KindOpenShiftManagedClusterBaseIdentityProvider + objectMap := make(map[string]interface{}) + if osmcbip.Kind != "" { + objectMap["kind"] = osmcbip.Kind + } + return json.Marshal(objectMap) +} + +// AsOpenShiftManagedClusterAADIdentityProvider is the BasicOpenShiftManagedClusterBaseIdentityProvider implementation for OpenShiftManagedClusterBaseIdentityProvider. +func (osmcbip OpenShiftManagedClusterBaseIdentityProvider) AsOpenShiftManagedClusterAADIdentityProvider() (*OpenShiftManagedClusterAADIdentityProvider, bool) { + return nil, false +} + +// AsOpenShiftManagedClusterBaseIdentityProvider is the BasicOpenShiftManagedClusterBaseIdentityProvider implementation for OpenShiftManagedClusterBaseIdentityProvider. +func (osmcbip OpenShiftManagedClusterBaseIdentityProvider) AsOpenShiftManagedClusterBaseIdentityProvider() (*OpenShiftManagedClusterBaseIdentityProvider, bool) { + return &osmcbip, true +} + +// AsBasicOpenShiftManagedClusterBaseIdentityProvider is the BasicOpenShiftManagedClusterBaseIdentityProvider implementation for OpenShiftManagedClusterBaseIdentityProvider. +func (osmcbip OpenShiftManagedClusterBaseIdentityProvider) AsBasicOpenShiftManagedClusterBaseIdentityProvider() (BasicOpenShiftManagedClusterBaseIdentityProvider, bool) { + return &osmcbip, true +} + +// OpenShiftManagedClusterIdentityProvider defines the configuration of the identity providers to be used +// in the OpenShift cluster. +type OpenShiftManagedClusterIdentityProvider struct { + // Name - Name of the provider. + Name *string `json:"name,omitempty"` + // Provider - Configuration of the provider. + Provider BasicOpenShiftManagedClusterBaseIdentityProvider `json:"provider,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for OpenShiftManagedClusterIdentityProvider struct. +func (osmcip *OpenShiftManagedClusterIdentityProvider) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + osmcip.Name = &name + } + case "provider": + if v != nil { + provider, err := unmarshalBasicOpenShiftManagedClusterBaseIdentityProvider(*v) + if err != nil { + return err + } + osmcip.Provider = provider + } + } + } + + return nil +} + +// OpenShiftManagedClusterListResult the response from the List OpenShift Managed Clusters operation. +type OpenShiftManagedClusterListResult struct { + autorest.Response `json:"-"` + // Value - The list of OpenShift managed clusters. + Value *[]OpenShiftManagedCluster `json:"value,omitempty"` + // NextLink - READ-ONLY; The URL to get the next set of OpenShift managed cluster results. + NextLink *string `json:"nextLink,omitempty"` +} + +// OpenShiftManagedClusterListResultIterator provides access to a complete listing of +// OpenShiftManagedCluster values. +type OpenShiftManagedClusterListResultIterator struct { + i int + page OpenShiftManagedClusterListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *OpenShiftManagedClusterListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftManagedClusterListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *OpenShiftManagedClusterListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OpenShiftManagedClusterListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter OpenShiftManagedClusterListResultIterator) Response() OpenShiftManagedClusterListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter OpenShiftManagedClusterListResultIterator) Value() OpenShiftManagedCluster { + if !iter.page.NotDone() { + return OpenShiftManagedCluster{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OpenShiftManagedClusterListResultIterator type. +func NewOpenShiftManagedClusterListResultIterator(page OpenShiftManagedClusterListResultPage) OpenShiftManagedClusterListResultIterator { + return OpenShiftManagedClusterListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (osmclr OpenShiftManagedClusterListResult) IsEmpty() bool { + return osmclr.Value == nil || len(*osmclr.Value) == 0 +} + +// openShiftManagedClusterListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (osmclr OpenShiftManagedClusterListResult) openShiftManagedClusterListResultPreparer(ctx context.Context) (*http.Request, error) { + if osmclr.NextLink == nil || len(to.String(osmclr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(osmclr.NextLink))) +} + +// OpenShiftManagedClusterListResultPage contains a page of OpenShiftManagedCluster values. +type OpenShiftManagedClusterListResultPage struct { + fn func(context.Context, OpenShiftManagedClusterListResult) (OpenShiftManagedClusterListResult, error) + osmclr OpenShiftManagedClusterListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *OpenShiftManagedClusterListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftManagedClusterListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.osmclr) + if err != nil { + return err + } + page.osmclr = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *OpenShiftManagedClusterListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OpenShiftManagedClusterListResultPage) NotDone() bool { + return !page.osmclr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OpenShiftManagedClusterListResultPage) Response() OpenShiftManagedClusterListResult { + return page.osmclr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OpenShiftManagedClusterListResultPage) Values() []OpenShiftManagedCluster { + if page.osmclr.IsEmpty() { + return nil + } + return *page.osmclr.Value +} + +// Creates a new instance of the OpenShiftManagedClusterListResultPage type. +func NewOpenShiftManagedClusterListResultPage(getNextPage func(context.Context, OpenShiftManagedClusterListResult) (OpenShiftManagedClusterListResult, error)) OpenShiftManagedClusterListResultPage { + return OpenShiftManagedClusterListResultPage{fn: getNextPage} +} + +// OpenShiftManagedClusterMasterPoolProfile openShiftManagedClusterMaterPoolProfile contains configuration +// for OpenShift master VMs. +type OpenShiftManagedClusterMasterPoolProfile struct { + // Name - Unique name of the master pool profile in the context of the subscription and resource group. + Name *string `json:"name,omitempty"` + // Count - Number of masters (VMs) to host docker containers. The default value is 3. + Count *int32 `json:"count,omitempty"` + // VMSize - Size of agent VMs. Possible values include: 'StandardD2sV3', 'StandardD4sV3', 'StandardD8sV3', 'StandardD16sV3', 'StandardD32sV3', 'StandardD64sV3', 'StandardDS4V2', 'StandardDS5V2', 'StandardF8sV2', 'StandardF16sV2', 'StandardF32sV2', 'StandardF64sV2', 'StandardF72sV2', 'StandardF8s', 'StandardF16s', 'StandardE4sV3', 'StandardE8sV3', 'StandardE16sV3', 'StandardE20sV3', 'StandardE32sV3', 'StandardE64sV3', 'StandardGS2', 'StandardGS3', 'StandardGS4', 'StandardGS5', 'StandardDS12V2', 'StandardDS13V2', 'StandardDS14V2', 'StandardDS15V2', 'StandardL4s', 'StandardL8s', 'StandardL16s', 'StandardL32s' + VMSize OpenShiftContainerServiceVMSize `json:"vmSize,omitempty"` + // SubnetCidr - Subnet CIDR for the peering. + SubnetCidr *string `json:"subnetCidr,omitempty"` + // OsType - OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: 'Linux', 'Windows' + OsType OSType `json:"osType,omitempty"` +} + +// OpenShiftManagedClusterMonitorProfile defines the configuration for Log Analytics integration. +type OpenShiftManagedClusterMonitorProfile struct { + // WorkspaceResourceID - Azure Resource Manager Resource ID for the Log Analytics workspace to integrate with. + WorkspaceResourceID *string `json:"workspaceResourceID,omitempty"` + // Enabled - If the Log analytics integration should be turned on or off + Enabled *bool `json:"enabled,omitempty"` +} + +// OpenShiftManagedClusterProperties properties of the OpenShift managed cluster. +type OpenShiftManagedClusterProperties struct { + // ProvisioningState - READ-ONLY; The current deployment or provisioning state, which only appears in the response. + ProvisioningState *string `json:"provisioningState,omitempty"` + // OpenShiftVersion - Version of OpenShift specified when creating the cluster. + OpenShiftVersion *string `json:"openShiftVersion,omitempty"` + // ClusterVersion - READ-ONLY; Version of OpenShift specified when creating the cluster. + ClusterVersion *string `json:"clusterVersion,omitempty"` + // PublicHostname - READ-ONLY; Service generated FQDN for OpenShift API server. + PublicHostname *string `json:"publicHostname,omitempty"` + // Fqdn - READ-ONLY; Service generated FQDN for OpenShift API server loadbalancer internal hostname. + Fqdn *string `json:"fqdn,omitempty"` + // NetworkProfile - Configuration for OpenShift networking. + NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` + // RouterProfiles - Configuration for OpenShift router(s). + RouterProfiles *[]OpenShiftRouterProfile `json:"routerProfiles,omitempty"` + // MasterPoolProfile - Configuration for OpenShift master VMs. + MasterPoolProfile *OpenShiftManagedClusterMasterPoolProfile `json:"masterPoolProfile,omitempty"` + // AgentPoolProfiles - Configuration of OpenShift cluster VMs. + AgentPoolProfiles *[]OpenShiftManagedClusterAgentPoolProfile `json:"agentPoolProfiles,omitempty"` + // AuthProfile - Configures OpenShift authentication. + AuthProfile *OpenShiftManagedClusterAuthProfile `json:"authProfile,omitempty"` + // MonitorProfile - Configures Log Analytics integration. + MonitorProfile *OpenShiftManagedClusterMonitorProfile `json:"monitorProfile,omitempty"` +} + +// OpenShiftManagedClustersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type OpenShiftManagedClustersCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *OpenShiftManagedClustersCreateOrUpdateFuture) Result(client OpenShiftManagedClustersClient) (osmc OpenShiftManagedCluster, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerservice.OpenShiftManagedClustersCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if osmc.Response.Response, err = future.GetResult(sender); err == nil && osmc.Response.Response.StatusCode != http.StatusNoContent { + osmc, err = client.CreateOrUpdateResponder(osmc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersCreateOrUpdateFuture", "Result", osmc.Response.Response, "Failure responding to request") + } + } + return +} + +// OpenShiftManagedClustersDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type OpenShiftManagedClustersDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *OpenShiftManagedClustersDeleteFuture) Result(client OpenShiftManagedClustersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerservice.OpenShiftManagedClustersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// OpenShiftManagedClustersUpdateTagsFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type OpenShiftManagedClustersUpdateTagsFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *OpenShiftManagedClustersUpdateTagsFuture) Result(client OpenShiftManagedClustersClient) (osmc OpenShiftManagedCluster, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersUpdateTagsFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerservice.OpenShiftManagedClustersUpdateTagsFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if osmc.Response.Response, err = future.GetResult(sender); err == nil && osmc.Response.Response.StatusCode != http.StatusNoContent { + osmc, err = client.UpdateTagsResponder(osmc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersUpdateTagsFuture", "Result", osmc.Response.Response, "Failure responding to request") + } + } + return +} + +// OpenShiftRouterProfile represents an OpenShift router +type OpenShiftRouterProfile struct { + // Name - Name of the router profile. + Name *string `json:"name,omitempty"` + // PublicSubdomain - READ-ONLY; DNS subdomain for OpenShift router. + PublicSubdomain *string `json:"publicSubdomain,omitempty"` + // Fqdn - READ-ONLY; Auto-allocated FQDN for the OpenShift router. + Fqdn *string `json:"fqdn,omitempty"` +} + +// OperationListResult the List Compute Operation operation response. +type OperationListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of compute operations + Value *[]OperationValue `json:"value,omitempty"` +} + +// OperationValue describes the properties of a Compute Operation value. +type OperationValue struct { + // Origin - READ-ONLY; The origin of the compute operation. + Origin *string `json:"origin,omitempty"` + // Name - READ-ONLY; The name of the compute operation. + Name *string `json:"name,omitempty"` + // OperationValueDisplay - Describes the properties of a Compute Operation Value Display. + *OperationValueDisplay `json:"display,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationValue. +func (ov OperationValue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ov.OperationValueDisplay != nil { + objectMap["display"] = ov.OperationValueDisplay + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for OperationValue struct. +func (ov *OperationValue) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "origin": + if v != nil { + var origin string + err = json.Unmarshal(*v, &origin) + if err != nil { + return err + } + ov.Origin = &origin + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ov.Name = &name + } + case "display": + if v != nil { + var operationValueDisplay OperationValueDisplay + err = json.Unmarshal(*v, &operationValueDisplay) + if err != nil { + return err + } + ov.OperationValueDisplay = &operationValueDisplay + } + } + } + + return nil +} + +// OperationValueDisplay describes the properties of a Compute Operation Value Display. +type OperationValueDisplay struct { + // Operation - READ-ONLY; The display name of the compute operation. + Operation *string `json:"operation,omitempty"` + // Resource - READ-ONLY; The display name of the resource the operation applies to. + Resource *string `json:"resource,omitempty"` + // Description - READ-ONLY; The description of the operation. + Description *string `json:"description,omitempty"` + // Provider - READ-ONLY; The resource provider for the operation. + Provider *string `json:"provider,omitempty"` +} + +// OrchestratorProfile contains information about orchestrator. +type OrchestratorProfile struct { + // OrchestratorType - Orchestrator type. + OrchestratorType *string `json:"orchestratorType,omitempty"` + // OrchestratorVersion - Orchestrator version (major, minor, patch). + OrchestratorVersion *string `json:"orchestratorVersion,omitempty"` + // IsPreview - Whether Kubernetes version is currently in preview. + IsPreview *bool `json:"isPreview,omitempty"` +} + +// OrchestratorProfileType profile for the container service orchestrator. +type OrchestratorProfileType struct { + // OrchestratorType - The orchestrator to use to manage container service cluster resources. Valid values are Kubernetes, Swarm, DCOS, DockerCE and Custom. Possible values include: 'Kubernetes', 'Swarm', 'DCOS', 'DockerCE', 'Custom' + OrchestratorType OrchestratorTypes `json:"orchestratorType,omitempty"` + // OrchestratorVersion - The version of the orchestrator to use. You can specify the major.minor.patch part of the actual version.For example, you can specify version as "1.6.11". + OrchestratorVersion *string `json:"orchestratorVersion,omitempty"` +} + +// OrchestratorVersionProfile the profile of an orchestrator and its available versions. +type OrchestratorVersionProfile struct { + // OrchestratorType - Orchestrator type. + OrchestratorType *string `json:"orchestratorType,omitempty"` + // OrchestratorVersion - Orchestrator version (major, minor, patch). + OrchestratorVersion *string `json:"orchestratorVersion,omitempty"` + // Default - Installed by default if version is not specified. + Default *bool `json:"default,omitempty"` + // IsPreview - Whether Kubernetes version is currently in preview. + IsPreview *bool `json:"isPreview,omitempty"` + // Upgrades - The list of available upgrade versions. + Upgrades *[]OrchestratorProfile `json:"upgrades,omitempty"` +} + +// OrchestratorVersionProfileListResult the list of versions for supported orchestrators. +type OrchestratorVersionProfileListResult struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Id of the orchestrator version profile list result. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the orchestrator version profile list result. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the orchestrator version profile list result. + Type *string `json:"type,omitempty"` + // OrchestratorVersionProfileProperties - The properties of an orchestrator version profile. + *OrchestratorVersionProfileProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for OrchestratorVersionProfileListResult. +func (ovplr OrchestratorVersionProfileListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ovplr.OrchestratorVersionProfileProperties != nil { + objectMap["properties"] = ovplr.OrchestratorVersionProfileProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for OrchestratorVersionProfileListResult struct. +func (ovplr *OrchestratorVersionProfileListResult) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ovplr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ovplr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ovplr.Type = &typeVar + } + case "properties": + if v != nil { + var orchestratorVersionProfileProperties OrchestratorVersionProfileProperties + err = json.Unmarshal(*v, &orchestratorVersionProfileProperties) + if err != nil { + return err + } + ovplr.OrchestratorVersionProfileProperties = &orchestratorVersionProfileProperties + } + } + } + + return nil +} + +// OrchestratorVersionProfileProperties the properties of an orchestrator version profile. +type OrchestratorVersionProfileProperties struct { + // Orchestrators - List of orchestrator version profiles. + Orchestrators *[]OrchestratorVersionProfile `json:"orchestrators,omitempty"` +} + +// Properties properties of the container service. +type Properties struct { + // ProvisioningState - READ-ONLY; The current deployment or provisioning state, which only appears in the response. + ProvisioningState *string `json:"provisioningState,omitempty"` + // OrchestratorProfile - Profile for the container service orchestrator. + OrchestratorProfile *OrchestratorProfileType `json:"orchestratorProfile,omitempty"` + // CustomProfile - Properties to configure a custom container service cluster. + CustomProfile *CustomProfile `json:"customProfile,omitempty"` + // ServicePrincipalProfile - Information about a service principal identity for the cluster to use for manipulating Azure APIs. Exact one of secret or keyVaultSecretRef need to be specified. + ServicePrincipalProfile *ServicePrincipalProfile `json:"servicePrincipalProfile,omitempty"` + // MasterProfile - Profile for the container service master. + MasterProfile *MasterProfile `json:"masterProfile,omitempty"` + // AgentPoolProfiles - Properties of the agent pool. + AgentPoolProfiles *[]AgentPoolProfile `json:"agentPoolProfiles,omitempty"` + // WindowsProfile - Profile for Windows VMs in the container service cluster. + WindowsProfile *WindowsProfile `json:"windowsProfile,omitempty"` + // LinuxProfile - Profile for Linux VMs in the container service cluster. + LinuxProfile *LinuxProfile `json:"linuxProfile,omitempty"` + // DiagnosticsProfile - Profile for diagnostics in the container service cluster. + DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` +} + +// PurchasePlan used for establishing the purchase context of any 3rd Party artifact through MarketPlace. +type PurchasePlan struct { + // Name - The plan ID. + Name *string `json:"name,omitempty"` + // Product - Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. + Product *string `json:"product,omitempty"` + // PromotionCode - The promotion code. + PromotionCode *string `json:"promotionCode,omitempty"` + // Publisher - The plan ID. + Publisher *string `json:"publisher,omitempty"` +} + +// Resource the Resource model definition. +type Resource struct { + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + return json.Marshal(objectMap) +} + +// ResourceReference a reference to an Azure resource. +type ResourceReference struct { + // ID - The fully qualified Azure resource id. + ID *string `json:"id,omitempty"` +} + +// ServicePrincipalProfile information about a service principal identity for the cluster to use for +// manipulating Azure APIs. Either secret or keyVaultSecretRef must be specified. +type ServicePrincipalProfile struct { + // ClientID - The ID for the service principal. + ClientID *string `json:"clientId,omitempty"` + // Secret - The secret password associated with the service principal in plain text. + Secret *string `json:"secret,omitempty"` + // KeyVaultSecretRef - Reference to a secret stored in Azure Key Vault. + KeyVaultSecretRef *KeyVaultSecretRef `json:"keyVaultSecretRef,omitempty"` +} + +// SSHConfiguration SSH configuration for Linux-based VMs running on Azure. +type SSHConfiguration struct { + // PublicKeys - The list of SSH public keys used to authenticate with Linux-based VMs. Only expect one key specified. + PublicKeys *[]SSHPublicKey `json:"publicKeys,omitempty"` +} + +// SSHPublicKey contains information about SSH certificate public key data. +type SSHPublicKey struct { + // KeyData - Certificate public key used to authenticate with VMs through SSH. The certificate must be in PEM format with or without headers. + KeyData *string `json:"keyData,omitempty"` +} + +// SubResource reference to another subresource. +type SubResource struct { + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` +} + +// TagsObject tags object for patch operations. +type TagsObject struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for TagsObject. +func (toVar TagsObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if toVar.Tags != nil { + objectMap["tags"] = toVar.Tags + } + return json.Marshal(objectMap) +} + +// VMDiagnostics profile for diagnostics on the container service VMs. +type VMDiagnostics struct { + // Enabled - Whether the VM diagnostic agent is provisioned on the VM. + Enabled *bool `json:"enabled,omitempty"` + // StorageURI - READ-ONLY; The URI of the storage account where diagnostics are stored. + StorageURI *string `json:"storageUri,omitempty"` +} + +// WindowsProfile profile for Windows VMs in the container service cluster. +type WindowsProfile struct { + // AdminUsername - The administrator username to use for Windows VMs. + AdminUsername *string `json:"adminUsername,omitempty"` + // AdminPassword - The administrator password to use for Windows VMs. + AdminPassword *string `json:"adminPassword,omitempty"` +} diff --git a/services/preview/containerservice/mgmt/2019-09-30-preview/containerservice/openshiftmanagedclusters.go b/services/preview/containerservice/mgmt/2019-09-30-preview/containerservice/openshiftmanagedclusters.go new file mode 100644 index 000000000000..4208abf82afd --- /dev/null +++ b/services/preview/containerservice/mgmt/2019-09-30-preview/containerservice/openshiftmanagedclusters.go @@ -0,0 +1,617 @@ +package containerservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// OpenShiftManagedClustersClient is the the Container Service Client. +type OpenShiftManagedClustersClient struct { + BaseClient +} + +// NewOpenShiftManagedClustersClient creates an instance of the OpenShiftManagedClustersClient client. +func NewOpenShiftManagedClustersClient(subscriptionID string) OpenShiftManagedClustersClient { + return NewOpenShiftManagedClustersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOpenShiftManagedClustersClientWithBaseURI creates an instance of the OpenShiftManagedClustersClient client. +func NewOpenShiftManagedClustersClientWithBaseURI(baseURI string, subscriptionID string) OpenShiftManagedClustersClient { + return OpenShiftManagedClustersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a OpenShift managed cluster with the specified configuration for agents and +// OpenShift version. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the OpenShift managed cluster resource. +// parameters - parameters supplied to the Create or Update an OpenShift Managed Cluster operation. +func (client OpenShiftManagedClustersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters OpenShiftManagedCluster) (result OpenShiftManagedClustersCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftManagedClustersClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.OpenShiftManagedClusterProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.OpenShiftManagedClusterProperties.OpenShiftVersion", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.OpenShiftManagedClusterProperties.MasterPoolProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.OpenShiftManagedClusterProperties.MasterPoolProfile.Count", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("containerservice.OpenShiftManagedClustersClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client OpenShiftManagedClustersClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, parameters OpenShiftManagedCluster) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-30-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.ContainerService/openShiftManagedClusters/{resourceName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client OpenShiftManagedClustersClient) CreateOrUpdateSender(req *http.Request) (future OpenShiftManagedClustersCreateOrUpdateFuture, err error) { + 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 OpenShiftManagedClustersClient) CreateOrUpdateResponder(resp *http.Response) (result OpenShiftManagedCluster, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the OpenShift managed cluster with a specified resource group and name. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the OpenShift managed cluster resource. +func (client OpenShiftManagedClustersClient) Delete(ctx context.Context, resourceGroupName string, resourceName string) (result OpenShiftManagedClustersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftManagedClustersClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.OpenShiftManagedClustersClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client OpenShiftManagedClustersClient) DeletePreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-30-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.ContainerService/openShiftManagedClusters/{resourceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client OpenShiftManagedClustersClient) DeleteSender(req *http.Request) (future OpenShiftManagedClustersDeleteFuture, err error) { + 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 OpenShiftManagedClustersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of the managed OpenShift cluster with a specified resource group and name. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the OpenShift managed cluster resource. +func (client OpenShiftManagedClustersClient) Get(ctx context.Context, resourceGroupName string, resourceName string) (result OpenShiftManagedCluster, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftManagedClustersClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.OpenShiftManagedClustersClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client OpenShiftManagedClustersClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-30-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.ContainerService/openShiftManagedClusters/{resourceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client OpenShiftManagedClustersClient) GetSender(req *http.Request) (*http.Response, error) { + 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 OpenShiftManagedClustersClient) GetResponder(resp *http.Response) (result OpenShiftManagedCluster, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets a list of OpenShift managed clusters in the specified subscription. The operation returns properties of +// each OpenShift managed cluster. +func (client OpenShiftManagedClustersClient) List(ctx context.Context) (result OpenShiftManagedClusterListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftManagedClustersClient.List") + defer func() { + sc := -1 + if result.osmclr.Response.Response != nil { + sc = result.osmclr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.osmclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "List", resp, "Failure sending request") + return + } + + result.osmclr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client OpenShiftManagedClustersClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-30-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/openShiftManagedClusters", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OpenShiftManagedClustersClient) ListSender(req *http.Request) (*http.Response, error) { + 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 OpenShiftManagedClustersClient) ListResponder(resp *http.Response) (result OpenShiftManagedClusterListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client OpenShiftManagedClustersClient) listNextResults(ctx context.Context, lastResults OpenShiftManagedClusterListResult) (result OpenShiftManagedClusterListResult, err error) { + req, err := lastResults.openShiftManagedClusterListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client OpenShiftManagedClustersClient) ListComplete(ctx context.Context) (result OpenShiftManagedClusterListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftManagedClustersClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByResourceGroup lists OpenShift managed clusters in the specified subscription and resource group. The operation +// returns properties of each OpenShift managed cluster. +// Parameters: +// resourceGroupName - the name of the resource group. +func (client OpenShiftManagedClustersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result OpenShiftManagedClusterListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftManagedClustersClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.osmclr.Response.Response != nil { + sc = result.osmclr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.OpenShiftManagedClustersClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.osmclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.osmclr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client OpenShiftManagedClustersClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-30-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.ContainerService/openShiftManagedClusters", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client OpenShiftManagedClustersClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + 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 OpenShiftManagedClustersClient) ListByResourceGroupResponder(resp *http.Response) (result OpenShiftManagedClusterListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client OpenShiftManagedClustersClient) listByResourceGroupNextResults(ctx context.Context, lastResults OpenShiftManagedClusterListResult) (result OpenShiftManagedClusterListResult, err error) { + req, err := lastResults.openShiftManagedClusterListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client OpenShiftManagedClustersClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result OpenShiftManagedClusterListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftManagedClustersClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// UpdateTags updates an OpenShift managed cluster with the specified tags. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the OpenShift managed cluster resource. +// parameters - parameters supplied to the Update OpenShift Managed Cluster Tags operation. +func (client OpenShiftManagedClustersClient) UpdateTags(ctx context.Context, resourceGroupName string, resourceName string, parameters TagsObject) (result OpenShiftManagedClustersUpdateTagsFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftManagedClustersClient.UpdateTags") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.OpenShiftManagedClustersClient", "UpdateTags", err.Error()) + } + + req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, resourceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "UpdateTags", nil, "Failure preparing request") + return + } + + result, err = client.UpdateTagsSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "UpdateTags", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateTagsPreparer prepares the UpdateTags request. +func (client OpenShiftManagedClustersClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, resourceName string, parameters TagsObject) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-30-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.ContainerService/openShiftManagedClusters/{resourceName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateTagsSender sends the UpdateTags request. The method will close the +// http.Response Body if it receives an error. +func (client OpenShiftManagedClustersClient) UpdateTagsSender(req *http.Request) (future OpenShiftManagedClustersUpdateTagsFuture, err error) { + 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 +} + +// UpdateTagsResponder handles the response to the UpdateTags request. The method always +// closes the http.Response Body. +func (client OpenShiftManagedClustersClient) UpdateTagsResponder(resp *http.Response) (result OpenShiftManagedCluster, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/containerservice/mgmt/2019-09-30-preview/containerservice/operations.go b/services/preview/containerservice/mgmt/2019-09-30-preview/containerservice/operations.go new file mode 100644 index 000000000000..a61a628971f6 --- /dev/null +++ b/services/preview/containerservice/mgmt/2019-09-30-preview/containerservice/operations.go @@ -0,0 +1,109 @@ +package containerservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// OperationsClient is the the Container Service Client. +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client. +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List gets a list of compute operations. +func (client OperationsClient) List(ctx context.Context) (result OperationListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.OperationsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OperationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.ContainerService/operations"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + 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 +} diff --git a/services/preview/containerservice/mgmt/2019-09-30-preview/containerservice/version.go b/services/preview/containerservice/mgmt/2019-09-30-preview/containerservice/version.go new file mode 100644 index 000000000000..b33e1e056038 --- /dev/null +++ b/services/preview/containerservice/mgmt/2019-09-30-preview/containerservice/version.go @@ -0,0 +1,30 @@ +package containerservice + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + version.Number + " containerservice/2019-09-30-preview" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/preview/costmanagement/mgmt/2019-10-01/costmanagement/client.go b/services/preview/costmanagement/mgmt/2019-10-01/costmanagement/client.go new file mode 100644 index 000000000000..4b604b5ee4e5 --- /dev/null +++ b/services/preview/costmanagement/mgmt/2019-10-01/costmanagement/client.go @@ -0,0 +1,51 @@ +// Package costmanagement implements the Azure ARM Costmanagement service API version 2019-10-01. +// +// +package costmanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the 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 Costmanagement + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Costmanagement. +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/costmanagement/mgmt/2019-10-01/costmanagement/costmanagementapi/interfaces.go b/services/preview/costmanagement/mgmt/2019-10-01/costmanagement/costmanagementapi/interfaces.go new file mode 100644 index 000000000000..255d2b21caf9 --- /dev/null +++ b/services/preview/costmanagement/mgmt/2019-10-01/costmanagement/costmanagementapi/interfaces.go @@ -0,0 +1,57 @@ +package costmanagementapi + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by 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/costmanagement/mgmt/2019-10-01/costmanagement" + "github.com/Azure/go-autorest/autorest" +) + +// DimensionsClientAPI contains the set of methods on the DimensionsClient type. +type DimensionsClientAPI interface { + ListByScope(ctx context.Context, scope string, filter string, expand string, skiptoken string, top *int32) (result costmanagement.DimensionsListResult, err error) +} + +var _ DimensionsClientAPI = (*costmanagement.DimensionsClient)(nil) + +// QueryClientAPI contains the set of methods on the QueryClient type. +type QueryClientAPI interface { + UsageByScope(ctx context.Context, scope string, parameters costmanagement.QueryDefinition) (result costmanagement.QueryResult, err error) +} + +var _ QueryClientAPI = (*costmanagement.QueryClient)(nil) + +// ExportsClientAPI contains the set of methods on the ExportsClient type. +type ExportsClientAPI interface { + CreateOrUpdate(ctx context.Context, scope string, exportName string, parameters costmanagement.Export) (result costmanagement.Export, err error) + Delete(ctx context.Context, scope string, exportName string) (result autorest.Response, err error) + Execute(ctx context.Context, scope string, exportName string) (result autorest.Response, err error) + Get(ctx context.Context, scope string, exportName string) (result costmanagement.Export, err error) + GetExecutionHistory(ctx context.Context, scope string, exportName string) (result costmanagement.ExportExecutionListResult, err error) + List(ctx context.Context, scope string) (result costmanagement.ExportListResult, err error) +} + +var _ ExportsClientAPI = (*costmanagement.ExportsClient)(nil) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result costmanagement.OperationListResultPage, err error) +} + +var _ OperationsClientAPI = (*costmanagement.OperationsClient)(nil) diff --git a/services/preview/costmanagement/mgmt/2019-10-01/costmanagement/dimensions.go b/services/preview/costmanagement/mgmt/2019-10-01/costmanagement/dimensions.go new file mode 100644 index 000000000000..16a57299d662 --- /dev/null +++ b/services/preview/costmanagement/mgmt/2019-10-01/costmanagement/dimensions.go @@ -0,0 +1,158 @@ +package costmanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the 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" +) + +// DimensionsClient is the client for the Dimensions methods of the Costmanagement service. +type DimensionsClient struct { + BaseClient +} + +// NewDimensionsClient creates an instance of the DimensionsClient client. +func NewDimensionsClient(subscriptionID string) DimensionsClient { + return NewDimensionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDimensionsClientWithBaseURI creates an instance of the DimensionsClient client. +func NewDimensionsClientWithBaseURI(baseURI string, subscriptionID string) DimensionsClient { + return DimensionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListByScope lists the dimensions by the defined scope. +// Parameters: +// scope - the scope associated with dimension operations. This includes '/subscriptions/{subscriptionId}/' for +// subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup +// scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department +// scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' +// for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for +// Management Group scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for +// billingProfile scope, +// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' +// for invoiceSection scope, and +// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for +// partners. +// filter - may be used to filter dimensions by properties/category, properties/usageStart, +// properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'. +// expand - may be used to expand the properties/data within a dimension category. By default, data is not +// included when listing dimensions. +// 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. +// top - may be used to limit the number of results to the most recent N dimension data. +func (client DimensionsClient) ListByScope(ctx context.Context, scope string, filter string, expand string, skiptoken string, top *int32) (result DimensionsListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DimensionsClient.ListByScope") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, + {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("costmanagement.DimensionsClient", "ListByScope", err.Error()) + } + + req, err := client.ListByScopePreparer(ctx, scope, filter, expand, skiptoken, top) + if err != nil { + err = autorest.NewErrorWithError(err, "costmanagement.DimensionsClient", "ListByScope", nil, "Failure preparing request") + return + } + + resp, err := client.ListByScopeSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "costmanagement.DimensionsClient", "ListByScope", resp, "Failure sending request") + return + } + + result, err = client.ListByScopeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "costmanagement.DimensionsClient", "ListByScope", resp, "Failure responding to request") + } + + return +} + +// ListByScopePreparer prepares the ListByScope request. +func (client DimensionsClient) ListByScopePreparer(ctx context.Context, scope string, filter string, expand string, skiptoken string, top *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "scope": scope, + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + if len(skiptoken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skiptoken) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{scope}/providers/Microsoft.CostManagement/dimensions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByScopeSender sends the ListByScope request. The method will close the +// http.Response Body if it receives an error. +func (client DimensionsClient) ListByScopeSender(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...) +} + +// ListByScopeResponder handles the response to the ListByScope request. The method always +// closes the http.Response Body. +func (client DimensionsClient) ListByScopeResponder(resp *http.Response) (result DimensionsListResult, 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/costmanagement/mgmt/2019-10-01/costmanagement/exports.go b/services/preview/costmanagement/mgmt/2019-10-01/costmanagement/exports.go new file mode 100644 index 000000000000..9042b6af21cc --- /dev/null +++ b/services/preview/costmanagement/mgmt/2019-10-01/costmanagement/exports.go @@ -0,0 +1,593 @@ +package costmanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the 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" +) + +// ExportsClient is the client for the Exports methods of the Costmanagement service. +type ExportsClient struct { + BaseClient +} + +// NewExportsClient creates an instance of the ExportsClient client. +func NewExportsClient(subscriptionID string) ExportsClient { + return NewExportsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewExportsClientWithBaseURI creates an instance of the ExportsClient client. +func NewExportsClientWithBaseURI(baseURI string, subscriptionID string) ExportsClient { + return ExportsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate the operation to create or update a export. Update operation requires latest eTag to be set in the +// request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag. +// Parameters: +// scope - the scope associated with query and export operations. This includes +// '/subscriptions/{subscriptionId}/' for subscription scope, +// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department +// scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' +// for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for +// Management Group scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for +// billingProfile scope, +// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' +// for invoiceSection scope, and +// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for +// partners. +// exportName - export Name. +// parameters - parameters supplied to the CreateOrUpdate Export operation. +func (client ExportsClient) CreateOrUpdate(ctx context.Context, scope string, exportName string, parameters Export) (result Export, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExportsClient.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: parameters, + Constraints: []validation.Constraint{{Target: "parameters.ExportProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ExportProperties.Schedule", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ExportProperties.Schedule.RecurrencePeriod", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ExportProperties.Schedule.RecurrencePeriod.From", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + }}}}}); err != nil { + return result, validation.NewError("costmanagement.ExportsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, scope, exportName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ExportsClient) CreateOrUpdatePreparer(ctx context.Context, scope string, exportName string, parameters Export) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "exportName": autorest.Encode("path", exportName), + "scope": scope, + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{scope}/providers/Microsoft.CostManagement/exports/{exportName}", 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 ExportsClient) 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 ExportsClient) CreateOrUpdateResponder(resp *http.Response) (result Export, 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 the operation to delete a export. +// Parameters: +// scope - the scope associated with query and export operations. This includes +// '/subscriptions/{subscriptionId}/' for subscription scope, +// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department +// scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' +// for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for +// Management Group scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for +// billingProfile scope, +// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' +// for invoiceSection scope, and +// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for +// partners. +// exportName - export Name. +func (client ExportsClient) Delete(ctx context.Context, scope string, exportName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExportsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, scope, exportName) + if err != nil { + err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ExportsClient) DeletePreparer(ctx context.Context, scope string, exportName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "exportName": autorest.Encode("path", exportName), + "scope": scope, + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{scope}/providers/Microsoft.CostManagement/exports/{exportName}", 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 ExportsClient) 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 ExportsClient) 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 +} + +// Execute the operation to execute a export. +// Parameters: +// scope - the scope associated with query and export operations. This includes +// '/subscriptions/{subscriptionId}/' for subscription scope, +// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department +// scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' +// for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for +// Management Group scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for +// billingProfile scope, +// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' +// for invoiceSection scope, and +// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for +// partners. +// exportName - export Name. +func (client ExportsClient) Execute(ctx context.Context, scope string, exportName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExportsClient.Execute") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ExecutePreparer(ctx, scope, exportName) + if err != nil { + err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "Execute", nil, "Failure preparing request") + return + } + + resp, err := client.ExecuteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "Execute", resp, "Failure sending request") + return + } + + result, err = client.ExecuteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "Execute", resp, "Failure responding to request") + } + + return +} + +// ExecutePreparer prepares the Execute request. +func (client ExportsClient) ExecutePreparer(ctx context.Context, scope string, exportName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "exportName": autorest.Encode("path", exportName), + "scope": scope, + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/run", pathParameters), + autorest.WithQueryParameters(queryParameters)) + 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 ExportsClient) ExecuteSender(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...) +} + +// ExecuteResponder handles the response to the Execute request. The method always +// closes the http.Response Body. +func (client ExportsClient) ExecuteResponder(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 the operation to get the export for the defined scope by export name. +// Parameters: +// scope - the scope associated with query and export operations. This includes +// '/subscriptions/{subscriptionId}/' for subscription scope, +// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department +// scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' +// for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for +// Management Group scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for +// billingProfile scope, +// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' +// for invoiceSection scope, and +// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for +// partners. +// exportName - export Name. +func (client ExportsClient) Get(ctx context.Context, scope string, exportName string) (result Export, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExportsClient.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, exportName) + if err != nil { + err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ExportsClient) GetPreparer(ctx context.Context, scope string, exportName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "exportName": autorest.Encode("path", exportName), + "scope": scope, + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{scope}/providers/Microsoft.CostManagement/exports/{exportName}", 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 ExportsClient) 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 ExportsClient) GetResponder(resp *http.Response) (result Export, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetExecutionHistory the operation to get the execution history of an export for the defined scope by export name. +// Parameters: +// scope - the scope associated with query and export operations. This includes +// '/subscriptions/{subscriptionId}/' for subscription scope, +// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department +// scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' +// for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for +// Management Group scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for +// billingProfile scope, +// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' +// for invoiceSection scope, and +// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for +// partners. +// exportName - export Name. +func (client ExportsClient) GetExecutionHistory(ctx context.Context, scope string, exportName string) (result ExportExecutionListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExportsClient.GetExecutionHistory") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetExecutionHistoryPreparer(ctx, scope, exportName) + if err != nil { + err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "GetExecutionHistory", nil, "Failure preparing request") + return + } + + resp, err := client.GetExecutionHistorySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "GetExecutionHistory", resp, "Failure sending request") + return + } + + result, err = client.GetExecutionHistoryResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "GetExecutionHistory", resp, "Failure responding to request") + } + + return +} + +// GetExecutionHistoryPreparer prepares the GetExecutionHistory request. +func (client ExportsClient) GetExecutionHistoryPreparer(ctx context.Context, scope string, exportName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "exportName": autorest.Encode("path", exportName), + "scope": scope, + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/runHistory", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetExecutionHistorySender sends the GetExecutionHistory request. The method will close the +// http.Response Body if it receives an error. +func (client ExportsClient) GetExecutionHistorySender(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...) +} + +// GetExecutionHistoryResponder handles the response to the GetExecutionHistory request. The method always +// closes the http.Response Body. +func (client ExportsClient) GetExecutionHistoryResponder(resp *http.Response) (result ExportExecutionListResult, 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 the operation to list all exports at the given scope. +// Parameters: +// scope - the scope associated with query and export operations. This includes +// '/subscriptions/{subscriptionId}/' for subscription scope, +// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department +// scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' +// for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for +// Management Group scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for +// billingProfile scope, +// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' +// for invoiceSection scope, and +// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for +// partners. +func (client ExportsClient) List(ctx context.Context, scope string) (result ExportListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExportsClient.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, scope) + if err != nil { + err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ExportsClient) ListPreparer(ctx context.Context, scope string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "scope": scope, + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{scope}/providers/Microsoft.CostManagement/exports", 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 ExportsClient) 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 ExportsClient) ListResponder(resp *http.Response) (result ExportListResult, 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/costmanagement/mgmt/2019-10-01/costmanagement/models.go b/services/preview/costmanagement/mgmt/2019-10-01/costmanagement/models.go new file mode 100644 index 000000000000..a59a87209b6a --- /dev/null +++ b/services/preview/costmanagement/mgmt/2019-10-01/costmanagement/models.go @@ -0,0 +1,966 @@ +package costmanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/costmanagement/mgmt/2019-10-01/costmanagement" + +// ExecutionStatus enumerates the values for execution status. +type ExecutionStatus string + +const ( + // Completed ... + Completed ExecutionStatus = "Completed" + // DataNotAvailable ... + DataNotAvailable ExecutionStatus = "DataNotAvailable" + // Failed ... + Failed ExecutionStatus = "Failed" + // InProgress ... + InProgress ExecutionStatus = "InProgress" + // NewDataNotAvailable ... + NewDataNotAvailable ExecutionStatus = "NewDataNotAvailable" + // Queued ... + Queued ExecutionStatus = "Queued" + // Timeout ... + Timeout ExecutionStatus = "Timeout" +) + +// PossibleExecutionStatusValues returns an array of possible values for the ExecutionStatus const type. +func PossibleExecutionStatusValues() []ExecutionStatus { + return []ExecutionStatus{Completed, DataNotAvailable, Failed, InProgress, NewDataNotAvailable, Queued, Timeout} +} + +// ExecutionType enumerates the values for execution type. +type ExecutionType string + +const ( + // OnDemand ... + OnDemand ExecutionType = "OnDemand" + // Scheduled ... + Scheduled ExecutionType = "Scheduled" +) + +// PossibleExecutionTypeValues returns an array of possible values for the ExecutionType const type. +func PossibleExecutionTypeValues() []ExecutionType { + return []ExecutionType{OnDemand, Scheduled} +} + +// FormatType enumerates the values for format type. +type FormatType string + +const ( + // Csv ... + Csv FormatType = "Csv" +) + +// PossibleFormatTypeValues returns an array of possible values for the FormatType const type. +func PossibleFormatTypeValues() []FormatType { + return []FormatType{Csv} +} + +// GranularityType enumerates the values for granularity type. +type GranularityType string + +const ( + // Daily ... + Daily GranularityType = "Daily" + // Hourly ... + Hourly GranularityType = "Hourly" +) + +// PossibleGranularityTypeValues returns an array of possible values for the GranularityType const type. +func PossibleGranularityTypeValues() []GranularityType { + return []GranularityType{Daily, Hourly} +} + +// QueryColumnType enumerates the values for query column type. +type QueryColumnType string + +const ( + // QueryColumnTypeDimension ... + QueryColumnTypeDimension QueryColumnType = "Dimension" + // QueryColumnTypeTag ... + QueryColumnTypeTag QueryColumnType = "Tag" +) + +// PossibleQueryColumnTypeValues returns an array of possible values for the QueryColumnType const type. +func PossibleQueryColumnTypeValues() []QueryColumnType { + return []QueryColumnType{QueryColumnTypeDimension, QueryColumnTypeTag} +} + +// RecurrenceType enumerates the values for recurrence type. +type RecurrenceType string + +const ( + // RecurrenceTypeAnnually ... + RecurrenceTypeAnnually RecurrenceType = "Annually" + // RecurrenceTypeDaily ... + RecurrenceTypeDaily RecurrenceType = "Daily" + // RecurrenceTypeMonthly ... + RecurrenceTypeMonthly RecurrenceType = "Monthly" + // RecurrenceTypeWeekly ... + RecurrenceTypeWeekly RecurrenceType = "Weekly" +) + +// PossibleRecurrenceTypeValues returns an array of possible values for the RecurrenceType const type. +func PossibleRecurrenceTypeValues() []RecurrenceType { + return []RecurrenceType{RecurrenceTypeAnnually, RecurrenceTypeDaily, RecurrenceTypeMonthly, RecurrenceTypeWeekly} +} + +// SortDirection enumerates the values for sort direction. +type SortDirection string + +const ( + // Ascending ... + Ascending SortDirection = "Ascending" + // Descending ... + Descending SortDirection = "Descending" +) + +// PossibleSortDirectionValues returns an array of possible values for the SortDirection const type. +func PossibleSortDirectionValues() []SortDirection { + return []SortDirection{Ascending, Descending} +} + +// StatusType enumerates the values for status type. +type StatusType string + +const ( + // Active ... + Active StatusType = "Active" + // Inactive ... + Inactive StatusType = "Inactive" +) + +// PossibleStatusTypeValues returns an array of possible values for the StatusType const type. +func PossibleStatusTypeValues() []StatusType { + return []StatusType{Active, Inactive} +} + +// TimeframeType enumerates the values for timeframe type. +type TimeframeType string + +const ( + // Custom ... + Custom TimeframeType = "Custom" + // MonthToDate ... + MonthToDate TimeframeType = "MonthToDate" + // TheLastMonth ... + TheLastMonth TimeframeType = "TheLastMonth" + // TheLastWeek ... + TheLastWeek TimeframeType = "TheLastWeek" + // TheLastYear ... + TheLastYear TimeframeType = "TheLastYear" + // WeekToDate ... + WeekToDate TimeframeType = "WeekToDate" + // YearToDate ... + YearToDate TimeframeType = "YearToDate" +) + +// PossibleTimeframeTypeValues returns an array of possible values for the TimeframeType const type. +func PossibleTimeframeTypeValues() []TimeframeType { + return []TimeframeType{Custom, MonthToDate, TheLastMonth, TheLastWeek, TheLastYear, WeekToDate, YearToDate} +} + +// CommonExportProperties the common properties of the export. +type CommonExportProperties struct { + // Format - The format of the export being delivered. Possible values include: 'Csv' + Format FormatType `json:"format,omitempty"` + // DeliveryInfo - Has delivery information for the export. + DeliveryInfo *ExportDeliveryInfo `json:"deliveryInfo,omitempty"` + // Definition - Has definition for the export. + Definition *QueryDefinition `json:"definition,omitempty"` +} + +// Dimension ... +type Dimension struct { + *DimensionProperties `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"` + // Tags - READ-ONLY; Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Dimension. +func (d Dimension) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if d.DimensionProperties != nil { + objectMap["properties"] = d.DimensionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Dimension struct. +func (d *Dimension) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var dimensionProperties DimensionProperties + err = json.Unmarshal(*v, &dimensionProperties) + if err != nil { + return err + } + d.DimensionProperties = &dimensionProperties + } + 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 "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + d.Tags = tags + } + } + } + + return nil +} + +// DimensionProperties ... +type DimensionProperties struct { + // Description - READ-ONLY; Dimension description. + Description *string `json:"description,omitempty"` + // FilterEnabled - READ-ONLY; Filter enabled. + FilterEnabled *bool `json:"filterEnabled,omitempty"` + // GroupingEnabled - READ-ONLY; Grouping enabled. + GroupingEnabled *bool `json:"groupingEnabled,omitempty"` + Data *[]string `json:"data,omitempty"` + // Total - READ-ONLY; Total number of data for the dimension. + Total *int32 `json:"total,omitempty"` + // Category - READ-ONLY; Dimension category. + Category *string `json:"category,omitempty"` + // UsageStart - READ-ONLY; Usage start. + UsageStart *date.Time `json:"usageStart,omitempty"` + // UsageEnd - READ-ONLY; Usage end. + UsageEnd *date.Time `json:"usageEnd,omitempty"` + // NextLink - READ-ONLY; The link (url) to the next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// DimensionsListResult result of listing dimensions. It contains a list of available dimensions. +type DimensionsListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of dimensions. + Value *[]Dimension `json:"value,omitempty"` +} + +// ErrorDetails the details of the error. +type ErrorDetails struct { + // Code - READ-ONLY; Error code. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; Error message indicating why the operation failed. + Message *string `json:"message,omitempty"` +} + +// 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"` +} + +// Export a export resource. +type Export struct { + autorest.Response `json:"-"` + *ExportProperties `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"` + // Tags - READ-ONLY; Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Export. +func (e Export) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if e.ExportProperties != nil { + objectMap["properties"] = e.ExportProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Export struct. +func (e *Export) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var exportProperties ExportProperties + err = json.Unmarshal(*v, &exportProperties) + if err != nil { + return err + } + e.ExportProperties = &exportProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + e.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + e.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + e.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + e.Tags = tags + } + } + } + + return nil +} + +// ExportDeliveryDestination the destination information for the delivery of the export. +type ExportDeliveryDestination struct { + // ResourceID - The resource id of the storage account where exports will be delivered. + ResourceID *string `json:"resourceId,omitempty"` + // Container - The name of the container where exports will be uploaded. + Container *string `json:"container,omitempty"` + // RootFolderPath - The name of the directory where exports will be uploaded. + RootFolderPath *string `json:"rootFolderPath,omitempty"` +} + +// ExportDeliveryInfo the delivery information associated with a export. +type ExportDeliveryInfo struct { + // Destination - Has destination for the export being delivered. + Destination *ExportDeliveryDestination `json:"destination,omitempty"` +} + +// ExportExecution a export execution. +type ExportExecution struct { + *ExportExecutionProperties `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"` + // Tags - READ-ONLY; Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ExportExecution. +func (ee ExportExecution) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ee.ExportExecutionProperties != nil { + objectMap["properties"] = ee.ExportExecutionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ExportExecution struct. +func (ee *ExportExecution) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var exportExecutionProperties ExportExecutionProperties + err = json.Unmarshal(*v, &exportExecutionProperties) + if err != nil { + return err + } + ee.ExportExecutionProperties = &exportExecutionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ee.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ee.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ee.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ee.Tags = tags + } + } + } + + return nil +} + +// ExportExecutionListResult result of listing exports execution history of a export by name +type ExportExecutionListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of export executions. + Value *[]ExportExecution `json:"value,omitempty"` +} + +// ExportExecutionProperties the properties of the export execution. +type ExportExecutionProperties struct { + // ExecutionType - The type of the export execution. Possible values include: 'OnDemand', 'Scheduled' + ExecutionType ExecutionType `json:"executionType,omitempty"` + // Status - The status of the export execution. Possible values include: 'Queued', 'InProgress', 'Completed', 'Failed', 'Timeout', 'NewDataNotAvailable', 'DataNotAvailable' + Status ExecutionStatus `json:"status,omitempty"` + // SubmittedBy - The identifier for the entity that executed the export. For OnDemand executions, it is the email id. For Scheduled executions, it is the constant value - System. + SubmittedBy *string `json:"submittedBy,omitempty"` + // SubmittedTime - The time when export was queued to be executed. + SubmittedTime *date.Time `json:"submittedTime,omitempty"` + // ProcessingStartTime - The time when export was picked up to be executed. + ProcessingStartTime *date.Time `json:"processingStartTime,omitempty"` + // ProcessingEndTime - The time when export execution finished. + ProcessingEndTime *date.Time `json:"processingEndTime,omitempty"` + // FileName - The name of the file export got written to. + FileName *string `json:"fileName,omitempty"` + RunSettings *CommonExportProperties `json:"runSettings,omitempty"` +} + +// ExportListResult result of listing exports. It contains a list of available exports in the scope +// provided. +type ExportListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of exports. + Value *[]Export `json:"value,omitempty"` +} + +// ExportProperties the properties of the export. +type ExportProperties struct { + // Schedule - Has schedule information for the export. + Schedule *ExportSchedule `json:"schedule,omitempty"` + // Format - The format of the export being delivered. Possible values include: 'Csv' + Format FormatType `json:"format,omitempty"` + // DeliveryInfo - Has delivery information for the export. + DeliveryInfo *ExportDeliveryInfo `json:"deliveryInfo,omitempty"` + // Definition - Has definition for the export. + Definition *QueryDefinition `json:"definition,omitempty"` +} + +// ExportRecurrencePeriod the start and end date for recurrence schedule. +type ExportRecurrencePeriod struct { + // From - The start date of recurrence. + From *date.Time `json:"from,omitempty"` + // To - The end date of recurrence. + To *date.Time `json:"to,omitempty"` +} + +// ExportSchedule the schedule associated with a export. +type ExportSchedule struct { + // Status - The status of the schedule. Whether active or not. If inactive, the export's scheduled execution is paused. Possible values include: 'Active', 'Inactive' + Status StatusType `json:"status,omitempty"` + // Recurrence - The schedule recurrence. Possible values include: 'RecurrenceTypeDaily', 'RecurrenceTypeWeekly', 'RecurrenceTypeMonthly', 'RecurrenceTypeAnnually' + Recurrence RecurrenceType `json:"recurrence,omitempty"` + // RecurrencePeriod - Has start and end date of the recurrence. The start date must be in future. If present, the end date must be greater than start date. + RecurrencePeriod *ExportRecurrencePeriod `json:"recurrencePeriod,omitempty"` +} + +// Operation a Cost management REST API operation. +type Operation struct { + // Name - READ-ONLY; Operation name: {provider}/{resource}/{operation}. + Name *string `json:"name,omitempty"` + // Display - The object that represents the operation. + Display *OperationDisplay `json:"display,omitempty"` +} + +// OperationDisplay the object that represents the operation. +type OperationDisplay struct { + // Provider - READ-ONLY; Service provider: Microsoft.CostManagement. + Provider *string `json:"provider,omitempty"` + // Resource - READ-ONLY; Resource on which the operation is performed: Dimensions, Query. + Resource *string `json:"resource,omitempty"` + // Operation - READ-ONLY; Operation type: Read, write, delete, etc. + Operation *string `json:"operation,omitempty"` +} + +// OperationListResult result of listing cost management operations. It contains a list of operations and a +// URL link to get the next set of results. +type OperationListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of cost management operations supported by the Microsoft.CostManagement resource provider. + Value *[]Operation `json:"value,omitempty"` + // NextLink - READ-ONLY; URL to get the next set of operation list results if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// OperationListResultIterator provides access to a complete listing of Operation values. +type OperationListResultIterator struct { + i int + page OperationListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *OperationListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OperationListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter OperationListResultIterator) Response() OperationListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter OperationListResultIterator) Value() Operation { + if !iter.page.NotDone() { + return Operation{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OperationListResultIterator type. +func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { + return OperationListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (olr OperationListResult) IsEmpty() bool { + return olr.Value == nil || len(*olr.Value) == 0 +} + +// operationListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { + if olr.NextLink == nil || len(to.String(olr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(olr.NextLink))) +} + +// OperationListResultPage contains a page of Operation values. +type OperationListResultPage struct { + fn func(context.Context, OperationListResult) (OperationListResult, error) + olr OperationListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.olr) + if err != nil { + return err + } + page.olr = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *OperationListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OperationListResultPage) NotDone() bool { + return !page.olr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OperationListResultPage) Response() OperationListResult { + return page.olr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OperationListResultPage) Values() []Operation { + if page.olr.IsEmpty() { + return nil + } + return *page.olr.Value +} + +// Creates a new instance of the OperationListResultPage type. +func NewOperationListResultPage(getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { + return OperationListResultPage{fn: getNextPage} +} + +// QueryAggregation the aggregation expression to be used in the query. +type QueryAggregation struct { + // Name - The name of the column to aggregate. + Name *string `json:"name,omitempty"` + // Function - The name of the aggregation function to use. + Function *string `json:"function,omitempty"` +} + +// QueryColumn ... +type QueryColumn struct { + // Name - The name of column. + Name *string `json:"name,omitempty"` + // Type - The type of column. + Type *string `json:"type,omitempty"` +} + +// QueryComparisonExpression the comparison expression to be used in the query. +type QueryComparisonExpression struct { + // Name - The name of the column to use in comparison. + Name *string `json:"name,omitempty"` + // Operator - The operator to use for comparison. + Operator *string `json:"operator,omitempty"` + // Values - Array of values to use for comparison + Values *[]string `json:"values,omitempty"` +} + +// QueryDataset the definition of data present in the query. +type QueryDataset struct { + // Granularity - The granularity of rows in the query. Possible values include: 'Daily', 'Hourly' + Granularity GranularityType `json:"granularity,omitempty"` + // Configuration - Has configuration information for the data in the export. The configuration will be ignored if aggregation and grouping are provided. + Configuration *QueryDatasetConfiguration `json:"configuration,omitempty"` + // Aggregation - Dictionary of aggregation expression to use in the query. The key of each item in the dictionary is the alias for the aggregated column. Query can have up to 2 aggregation clauses. + Aggregation map[string]*QueryAggregation `json:"aggregation"` + // Grouping - Array of group by expression to use in the query. Query can have up to 2 group by clauses. + Grouping *[]QueryGrouping `json:"grouping,omitempty"` + // Sorting - Array of sorting by columns in query. + Sorting *[]QuerySortingConfiguration `json:"sorting,omitempty"` + // Filter - Has filter expression to use in the query. + Filter *QueryFilter `json:"filter,omitempty"` +} + +// MarshalJSON is the custom marshaler for QueryDataset. +func (qd QueryDataset) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if qd.Granularity != "" { + objectMap["granularity"] = qd.Granularity + } + if qd.Configuration != nil { + objectMap["configuration"] = qd.Configuration + } + if qd.Aggregation != nil { + objectMap["aggregation"] = qd.Aggregation + } + if qd.Grouping != nil { + objectMap["grouping"] = qd.Grouping + } + if qd.Sorting != nil { + objectMap["sorting"] = qd.Sorting + } + if qd.Filter != nil { + objectMap["filter"] = qd.Filter + } + return json.Marshal(objectMap) +} + +// QueryDatasetConfiguration the configuration of dataset in the query. +type QueryDatasetConfiguration struct { + // Columns - Array of column names to be included in the query. Any valid query column name is allowed. If not provided, then query includes all columns. + Columns *[]string `json:"columns,omitempty"` +} + +// QueryDefinition the definition of a query. +type QueryDefinition struct { + // Type - The type of the query. + Type *string `json:"type,omitempty"` + // Timeframe - The time frame for pulling data for the query. If custom, then a specific time period must be provided. Possible values include: 'WeekToDate', 'MonthToDate', 'YearToDate', 'TheLastWeek', 'TheLastMonth', 'TheLastYear', 'Custom' + Timeframe TimeframeType `json:"timeframe,omitempty"` + // TimePeriod - Has time period for pulling data for the query. + TimePeriod *QueryTimePeriod `json:"timePeriod,omitempty"` + // Dataset - Has definition for data in this query. + Dataset *QueryDataset `json:"dataset,omitempty"` +} + +// QueryFilter the filter expression to be used in the export. +type QueryFilter struct { + // And - The logical "AND" expression. Must have at least 2 items. + And *[]QueryFilter `json:"and,omitempty"` + // Or - The logical "OR" expression. Must have at least 2 items. + Or *[]QueryFilter `json:"or,omitempty"` + // Not - The logical "NOT" expression. + Not *QueryFilter `json:"not,omitempty"` + // Dimension - Has comparison expression for a dimension + Dimension *QueryComparisonExpression `json:"dimension,omitempty"` + // Tag - Has comparison expression for a tag + Tag *QueryComparisonExpression `json:"tag,omitempty"` +} + +// QueryGrouping the group by expression to be used in the query. +type QueryGrouping struct { + // Type - Has type of the column to group. Possible values include: 'QueryColumnTypeTag', 'QueryColumnTypeDimension' + Type QueryColumnType `json:"type,omitempty"` + // Name - The name of the column to group. + Name *string `json:"name,omitempty"` +} + +// QueryProperties ... +type QueryProperties struct { + // NextLink - The link (url) to the next page of results. + NextLink *string `json:"nextLink,omitempty"` + // Columns - Array of columns + Columns *[]QueryColumn `json:"columns,omitempty"` + // Rows - Array of rows + Rows *[][]interface{} `json:"rows,omitempty"` +} + +// QueryResult result of query. It contains all columns listed under groupings and aggregation. +type QueryResult struct { + autorest.Response `json:"-"` + *QueryProperties `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"` + // Tags - READ-ONLY; Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for QueryResult. +func (qr QueryResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if qr.QueryProperties != nil { + objectMap["properties"] = qr.QueryProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for QueryResult struct. +func (qr *QueryResult) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var queryProperties QueryProperties + err = json.Unmarshal(*v, &queryProperties) + if err != nil { + return err + } + qr.QueryProperties = &queryProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + qr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + qr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + qr.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + qr.Tags = tags + } + } + } + + return nil +} + +// QuerySortingConfiguration the configuration for sorting in the query. +type QuerySortingConfiguration struct { + // QuerySortingDirection - The sorting direction. Possible values include: 'Ascending', 'Descending' + QuerySortingDirection SortDirection `json:"querySortingDirection,omitempty"` + // Name - The name of the column to use in sorting. + Name *string `json:"name,omitempty"` +} + +// QueryTimePeriod the start and end date for pulling data for the query. +type QueryTimePeriod struct { + // From - The start date to pull data from. + From *date.Time `json:"from,omitempty"` + // To - The end date to pull data to. + To *date.Time `json:"to,omitempty"` +} + +// Resource the Resource model definition. +type Resource struct { + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Tags - READ-ONLY; 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{}) + return json.Marshal(objectMap) +} diff --git a/services/preview/costmanagement/mgmt/2019-10-01/costmanagement/operations.go b/services/preview/costmanagement/mgmt/2019-10-01/costmanagement/operations.go new file mode 100644 index 000000000000..d8eb4bd62a9d --- /dev/null +++ b/services/preview/costmanagement/mgmt/2019-10-01/costmanagement/operations.go @@ -0,0 +1,147 @@ +package costmanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if 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 Costmanagement 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 lists all of the available cost management 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, "costmanagement.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, "costmanagement.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.olr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "costmanagement.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-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.CostManagement/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, "costmanagement.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, "costmanagement.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "costmanagement.OperationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client OperationsClient) ListComplete(ctx context.Context) (result OperationListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} diff --git a/services/preview/costmanagement/mgmt/2019-10-01/costmanagement/query.go b/services/preview/costmanagement/mgmt/2019-10-01/costmanagement/query.go new file mode 100644 index 000000000000..bc517d718696 --- /dev/null +++ b/services/preview/costmanagement/mgmt/2019-10-01/costmanagement/query.go @@ -0,0 +1,166 @@ +package costmanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the 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 client for the Query methods of the Costmanagement service. +type QueryClient struct { + BaseClient +} + +// NewQueryClient creates an instance of the QueryClient client. +func NewQueryClient(subscriptionID string) QueryClient { + return NewQueryClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewQueryClientWithBaseURI creates an instance of the QueryClient client. +func NewQueryClientWithBaseURI(baseURI string, subscriptionID string) QueryClient { + return QueryClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// UsageByScope query the usage data for scope defined. +// Parameters: +// scope - the scope associated with query and export operations. This includes +// '/subscriptions/{subscriptionId}/' for subscription scope, +// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department +// scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' +// for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for +// Management Group scope, +// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for +// billingProfile scope, +// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' +// for invoiceSection scope, and +// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for +// partners. +// parameters - parameters supplied to the CreateOrUpdate Query Config operation. +func (client QueryClient) UsageByScope(ctx context.Context, scope string, parameters QueryDefinition) (result QueryResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/QueryClient.UsageByScope") + defer func() { + 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.Type", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.TimePeriod", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.TimePeriod.From", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.TimePeriod.To", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "parameters.Dataset", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Dataset.Grouping", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Dataset.Grouping", Name: validation.MaxItems, Rule: 2, Chain: nil}}}, + {Target: "parameters.Dataset.Filter", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Dataset.Filter.And", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Dataset.Filter.And", Name: validation.MinItems, Rule: 2, Chain: nil}}}, + {Target: "parameters.Dataset.Filter.Or", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Dataset.Filter.Or", Name: validation.MinItems, Rule: 2, Chain: nil}}}, + {Target: "parameters.Dataset.Filter.Not", Name: validation.Null, Rule: false, Chain: nil}, + {Target: "parameters.Dataset.Filter.Dimension", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Dataset.Filter.Dimension.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.Dataset.Filter.Dimension.Operator", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.Dataset.Filter.Dimension.Values", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Dataset.Filter.Dimension.Values", Name: validation.MinItems, Rule: 1, Chain: nil}}}, + }}, + {Target: "parameters.Dataset.Filter.Tag", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Dataset.Filter.Tag.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.Dataset.Filter.Tag.Operator", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.Dataset.Filter.Tag.Values", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Dataset.Filter.Tag.Values", Name: validation.MinItems, Rule: 1, Chain: nil}}}, + }}, + }}, + }}}}}); err != nil { + return result, validation.NewError("costmanagement.QueryClient", "UsageByScope", err.Error()) + } + + req, err := client.UsageByScopePreparer(ctx, scope, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "costmanagement.QueryClient", "UsageByScope", nil, "Failure preparing request") + return + } + + resp, err := client.UsageByScopeSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "costmanagement.QueryClient", "UsageByScope", resp, "Failure sending request") + return + } + + result, err = client.UsageByScopeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "costmanagement.QueryClient", "UsageByScope", resp, "Failure responding to request") + } + + return +} + +// UsageByScopePreparer prepares the UsageByScope request. +func (client QueryClient) UsageByScopePreparer(ctx context.Context, scope string, parameters QueryDefinition) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "scope": scope, + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{scope}/providers/Microsoft.CostManagement/query", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UsageByScopeSender sends the UsageByScope request. The method will close the +// http.Response Body if it receives an error. +func (client QueryClient) UsageByScopeSender(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...) +} + +// UsageByScopeResponder handles the response to the UsageByScope request. The method always +// closes the http.Response Body. +func (client QueryClient) UsageByScopeResponder(resp *http.Response) (result QueryResult, 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/costmanagement/mgmt/2019-10-01/costmanagement/version.go b/services/preview/costmanagement/mgmt/2019-10-01/costmanagement/version.go new file mode 100644 index 000000000000..f1711e9d07e1 --- /dev/null +++ b/services/preview/costmanagement/mgmt/2019-10-01/costmanagement/version.go @@ -0,0 +1,30 @@ +package costmanagement + +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 + " costmanagement/2019-10-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/preview/datafactory/mgmt/2017-09-01-preview/datafactory/models.go b/services/preview/datafactory/mgmt/2017-09-01-preview/datafactory/models.go index b207dd6b13b7..5541101fd47e 100644 --- a/services/preview/datafactory/mgmt/2017-09-01-preview/datafactory/models.go +++ b/services/preview/datafactory/mgmt/2017-09-01-preview/datafactory/models.go @@ -19133,6 +19133,8 @@ type BlobEventsTriggerTypeProperties struct { BlobPathBeginsWith *string `json:"blobPathBeginsWith,omitempty"` // BlobPathEndsWith - The blob path must end with the pattern provided for trigger to fire. For example, 'december/boxes.csv' will only fire the trigger for blobs named boxes in a december folder. At least one of these must be provided: blobPathBeginsWith, blobPathEndsWith. BlobPathEndsWith *string `json:"blobPathEndsWith,omitempty"` + // IgnoreEmptyBlobs - If set to true, blobs with zero bytes will be ignored. + IgnoreEmptyBlobs *bool `json:"ignoreEmptyBlobs,omitempty"` // Events - The type of events that cause this trigger to fire. Events *[]BlobEventTypes `json:"events,omitempty"` // Scope - The ARM resource ID of the Storage Account. diff --git a/services/preview/datashare/mgmt/2018-11-01-preview/datashare/datasetmappings.go b/services/preview/datashare/mgmt/2018-11-01-preview/datashare/datasetmappings.go index 1bc643740fbf..632d75aba2cf 100644 --- a/services/preview/datashare/mgmt/2018-11-01-preview/datashare/datasetmappings.go +++ b/services/preview/datashare/mgmt/2018-11-01-preview/datashare/datasetmappings.go @@ -45,7 +45,7 @@ func NewDataSetMappingsClientWithBaseURI(baseURI string, subscriptionID string) // resourceGroupName - the resource group name. // accountName - the name of the share account. // shareSubscriptionName - the name of the share subscription which will hold the data set sink. -// dataSetMappingName - the Id of the source data set being mapped. +// dataSetMappingName - the name of the data set mapping to be created. // dataSetMapping - destination data set configuration details. func (client DataSetMappingsClient) Create(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, dataSetMappingName string, dataSetMapping BasicDataSetMapping) (result DataSetMappingModel, err error) { if tracing.IsEnabled() { diff --git a/services/preview/datashare/mgmt/2018-11-01-preview/datashare/datasets.go b/services/preview/datashare/mgmt/2018-11-01-preview/datashare/datasets.go index 4a08ddace234..47bee16b75c2 100644 --- a/services/preview/datashare/mgmt/2018-11-01-preview/datashare/datasets.go +++ b/services/preview/datashare/mgmt/2018-11-01-preview/datashare/datasets.go @@ -130,13 +130,13 @@ func (client DataSetsClient) CreateResponder(resp *http.Response) (result DataSe // accountName - the name of the share account. // shareName - the name of the share. // dataSetName - the name of the dataSet. -func (client DataSetsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, shareName string, dataSetName string) (result autorest.Response, err error) { +func (client DataSetsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, shareName string, dataSetName string) (result DataSetsDeleteFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/DataSetsClient.Delete") defer func() { sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode + if result.Response() != nil { + sc = result.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -147,18 +147,12 @@ func (client DataSetsClient) Delete(ctx context.Context, resourceGroupName strin return } - resp, err := client.DeleteSender(req) + result, err = client.DeleteSender(req) if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "datashare.DataSetsClient", "Delete", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "datashare.DataSetsClient", "Delete", result.Response(), "Failure sending request") return } - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "datashare.DataSetsClient", "Delete", resp, "Failure responding to request") - } - return } @@ -187,9 +181,15 @@ func (client DataSetsClient) DeletePreparer(ctx context.Context, resourceGroupNa // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. -func (client DataSetsClient) DeleteSender(req *http.Request) (*http.Response, error) { +func (client DataSetsClient) DeleteSender(req *http.Request) (future DataSetsDeleteFuture, err error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + 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 @@ -198,7 +198,7 @@ func (client DataSetsClient) DeleteResponder(resp *http.Response) (result autore err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp return diff --git a/services/preview/datashare/mgmt/2018-11-01-preview/datashare/datashareapi/interfaces.go b/services/preview/datashare/mgmt/2018-11-01-preview/datashare/datashareapi/interfaces.go index 80094b3f09a3..cde7671b16c2 100644 --- a/services/preview/datashare/mgmt/2018-11-01-preview/datashare/datashareapi/interfaces.go +++ b/services/preview/datashare/mgmt/2018-11-01-preview/datashare/datashareapi/interfaces.go @@ -47,7 +47,7 @@ var _ ConsumerInvitationsClientAPI = (*datashare.ConsumerInvitationsClient)(nil) // DataSetsClientAPI contains the set of methods on the DataSetsClient type. type DataSetsClientAPI interface { Create(ctx context.Context, resourceGroupName string, accountName string, shareName string, dataSetName string, dataSet datashare.BasicDataSet) (result datashare.DataSetModel, err error) - Delete(ctx context.Context, resourceGroupName string, accountName string, shareName string, dataSetName string) (result autorest.Response, err error) + Delete(ctx context.Context, resourceGroupName string, accountName string, shareName string, dataSetName string) (result datashare.DataSetsDeleteFuture, err error) Get(ctx context.Context, resourceGroupName string, accountName string, shareName string, dataSetName string) (result datashare.DataSetModel, err error) ListByShare(ctx context.Context, resourceGroupName string, accountName string, shareName string, skipToken string) (result datashare.DataSetListPage, err error) } 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 8fd86e2e13ae..69f7c1eac0ee 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,6 +66,10 @@ const ( BlobFolder DataSetType = "BlobFolder" // Container ... Container DataSetType = "Container" + // KustoCluster ... + KustoCluster DataSetType = "KustoCluster" + // KustoDatabase ... + KustoDatabase DataSetType = "KustoDatabase" // SQLDBTable ... SQLDBTable DataSetType = "SqlDBTable" // SQLDWTable ... @@ -74,7 +78,7 @@ const ( // 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, SQLDBTable, SQLDWTable} + return []DataSetType{AdlsGen1File, AdlsGen1Folder, AdlsGen2File, AdlsGen2FileSystem, AdlsGen2Folder, Blob, BlobFolder, Container, KustoCluster, KustoDatabase, SQLDBTable, SQLDWTable} } // InvitationStatus enumerates the values for invitation status. @@ -118,6 +122,10 @@ const ( KindContainer Kind = "Container" // KindDataSet ... KindDataSet Kind = "DataSet" + // KindKustoCluster ... + KindKustoCluster Kind = "KustoCluster" + // KindKustoDatabase ... + KindKustoDatabase Kind = "KustoDatabase" // KindSQLDBTable ... KindSQLDBTable Kind = "SqlDBTable" // KindSQLDWTable ... @@ -126,7 +134,7 @@ const ( // 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, KindSQLDBTable, KindSQLDWTable} + return []Kind{KindAdlsGen1File, KindAdlsGen1Folder, KindAdlsGen2File, KindAdlsGen2FileSystem, KindAdlsGen2Folder, KindBlob, KindBlobFolder, KindContainer, KindDataSet, KindKustoCluster, KindKustoDatabase, KindSQLDBTable, KindSQLDWTable} } // KindBasicDataSetMapping enumerates the values for kind basic data set mapping. @@ -147,6 +155,10 @@ const ( KindBasicDataSetMappingKindContainer KindBasicDataSetMapping = "Container" // KindBasicDataSetMappingKindDataSetMapping ... KindBasicDataSetMappingKindDataSetMapping KindBasicDataSetMapping = "DataSetMapping" + // KindBasicDataSetMappingKindKustoCluster ... + KindBasicDataSetMappingKindKustoCluster KindBasicDataSetMapping = "KustoCluster" + // KindBasicDataSetMappingKindKustoDatabase ... + KindBasicDataSetMappingKindKustoDatabase KindBasicDataSetMapping = "KustoDatabase" // KindBasicDataSetMappingKindSQLDBTable ... KindBasicDataSetMappingKindSQLDBTable KindBasicDataSetMapping = "SqlDBTable" // KindBasicDataSetMappingKindSQLDWTable ... @@ -155,7 +167,7 @@ const ( // PossibleKindBasicDataSetMappingValues returns an array of possible values for the KindBasicDataSetMapping const type. func PossibleKindBasicDataSetMappingValues() []KindBasicDataSetMapping { - return []KindBasicDataSetMapping{KindBasicDataSetMappingKindAdlsGen2File, KindBasicDataSetMappingKindAdlsGen2FileSystem, KindBasicDataSetMappingKindAdlsGen2Folder, KindBasicDataSetMappingKindBlob, KindBasicDataSetMappingKindBlobFolder, KindBasicDataSetMappingKindContainer, KindBasicDataSetMappingKindDataSetMapping, KindBasicDataSetMappingKindSQLDBTable, KindBasicDataSetMappingKindSQLDWTable} + return []KindBasicDataSetMapping{KindBasicDataSetMappingKindAdlsGen2File, KindBasicDataSetMappingKindAdlsGen2FileSystem, KindBasicDataSetMappingKindAdlsGen2Folder, KindBasicDataSetMappingKindBlob, KindBasicDataSetMappingKindBlobFolder, KindBasicDataSetMappingKindContainer, KindBasicDataSetMappingKindDataSetMapping, KindBasicDataSetMappingKindKustoCluster, KindBasicDataSetMappingKindKustoDatabase, KindBasicDataSetMappingKindSQLDBTable, KindBasicDataSetMappingKindSQLDWTable} } // KindBasicSourceShareSynchronizationSetting enumerates the values for kind basic source share synchronization @@ -261,11 +273,13 @@ type ShareKind string const ( // CopyBased ... CopyBased ShareKind = "CopyBased" + // InPlace ... + InPlace ShareKind = "InPlace" ) // PossibleShareKindValues returns an array of possible values for the ShareKind const type. func PossibleShareKindValues() []ShareKind { - return []ShareKind{CopyBased} + return []ShareKind{CopyBased, InPlace} } // ShareSubscriptionStatus enumerates the values for share subscription status. @@ -620,10 +634,12 @@ func NewAccountListPage(getNextPage func(context.Context, AccountList) (AccountL type AccountProperties struct { // CreatedAt - READ-ONLY; Time at which the account was created. CreatedAt *date.Time `json:"createdAt,omitempty"` - // CreatedBy - READ-ONLY; Name of the user who created the account. - CreatedBy *string `json:"createdBy,omitempty"` // ProvisioningState - READ-ONLY; Provisioning state of the Account. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // UserEmail - READ-ONLY; Email of the user who created the resource + UserEmail *string `json:"userEmail,omitempty"` + // UserName - READ-ONLY; Name of the user who created the resource + UserName *string `json:"userName,omitempty"` } // AccountsCreateFuture an abstraction for monitoring and retrieving the results of a long-running @@ -699,9 +715,9 @@ func (aup AccountUpdateParameters) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// ADLSGen1FileDataSet an ADLS Gen 1 file dataset. +// ADLSGen1FileDataSet an ADLS Gen 1 file data set. type ADLSGen1FileDataSet struct { - // ADLSGen1FileProperties - ADLS Gen 1 file dataset properties. + // ADLSGen1FileProperties - ADLS Gen 1 file data set properties. *ADLSGen1FileProperties `json:"properties,omitempty"` // ID - READ-ONLY; The resource id of the azure resource ID *string `json:"id,omitempty"` @@ -709,7 +725,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', 'KindSQLDWTable', 'KindSQLDBTable' + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindKustoCluster', 'KindKustoDatabase', 'KindSQLDWTable', 'KindSQLDBTable' Kind Kind `json:"kind,omitempty"` } @@ -766,6 +782,16 @@ func (ag1fds ADLSGen1FileDataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, return &ag1fds, true } +// AsKustoClusterDataSet is the BasicDataSet implementation for ADLSGen1FileDataSet. +func (ag1fds ADLSGen1FileDataSet) AsKustoClusterDataSet() (*KustoClusterDataSet, bool) { + return nil, false +} + +// AsKustoDatabaseDataSet is the BasicDataSet implementation for ADLSGen1FileDataSet. +func (ag1fds ADLSGen1FileDataSet) AsKustoDatabaseDataSet() (*KustoDatabaseDataSet, bool) { + return nil, false +} + // AsSQLDWTableDataSet is the BasicDataSet implementation for ADLSGen1FileDataSet. func (ag1fds ADLSGen1FileDataSet) AsSQLDWTableDataSet() (*SQLDWTableDataSet, bool) { return nil, false @@ -862,11 +888,11 @@ type ADLSGen1FileProperties struct { SubscriptionID *string `json:"subscriptionId,omitempty"` } -// ADLSGen1FolderDataSet an ADLS Gen 1 folder dataset. +// ADLSGen1FolderDataSet an ADLS Gen 1 folder data set. type ADLSGen1FolderDataSet struct { - // ADLSGen1FolderProperties - ADLS Gen 1 folder dataset properties. + // ADLSGen1FolderProperties - ADLS Gen 1 folder data set properties. *ADLSGen1FolderProperties `json:"properties,omitempty"` - // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindSQLDWTable', 'KindSQLDBTable' + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindKustoCluster', 'KindKustoDatabase', 'KindSQLDWTable', 'KindSQLDBTable' Kind Kind `json:"kind,omitempty"` // ID - READ-ONLY; The resource id of the azure resource ID *string `json:"id,omitempty"` @@ -929,6 +955,16 @@ func (ag1fds ADLSGen1FolderDataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSe return nil, false } +// AsKustoClusterDataSet is the BasicDataSet implementation for ADLSGen1FolderDataSet. +func (ag1fds ADLSGen1FolderDataSet) AsKustoClusterDataSet() (*KustoClusterDataSet, bool) { + return nil, false +} + +// AsKustoDatabaseDataSet is the BasicDataSet implementation for ADLSGen1FolderDataSet. +func (ag1fds ADLSGen1FolderDataSet) AsKustoDatabaseDataSet() (*KustoDatabaseDataSet, bool) { + return nil, false +} + // AsSQLDWTableDataSet is the BasicDataSet implementation for ADLSGen1FolderDataSet. func (ag1fds ADLSGen1FolderDataSet) AsSQLDWTableDataSet() (*SQLDWTableDataSet, bool) { return nil, false @@ -1023,11 +1059,11 @@ type ADLSGen1FolderProperties struct { SubscriptionID *string `json:"subscriptionId,omitempty"` } -// ADLSGen2FileDataSet an ADLS Gen 2 file dataset. +// ADLSGen2FileDataSet an ADLS Gen 2 file data set. type ADLSGen2FileDataSet struct { - // ADLSGen2FileProperties - ADLS Gen 2 file dataset properties. + // ADLSGen2FileProperties - ADLS Gen 2 file data set properties. *ADLSGen2FileProperties `json:"properties,omitempty"` - // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindSQLDWTable', 'KindSQLDBTable' + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindKustoCluster', 'KindKustoDatabase', 'KindSQLDWTable', 'KindSQLDBTable' Kind Kind `json:"kind,omitempty"` // ID - READ-ONLY; The resource id of the azure resource ID *string `json:"id,omitempty"` @@ -1090,6 +1126,16 @@ func (ag2fds ADLSGen2FileDataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, return nil, false } +// AsKustoClusterDataSet is the BasicDataSet implementation for ADLSGen2FileDataSet. +func (ag2fds ADLSGen2FileDataSet) AsKustoClusterDataSet() (*KustoClusterDataSet, bool) { + return nil, false +} + +// AsKustoDatabaseDataSet is the BasicDataSet implementation for ADLSGen2FileDataSet. +func (ag2fds ADLSGen2FileDataSet) AsKustoDatabaseDataSet() (*KustoDatabaseDataSet, bool) { + return nil, false +} + // AsSQLDWTableDataSet is the BasicDataSet implementation for ADLSGen2FileDataSet. func (ag2fds ADLSGen2FileDataSet) AsSQLDWTableDataSet() (*SQLDWTableDataSet, bool) { return nil, false @@ -1170,9 +1216,9 @@ func (ag2fds *ADLSGen2FileDataSet) UnmarshalJSON(body []byte) error { return nil } -// ADLSGen2FileDataSetMapping an ADLS Gen2 file dataset mapping. +// ADLSGen2FileDataSetMapping an ADLS Gen2 file data set mapping. type ADLSGen2FileDataSetMapping struct { - // ADLSGen2FileDataSetMappingProperties - ADLS Gen2 file dataset mapping properties. + // ADLSGen2FileDataSetMappingProperties - ADLS Gen2 file data set mapping properties. *ADLSGen2FileDataSetMappingProperties `json:"properties,omitempty"` // ID - READ-ONLY; The resource id of the azure resource ID *string `json:"id,omitempty"` @@ -1180,7 +1226,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', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' + // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindKustoCluster', 'KindBasicDataSetMappingKindKustoDatabase', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' Kind KindBasicDataSetMapping `json:"kind,omitempty"` } @@ -1227,6 +1273,16 @@ func (ag2fdsm ADLSGen2FileDataSetMapping) AsADLSGen2FileSystemDataSetMapping() ( return nil, false } +// AsKustoClusterDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileDataSetMapping. +func (ag2fdsm ADLSGen2FileDataSetMapping) AsKustoClusterDataSetMapping() (*KustoClusterDataSetMapping, bool) { + return nil, false +} + +// AsKustoDatabaseDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileDataSetMapping. +func (ag2fdsm ADLSGen2FileDataSetMapping) AsKustoDatabaseDataSetMapping() (*KustoDatabaseDataSetMapping, bool) { + return nil, false +} + // AsSQLDWTableDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileDataSetMapping. func (ag2fdsm ADLSGen2FileDataSetMapping) AsSQLDWTableDataSetMapping() (*SQLDWTableDataSetMapping, bool) { return nil, false @@ -1307,11 +1363,11 @@ func (ag2fdsm *ADLSGen2FileDataSetMapping) UnmarshalJSON(body []byte) error { return nil } -// ADLSGen2FileDataSetMappingProperties ADLS Gen 2 file dataset mapping property bag. +// ADLSGen2FileDataSetMappingProperties ADLS Gen 2 file data set mapping property bag. type ADLSGen2FileDataSetMappingProperties struct { - // DataSetID - Gets the id of source dataset. + // DataSetID - The id of the source data set. DataSetID *string `json:"dataSetId,omitempty"` - // DataSetMappingStatus - Gets the status of the dataset mapping. Possible values include: 'Ok', 'Broken' + // DataSetMappingStatus - READ-ONLY; Gets the status of the data set mapping. Possible values include: 'Ok', 'Broken' DataSetMappingStatus DataSetMappingStatus `json:"dataSetMappingStatus,omitempty"` // FilePath - File path within the file system. FilePath *string `json:"filePath,omitempty"` @@ -1319,6 +1375,8 @@ type ADLSGen2FileDataSetMappingProperties struct { FileSystem *string `json:"fileSystem,omitempty"` // OutputType - Type of output file. Possible values include: 'Csv', 'Parquet' OutputType OutputType `json:"outputType,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the data set mapping. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // ResourceGroup - Resource group of storage account. ResourceGroup *string `json:"resourceGroup,omitempty"` // StorageAccountName - Storage account name of the source data set. @@ -1343,11 +1401,11 @@ type ADLSGen2FileProperties struct { SubscriptionID *string `json:"subscriptionId,omitempty"` } -// ADLSGen2FileSystemDataSet an ADLS Gen 2 file system dataset. +// ADLSGen2FileSystemDataSet an ADLS Gen 2 file system data set. type ADLSGen2FileSystemDataSet struct { - // ADLSGen2FileSystemProperties - ADLS Gen 2 file system dataset properties. + // ADLSGen2FileSystemProperties - ADLS Gen 2 file system data set properties. *ADLSGen2FileSystemProperties `json:"properties,omitempty"` - // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindSQLDWTable', 'KindSQLDBTable' + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindKustoCluster', 'KindKustoDatabase', 'KindSQLDWTable', 'KindSQLDBTable' Kind Kind `json:"kind,omitempty"` // ID - READ-ONLY; The resource id of the azure resource ID *string `json:"id,omitempty"` @@ -1410,6 +1468,16 @@ func (ag2fsds ADLSGen2FileSystemDataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileD return nil, false } +// AsKustoClusterDataSet is the BasicDataSet implementation for ADLSGen2FileSystemDataSet. +func (ag2fsds ADLSGen2FileSystemDataSet) AsKustoClusterDataSet() (*KustoClusterDataSet, bool) { + return nil, false +} + +// AsKustoDatabaseDataSet is the BasicDataSet implementation for ADLSGen2FileSystemDataSet. +func (ag2fsds ADLSGen2FileSystemDataSet) AsKustoDatabaseDataSet() (*KustoDatabaseDataSet, bool) { + return nil, false +} + // AsSQLDWTableDataSet is the BasicDataSet implementation for ADLSGen2FileSystemDataSet. func (ag2fsds ADLSGen2FileSystemDataSet) AsSQLDWTableDataSet() (*SQLDWTableDataSet, bool) { return nil, false @@ -1490,11 +1558,11 @@ func (ag2fsds *ADLSGen2FileSystemDataSet) UnmarshalJSON(body []byte) error { return nil } -// ADLSGen2FileSystemDataSetMapping an ADLS Gen2 file system dataset mapping. +// ADLSGen2FileSystemDataSetMapping an ADLS Gen2 file system data set mapping. type ADLSGen2FileSystemDataSetMapping struct { - // ADLSGen2FileSystemDataSetMappingProperties - ADLS Gen2 file system dataset mapping properties. + // ADLSGen2FileSystemDataSetMappingProperties - ADLS Gen2 file system data set mapping properties. *ADLSGen2FileSystemDataSetMappingProperties `json:"properties,omitempty"` - // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' + // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindKustoCluster', 'KindBasicDataSetMappingKindKustoDatabase', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' Kind KindBasicDataSetMapping `json:"kind,omitempty"` // ID - READ-ONLY; The resource id of the azure resource ID *string `json:"id,omitempty"` @@ -1547,6 +1615,16 @@ func (ag2fsdsm ADLSGen2FileSystemDataSetMapping) AsADLSGen2FileSystemDataSetMapp return &ag2fsdsm, true } +// AsKustoClusterDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileSystemDataSetMapping. +func (ag2fsdsm ADLSGen2FileSystemDataSetMapping) AsKustoClusterDataSetMapping() (*KustoClusterDataSetMapping, bool) { + return nil, false +} + +// AsKustoDatabaseDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileSystemDataSetMapping. +func (ag2fsdsm ADLSGen2FileSystemDataSetMapping) AsKustoDatabaseDataSetMapping() (*KustoDatabaseDataSetMapping, bool) { + return nil, false +} + // AsSQLDWTableDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileSystemDataSetMapping. func (ag2fsdsm ADLSGen2FileSystemDataSetMapping) AsSQLDWTableDataSetMapping() (*SQLDWTableDataSetMapping, bool) { return nil, false @@ -1627,14 +1705,16 @@ func (ag2fsdsm *ADLSGen2FileSystemDataSetMapping) UnmarshalJSON(body []byte) err return nil } -// ADLSGen2FileSystemDataSetMappingProperties ADLS Gen 2 file system dataset mapping property bag. +// ADLSGen2FileSystemDataSetMappingProperties ADLS Gen 2 file system data set mapping property bag. type ADLSGen2FileSystemDataSetMappingProperties struct { - // DataSetID - Gets the id of source dataset. + // DataSetID - The id of the source data set. DataSetID *string `json:"dataSetId,omitempty"` - // DataSetMappingStatus - Gets the status of the dataset mapping. Possible values include: 'Ok', 'Broken' + // DataSetMappingStatus - READ-ONLY; Gets the status of the data set mapping. Possible values include: 'Ok', 'Broken' DataSetMappingStatus DataSetMappingStatus `json:"dataSetMappingStatus,omitempty"` // FileSystem - The file system name. FileSystem *string `json:"fileSystem,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the data set mapping. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // ResourceGroup - Resource group of storage account. ResourceGroup *string `json:"resourceGroup,omitempty"` // StorageAccountName - Storage account name of the source data set. @@ -1657,11 +1737,11 @@ type ADLSGen2FileSystemProperties struct { SubscriptionID *string `json:"subscriptionId,omitempty"` } -// ADLSGen2FolderDataSet an ADLS Gen 2 folder dataset. +// ADLSGen2FolderDataSet an ADLS Gen 2 folder data set. type ADLSGen2FolderDataSet struct { - // ADLSGen2FolderProperties - ADLS Gen 2 folder dataset properties. + // ADLSGen2FolderProperties - ADLS Gen 2 folder data set properties. *ADLSGen2FolderProperties `json:"properties,omitempty"` - // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindSQLDWTable', 'KindSQLDBTable' + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindKustoCluster', 'KindKustoDatabase', 'KindSQLDWTable', 'KindSQLDBTable' Kind Kind `json:"kind,omitempty"` // ID - READ-ONLY; The resource id of the azure resource ID *string `json:"id,omitempty"` @@ -1724,6 +1804,16 @@ func (ag2fds ADLSGen2FolderDataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSe return nil, false } +// AsKustoClusterDataSet is the BasicDataSet implementation for ADLSGen2FolderDataSet. +func (ag2fds ADLSGen2FolderDataSet) AsKustoClusterDataSet() (*KustoClusterDataSet, bool) { + return nil, false +} + +// AsKustoDatabaseDataSet is the BasicDataSet implementation for ADLSGen2FolderDataSet. +func (ag2fds ADLSGen2FolderDataSet) AsKustoDatabaseDataSet() (*KustoDatabaseDataSet, bool) { + return nil, false +} + // AsSQLDWTableDataSet is the BasicDataSet implementation for ADLSGen2FolderDataSet. func (ag2fds ADLSGen2FolderDataSet) AsSQLDWTableDataSet() (*SQLDWTableDataSet, bool) { return nil, false @@ -1804,11 +1894,11 @@ func (ag2fds *ADLSGen2FolderDataSet) UnmarshalJSON(body []byte) error { return nil } -// ADLSGen2FolderDataSetMapping an ADLS Gen2 folder dataset mapping. +// ADLSGen2FolderDataSetMapping an ADLS Gen2 folder data set mapping. type ADLSGen2FolderDataSetMapping struct { - // ADLSGen2FolderDataSetMappingProperties - ADLS Gen2 folder dataset mapping properties. + // ADLSGen2FolderDataSetMappingProperties - ADLS Gen2 folder data set mapping properties. *ADLSGen2FolderDataSetMappingProperties `json:"properties,omitempty"` - // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' + // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindKustoCluster', 'KindBasicDataSetMappingKindKustoDatabase', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' Kind KindBasicDataSetMapping `json:"kind,omitempty"` // ID - READ-ONLY; The resource id of the azure resource ID *string `json:"id,omitempty"` @@ -1861,6 +1951,16 @@ func (ag2fdsm ADLSGen2FolderDataSetMapping) AsADLSGen2FileSystemDataSetMapping() return nil, false } +// AsKustoClusterDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FolderDataSetMapping. +func (ag2fdsm ADLSGen2FolderDataSetMapping) AsKustoClusterDataSetMapping() (*KustoClusterDataSetMapping, bool) { + return nil, false +} + +// AsKustoDatabaseDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FolderDataSetMapping. +func (ag2fdsm ADLSGen2FolderDataSetMapping) AsKustoDatabaseDataSetMapping() (*KustoDatabaseDataSetMapping, bool) { + return nil, false +} + // AsSQLDWTableDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FolderDataSetMapping. func (ag2fdsm ADLSGen2FolderDataSetMapping) AsSQLDWTableDataSetMapping() (*SQLDWTableDataSetMapping, bool) { return nil, false @@ -1941,16 +2041,18 @@ func (ag2fdsm *ADLSGen2FolderDataSetMapping) UnmarshalJSON(body []byte) error { return nil } -// ADLSGen2FolderDataSetMappingProperties ADLS Gen 2 folder dataset mapping property bag. +// ADLSGen2FolderDataSetMappingProperties ADLS Gen 2 folder data set mapping property bag. type ADLSGen2FolderDataSetMappingProperties struct { - // DataSetID - Gets the id of source dataset. + // DataSetID - The id of the source data set. DataSetID *string `json:"dataSetId,omitempty"` - // DataSetMappingStatus - Gets the status of the dataset mapping. Possible values include: 'Ok', 'Broken' + // DataSetMappingStatus - READ-ONLY; Gets the status of the data set mapping. Possible values include: 'Ok', 'Broken' DataSetMappingStatus DataSetMappingStatus `json:"dataSetMappingStatus,omitempty"` // FileSystem - File system to which the folder belongs. FileSystem *string `json:"fileSystem,omitempty"` // FolderPath - Folder path within the file system. FolderPath *string `json:"folderPath,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the data set mapping. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // ResourceGroup - Resource group of storage account. ResourceGroup *string `json:"resourceGroup,omitempty"` // StorageAccountName - Storage account name of the source data set. @@ -1975,11 +2077,11 @@ type ADLSGen2FolderProperties struct { SubscriptionID *string `json:"subscriptionId,omitempty"` } -// BlobContainerDataSet an Azure storage blob container dataset. +// BlobContainerDataSet an Azure storage blob container data set. type BlobContainerDataSet struct { - // BlobContainerProperties - Blob container dataset properties. + // BlobContainerProperties - Blob container data set properties. *BlobContainerProperties `json:"properties,omitempty"` - // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindSQLDWTable', 'KindSQLDBTable' + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindKustoCluster', 'KindKustoDatabase', 'KindSQLDWTable', 'KindSQLDBTable' Kind Kind `json:"kind,omitempty"` // ID - READ-ONLY; The resource id of the azure resource ID *string `json:"id,omitempty"` @@ -2042,6 +2144,16 @@ func (bcds BlobContainerDataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, return nil, false } +// AsKustoClusterDataSet is the BasicDataSet implementation for BlobContainerDataSet. +func (bcds BlobContainerDataSet) AsKustoClusterDataSet() (*KustoClusterDataSet, bool) { + return nil, false +} + +// AsKustoDatabaseDataSet is the BasicDataSet implementation for BlobContainerDataSet. +func (bcds BlobContainerDataSet) AsKustoDatabaseDataSet() (*KustoDatabaseDataSet, bool) { + return nil, false +} + // AsSQLDWTableDataSet is the BasicDataSet implementation for BlobContainerDataSet. func (bcds BlobContainerDataSet) AsSQLDWTableDataSet() (*SQLDWTableDataSet, bool) { return nil, false @@ -2122,11 +2234,11 @@ func (bcds *BlobContainerDataSet) UnmarshalJSON(body []byte) error { return nil } -// BlobContainerDataSetMapping a Blob container dataset mapping. +// BlobContainerDataSetMapping a Blob container data set mapping. type BlobContainerDataSetMapping struct { - // BlobContainerMappingProperties - Blob container dataset mapping properties. + // BlobContainerMappingProperties - Blob container data set mapping properties. *BlobContainerMappingProperties `json:"properties,omitempty"` - // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' + // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindKustoCluster', 'KindBasicDataSetMappingKindKustoDatabase', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' Kind KindBasicDataSetMapping `json:"kind,omitempty"` // ID - READ-ONLY; The resource id of the azure resource ID *string `json:"id,omitempty"` @@ -2179,6 +2291,16 @@ func (bcdsm BlobContainerDataSetMapping) AsADLSGen2FileSystemDataSetMapping() (* return nil, false } +// AsKustoClusterDataSetMapping is the BasicDataSetMapping implementation for BlobContainerDataSetMapping. +func (bcdsm BlobContainerDataSetMapping) AsKustoClusterDataSetMapping() (*KustoClusterDataSetMapping, bool) { + return nil, false +} + +// AsKustoDatabaseDataSetMapping is the BasicDataSetMapping implementation for BlobContainerDataSetMapping. +func (bcdsm BlobContainerDataSetMapping) AsKustoDatabaseDataSetMapping() (*KustoDatabaseDataSetMapping, bool) { + return nil, false +} + // AsSQLDWTableDataSetMapping is the BasicDataSetMapping implementation for BlobContainerDataSetMapping. func (bcdsm BlobContainerDataSetMapping) AsSQLDWTableDataSetMapping() (*SQLDWTableDataSetMapping, bool) { return nil, false @@ -2259,14 +2381,16 @@ func (bcdsm *BlobContainerDataSetMapping) UnmarshalJSON(body []byte) error { return nil } -// BlobContainerMappingProperties azure storage Blob container dataset mapping property bag. +// BlobContainerMappingProperties azure storage Blob container data set mapping property bag. type BlobContainerMappingProperties struct { // ContainerName - BLOB Container name. ContainerName *string `json:"containerName,omitempty"` - // DataSetID - Gets the id of source dataset. + // DataSetID - The id of the source data set. DataSetID *string `json:"dataSetId,omitempty"` - // DataSetMappingStatus - Gets the status of the dataset mapping. Possible values include: 'Ok', 'Broken' + // DataSetMappingStatus - READ-ONLY; Gets the status of the data set mapping. Possible values include: 'Ok', 'Broken' DataSetMappingStatus DataSetMappingStatus `json:"dataSetMappingStatus,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the data set mapping. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // ResourceGroup - Resource group of storage account. ResourceGroup *string `json:"resourceGroup,omitempty"` // StorageAccountName - Storage account name of the source data set. @@ -2289,11 +2413,11 @@ type BlobContainerProperties struct { SubscriptionID *string `json:"subscriptionId,omitempty"` } -// BlobDataSet an Azure storage blob dataset. +// BlobDataSet an Azure storage blob data set. type BlobDataSet struct { - // BlobProperties - Blob dataset properties. + // BlobProperties - Blob data set properties. *BlobProperties `json:"properties,omitempty"` - // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindSQLDWTable', 'KindSQLDBTable' + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindKustoCluster', 'KindKustoDatabase', 'KindSQLDWTable', 'KindSQLDBTable' Kind Kind `json:"kind,omitempty"` // ID - READ-ONLY; The resource id of the azure resource ID *string `json:"id,omitempty"` @@ -2356,6 +2480,16 @@ func (bds BlobDataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, bool) { return nil, false } +// AsKustoClusterDataSet is the BasicDataSet implementation for BlobDataSet. +func (bds BlobDataSet) AsKustoClusterDataSet() (*KustoClusterDataSet, bool) { + return nil, false +} + +// AsKustoDatabaseDataSet is the BasicDataSet implementation for BlobDataSet. +func (bds BlobDataSet) AsKustoDatabaseDataSet() (*KustoDatabaseDataSet, bool) { + return nil, false +} + // AsSQLDWTableDataSet is the BasicDataSet implementation for BlobDataSet. func (bds BlobDataSet) AsSQLDWTableDataSet() (*SQLDWTableDataSet, bool) { return nil, false @@ -2436,11 +2570,11 @@ func (bds *BlobDataSet) UnmarshalJSON(body []byte) error { return nil } -// BlobDataSetMapping a Blob dataset mapping. +// BlobDataSetMapping a Blob data set mapping. type BlobDataSetMapping struct { - // BlobMappingProperties - Blob dataset mapping properties. + // BlobMappingProperties - Blob data set mapping properties. *BlobMappingProperties `json:"properties,omitempty"` - // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' + // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindKustoCluster', 'KindBasicDataSetMappingKindKustoDatabase', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' Kind KindBasicDataSetMapping `json:"kind,omitempty"` // ID - READ-ONLY; The resource id of the azure resource ID *string `json:"id,omitempty"` @@ -2493,6 +2627,16 @@ func (bdsm BlobDataSetMapping) AsADLSGen2FileSystemDataSetMapping() (*ADLSGen2Fi return nil, false } +// AsKustoClusterDataSetMapping is the BasicDataSetMapping implementation for BlobDataSetMapping. +func (bdsm BlobDataSetMapping) AsKustoClusterDataSetMapping() (*KustoClusterDataSetMapping, bool) { + return nil, false +} + +// AsKustoDatabaseDataSetMapping is the BasicDataSetMapping implementation for BlobDataSetMapping. +func (bdsm BlobDataSetMapping) AsKustoDatabaseDataSetMapping() (*KustoDatabaseDataSetMapping, bool) { + return nil, false +} + // AsSQLDWTableDataSetMapping is the BasicDataSetMapping implementation for BlobDataSetMapping. func (bdsm BlobDataSetMapping) AsSQLDWTableDataSetMapping() (*SQLDWTableDataSetMapping, bool) { return nil, false @@ -2573,11 +2717,11 @@ func (bdsm *BlobDataSetMapping) UnmarshalJSON(body []byte) error { return nil } -// BlobFolderDataSet an Azure storage blob folder dataset. +// BlobFolderDataSet an Azure storage blob folder data set. type BlobFolderDataSet struct { - // BlobFolderProperties - Blob folder dataset properties. + // BlobFolderProperties - Blob folder data set properties. *BlobFolderProperties `json:"properties,omitempty"` - // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindSQLDWTable', 'KindSQLDBTable' + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindKustoCluster', 'KindKustoDatabase', 'KindSQLDWTable', 'KindSQLDBTable' Kind Kind `json:"kind,omitempty"` // ID - READ-ONLY; The resource id of the azure resource ID *string `json:"id,omitempty"` @@ -2640,6 +2784,16 @@ func (bfds BlobFolderDataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, boo return nil, false } +// AsKustoClusterDataSet is the BasicDataSet implementation for BlobFolderDataSet. +func (bfds BlobFolderDataSet) AsKustoClusterDataSet() (*KustoClusterDataSet, bool) { + return nil, false +} + +// AsKustoDatabaseDataSet is the BasicDataSet implementation for BlobFolderDataSet. +func (bfds BlobFolderDataSet) AsKustoDatabaseDataSet() (*KustoDatabaseDataSet, bool) { + return nil, false +} + // AsSQLDWTableDataSet is the BasicDataSet implementation for BlobFolderDataSet. func (bfds BlobFolderDataSet) AsSQLDWTableDataSet() (*SQLDWTableDataSet, bool) { return nil, false @@ -2720,11 +2874,11 @@ func (bfds *BlobFolderDataSet) UnmarshalJSON(body []byte) error { return nil } -// BlobFolderDataSetMapping a Blob folder dataset mapping. +// BlobFolderDataSetMapping a Blob folder data set mapping. type BlobFolderDataSetMapping struct { - // BlobFolderMappingProperties - Blob folder dataset mapping properties. + // BlobFolderMappingProperties - Blob folder data set mapping properties. *BlobFolderMappingProperties `json:"properties,omitempty"` - // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' + // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindKustoCluster', 'KindBasicDataSetMappingKindKustoDatabase', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' Kind KindBasicDataSetMapping `json:"kind,omitempty"` // ID - READ-ONLY; The resource id of the azure resource ID *string `json:"id,omitempty"` @@ -2777,6 +2931,16 @@ func (bfdsm BlobFolderDataSetMapping) AsADLSGen2FileSystemDataSetMapping() (*ADL return nil, false } +// AsKustoClusterDataSetMapping is the BasicDataSetMapping implementation for BlobFolderDataSetMapping. +func (bfdsm BlobFolderDataSetMapping) AsKustoClusterDataSetMapping() (*KustoClusterDataSetMapping, bool) { + return nil, false +} + +// AsKustoDatabaseDataSetMapping is the BasicDataSetMapping implementation for BlobFolderDataSetMapping. +func (bfdsm BlobFolderDataSetMapping) AsKustoDatabaseDataSetMapping() (*KustoDatabaseDataSetMapping, bool) { + return nil, false +} + // AsSQLDWTableDataSetMapping is the BasicDataSetMapping implementation for BlobFolderDataSetMapping. func (bfdsm BlobFolderDataSetMapping) AsSQLDWTableDataSetMapping() (*SQLDWTableDataSetMapping, bool) { return nil, false @@ -2857,16 +3021,18 @@ func (bfdsm *BlobFolderDataSetMapping) UnmarshalJSON(body []byte) error { return nil } -// BlobFolderMappingProperties azure storage Blob folder dataset mapping property bag. +// BlobFolderMappingProperties azure storage Blob folder data set mapping property bag. type BlobFolderMappingProperties struct { // ContainerName - Container that has the file path. ContainerName *string `json:"containerName,omitempty"` - // DataSetID - Gets the id of source dataset. + // DataSetID - The id of the source data set. DataSetID *string `json:"dataSetId,omitempty"` - // DataSetMappingStatus - Gets the status of the dataset mapping. Possible values include: 'Ok', 'Broken' + // DataSetMappingStatus - READ-ONLY; Gets the status of the data set mapping. Possible values include: 'Ok', 'Broken' DataSetMappingStatus DataSetMappingStatus `json:"dataSetMappingStatus,omitempty"` // Prefix - Prefix for blob folder Prefix *string `json:"prefix,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the data set mapping. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // ResourceGroup - Resource group of storage account. ResourceGroup *string `json:"resourceGroup,omitempty"` // StorageAccountName - Storage account name of the source data set. @@ -2891,18 +3057,20 @@ type BlobFolderProperties struct { SubscriptionID *string `json:"subscriptionId,omitempty"` } -// BlobMappingProperties azure storage Blob dataset mapping property bag. +// BlobMappingProperties azure storage Blob data set mapping property bag. type BlobMappingProperties struct { // ContainerName - Container that has the file path. ContainerName *string `json:"containerName,omitempty"` - // DataSetID - Gets the id of source dataset. + // DataSetID - The id of the source data set. DataSetID *string `json:"dataSetId,omitempty"` - // DataSetMappingStatus - Gets the status of the dataset mapping. Possible values include: 'Ok', 'Broken' + // DataSetMappingStatus - READ-ONLY; Gets the status of the data set mapping. Possible values include: 'Ok', 'Broken' 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"` + // ProvisioningState - READ-ONLY; Provisioning state of the data set mapping. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // ResourceGroup - Resource group of storage account. ResourceGroup *string `json:"resourceGroup,omitempty"` // StorageAccountName - Storage account name of the source data set. @@ -3158,18 +3326,24 @@ type ConsumerInvitationProperties struct { InvitationStatus InvitationStatus `json:"invitationStatus,omitempty"` // Location - READ-ONLY; invitation location Location *string `json:"location,omitempty"` + // ProviderEmail - READ-ONLY; Email of the provider who created the resource + ProviderEmail *string `json:"providerEmail,omitempty"` + // ProviderName - READ-ONLY; Name of the provider who created the resource + ProviderName *string `json:"providerName,omitempty"` + // ProviderTenantName - READ-ONLY; Tenant name of the provider who created the resource + ProviderTenantName *string `json:"providerTenantName,omitempty"` // RespondedAt - READ-ONLY; The time the recipient responded to the invitation. RespondedAt *date.Time `json:"respondedAt,omitempty"` - // Sender - READ-ONLY; Gets the name of the sender. - Sender *string `json:"sender,omitempty"` - // SenderCompanyName - READ-ONLY; Gets the company name of the sender. - SenderCompanyName *string `json:"senderCompanyName,omitempty"` // SentAt - READ-ONLY; Gets the time at which the invitation was sent. SentAt *date.Time `json:"sentAt,omitempty"` // ShareName - READ-ONLY; Gets the source share Name. ShareName *string `json:"shareName,omitempty"` // TermsOfUse - READ-ONLY; Terms of use shared when the invitation was created TermsOfUse *string `json:"termsOfUse,omitempty"` + // UserEmail - READ-ONLY; Email of the user who created the resource + UserEmail *string `json:"userEmail,omitempty"` + // UserName - READ-ONLY; Name of the user who created the resource + UserName *string `json:"userName,omitempty"` } // ConsumerSourceDataSet a consumer side dataSet data transfer object. @@ -3394,9 +3568,13 @@ func NewConsumerSourceDataSetListPage(getNextPage func(context.Context, Consumer type ConsumerSourceDataSetProperties struct { // DataSetID - READ-ONLY; DataSet Id DataSetID *string `json:"dataSetId,omitempty"` + // DataSetLocation - READ-ONLY; Location of the data set. + DataSetLocation *string `json:"dataSetLocation,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', 'SQLDBTable', 'SQLDWTable' + // DataSetPath - READ-ONLY; DataSet path + DataSetPath *string `json:"dataSetPath,omitempty"` + // DataSetType - READ-ONLY; Type of data set. Possible values include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SQLDBTable', 'SQLDWTable' DataSetType DataSetType `json:"dataSetType,omitempty"` } @@ -3410,6 +3588,8 @@ type BasicDataSet interface { AsADLSGen2FileSystemDataSet() (*ADLSGen2FileSystemDataSet, bool) AsADLSGen1FolderDataSet() (*ADLSGen1FolderDataSet, bool) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, bool) + AsKustoClusterDataSet() (*KustoClusterDataSet, bool) + AsKustoDatabaseDataSet() (*KustoDatabaseDataSet, bool) AsSQLDWTableDataSet() (*SQLDWTableDataSet, bool) AsSQLDBTableDataSet() (*SQLDBTableDataSet, bool) AsDataSet() (*DataSet, bool) @@ -3418,7 +3598,7 @@ type BasicDataSet interface { // 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', 'KindSQLDWTable', 'KindSQLDBTable' + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindKustoCluster', 'KindKustoDatabase', 'KindSQLDWTable', 'KindSQLDBTable' Kind Kind `json:"kind,omitempty"` // ID - READ-ONLY; The resource id of the azure resource ID *string `json:"id,omitempty"` @@ -3468,6 +3648,14 @@ func unmarshalBasicDataSet(body []byte) (BasicDataSet, error) { var ag1fds ADLSGen1FileDataSet err := json.Unmarshal(body, &ag1fds) return ag1fds, err + case string(KindKustoCluster): + var kcds KustoClusterDataSet + err := json.Unmarshal(body, &kcds) + return kcds, err + case string(KindKustoDatabase): + var kdds KustoDatabaseDataSet + err := json.Unmarshal(body, &kdds) + return kdds, err case string(KindSQLDWTable): var sdtds SQLDWTableDataSet err := json.Unmarshal(body, &sdtds) @@ -3551,6 +3739,16 @@ func (ds DataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, bool) { return nil, false } +// AsKustoClusterDataSet is the BasicDataSet implementation for DataSet. +func (ds DataSet) AsKustoClusterDataSet() (*KustoClusterDataSet, bool) { + return nil, false +} + +// AsKustoDatabaseDataSet is the BasicDataSet implementation for DataSet. +func (ds DataSet) AsKustoDatabaseDataSet() (*KustoDatabaseDataSet, bool) { + return nil, false +} + // AsSQLDWTableDataSet is the BasicDataSet implementation for DataSet. func (ds DataSet) AsSQLDWTableDataSet() (*SQLDWTableDataSet, bool) { return nil, false @@ -3749,7 +3947,7 @@ func NewDataSetListPage(getNextPage func(context.Context, DataSetList) (DataSetL return DataSetListPage{fn: getNextPage} } -// BasicDataSetMapping a dataset mapping data transfer object. +// BasicDataSetMapping a data set mapping data transfer object. type BasicDataSetMapping interface { AsBlobDataSetMapping() (*BlobDataSetMapping, bool) AsBlobFolderDataSetMapping() (*BlobFolderDataSetMapping, bool) @@ -3757,15 +3955,17 @@ type BasicDataSetMapping interface { AsADLSGen2FileDataSetMapping() (*ADLSGen2FileDataSetMapping, bool) AsADLSGen2FolderDataSetMapping() (*ADLSGen2FolderDataSetMapping, bool) AsADLSGen2FileSystemDataSetMapping() (*ADLSGen2FileSystemDataSetMapping, bool) + AsKustoClusterDataSetMapping() (*KustoClusterDataSetMapping, bool) + AsKustoDatabaseDataSetMapping() (*KustoDatabaseDataSetMapping, bool) AsSQLDWTableDataSetMapping() (*SQLDWTableDataSetMapping, bool) AsSQLDBTableDataSetMapping() (*SQLDBTableDataSetMapping, bool) AsDataSetMapping() (*DataSetMapping, bool) } -// DataSetMapping a dataset mapping data transfer object. +// DataSetMapping a data set mapping data transfer object. type DataSetMapping struct { autorest.Response `json:"-"` - // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' + // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindKustoCluster', 'KindBasicDataSetMappingKindKustoDatabase', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' Kind KindBasicDataSetMapping `json:"kind,omitempty"` // ID - READ-ONLY; The resource id of the azure resource ID *string `json:"id,omitempty"` @@ -3807,6 +4007,14 @@ func unmarshalBasicDataSetMapping(body []byte) (BasicDataSetMapping, error) { var ag2fsdsm ADLSGen2FileSystemDataSetMapping err := json.Unmarshal(body, &ag2fsdsm) return ag2fsdsm, err + case string(KindBasicDataSetMappingKindKustoCluster): + var kcdsm KustoClusterDataSetMapping + err := json.Unmarshal(body, &kcdsm) + return kcdsm, err + case string(KindBasicDataSetMappingKindKustoDatabase): + var kddsm KustoDatabaseDataSetMapping + err := json.Unmarshal(body, &kddsm) + return kddsm, err case string(KindBasicDataSetMappingKindSQLDWTable): var sdtdsm SQLDWTableDataSetMapping err := json.Unmarshal(body, &sdtdsm) @@ -3880,6 +4088,16 @@ func (dsm DataSetMapping) AsADLSGen2FileSystemDataSetMapping() (*ADLSGen2FileSys return nil, false } +// AsKustoClusterDataSetMapping is the BasicDataSetMapping implementation for DataSetMapping. +func (dsm DataSetMapping) AsKustoClusterDataSetMapping() (*KustoClusterDataSetMapping, bool) { + return nil, false +} + +// AsKustoDatabaseDataSetMapping is the BasicDataSetMapping implementation for DataSetMapping. +func (dsm DataSetMapping) AsKustoDatabaseDataSetMapping() (*KustoDatabaseDataSetMapping, bool) { + return nil, false +} + // AsSQLDWTableDataSetMapping is the BasicDataSetMapping implementation for DataSetMapping. func (dsm DataSetMapping) AsSQLDWTableDataSetMapping() (*SQLDWTableDataSetMapping, bool) { return nil, false @@ -4112,6 +4330,29 @@ func (dsm *DataSetModel) UnmarshalJSON(body []byte) error { return nil } +// DataSetsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DataSetsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DataSetsDeleteFuture) Result(client DataSetsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.DataSetsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("datashare.DataSetsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + // DefaultDto base data transfer object implementation for default resources. type DefaultDto struct { // ID - READ-ONLY; The resource id of the azure resource @@ -4401,8 +4642,6 @@ type InvitationProperties struct { InvitationStatus InvitationStatus `json:"invitationStatus,omitempty"` // RespondedAt - READ-ONLY; The time the recipient responded to the invitation. RespondedAt *date.Time `json:"respondedAt,omitempty"` - // Sender - READ-ONLY; Gets the name of the sender. - Sender *string `json:"sender,omitempty"` // SentAt - READ-ONLY; Gets the time at which the invitation was sent. SentAt *date.Time `json:"sentAt,omitempty"` // TargetActiveDirectoryID - The target Azure AD Id. Can't be combined with email. @@ -4413,158 +4652,822 @@ type InvitationProperties struct { // Must be specified along TargetActiveDirectoryId. This enables sending // invitations to specific users or applications in an AD tenant. TargetObjectID *string `json:"targetObjectId,omitempty"` + // UserEmail - READ-ONLY; Email of the user who created the resource + UserEmail *string `json:"userEmail,omitempty"` + // UserName - READ-ONLY; Name of the user who created the resource + UserName *string `json:"userName,omitempty"` } -// OperationList list response for get operations. -type OperationList struct { - autorest.Response `json:"-"` - // NextLink - The Url of next result page. - NextLink *string `json:"nextLink,omitempty"` - // Value - Collection of items of type DataTransferObjects. - Value *[]OperationModel `json:"value,omitempty"` -} - -// OperationListIterator provides access to a complete listing of OperationModel values. -type OperationListIterator struct { - i int - page OperationListPage +// KustoClusterDataSet a kusto cluster data set. +type KustoClusterDataSet struct { + // KustoClusterDataSetProperties - Kusto cluster data set properties. + *KustoClusterDataSetProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindKustoCluster', 'KindKustoDatabase', '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"` } -// NextWithContext advances 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 +// MarshalJSON is the custom marshaler for KustoClusterDataSet. +func (kcds KustoClusterDataSet) MarshalJSON() ([]byte, error) { + kcds.Kind = KindKustoCluster + objectMap := make(map[string]interface{}) + if kcds.KustoClusterDataSetProperties != nil { + objectMap["properties"] = kcds.KustoClusterDataSetProperties } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err + if kcds.Kind != "" { + objectMap["kind"] = kcds.Kind } - iter.i = 0 - return nil + return json.Marshal(objectMap) } -// Next advances to the next value. 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()) +// AsBlobDataSet is the BasicDataSet implementation for KustoClusterDataSet. +func (kcds KustoClusterDataSet) AsBlobDataSet() (*BlobDataSet, bool) { + return nil, false } -// 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()) +// AsBlobFolderDataSet is the BasicDataSet implementation for KustoClusterDataSet. +func (kcds KustoClusterDataSet) AsBlobFolderDataSet() (*BlobFolderDataSet, bool) { + return nil, false } -// Response returns the raw server response from the last page request. -func (iter OperationListIterator) Response() OperationList { - return iter.page.Response() +// AsBlobContainerDataSet is the BasicDataSet implementation for KustoClusterDataSet. +func (kcds KustoClusterDataSet) AsBlobContainerDataSet() (*BlobContainerDataSet, 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 OperationListIterator) Value() OperationModel { - if !iter.page.NotDone() { - return OperationModel{} - } - return iter.page.Values()[iter.i] +// AsADLSGen2FileDataSet is the BasicDataSet implementation for KustoClusterDataSet. +func (kcds KustoClusterDataSet) AsADLSGen2FileDataSet() (*ADLSGen2FileDataSet, bool) { + return nil, false } -// Creates a new instance of the OperationListIterator type. -func NewOperationListIterator(page OperationListPage) OperationListIterator { - return OperationListIterator{page: page} +// AsADLSGen2FolderDataSet is the BasicDataSet implementation for KustoClusterDataSet. +func (kcds KustoClusterDataSet) AsADLSGen2FolderDataSet() (*ADLSGen2FolderDataSet, bool) { + return nil, false } -// IsEmpty returns true if the ListResult contains no values. -func (ol OperationList) IsEmpty() bool { - return ol.Value == nil || len(*ol.Value) == 0 +// AsADLSGen2FileSystemDataSet is the BasicDataSet implementation for KustoClusterDataSet. +func (kcds KustoClusterDataSet) AsADLSGen2FileSystemDataSet() (*ADLSGen2FileSystemDataSet, bool) { + return nil, false } -// 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))) +// AsADLSGen1FolderDataSet is the BasicDataSet implementation for KustoClusterDataSet. +func (kcds KustoClusterDataSet) AsADLSGen1FolderDataSet() (*ADLSGen1FolderDataSet, bool) { + return nil, false } -// OperationListPage contains a page of OperationModel values. -type OperationListPage struct { - fn func(context.Context, OperationList) (OperationList, error) - ol OperationList +// AsADLSGen1FileDataSet is the BasicDataSet implementation for KustoClusterDataSet. +func (kcds KustoClusterDataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, bool) { + return nil, false } -// NextWithContext advances to the 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 +// AsKustoClusterDataSet is the BasicDataSet implementation for KustoClusterDataSet. +func (kcds KustoClusterDataSet) AsKustoClusterDataSet() (*KustoClusterDataSet, bool) { + return &kcds, true } -// Next advances to the next page of values. 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()) +// AsKustoDatabaseDataSet is the BasicDataSet implementation for KustoClusterDataSet. +func (kcds KustoClusterDataSet) AsKustoDatabaseDataSet() (*KustoDatabaseDataSet, bool) { + return nil, false } -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page OperationListPage) NotDone() bool { - return !page.ol.IsEmpty() +// AsSQLDWTableDataSet is the BasicDataSet implementation for KustoClusterDataSet. +func (kcds KustoClusterDataSet) AsSQLDWTableDataSet() (*SQLDWTableDataSet, bool) { + return nil, false } -// Response returns the raw server response from the last page request. -func (page OperationListPage) Response() OperationList { - return page.ol +// AsSQLDBTableDataSet is the BasicDataSet implementation for KustoClusterDataSet. +func (kcds KustoClusterDataSet) AsSQLDBTableDataSet() (*SQLDBTableDataSet, bool) { + return nil, false } -// Values returns the slice of values for the current page or nil if there are no values. -func (page OperationListPage) Values() []OperationModel { - if page.ol.IsEmpty() { - return nil - } - return *page.ol.Value +// AsDataSet is the BasicDataSet implementation for KustoClusterDataSet. +func (kcds KustoClusterDataSet) AsDataSet() (*DataSet, bool) { + return nil, false } -// Creates a new instance of the OperationListPage type. -func NewOperationListPage(getNextPage func(context.Context, OperationList) (OperationList, error)) OperationListPage { - return OperationListPage{fn: getNextPage} +// AsBasicDataSet is the BasicDataSet implementation for KustoClusterDataSet. +func (kcds KustoClusterDataSet) AsBasicDataSet() (BasicDataSet, bool) { + return &kcds, true } -// OperationMetaLogSpecification log specifications for operation api -type OperationMetaLogSpecification struct { - // BlobDuration - blob duration of the log - BlobDuration *string `json:"blobDuration,omitempty"` +// UnmarshalJSON is the custom unmarshaler for KustoClusterDataSet struct. +func (kcds *KustoClusterDataSet) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var kustoClusterDataSetProperties KustoClusterDataSetProperties + err = json.Unmarshal(*v, &kustoClusterDataSetProperties) + if err != nil { + return err + } + kcds.KustoClusterDataSetProperties = &kustoClusterDataSetProperties + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + kcds.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + kcds.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + kcds.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + kcds.Type = &typeVar + } + } + } + + return nil +} + +// KustoClusterDataSetMapping a Kusto cluster data set mapping +type KustoClusterDataSetMapping struct { + // KustoClusterDataSetMappingProperties - Kusto cluster data set mapping properties. + *KustoClusterDataSetMappingProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindKustoCluster', 'KindBasicDataSetMappingKindKustoDatabase', '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 KustoClusterDataSetMapping. +func (kcdsm KustoClusterDataSetMapping) MarshalJSON() ([]byte, error) { + kcdsm.Kind = KindBasicDataSetMappingKindKustoCluster + objectMap := make(map[string]interface{}) + if kcdsm.KustoClusterDataSetMappingProperties != nil { + objectMap["properties"] = kcdsm.KustoClusterDataSetMappingProperties + } + if kcdsm.Kind != "" { + objectMap["kind"] = kcdsm.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSetMapping is the BasicDataSetMapping implementation for KustoClusterDataSetMapping. +func (kcdsm KustoClusterDataSetMapping) AsBlobDataSetMapping() (*BlobDataSetMapping, bool) { + return nil, false +} + +// AsBlobFolderDataSetMapping is the BasicDataSetMapping implementation for KustoClusterDataSetMapping. +func (kcdsm KustoClusterDataSetMapping) AsBlobFolderDataSetMapping() (*BlobFolderDataSetMapping, bool) { + return nil, false +} + +// AsBlobContainerDataSetMapping is the BasicDataSetMapping implementation for KustoClusterDataSetMapping. +func (kcdsm KustoClusterDataSetMapping) AsBlobContainerDataSetMapping() (*BlobContainerDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FileDataSetMapping is the BasicDataSetMapping implementation for KustoClusterDataSetMapping. +func (kcdsm KustoClusterDataSetMapping) AsADLSGen2FileDataSetMapping() (*ADLSGen2FileDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSetMapping is the BasicDataSetMapping implementation for KustoClusterDataSetMapping. +func (kcdsm KustoClusterDataSetMapping) AsADLSGen2FolderDataSetMapping() (*ADLSGen2FolderDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSetMapping is the BasicDataSetMapping implementation for KustoClusterDataSetMapping. +func (kcdsm KustoClusterDataSetMapping) AsADLSGen2FileSystemDataSetMapping() (*ADLSGen2FileSystemDataSetMapping, bool) { + return nil, false +} + +// AsKustoClusterDataSetMapping is the BasicDataSetMapping implementation for KustoClusterDataSetMapping. +func (kcdsm KustoClusterDataSetMapping) AsKustoClusterDataSetMapping() (*KustoClusterDataSetMapping, bool) { + return &kcdsm, true +} + +// AsKustoDatabaseDataSetMapping is the BasicDataSetMapping implementation for KustoClusterDataSetMapping. +func (kcdsm KustoClusterDataSetMapping) AsKustoDatabaseDataSetMapping() (*KustoDatabaseDataSetMapping, bool) { + return nil, false +} + +// AsSQLDWTableDataSetMapping is the BasicDataSetMapping implementation for KustoClusterDataSetMapping. +func (kcdsm KustoClusterDataSetMapping) AsSQLDWTableDataSetMapping() (*SQLDWTableDataSetMapping, bool) { + return nil, false +} + +// AsSQLDBTableDataSetMapping is the BasicDataSetMapping implementation for KustoClusterDataSetMapping. +func (kcdsm KustoClusterDataSetMapping) AsSQLDBTableDataSetMapping() (*SQLDBTableDataSetMapping, bool) { + return nil, false +} + +// AsDataSetMapping is the BasicDataSetMapping implementation for KustoClusterDataSetMapping. +func (kcdsm KustoClusterDataSetMapping) AsDataSetMapping() (*DataSetMapping, bool) { + return nil, false +} + +// AsBasicDataSetMapping is the BasicDataSetMapping implementation for KustoClusterDataSetMapping. +func (kcdsm KustoClusterDataSetMapping) AsBasicDataSetMapping() (BasicDataSetMapping, bool) { + return &kcdsm, true +} + +// UnmarshalJSON is the custom unmarshaler for KustoClusterDataSetMapping struct. +func (kcdsm *KustoClusterDataSetMapping) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var kustoClusterDataSetMappingProperties KustoClusterDataSetMappingProperties + err = json.Unmarshal(*v, &kustoClusterDataSetMappingProperties) + if err != nil { + return err + } + kcdsm.KustoClusterDataSetMappingProperties = &kustoClusterDataSetMappingProperties + } + case "kind": + if v != nil { + var kind KindBasicDataSetMapping + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + kcdsm.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + kcdsm.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + kcdsm.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + kcdsm.Type = &typeVar + } + } + } + + return nil +} + +// KustoClusterDataSetMappingProperties properties of the Kusto cluster data set mapping +type KustoClusterDataSetMappingProperties struct { + // DataSetID - The id of the source data set. + DataSetID *string `json:"dataSetId,omitempty"` + // DataSetMappingStatus - READ-ONLY; Gets the status of the data set mapping. Possible values include: 'Ok', 'Broken' + DataSetMappingStatus DataSetMappingStatus `json:"dataSetMappingStatus,omitempty"` + // KustoClusterResourceID - Resource id of the sink kusto cluster. + KustoClusterResourceID *string `json:"kustoClusterResourceId,omitempty"` + // Location - READ-ONLY; Location of the sink kusto cluster. + Location *string `json:"location,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the data set mapping. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// KustoClusterDataSetProperties properties of the kusto cluster data set. +type KustoClusterDataSetProperties struct { + // DataSetID - READ-ONLY; Unique id for identifying a data set resource + DataSetID *string `json:"dataSetId,omitempty"` + // KustoClusterResourceID - Resource id of the kusto cluster. + KustoClusterResourceID *string `json:"kustoClusterResourceId,omitempty"` + // Location - READ-ONLY; Location of the kusto cluster. + Location *string `json:"location,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the kusto cluster data set. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// KustoDatabaseDataSet a kusto database data set. +type KustoDatabaseDataSet struct { + // KustoDatabaseDataSetProperties - Kusto database data set properties. + *KustoDatabaseDataSetProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindKustoCluster', 'KindKustoDatabase', '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 KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) MarshalJSON() ([]byte, error) { + kdds.Kind = KindKustoDatabase + objectMap := make(map[string]interface{}) + if kdds.KustoDatabaseDataSetProperties != nil { + objectMap["properties"] = kdds.KustoDatabaseDataSetProperties + } + if kdds.Kind != "" { + objectMap["kind"] = kdds.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSet is the BasicDataSet implementation for KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) AsBlobDataSet() (*BlobDataSet, bool) { + return nil, false +} + +// AsBlobFolderDataSet is the BasicDataSet implementation for KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) AsBlobFolderDataSet() (*BlobFolderDataSet, bool) { + return nil, false +} + +// AsBlobContainerDataSet is the BasicDataSet implementation for KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) AsBlobContainerDataSet() (*BlobContainerDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileDataSet is the BasicDataSet implementation for KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) AsADLSGen2FileDataSet() (*ADLSGen2FileDataSet, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSet is the BasicDataSet implementation for KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) AsADLSGen2FolderDataSet() (*ADLSGen2FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSet is the BasicDataSet implementation for KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) AsADLSGen2FileSystemDataSet() (*ADLSGen2FileSystemDataSet, bool) { + return nil, false +} + +// AsADLSGen1FolderDataSet is the BasicDataSet implementation for KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) AsADLSGen1FolderDataSet() (*ADLSGen1FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen1FileDataSet is the BasicDataSet implementation for KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, bool) { + return nil, false +} + +// AsKustoClusterDataSet is the BasicDataSet implementation for KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) AsKustoClusterDataSet() (*KustoClusterDataSet, bool) { + return nil, false +} + +// AsKustoDatabaseDataSet is the BasicDataSet implementation for KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) AsKustoDatabaseDataSet() (*KustoDatabaseDataSet, bool) { + return &kdds, true +} + +// AsSQLDWTableDataSet is the BasicDataSet implementation for KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) AsSQLDWTableDataSet() (*SQLDWTableDataSet, bool) { + return nil, false +} + +// AsSQLDBTableDataSet is the BasicDataSet implementation for KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) AsSQLDBTableDataSet() (*SQLDBTableDataSet, bool) { + return nil, false +} + +// AsDataSet is the BasicDataSet implementation for KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) AsDataSet() (*DataSet, bool) { + return nil, false +} + +// AsBasicDataSet is the BasicDataSet implementation for KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) AsBasicDataSet() (BasicDataSet, bool) { + return &kdds, true +} + +// UnmarshalJSON is the custom unmarshaler for KustoDatabaseDataSet struct. +func (kdds *KustoDatabaseDataSet) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var kustoDatabaseDataSetProperties KustoDatabaseDataSetProperties + err = json.Unmarshal(*v, &kustoDatabaseDataSetProperties) + if err != nil { + return err + } + kdds.KustoDatabaseDataSetProperties = &kustoDatabaseDataSetProperties + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + kdds.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + kdds.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + kdds.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + kdds.Type = &typeVar + } + } + } + + return nil +} + +// KustoDatabaseDataSetMapping a Kusto database data set mapping +type KustoDatabaseDataSetMapping struct { + // KustoDatabaseDataSetMappingProperties - Kusto database data set mapping properties. + *KustoDatabaseDataSetMappingProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindKustoCluster', 'KindBasicDataSetMappingKindKustoDatabase', '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 KustoDatabaseDataSetMapping. +func (kddsm KustoDatabaseDataSetMapping) MarshalJSON() ([]byte, error) { + kddsm.Kind = KindBasicDataSetMappingKindKustoDatabase + objectMap := make(map[string]interface{}) + if kddsm.KustoDatabaseDataSetMappingProperties != nil { + objectMap["properties"] = kddsm.KustoDatabaseDataSetMappingProperties + } + if kddsm.Kind != "" { + objectMap["kind"] = kddsm.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSetMapping is the BasicDataSetMapping implementation for KustoDatabaseDataSetMapping. +func (kddsm KustoDatabaseDataSetMapping) AsBlobDataSetMapping() (*BlobDataSetMapping, bool) { + return nil, false +} + +// AsBlobFolderDataSetMapping is the BasicDataSetMapping implementation for KustoDatabaseDataSetMapping. +func (kddsm KustoDatabaseDataSetMapping) AsBlobFolderDataSetMapping() (*BlobFolderDataSetMapping, bool) { + return nil, false +} + +// AsBlobContainerDataSetMapping is the BasicDataSetMapping implementation for KustoDatabaseDataSetMapping. +func (kddsm KustoDatabaseDataSetMapping) AsBlobContainerDataSetMapping() (*BlobContainerDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FileDataSetMapping is the BasicDataSetMapping implementation for KustoDatabaseDataSetMapping. +func (kddsm KustoDatabaseDataSetMapping) AsADLSGen2FileDataSetMapping() (*ADLSGen2FileDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSetMapping is the BasicDataSetMapping implementation for KustoDatabaseDataSetMapping. +func (kddsm KustoDatabaseDataSetMapping) AsADLSGen2FolderDataSetMapping() (*ADLSGen2FolderDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSetMapping is the BasicDataSetMapping implementation for KustoDatabaseDataSetMapping. +func (kddsm KustoDatabaseDataSetMapping) AsADLSGen2FileSystemDataSetMapping() (*ADLSGen2FileSystemDataSetMapping, bool) { + return nil, false +} + +// AsKustoClusterDataSetMapping is the BasicDataSetMapping implementation for KustoDatabaseDataSetMapping. +func (kddsm KustoDatabaseDataSetMapping) AsKustoClusterDataSetMapping() (*KustoClusterDataSetMapping, bool) { + return nil, false +} + +// AsKustoDatabaseDataSetMapping is the BasicDataSetMapping implementation for KustoDatabaseDataSetMapping. +func (kddsm KustoDatabaseDataSetMapping) AsKustoDatabaseDataSetMapping() (*KustoDatabaseDataSetMapping, bool) { + return &kddsm, true +} + +// AsSQLDWTableDataSetMapping is the BasicDataSetMapping implementation for KustoDatabaseDataSetMapping. +func (kddsm KustoDatabaseDataSetMapping) AsSQLDWTableDataSetMapping() (*SQLDWTableDataSetMapping, bool) { + return nil, false +} + +// AsSQLDBTableDataSetMapping is the BasicDataSetMapping implementation for KustoDatabaseDataSetMapping. +func (kddsm KustoDatabaseDataSetMapping) AsSQLDBTableDataSetMapping() (*SQLDBTableDataSetMapping, bool) { + return nil, false +} + +// AsDataSetMapping is the BasicDataSetMapping implementation for KustoDatabaseDataSetMapping. +func (kddsm KustoDatabaseDataSetMapping) AsDataSetMapping() (*DataSetMapping, bool) { + return nil, false +} + +// AsBasicDataSetMapping is the BasicDataSetMapping implementation for KustoDatabaseDataSetMapping. +func (kddsm KustoDatabaseDataSetMapping) AsBasicDataSetMapping() (BasicDataSetMapping, bool) { + return &kddsm, true +} + +// UnmarshalJSON is the custom unmarshaler for KustoDatabaseDataSetMapping struct. +func (kddsm *KustoDatabaseDataSetMapping) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var kustoDatabaseDataSetMappingProperties KustoDatabaseDataSetMappingProperties + err = json.Unmarshal(*v, &kustoDatabaseDataSetMappingProperties) + if err != nil { + return err + } + kddsm.KustoDatabaseDataSetMappingProperties = &kustoDatabaseDataSetMappingProperties + } + case "kind": + if v != nil { + var kind KindBasicDataSetMapping + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + kddsm.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + kddsm.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + kddsm.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + kddsm.Type = &typeVar + } + } + } + + return nil +} + +// KustoDatabaseDataSetMappingProperties properties of the Kusto database data set mapping +type KustoDatabaseDataSetMappingProperties struct { + // DataSetID - The id of the source data set. + DataSetID *string `json:"dataSetId,omitempty"` + // DataSetMappingStatus - READ-ONLY; Gets the status of the data set mapping. Possible values include: 'Ok', 'Broken' + DataSetMappingStatus DataSetMappingStatus `json:"dataSetMappingStatus,omitempty"` + // KustoClusterResourceID - Resource id of the sink kusto cluster. + KustoClusterResourceID *string `json:"kustoClusterResourceId,omitempty"` + // Location - READ-ONLY; Location of the sink kusto cluster. + Location *string `json:"location,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the data set mapping. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// KustoDatabaseDataSetProperties properties of the kusto database data set. +type KustoDatabaseDataSetProperties struct { + // DataSetID - READ-ONLY; Unique id for identifying a data set resource + DataSetID *string `json:"dataSetId,omitempty"` + // KustoDatabaseResourceID - Resource id of the kusto database. + KustoDatabaseResourceID *string `json:"kustoDatabaseResourceId,omitempty"` + // Location - READ-ONLY; Location of the kusto cluster. + Location *string `json:"location,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the kusto database data set. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// OperationList list response for get operations. +type OperationList struct { + autorest.Response `json:"-"` + // NextLink - The Url of next result page. + NextLink *string `json:"nextLink,omitempty"` + // Value - Collection of items of type DataTransferObjects. + Value *[]OperationModel `json:"value,omitempty"` +} + +// OperationListIterator provides access to a complete listing of OperationModel 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() OperationModel { + if !iter.page.NotDone() { + return OperationModel{} + } + 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 OperationModel 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() []OperationModel { + 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} +} + +// OperationMetaLogSpecification log specifications for operation api +type OperationMetaLogSpecification struct { + // BlobDuration - blob duration of the log + BlobDuration *string `json:"blobDuration,omitempty"` // DisplayName - localized name of the log category DisplayName *string `json:"displayName,omitempty"` // Name - name of the log category @@ -4939,16 +5842,18 @@ func NewProviderShareSubscriptionListPage(getNextPage func(context.Context, Prov // ProviderShareSubscriptionProperties provider share subscription properties type ProviderShareSubscriptionProperties struct { - // Company - READ-ONLY; Company name - Company *string `json:"company,omitempty"` + // ConsumerEmail - READ-ONLY; Email of the consumer who created the share subscription + ConsumerEmail *string `json:"consumerEmail,omitempty"` + // ConsumerName - READ-ONLY; Name of the consumer who created the share subscription + ConsumerName *string `json:"consumerName,omitempty"` + // ConsumerTenantName - READ-ONLY; Tenant name of the consumer who created the share subscription + ConsumerTenantName *string `json:"consumerTenantName,omitempty"` // CreatedAt - READ-ONLY; created at CreatedAt *date.Time `json:"createdAt,omitempty"` - // CreatedBy - READ-ONLY; Created by - CreatedBy *string `json:"createdBy,omitempty"` + // ProviderName - READ-ONLY; Name of the provider who created the share + ProviderName *string `json:"providerName,omitempty"` // SharedAt - READ-ONLY; Shared at SharedAt *date.Time `json:"sharedAt,omitempty"` - // SharedBy - READ-ONLY; Shared by - SharedBy *string `json:"sharedBy,omitempty"` // ShareSubscriptionObjectID - READ-ONLY; share Subscription Object Id ShareSubscriptionObjectID *string `json:"shareSubscriptionObjectId,omitempty"` // ShareSubscriptionStatus - READ-ONLY; Gets the status of share subscription. Possible values include: 'Active', 'Revoked', 'SourceDeleted', 'Revoking' @@ -5178,14 +6083,14 @@ func (sss *ScheduledSynchronizationSetting) UnmarshalJSON(body []byte) error { type ScheduledSynchronizationSettingProperties struct { // CreatedAt - READ-ONLY; Time at which the synchronization setting was created. CreatedAt *date.Time `json:"createdAt,omitempty"` - // CreatedBy - READ-ONLY; Name of the user who created the synchronization setting. - CreatedBy *string `json:"createdBy,omitempty"` // ProvisioningState - READ-ONLY; Gets or sets the provisioning state. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // RecurrenceInterval - Recurrence Interval. Possible values include: 'Hour', 'Day' RecurrenceInterval RecurrenceInterval `json:"recurrenceInterval,omitempty"` // SynchronizationTime - Synchronization time SynchronizationTime *date.Time `json:"synchronizationTime,omitempty"` + // UserName - READ-ONLY; Name of the user who created the synchronization setting. + UserName *string `json:"userName,omitempty"` } // ScheduledTrigger a type of trigger based on schedule @@ -5294,8 +6199,6 @@ func (st *ScheduledTrigger) UnmarshalJSON(body []byte) error { type ScheduledTriggerProperties struct { // CreatedAt - READ-ONLY; Time at which the trigger was created. CreatedAt *date.Time `json:"createdAt,omitempty"` - // CreatedBy - READ-ONLY; Name of the user who created the trigger. - CreatedBy *string `json:"createdBy,omitempty"` // ProvisioningState - READ-ONLY; Gets the provisioning state. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // RecurrenceInterval - Recurrence Interval. Possible values include: 'Hour', 'Day' @@ -5306,6 +6209,8 @@ type ScheduledTriggerProperties struct { SynchronizationTime *date.Time `json:"synchronizationTime,omitempty"` // TriggerStatus - READ-ONLY; Gets the trigger state. Possible values include: 'TriggerStatusActive', 'TriggerStatusInactive', 'TriggerStatusSourceSynchronizationSettingDeleted' TriggerStatus TriggerStatus `json:"triggerStatus,omitempty"` + // UserName - READ-ONLY; Name of the user who created the trigger. + UserName *string `json:"userName,omitempty"` } // Share a share data transfer object. @@ -5531,16 +6436,18 @@ func NewShareListPage(getNextPage func(context.Context, ShareList) (ShareList, e type ShareProperties struct { // CreatedAt - READ-ONLY; Time at which the share was created. CreatedAt *date.Time `json:"createdAt,omitempty"` - // CreatedBy - READ-ONLY; Name of the user who created the share. - CreatedBy *string `json:"createdBy,omitempty"` // Description - Share description. Description *string `json:"description,omitempty"` // ProvisioningState - READ-ONLY; Gets or sets the provisioning state. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // ShareKind - Share kind. Possible values include: 'CopyBased' + // ShareKind - Share kind. Possible values include: 'CopyBased', 'InPlace' ShareKind ShareKind `json:"shareKind,omitempty"` // Terms - Share terms. Terms *string `json:"terms,omitempty"` + // UserEmail - READ-ONLY; Email of the user who created the resource + UserEmail *string `json:"userEmail,omitempty"` + // UserName - READ-ONLY; Name of the user who created the resource + UserName *string `json:"userName,omitempty"` } // SharesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. @@ -5794,26 +6701,30 @@ func NewShareSubscriptionListPage(getNextPage func(context.Context, ShareSubscri type ShareSubscriptionProperties struct { // CreatedAt - READ-ONLY; Time at which the share subscription was created. CreatedAt *date.Time `json:"createdAt,omitempty"` - // CreatedBy - READ-ONLY; The user who created the share subscription. - CreatedBy *string `json:"createdBy,omitempty"` // InvitationID - The invitation id. InvitationID *string `json:"invitationId,omitempty"` + // ProviderEmail - READ-ONLY; Email of the provider who created the resource + ProviderEmail *string `json:"providerEmail,omitempty"` + // ProviderName - READ-ONLY; Name of the provider who created the resource + ProviderName *string `json:"providerName,omitempty"` + // ProviderTenantName - READ-ONLY; Tenant name of the provider who created the resource + ProviderTenantName *string `json:"providerTenantName,omitempty"` // ProvisioningState - READ-ONLY; Provisioning state of the share subscription. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // ShareDescription - READ-ONLY; Description of share ShareDescription *string `json:"shareDescription,omitempty"` - // ShareKind - READ-ONLY; Kind of share. Possible values include: 'CopyBased' + // ShareKind - READ-ONLY; Kind of share. Possible values include: 'CopyBased', 'InPlace' ShareKind ShareKind `json:"shareKind,omitempty"` // ShareName - READ-ONLY; Name of the share ShareName *string `json:"shareName,omitempty"` - // ShareSender - READ-ONLY; Sender of the share - ShareSender *string `json:"shareSender,omitempty"` - // ShareSenderCompanyName - READ-ONLY; Company name of the share sender - ShareSenderCompanyName *string `json:"shareSenderCompanyName,omitempty"` // ShareSubscriptionStatus - READ-ONLY; Gets the current status of share subscription. Possible values include: 'Active', 'Revoked', 'SourceDeleted', 'Revoking' ShareSubscriptionStatus ShareSubscriptionStatus `json:"shareSubscriptionStatus,omitempty"` // ShareTerms - READ-ONLY; Terms of a share ShareTerms *string `json:"shareTerms,omitempty"` + // UserEmail - READ-ONLY; Email of the user who created the resource + UserEmail *string `json:"userEmail,omitempty"` + // UserName - READ-ONLY; Name of the user who created the resource + UserName *string `json:"userName,omitempty"` } // ShareSubscriptionsCancelSynchronizationFuture an abstraction for monitoring and retrieving the results @@ -5918,6 +6829,8 @@ type ShareSubscriptionSynchronization struct { Status *string `json:"status,omitempty"` // SynchronizationID - Synchronization id SynchronizationID *string `json:"synchronizationId,omitempty"` + // SynchronizationMode - READ-ONLY; Synchronization Mode. Possible values include: 'Incremental', 'FullSync' + SynchronizationMode SynchronizationMode `json:"synchronizationMode,omitempty"` } // ShareSubscriptionSynchronizationList a consumer side list of share subscription synchronizations @@ -6069,22 +6982,26 @@ func NewShareSubscriptionSynchronizationListPage(getNextPage func(context.Contex // ShareSynchronization a ShareSynchronization data transfer object. type ShareSynchronization struct { - // Company - Company name - Company *string `json:"company,omitempty"` + // ConsumerEmail - Email of the user who created the synchronization + ConsumerEmail *string `json:"consumerEmail,omitempty"` + // ConsumerName - Name of the user who created the synchronization + ConsumerName *string `json:"consumerName,omitempty"` + // ConsumerTenantName - Tenant name of the consumer who created the synchronization + ConsumerTenantName *string `json:"consumerTenantName,omitempty"` // DurationMs - synchronization duration DurationMs *int32 `json:"durationMs,omitempty"` // EndTime - End time of synchronization EndTime *date.Time `json:"endTime,omitempty"` // Message - message of synchronization Message *string `json:"message,omitempty"` - // Recipient - Recipient id - Recipient *string `json:"recipient,omitempty"` // StartTime - start time of synchronization StartTime *date.Time `json:"startTime,omitempty"` // Status - Raw Status Status *string `json:"status,omitempty"` // SynchronizationID - Synchronization id SynchronizationID *string `json:"synchronizationId,omitempty"` + // SynchronizationMode - READ-ONLY; Synchronization mode. Possible values include: 'Incremental', 'FullSync' + SynchronizationMode SynchronizationMode `json:"synchronizationMode,omitempty"` } // ShareSynchronizationList list response for get ShareSynchronization. @@ -6487,11 +7404,11 @@ func NewSourceShareSynchronizationSettingListPage(getNextPage func(context.Conte return SourceShareSynchronizationSettingListPage{fn: getNextPage} } -// SQLDBTableDataSet a SQL DB table dataset. +// SQLDBTableDataSet a SQL DB table data set. type SQLDBTableDataSet struct { - // SQLDBTableProperties - SQL DB table dataset properties. + // SQLDBTableProperties - SQL DB table data set properties. *SQLDBTableProperties `json:"properties,omitempty"` - // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindSQLDWTable', 'KindSQLDBTable' + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindKustoCluster', 'KindKustoDatabase', 'KindSQLDWTable', 'KindSQLDBTable' Kind Kind `json:"kind,omitempty"` // ID - READ-ONLY; The resource id of the azure resource ID *string `json:"id,omitempty"` @@ -6554,6 +7471,16 @@ func (sdtds SQLDBTableDataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, bo return nil, false } +// AsKustoClusterDataSet is the BasicDataSet implementation for SQLDBTableDataSet. +func (sdtds SQLDBTableDataSet) AsKustoClusterDataSet() (*KustoClusterDataSet, bool) { + return nil, false +} + +// AsKustoDatabaseDataSet is the BasicDataSet implementation for SQLDBTableDataSet. +func (sdtds SQLDBTableDataSet) AsKustoDatabaseDataSet() (*KustoDatabaseDataSet, bool) { + return nil, false +} + // AsSQLDWTableDataSet is the BasicDataSet implementation for SQLDBTableDataSet. func (sdtds SQLDBTableDataSet) AsSQLDWTableDataSet() (*SQLDWTableDataSet, bool) { return nil, false @@ -6634,11 +7561,11 @@ func (sdtds *SQLDBTableDataSet) UnmarshalJSON(body []byte) error { return nil } -// SQLDBTableDataSetMapping a SQL DB Table dataset mapping. +// SQLDBTableDataSetMapping a SQL DB Table data set mapping. type SQLDBTableDataSetMapping struct { - // SQLDBTableDataSetMappingProperties - Sql DB dataset mapping properties. + // SQLDBTableDataSetMappingProperties - Sql DB data set mapping properties. *SQLDBTableDataSetMappingProperties `json:"properties,omitempty"` - // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' + // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindKustoCluster', 'KindBasicDataSetMappingKindKustoDatabase', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' Kind KindBasicDataSetMapping `json:"kind,omitempty"` // ID - READ-ONLY; The resource id of the azure resource ID *string `json:"id,omitempty"` @@ -6691,6 +7618,16 @@ func (sdtdsm SQLDBTableDataSetMapping) AsADLSGen2FileSystemDataSetMapping() (*AD return nil, false } +// AsKustoClusterDataSetMapping is the BasicDataSetMapping implementation for SQLDBTableDataSetMapping. +func (sdtdsm SQLDBTableDataSetMapping) AsKustoClusterDataSetMapping() (*KustoClusterDataSetMapping, bool) { + return nil, false +} + +// AsKustoDatabaseDataSetMapping is the BasicDataSetMapping implementation for SQLDBTableDataSetMapping. +func (sdtdsm SQLDBTableDataSetMapping) AsKustoDatabaseDataSetMapping() (*KustoDatabaseDataSetMapping, bool) { + return nil, false +} + // AsSQLDWTableDataSetMapping is the BasicDataSetMapping implementation for SQLDBTableDataSetMapping. func (sdtdsm SQLDBTableDataSetMapping) AsSQLDWTableDataSetMapping() (*SQLDWTableDataSetMapping, bool) { return nil, false @@ -6775,10 +7712,14 @@ func (sdtdsm *SQLDBTableDataSetMapping) UnmarshalJSON(body []byte) error { type SQLDBTableDataSetMappingProperties struct { // DatabaseName - DatabaseName name of the sink data set DatabaseName *string `json:"databaseName,omitempty"` - // DataSetID - Gets the id of source dataset. + // DataSetID - The id of the source data set. DataSetID *string `json:"dataSetId,omitempty"` - // DataSetMappingStatus - Gets the status of the dataset mapping. Possible values include: 'Ok', 'Broken' + // DataSetMappingStatus - READ-ONLY; Gets the status of the data set mapping. Possible values include: 'Ok', 'Broken' DataSetMappingStatus DataSetMappingStatus `json:"dataSetMappingStatus,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the data set mapping. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // SchemaName - Schema of the table. Default value is dbo. + SchemaName *string `json:"schemaName,omitempty"` // SQLServerResourceID - Resource id of SQL server SQLServerResourceID *string `json:"sqlServerResourceId,omitempty"` // TableName - SQL DB table name. @@ -6791,17 +7732,19 @@ type SQLDBTableProperties struct { DatabaseName *string `json:"databaseName,omitempty"` // DataSetID - READ-ONLY; Unique id for identifying a data set resource DataSetID *string `json:"dataSetId,omitempty"` + // SchemaName - Schema of the table. Default value is dbo. + SchemaName *string `json:"schemaName,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. +// SQLDWTableDataSet a SQL DW table data set. type SQLDWTableDataSet struct { - // SQLDWTableProperties - SQL DW table dataset properties. + // SQLDWTableProperties - SQL DW table data set properties. *SQLDWTableProperties `json:"properties,omitempty"` - // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindSQLDWTable', 'KindSQLDBTable' + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindKustoCluster', 'KindKustoDatabase', 'KindSQLDWTable', 'KindSQLDBTable' Kind Kind `json:"kind,omitempty"` // ID - READ-ONLY; The resource id of the azure resource ID *string `json:"id,omitempty"` @@ -6864,6 +7807,16 @@ func (sdtds SQLDWTableDataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, bo return nil, false } +// AsKustoClusterDataSet is the BasicDataSet implementation for SQLDWTableDataSet. +func (sdtds SQLDWTableDataSet) AsKustoClusterDataSet() (*KustoClusterDataSet, bool) { + return nil, false +} + +// AsKustoDatabaseDataSet is the BasicDataSet implementation for SQLDWTableDataSet. +func (sdtds SQLDWTableDataSet) AsKustoDatabaseDataSet() (*KustoDatabaseDataSet, bool) { + return nil, false +} + // AsSQLDWTableDataSet is the BasicDataSet implementation for SQLDWTableDataSet. func (sdtds SQLDWTableDataSet) AsSQLDWTableDataSet() (*SQLDWTableDataSet, bool) { return &sdtds, true @@ -6944,11 +7897,11 @@ func (sdtds *SQLDWTableDataSet) UnmarshalJSON(body []byte) error { return nil } -// SQLDWTableDataSetMapping a SQL DW Table dataset mapping. +// SQLDWTableDataSetMapping a SQL DW Table data set mapping. type SQLDWTableDataSetMapping struct { - // SQLDWTableDataSetMappingProperties - Sql DW dataset mapping properties. + // SQLDWTableDataSetMappingProperties - Sql DW data set mapping properties. *SQLDWTableDataSetMappingProperties `json:"properties,omitempty"` - // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' + // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindKustoCluster', 'KindBasicDataSetMappingKindKustoDatabase', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' Kind KindBasicDataSetMapping `json:"kind,omitempty"` // ID - READ-ONLY; The resource id of the azure resource ID *string `json:"id,omitempty"` @@ -7001,6 +7954,16 @@ func (sdtdsm SQLDWTableDataSetMapping) AsADLSGen2FileSystemDataSetMapping() (*AD return nil, false } +// AsKustoClusterDataSetMapping is the BasicDataSetMapping implementation for SQLDWTableDataSetMapping. +func (sdtdsm SQLDWTableDataSetMapping) AsKustoClusterDataSetMapping() (*KustoClusterDataSetMapping, bool) { + return nil, false +} + +// AsKustoDatabaseDataSetMapping is the BasicDataSetMapping implementation for SQLDWTableDataSetMapping. +func (sdtdsm SQLDWTableDataSetMapping) AsKustoDatabaseDataSetMapping() (*KustoDatabaseDataSetMapping, bool) { + return nil, false +} + // AsSQLDWTableDataSetMapping is the BasicDataSetMapping implementation for SQLDWTableDataSetMapping. func (sdtdsm SQLDWTableDataSetMapping) AsSQLDWTableDataSetMapping() (*SQLDWTableDataSetMapping, bool) { return &sdtdsm, true @@ -7083,12 +8046,16 @@ func (sdtdsm *SQLDWTableDataSetMapping) UnmarshalJSON(body []byte) error { // SQLDWTableDataSetMappingProperties properties of the SQL DW table data set mapping. type SQLDWTableDataSetMappingProperties struct { - // DataSetID - Gets the id of source dataset. + // DataSetID - The id of the source data set. DataSetID *string `json:"dataSetId,omitempty"` - // DataSetMappingStatus - Gets the status of the dataset mapping. Possible values include: 'Ok', 'Broken' + // DataSetMappingStatus - READ-ONLY; Gets the status of the data set mapping. Possible values include: 'Ok', 'Broken' DataSetMappingStatus DataSetMappingStatus `json:"dataSetMappingStatus,omitempty"` // DataWarehouseName - DataWarehouse name of the source data set DataWarehouseName *string `json:"dataWarehouseName,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the data set mapping. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // SchemaName - Schema of the table. Default value is dbo. + SchemaName *string `json:"schemaName,omitempty"` // SQLServerResourceID - Resource id of SQL server SQLServerResourceID *string `json:"sqlServerResourceId,omitempty"` // TableName - SQL DW table name. @@ -7101,43 +8068,45 @@ type SQLDWTableProperties struct { DataSetID *string `json:"dataSetId,omitempty"` // DataWarehouseName - DataWarehouse name of the source data set DataWarehouseName *string `json:"dataWarehouseName,omitempty"` + // SchemaName - Schema of the table. Default value is dbo. + SchemaName *string `json:"schemaName,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 +// SynchronizationDetails synchronization details at data set level type SynchronizationDetails struct { - // DataSetID - READ-ONLY; id of dataSet + // DataSetID - READ-ONLY; Id of data set DataSetID *string `json:"dataSetId,omitempty"` - // DataSetType - READ-ONLY; type of DataSet. Possible values include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'SQLDBTable', 'SQLDWTable' + // DataSetType - READ-ONLY; Type of the data set. Possible values include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SQLDBTable', 'SQLDWTable' DataSetType DataSetType `json:"dataSetType,omitempty"` - // DurationMs - READ-ONLY; duration of dataset level copy + // DurationMs - READ-ONLY; Duration of data set level copy DurationMs *int32 `json:"durationMs,omitempty"` - // EndTime - READ-ONLY; End time of dataset level copy + // EndTime - READ-ONLY; End time of data set level copy EndTime *date.Time `json:"endTime,omitempty"` - // FilesRead - READ-ONLY; The number of files read from the source dataset. + // FilesRead - READ-ONLY; The number of files read from the source data set FilesRead *int64 `json:"filesRead,omitempty"` - // FilesWritten - READ-ONLY; The number of files written into the sink dataset. + // FilesWritten - READ-ONLY; The number of files written into the sink data set FilesWritten *int64 `json:"filesWritten,omitempty"` - // Message - READ-ONLY; Error Message if any + // Message - READ-ONLY; Error message if any Message *string `json:"message,omitempty"` - // Name - READ-ONLY; name of dataSet + // Name - READ-ONLY; Name of the data set Name *string `json:"name,omitempty"` - // RowsCopied - READ-ONLY; The number of files copied into the sink dataset. + // RowsCopied - READ-ONLY; The number of files copied into the sink data set RowsCopied *int64 `json:"rowsCopied,omitempty"` - // RowsRead - READ-ONLY; The number of rows read from the source dataset. + // RowsRead - READ-ONLY; The number of rows read from the source data set. RowsRead *int64 `json:"rowsRead,omitempty"` - // SizeRead - READ-ONLY; The size of the data read from the source dataset in bytes. + // SizeRead - READ-ONLY; The size of the data read from the source data set in bytes SizeRead *int64 `json:"sizeRead,omitempty"` - // SizeWritten - READ-ONLY; The size of the data written into the sink dataset in bytes. + // SizeWritten - READ-ONLY; The size of the data written into the sink data set in bytes SizeWritten *int64 `json:"sizeWritten,omitempty"` - // StartTime - READ-ONLY; start time of dataset level copy + // StartTime - READ-ONLY; Start time of data set level copy StartTime *date.Time `json:"startTime,omitempty"` // Status - READ-ONLY; Raw Status Status *string `json:"status,omitempty"` - // VCore - READ-ONLY; The vCore units consumed for the dataset synchronization. + // VCore - READ-ONLY; The vCore units consumed for the data set synchronization VCore *int64 `json:"vCore,omitempty"` } diff --git a/services/preview/datashare/mgmt/2018-11-01-preview/datashare/shares.go b/services/preview/datashare/mgmt/2018-11-01-preview/datashare/shares.go index 4befdf3f4996..a097385910d9 100644 --- a/services/preview/datashare/mgmt/2018-11-01-preview/datashare/shares.go +++ b/services/preview/datashare/mgmt/2018-11-01-preview/datashare/shares.go @@ -456,6 +456,7 @@ func (client SharesClient) ListSynchronizationDetailsPreparer(ctx context.Contex queryParameters["$skipToken"] = autorest.Encode("query", skipToken) } + shareSynchronization.SynchronizationMode = "" preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), diff --git a/services/preview/datashare/mgmt/2018-11-01-preview/datashare/sharesubscriptions.go b/services/preview/datashare/mgmt/2018-11-01-preview/datashare/sharesubscriptions.go index 6a543e2b4837..b55873cc2cbd 100644 --- a/services/preview/datashare/mgmt/2018-11-01-preview/datashare/sharesubscriptions.go +++ b/services/preview/datashare/mgmt/2018-11-01-preview/datashare/sharesubscriptions.go @@ -98,6 +98,7 @@ func (client ShareSubscriptionsClient) CancelSynchronizationPreparer(ctx context shareSubscriptionSynchronization.Message = nil shareSubscriptionSynchronization.StartTime = nil shareSubscriptionSynchronization.Status = nil + shareSubscriptionSynchronization.SynchronizationMode = "" preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), @@ -689,6 +690,7 @@ func (client ShareSubscriptionsClient) ListSynchronizationDetailsPreparer(ctx co shareSubscriptionSynchronization.Message = nil shareSubscriptionSynchronization.StartTime = nil shareSubscriptionSynchronization.Status = nil + shareSubscriptionSynchronization.SynchronizationMode = "" preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), diff --git a/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/models.go b/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/models.go index 8a3ad3c6d17c..c0e01c5e8f76 100644 --- a/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/models.go +++ b/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/models.go @@ -46,6 +46,19 @@ func PossibleDefaultActionValues() []DefaultAction { return []DefaultAction{Allow, Deny} } +// IdentityType enumerates the values for identity type. +type IdentityType string + +const ( + // SystemAssigned ... + SystemAssigned IdentityType = "SystemAssigned" +) + +// PossibleIdentityTypeValues returns an array of possible values for the IdentityType const type. +func PossibleIdentityTypeValues() []IdentityType { + return []IdentityType{SystemAssigned} +} + // IPAction enumerates the values for ip action. type IPAction string @@ -61,6 +74,19 @@ func PossibleIPActionValues() []IPAction { return []IPAction{Accept, Reject} } +// KeySource enumerates the values for key source. +type KeySource string + +const ( + // MicrosoftKeyVault ... + MicrosoftKeyVault KeySource = "Microsoft.KeyVault" +) + +// PossibleKeySourceValues returns an array of possible values for the KeySource const type. +func PossibleKeySourceValues() []KeySource { + return []KeySource{MicrosoftKeyVault} +} + // NetworkRuleIPAction enumerates the values for network rule ip action. type NetworkRuleIPAction string @@ -778,6 +804,8 @@ type EHNamespaceProperties struct { UpdatedAt *date.Time `json:"updatedAt,omitempty"` // ServiceBusEndpoint - READ-ONLY; Endpoint you can use to perform Service Bus operations. ServiceBusEndpoint *string `json:"serviceBusEndpoint,omitempty"` + // ClusterArmID - Cluster ARM ID of the Namespace. + ClusterArmID *string `json:"clusterArmId,omitempty"` // MetricID - READ-ONLY; Identifier for Azure Insights metrics. MetricID *string `json:"metricId,omitempty"` // IsAutoInflateEnabled - Value that indicates whether AutoInflate is enabled for eventhub namespace. @@ -788,6 +816,18 @@ type EHNamespaceProperties struct { KafkaEnabled *bool `json:"kafkaEnabled,omitempty"` // ZoneRedundant - Enabling this property creates a Standard Event Hubs Namespace in regions supported availability zones. ZoneRedundant *bool `json:"zoneRedundant,omitempty"` + // Identity - Properties of BYOK Identity description + Identity *Identity `json:"identity,omitempty"` + // Encryption - Properties of BYOK Encryption description + Encryption *Encryption `json:"encryption,omitempty"` +} + +// Encryption properties to configure Encryption +type Encryption struct { + // KeyVaultProperties - Properties of KeyVault + KeyVaultProperties *KeyVaultProperties `json:"keyVaultProperties,omitempty"` + // KeySource - Enumerates the possible value of keySource for Encryption. Possible values include: 'MicrosoftKeyVault' + KeySource KeySource `json:"keySource,omitempty"` } // ErrorResponse error response that indicates the service is not able to process the incoming request. The @@ -799,6 +839,16 @@ type ErrorResponse struct { Message *string `json:"message,omitempty"` } +// Identity properties to configure Identity for Bring your Own Keys +type Identity struct { + // PrincipalID - ObjectId from the KeyVault + PrincipalID *string `json:"principalId,omitempty"` + // TenantID - TenantId from the KeyVault + TenantID *string `json:"tenantId,omitempty"` + // Type - Enumerates the possible value Identity type, which currently supports only 'SystemAssigned'. Possible values include: 'SystemAssigned' + Type IdentityType `json:"type,omitempty"` +} + // IPFilterRule single item in a List or Get IpFilterRules operation type IPFilterRule struct { autorest.Response `json:"-"` @@ -1028,6 +1078,14 @@ type IPFilterRuleProperties struct { FilterName *string `json:"filterName,omitempty"` } +// KeyVaultProperties properties to configure keyVault Properties +type KeyVaultProperties struct { + // KeyName - Name of the Key from KeyVault + KeyName *string `json:"keyName,omitempty"` + // KeyVaultURI - Uri of KeyVault + KeyVaultURI *string `json:"keyVaultUri,omitempty"` +} + // NamespacesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type NamespacesCreateOrUpdateFuture struct { diff --git a/services/preview/hdinsight/mgmt/2015-03-01-preview/hdinsight/models.go b/services/preview/hdinsight/mgmt/2015-03-01-preview/hdinsight/models.go index 9bb620534336..d4cc4f5a350d 100644 --- a/services/preview/hdinsight/mgmt/2015-03-01-preview/hdinsight/models.go +++ b/services/preview/hdinsight/mgmt/2015-03-01-preview/hdinsight/models.go @@ -30,34 +30,6 @@ import ( // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2015-03-01-preview/hdinsight" -// ApplicationHTTPSEndpointAccessMode enumerates the values for application https endpoint access mode. -type ApplicationHTTPSEndpointAccessMode string - -const ( - // WebPage ... - WebPage ApplicationHTTPSEndpointAccessMode = "WebPage" -) - -// PossibleApplicationHTTPSEndpointAccessModeValues returns an array of possible values for the ApplicationHTTPSEndpointAccessMode const type. -func PossibleApplicationHTTPSEndpointAccessModeValues() []ApplicationHTTPSEndpointAccessMode { - return []ApplicationHTTPSEndpointAccessMode{WebPage} -} - -// ApplicationType enumerates the values for application type. -type ApplicationType string - -const ( - // CustomApplication ... - CustomApplication ApplicationType = "CustomApplication" - // RServer ... - RServer ApplicationType = "RServer" -) - -// PossibleApplicationTypeValues returns an array of possible values for the ApplicationType const type. -func PossibleApplicationTypeValues() []ApplicationType { - return []ApplicationType{CustomApplication, RServer} -} - // AsyncOperationState enumerates the values for async operation state. type AsyncOperationState string @@ -260,7 +232,7 @@ type ApplicationGetEndpoint struct { // ApplicationGetHTTPSEndpoint gets the application HTTP endpoints. type ApplicationGetHTTPSEndpoint struct { // AccessModes - The list of access modes for the application. - AccessModes *[]ApplicationHTTPSEndpointAccessMode `json:"accessModes,omitempty"` + AccessModes *[]string `json:"accessModes,omitempty"` // Location - The location of the endpoint. Location *string `json:"location,omitempty"` // DestinationPort - The destination port to connect to. @@ -434,8 +406,8 @@ type ApplicationProperties struct { SSHEndpoints *[]ApplicationGetEndpoint `json:"sshEndpoints,omitempty"` // ProvisioningState - READ-ONLY; The provisioning state of the application. ProvisioningState *string `json:"provisioningState,omitempty"` - // ApplicationType - The application type. Possible values include: 'CustomApplication', 'RServer' - ApplicationType ApplicationType `json:"applicationType,omitempty"` + // ApplicationType - The application type. + ApplicationType *string `json:"applicationType,omitempty"` // ApplicationState - READ-ONLY; The application state. ApplicationState *string `json:"applicationState,omitempty"` // Errors - The list of errors. diff --git a/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/models.go b/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/models.go index c8679a059aff..ec244d5e7a5c 100644 --- a/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/models.go +++ b/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/models.go @@ -30,34 +30,6 @@ import ( // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight" -// ApplicationHTTPSEndpointAccessMode enumerates the values for application https endpoint access mode. -type ApplicationHTTPSEndpointAccessMode string - -const ( - // WebPage ... - WebPage ApplicationHTTPSEndpointAccessMode = "WebPage" -) - -// PossibleApplicationHTTPSEndpointAccessModeValues returns an array of possible values for the ApplicationHTTPSEndpointAccessMode const type. -func PossibleApplicationHTTPSEndpointAccessModeValues() []ApplicationHTTPSEndpointAccessMode { - return []ApplicationHTTPSEndpointAccessMode{WebPage} -} - -// ApplicationType enumerates the values for application type. -type ApplicationType string - -const ( - // CustomApplication ... - CustomApplication ApplicationType = "CustomApplication" - // RServer ... - RServer ApplicationType = "RServer" -) - -// PossibleApplicationTypeValues returns an array of possible values for the ApplicationType const type. -func PossibleApplicationTypeValues() []ApplicationType { - return []ApplicationType{CustomApplication, RServer} -} - // AsyncOperationState enumerates the values for async operation state. type AsyncOperationState string @@ -260,7 +232,7 @@ type ApplicationGetEndpoint struct { // ApplicationGetHTTPSEndpoint gets the application HTTP endpoints. type ApplicationGetHTTPSEndpoint struct { // AccessModes - The list of access modes for the application. - AccessModes *[]ApplicationHTTPSEndpointAccessMode `json:"accessModes,omitempty"` + AccessModes *[]string `json:"accessModes,omitempty"` // Location - The location of the endpoint. Location *string `json:"location,omitempty"` // DestinationPort - The destination port to connect to. @@ -434,8 +406,8 @@ type ApplicationProperties struct { SSHEndpoints *[]ApplicationGetEndpoint `json:"sshEndpoints,omitempty"` // ProvisioningState - READ-ONLY; The provisioning state of the application. ProvisioningState *string `json:"provisioningState,omitempty"` - // ApplicationType - The application type. Possible values include: 'CustomApplication', 'RServer' - ApplicationType ApplicationType `json:"applicationType,omitempty"` + // ApplicationType - The application type. + ApplicationType *string `json:"applicationType,omitempty"` // ApplicationState - READ-ONLY; The application state. ApplicationState *string `json:"applicationState,omitempty"` // Errors - The list of errors. diff --git a/services/preview/hybridcompute/mgmt/2019-03-18-preview/hybridcompute/client.go b/services/preview/hybridcompute/mgmt/2019-03-18-preview/hybridcompute/client.go new file mode 100644 index 000000000000..12a0d603aee4 --- /dev/null +++ b/services/preview/hybridcompute/mgmt/2019-03-18-preview/hybridcompute/client.go @@ -0,0 +1,51 @@ +// Package hybridcompute implements the Azure ARM Hybridcompute service API version 2019-03-18-preview. +// +// The Hybrid Compute Management Client. +package hybridcompute + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the 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 Hybridcompute + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Hybridcompute. +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/hybridcompute/mgmt/2019-03-18-preview/hybridcompute/hybridcomputeapi/interfaces.go b/services/preview/hybridcompute/mgmt/2019-03-18-preview/hybridcompute/hybridcomputeapi/interfaces.go new file mode 100644 index 000000000000..3624060b7804 --- /dev/null +++ b/services/preview/hybridcompute/mgmt/2019-03-18-preview/hybridcompute/hybridcomputeapi/interfaces.go @@ -0,0 +1,44 @@ +package hybridcomputeapi + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by 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/hybridcompute/mgmt/2019-03-18-preview/hybridcompute" + "github.com/Azure/go-autorest/autorest" +) + +// MachinesClientAPI contains the set of methods on the MachinesClient type. +type MachinesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, name string, parameters hybridcompute.Machine) (result hybridcompute.Machine, err error) + Delete(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, name string, expand hybridcompute.InstanceViewTypes) (result hybridcompute.Machine, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result hybridcompute.MachineListResultPage, err error) + ListBySubscription(ctx context.Context) (result hybridcompute.MachineListResultPage, err error) + Reconnect(ctx context.Context, resourceGroupName string, name string, parameters hybridcompute.MachineReconnect) (result hybridcompute.Machine, err error) + Update(ctx context.Context, resourceGroupName string, name string, parameters hybridcompute.MachineUpdate) (result hybridcompute.Machine, err error) +} + +var _ MachinesClientAPI = (*hybridcompute.MachinesClient)(nil) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result hybridcompute.OperationListResult, err error) +} + +var _ OperationsClientAPI = (*hybridcompute.OperationsClient)(nil) diff --git a/services/preview/hybridcompute/mgmt/2019-03-18-preview/hybridcompute/machines.go b/services/preview/hybridcompute/mgmt/2019-03-18-preview/hybridcompute/machines.go new file mode 100644 index 000000000000..0fe8112e987a --- /dev/null +++ b/services/preview/hybridcompute/mgmt/2019-03-18-preview/hybridcompute/machines.go @@ -0,0 +1,663 @@ +package hybridcompute + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if 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" +) + +// MachinesClient is the the Hybrid Compute Management Client. +type MachinesClient struct { + BaseClient +} + +// NewMachinesClient creates an instance of the MachinesClient client. +func NewMachinesClient(subscriptionID string) MachinesClient { + return NewMachinesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewMachinesClientWithBaseURI creates an instance of the MachinesClient client. +func NewMachinesClientWithBaseURI(baseURI string, subscriptionID string) MachinesClient { + return MachinesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate the operation to create or update a hybrid machine resource identity in Azure. +// Parameters: +// resourceGroupName - the name of the resource group. +// name - the name of the hybrid machine. +// parameters - parameters supplied to the Create hybrid machine operation. +func (client MachinesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, name string, parameters Machine) (result Machine, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MachinesClient.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, name, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "hybridcompute.MachinesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "hybridcompute.MachinesClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "hybridcompute.MachinesClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client MachinesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, name string, parameters Machine) (*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-03-18-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.HybridCompute/machines/{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 MachinesClient) 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 MachinesClient) CreateOrUpdateResponder(resp *http.Response) (result Machine, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to remove a hybrid machine identity in Azure. +// Parameters: +// resourceGroupName - the name of the resource group. +// name - the name of the hybrid machine. +func (client MachinesClient) Delete(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MachinesClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "hybridcompute.MachinesClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "hybridcompute.MachinesClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "hybridcompute.MachinesClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client MachinesClient) 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-03-18-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.HybridCompute/machines/{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 MachinesClient) 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 MachinesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieves information about the model view or the instance view of a hybrid machine. +// Parameters: +// resourceGroupName - the name of the resource group. +// name - the name of the hybrid machine. +// expand - the expand expression to apply on the operation. +func (client MachinesClient) Get(ctx context.Context, resourceGroupName string, name string, expand InstanceViewTypes) (result Machine, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MachinesClient.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, name, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "hybridcompute.MachinesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "hybridcompute.MachinesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "hybridcompute.MachinesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client MachinesClient) GetPreparer(ctx context.Context, resourceGroupName string, name string, expand InstanceViewTypes) (*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-03-18-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(string(expand)) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{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 MachinesClient) 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 MachinesClient) GetResponder(resp *http.Response) (result Machine, 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 hybrid machines in the specified resource group. Use the nextLink property in the +// response to get the next page of hybrid machines. +// Parameters: +// resourceGroupName - the name of the resource group. +func (client MachinesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result MachineListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MachinesClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.mlr.Response.Response != nil { + sc = result.mlr.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, "hybridcompute.MachinesClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.mlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "hybridcompute.MachinesClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.mlr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "hybridcompute.MachinesClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client MachinesClient) 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-18-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.HybridCompute/machines", 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 MachinesClient) 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 MachinesClient) ListByResourceGroupResponder(resp *http.Response) (result MachineListResult, 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 MachinesClient) listByResourceGroupNextResults(ctx context.Context, lastResults MachineListResult) (result MachineListResult, err error) { + req, err := lastResults.machineListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "hybridcompute.MachinesClient", "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, "hybridcompute.MachinesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "hybridcompute.MachinesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client MachinesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result MachineListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MachinesClient.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 the hybrid machines in the specified subscription. Use the nextLink property in the +// response to get the next page of hybrid machines. +func (client MachinesClient) ListBySubscription(ctx context.Context) (result MachineListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MachinesClient.ListBySubscription") + defer func() { + sc := -1 + if result.mlr.Response.Response != nil { + sc = result.mlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "hybridcompute.MachinesClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.mlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "hybridcompute.MachinesClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.mlr, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "hybridcompute.MachinesClient", "ListBySubscription", resp, "Failure responding to request") + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client MachinesClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-03-18-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/machines", 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 MachinesClient) 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 MachinesClient) ListBySubscriptionResponder(resp *http.Response) (result MachineListResult, 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 MachinesClient) listBySubscriptionNextResults(ctx context.Context, lastResults MachineListResult) (result MachineListResult, err error) { + req, err := lastResults.machineListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "hybridcompute.MachinesClient", "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, "hybridcompute.MachinesClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "hybridcompute.MachinesClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client MachinesClient) ListBySubscriptionComplete(ctx context.Context) (result MachineListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MachinesClient.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 +} + +// Reconnect the operation to reconnect a hybrid machine resource to its identity in Azure. +// Parameters: +// resourceGroupName - the name of the resource group. +// name - the name of the hybrid machine. +// parameters - parameters supplied to the Reconnect hybrid machine operation. +func (client MachinesClient) Reconnect(ctx context.Context, resourceGroupName string, name string, parameters MachineReconnect) (result Machine, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MachinesClient.Reconnect") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ReconnectPreparer(ctx, resourceGroupName, name, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "hybridcompute.MachinesClient", "Reconnect", nil, "Failure preparing request") + return + } + + resp, err := client.ReconnectSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "hybridcompute.MachinesClient", "Reconnect", resp, "Failure sending request") + return + } + + result, err = client.ReconnectResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "hybridcompute.MachinesClient", "Reconnect", resp, "Failure responding to request") + } + + return +} + +// ReconnectPreparer prepares the Reconnect request. +func (client MachinesClient) ReconnectPreparer(ctx context.Context, resourceGroupName string, name string, parameters MachineReconnect) (*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-03-18-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.HybridCompute/machines/{name}/reconnect", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReconnectSender sends the Reconnect request. The method will close the +// http.Response Body if it receives an error. +func (client MachinesClient) ReconnectSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ReconnectResponder handles the response to the Reconnect request. The method always +// closes the http.Response Body. +func (client MachinesClient) ReconnectResponder(resp *http.Response) (result Machine, 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 the operation to update a hybrid machine. +// Parameters: +// resourceGroupName - the name of the resource group. +// name - the name of the hybrid machine. +// parameters - parameters supplied to the Update hybrid machine operation. +func (client MachinesClient) Update(ctx context.Context, resourceGroupName string, name string, parameters MachineUpdate) (result Machine, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MachinesClient.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, name, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "hybridcompute.MachinesClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "hybridcompute.MachinesClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "hybridcompute.MachinesClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client MachinesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, name string, parameters MachineUpdate) (*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-03-18-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.HybridCompute/machines/{name}", 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 MachinesClient) 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 MachinesClient) UpdateResponder(resp *http.Response) (result Machine, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/hybridcompute/mgmt/2019-03-18-preview/hybridcompute/models.go b/services/preview/hybridcompute/mgmt/2019-03-18-preview/hybridcompute/models.go new file mode 100644 index 000000000000..afe793fd4bc7 --- /dev/null +++ b/services/preview/hybridcompute/mgmt/2019-03-18-preview/hybridcompute/models.go @@ -0,0 +1,701 @@ +package hybridcompute + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/hybridcompute/mgmt/2019-03-18-preview/hybridcompute" + +// InstanceViewTypes enumerates the values for instance view types. +type InstanceViewTypes string + +const ( + // InstanceView ... + InstanceView InstanceViewTypes = "instanceView" +) + +// PossibleInstanceViewTypesValues returns an array of possible values for the InstanceViewTypes const type. +func PossibleInstanceViewTypesValues() []InstanceViewTypes { + return []InstanceViewTypes{InstanceView} +} + +// StatusTypes enumerates the values for status types. +type StatusTypes string + +const ( + // Connected ... + Connected StatusTypes = "Connected" + // Disconnected ... + Disconnected StatusTypes = "Disconnected" + // Error ... + Error StatusTypes = "Error" +) + +// PossibleStatusTypesValues returns an array of possible values for the StatusTypes const type. +func PossibleStatusTypesValues() []StatusTypes { + return []StatusTypes{Connected, Disconnected, Error} +} + +// 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"` + // Details - Additional error details. + Details *[]ErrorDetail `json:"details,omitempty"` +} + +// ErrorResponse contains details when the response code indicates an error. +type ErrorResponse struct { + // Error - The error details. + Error *ErrorDetail `json:"error,omitempty"` +} + +// Identity ... +type Identity struct { + // Type - The identity type. + Type *string `json:"type,omitempty"` + // PrincipalID - READ-ONLY; The identity's principal id. + PrincipalID *string `json:"principalId,omitempty"` + // TenantID - READ-ONLY; The identity's tenant id. + TenantID *string `json:"tenantId,omitempty"` +} + +// Machine describes a hybrid machine. +type Machine struct { + autorest.Response `json:"-"` + // MachineProperties - Hybrid Compute Machine properties + *MachineProperties `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"` + // Identity - Hybrid Compute Machine Managed Identity + *Identity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for Machine. +func (mVar Machine) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mVar.MachineProperties != nil { + objectMap["properties"] = mVar.MachineProperties + } + if mVar.Location != nil { + objectMap["location"] = mVar.Location + } + if mVar.Tags != nil { + objectMap["tags"] = mVar.Tags + } + if mVar.Identity != nil { + objectMap["identity"] = mVar.Identity + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Machine struct. +func (mVar *Machine) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var machineProperties MachineProperties + err = json.Unmarshal(*v, &machineProperties) + if err != nil { + return err + } + mVar.MachineProperties = &machineProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mVar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mVar.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mVar.Type = &typeVar + } + 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 "identity": + if v != nil { + var identity Identity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + mVar.Identity = &identity + } + } + } + + return nil +} + +// MachineListResult the List hybrid machine operation response. +type MachineListResult struct { + autorest.Response `json:"-"` + // Value - The list of hybrid machines. + Value *[]Machine `json:"value,omitempty"` + // NextLink - The URI to fetch the next page of VMs. Call ListNext() with this URI to fetch the next page of hybrid machines. + NextLink *string `json:"nextLink,omitempty"` +} + +// MachineListResultIterator provides access to a complete listing of Machine values. +type MachineListResultIterator struct { + i int + page MachineListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *MachineListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MachineListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *MachineListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter MachineListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter MachineListResultIterator) Response() MachineListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter MachineListResultIterator) Value() Machine { + if !iter.page.NotDone() { + return Machine{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the MachineListResultIterator type. +func NewMachineListResultIterator(page MachineListResultPage) MachineListResultIterator { + return MachineListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (mlr MachineListResult) IsEmpty() bool { + return mlr.Value == nil || len(*mlr.Value) == 0 +} + +// machineListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (mlr MachineListResult) machineListResultPreparer(ctx context.Context) (*http.Request, error) { + if mlr.NextLink == nil || len(to.String(mlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(mlr.NextLink))) +} + +// MachineListResultPage contains a page of Machine values. +type MachineListResultPage struct { + fn func(context.Context, MachineListResult) (MachineListResult, error) + mlr MachineListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *MachineListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MachineListResultPage.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.mlr) + if err != nil { + return err + } + page.mlr = 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 *MachineListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page MachineListResultPage) NotDone() bool { + return !page.mlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page MachineListResultPage) Response() MachineListResult { + return page.mlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page MachineListResultPage) Values() []Machine { + if page.mlr.IsEmpty() { + return nil + } + return *page.mlr.Value +} + +// Creates a new instance of the MachineListResultPage type. +func NewMachineListResultPage(getNextPage func(context.Context, MachineListResult) (MachineListResult, error)) MachineListResultPage { + return MachineListResultPage{fn: getNextPage} +} + +// MachineProperties describes the properties of a hybrid machine. +type MachineProperties struct { + // OsProfile - Specifies the operating system settings for the hybrid machine. + OsProfile *OSProfile `json:"osProfile,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. + ProvisioningState *string `json:"provisioningState,omitempty"` + // Status - READ-ONLY; The status of the hybrid machine agent. Possible values include: 'Connected', 'Disconnected', 'Error' + Status StatusTypes `json:"status,omitempty"` + // LastStatusChange - READ-ONLY; The time of the last status change. + LastStatusChange *date.Time `json:"lastStatusChange,omitempty"` + // ErrorDetails - READ-ONLY; Details about the error state. + ErrorDetails *[]ErrorDetail `json:"errorDetails,omitempty"` + // AgentVersion - READ-ONLY; The hybrid machine agent full version. + AgentVersion *string `json:"agentVersion,omitempty"` + // VMID - READ-ONLY; Specifies the hybrid machine unique ID. + VMID *string `json:"vmId,omitempty"` + // DisplayName - READ-ONLY; Specifies the hybrid machine display name. + DisplayName *string `json:"displayName,omitempty"` + // MachineFqdn - READ-ONLY; Specifies the hybrid machine FQDN. + MachineFqdn *string `json:"machineFqdn,omitempty"` + // PhysicalLocation - Resource's Physical Location + PhysicalLocation *string `json:"physicalLocation,omitempty"` + // ClientPublicKey - Public Key that the client provides to be used during initial resource onboarding + ClientPublicKey *string `json:"clientPublicKey,omitempty"` + // OsName - READ-ONLY; The Operating System running on the hybrid machine. + OsName *string `json:"osName,omitempty"` + // OsVersion - READ-ONLY; The version of Operating System running on the hybrid machine. + OsVersion *string `json:"osVersion,omitempty"` +} + +// MachineReconnect describes a hybrid machine reconnect. +type MachineReconnect struct { + // MachineReconnectProperties - Hybrid Compute Machine properties + *MachineReconnectProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for MachineReconnect. +func (mr MachineReconnect) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mr.MachineReconnectProperties != nil { + objectMap["properties"] = mr.MachineReconnectProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for MachineReconnect struct. +func (mr *MachineReconnect) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var machineReconnectProperties MachineReconnectProperties + err = json.Unmarshal(*v, &machineReconnectProperties) + if err != nil { + return err + } + mr.MachineReconnectProperties = &machineReconnectProperties + } + } + } + + return nil +} + +// MachineReconnectProperties describes the properties required to reconnect a hybrid machine. +type MachineReconnectProperties struct { + // VMID - Specifies the hybrid machine unique ID. + VMID *string `json:"vmId,omitempty"` + // ClientPublicKey - Public Key that the client provides to be used during initial resource onboarding. + ClientPublicKey *string `json:"clientPublicKey,omitempty"` +} + +// MachineUpdate describes a hybrid machine Update. +type MachineUpdate struct { + // Identity - Hybrid Compute Machine Managed Identity + *Identity `json:"identity,omitempty"` + // MachineUpdateProperties - Hybrid Compute Machine properties + *MachineUpdateProperties `json:"properties,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for MachineUpdate. +func (mu MachineUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mu.Identity != nil { + objectMap["identity"] = mu.Identity + } + if mu.MachineUpdateProperties != nil { + objectMap["properties"] = mu.MachineUpdateProperties + } + if mu.Tags != nil { + objectMap["tags"] = mu.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for MachineUpdate struct. +func (mu *MachineUpdate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "identity": + if v != nil { + var identity Identity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + mu.Identity = &identity + } + case "properties": + if v != nil { + var machineUpdateProperties MachineUpdateProperties + err = json.Unmarshal(*v, &machineUpdateProperties) + if err != nil { + return err + } + mu.MachineUpdateProperties = &machineUpdateProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + mu.Tags = tags + } + } + } + + return nil +} + +// MachineUpdateProperties describes the ARM updatable properties of a hybrid machine. +type MachineUpdateProperties struct { + // PhysicalLocation - Resource's Physical Location + PhysicalLocation *string `json:"physicalLocation,omitempty"` +} + +// OperationListResult the List Compute Operation operation response. +type OperationListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of compute operations + Value *[]OperationValue `json:"value,omitempty"` +} + +// OperationValue describes the properties of a Compute Operation value. +type OperationValue struct { + // Origin - READ-ONLY; The origin of the compute operation. + Origin *string `json:"origin,omitempty"` + // Name - READ-ONLY; The name of the compute operation. + Name *string `json:"name,omitempty"` + // OperationValueDisplay - Display properties + *OperationValueDisplay `json:"display,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationValue. +func (ov OperationValue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ov.OperationValueDisplay != nil { + objectMap["display"] = ov.OperationValueDisplay + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for OperationValue struct. +func (ov *OperationValue) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "origin": + if v != nil { + var origin string + err = json.Unmarshal(*v, &origin) + if err != nil { + return err + } + ov.Origin = &origin + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ov.Name = &name + } + case "display": + if v != nil { + var operationValueDisplay OperationValueDisplay + err = json.Unmarshal(*v, &operationValueDisplay) + if err != nil { + return err + } + ov.OperationValueDisplay = &operationValueDisplay + } + } + } + + return nil +} + +// OperationValueDisplay describes the properties of a Hybrid Compute Operation Value Display. +type OperationValueDisplay struct { + // Operation - READ-ONLY; The display name of the compute operation. + Operation *string `json:"operation,omitempty"` + // Resource - READ-ONLY; The display name of the resource the operation applies to. + Resource *string `json:"resource,omitempty"` + // Description - READ-ONLY; The description of the operation. + Description *string `json:"description,omitempty"` + // Provider - READ-ONLY; The resource provider for the operation. + Provider *string `json:"provider,omitempty"` +} + +// OSProfile specifies the operating system settings for the hybrid machine. +type OSProfile struct { + // ComputerName - READ-ONLY; Specifies the host OS name of the hybrid machine. + ComputerName *string `json:"computerName,omitempty"` +} + +// Resource the Resource model definition. +type Resource struct { + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` + // Identity - Hybrid Compute Machine Managed Identity + *Identity `json:"identity,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.Identity != nil { + objectMap["identity"] = r.Identity + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Resource struct. +func (r *Resource) UnmarshalJSON(body []byte) error { + 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 + } + r.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + r.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + r.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + r.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + r.Tags = tags + } + case "identity": + if v != nil { + var identity Identity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + r.Identity = &identity + } + } + } + + return nil +} + +// UpdateResource the Update Resource model definition. +type UpdateResource struct { + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for UpdateResource. +func (ur UpdateResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ur.Tags != nil { + objectMap["tags"] = ur.Tags + } + return json.Marshal(objectMap) +} diff --git a/services/preview/hybridcompute/mgmt/2019-03-18-preview/hybridcompute/operations.go b/services/preview/hybridcompute/mgmt/2019-03-18-preview/hybridcompute/operations.go new file mode 100644 index 000000000000..a019c1f54d75 --- /dev/null +++ b/services/preview/hybridcompute/mgmt/2019-03-18-preview/hybridcompute/operations.go @@ -0,0 +1,109 @@ +package hybridcompute + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// OperationsClient is the the Hybrid Compute Management 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 gets a list of hybrid compute operations. +func (client OperationsClient) List(ctx context.Context) (result OperationListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "hybridcompute.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, "hybridcompute.OperationsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "hybridcompute.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-03-18-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.HybridCompute/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 +} diff --git a/services/preview/hybridcompute/mgmt/2019-03-18-preview/hybridcompute/version.go b/services/preview/hybridcompute/mgmt/2019-03-18-preview/hybridcompute/version.go new file mode 100644 index 000000000000..e24833452815 --- /dev/null +++ b/services/preview/hybridcompute/mgmt/2019-03-18-preview/hybridcompute/version.go @@ -0,0 +1,30 @@ +package hybridcompute + +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 + " hybridcompute/2019-03-18-preview" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/preview/mysql/mgmt/2017-12-01-preview/mysql/models.go b/services/preview/mysql/mgmt/2017-12-01-preview/mysql/models.go index 92d6a398523f..504b3d0d5f8e 100644 --- a/services/preview/mysql/mgmt/2017-12-01-preview/mysql/models.go +++ b/services/preview/mysql/mgmt/2017-12-01-preview/mysql/models.go @@ -25,6 +25,7 @@ import ( "github.com/Azure/go-autorest/autorest/date" "github.com/Azure/go-autorest/autorest/to" "github.com/Azure/go-autorest/tracing" + "github.com/satori/go.uuid" "net/http" ) @@ -948,6 +949,156 @@ func (s *Server) UnmarshalJSON(body []byte) error { return nil } +// ServerAdministratorProperties the properties of an server Administrator. +type ServerAdministratorProperties struct { + // AdministratorType - The type of administrator. + AdministratorType *string `json:"administratorType,omitempty"` + // Login - The server administrator login value. + Login *string `json:"login,omitempty"` + // Sid - The server administrator Sid (Secure ID). + Sid *uuid.UUID `json:"sid,omitempty"` + // TenantID - The server Active Directory Administrator tenant id. + TenantID *uuid.UUID `json:"tenantId,omitempty"` +} + +// ServerAdministratorResource represents a and external administrator to be created. +type ServerAdministratorResource struct { + autorest.Response `json:"-"` + // ServerAdministratorProperties - Properties of the server AAD administrator. + *ServerAdministratorProperties `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 ServerAdministratorResource. +func (sar ServerAdministratorResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sar.ServerAdministratorProperties != nil { + objectMap["properties"] = sar.ServerAdministratorProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ServerAdministratorResource struct. +func (sar *ServerAdministratorResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var serverAdministratorProperties ServerAdministratorProperties + err = json.Unmarshal(*v, &serverAdministratorProperties) + if err != nil { + return err + } + sar.ServerAdministratorProperties = &serverAdministratorProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sar.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sar.Type = &typeVar + } + } + } + + return nil +} + +// ServerAdministratorResourceListResult the response to a list Active Directory Administrators request. +type ServerAdministratorResourceListResult struct { + autorest.Response `json:"-"` + // Value - The list of server Active Directory Administrators for the server. + Value *[]ServerAdministratorResource `json:"value,omitempty"` +} + +// ServerAdministratorsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ServerAdministratorsCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ServerAdministratorsCreateOrUpdateFuture) Result(client ServerAdministratorsClient) (sar ServerAdministratorResource, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "mysql.ServerAdministratorsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("mysql.ServerAdministratorsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sar.Response.Response, err = future.GetResult(sender); err == nil && sar.Response.Response.StatusCode != http.StatusNoContent { + sar, err = client.CreateOrUpdateResponder(sar.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "mysql.ServerAdministratorsCreateOrUpdateFuture", "Result", sar.Response.Response, "Failure responding to request") + } + } + return +} + +// ServerAdministratorsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ServerAdministratorsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ServerAdministratorsDeleteFuture) Result(client ServerAdministratorsClient) (sar ServerAdministratorResource, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "mysql.ServerAdministratorsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("mysql.ServerAdministratorsDeleteFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sar.Response.Response, err = future.GetResult(sender); err == nil && sar.Response.Response.StatusCode != http.StatusNoContent { + sar, err = client.DeleteResponder(sar.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "mysql.ServerAdministratorsDeleteFuture", "Result", sar.Response.Response, "Failure responding to request") + } + } + return +} + // ServerForCreate represents a server to be created. type ServerForCreate struct { // Sku - The SKU (pricing tier) of the server. diff --git a/services/preview/mysql/mgmt/2017-12-01-preview/mysql/mysqlapi/interfaces.go b/services/preview/mysql/mgmt/2017-12-01-preview/mysql/mysqlapi/interfaces.go index 4c90ae8ef5c7..2ad7af82c238 100644 --- a/services/preview/mysql/mgmt/2017-12-01-preview/mysql/mysqlapi/interfaces.go +++ b/services/preview/mysql/mgmt/2017-12-01-preview/mysql/mysqlapi/interfaces.go @@ -88,6 +88,16 @@ type LogFilesClientAPI interface { var _ LogFilesClientAPI = (*mysql.LogFilesClient)(nil) +// ServerAdministratorsClientAPI contains the set of methods on the ServerAdministratorsClient type. +type ServerAdministratorsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, properties mysql.ServerAdministratorResource) (result mysql.ServerAdministratorsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, serverName string) (result mysql.ServerAdministratorsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, serverName string) (result mysql.ServerAdministratorResource, err error) + ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result mysql.ServerAdministratorResourceListResult, err error) +} + +var _ ServerAdministratorsClientAPI = (*mysql.ServerAdministratorsClient)(nil) + // LocationBasedPerformanceTierClientAPI contains the set of methods on the LocationBasedPerformanceTierClient type. type LocationBasedPerformanceTierClientAPI interface { List(ctx context.Context, locationName string) (result mysql.PerformanceTierListResult, err error) diff --git a/services/preview/sql/mgmt/2018-06-15-preview/sql/serverkeys.go b/services/preview/mysql/mgmt/2017-12-01-preview/mysql/serveradministrators.go similarity index 53% rename from services/preview/sql/mgmt/2018-06-15-preview/sql/serverkeys.go rename to services/preview/mysql/mgmt/2017-12-01-preview/mysql/serveradministrators.go index 9e9e38abbe15..890be04cb44c 100644 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/serverkeys.go +++ b/services/preview/mysql/mgmt/2017-12-01-preview/mysql/serveradministrators.go @@ -1,4 +1,4 @@ -package sql +package mysql // Copyright (c) Microsoft and contributors. All rights reserved. // @@ -21,40 +21,38 @@ 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" ) -// ServerKeysClient is the the Azure SQL Database management API provides a RESTful set of web services that interact -// with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, and -// delete databases. -type ServerKeysClient struct { +// ServerAdministratorsClient is the the Microsoft Azure management API provides create, read, update, and delete +// functionality for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and +// configurations with new business model. +type ServerAdministratorsClient struct { BaseClient } -// NewServerKeysClient creates an instance of the ServerKeysClient client. -func NewServerKeysClient(subscriptionID string) ServerKeysClient { - return NewServerKeysClientWithBaseURI(DefaultBaseURI, subscriptionID) +// NewServerAdministratorsClient creates an instance of the ServerAdministratorsClient client. +func NewServerAdministratorsClient(subscriptionID string) ServerAdministratorsClient { + return NewServerAdministratorsClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewServerKeysClientWithBaseURI creates an instance of the ServerKeysClient client. -func NewServerKeysClientWithBaseURI(baseURI string, subscriptionID string) ServerKeysClient { - return ServerKeysClient{NewWithBaseURI(baseURI, subscriptionID)} +// NewServerAdministratorsClientWithBaseURI creates an instance of the ServerAdministratorsClient client. +func NewServerAdministratorsClientWithBaseURI(baseURI string, subscriptionID string) ServerAdministratorsClient { + return ServerAdministratorsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate creates or updates a server key. +// CreateOrUpdate creates or update active directory administrator on an existing server. The update action will +// overwrite the existing administrator. // 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. -// keyName - the name of the server key to be operated on (updated or created). The key name is required to be -// in the format of 'vault_key_version'. For example, if the keyId is -// https://YourVaultName.vault.azure.net/keys/YourKeyName/01234567890123456789012345678901, then the server key -// name should be formatted as: YourVaultName_YourKeyName_01234567890123456789012345678901 -// parameters - the requested server key resource state. -func (client ServerKeysClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, keyName string, parameters ServerKey) (result ServerKeysCreateOrUpdateFuture, err error) { +// properties - the required parameters for creating or updating an AAD server administrator. +func (client ServerAdministratorsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, properties ServerAdministratorResource) (result ServerAdministratorsCreateOrUpdateFuture, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServerKeysClient.CreateOrUpdate") + ctx = tracing.StartSpan(ctx, fqdn+"/ServerAdministratorsClient.CreateOrUpdate") defer func() { sc := -1 if result.Response() != nil { @@ -63,15 +61,26 @@ func (client ServerKeysClient) CreateOrUpdate(ctx context.Context, resourceGroup tracing.EndSpan(ctx, sc, err) }() } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, keyName, parameters) + if err := validation.Validate([]validation.Validation{ + {TargetValue: properties, + Constraints: []validation.Constraint{{Target: "properties.ServerAdministratorProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "properties.ServerAdministratorProperties.AdministratorType", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "properties.ServerAdministratorProperties.Login", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "properties.ServerAdministratorProperties.Sid", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "properties.ServerAdministratorProperties.TenantID", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("mysql.ServerAdministratorsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, properties) if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerKeysClient", "CreateOrUpdate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "mysql.ServerAdministratorsClient", "CreateOrUpdate", nil, "Failure preparing request") return } result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerKeysClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "mysql.ServerAdministratorsClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -79,33 +88,31 @@ func (client ServerKeysClient) CreateOrUpdate(ctx context.Context, resourceGroup } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ServerKeysClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, keyName string, parameters ServerKey) (*http.Request, error) { +func (client ServerAdministratorsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, properties ServerAdministratorResource) (*http.Request, error) { pathParameters := map[string]interface{}{ - "keyName": autorest.Encode("path", keyName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serverName": autorest.Encode("path", serverName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2015-05-01-preview" + const APIVersion = "2017-12-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } - parameters.Location = 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.Sql/servers/{serverName}/keys/{keyName}", pathParameters), - autorest.WithJSON(parameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/Administrators/activeDirectory", pathParameters), + autorest.WithJSON(properties), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. -func (client ServerKeysClient) CreateOrUpdateSender(req *http.Request) (future ServerKeysCreateOrUpdateFuture, err error) { +func (client ServerAdministratorsClient) CreateOrUpdateSender(req *http.Request) (future ServerAdministratorsCreateOrUpdateFuture, err error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) var resp *http.Response resp, err = autorest.SendWithSender(client, req, sd...) @@ -118,26 +125,25 @@ func (client ServerKeysClient) CreateOrUpdateSender(req *http.Request) (future S // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always // closes the http.Response Body. -func (client ServerKeysClient) CreateOrUpdateResponder(resp *http.Response) (result ServerKey, err error) { +func (client ServerAdministratorsClient) CreateOrUpdateResponder(resp *http.Response) (result ServerAdministratorResource, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// Delete deletes the server key with the given name. +// Delete deletes AAD Administrator. // 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. -// keyName - the name of the server key to be deleted. -func (client ServerKeysClient) Delete(ctx context.Context, resourceGroupName string, serverName string, keyName string) (result ServerKeysDeleteFuture, err error) { +func (client ServerAdministratorsClient) Delete(ctx context.Context, resourceGroupName string, serverName string) (result ServerAdministratorsDeleteFuture, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServerKeysClient.Delete") + ctx = tracing.StartSpan(ctx, fqdn+"/ServerAdministratorsClient.Delete") defer func() { sc := -1 if result.Response() != nil { @@ -146,15 +152,15 @@ func (client ServerKeysClient) Delete(ctx context.Context, resourceGroupName str tracing.EndSpan(ctx, sc, err) }() } - req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, keyName) + req, err := client.DeletePreparer(ctx, resourceGroupName, serverName) if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerKeysClient", "Delete", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "mysql.ServerAdministratorsClient", "Delete", nil, "Failure preparing request") return } result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerKeysClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "mysql.ServerAdministratorsClient", "Delete", result.Response(), "Failure sending request") return } @@ -162,15 +168,14 @@ func (client ServerKeysClient) Delete(ctx context.Context, resourceGroupName str } // DeletePreparer prepares the Delete request. -func (client ServerKeysClient) DeletePreparer(ctx context.Context, resourceGroupName string, serverName string, keyName string) (*http.Request, error) { +func (client ServerAdministratorsClient) DeletePreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "keyName": autorest.Encode("path", keyName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serverName": autorest.Encode("path", serverName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2015-05-01-preview" + const APIVersion = "2017-12-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -178,14 +183,14 @@ func (client ServerKeysClient) DeletePreparer(ctx context.Context, resourceGroup preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys/{keyName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/Administrators/activeDirectory", 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 ServerKeysClient) DeleteSender(req *http.Request) (future ServerKeysDeleteFuture, err error) { +func (client ServerAdministratorsClient) DeleteSender(req *http.Request) (future ServerAdministratorsDeleteFuture, err error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) var resp *http.Response resp, err = autorest.SendWithSender(client, req, sd...) @@ -198,25 +203,25 @@ func (client ServerKeysClient) DeleteSender(req *http.Request) (future ServerKey // DeleteResponder handles the response to the Delete request. The method always // closes the http.Response Body. -func (client ServerKeysClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { +func (client ServerAdministratorsClient) DeleteResponder(resp *http.Response) (result ServerAdministratorResource, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) - result.Response = resp + result.Response = autorest.Response{Response: resp} return } -// Get gets a server key. +// Get gets information about a AAD server administrator. // 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. -// keyName - the name of the server key to be retrieved. -func (client ServerKeysClient) Get(ctx context.Context, resourceGroupName string, serverName string, keyName string) (result ServerKey, err error) { +func (client ServerAdministratorsClient) Get(ctx context.Context, resourceGroupName string, serverName string) (result ServerAdministratorResource, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServerKeysClient.Get") + ctx = tracing.StartSpan(ctx, fqdn+"/ServerAdministratorsClient.Get") defer func() { sc := -1 if result.Response.Response != nil { @@ -225,37 +230,36 @@ func (client ServerKeysClient) Get(ctx context.Context, resourceGroupName string tracing.EndSpan(ctx, sc, err) }() } - req, err := client.GetPreparer(ctx, resourceGroupName, serverName, keyName) + req, err := client.GetPreparer(ctx, resourceGroupName, serverName) if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerKeysClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "mysql.ServerAdministratorsClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ServerKeysClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "mysql.ServerAdministratorsClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerKeysClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "mysql.ServerAdministratorsClient", "Get", resp, "Failure responding to request") } return } // GetPreparer prepares the Get request. -func (client ServerKeysClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, keyName string) (*http.Request, error) { +func (client ServerAdministratorsClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "keyName": autorest.Encode("path", keyName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serverName": autorest.Encode("path", serverName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2015-05-01-preview" + const APIVersion = "2017-12-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -263,21 +267,21 @@ func (client ServerKeysClient) GetPreparer(ctx context.Context, resourceGroupNam preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys/{keyName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/Administrators/activeDirectory", 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 ServerKeysClient) GetSender(req *http.Request) (*http.Response, error) { +func (client ServerAdministratorsClient) 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 ServerKeysClient) GetResponder(resp *http.Response) (result ServerKey, err error) { +func (client ServerAdministratorsClient) GetResponder(resp *http.Response) (result ServerAdministratorResource, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -288,53 +292,52 @@ func (client ServerKeysClient) GetResponder(resp *http.Response) (result ServerK return } -// ListByServer gets a list of server keys. +// ListByServer returns a list of server Administrators. // 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 ServerKeysClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result ServerKeyListResultPage, err error) { +func (client ServerAdministratorsClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result ServerAdministratorResourceListResult, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServerKeysClient.ListByServer") + ctx = tracing.StartSpan(ctx, fqdn+"/ServerAdministratorsClient.ListByServer") defer func() { sc := -1 - if result.sklr.Response.Response != nil { - sc = result.sklr.Response.Response.StatusCode + if result.Response.Response != nil { + sc = result.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.ServerKeysClient", "ListByServer", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "mysql.ServerAdministratorsClient", "ListByServer", nil, "Failure preparing request") return } resp, err := client.ListByServerSender(req) if err != nil { - result.sklr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ServerKeysClient", "ListByServer", resp, "Failure sending request") + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "mysql.ServerAdministratorsClient", "ListByServer", resp, "Failure sending request") return } - result.sklr, err = client.ListByServerResponder(resp) + result, err = client.ListByServerResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerKeysClient", "ListByServer", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "mysql.ServerAdministratorsClient", "ListByServer", resp, "Failure responding to request") } return } // ListByServerPreparer prepares the ListByServer request. -func (client ServerKeysClient) ListByServerPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { +func (client ServerAdministratorsClient) 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 = "2015-05-01-preview" + const APIVersion = "2017-12-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -342,21 +345,21 @@ func (client ServerKeysClient) ListByServerPreparer(ctx context.Context, resourc preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/administrators", 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 ServerKeysClient) ListByServerSender(req *http.Request) (*http.Response, error) { +func (client ServerAdministratorsClient) 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 ServerKeysClient) ListByServerResponder(resp *http.Response) (result ServerKeyListResult, err error) { +func (client ServerAdministratorsClient) ListByServerResponder(resp *http.Response) (result ServerAdministratorResourceListResult, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -366,40 +369,3 @@ func (client ServerKeysClient) ListByServerResponder(resp *http.Response) (resul result.Response = autorest.Response{Response: resp} return } - -// listByServerNextResults retrieves the next set of results, if any. -func (client ServerKeysClient) listByServerNextResults(ctx context.Context, lastResults ServerKeyListResult) (result ServerKeyListResult, err error) { - req, err := lastResults.serverKeyListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.ServerKeysClient", "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.ServerKeysClient", "listByServerNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerKeysClient", "listByServerNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByServerComplete enumerates all values, automatically crossing page boundaries as required. -func (client ServerKeysClient) ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string) (result ServerKeyListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServerKeysClient.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/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/models.go b/services/preview/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/models.go index b71302b59126..a47383465675 100644 --- a/services/preview/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/models.go +++ b/services/preview/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/models.go @@ -872,11 +872,11 @@ type WorkspaceListUsagesResult struct { type WorkspaceProperties struct { // ProvisioningState - The provisioning state of the workspace. Possible values include: 'Creating', 'Succeeded', 'Failed', 'Canceled', 'Deleting', 'ProvisioningAccount' ProvisioningState EntityStatus `json:"provisioningState,omitempty"` - // Source - The source of the workspace. Source defines where the workspace was created. 'Azure' implies it was created in Azure. 'External' implies it was created via the Operational Insights Portal. This value is set on the service side and read-only on the client side. + // Source - READ-ONLY; This is a read-only legacy property. It is always set to 'Azure' by the service. Kept here for backward compatibility. Source *string `json:"source,omitempty"` - // CustomerID - The ID associated with the workspace. Setting this value at creation time allows the workspace being created to be linked to an existing workspace. + // CustomerID - READ-ONLY; This is a read-only property. Represents the ID associated with the workspace. CustomerID *string `json:"customerId,omitempty"` - // PortalURL - The URL of the Operational Insights portal for this workspace. This value is set on the service side and read-only on the client side. + // PortalURL - READ-ONLY; This is a legacy property and is not used anymore. Kept here for backward compatibility. PortalURL *string `json:"portalUrl,omitempty"` // Sku - The SKU of the workspace. Sku *Sku `json:"sku,omitempty"` diff --git a/services/preview/peering/mgmt/2019-08-01-preview/peering/client.go b/services/preview/peering/mgmt/2019-08-01-preview/peering/client.go index b221a50435f4..bd71733e8b42 100644 --- a/services/preview/peering/mgmt/2019-08-01-preview/peering/client.go +++ b/services/preview/peering/mgmt/2019-08-01-preview/peering/client.go @@ -57,8 +57,8 @@ func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { // CheckServiceProviderAvailability checks if the peering service provider is present within 1000 miles of customer's // location // Parameters: -// checkServiceProviderAvailabilityInput - the CheckServiceProviderAvailabilityInput indicating customer -// location and service provider. +// checkServiceProviderAvailabilityInput - the CheckServiceProviderAvailabilityInput +// indicating customer location and service provider. func (client BaseClient) CheckServiceProviderAvailability(ctx context.Context, checkServiceProviderAvailabilityInput CheckServiceProviderAvailabilityInput) (result String, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CheckServiceProviderAvailability") diff --git a/services/preview/peering/mgmt/2019-09-01-preview/peering/client.go b/services/preview/peering/mgmt/2019-09-01-preview/peering/client.go new file mode 100644 index 000000000000..0af85a137871 --- /dev/null +++ b/services/preview/peering/mgmt/2019-09-01-preview/peering/client.go @@ -0,0 +1,133 @@ +// Package peering implements the Azure ARM Peering service API version 2019-09-01-preview. +// +// Peering Client +package peering + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +const ( + // DefaultBaseURI is the default URI used for the service Peering + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Peering. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the BaseClient client. +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} + +// CheckServiceProviderAvailability checks if the peering service provider is present within 1000 miles of customer's +// location +// Parameters: +// checkServiceProviderAvailabilityInput - the CheckServiceProviderAvailabilityInput indicating customer +// location and service provider. +func (client BaseClient) CheckServiceProviderAvailability(ctx context.Context, checkServiceProviderAvailabilityInput CheckServiceProviderAvailabilityInput) (result String, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CheckServiceProviderAvailability") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CheckServiceProviderAvailabilityPreparer(ctx, checkServiceProviderAvailabilityInput) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.BaseClient", "CheckServiceProviderAvailability", nil, "Failure preparing request") + return + } + + resp, err := client.CheckServiceProviderAvailabilitySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "peering.BaseClient", "CheckServiceProviderAvailability", resp, "Failure sending request") + return + } + + result, err = client.CheckServiceProviderAvailabilityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.BaseClient", "CheckServiceProviderAvailability", resp, "Failure responding to request") + } + + return +} + +// CheckServiceProviderAvailabilityPreparer prepares the CheckServiceProviderAvailability request. +func (client BaseClient) CheckServiceProviderAvailabilityPreparer(ctx context.Context, checkServiceProviderAvailabilityInput CheckServiceProviderAvailabilityInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-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}/providers/Microsoft.Peering/CheckServiceProviderAvailability", pathParameters), + autorest.WithJSON(checkServiceProviderAvailabilityInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckServiceProviderAvailabilitySender sends the CheckServiceProviderAvailability request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) CheckServiceProviderAvailabilitySender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// CheckServiceProviderAvailabilityResponder handles the response to the CheckServiceProviderAvailability request. The method always +// closes the http.Response Body. +func (client BaseClient) CheckServiceProviderAvailabilityResponder(resp *http.Response) (result String, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/peering/mgmt/2019-09-01-preview/peering/legacypeerings.go b/services/preview/peering/mgmt/2019-09-01-preview/peering/legacypeerings.go new file mode 100644 index 000000000000..b5230ef184ea --- /dev/null +++ b/services/preview/peering/mgmt/2019-09-01-preview/peering/legacypeerings.go @@ -0,0 +1,156 @@ +package peering + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// LegacyPeeringsClient is the peering Client +type LegacyPeeringsClient struct { + BaseClient +} + +// NewLegacyPeeringsClient creates an instance of the LegacyPeeringsClient client. +func NewLegacyPeeringsClient(subscriptionID string) LegacyPeeringsClient { + return NewLegacyPeeringsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewLegacyPeeringsClientWithBaseURI creates an instance of the LegacyPeeringsClient client. +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-09-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-09-01-preview/peering/locations.go b/services/preview/peering/mgmt/2019-09-01-preview/peering/locations.go new file mode 100644 index 000000000000..b9ef1363bcc6 --- /dev/null +++ b/services/preview/peering/mgmt/2019-09-01-preview/peering/locations.go @@ -0,0 +1,158 @@ +package peering + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// LocationsClient is the peering Client +type LocationsClient struct { + BaseClient +} + +// NewLocationsClient creates an instance of the LocationsClient client. +func NewLocationsClient(subscriptionID string) LocationsClient { + return NewLocationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewLocationsClientWithBaseURI creates an instance of the LocationsClient client. +func NewLocationsClientWithBaseURI(baseURI string, subscriptionID string) LocationsClient { + return LocationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists all of the available peering locations for the specified kind of peering. +// Parameters: +// kind - the kind of the peering. +// directPeeringType - the type of direct peering. +func (client LocationsClient) List(ctx context.Context, kind string, directPeeringType string) (result LocationListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LocationsClient.List") + defer func() { + sc := -1 + if result.llr.Response.Response != nil { + sc = result.llr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, kind, directPeeringType) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.LocationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.llr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "peering.LocationsClient", "List", resp, "Failure sending request") + return + } + + result.llr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.LocationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client LocationsClient) ListPreparer(ctx context.Context, kind string, directPeeringType string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "kind": autorest.Encode("query", kind), + } + if len(string(directPeeringType)) > 0 { + queryParameters["directPeeringType"] = autorest.Encode("query", directPeeringType) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Peering/peeringLocations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client LocationsClient) ListSender(req *http.Request) (*http.Response, error) { + 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, directPeeringType string) (result LocationListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LocationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, kind, directPeeringType) + return +} diff --git a/services/preview/peering/mgmt/2019-09-01-preview/peering/models.go b/services/preview/peering/mgmt/2019-09-01-preview/peering/models.go new file mode 100644 index 000000000000..bbf47ea3d27d --- /dev/null +++ b/services/preview/peering/mgmt/2019-09-01-preview/peering/models.go @@ -0,0 +1,2426 @@ +package peering + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/peering/mgmt/2019-09-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} +} + +// DirectPeeringType enumerates the values for direct peering type. +type DirectPeeringType string + +const ( + // Cdn ... + Cdn DirectPeeringType = "Cdn" + // Edge ... + Edge DirectPeeringType = "Edge" + // Internal ... + Internal DirectPeeringType = "Internal" + // Transit ... + Transit DirectPeeringType = "Transit" +) + +// PossibleDirectPeeringTypeValues returns an array of possible values for the DirectPeeringType const type. +func PossibleDirectPeeringTypeValues() []DirectPeeringType { + return []DirectPeeringType{Cdn, Edge, Internal, Transit} +} + +// Family enumerates the values for family. +type Family string + +const ( + // Direct ... + Direct Family = "Direct" + // Exchange ... + Exchange Family = "Exchange" +) + +// PossibleFamilyValues returns an array of possible values for the Family const type. +func PossibleFamilyValues() []Family { + return []Family{Direct, Exchange} +} + +// Kind enumerates the values for kind. +type Kind string + +const ( + // KindDirect ... + KindDirect Kind = "Direct" + // KindExchange ... + KindExchange Kind = "Exchange" +) + +// PossibleKindValues returns an array of possible values for the Kind const type. +func PossibleKindValues() []Kind { + return []Kind{KindDirect, KindExchange} +} + +// LearnedType enumerates the values for learned type. +type LearnedType string + +const ( + // LearnedTypeNone ... + LearnedTypeNone LearnedType = "None" + // LearnedTypeViaServiceProvider ... + LearnedTypeViaServiceProvider LearnedType = "ViaServiceProvider" + // LearnedTypeViaSession ... + LearnedTypeViaSession LearnedType = "ViaSession" +) + +// PossibleLearnedTypeValues returns an array of possible values for the LearnedType const type. +func PossibleLearnedTypeValues() []LearnedType { + return []LearnedType{LearnedTypeNone, LearnedTypeViaServiceProvider, LearnedTypeViaSession} +} + +// 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" + // PremiumDirectMetered ... + PremiumDirectMetered Name = "Premium_Direct_Metered" + // PremiumDirectUnlimited ... + PremiumDirectUnlimited Name = "Premium_Direct_Unlimited" + // 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, PremiumDirectMetered, PremiumDirectUnlimited, PremiumExchangeMetered} +} + +// PrefixValidationState enumerates the values for prefix validation state. +type PrefixValidationState string + +const ( + // PrefixValidationStateFailed ... + PrefixValidationStateFailed PrefixValidationState = "Failed" + // PrefixValidationStateInvalid ... + PrefixValidationStateInvalid PrefixValidationState = "Invalid" + // PrefixValidationStateNone ... + PrefixValidationStateNone PrefixValidationState = "None" + // PrefixValidationStatePending ... + PrefixValidationStatePending PrefixValidationState = "Pending" + // PrefixValidationStateUnknown ... + PrefixValidationStateUnknown PrefixValidationState = "Unknown" + // PrefixValidationStateVerified ... + PrefixValidationStateVerified PrefixValidationState = "Verified" + // PrefixValidationStateWarning ... + PrefixValidationStateWarning PrefixValidationState = "Warning" +) + +// PossiblePrefixValidationStateValues returns an array of possible values for the PrefixValidationState const type. +func PossiblePrefixValidationStateValues() []PrefixValidationState { + return []PrefixValidationState{PrefixValidationStateFailed, PrefixValidationStateInvalid, PrefixValidationStateNone, PrefixValidationStatePending, PrefixValidationStateUnknown, PrefixValidationStateVerified, PrefixValidationStateWarning} +} + +// ProvisioningState enumerates the values for provisioning state. +type ProvisioningState string + +const ( + // Deleting ... + Deleting ProvisioningState = "Deleting" + // Failed ... + Failed ProvisioningState = "Failed" + // Succeeded ... + Succeeded ProvisioningState = "Succeeded" + // Updating ... + Updating ProvisioningState = "Updating" +) + +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{Deleting, Failed, Succeeded, Updating} +} + +// SessionAddressProvider enumerates the values for session address provider. +type SessionAddressProvider string + +const ( + // Microsoft ... + Microsoft SessionAddressProvider = "Microsoft" + // Peer ... + Peer SessionAddressProvider = "Peer" +) + +// PossibleSessionAddressProviderValues returns an array of possible values for the SessionAddressProvider const type. +func PossibleSessionAddressProviderValues() []SessionAddressProvider { + return []SessionAddressProvider{Microsoft, Peer} +} + +// SessionStateV4 enumerates the values for session state v4. +type SessionStateV4 string + +const ( + // SessionStateV4Active ... + SessionStateV4Active SessionStateV4 = "Active" + // SessionStateV4Connect ... + SessionStateV4Connect SessionStateV4 = "Connect" + // SessionStateV4Established ... + SessionStateV4Established SessionStateV4 = "Established" + // SessionStateV4Idle ... + SessionStateV4Idle SessionStateV4 = "Idle" + // SessionStateV4None ... + SessionStateV4None SessionStateV4 = "None" + // SessionStateV4OpenConfirm ... + SessionStateV4OpenConfirm SessionStateV4 = "OpenConfirm" + // SessionStateV4OpenReceived ... + SessionStateV4OpenReceived SessionStateV4 = "OpenReceived" + // SessionStateV4OpenSent ... + SessionStateV4OpenSent SessionStateV4 = "OpenSent" + // SessionStateV4PendingAdd ... + SessionStateV4PendingAdd SessionStateV4 = "PendingAdd" + // SessionStateV4PendingRemove ... + SessionStateV4PendingRemove SessionStateV4 = "PendingRemove" + // SessionStateV4PendingUpdate ... + SessionStateV4PendingUpdate SessionStateV4 = "PendingUpdate" +) + +// PossibleSessionStateV4Values returns an array of possible values for the SessionStateV4 const type. +func PossibleSessionStateV4Values() []SessionStateV4 { + return []SessionStateV4{SessionStateV4Active, SessionStateV4Connect, SessionStateV4Established, SessionStateV4Idle, SessionStateV4None, SessionStateV4OpenConfirm, SessionStateV4OpenReceived, SessionStateV4OpenSent, SessionStateV4PendingAdd, SessionStateV4PendingRemove, SessionStateV4PendingUpdate} +} + +// SessionStateV6 enumerates the values for session state v6. +type SessionStateV6 string + +const ( + // SessionStateV6Active ... + SessionStateV6Active SessionStateV6 = "Active" + // SessionStateV6Connect ... + SessionStateV6Connect SessionStateV6 = "Connect" + // SessionStateV6Established ... + SessionStateV6Established SessionStateV6 = "Established" + // SessionStateV6Idle ... + SessionStateV6Idle SessionStateV6 = "Idle" + // SessionStateV6None ... + SessionStateV6None SessionStateV6 = "None" + // SessionStateV6OpenConfirm ... + SessionStateV6OpenConfirm SessionStateV6 = "OpenConfirm" + // SessionStateV6OpenReceived ... + SessionStateV6OpenReceived SessionStateV6 = "OpenReceived" + // SessionStateV6OpenSent ... + SessionStateV6OpenSent SessionStateV6 = "OpenSent" + // SessionStateV6PendingAdd ... + SessionStateV6PendingAdd SessionStateV6 = "PendingAdd" + // SessionStateV6PendingRemove ... + SessionStateV6PendingRemove SessionStateV6 = "PendingRemove" + // SessionStateV6PendingUpdate ... + SessionStateV6PendingUpdate SessionStateV6 = "PendingUpdate" +) + +// PossibleSessionStateV6Values returns an array of possible values for the SessionStateV6 const type. +func PossibleSessionStateV6Values() []SessionStateV6 { + return []SessionStateV6{SessionStateV6Active, SessionStateV6Connect, SessionStateV6Established, SessionStateV6Idle, SessionStateV6None, SessionStateV6OpenConfirm, SessionStateV6OpenReceived, SessionStateV6OpenSent, SessionStateV6PendingAdd, SessionStateV6PendingRemove, SessionStateV6PendingUpdate} +} + +// Size enumerates the values for size. +type Size string + +const ( + // Free ... + Free Size = "Free" + // Metered ... + Metered Size = "Metered" + // Unlimited ... + Unlimited Size = "Unlimited" +) + +// PossibleSizeValues returns an array of possible values for the Size const type. +func PossibleSizeValues() []Size { + return []Size{Free, Metered, Unlimited} +} + +// Tier enumerates the values for tier. +type Tier string + +const ( + // Basic ... + Basic Tier = "Basic" + // Premium ... + Premium Tier = "Premium" +) + +// PossibleTierValues returns an array of possible values for the Tier const type. +func PossibleTierValues() []Tier { + return []Tier{Basic, Premium} +} + +// ValidationState enumerates the values for validation state. +type ValidationState string + +const ( + // ValidationStateApproved ... + ValidationStateApproved ValidationState = "Approved" + // ValidationStateFailed ... + ValidationStateFailed ValidationState = "Failed" + // ValidationStateNone ... + ValidationStateNone ValidationState = "None" + // ValidationStatePending ... + ValidationStatePending ValidationState = "Pending" +) + +// PossibleValidationStateValues returns an array of possible values for the ValidationState const type. +func PossibleValidationStateValues() []ValidationState { + return []ValidationState{ValidationStateApproved, ValidationStateFailed, ValidationStateNone, ValidationStatePending} +} + +// BandwidthOffer the properties that define a peering bandwidth offer. +type BandwidthOffer struct { + // OfferName - The name of the bandwidth offer. + OfferName *string `json:"offerName,omitempty"` + // ValueInMbps - The value of the bandwidth offer in Mbps. + ValueInMbps *int32 `json:"valueInMbps,omitempty"` +} + +// BgpSession the properties that define a BGP session. +type BgpSession struct { + // SessionPrefixV4 - The IPv4 prefix that contains both ends' IPv4 addresses. + SessionPrefixV4 *string `json:"sessionPrefixV4,omitempty"` + // SessionPrefixV6 - The IPv6 prefix that contains both ends' IPv6 addresses. + SessionPrefixV6 *string `json:"sessionPrefixV6,omitempty"` + // MicrosoftSessionIPv4Address - 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', 'SessionStateV4OpenReceived', 'SessionStateV4Established', 'SessionStateV4PendingAdd', 'SessionStateV4PendingUpdate', 'SessionStateV4PendingRemove' + SessionStateV4 SessionStateV4 `json:"sessionStateV4,omitempty"` + // SessionStateV6 - READ-ONLY; The state of the IPv6 session. Possible values include: 'SessionStateV6None', 'SessionStateV6Idle', 'SessionStateV6Connect', 'SessionStateV6Active', 'SessionStateV6OpenSent', 'SessionStateV6OpenConfirm', 'SessionStateV6OpenReceived', 'SessionStateV6Established', 'SessionStateV6PendingAdd', 'SessionStateV6PendingUpdate', 'SessionStateV6PendingRemove' + SessionStateV6 SessionStateV6 `json:"sessionStateV6,omitempty"` + // MaxPrefixesAdvertisedV4 - The maximum number of prefixes advertised over the IPv4 session. + MaxPrefixesAdvertisedV4 *int32 `json:"maxPrefixesAdvertisedV4,omitempty"` + // MaxPrefixesAdvertisedV6 - The maximum number of prefixes advertised over the IPv6 session. + MaxPrefixesAdvertisedV6 *int32 `json:"maxPrefixesAdvertisedV6,omitempty"` + // Md5AuthenticationKey - The MD5 authentication key of the session. + Md5AuthenticationKey *string `json:"md5AuthenticationKey,omitempty"` +} + +// CheckServiceProviderAvailabilityInput class for CheckServiceProviderAvailabilityInput +type CheckServiceProviderAvailabilityInput struct { + // PeeringServiceLocation - Gets or sets the PeeringServiceLocation + PeeringServiceLocation *string `json:"peeringServiceLocation,omitempty"` + // PeeringServiceProvider - Gets or sets the PeeringServiceProvider + PeeringServiceProvider *string `json:"peeringServiceProvider,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 - READ-ONLY; The bandwidth that is actually provisioned. + ProvisionedBandwidthInMbps *int32 `json:"provisionedBandwidthInMbps,omitempty"` + // SessionAddressProvider - The field indicating if Microsoft provides session ip addresses. Possible values include: 'Microsoft', 'Peer' + SessionAddressProvider SessionAddressProvider `json:"sessionAddressProvider,omitempty"` + // UseForPeeringService - The flag that indicates whether or not the connection is used for peering service. + UseForPeeringService *bool `json:"useForPeeringService,omitempty"` + // PeeringDBFacilityID - The PeeringDB.com ID of the facility at which the connection has to be set up. + PeeringDBFacilityID *int32 `json:"peeringDBFacilityId,omitempty"` + // ConnectionState - READ-ONLY; The state of the connection. Possible values include: 'None', 'PendingApproval', 'Approved', 'ProvisioningStarted', 'ProvisioningFailed', 'ProvisioningCompleted', 'Validating', 'Active' + ConnectionState ConnectionState `json:"connectionState,omitempty"` + // BgpSession - The BGP session associated with the connection. + BgpSession *BgpSession `json:"bgpSession,omitempty"` + // ConnectionIdentifier - The unique identifier (GUID) for the connection. + ConnectionIdentifier *string `json:"connectionIdentifier,omitempty"` + // ErrorMessage - READ-ONLY; The error message related to the connection state, if any. + ErrorMessage *string `json:"errorMessage,omitempty"` +} + +// DirectPeeringFacility the properties that define a direct peering facility. +type DirectPeeringFacility struct { + // Address - The address of the direct peering facility. + Address *string `json:"address,omitempty"` + // DirectPeeringType - The type of the direct peering. Possible values include: 'Edge', 'Transit', 'Cdn', 'Internal' + DirectPeeringType DirectPeeringType `json:"directPeeringType,omitempty"` + // PeeringDBFacilityID - The PeeringDB.com ID of the facility. + PeeringDBFacilityID *int32 `json:"peeringDBFacilityId,omitempty"` + // PeeringDBFacilityLink - The PeeringDB.com URL of the facility. + PeeringDBFacilityLink *string `json:"peeringDBFacilityLink,omitempty"` +} + +// 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"` + // ConnectionIdentifier - The unique identifier (GUID) for the connection. + ConnectionIdentifier *string `json:"connectionIdentifier,omitempty"` + // ErrorMessage - READ-ONLY; The error message related to the connection state, if any. + ErrorMessage *string `json:"errorMessage,omitempty"` +} + +// ExchangePeeringFacility the properties that define an exchange peering facility. +type ExchangePeeringFacility struct { + // ExchangeName - The name of the exchange peering facility. + ExchangeName *string `json:"exchangeName,omitempty"` + // BandwidthInMbps - The bandwidth of the connection between Microsoft and the exchange peering facility. + BandwidthInMbps *int32 `json:"bandwidthInMbps,omitempty"` + // MicrosoftIPv4Address - The IPv4 address of Microsoft at the exchange peering facility. + MicrosoftIPv4Address *string `json:"microsoftIPv4Address,omitempty"` + // MicrosoftIPv6Address - The IPv6 address of Microsoft at the exchange peering facility. + MicrosoftIPv6Address *string `json:"microsoftIPv6Address,omitempty"` + // FacilityIPv4Prefix - The IPv4 prefixes associated with the exchange peering facility. + FacilityIPv4Prefix *string `json:"facilityIPv4Prefix,omitempty"` + // FacilityIPv6Prefix - The IPv6 prefixes associated with the exchange peering facility. + FacilityIPv6Prefix *string `json:"facilityIPv6Prefix,omitempty"` + // PeeringDBFacilityID - The PeeringDB.com ID of the facility. + PeeringDBFacilityID *int32 `json:"peeringDBFacilityId,omitempty"` + // PeeringDBFacilityLink - The PeeringDB.com URL of the facility. + PeeringDBFacilityLink *string `json:"peeringDBFacilityLink,omitempty"` +} + +// ListResult the paginated list of peerings. +type ListResult struct { + autorest.Response `json:"-"` + // Value - The list of peerings. + Value *[]Model `json:"value,omitempty"` + // NextLink - The link to fetch the next page of peerings. + NextLink *string `json:"nextLink,omitempty"` +} + +// ListResultIterator provides access to a complete listing of Model values. +type ListResultIterator struct { + i int + page ListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ListResultIterator) Response() ListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ListResultIterator) Value() Model { + if !iter.page.NotDone() { + return Model{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ListResultIterator type. +func NewListResultIterator(page ListResultPage) ListResultIterator { + return ListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (lr ListResult) IsEmpty() bool { + return lr.Value == nil || len(*lr.Value) == 0 +} + +// listResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lr ListResult) listResultPreparer(ctx context.Context) (*http.Request, error) { + if lr.NextLink == nil || len(to.String(lr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lr.NextLink))) +} + +// ListResultPage contains a page of Model values. +type ListResultPage struct { + fn func(context.Context, ListResult) (ListResult, error) + lr ListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.lr) + if err != nil { + return err + } + page.lr = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ListResultPage) NotDone() bool { + return !page.lr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ListResultPage) Response() ListResult { + return page.lr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ListResultPage) Values() []Model { + if page.lr.IsEmpty() { + return nil + } + return *page.lr.Value +} + +// Creates a new instance of the ListResultPage type. +func NewListResultPage(getNextPage func(context.Context, ListResult) (ListResult, error)) ListResultPage { + return ListResultPage{fn: getNextPage} +} + +// Location peering location is where connectivity could be established to the Microsoft Cloud Edge. +type Location struct { + // Kind - The kind of peering that the peering location supports. Possible values include: 'KindDirect', 'KindExchange' + Kind Kind `json:"kind,omitempty"` + // LocationProperties - The properties that define a peering location. + *LocationProperties `json:"properties,omitempty"` + // Name - READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty"` + // ID - READ-ONLY; The ID of the resource. + ID *string `json:"id,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Location. +func (l Location) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if l.Kind != "" { + objectMap["kind"] = l.Kind + } + if l.LocationProperties != nil { + objectMap["properties"] = l.LocationProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Location struct. +func (l *Location) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + l.Kind = kind + } + case "properties": + if v != nil { + var locationProperties LocationProperties + err = json.Unmarshal(*v, &locationProperties) + if err != nil { + return err + } + l.LocationProperties = &locationProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + l.Name = &name + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + l.ID = &ID + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + l.Type = &typeVar + } + } + } + + return nil +} + +// LocationListResult the paginated list of peering locations. +type LocationListResult struct { + autorest.Response `json:"-"` + // Value - The list of peering locations. + Value *[]Location `json:"value,omitempty"` + // NextLink - The link to fetch the next page of peering locations. + NextLink *string `json:"nextLink,omitempty"` +} + +// LocationListResultIterator provides access to a complete listing of Location values. +type LocationListResultIterator struct { + i int + page LocationListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *LocationListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LocationListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *LocationListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter LocationListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter LocationListResultIterator) Response() LocationListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter LocationListResultIterator) Value() Location { + if !iter.page.NotDone() { + return Location{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the LocationListResultIterator type. +func NewLocationListResultIterator(page LocationListResultPage) LocationListResultIterator { + return LocationListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (llr LocationListResult) IsEmpty() bool { + return llr.Value == nil || len(*llr.Value) == 0 +} + +// locationListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (llr LocationListResult) locationListResultPreparer(ctx context.Context) (*http.Request, error) { + if llr.NextLink == nil || len(to.String(llr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(llr.NextLink))) +} + +// LocationListResultPage contains a page of Location values. +type LocationListResultPage struct { + fn func(context.Context, LocationListResult) (LocationListResult, error) + llr LocationListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *LocationListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LocationListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.llr) + if err != nil { + return err + } + page.llr = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *LocationListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page LocationListResultPage) NotDone() bool { + return !page.llr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page LocationListResultPage) Response() LocationListResult { + return page.llr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page LocationListResultPage) Values() []Location { + if page.llr.IsEmpty() { + return nil + } + return *page.llr.Value +} + +// Creates a new instance of the LocationListResultPage type. +func NewLocationListResultPage(getNextPage func(context.Context, LocationListResult) (LocationListResult, error)) LocationListResultPage { + return LocationListResultPage{fn: getNextPage} +} + +// LocationProperties the properties that define a peering location. +type LocationProperties struct { + // Direct - The properties that define a direct peering location. + Direct *LocationPropertiesDirect `json:"direct,omitempty"` + // Exchange - The properties that define an exchange peering location. + Exchange *LocationPropertiesExchange `json:"exchange,omitempty"` + // PeeringLocation - The name of the peering location. + PeeringLocation *string `json:"peeringLocation,omitempty"` + // Country - The country in which the peering location exists. + Country *string `json:"country,omitempty"` + // AzureRegion - The Azure region associated with the peering location. + AzureRegion *string `json:"azureRegion,omitempty"` +} + +// LocationPropertiesDirect the properties that define a direct peering location. +type LocationPropertiesDirect struct { + // PeeringFacilities - The list of direct peering facilities at the peering location. + PeeringFacilities *[]DirectPeeringFacility `json:"peeringFacilities,omitempty"` + // BandwidthOffers - The list of bandwidth offers available at the peering location. + BandwidthOffers *[]BandwidthOffer `json:"bandwidthOffers,omitempty"` +} + +// LocationPropertiesExchange the properties that define an exchange peering location. +type LocationPropertiesExchange struct { + // PeeringFacilities - The list of exchange peering facilities at the peering location. + PeeringFacilities *[]ExchangePeeringFacility `json:"peeringFacilities,omitempty"` +} + +// Model peering is a logical representation of a set of connections to the Microsoft Cloud Edge at a +// location. +type Model struct { + autorest.Response `json:"-"` + // Sku - The SKU that defines the tier and kind of the peering. + Sku *Sku `json:"sku,omitempty"` + // Kind - The kind of the peering. Possible values include: 'KindDirect', 'KindExchange' + Kind Kind `json:"kind,omitempty"` + // Properties - The properties that define a peering. + *Properties `json:"properties,omitempty"` + // Location - The location of the resource. + Location *string `json:"location,omitempty"` + // Tags - The resource tags. + Tags map[string]*string `json:"tags"` + // Name - READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty"` + // ID - READ-ONLY; The ID of the resource. + ID *string `json:"id,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Model. +func (mVar Model) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mVar.Sku != nil { + objectMap["sku"] = mVar.Sku + } + if mVar.Kind != "" { + objectMap["kind"] = mVar.Kind + } + if mVar.Properties != nil { + objectMap["properties"] = mVar.Properties + } + if mVar.Location != nil { + objectMap["location"] = mVar.Location + } + if mVar.Tags != nil { + objectMap["tags"] = mVar.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Model struct. +func (mVar *Model) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + mVar.Sku = &sku + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + mVar.Kind = kind + } + case "properties": + if v != nil { + var properties Properties + err = json.Unmarshal(*v, &properties) + if err != nil { + return err + } + mVar.Properties = &properties + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + mVar.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + mVar.Tags = tags + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mVar.Name = &name + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mVar.ID = &ID + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mVar.Type = &typeVar + } + } + } + + return nil +} + +// Operation the peering API operation. +type Operation struct { + // Name - READ-ONLY; The name of the operation. + Name *string `json:"name,omitempty"` + // Display - READ-ONLY; The information related to the operation. + Display *OperationDisplayInfo `json:"display,omitempty"` + // IsDataAction - READ-ONLY; The flag that indicates whether the operation applies to data plane. + IsDataAction *bool `json:"isDataAction,omitempty"` +} + +// OperationDisplayInfo the information related to the operation. +type OperationDisplayInfo struct { + // Provider - READ-ONLY; The name of the resource provider. + Provider *string `json:"provider,omitempty"` + // Resource - READ-ONLY; The type of the resource. + Resource *string `json:"resource,omitempty"` + // Operation - READ-ONLY; The name of the operation. + Operation *string `json:"operation,omitempty"` + // Description - READ-ONLY; The description of the operation. + Description *string `json:"description,omitempty"` +} + +// OperationListResult the paginated list of peering API operations. +type OperationListResult struct { + autorest.Response `json:"-"` + // Value - The list of peering API operations. + Value *[]Operation `json:"value,omitempty"` + // NextLink - The link to fetch the next page of peering API operations. + NextLink *string `json:"nextLink,omitempty"` +} + +// OperationListResultIterator provides access to a complete listing of Operation values. +type OperationListResultIterator struct { + i int + page OperationListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *OperationListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OperationListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter OperationListResultIterator) Response() OperationListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter OperationListResultIterator) Value() Operation { + if !iter.page.NotDone() { + return Operation{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OperationListResultIterator type. +func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { + return OperationListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (olr OperationListResult) IsEmpty() bool { + return olr.Value == nil || len(*olr.Value) == 0 +} + +// operationListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { + if olr.NextLink == nil || len(to.String(olr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(olr.NextLink))) +} + +// OperationListResultPage contains a page of Operation values. +type OperationListResultPage struct { + fn func(context.Context, OperationListResult) (OperationListResult, error) + olr OperationListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.olr) + if err != nil { + return err + } + page.olr = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *OperationListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OperationListResultPage) NotDone() bool { + return !page.olr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OperationListResultPage) Response() OperationListResult { + return page.olr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OperationListResultPage) Values() []Operation { + if page.olr.IsEmpty() { + return nil + } + return *page.olr.Value +} + +// Creates a new instance of the OperationListResultPage type. +func NewOperationListResultPage(getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { + return OperationListResultPage{fn: getNextPage} +} + +// PeerAsn the essential information related to the peer's ASN. +type PeerAsn struct { + autorest.Response `json:"-"` + // PeerAsnProperties - The properties that define a peer's ASN. + *PeerAsnProperties `json:"properties,omitempty"` + // Name - READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty"` + // ID - READ-ONLY; The ID of the resource. + ID *string `json:"id,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PeerAsn. +func (pa PeerAsn) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pa.PeerAsnProperties != nil { + objectMap["properties"] = pa.PeerAsnProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PeerAsn struct. +func (pa *PeerAsn) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var peerAsnProperties PeerAsnProperties + err = json.Unmarshal(*v, &peerAsnProperties) + if err != nil { + return err + } + pa.PeerAsnProperties = &peerAsnProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pa.Name = &name + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pa.ID = &ID + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pa.Type = &typeVar + } + } + } + + return nil +} + +// PeerAsnListResult the paginated list of peer ASNs. +type PeerAsnListResult struct { + autorest.Response `json:"-"` + // Value - The list of peer ASNs. + Value *[]PeerAsn `json:"value,omitempty"` + // NextLink - The link to fetch the next page of peer ASNs. + NextLink *string `json:"nextLink,omitempty"` +} + +// PeerAsnListResultIterator provides access to a complete listing of PeerAsn values. +type PeerAsnListResultIterator struct { + i int + page PeerAsnListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *PeerAsnListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PeerAsnListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *PeerAsnListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PeerAsnListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter PeerAsnListResultIterator) Response() PeerAsnListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter PeerAsnListResultIterator) Value() PeerAsn { + if !iter.page.NotDone() { + return PeerAsn{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PeerAsnListResultIterator type. +func NewPeerAsnListResultIterator(page PeerAsnListResultPage) PeerAsnListResultIterator { + return PeerAsnListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (palr PeerAsnListResult) IsEmpty() bool { + return palr.Value == nil || len(*palr.Value) == 0 +} + +// peerAsnListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (palr PeerAsnListResult) peerAsnListResultPreparer(ctx context.Context) (*http.Request, error) { + if palr.NextLink == nil || len(to.String(palr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(palr.NextLink))) +} + +// PeerAsnListResultPage contains a page of PeerAsn values. +type PeerAsnListResultPage struct { + fn func(context.Context, PeerAsnListResult) (PeerAsnListResult, error) + palr PeerAsnListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *PeerAsnListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PeerAsnListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.palr) + if err != nil { + return err + } + page.palr = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *PeerAsnListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PeerAsnListResultPage) NotDone() bool { + return !page.palr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PeerAsnListResultPage) Response() PeerAsnListResult { + return page.palr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PeerAsnListResultPage) Values() []PeerAsn { + if page.palr.IsEmpty() { + return nil + } + return *page.palr.Value +} + +// Creates a new instance of the PeerAsnListResultPage type. +func NewPeerAsnListResultPage(getNextPage func(context.Context, PeerAsnListResult) (PeerAsnListResult, error)) PeerAsnListResultPage { + return PeerAsnListResultPage{fn: getNextPage} +} + +// PeerAsnProperties the properties that define a peer's ASN. +type PeerAsnProperties struct { + // PeerAsn - The Autonomous System Number (ASN) of the peer. + PeerAsn *int32 `json:"peerAsn,omitempty"` + // 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"` + // ErrorMessage - READ-ONLY; The error message for the validation state + ErrorMessage *string `json:"errorMessage,omitempty"` +} + +// Properties the properties that define connectivity to the Microsoft Cloud Edge. +type Properties struct { + // Direct - The properties that define a direct peering. + Direct *PropertiesDirect `json:"direct,omitempty"` + // Exchange - The properties that define an exchange peering. + Exchange *PropertiesExchange `json:"exchange,omitempty"` + // PeeringLocation - The location of the peering. + PeeringLocation *string `json:"peeringLocation,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// PropertiesDirect the properties that define a direct peering. +type PropertiesDirect struct { + // Connections - The set of connections that constitute a direct peering. + Connections *[]DirectConnection `json:"connections,omitempty"` + // UseForPeeringService - READ-ONLY; The flag that indicates whether or not the peering is used for peering service. + UseForPeeringService *bool `json:"useForPeeringService,omitempty"` + // PeerAsn - The reference of the peer ASN. + PeerAsn *SubResource `json:"peerAsn,omitempty"` + // DirectPeeringType - The type of direct peering. Possible values include: 'Edge', 'Transit', 'Cdn', 'Internal' + DirectPeeringType DirectPeeringType `json:"directPeeringType,omitempty"` +} + +// PropertiesExchange the properties that define an exchange peering. +type PropertiesExchange struct { + // Connections - The set of connections that constitute an exchange peering. + Connections *[]ExchangeConnection `json:"connections,omitempty"` + // PeerAsn - The reference of the peer ASN. + PeerAsn *SubResource `json:"peerAsn,omitempty"` +} + +// Resource the ARM resource class. +type Resource struct { + // Name - READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty"` + // ID - READ-ONLY; The ID of the resource. + ID *string `json:"id,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` +} + +// ResourceTags the resource tags. +type ResourceTags struct { + // Tags - Gets or sets the tags, a dictionary of descriptors arm object + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ResourceTags. +func (rt ResourceTags) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rt.Tags != nil { + objectMap["tags"] = rt.Tags + } + return json.Marshal(objectMap) +} + +// Service peering Service +type Service struct { + autorest.Response `json:"-"` + // ServiceProperties - The properties that define a peering service. + *ServiceProperties `json:"properties,omitempty"` + // Location - The location of the resource. + Location *string `json:"location,omitempty"` + // Tags - The resource tags. + Tags map[string]*string `json:"tags"` + // Name - READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty"` + // ID - READ-ONLY; The ID of the resource. + ID *string `json:"id,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Service. +func (s Service) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if s.ServiceProperties != nil { + objectMap["properties"] = s.ServiceProperties + } + if s.Location != nil { + objectMap["location"] = s.Location + } + if s.Tags != nil { + objectMap["tags"] = s.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Service struct. +func (s *Service) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var serviceProperties ServiceProperties + err = json.Unmarshal(*v, &serviceProperties) + if err != nil { + return err + } + s.ServiceProperties = &serviceProperties + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + s.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + s.Tags = tags + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + s.Name = &name + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + s.ID = &ID + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + s.Type = &typeVar + } + } + } + + return nil +} + +// ServiceListResult the paginated list of peering services. +type ServiceListResult struct { + autorest.Response `json:"-"` + // Value - The list of peering services. + Value *[]Service `json:"value,omitempty"` + // NextLink - The link to fetch the next page of peering services. + NextLink *string `json:"nextLink,omitempty"` +} + +// ServiceListResultIterator provides access to a complete listing of Service values. +type ServiceListResultIterator struct { + i int + page ServiceListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ServiceListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ServiceListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ServiceListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ServiceListResultIterator) Response() ServiceListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ServiceListResultIterator) Value() Service { + if !iter.page.NotDone() { + return Service{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ServiceListResultIterator type. +func NewServiceListResultIterator(page ServiceListResultPage) ServiceListResultIterator { + return ServiceListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (slr ServiceListResult) IsEmpty() bool { + return slr.Value == nil || len(*slr.Value) == 0 +} + +// serviceListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (slr ServiceListResult) serviceListResultPreparer(ctx context.Context) (*http.Request, error) { + if slr.NextLink == nil || len(to.String(slr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(slr.NextLink))) +} + +// ServiceListResultPage contains a page of Service values. +type ServiceListResultPage struct { + fn func(context.Context, ServiceListResult) (ServiceListResult, error) + slr ServiceListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ServiceListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.slr) + if err != nil { + return err + } + page.slr = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ServiceListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ServiceListResultPage) NotDone() bool { + return !page.slr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ServiceListResultPage) Response() ServiceListResult { + return page.slr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ServiceListResultPage) Values() []Service { + if page.slr.IsEmpty() { + return nil + } + return *page.slr.Value +} + +// Creates a new instance of the ServiceListResultPage type. +func NewServiceListResultPage(getNextPage func(context.Context, ServiceListResult) (ServiceListResult, error)) ServiceListResultPage { + return ServiceListResultPage{fn: getNextPage} +} + +// ServiceLocation peeringService location +type ServiceLocation struct { + // ServiceLocationProperties - The properties that define a peering service location. + *ServiceLocationProperties `json:"properties,omitempty"` + // Name - READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty"` + // ID - READ-ONLY; The ID of the resource. + ID *string `json:"id,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServiceLocation. +func (sl ServiceLocation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sl.ServiceLocationProperties != nil { + objectMap["properties"] = sl.ServiceLocationProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ServiceLocation struct. +func (sl *ServiceLocation) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var serviceLocationProperties ServiceLocationProperties + err = json.Unmarshal(*v, &serviceLocationProperties) + if err != nil { + return err + } + sl.ServiceLocationProperties = &serviceLocationProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sl.Name = &name + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sl.ID = &ID + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sl.Type = &typeVar + } + } + } + + return nil +} + +// ServiceLocationListResult the paginated list of peering service locations. +type ServiceLocationListResult struct { + autorest.Response `json:"-"` + // Value - The list of peering service locations. + Value *[]ServiceLocation `json:"value,omitempty"` + // NextLink - The link to fetch the next page of peering service locations. + NextLink *string `json:"nextLink,omitempty"` +} + +// ServiceLocationListResultIterator provides access to a complete listing of ServiceLocation values. +type ServiceLocationListResultIterator struct { + i int + page ServiceLocationListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ServiceLocationListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceLocationListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ServiceLocationListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ServiceLocationListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ServiceLocationListResultIterator) Response() ServiceLocationListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ServiceLocationListResultIterator) Value() ServiceLocation { + if !iter.page.NotDone() { + return ServiceLocation{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ServiceLocationListResultIterator type. +func NewServiceLocationListResultIterator(page ServiceLocationListResultPage) ServiceLocationListResultIterator { + return ServiceLocationListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sllr ServiceLocationListResult) IsEmpty() bool { + return sllr.Value == nil || len(*sllr.Value) == 0 +} + +// serviceLocationListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sllr ServiceLocationListResult) serviceLocationListResultPreparer(ctx context.Context) (*http.Request, error) { + if sllr.NextLink == nil || len(to.String(sllr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sllr.NextLink))) +} + +// ServiceLocationListResultPage contains a page of ServiceLocation values. +type ServiceLocationListResultPage struct { + fn func(context.Context, ServiceLocationListResult) (ServiceLocationListResult, error) + sllr ServiceLocationListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ServiceLocationListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceLocationListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.sllr) + if err != nil { + return err + } + page.sllr = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ServiceLocationListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ServiceLocationListResultPage) NotDone() bool { + return !page.sllr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ServiceLocationListResultPage) Response() ServiceLocationListResult { + return page.sllr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ServiceLocationListResultPage) Values() []ServiceLocation { + if page.sllr.IsEmpty() { + return nil + } + return *page.sllr.Value +} + +// Creates a new instance of the ServiceLocationListResultPage type. +func NewServiceLocationListResultPage(getNextPage func(context.Context, ServiceLocationListResult) (ServiceLocationListResult, error)) ServiceLocationListResultPage { + return ServiceLocationListResultPage{fn: getNextPage} +} + +// ServiceLocationProperties the properties that define connectivity to the Peering Service Location. +type ServiceLocationProperties struct { + // Country - Country of the customer + Country *string `json:"country,omitempty"` + // State - State of the customer + State *string `json:"state,omitempty"` + // AzureRegion - Azure region for the location + AzureRegion *string `json:"azureRegion,omitempty"` +} + +// ServicePrefix the peering service prefix class. +type ServicePrefix struct { + autorest.Response `json:"-"` + // ServicePrefixProperties - Gets or sets the peering prefix properties. + *ServicePrefixProperties `json:"properties,omitempty"` + // Name - READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty"` + // ID - READ-ONLY; The ID of the resource. + ID *string `json:"id,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServicePrefix. +func (sp ServicePrefix) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sp.ServicePrefixProperties != nil { + objectMap["properties"] = sp.ServicePrefixProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ServicePrefix struct. +func (sp *ServicePrefix) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var servicePrefixProperties ServicePrefixProperties + err = json.Unmarshal(*v, &servicePrefixProperties) + if err != nil { + return err + } + sp.ServicePrefixProperties = &servicePrefixProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sp.Name = &name + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sp.ID = &ID + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sp.Type = &typeVar + } + } + } + + return nil +} + +// ServicePrefixEvent the details of the event associated with a prefix. +type ServicePrefixEvent struct { + // EventTimestamp - READ-ONLY; The timestamp of the event associated with a prefix. + EventTimestamp *date.Time `json:"eventTimestamp,omitempty"` + // EventType - READ-ONLY; The type of the event associated with a prefix. + EventType *string `json:"eventType,omitempty"` + // EventSummary - READ-ONLY; The summary of the event associated with a prefix. + EventSummary *string `json:"eventSummary,omitempty"` + // EventLevel - READ-ONLY; The level of the event associated with a prefix. + EventLevel *string `json:"eventLevel,omitempty"` + // EventDescription - READ-ONLY; The description of the event associated with a prefix. + EventDescription *string `json:"eventDescription,omitempty"` +} + +// ServicePrefixListResult the paginated list of peering service prefixes. +type ServicePrefixListResult struct { + autorest.Response `json:"-"` + // Value - The list of peering service prefixes. + Value *[]ServicePrefix `json:"value,omitempty"` + // NextLink - The link to fetch the next page of peering service prefixes. + NextLink *string `json:"nextLink,omitempty"` +} + +// ServicePrefixListResultIterator provides access to a complete listing of ServicePrefix values. +type ServicePrefixListResultIterator struct { + i int + page ServicePrefixListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ServicePrefixListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicePrefixListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ServicePrefixListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ServicePrefixListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ServicePrefixListResultIterator) Response() ServicePrefixListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ServicePrefixListResultIterator) Value() ServicePrefix { + if !iter.page.NotDone() { + return ServicePrefix{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ServicePrefixListResultIterator type. +func NewServicePrefixListResultIterator(page ServicePrefixListResultPage) ServicePrefixListResultIterator { + return ServicePrefixListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (splr ServicePrefixListResult) IsEmpty() bool { + return splr.Value == nil || len(*splr.Value) == 0 +} + +// servicePrefixListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (splr ServicePrefixListResult) servicePrefixListResultPreparer(ctx context.Context) (*http.Request, error) { + if splr.NextLink == nil || len(to.String(splr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(splr.NextLink))) +} + +// ServicePrefixListResultPage contains a page of ServicePrefix values. +type ServicePrefixListResultPage struct { + fn func(context.Context, ServicePrefixListResult) (ServicePrefixListResult, error) + splr ServicePrefixListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ServicePrefixListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicePrefixListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.splr) + if err != nil { + return err + } + page.splr = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ServicePrefixListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ServicePrefixListResultPage) NotDone() bool { + return !page.splr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ServicePrefixListResultPage) Response() ServicePrefixListResult { + return page.splr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ServicePrefixListResultPage) Values() []ServicePrefix { + if page.splr.IsEmpty() { + return nil + } + return *page.splr.Value +} + +// Creates a new instance of the ServicePrefixListResultPage type. +func NewServicePrefixListResultPage(getNextPage func(context.Context, ServicePrefixListResult) (ServicePrefixListResult, error)) ServicePrefixListResultPage { + return ServicePrefixListResultPage{fn: getNextPage} +} + +// ServicePrefixProperties the peering service prefix properties class. +type ServicePrefixProperties struct { + // Prefix - The prefix from which your traffic originates. + Prefix *string `json:"prefix,omitempty"` + // PrefixValidationState - READ-ONLY; The prefix validation state. Possible values include: 'PrefixValidationStateNone', 'PrefixValidationStateInvalid', 'PrefixValidationStateVerified', 'PrefixValidationStateFailed', 'PrefixValidationStatePending', 'PrefixValidationStateWarning', 'PrefixValidationStateUnknown' + PrefixValidationState PrefixValidationState `json:"prefixValidationState,omitempty"` + // LearnedType - READ-ONLY; The prefix learned type. Possible values include: 'LearnedTypeNone', 'LearnedTypeViaServiceProvider', 'LearnedTypeViaSession' + LearnedType LearnedType `json:"learnedType,omitempty"` + // ErrorMessage - READ-ONLY; The error message for validation state + ErrorMessage *string `json:"errorMessage,omitempty"` + // Events - READ-ONLY; The list of events for peering service prefix + Events *[]ServicePrefixEvent `json:"events,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// ServiceProperties the properties that define connectivity to the Peering Service. +type ServiceProperties struct { + // PeeringServiceLocation - The PeeringServiceLocation of the Customer. + PeeringServiceLocation *string `json:"peeringServiceLocation,omitempty"` + // PeeringServiceProvider - The MAPS Provider Name. + PeeringServiceProvider *string `json:"peeringServiceProvider,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// ServiceProvider peeringService provider +type ServiceProvider struct { + // ServiceProviderProperties - The properties that define a peering service provider. + *ServiceProviderProperties `json:"properties,omitempty"` + // Name - READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty"` + // ID - READ-ONLY; The ID of the resource. + ID *string `json:"id,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServiceProvider. +func (sp ServiceProvider) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sp.ServiceProviderProperties != nil { + objectMap["properties"] = sp.ServiceProviderProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ServiceProvider struct. +func (sp *ServiceProvider) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var serviceProviderProperties ServiceProviderProperties + err = json.Unmarshal(*v, &serviceProviderProperties) + if err != nil { + return err + } + sp.ServiceProviderProperties = &serviceProviderProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sp.Name = &name + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sp.ID = &ID + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sp.Type = &typeVar + } + } + } + + return nil +} + +// ServiceProviderListResult the paginated list of peering service providers. +type ServiceProviderListResult struct { + autorest.Response `json:"-"` + // Value - The list of peering service providers. + Value *[]ServiceProvider `json:"value,omitempty"` + // NextLink - The link to fetch the next page of peering service providers. + NextLink *string `json:"nextLink,omitempty"` +} + +// ServiceProviderListResultIterator provides access to a complete listing of ServiceProvider values. +type ServiceProviderListResultIterator struct { + i int + page ServiceProviderListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ServiceProviderListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceProviderListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ServiceProviderListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ServiceProviderListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ServiceProviderListResultIterator) Response() ServiceProviderListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ServiceProviderListResultIterator) Value() ServiceProvider { + if !iter.page.NotDone() { + return ServiceProvider{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ServiceProviderListResultIterator type. +func NewServiceProviderListResultIterator(page ServiceProviderListResultPage) ServiceProviderListResultIterator { + return ServiceProviderListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (splr ServiceProviderListResult) IsEmpty() bool { + return splr.Value == nil || len(*splr.Value) == 0 +} + +// serviceProviderListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (splr ServiceProviderListResult) serviceProviderListResultPreparer(ctx context.Context) (*http.Request, error) { + if splr.NextLink == nil || len(to.String(splr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(splr.NextLink))) +} + +// ServiceProviderListResultPage contains a page of ServiceProvider values. +type ServiceProviderListResultPage struct { + fn func(context.Context, ServiceProviderListResult) (ServiceProviderListResult, error) + splr ServiceProviderListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ServiceProviderListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceProviderListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.splr) + if err != nil { + return err + } + page.splr = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ServiceProviderListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ServiceProviderListResultPage) NotDone() bool { + return !page.splr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ServiceProviderListResultPage) Response() ServiceProviderListResult { + return page.splr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ServiceProviderListResultPage) Values() []ServiceProvider { + if page.splr.IsEmpty() { + return nil + } + return *page.splr.Value +} + +// Creates a new instance of the ServiceProviderListResultPage type. +func NewServiceProviderListResultPage(getNextPage func(context.Context, ServiceProviderListResult) (ServiceProviderListResult, error)) ServiceProviderListResultPage { + return ServiceProviderListResultPage{fn: getNextPage} +} + +// ServiceProviderProperties the properties that define connectivity to the Peering Service Provider. +type ServiceProviderProperties struct { + // ServiceProviderName - The name of the service provider. + ServiceProviderName *string `json:"serviceProviderName,omitempty"` +} + +// 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', 'PremiumDirectMetered', 'PremiumDirectUnlimited' + 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"` +} + +// String ... +type String struct { + autorest.Response `json:"-"` + // Value - Possible values include: 'Available', 'Unavailable' + Value *string `json:"value,omitempty"` +} + +// SubResource the sub resource. +type SubResource struct { + // ID - The identifier of the referenced resource. + ID *string `json:"id,omitempty"` +} diff --git a/services/preview/sql/mgmt/2018-06-15-preview/sql/operations.go b/services/preview/peering/mgmt/2019-09-01-preview/peering/operations.go similarity index 79% rename from services/preview/sql/mgmt/2018-06-15-preview/sql/operations.go rename to services/preview/peering/mgmt/2019-09-01-preview/peering/operations.go index bd0657225fde..ae4324c7426a 100644 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/operations.go +++ b/services/preview/peering/mgmt/2019-09-01-preview/peering/operations.go @@ -1,4 +1,4 @@ -package sql +package peering // Copyright (c) Microsoft and contributors. All rights reserved. // @@ -25,9 +25,7 @@ import ( "net/http" ) -// OperationsClient is the the Azure SQL Database management API provides a RESTful set of web services that interact -// with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, and -// delete databases. +// OperationsClient is the peering Client type OperationsClient struct { BaseClient } @@ -42,7 +40,7 @@ func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) Opera return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// List lists all of the available SQL Rest API operations. +// List lists all of the available API operations for peering resources. func (client OperationsClient) List(ctx context.Context) (result OperationListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") @@ -57,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, "sql.OperationsClient", "List", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "peering.OperationsClient", "List", nil, "Failure preparing request") return } resp, err := client.ListSender(req) if err != nil { result.olr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.OperationsClient", "List", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "peering.OperationsClient", "List", resp, "Failure sending request") return } result.olr, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "sql.OperationsClient", "List", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "peering.OperationsClient", "List", resp, "Failure responding to request") } return @@ -78,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 = "2015-05-01-preview" + const APIVersion = "2019-09-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -86,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.Sql/operations"), + autorest.WithPath("/providers/Microsoft.Peering/operations"), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -115,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, "sql.OperationsClient", "listNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "peering.OperationsClient", "listNextResults", nil, "Failure preparing next results request") } if req == nil { return @@ -123,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, "sql.OperationsClient", "listNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "peering.OperationsClient", "listNextResults", resp, "Failure sending next results request") } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "sql.OperationsClient", "listNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "peering.OperationsClient", "listNextResults", resp, "Failure responding to next results request") } return } diff --git a/services/preview/peering/mgmt/2019-09-01-preview/peering/peerasns.go b/services/preview/peering/mgmt/2019-09-01-preview/peering/peerasns.go new file mode 100644 index 000000000000..14a5e258bd16 --- /dev/null +++ b/services/preview/peering/mgmt/2019-09-01-preview/peering/peerasns.go @@ -0,0 +1,379 @@ +package peering + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// PeerAsnsClient is the peering Client +type PeerAsnsClient struct { + BaseClient +} + +// NewPeerAsnsClient creates an instance of the PeerAsnsClient client. +func NewPeerAsnsClient(subscriptionID string) PeerAsnsClient { + return NewPeerAsnsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPeerAsnsClientWithBaseURI creates an instance of the PeerAsnsClient client. +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-09-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-09-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-09-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-09-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-09-01-preview/peering/peeringapi/interfaces.go b/services/preview/peering/mgmt/2019-09-01-preview/peering/peeringapi/interfaces.go new file mode 100644 index 000000000000..f88926bfe4eb --- /dev/null +++ b/services/preview/peering/mgmt/2019-09-01-preview/peering/peeringapi/interfaces.go @@ -0,0 +1,110 @@ +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-09-01-preview/peering" + "github.com/Azure/go-autorest/autorest" +) + +// BaseClientAPI contains the set of methods on the BaseClient type. +type BaseClientAPI interface { + CheckServiceProviderAvailability(ctx context.Context, checkServiceProviderAvailabilityInput peering.CheckServiceProviderAvailabilityInput) (result peering.String, err error) +} + +var _ BaseClientAPI = (*peering.BaseClient)(nil) + +// LegacyPeeringsClientAPI contains the set of methods on the LegacyPeeringsClient type. +type LegacyPeeringsClientAPI interface { + List(ctx context.Context, peeringLocation string, kind string) (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, directPeeringType 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) + +// ServiceLocationsClientAPI contains the set of methods on the ServiceLocationsClient type. +type ServiceLocationsClientAPI interface { + List(ctx context.Context) (result peering.ServiceLocationListResultPage, err error) +} + +var _ ServiceLocationsClientAPI = (*peering.ServiceLocationsClient)(nil) + +// PrefixesClientAPI contains the set of methods on the PrefixesClient type. +type PrefixesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, peeringServiceName string, prefixName string, peeringServicePrefix peering.ServicePrefix) (result peering.ServicePrefix, err error) + Delete(ctx context.Context, resourceGroupName string, peeringServiceName string, prefixName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, peeringServiceName string, prefixName string, expand string) (result peering.ServicePrefix, err error) + ListByPeeringService(ctx context.Context, resourceGroupName string, peeringServiceName string, expand string) (result peering.ServicePrefixListResultPage, err error) +} + +var _ PrefixesClientAPI = (*peering.PrefixesClient)(nil) + +// ServiceProvidersClientAPI contains the set of methods on the ServiceProvidersClient type. +type ServiceProvidersClientAPI interface { + List(ctx context.Context) (result peering.ServiceProviderListResultPage, err error) +} + +var _ ServiceProvidersClientAPI = (*peering.ServiceProvidersClient)(nil) + +// ServicesClientAPI contains the set of methods on the ServicesClient type. +type ServicesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, peeringServiceName string, peeringService peering.Service) (result peering.Service, err error) + Delete(ctx context.Context, resourceGroupName string, peeringServiceName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, peeringServiceName string) (result peering.Service, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result peering.ServiceListResultPage, err error) + ListBySubscription(ctx context.Context) (result peering.ServiceListResultPage, err error) + Update(ctx context.Context, resourceGroupName string, peeringServiceName string, tags peering.ResourceTags) (result peering.Service, err error) +} + +var _ ServicesClientAPI = (*peering.ServicesClient)(nil) diff --git a/services/preview/peering/mgmt/2019-09-01-preview/peering/peerings.go b/services/preview/peering/mgmt/2019-09-01-preview/peering/peerings.go new file mode 100644 index 000000000000..c2906422fc11 --- /dev/null +++ b/services/preview/peering/mgmt/2019-09-01-preview/peering/peerings.go @@ -0,0 +1,586 @@ +package peering + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// PeeringsClient is the peering Client +type PeeringsClient struct { + BaseClient +} + +// NewPeeringsClient creates an instance of the PeeringsClient client. +func NewPeeringsClient(subscriptionID string) PeeringsClient { + return NewPeeringsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPeeringsClientWithBaseURI creates an instance of the PeeringsClient client. +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-09-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-09-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-09-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-09-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-09-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-09-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-09-01-preview/peering/prefixes.go b/services/preview/peering/mgmt/2019-09-01-preview/peering/prefixes.go new file mode 100644 index 000000000000..601d96cb54e6 --- /dev/null +++ b/services/preview/peering/mgmt/2019-09-01-preview/peering/prefixes.go @@ -0,0 +1,406 @@ +package peering + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// PrefixesClient is the peering Client +type PrefixesClient struct { + BaseClient +} + +// NewPrefixesClient creates an instance of the PrefixesClient client. +func NewPrefixesClient(subscriptionID string) PrefixesClient { + return NewPrefixesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPrefixesClientWithBaseURI creates an instance of the PrefixesClient client. +func NewPrefixesClientWithBaseURI(baseURI string, subscriptionID string) PrefixesClient { + return PrefixesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates a new prefix with the specified name under the given subscription, resource group and peering +// service. +// Parameters: +// resourceGroupName - the name of the resource group. +// peeringServiceName - the name of the peering service. +// prefixName - the name of the prefix. +// peeringServicePrefix - the properties needed to create a prefix. +func (client PrefixesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, peeringServiceName string, prefixName string, peeringServicePrefix ServicePrefix) (result ServicePrefix, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrefixesClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, peeringServiceName, prefixName, peeringServicePrefix) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.PrefixesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "peering.PrefixesClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.PrefixesClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client PrefixesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, peeringServiceName string, prefixName string, peeringServicePrefix ServicePrefix) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "peeringServiceName": autorest.Encode("path", peeringServiceName), + "prefixName": autorest.Encode("path", prefixName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-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/peeringServices/{peeringServiceName}/prefixes/{prefixName}", pathParameters), + autorest.WithJSON(peeringServicePrefix), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client PrefixesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + 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 PrefixesClient) CreateOrUpdateResponder(resp *http.Response) (result ServicePrefix, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes an existing prefix with the specified name under the given subscription, resource group and peering +// service. +// Parameters: +// resourceGroupName - the name of the resource group. +// peeringServiceName - the name of the peering service. +// prefixName - the name of the prefix. +func (client PrefixesClient) Delete(ctx context.Context, resourceGroupName string, peeringServiceName string, prefixName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrefixesClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, peeringServiceName, prefixName) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.PrefixesClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "peering.PrefixesClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.PrefixesClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client PrefixesClient) DeletePreparer(ctx context.Context, resourceGroupName string, peeringServiceName string, prefixName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "peeringServiceName": autorest.Encode("path", peeringServiceName), + "prefixName": autorest.Encode("path", prefixName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-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/peeringServices/{peeringServiceName}/prefixes/{prefixName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client PrefixesClient) DeleteSender(req *http.Request) (*http.Response, error) { + 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 PrefixesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets an existing prefix with the specified name under the given subscription, resource group and peering +// service. +// Parameters: +// resourceGroupName - the name of the resource group. +// peeringServiceName - the name of the peering service. +// prefixName - the name of the prefix. +// expand - the properties to be expanded. +func (client PrefixesClient) Get(ctx context.Context, resourceGroupName string, peeringServiceName string, prefixName string, expand string) (result ServicePrefix, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrefixesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, peeringServiceName, prefixName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.PrefixesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "peering.PrefixesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.PrefixesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client PrefixesClient) GetPreparer(ctx context.Context, resourceGroupName string, peeringServiceName string, prefixName string, expand string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "peeringServiceName": autorest.Encode("path", peeringServiceName), + "prefixName": autorest.Encode("path", prefixName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peeringServices/{peeringServiceName}/prefixes/{prefixName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client PrefixesClient) GetSender(req *http.Request) (*http.Response, error) { + 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 PrefixesClient) GetResponder(resp *http.Response) (result ServicePrefix, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByPeeringService lists all prefixes under the given subscription, resource group and peering service. +// Parameters: +// resourceGroupName - the name of the resource group. +// peeringServiceName - the name of the peering service. +// expand - the properties to be expanded. +func (client PrefixesClient) ListByPeeringService(ctx context.Context, resourceGroupName string, peeringServiceName string, expand string) (result ServicePrefixListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrefixesClient.ListByPeeringService") + defer func() { + sc := -1 + if result.splr.Response.Response != nil { + sc = result.splr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByPeeringServiceNextResults + req, err := client.ListByPeeringServicePreparer(ctx, resourceGroupName, peeringServiceName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.PrefixesClient", "ListByPeeringService", nil, "Failure preparing request") + return + } + + resp, err := client.ListByPeeringServiceSender(req) + if err != nil { + result.splr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "peering.PrefixesClient", "ListByPeeringService", resp, "Failure sending request") + return + } + + result.splr, err = client.ListByPeeringServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.PrefixesClient", "ListByPeeringService", resp, "Failure responding to request") + } + + return +} + +// ListByPeeringServicePreparer prepares the ListByPeeringService request. +func (client PrefixesClient) ListByPeeringServicePreparer(ctx context.Context, resourceGroupName string, peeringServiceName string, expand string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "peeringServiceName": autorest.Encode("path", peeringServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peeringServices/{peeringServiceName}/prefixes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByPeeringServiceSender sends the ListByPeeringService request. The method will close the +// http.Response Body if it receives an error. +func (client PrefixesClient) ListByPeeringServiceSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByPeeringServiceResponder handles the response to the ListByPeeringService request. The method always +// closes the http.Response Body. +func (client PrefixesClient) ListByPeeringServiceResponder(resp *http.Response) (result ServicePrefixListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByPeeringServiceNextResults retrieves the next set of results, if any. +func (client PrefixesClient) listByPeeringServiceNextResults(ctx context.Context, lastResults ServicePrefixListResult) (result ServicePrefixListResult, err error) { + req, err := lastResults.servicePrefixListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "peering.PrefixesClient", "listByPeeringServiceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByPeeringServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "peering.PrefixesClient", "listByPeeringServiceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByPeeringServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.PrefixesClient", "listByPeeringServiceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByPeeringServiceComplete enumerates all values, automatically crossing page boundaries as required. +func (client PrefixesClient) ListByPeeringServiceComplete(ctx context.Context, resourceGroupName string, peeringServiceName string, expand string) (result ServicePrefixListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrefixesClient.ListByPeeringService") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByPeeringService(ctx, resourceGroupName, peeringServiceName, expand) + return +} diff --git a/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/privatecloudbyregion.go b/services/preview/peering/mgmt/2019-09-01-preview/peering/servicelocations.go similarity index 50% rename from services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/privatecloudbyregion.go rename to services/preview/peering/mgmt/2019-09-01-preview/peering/servicelocations.go index d604422c9686..51bb8bc8f450 100644 --- a/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/privatecloudbyregion.go +++ b/services/preview/peering/mgmt/2019-09-01-preview/peering/servicelocations.go @@ -1,4 +1,4 @@ -package vmwarecloudsimple +package peering // Copyright (c) Microsoft and contributors. All rights reserved. // @@ -25,29 +25,29 @@ import ( "net/http" ) -// PrivateCloudByRegionClient is the description of the new service -type PrivateCloudByRegionClient struct { +// ServiceLocationsClient is the peering Client +type ServiceLocationsClient struct { BaseClient } -// NewPrivateCloudByRegionClient creates an instance of the PrivateCloudByRegionClient client. -func NewPrivateCloudByRegionClient(referer string, regionID string, subscriptionID string) PrivateCloudByRegionClient { - return NewPrivateCloudByRegionClientWithBaseURI(DefaultBaseURI, referer, regionID, subscriptionID) +// NewServiceLocationsClient creates an instance of the ServiceLocationsClient client. +func NewServiceLocationsClient(subscriptionID string) ServiceLocationsClient { + return NewServiceLocationsClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewPrivateCloudByRegionClientWithBaseURI creates an instance of the PrivateCloudByRegionClient client. -func NewPrivateCloudByRegionClientWithBaseURI(baseURI string, referer string, regionID string, subscriptionID string) PrivateCloudByRegionClient { - return PrivateCloudByRegionClient{NewWithBaseURI(baseURI, referer, regionID, subscriptionID)} +// NewServiceLocationsClientWithBaseURI creates an instance of the ServiceLocationsClient client. +func NewServiceLocationsClientWithBaseURI(baseURI string, subscriptionID string) ServiceLocationsClient { + return ServiceLocationsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// List returns list of private clouds in particular region -func (client PrivateCloudByRegionClient) List(ctx context.Context) (result PrivateCloudListPage, err error) { +// List lists all of the available peering service locations for the specified kind of peering. +func (client ServiceLocationsClient) List(ctx context.Context) (result ServiceLocationListResultPage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateCloudByRegionClient.List") + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceLocationsClient.List") defer func() { sc := -1 - if result.pcl.Response.Response != nil { - sc = result.pcl.Response.Response.StatusCode + if result.sllr.Response.Response != nil { + sc = result.sllr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -55,33 +55,32 @@ func (client PrivateCloudByRegionClient) List(ctx context.Context) (result Priva result.fn = client.listNextResults req, err := client.ListPreparer(ctx) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.PrivateCloudByRegionClient", "List", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "peering.ServiceLocationsClient", "List", nil, "Failure preparing request") return } resp, err := client.ListSender(req) if err != nil { - result.pcl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.PrivateCloudByRegionClient", "List", resp, "Failure sending request") + result.sllr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "peering.ServiceLocationsClient", "List", resp, "Failure sending request") return } - result.pcl, err = client.ListResponder(resp) + result.sllr, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.PrivateCloudByRegionClient", "List", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "peering.ServiceLocationsClient", "List", resp, "Failure responding to request") } return } // ListPreparer prepares the List request. -func (client PrivateCloudByRegionClient) ListPreparer(ctx context.Context) (*http.Request, error) { +func (client ServiceLocationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { pathParameters := map[string]interface{}{ - "regionId": autorest.Encode("path", client.RegionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-04-01" + const APIVersion = "2019-09-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -89,21 +88,21 @@ func (client PrivateCloudByRegionClient) ListPreparer(ctx context.Context) (*htt preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Peering/peeringServiceLocations", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. -func (client PrivateCloudByRegionClient) ListSender(req *http.Request) (*http.Response, error) { +func (client ServiceLocationsClient) 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 PrivateCloudByRegionClient) ListResponder(resp *http.Response) (result PrivateCloudList, err error) { +func (client ServiceLocationsClient) ListResponder(resp *http.Response) (result ServiceLocationListResult, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -115,10 +114,10 @@ func (client PrivateCloudByRegionClient) ListResponder(resp *http.Response) (res } // listNextResults retrieves the next set of results, if any. -func (client PrivateCloudByRegionClient) listNextResults(ctx context.Context, lastResults PrivateCloudList) (result PrivateCloudList, err error) { - req, err := lastResults.privateCloudListPreparer(ctx) +func (client ServiceLocationsClient) listNextResults(ctx context.Context, lastResults ServiceLocationListResult) (result ServiceLocationListResult, err error) { + req, err := lastResults.serviceLocationListResultPreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.PrivateCloudByRegionClient", "listNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "peering.ServiceLocationsClient", "listNextResults", nil, "Failure preparing next results request") } if req == nil { return @@ -126,19 +125,19 @@ func (client PrivateCloudByRegionClient) listNextResults(ctx context.Context, la resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.PrivateCloudByRegionClient", "listNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "peering.ServiceLocationsClient", "listNextResults", resp, "Failure sending next results request") } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.PrivateCloudByRegionClient", "listNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "peering.ServiceLocationsClient", "listNextResults", resp, "Failure responding to next results request") } return } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client PrivateCloudByRegionClient) ListComplete(ctx context.Context) (result PrivateCloudListIterator, err error) { +func (client ServiceLocationsClient) ListComplete(ctx context.Context) (result ServiceLocationListResultIterator, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateCloudByRegionClient.List") + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceLocationsClient.List") defer func() { sc := -1 if result.Response().Response.Response != nil { diff --git a/services/preview/peering/mgmt/2019-09-01-preview/peering/serviceproviders.go b/services/preview/peering/mgmt/2019-09-01-preview/peering/serviceproviders.go new file mode 100644 index 000000000000..cc26d5af1164 --- /dev/null +++ b/services/preview/peering/mgmt/2019-09-01-preview/peering/serviceproviders.go @@ -0,0 +1,151 @@ +package peering + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ServiceProvidersClient is the peering Client +type ServiceProvidersClient struct { + BaseClient +} + +// NewServiceProvidersClient creates an instance of the ServiceProvidersClient client. +func NewServiceProvidersClient(subscriptionID string) ServiceProvidersClient { + return NewServiceProvidersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewServiceProvidersClientWithBaseURI creates an instance of the ServiceProvidersClient client. +func NewServiceProvidersClientWithBaseURI(baseURI string, subscriptionID string) ServiceProvidersClient { + return ServiceProvidersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists all of the available peering service locations for the specified kind of peering. +func (client ServiceProvidersClient) List(ctx context.Context) (result ServiceProviderListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceProvidersClient.List") + defer func() { + sc := -1 + if result.splr.Response.Response != nil { + sc = result.splr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.ServiceProvidersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.splr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "peering.ServiceProvidersClient", "List", resp, "Failure sending request") + return + } + + result.splr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.ServiceProvidersClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ServiceProvidersClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-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/peeringServiceProviders", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ServiceProvidersClient) ListSender(req *http.Request) (*http.Response, error) { + 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 ServiceProvidersClient) ListResponder(resp *http.Response) (result ServiceProviderListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ServiceProvidersClient) listNextResults(ctx context.Context, lastResults ServiceProviderListResult) (result ServiceProviderListResult, err error) { + req, err := lastResults.serviceProviderListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "peering.ServiceProvidersClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "peering.ServiceProvidersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.ServiceProvidersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ServiceProvidersClient) ListComplete(ctx context.Context) (result ServiceProviderListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceProvidersClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} diff --git a/services/preview/peering/mgmt/2019-09-01-preview/peering/services.go b/services/preview/peering/mgmt/2019-09-01-preview/peering/services.go new file mode 100644 index 000000000000..2fb32fda7dc3 --- /dev/null +++ b/services/preview/peering/mgmt/2019-09-01-preview/peering/services.go @@ -0,0 +1,585 @@ +package peering + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ServicesClient is the peering Client +type ServicesClient struct { + BaseClient +} + +// NewServicesClient creates an instance of the ServicesClient client. +func NewServicesClient(subscriptionID string) ServicesClient { + return NewServicesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewServicesClientWithBaseURI creates an instance of the ServicesClient client. +func NewServicesClientWithBaseURI(baseURI string, subscriptionID string) ServicesClient { + return ServicesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates a new peering service or updates an existing peering with the specified name under the given +// subscription and resource group. +// Parameters: +// resourceGroupName - the name of the resource group. +// peeringServiceName - the name of the peering service. +// peeringService - the properties needed to create or update a peering service. +func (client ServicesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, peeringServiceName string, peeringService Service) (result Service, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: peeringService, + Constraints: []validation.Constraint{{Target: "peeringService.Location", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("peering.ServicesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, peeringServiceName, peeringService) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.ServicesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "peering.ServicesClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.ServicesClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ServicesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, peeringServiceName string, peeringService Service) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "peeringServiceName": autorest.Encode("path", peeringServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-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/peeringServices/{peeringServiceName}", pathParameters), + autorest.WithJSON(peeringService), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + 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 ServicesClient) CreateOrUpdateResponder(resp *http.Response) (result Service, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes an existing peering service with the specified name under the given subscription and resource group. +// Parameters: +// resourceGroupName - the name of the resource group. +// peeringServiceName - the name of the peering service. +func (client ServicesClient) Delete(ctx context.Context, resourceGroupName string, peeringServiceName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, peeringServiceName) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.ServicesClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "peering.ServicesClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.ServicesClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ServicesClient) DeletePreparer(ctx context.Context, resourceGroupName string, peeringServiceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "peeringServiceName": autorest.Encode("path", peeringServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-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/peeringServices/{peeringServiceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) DeleteSender(req *http.Request) (*http.Response, error) { + 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 ServicesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets an existing peering service with the specified name under the given subscription and resource group. +// Parameters: +// resourceGroupName - the name of the resource group. +// peeringServiceName - the name of the peering. +func (client ServicesClient) Get(ctx context.Context, resourceGroupName string, peeringServiceName string) (result Service, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, peeringServiceName) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.ServicesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "peering.ServicesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.ServicesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ServicesClient) GetPreparer(ctx context.Context, resourceGroupName string, peeringServiceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "peeringServiceName": autorest.Encode("path", peeringServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-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/peeringServices/{peeringServiceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) GetSender(req *http.Request) (*http.Response, error) { + 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 Service, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup lists all of the peering services under the given subscription and resource group. +// Parameters: +// resourceGroupName - the name of the resource group. +func (client ServicesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ServiceListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.slr.Response.Response != nil { + sc = result.slr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.ServicesClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.slr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "peering.ServicesClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.slr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.ServicesClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client ServicesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-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/peeringServices", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + 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 ServiceListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client ServicesClient) listByResourceGroupNextResults(ctx context.Context, lastResults ServiceListResult) (result ServiceListResult, err error) { + req, err := lastResults.serviceListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "peering.ServicesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "peering.ServicesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.ServicesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client ServicesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ServiceListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// ListBySubscription lists all of the peerings under the given subscription. +func (client ServicesClient) ListBySubscription(ctx context.Context) (result ServiceListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.ListBySubscription") + defer func() { + sc := -1 + if result.slr.Response.Response != nil { + sc = result.slr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.ServicesClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.slr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "peering.ServicesClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.slr, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.ServicesClient", "ListBySubscription", resp, "Failure responding to request") + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client ServicesClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-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/peeringServices", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySubscriptionSender sends the ListBySubscription request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { + 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 ServicesClient) ListBySubscriptionResponder(resp *http.Response) (result ServiceListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySubscriptionNextResults retrieves the next set of results, if any. +func (client ServicesClient) listBySubscriptionNextResults(ctx context.Context, lastResults ServiceListResult) (result ServiceListResult, err error) { + req, err := lastResults.serviceListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "peering.ServicesClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "peering.ServicesClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.ServicesClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client ServicesClient) ListBySubscriptionComplete(ctx context.Context) (result ServiceListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.ListBySubscription") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListBySubscription(ctx) + return +} + +// Update updates tags for a peering service with the specified name under the given subscription and resource group. +// Parameters: +// resourceGroupName - the name of the resource group. +// peeringServiceName - the name of the peering service. +// tags - the resource tags. +func (client ServicesClient) Update(ctx context.Context, resourceGroupName string, peeringServiceName string, tags ResourceTags) (result Service, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, peeringServiceName, tags) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.ServicesClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "peering.ServicesClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.ServicesClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ServicesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, peeringServiceName string, tags ResourceTags) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "peeringServiceName": autorest.Encode("path", peeringServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-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/peeringServices/{peeringServiceName}", pathParameters), + autorest.WithJSON(tags), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) UpdateSender(req *http.Request) (*http.Response, error) { + 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 ServicesClient) UpdateResponder(resp *http.Response) (result Service, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/peering/mgmt/2019-09-01-preview/peering/version.go b/services/preview/peering/mgmt/2019-09-01-preview/peering/version.go new file mode 100644 index 000000000000..4a5c93f82049 --- /dev/null +++ b/services/preview/peering/mgmt/2019-09-01-preview/peering/version.go @@ -0,0 +1,30 @@ +package peering + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + version.Number + " peering/2019-09-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/postgresql/mgmt/2017-12-01-preview/postgresql/models.go b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/models.go index 08eefa57999d..853ba11d2c91 100644 --- a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/models.go +++ b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/models.go @@ -25,6 +25,7 @@ import ( "github.com/Azure/go-autorest/autorest/date" "github.com/Azure/go-autorest/autorest/to" "github.com/Azure/go-autorest/tracing" + "github.com/satori/go.uuid" "net/http" ) @@ -956,6 +957,156 @@ func (s *Server) UnmarshalJSON(body []byte) error { return nil } +// ServerAdministratorProperties the properties of an server Administrator. +type ServerAdministratorProperties struct { + // AdministratorType - The type of administrator. + AdministratorType *string `json:"administratorType,omitempty"` + // Login - The server administrator login value. + Login *string `json:"login,omitempty"` + // Sid - The server administrator Sid (Secure ID). + Sid *uuid.UUID `json:"sid,omitempty"` + // TenantID - The server Active Directory Administrator tenant id. + TenantID *uuid.UUID `json:"tenantId,omitempty"` +} + +// ServerAdministratorResource represents a and external administrator to be created. +type ServerAdministratorResource struct { + autorest.Response `json:"-"` + // ServerAdministratorProperties - Properties of the server AAD administrator. + *ServerAdministratorProperties `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 ServerAdministratorResource. +func (sar ServerAdministratorResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sar.ServerAdministratorProperties != nil { + objectMap["properties"] = sar.ServerAdministratorProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ServerAdministratorResource struct. +func (sar *ServerAdministratorResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var serverAdministratorProperties ServerAdministratorProperties + err = json.Unmarshal(*v, &serverAdministratorProperties) + if err != nil { + return err + } + sar.ServerAdministratorProperties = &serverAdministratorProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sar.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sar.Type = &typeVar + } + } + } + + return nil +} + +// ServerAdministratorResourceListResult the response to a list Active Directory Administrators request. +type ServerAdministratorResourceListResult struct { + autorest.Response `json:"-"` + // Value - The list of server Active Directory Administrators for the server. + Value *[]ServerAdministratorResource `json:"value,omitempty"` +} + +// ServerAdministratorsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ServerAdministratorsCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ServerAdministratorsCreateOrUpdateFuture) Result(client ServerAdministratorsClient) (sar ServerAdministratorResource, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServerAdministratorsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("postgresql.ServerAdministratorsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sar.Response.Response, err = future.GetResult(sender); err == nil && sar.Response.Response.StatusCode != http.StatusNoContent { + sar, err = client.CreateOrUpdateResponder(sar.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServerAdministratorsCreateOrUpdateFuture", "Result", sar.Response.Response, "Failure responding to request") + } + } + return +} + +// ServerAdministratorsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ServerAdministratorsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ServerAdministratorsDeleteFuture) Result(client ServerAdministratorsClient) (sar ServerAdministratorResource, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServerAdministratorsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("postgresql.ServerAdministratorsDeleteFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sar.Response.Response, err = future.GetResult(sender); err == nil && sar.Response.Response.StatusCode != http.StatusNoContent { + sar, err = client.DeleteResponder(sar.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServerAdministratorsDeleteFuture", "Result", sar.Response.Response, "Failure responding to request") + } + } + return +} + // ServerForCreate represents a server to be created. type ServerForCreate struct { // Sku - The SKU (pricing tier) of the server. diff --git a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/postgresqlapi/interfaces.go b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/postgresqlapi/interfaces.go index 6d4dc73b9886..07a979d114e8 100644 --- a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/postgresqlapi/interfaces.go +++ b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/postgresqlapi/interfaces.go @@ -88,6 +88,16 @@ type LogFilesClientAPI interface { var _ LogFilesClientAPI = (*postgresql.LogFilesClient)(nil) +// ServerAdministratorsClientAPI contains the set of methods on the ServerAdministratorsClient type. +type ServerAdministratorsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, properties postgresql.ServerAdministratorResource) (result postgresql.ServerAdministratorsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, serverName string) (result postgresql.ServerAdministratorsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, serverName string) (result postgresql.ServerAdministratorResource, err error) + ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result postgresql.ServerAdministratorResourceListResult, err error) +} + +var _ ServerAdministratorsClientAPI = (*postgresql.ServerAdministratorsClient)(nil) + // LocationBasedPerformanceTierClientAPI contains the set of methods on the LocationBasedPerformanceTierClient type. type LocationBasedPerformanceTierClientAPI interface { List(ctx context.Context, locationName string) (result postgresql.PerformanceTierListResult, err error) diff --git a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/serveradministrators.go b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/serveradministrators.go new file mode 100644 index 000000000000..21a99463ac44 --- /dev/null +++ b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/serveradministrators.go @@ -0,0 +1,371 @@ +package postgresql + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the 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" +) + +// ServerAdministratorsClient is the the Microsoft Azure management API provides create, read, update, and delete +// functionality for Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, security +// alert policies, log files and configurations with new business model. +type ServerAdministratorsClient struct { + BaseClient +} + +// NewServerAdministratorsClient creates an instance of the ServerAdministratorsClient client. +func NewServerAdministratorsClient(subscriptionID string) ServerAdministratorsClient { + return NewServerAdministratorsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewServerAdministratorsClientWithBaseURI creates an instance of the ServerAdministratorsClient client. +func NewServerAdministratorsClientWithBaseURI(baseURI string, subscriptionID string) ServerAdministratorsClient { + return ServerAdministratorsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or update active directory administrator on an existing server. The update action will +// overwrite the existing administrator. +// 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. +// properties - the required parameters for creating or updating an AAD server administrator. +func (client ServerAdministratorsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, properties ServerAdministratorResource) (result ServerAdministratorsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServerAdministratorsClient.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: properties, + Constraints: []validation.Constraint{{Target: "properties.ServerAdministratorProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "properties.ServerAdministratorProperties.AdministratorType", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "properties.ServerAdministratorProperties.Login", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "properties.ServerAdministratorProperties.Sid", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "properties.ServerAdministratorProperties.TenantID", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("postgresql.ServerAdministratorsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, properties) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServerAdministratorsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServerAdministratorsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ServerAdministratorsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, properties ServerAdministratorResource) (*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-12-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/Administrators/activeDirectory", pathParameters), + autorest.WithJSON(properties), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ServerAdministratorsClient) CreateOrUpdateSender(req *http.Request) (future ServerAdministratorsCreateOrUpdateFuture, 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 ServerAdministratorsClient) CreateOrUpdateResponder(resp *http.Response) (result ServerAdministratorResource, 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 AAD Administrator. +// 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 ServerAdministratorsClient) Delete(ctx context.Context, resourceGroupName string, serverName string) (result ServerAdministratorsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServerAdministratorsClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, serverName) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServerAdministratorsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServerAdministratorsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ServerAdministratorsClient) DeletePreparer(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-12-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/Administrators/activeDirectory", 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 ServerAdministratorsClient) DeleteSender(req *http.Request) (future ServerAdministratorsDeleteFuture, 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 ServerAdministratorsClient) DeleteResponder(resp *http.Response) (result ServerAdministratorResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets information about a AAD server administrator. +// 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 ServerAdministratorsClient) Get(ctx context.Context, resourceGroupName string, serverName string) (result ServerAdministratorResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServerAdministratorsClient.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, serverName) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServerAdministratorsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "postgresql.ServerAdministratorsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServerAdministratorsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ServerAdministratorsClient) GetPreparer(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-12-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/Administrators/activeDirectory", 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 ServerAdministratorsClient) 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 ServerAdministratorsClient) GetResponder(resp *http.Response) (result ServerAdministratorResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByServer returns a list of server Administrators. +// 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 ServerAdministratorsClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result ServerAdministratorResourceListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServerAdministratorsClient.ListByServer") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServerAdministratorsClient", "ListByServer", nil, "Failure preparing request") + return + } + + resp, err := client.ListByServerSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "postgresql.ServerAdministratorsClient", "ListByServer", resp, "Failure sending request") + return + } + + result, err = client.ListByServerResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServerAdministratorsClient", "ListByServer", resp, "Failure responding to request") + } + + return +} + +// ListByServerPreparer prepares the ListByServer request. +func (client ServerAdministratorsClient) 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-12-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/administrators", 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 ServerAdministratorsClient) 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 ServerAdministratorsClient) ListByServerResponder(resp *http.Response) (result ServerAdministratorResourceListResult, 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/reservations/mgmt/2019-04-01/reservations/models.go b/services/preview/reservations/mgmt/2019-04-01/reservations/models.go index 6e01aed5501e..b457c00410a3 100644 --- a/services/preview/reservations/mgmt/2019-04-01/reservations/models.go +++ b/services/preview/reservations/mgmt/2019-04-01/reservations/models.go @@ -415,7 +415,7 @@ type Catalog struct { // 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"` + BillingPlans map[string][]ReservationBillingPlan `json:"billingPlans"` // Terms - READ-ONLY; Available reservation terms for this resource Terms *[]ReservationTerm `json:"terms,omitempty"` // Locations - READ-ONLY @@ -426,62 +426,15 @@ 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) { +// MarshalJSON is the custom marshaler for Catalog. +func (c Catalog) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if cPi.Name != "" { - objectMap["name"] = cPi.Name - } - for k, v := range cPi.AdditionalProperties { - objectMap[k] = v + if c.BillingPlans != nil { + objectMap["billingPlans"] = c.BillingPlans } 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"` diff --git a/services/preview/security/mgmt/v3.0/security/iotsecuritysolutions.go b/services/preview/security/mgmt/v3.0/security/iotsecuritysolutions.go deleted file mode 100644 index 03b256dad4c7..000000000000 --- a/services/preview/security/mgmt/v3.0/security/iotsecuritysolutions.go +++ /dev/null @@ -1,163 +0,0 @@ -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" -) - -// IoTSecuritySolutionsClient is the API spec for Microsoft.Security (Azure Security Center) resource provider -type IoTSecuritySolutionsClient struct { - BaseClient -} - -// NewIoTSecuritySolutionsClient creates an instance of the IoTSecuritySolutionsClient client. -func NewIoTSecuritySolutionsClient(subscriptionID string, ascLocation string) IoTSecuritySolutionsClient { - return NewIoTSecuritySolutionsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) -} - -// NewIoTSecuritySolutionsClientWithBaseURI creates an instance of the IoTSecuritySolutionsClient client. -func NewIoTSecuritySolutionsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IoTSecuritySolutionsClient { - return IoTSecuritySolutionsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} -} - -// List list of security solutions -// Parameters: -// filter - filter the Security Solution with OData syntax. supporting filter by iotHubs -func (client IoTSecuritySolutionsClient) List(ctx context.Context, filter string) (result IoTSecuritySolutionsListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IoTSecuritySolutionsClient.List") - 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.IoTSecuritySolutionsClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.itssl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsClient", "List", resp, "Failure sending request") - return - } - - result.itssl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client IoTSecuritySolutionsClient) ListPreparer(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)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client IoTSecuritySolutionsClient) 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 IoTSecuritySolutionsClient) ListResponder(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 -} - -// listNextResults retrieves the next set of results, if any. -func (client IoTSecuritySolutionsClient) listNextResults(ctx context.Context, lastResults IoTSecuritySolutionsList) (result IoTSecuritySolutionsList, err error) { - req, err := lastResults.ioTSecuritySolutionsListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsClient", "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.IoTSecuritySolutionsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client IoTSecuritySolutionsClient) ListComplete(ctx context.Context, filter string) (result IoTSecuritySolutionsListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IoTSecuritySolutionsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, filter) - return -} diff --git a/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalytics.go b/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalytics.go deleted file mode 100644 index 22ce11631743..000000000000 --- a/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalytics.go +++ /dev/null @@ -1,219 +0,0 @@ -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" -) - -// IoTSecuritySolutionsAnalyticsClient is the API spec for Microsoft.Security (Azure Security Center) resource provider -type IoTSecuritySolutionsAnalyticsClient struct { - BaseClient -} - -// NewIoTSecuritySolutionsAnalyticsClient creates an instance of the IoTSecuritySolutionsAnalyticsClient client. -func NewIoTSecuritySolutionsAnalyticsClient(subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsClient { - return NewIoTSecuritySolutionsAnalyticsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) -} - -// NewIoTSecuritySolutionsAnalyticsClientWithBaseURI creates an instance of the IoTSecuritySolutionsAnalyticsClient -// client. -func NewIoTSecuritySolutionsAnalyticsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsClient { - return IoTSecuritySolutionsAnalyticsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} -} - -// GetAll security Analytics of a 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 -func (client IoTSecuritySolutionsAnalyticsClient) GetAll(ctx context.Context, resourceGroupName string, solutionName string) (result IoTSecuritySolutionAnalyticsModelList, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IoTSecuritySolutionsAnalyticsClient.GetAll") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.IoTSecuritySolutionsAnalyticsClient", "GetAll", err.Error()) - } - - req, err := client.GetAllPreparer(ctx, resourceGroupName, solutionName) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsClient", "GetAll", nil, "Failure preparing request") - return - } - - resp, err := client.GetAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsClient", "GetAll", resp, "Failure sending request") - return - } - - result, err = client.GetAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsClient", "GetAll", resp, "Failure responding to request") - } - - return -} - -// GetAllPreparer prepares the GetAll request. -func (client IoTSecuritySolutionsAnalyticsClient) GetAllPreparer(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)) -} - -// GetAllSender sends the GetAll request. The method will close the -// http.Response Body if it receives an error. -func (client IoTSecuritySolutionsAnalyticsClient) GetAllSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// GetAllResponder handles the response to the GetAll request. The method always -// closes the http.Response Body. -func (client IoTSecuritySolutionsAnalyticsClient) GetAllResponder(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 -} - -// GetDefault security Analytics of a 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 -func (client IoTSecuritySolutionsAnalyticsClient) GetDefault(ctx context.Context, resourceGroupName string, solutionName string) (result IoTSecuritySolutionAnalyticsModel, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IoTSecuritySolutionsAnalyticsClient.GetDefault") - defer func() { - 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.IoTSecuritySolutionsAnalyticsClient", "GetDefault", err.Error()) - } - - req, err := client.GetDefaultPreparer(ctx, resourceGroupName, solutionName) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsClient", "GetDefault", nil, "Failure preparing request") - return - } - - resp, err := client.GetDefaultSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsClient", "GetDefault", resp, "Failure sending request") - return - } - - result, err = client.GetDefaultResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsClient", "GetDefault", resp, "Failure responding to request") - } - - return -} - -// GetDefaultPreparer prepares the GetDefault request. -func (client IoTSecuritySolutionsAnalyticsClient) GetDefaultPreparer(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)) -} - -// GetDefaultSender sends the GetDefault request. The method will close the -// http.Response Body if it receives an error. -func (client IoTSecuritySolutionsAnalyticsClient) GetDefaultSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// GetDefaultResponder handles the response to the GetDefault request. The method always -// closes the http.Response Body. -func (client IoTSecuritySolutionsAnalyticsClient) GetDefaultResponder(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 -} diff --git a/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalyticsaggregatedalerts.go b/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalyticsaggregatedalerts.go deleted file mode 100644 index 1cc08c1c364a..000000000000 --- a/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalyticsaggregatedalerts.go +++ /dev/null @@ -1,175 +0,0 @@ -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" -) - -// IoTSecuritySolutionsAnalyticsAggregatedAlertsClient is the API spec for Microsoft.Security (Azure Security Center) -// resource provider -type IoTSecuritySolutionsAnalyticsAggregatedAlertsClient struct { - BaseClient -} - -// NewIoTSecuritySolutionsAnalyticsAggregatedAlertsClient creates an instance of the -// IoTSecuritySolutionsAnalyticsAggregatedAlertsClient client. -func NewIoTSecuritySolutionsAnalyticsAggregatedAlertsClient(subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsAggregatedAlertsClient { - return NewIoTSecuritySolutionsAnalyticsAggregatedAlertsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) -} - -// NewIoTSecuritySolutionsAnalyticsAggregatedAlertsClientWithBaseURI creates an instance of the -// IoTSecuritySolutionsAnalyticsAggregatedAlertsClient client. -func NewIoTSecuritySolutionsAnalyticsAggregatedAlertsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsAggregatedAlertsClient { - return IoTSecuritySolutionsAnalyticsAggregatedAlertsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} -} - -// List security Analytics of a 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 -// top - the number of results to retrieve. -func (client IoTSecuritySolutionsAnalyticsAggregatedAlertsClient) List(ctx context.Context, resourceGroupName string, solutionName string, top *int32) (result IoTSecurityAggregatedAlertListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IoTSecuritySolutionsAnalyticsAggregatedAlertsClient.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.IoTSecuritySolutionsAnalyticsAggregatedAlertsClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, solutionName, top) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsAggregatedAlertsClient", "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.IoTSecuritySolutionsAnalyticsAggregatedAlertsClient", "List", resp, "Failure sending request") - return - } - - result.itsaal, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsAggregatedAlertsClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client IoTSecuritySolutionsAnalyticsAggregatedAlertsClient) 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 IoTSecuritySolutionsAnalyticsAggregatedAlertsClient) 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 IoTSecuritySolutionsAnalyticsAggregatedAlertsClient) 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 IoTSecuritySolutionsAnalyticsAggregatedAlertsClient) listNextResults(ctx context.Context, lastResults IoTSecurityAggregatedAlertList) (result IoTSecurityAggregatedAlertList, err error) { - req, err := lastResults.ioTSecurityAggregatedAlertListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsAggregatedAlertsClient", "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.IoTSecuritySolutionsAnalyticsAggregatedAlertsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsAggregatedAlertsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client IoTSecuritySolutionsAnalyticsAggregatedAlertsClient) ListComplete(ctx context.Context, resourceGroupName string, solutionName string, top *int32) (result IoTSecurityAggregatedAlertListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IoTSecuritySolutionsAnalyticsAggregatedAlertsClient.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/iotsecuritysolutionsanalyticsrecommendations.go b/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalyticsrecommendations.go deleted file mode 100644 index 0a4201655260..000000000000 --- a/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalyticsrecommendations.go +++ /dev/null @@ -1,175 +0,0 @@ -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" -) - -// IoTSecuritySolutionsAnalyticsRecommendationsClient is the API spec for Microsoft.Security (Azure Security Center) -// resource provider -type IoTSecuritySolutionsAnalyticsRecommendationsClient struct { - BaseClient -} - -// NewIoTSecuritySolutionsAnalyticsRecommendationsClient creates an instance of the -// IoTSecuritySolutionsAnalyticsRecommendationsClient client. -func NewIoTSecuritySolutionsAnalyticsRecommendationsClient(subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsRecommendationsClient { - return NewIoTSecuritySolutionsAnalyticsRecommendationsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) -} - -// NewIoTSecuritySolutionsAnalyticsRecommendationsClientWithBaseURI creates an instance of the -// IoTSecuritySolutionsAnalyticsRecommendationsClient client. -func NewIoTSecuritySolutionsAnalyticsRecommendationsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsRecommendationsClient { - return IoTSecuritySolutionsAnalyticsRecommendationsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} -} - -// List security Analytics of a 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 -// top - the number of results to retrieve. -func (client IoTSecuritySolutionsAnalyticsRecommendationsClient) List(ctx context.Context, resourceGroupName string, solutionName string, top *int32) (result IoTSecurityAggregatedRecommendationListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IoTSecuritySolutionsAnalyticsRecommendationsClient.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.IoTSecuritySolutionsAnalyticsRecommendationsClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, solutionName, top) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsRecommendationsClient", "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.IoTSecuritySolutionsAnalyticsRecommendationsClient", "List", resp, "Failure sending request") - return - } - - result.itsarl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsRecommendationsClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client IoTSecuritySolutionsAnalyticsRecommendationsClient) 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 IoTSecuritySolutionsAnalyticsRecommendationsClient) 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 IoTSecuritySolutionsAnalyticsRecommendationsClient) 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 IoTSecuritySolutionsAnalyticsRecommendationsClient) listNextResults(ctx context.Context, lastResults IoTSecurityAggregatedRecommendationList) (result IoTSecurityAggregatedRecommendationList, err error) { - req, err := lastResults.ioTSecurityAggregatedRecommendationListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsRecommendationsClient", "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.IoTSecuritySolutionsAnalyticsRecommendationsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsRecommendationsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client IoTSecuritySolutionsAnalyticsRecommendationsClient) ListComplete(ctx context.Context, resourceGroupName string, solutionName string, top *int32) (result IoTSecurityAggregatedRecommendationListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IoTSecuritySolutionsAnalyticsRecommendationsClient.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/iotsecuritysolutionsresourcegroup.go b/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsresourcegroup.go deleted file mode 100644 index a2214a0bdf94..000000000000 --- a/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsresourcegroup.go +++ /dev/null @@ -1,173 +0,0 @@ -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" -) - -// IoTSecuritySolutionsResourceGroupClient is the API spec for Microsoft.Security (Azure Security Center) resource -// provider -type IoTSecuritySolutionsResourceGroupClient struct { - BaseClient -} - -// NewIoTSecuritySolutionsResourceGroupClient creates an instance of the IoTSecuritySolutionsResourceGroupClient -// client. -func NewIoTSecuritySolutionsResourceGroupClient(subscriptionID string, ascLocation string) IoTSecuritySolutionsResourceGroupClient { - return NewIoTSecuritySolutionsResourceGroupClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) -} - -// NewIoTSecuritySolutionsResourceGroupClientWithBaseURI creates an instance of the -// IoTSecuritySolutionsResourceGroupClient client. -func NewIoTSecuritySolutionsResourceGroupClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IoTSecuritySolutionsResourceGroupClient { - return IoTSecuritySolutionsResourceGroupClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} -} - -// List list of security solutions -// Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// filter - filter the Security Solution with OData syntax. supporting filter by iotHubs -func (client IoTSecuritySolutionsResourceGroupClient) List(ctx context.Context, resourceGroupName string, filter string) (result IoTSecuritySolutionsListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IoTSecuritySolutionsResourceGroupClient.List") - 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.IoTSecuritySolutionsResourceGroupClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsResourceGroupClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.itssl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsResourceGroupClient", "List", resp, "Failure sending request") - return - } - - result.itssl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsResourceGroupClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client IoTSecuritySolutionsResourceGroupClient) ListPreparer(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)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client IoTSecuritySolutionsResourceGroupClient) 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 IoTSecuritySolutionsResourceGroupClient) ListResponder(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 -} - -// listNextResults retrieves the next set of results, if any. -func (client IoTSecuritySolutionsResourceGroupClient) listNextResults(ctx context.Context, lastResults IoTSecuritySolutionsList) (result IoTSecuritySolutionsList, err error) { - req, err := lastResults.ioTSecuritySolutionsListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsResourceGroupClient", "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.IoTSecuritySolutionsResourceGroupClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsResourceGroupClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client IoTSecuritySolutionsResourceGroupClient) ListComplete(ctx context.Context, resourceGroupName string, filter string) (result IoTSecuritySolutionsListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IoTSecuritySolutionsResourceGroupClient.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, filter) - return -} diff --git a/services/preview/security/mgmt/v3.0/security/models.go b/services/preview/security/mgmt/v3.0/security/models.go index 1f0482eb5644..656cd2a88cbe 100644 --- a/services/preview/security/mgmt/v3.0/security/models.go +++ b/services/preview/security/mgmt/v3.0/security/models.go @@ -4936,6 +4936,18 @@ type IoTSecurityAggregatedAlertProperties struct { ActionTaken *string `json:"actionTaken,omitempty"` // LogAnalyticsQuery - READ-ONLY; Log analytics query for getting the list of affected devices/alerts. LogAnalyticsQuery *string `json:"logAnalyticsQuery,omitempty"` + // TopDevicesList - READ-ONLY; 10 devices with the highest number of occurrences of this alert type, on this day. + TopDevicesList *[]IoTSecurityAggregatedAlertPropertiesTopDevicesListItem `json:"topDevicesList,omitempty"` +} + +// IoTSecurityAggregatedAlertPropertiesTopDevicesListItem ... +type IoTSecurityAggregatedAlertPropertiesTopDevicesListItem struct { + // DeviceID - READ-ONLY; Name of the device. + DeviceID *string `json:"deviceId,omitempty"` + // AlertsCount - READ-ONLY; Number of alerts raised for this device. + AlertsCount *int32 `json:"alertsCount,omitempty"` + // LastOccurrence - READ-ONLY; Most recent time this alert was raised for this device, on this day. + LastOccurrence *string `json:"lastOccurrence,omitempty"` } // IoTSecurityAggregatedRecommendation ioT Security solution recommendation information. diff --git a/services/preview/sql/mgmt/2018-06-15-preview/sql/backupshorttermretentionpolicies.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/backupshorttermretentionpolicies.go deleted file mode 100644 index 1ac1fa8642cd..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/backupshorttermretentionpolicies.go +++ /dev/null @@ -1,411 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// BackupShortTermRetentionPoliciesClient is the the Azure SQL Database management API provides a RESTful set of web -// services that interact with Azure SQL Database services to manage your databases. The API enables you to create, -// retrieve, update, and delete databases. -type BackupShortTermRetentionPoliciesClient struct { - BaseClient -} - -// NewBackupShortTermRetentionPoliciesClient creates an instance of the BackupShortTermRetentionPoliciesClient client. -func NewBackupShortTermRetentionPoliciesClient(subscriptionID string) BackupShortTermRetentionPoliciesClient { - return NewBackupShortTermRetentionPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewBackupShortTermRetentionPoliciesClientWithBaseURI creates an instance of the -// BackupShortTermRetentionPoliciesClient client. -func NewBackupShortTermRetentionPoliciesClientWithBaseURI(baseURI string, subscriptionID string) BackupShortTermRetentionPoliciesClient { - return BackupShortTermRetentionPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate updates a database's short term retention policy. -// 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. -// parameters - the short term retention policy info. -func (client BackupShortTermRetentionPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters BackupShortTermRetentionPolicy) (result BackupShortTermRetentionPoliciesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BackupShortTermRetentionPoliciesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, databaseName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.BackupShortTermRetentionPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.BackupShortTermRetentionPoliciesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client BackupShortTermRetentionPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters BackupShortTermRetentionPolicy) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "policyName": autorest.Encode("path", "default"), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-10-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.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client BackupShortTermRetentionPoliciesClient) CreateOrUpdateSender(req *http.Request) (future BackupShortTermRetentionPoliciesCreateOrUpdateFuture, 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 BackupShortTermRetentionPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result BackupShortTermRetentionPolicy, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get gets a database's short term retention policy. -// 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 BackupShortTermRetentionPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result BackupShortTermRetentionPolicy, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BackupShortTermRetentionPoliciesClient.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, serverName, databaseName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.BackupShortTermRetentionPoliciesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.BackupShortTermRetentionPoliciesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.BackupShortTermRetentionPoliciesClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client BackupShortTermRetentionPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "policyName": autorest.Encode("path", "default"), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-10-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}/backupShortTermRetentionPolicies/{policyName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client BackupShortTermRetentionPoliciesClient) 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 BackupShortTermRetentionPoliciesClient) GetResponder(resp *http.Response) (result BackupShortTermRetentionPolicy, 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 gets a database's short term retention policy. -// 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 BackupShortTermRetentionPoliciesClient) ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result BackupShortTermRetentionPolicyListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BackupShortTermRetentionPoliciesClient.ListByDatabase") - defer func() { - sc := -1 - if result.bstrplr.Response.Response != nil { - sc = result.bstrplr.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.BackupShortTermRetentionPoliciesClient", "ListByDatabase", nil, "Failure preparing request") - return - } - - resp, err := client.ListByDatabaseSender(req) - if err != nil { - result.bstrplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.BackupShortTermRetentionPoliciesClient", "ListByDatabase", resp, "Failure sending request") - return - } - - result.bstrplr, err = client.ListByDatabaseResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.BackupShortTermRetentionPoliciesClient", "ListByDatabase", resp, "Failure responding to request") - } - - return -} - -// ListByDatabasePreparer prepares the ListByDatabase request. -func (client BackupShortTermRetentionPoliciesClient) 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-10-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}/backupShortTermRetentionPolicies", 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 BackupShortTermRetentionPoliciesClient) 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 BackupShortTermRetentionPoliciesClient) ListByDatabaseResponder(resp *http.Response) (result BackupShortTermRetentionPolicyListResult, 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 BackupShortTermRetentionPoliciesClient) listByDatabaseNextResults(ctx context.Context, lastResults BackupShortTermRetentionPolicyListResult) (result BackupShortTermRetentionPolicyListResult, err error) { - req, err := lastResults.backupShortTermRetentionPolicyListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.BackupShortTermRetentionPoliciesClient", "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.BackupShortTermRetentionPoliciesClient", "listByDatabaseNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByDatabaseResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.BackupShortTermRetentionPoliciesClient", "listByDatabaseNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByDatabaseComplete enumerates all values, automatically crossing page boundaries as required. -func (client BackupShortTermRetentionPoliciesClient) ListByDatabaseComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result BackupShortTermRetentionPolicyListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BackupShortTermRetentionPoliciesClient.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 -} - -// Update updates a database's short term retention policy. -// 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. -// parameters - the short term retention policy info. -func (client BackupShortTermRetentionPoliciesClient) Update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters BackupShortTermRetentionPolicy) (result BackupShortTermRetentionPoliciesUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BackupShortTermRetentionPoliciesClient.Update") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, serverName, databaseName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.BackupShortTermRetentionPoliciesClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.BackupShortTermRetentionPoliciesClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client BackupShortTermRetentionPoliciesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters BackupShortTermRetentionPolicy) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "policyName": autorest.Encode("path", "default"), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-10-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.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}", 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 BackupShortTermRetentionPoliciesClient) UpdateSender(req *http.Request) (future BackupShortTermRetentionPoliciesUpdateFuture, 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 BackupShortTermRetentionPoliciesClient) UpdateResponder(resp *http.Response) (result BackupShortTermRetentionPolicy, 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/sql/mgmt/2018-06-15-preview/sql/databaseautomatictuning.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/databaseautomatictuning.go deleted file mode 100644 index 2b7edb2d0e14..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/databaseautomatictuning.go +++ /dev/null @@ -1,206 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// DatabaseAutomaticTuningClient is the the Azure SQL Database management API provides a RESTful set of web services -// that interact with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, -// update, and delete databases. -type DatabaseAutomaticTuningClient struct { - BaseClient -} - -// NewDatabaseAutomaticTuningClient creates an instance of the DatabaseAutomaticTuningClient client. -func NewDatabaseAutomaticTuningClient(subscriptionID string) DatabaseAutomaticTuningClient { - return NewDatabaseAutomaticTuningClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDatabaseAutomaticTuningClientWithBaseURI creates an instance of the DatabaseAutomaticTuningClient client. -func NewDatabaseAutomaticTuningClientWithBaseURI(baseURI string, subscriptionID string) DatabaseAutomaticTuningClient { - return DatabaseAutomaticTuningClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets a database's automatic tuning. -// 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 DatabaseAutomaticTuningClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result DatabaseAutomaticTuning, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAutomaticTuningClient.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, serverName, databaseName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabaseAutomaticTuningClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.DatabaseAutomaticTuningClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabaseAutomaticTuningClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client DatabaseAutomaticTuningClient) GetPreparer(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}/automaticTuning/current", 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 DatabaseAutomaticTuningClient) 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 DatabaseAutomaticTuningClient) GetResponder(resp *http.Response) (result DatabaseAutomaticTuning, 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 automatic tuning properties for target 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. -// parameters - the requested automatic tuning resource state. -func (client DatabaseAutomaticTuningClient) Update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters DatabaseAutomaticTuning) (result DatabaseAutomaticTuning, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAutomaticTuningClient.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, serverName, databaseName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabaseAutomaticTuningClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.DatabaseAutomaticTuningClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabaseAutomaticTuningClient", "Update", resp, "Failure responding to request") - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client DatabaseAutomaticTuningClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters DatabaseAutomaticTuning) (*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.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/automaticTuning/current", 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 DatabaseAutomaticTuningClient) 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 DatabaseAutomaticTuningClient) UpdateResponder(resp *http.Response) (result DatabaseAutomaticTuning, 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/sql/mgmt/2018-06-15-preview/sql/databaseblobauditingpolicies.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/databaseblobauditingpolicies.go deleted file mode 100644 index 8e61953bbeae..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/databaseblobauditingpolicies.go +++ /dev/null @@ -1,328 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// DatabaseBlobAuditingPoliciesClient is the the Azure SQL Database management API provides a RESTful set of web -// services that interact with Azure SQL Database services to manage your databases. The API enables you to create, -// retrieve, update, and delete databases. -type DatabaseBlobAuditingPoliciesClient struct { - BaseClient -} - -// NewDatabaseBlobAuditingPoliciesClient creates an instance of the DatabaseBlobAuditingPoliciesClient client. -func NewDatabaseBlobAuditingPoliciesClient(subscriptionID string) DatabaseBlobAuditingPoliciesClient { - return NewDatabaseBlobAuditingPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDatabaseBlobAuditingPoliciesClientWithBaseURI creates an instance of the DatabaseBlobAuditingPoliciesClient -// client. -func NewDatabaseBlobAuditingPoliciesClientWithBaseURI(baseURI string, subscriptionID string) DatabaseBlobAuditingPoliciesClient { - return DatabaseBlobAuditingPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a database's blob auditing policy. -// 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. -// parameters - the database blob auditing policy. -func (client DatabaseBlobAuditingPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters DatabaseBlobAuditingPolicy) (result DatabaseBlobAuditingPolicy, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseBlobAuditingPoliciesClient.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, serverName, databaseName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabaseBlobAuditingPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.DatabaseBlobAuditingPoliciesClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabaseBlobAuditingPoliciesClient", "CreateOrUpdate", resp, "Failure responding to request") - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DatabaseBlobAuditingPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters DatabaseBlobAuditingPolicy) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "blobAuditingPolicyName": autorest.Encode("path", "default"), - "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, - } - - parameters.Kind = 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.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings/{blobAuditingPolicyName}", 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 DatabaseBlobAuditingPoliciesClient) 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 DatabaseBlobAuditingPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result DatabaseBlobAuditingPolicy, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get gets a database's blob auditing policy. -// 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) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result DatabaseBlobAuditingPolicy, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseBlobAuditingPoliciesClient.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, serverName, databaseName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabaseBlobAuditingPoliciesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.DatabaseBlobAuditingPoliciesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabaseBlobAuditingPoliciesClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client DatabaseBlobAuditingPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "blobAuditingPolicyName": autorest.Encode("path", "default"), - "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/{blobAuditingPolicyName}", 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 DatabaseBlobAuditingPoliciesClient) 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 DatabaseBlobAuditingPoliciesClient) GetResponder(resp *http.Response) (result DatabaseBlobAuditingPolicy, 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 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/2018-06-15-preview/sql/databaseoperations.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/databaseoperations.go deleted file mode 100644 index c7d3384f8718..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/databaseoperations.go +++ /dev/null @@ -1,243 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "github.com/satori/go.uuid" - "net/http" -) - -// DatabaseOperationsClient is the the Azure SQL Database management API provides a RESTful set of web services that -// interact with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, -// and delete databases. -type DatabaseOperationsClient struct { - BaseClient -} - -// NewDatabaseOperationsClient creates an instance of the DatabaseOperationsClient client. -func NewDatabaseOperationsClient(subscriptionID string) DatabaseOperationsClient { - return NewDatabaseOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDatabaseOperationsClientWithBaseURI creates an instance of the DatabaseOperationsClient client. -func NewDatabaseOperationsClientWithBaseURI(baseURI string, subscriptionID string) DatabaseOperationsClient { - return DatabaseOperationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Cancel cancels the asynchronous operation on the 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. -// operationID - the operation identifier. -func (client DatabaseOperationsClient) Cancel(ctx context.Context, resourceGroupName string, serverName string, databaseName string, operationID uuid.UUID) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseOperationsClient.Cancel") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CancelPreparer(ctx, resourceGroupName, serverName, databaseName, operationID) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabaseOperationsClient", "Cancel", nil, "Failure preparing request") - return - } - - resp, err := client.CancelSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "sql.DatabaseOperationsClient", "Cancel", resp, "Failure sending request") - return - } - - result, err = client.CancelResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabaseOperationsClient", "Cancel", resp, "Failure responding to request") - } - - return -} - -// CancelPreparer prepares the Cancel request. -func (client DatabaseOperationsClient) CancelPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, operationID uuid.UUID) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "operationId": autorest.Encode("path", operationID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-10-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.Sql/servers/{serverName}/databases/{databaseName}/operations/{operationId}/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 DatabaseOperationsClient) 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 DatabaseOperationsClient) 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 -} - -// ListByDatabase gets a list of operations performed on the 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 DatabaseOperationsClient) ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result DatabaseOperationListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseOperationsClient.ListByDatabase") - defer func() { - sc := -1 - if result.dolr.Response.Response != nil { - sc = result.dolr.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.DatabaseOperationsClient", "ListByDatabase", nil, "Failure preparing request") - return - } - - resp, err := client.ListByDatabaseSender(req) - if err != nil { - result.dolr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.DatabaseOperationsClient", "ListByDatabase", resp, "Failure sending request") - return - } - - result.dolr, err = client.ListByDatabaseResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabaseOperationsClient", "ListByDatabase", resp, "Failure responding to request") - } - - return -} - -// ListByDatabasePreparer prepares the ListByDatabase request. -func (client DatabaseOperationsClient) 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-10-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}/operations", 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 DatabaseOperationsClient) 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 DatabaseOperationsClient) ListByDatabaseResponder(resp *http.Response) (result DatabaseOperationListResult, 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 DatabaseOperationsClient) listByDatabaseNextResults(ctx context.Context, lastResults DatabaseOperationListResult) (result DatabaseOperationListResult, err error) { - req, err := lastResults.databaseOperationListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.DatabaseOperationsClient", "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.DatabaseOperationsClient", "listByDatabaseNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByDatabaseResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabaseOperationsClient", "listByDatabaseNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByDatabaseComplete enumerates all values, automatically crossing page boundaries as required. -func (client DatabaseOperationsClient) ListByDatabaseComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result DatabaseOperationListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseOperationsClient.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/2018-06-15-preview/sql/databases.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/databases.go deleted file mode 100644 index 3659eaa15829..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/databases.go +++ /dev/null @@ -1,1456 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the 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 SQL Database management API provides a RESTful set of web services that interact -// with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, and -// delete 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)} -} - -// CreateImportOperation creates an import operation that imports a bacpac into an existing database. The existing -// database must be empty. -// 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 to import into -// parameters - the required parameters for importing a Bacpac into a database. -func (client DatabasesClient) CreateImportOperation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters ImportExtensionRequest) (result DatabasesCreateImportOperationFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabasesClient.CreateImportOperation") - 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.ImportExtensionProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ImportExtensionProperties.OperationMode", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("sql.DatabasesClient", "CreateImportOperation", err.Error()) - } - - req, err := client.CreateImportOperationPreparer(ctx, resourceGroupName, serverName, databaseName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "CreateImportOperation", nil, "Failure preparing request") - return - } - - result, err = client.CreateImportOperationSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "CreateImportOperation", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateImportOperationPreparer prepares the CreateImportOperation request. -func (client DatabasesClient) CreateImportOperationPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters ImportExtensionRequest) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "extensionName": autorest.Encode("path", "import"), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-04-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateImportOperationSender sends the CreateImportOperation request. The method will close the -// http.Response Body if it receives an error. -func (client DatabasesClient) CreateImportOperationSender(req *http.Request) (future DatabasesCreateImportOperationFuture, 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 -} - -// CreateImportOperationResponder handles the response to the CreateImportOperation request. The method always -// closes the http.Response Body. -func (client DatabasesClient) CreateImportOperationResponder(resp *http.Response) (result ImportExportResponse, 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 -} - -// CreateOrUpdate creates a new database or updates an existing 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. -// parameters - the requested database resource state. -func (client DatabasesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters Database) (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) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.Sku", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Sku.Name", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "parameters.DatabaseProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.DatabaseProperties.CurrentSku", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.DatabaseProperties.CurrentSku.Name", Name: validation.Null, Rule: true, Chain: nil}}}, - }}}}}); err != nil { - return result, validation.NewError("sql.DatabasesClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, databaseName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DatabasesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters Database) (*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-10-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Kind = nil - parameters.ManagedBy = 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.Sql/servers/{serverName}/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 Database, 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. -// 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 DatabasesClient) Delete(ctx context.Context, resourceGroupName string, serverName 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, serverName, databaseName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client DatabasesClient) DeletePreparer(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-10-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.Sql/servers/{serverName}/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 -} - -// Export exports a database to a bacpac. -// 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 to be exported. -// parameters - the required parameters for exporting a database. -func (client DatabasesClient) Export(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters ExportRequest) (result DatabasesExportFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabasesClient.Export") - 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.StorageKey", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.StorageURI", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.AdministratorLogin", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.AdministratorLoginPassword", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("sql.DatabasesClient", "Export", err.Error()) - } - - req, err := client.ExportPreparer(ctx, resourceGroupName, serverName, databaseName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "Export", nil, "Failure preparing request") - return - } - - result, err = client.ExportSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "Export", result.Response(), "Failure sending request") - return - } - - return -} - -// ExportPreparer prepares the Export request. -func (client DatabasesClient) ExportPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters ExportRequest) (*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 = "2014-04-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/export", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - 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 DatabasesClient) ExportSender(req *http.Request) (future DatabasesExportFuture, 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 -} - -// ExportResponder handles the response to the Export request. The method always -// closes the http.Response Body. -func (client DatabasesClient) ExportResponder(resp *http.Response) (result ImportExportResponse, 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 -} - -// Failover failovers 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 to failover. -func (client DatabasesClient) Failover(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result DatabasesFailoverFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabasesClient.Failover") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.FailoverPreparer(ctx, resourceGroupName, serverName, databaseName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "Failover", nil, "Failure preparing request") - return - } - - result, err = client.FailoverSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "Failover", result.Response(), "Failure sending request") - return - } - - return -} - -// FailoverPreparer prepares the Failover request. -func (client DatabasesClient) FailoverPreparer(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 = "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.Sql/servers/{serverName}/databases/{databaseName}/failover", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// FailoverSender sends the Failover request. The method will close the -// http.Response Body if it receives an error. -func (client DatabasesClient) FailoverSender(req *http.Request) (future DatabasesFailoverFuture, 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 -} - -// FailoverResponder handles the response to the Failover request. The method always -// closes the http.Response Body. -func (client DatabasesClient) FailoverResponder(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 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 DatabasesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result Database, 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, serverName, databaseName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.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, "sql.DatabasesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client DatabasesClient) GetPreparer(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-10-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}", 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 Database, 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 bacpac into a new 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. -// parameters - the required parameters for importing a Bacpac into a database. -func (client DatabasesClient) Import(ctx context.Context, resourceGroupName string, serverName string, parameters ImportRequest) (result DatabasesImportFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabasesClient.Import") - 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.DatabaseName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.MaxSizeBytes", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("sql.DatabasesClient", "Import", err.Error()) - } - - req, err := client.ImportPreparer(ctx, resourceGroupName, serverName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "Import", nil, "Failure preparing request") - return - } - - result, err = client.ImportSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "Import", result.Response(), "Failure sending request") - return - } - - return -} - -// ImportPreparer prepares the Import request. -func (client DatabasesClient) ImportPreparer(ctx context.Context, resourceGroupName string, serverName string, parameters ImportRequest) (*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 = "2014-04-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/import", pathParameters), - autorest.WithJSON(parameters), - 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 DatabasesClient) ImportSender(req *http.Request) (future DatabasesImportFuture, 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 -} - -// ImportResponder handles the response to the Import request. The method always -// closes the http.Response Body. -func (client DatabasesClient) ImportResponder(resp *http.Response) (result ImportExportResponse, 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 -} - -// ListByElasticPool gets a list of databases in an elastic pool. -// 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. -// elasticPoolName - the name of the elastic pool. -func (client DatabasesClient) ListByElasticPool(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (result DatabaseListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabasesClient.ListByElasticPool") - defer func() { - sc := -1 - if result.dlr.Response.Response != nil { - sc = result.dlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByElasticPoolNextResults - req, err := client.ListByElasticPoolPreparer(ctx, resourceGroupName, serverName, elasticPoolName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "ListByElasticPool", nil, "Failure preparing request") - return - } - - resp, err := client.ListByElasticPoolSender(req) - if err != nil { - result.dlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "ListByElasticPool", resp, "Failure sending request") - return - } - - result.dlr, err = client.ListByElasticPoolResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "ListByElasticPool", resp, "Failure responding to request") - } - - return -} - -// ListByElasticPoolPreparer prepares the ListByElasticPool request. -func (client DatabasesClient) ListByElasticPoolPreparer(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "elasticPoolName": autorest.Encode("path", elasticPoolName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-10-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}/elasticPools/{elasticPoolName}/databases", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByElasticPoolSender sends the ListByElasticPool request. The method will close the -// http.Response Body if it receives an error. -func (client DatabasesClient) ListByElasticPoolSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByElasticPoolResponder handles the response to the ListByElasticPool request. The method always -// closes the http.Response Body. -func (client DatabasesClient) ListByElasticPoolResponder(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 -} - -// listByElasticPoolNextResults retrieves the next set of results, if any. -func (client DatabasesClient) listByElasticPoolNextResults(ctx context.Context, lastResults DatabaseListResult) (result DatabaseListResult, err error) { - req, err := lastResults.databaseListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.DatabasesClient", "listByElasticPoolNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByElasticPoolSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "sql.DatabasesClient", "listByElasticPoolNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByElasticPoolResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "listByElasticPoolNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByElasticPoolComplete enumerates all values, automatically crossing page boundaries as required. -func (client DatabasesClient) ListByElasticPoolComplete(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (result DatabaseListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabasesClient.ListByElasticPool") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByElasticPool(ctx, resourceGroupName, serverName, elasticPoolName) - return -} - -// ListByServer gets a list of databases. -// 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 DatabasesClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result DatabaseListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabasesClient.ListByServer") - defer func() { - sc := -1 - if result.dlr.Response.Response != nil { - sc = result.dlr.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.DatabasesClient", "ListByServer", nil, "Failure preparing request") - return - } - - resp, err := client.ListByServerSender(req) - if err != nil { - result.dlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "ListByServer", resp, "Failure sending request") - return - } - - result.dlr, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "ListByServer", resp, "Failure responding to request") - } - - return -} - -// ListByServerPreparer prepares the ListByServer request. -func (client DatabasesClient) 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-10-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", 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 DatabasesClient) 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 DatabasesClient) ListByServerResponder(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 -} - -// listByServerNextResults retrieves the next set of results, if any. -func (client DatabasesClient) listByServerNextResults(ctx context.Context, lastResults DatabaseListResult) (result DatabaseListResult, err error) { - req, err := lastResults.databaseListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.DatabasesClient", "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.DatabasesClient", "listByServerNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "listByServerNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByServerComplete enumerates all values, automatically crossing page boundaries as required. -func (client DatabasesClient) ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string) (result DatabaseListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabasesClient.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 -} - -// ListMetricDefinitions returns database metric definitions. -// 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 DatabasesClient) ListMetricDefinitions(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result MetricDefinitionListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabasesClient.ListMetricDefinitions") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListMetricDefinitionsPreparer(ctx, resourceGroupName, serverName, databaseName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "ListMetricDefinitions", nil, "Failure preparing request") - return - } - - resp, err := client.ListMetricDefinitionsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "ListMetricDefinitions", resp, "Failure sending request") - return - } - - result, err = client.ListMetricDefinitionsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "ListMetricDefinitions", resp, "Failure responding to request") - } - - return -} - -// ListMetricDefinitionsPreparer prepares the ListMetricDefinitions request. -func (client DatabasesClient) ListMetricDefinitionsPreparer(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 = "2014-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.Sql/servers/{serverName}/databases/{databaseName}/metricDefinitions", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListMetricDefinitionsSender sends the ListMetricDefinitions request. The method will close the -// http.Response Body if it receives an error. -func (client DatabasesClient) ListMetricDefinitionsSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListMetricDefinitionsResponder handles the response to the ListMetricDefinitions request. The method always -// closes the http.Response Body. -func (client DatabasesClient) ListMetricDefinitionsResponder(resp *http.Response) (result MetricDefinitionListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListMetrics returns database metrics. -// 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. -// filter - an OData filter expression that describes a subset of metrics to return. -func (client DatabasesClient) ListMetrics(ctx context.Context, resourceGroupName string, serverName string, databaseName string, filter string) (result MetricListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabasesClient.ListMetrics") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListMetricsPreparer(ctx, resourceGroupName, serverName, databaseName, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "ListMetrics", nil, "Failure preparing request") - return - } - - resp, err := client.ListMetricsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "ListMetrics", resp, "Failure sending request") - return - } - - result, err = client.ListMetricsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "ListMetrics", resp, "Failure responding to request") - } - - return -} - -// ListMetricsPreparer prepares the ListMetrics request. -func (client DatabasesClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, filter 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 = "2014-04-01" - queryParameters := map[string]interface{}{ - "$filter": autorest.Encode("query", filter), - "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}/metrics", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListMetricsSender sends the ListMetrics request. The method will close the -// http.Response Body if it receives an error. -func (client DatabasesClient) ListMetricsSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListMetricsResponder handles the response to the ListMetrics request. The method always -// closes the http.Response Body. -func (client DatabasesClient) ListMetricsResponder(resp *http.Response) (result MetricListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Pause pauses 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 to be paused. -func (client DatabasesClient) Pause(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result DatabasesPauseFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabasesClient.Pause") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.PausePreparer(ctx, resourceGroupName, serverName, databaseName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "Pause", nil, "Failure preparing request") - return - } - - result, err = client.PauseSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "Pause", result.Response(), "Failure sending request") - return - } - - return -} - -// PausePreparer prepares the Pause request. -func (client DatabasesClient) PausePreparer(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-10-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.Sql/servers/{serverName}/databases/{databaseName}/pause", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PauseSender sends the Pause request. The method will close the -// http.Response Body if it receives an error. -func (client DatabasesClient) PauseSender(req *http.Request) (future DatabasesPauseFuture, 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 -} - -// PauseResponder handles the response to the Pause request. The method always -// closes the http.Response Body. -func (client DatabasesClient) PauseResponder(resp *http.Response) (result Database, 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 -} - -// Rename renames 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 to rename. -// parameters - the resource move definition for renaming this database. -func (client DatabasesClient) Rename(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters ResourceMoveDefinition) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabasesClient.Rename") - 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.ID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("sql.DatabasesClient", "Rename", err.Error()) - } - - req, err := client.RenamePreparer(ctx, resourceGroupName, serverName, databaseName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "Rename", nil, "Failure preparing request") - return - } - - resp, err := client.RenameSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "Rename", resp, "Failure sending request") - return - } - - result, err = client.RenameResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "Rename", resp, "Failure responding to request") - } - - return -} - -// RenamePreparer prepares the Rename request. -func (client DatabasesClient) RenamePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters ResourceMoveDefinition) (*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-10-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.Sql/servers/{serverName}/databases/{databaseName}/move", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RenameSender sends the Rename request. The method will close the -// http.Response Body if it receives an error. -func (client DatabasesClient) RenameSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// RenameResponder handles the response to the Rename request. The method always -// closes the http.Response Body. -func (client DatabasesClient) RenameResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Resume resumes 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 to be resumed. -func (client DatabasesClient) Resume(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result DatabasesResumeFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabasesClient.Resume") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ResumePreparer(ctx, resourceGroupName, serverName, databaseName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "Resume", nil, "Failure preparing request") - return - } - - result, err = client.ResumeSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "Resume", result.Response(), "Failure sending request") - return - } - - return -} - -// ResumePreparer prepares the Resume request. -func (client DatabasesClient) ResumePreparer(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-10-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.Sql/servers/{serverName}/databases/{databaseName}/resume", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ResumeSender sends the Resume request. The method will close the -// http.Response Body if it receives an error. -func (client DatabasesClient) ResumeSender(req *http.Request) (future DatabasesResumeFuture, 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 -} - -// ResumeResponder handles the response to the Resume request. The method always -// closes the http.Response Body. -func (client DatabasesClient) ResumeResponder(resp *http.Response) (result Database, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Update updates an existing 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. -// parameters - the requested database resource state. -func (client DatabasesClient) Update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters DatabaseUpdate) (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, serverName, databaseName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client DatabasesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters DatabaseUpdate) (*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-10-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.Sql/servers/{serverName}/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 Database, 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 -} - -// UpgradeDataWarehouse upgrades a data warehouse. -// 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 to be upgraded. -func (client DatabasesClient) UpgradeDataWarehouse(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result DatabasesUpgradeDataWarehouseFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabasesClient.UpgradeDataWarehouse") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpgradeDataWarehousePreparer(ctx, resourceGroupName, serverName, databaseName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "UpgradeDataWarehouse", nil, "Failure preparing request") - return - } - - result, err = client.UpgradeDataWarehouseSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "UpgradeDataWarehouse", result.Response(), "Failure sending request") - return - } - - return -} - -// UpgradeDataWarehousePreparer prepares the UpgradeDataWarehouse request. -func (client DatabasesClient) UpgradeDataWarehousePreparer(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-10-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.Sql/servers/{serverName}/databases/{databaseName}/upgradeDataWarehouse", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpgradeDataWarehouseSender sends the UpgradeDataWarehouse request. The method will close the -// http.Response Body if it receives an error. -func (client DatabasesClient) UpgradeDataWarehouseSender(req *http.Request) (future DatabasesUpgradeDataWarehouseFuture, 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 -} - -// UpgradeDataWarehouseResponder handles the response to the UpgradeDataWarehouse request. The method always -// closes the http.Response Body. -func (client DatabasesClient) UpgradeDataWarehouseResponder(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/sql/mgmt/2018-06-15-preview/sql/databasethreatdetectionpolicies.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/databasethreatdetectionpolicies.go deleted file mode 100644 index 9c858036755f..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/databasethreatdetectionpolicies.go +++ /dev/null @@ -1,210 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// DatabaseThreatDetectionPoliciesClient is the the Azure SQL Database management API provides a RESTful set of web -// services that interact with Azure SQL Database services to manage your databases. The API enables you to create, -// retrieve, update, and delete databases. -type DatabaseThreatDetectionPoliciesClient struct { - BaseClient -} - -// NewDatabaseThreatDetectionPoliciesClient creates an instance of the DatabaseThreatDetectionPoliciesClient client. -func NewDatabaseThreatDetectionPoliciesClient(subscriptionID string) DatabaseThreatDetectionPoliciesClient { - return NewDatabaseThreatDetectionPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDatabaseThreatDetectionPoliciesClientWithBaseURI creates an instance of the DatabaseThreatDetectionPoliciesClient -// client. -func NewDatabaseThreatDetectionPoliciesClientWithBaseURI(baseURI string, subscriptionID string) DatabaseThreatDetectionPoliciesClient { - return DatabaseThreatDetectionPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a database's threat detection policy. -// 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 for which database Threat Detection policy is defined. -// parameters - the database Threat Detection policy. -func (client DatabaseThreatDetectionPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters DatabaseSecurityAlertPolicy) (result DatabaseSecurityAlertPolicy, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseThreatDetectionPoliciesClient.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, serverName, databaseName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabaseThreatDetectionPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.DatabaseThreatDetectionPoliciesClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabaseThreatDetectionPoliciesClient", "CreateOrUpdate", resp, "Failure responding to request") - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DatabaseThreatDetectionPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters DatabaseSecurityAlertPolicy) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "securityAlertPolicyName": autorest.Encode("path", "default"), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-04-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Kind = 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.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}", 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 DatabaseThreatDetectionPoliciesClient) 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 DatabaseThreatDetectionPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result DatabaseSecurityAlertPolicy, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get gets a database's threat detection policy. -// 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 for which database Threat Detection policy is defined. -func (client DatabaseThreatDetectionPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result DatabaseSecurityAlertPolicy, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseThreatDetectionPoliciesClient.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, serverName, databaseName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabaseThreatDetectionPoliciesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.DatabaseThreatDetectionPoliciesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabaseThreatDetectionPoliciesClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client DatabaseThreatDetectionPoliciesClient) GetPreparer(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), - "securityAlertPolicyName": autorest.Encode("path", "default"), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-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.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}", 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 DatabaseThreatDetectionPoliciesClient) 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 DatabaseThreatDetectionPoliciesClient) GetResponder(resp *http.Response) (result DatabaseSecurityAlertPolicy, 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/sql/mgmt/2018-06-15-preview/sql/databasevulnerabilityassessmentrulebaselines.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/databasevulnerabilityassessmentrulebaselines.go deleted file mode 100644 index c4de2c1ee8e8..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/databasevulnerabilityassessmentrulebaselines.go +++ /dev/null @@ -1,313 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the 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" -) - -// DatabaseVulnerabilityAssessmentRuleBaselinesClient is the the Azure SQL Database management API provides a RESTful -// set of web services that interact with Azure SQL Database services to manage your databases. The API enables you to -// create, retrieve, update, and delete databases. -type DatabaseVulnerabilityAssessmentRuleBaselinesClient struct { - BaseClient -} - -// NewDatabaseVulnerabilityAssessmentRuleBaselinesClient creates an instance of the -// DatabaseVulnerabilityAssessmentRuleBaselinesClient client. -func NewDatabaseVulnerabilityAssessmentRuleBaselinesClient(subscriptionID string) DatabaseVulnerabilityAssessmentRuleBaselinesClient { - return NewDatabaseVulnerabilityAssessmentRuleBaselinesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDatabaseVulnerabilityAssessmentRuleBaselinesClientWithBaseURI creates an instance of the -// DatabaseVulnerabilityAssessmentRuleBaselinesClient client. -func NewDatabaseVulnerabilityAssessmentRuleBaselinesClientWithBaseURI(baseURI string, subscriptionID string) DatabaseVulnerabilityAssessmentRuleBaselinesClient { - return DatabaseVulnerabilityAssessmentRuleBaselinesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a database's vulnerability assessment rule baseline. -// 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 for which the vulnerability assessment rule baseline is defined. -// ruleID - the vulnerability assessment rule ID. -// baselineName - the name of the vulnerability assessment rule baseline (default implies a baseline on a -// database level rule and master for server level rule). -// parameters - the requested rule baseline resource. -func (client DatabaseVulnerabilityAssessmentRuleBaselinesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, ruleID string, baselineName VulnerabilityAssessmentPolicyBaselineName, parameters DatabaseVulnerabilityAssessmentRuleBaseline) (result DatabaseVulnerabilityAssessmentRuleBaseline, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseVulnerabilityAssessmentRuleBaselinesClient.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: parameters, - Constraints: []validation.Constraint{{Target: "parameters.DatabaseVulnerabilityAssessmentRuleBaselineProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.DatabaseVulnerabilityAssessmentRuleBaselineProperties.BaselineResults", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("sql.DatabaseVulnerabilityAssessmentRuleBaselinesClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, databaseName, ruleID, baselineName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabaseVulnerabilityAssessmentRuleBaselinesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.DatabaseVulnerabilityAssessmentRuleBaselinesClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabaseVulnerabilityAssessmentRuleBaselinesClient", "CreateOrUpdate", resp, "Failure responding to request") - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DatabaseVulnerabilityAssessmentRuleBaselinesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, ruleID string, baselineName VulnerabilityAssessmentPolicyBaselineName, parameters DatabaseVulnerabilityAssessmentRuleBaseline) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "baselineName": autorest.Encode("path", baselineName), - "databaseName": autorest.Encode("path", databaseName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "ruleId": autorest.Encode("path", ruleID), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vulnerabilityAssessmentName": autorest.Encode("path", "default"), - } - - const APIVersion = "2017-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.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}", 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 DatabaseVulnerabilityAssessmentRuleBaselinesClient) 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 DatabaseVulnerabilityAssessmentRuleBaselinesClient) CreateOrUpdateResponder(resp *http.Response) (result DatabaseVulnerabilityAssessmentRuleBaseline, 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 the database's vulnerability assessment rule baseline. -// 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 for which the vulnerability assessment rule baseline is defined. -// ruleID - the vulnerability assessment rule ID. -// baselineName - the name of the vulnerability assessment rule baseline (default implies a baseline on a -// database level rule and master for server level rule). -func (client DatabaseVulnerabilityAssessmentRuleBaselinesClient) Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, ruleID string, baselineName VulnerabilityAssessmentPolicyBaselineName) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseVulnerabilityAssessmentRuleBaselinesClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, databaseName, ruleID, baselineName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabaseVulnerabilityAssessmentRuleBaselinesClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "sql.DatabaseVulnerabilityAssessmentRuleBaselinesClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabaseVulnerabilityAssessmentRuleBaselinesClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client DatabaseVulnerabilityAssessmentRuleBaselinesClient) DeletePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, ruleID string, baselineName VulnerabilityAssessmentPolicyBaselineName) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "baselineName": autorest.Encode("path", baselineName), - "databaseName": autorest.Encode("path", databaseName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "ruleId": autorest.Encode("path", ruleID), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vulnerabilityAssessmentName": autorest.Encode("path", "default"), - } - - const APIVersion = "2017-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.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}", 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 DatabaseVulnerabilityAssessmentRuleBaselinesClient) 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 DatabaseVulnerabilityAssessmentRuleBaselinesClient) 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 a database's vulnerability assessment rule baseline. -// 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 for which the vulnerability assessment rule baseline is defined. -// ruleID - the vulnerability assessment rule ID. -// baselineName - the name of the vulnerability assessment rule baseline (default implies a baseline on a -// database level rule and master for server level rule). -func (client DatabaseVulnerabilityAssessmentRuleBaselinesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, ruleID string, baselineName VulnerabilityAssessmentPolicyBaselineName) (result DatabaseVulnerabilityAssessmentRuleBaseline, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseVulnerabilityAssessmentRuleBaselinesClient.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, serverName, databaseName, ruleID, baselineName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabaseVulnerabilityAssessmentRuleBaselinesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.DatabaseVulnerabilityAssessmentRuleBaselinesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabaseVulnerabilityAssessmentRuleBaselinesClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client DatabaseVulnerabilityAssessmentRuleBaselinesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, ruleID string, baselineName VulnerabilityAssessmentPolicyBaselineName) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "baselineName": autorest.Encode("path", baselineName), - "databaseName": autorest.Encode("path", databaseName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "ruleId": autorest.Encode("path", ruleID), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vulnerabilityAssessmentName": autorest.Encode("path", "default"), - } - - 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}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}", 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 DatabaseVulnerabilityAssessmentRuleBaselinesClient) 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 DatabaseVulnerabilityAssessmentRuleBaselinesClient) GetResponder(resp *http.Response) (result DatabaseVulnerabilityAssessmentRuleBaseline, 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/sql/mgmt/2018-06-15-preview/sql/databasevulnerabilityassessments.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/databasevulnerabilityassessments.go deleted file mode 100644 index e953704645ce..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/databasevulnerabilityassessments.go +++ /dev/null @@ -1,407 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// DatabaseVulnerabilityAssessmentsClient is the the Azure SQL Database management API provides a RESTful set of web -// services that interact with Azure SQL Database services to manage your databases. The API enables you to create, -// retrieve, update, and delete databases. -type DatabaseVulnerabilityAssessmentsClient struct { - BaseClient -} - -// NewDatabaseVulnerabilityAssessmentsClient creates an instance of the DatabaseVulnerabilityAssessmentsClient client. -func NewDatabaseVulnerabilityAssessmentsClient(subscriptionID string) DatabaseVulnerabilityAssessmentsClient { - return NewDatabaseVulnerabilityAssessmentsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDatabaseVulnerabilityAssessmentsClientWithBaseURI creates an instance of the -// DatabaseVulnerabilityAssessmentsClient client. -func NewDatabaseVulnerabilityAssessmentsClientWithBaseURI(baseURI string, subscriptionID string) DatabaseVulnerabilityAssessmentsClient { - return DatabaseVulnerabilityAssessmentsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates the database's vulnerability assessment. -// 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 for which the vulnerability assessment is defined. -// parameters - the requested resource. -func (client DatabaseVulnerabilityAssessmentsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters DatabaseVulnerabilityAssessment) (result DatabaseVulnerabilityAssessment, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseVulnerabilityAssessmentsClient.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, serverName, databaseName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabaseVulnerabilityAssessmentsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.DatabaseVulnerabilityAssessmentsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabaseVulnerabilityAssessmentsClient", "CreateOrUpdate", resp, "Failure responding to request") - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DatabaseVulnerabilityAssessmentsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters DatabaseVulnerabilityAssessment) (*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), - "vulnerabilityAssessmentName": autorest.Encode("path", "default"), - } - - const APIVersion = "2017-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.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}", 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 DatabaseVulnerabilityAssessmentsClient) 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 DatabaseVulnerabilityAssessmentsClient) CreateOrUpdateResponder(resp *http.Response) (result DatabaseVulnerabilityAssessment, 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 removes the database's vulnerability assessment. -// 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 for which the vulnerability assessment is defined. -func (client DatabaseVulnerabilityAssessmentsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseVulnerabilityAssessmentsClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, databaseName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabaseVulnerabilityAssessmentsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "sql.DatabaseVulnerabilityAssessmentsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabaseVulnerabilityAssessmentsClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client DatabaseVulnerabilityAssessmentsClient) DeletePreparer(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), - "vulnerabilityAssessmentName": autorest.Encode("path", "default"), - } - - const APIVersion = "2017-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.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}", 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 DatabaseVulnerabilityAssessmentsClient) 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 DatabaseVulnerabilityAssessmentsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the database's vulnerability assessment. -// 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 for which the vulnerability assessment is defined. -func (client DatabaseVulnerabilityAssessmentsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result DatabaseVulnerabilityAssessment, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseVulnerabilityAssessmentsClient.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, serverName, databaseName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabaseVulnerabilityAssessmentsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.DatabaseVulnerabilityAssessmentsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabaseVulnerabilityAssessmentsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client DatabaseVulnerabilityAssessmentsClient) GetPreparer(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), - "vulnerabilityAssessmentName": autorest.Encode("path", "default"), - } - - 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}/vulnerabilityAssessments/{vulnerabilityAssessmentName}", 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 DatabaseVulnerabilityAssessmentsClient) 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 DatabaseVulnerabilityAssessmentsClient) GetResponder(resp *http.Response) (result DatabaseVulnerabilityAssessment, 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 lists the vulnerability assessment policies associated with 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 for which the vulnerability assessment policies are defined. -func (client DatabaseVulnerabilityAssessmentsClient) ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result DatabaseVulnerabilityAssessmentListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseVulnerabilityAssessmentsClient.ListByDatabase") - defer func() { - sc := -1 - if result.dvalr.Response.Response != nil { - sc = result.dvalr.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.DatabaseVulnerabilityAssessmentsClient", "ListByDatabase", nil, "Failure preparing request") - return - } - - resp, err := client.ListByDatabaseSender(req) - if err != nil { - result.dvalr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.DatabaseVulnerabilityAssessmentsClient", "ListByDatabase", resp, "Failure sending request") - return - } - - result.dvalr, err = client.ListByDatabaseResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabaseVulnerabilityAssessmentsClient", "ListByDatabase", resp, "Failure responding to request") - } - - return -} - -// ListByDatabasePreparer prepares the ListByDatabase request. -func (client DatabaseVulnerabilityAssessmentsClient) 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}/vulnerabilityAssessments", 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 DatabaseVulnerabilityAssessmentsClient) 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 DatabaseVulnerabilityAssessmentsClient) ListByDatabaseResponder(resp *http.Response) (result DatabaseVulnerabilityAssessmentListResult, 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 DatabaseVulnerabilityAssessmentsClient) listByDatabaseNextResults(ctx context.Context, lastResults DatabaseVulnerabilityAssessmentListResult) (result DatabaseVulnerabilityAssessmentListResult, err error) { - req, err := lastResults.databaseVulnerabilityAssessmentListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.DatabaseVulnerabilityAssessmentsClient", "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.DatabaseVulnerabilityAssessmentsClient", "listByDatabaseNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByDatabaseResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabaseVulnerabilityAssessmentsClient", "listByDatabaseNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByDatabaseComplete enumerates all values, automatically crossing page boundaries as required. -func (client DatabaseVulnerabilityAssessmentsClient) ListByDatabaseComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result DatabaseVulnerabilityAssessmentListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseVulnerabilityAssessmentsClient.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/2018-06-15-preview/sql/databasevulnerabilityassessmentscans.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/databasevulnerabilityassessmentscans.go deleted file mode 100644 index c373cd98d049..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/databasevulnerabilityassessmentscans.go +++ /dev/null @@ -1,412 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// DatabaseVulnerabilityAssessmentScansClient is the the Azure SQL Database management API provides a RESTful set of -// web services that interact with Azure SQL Database services to manage your databases. The API enables you to create, -// retrieve, update, and delete databases. -type DatabaseVulnerabilityAssessmentScansClient struct { - BaseClient -} - -// NewDatabaseVulnerabilityAssessmentScansClient creates an instance of the DatabaseVulnerabilityAssessmentScansClient -// client. -func NewDatabaseVulnerabilityAssessmentScansClient(subscriptionID string) DatabaseVulnerabilityAssessmentScansClient { - return NewDatabaseVulnerabilityAssessmentScansClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDatabaseVulnerabilityAssessmentScansClientWithBaseURI creates an instance of the -// DatabaseVulnerabilityAssessmentScansClient client. -func NewDatabaseVulnerabilityAssessmentScansClientWithBaseURI(baseURI string, subscriptionID string) DatabaseVulnerabilityAssessmentScansClient { - return DatabaseVulnerabilityAssessmentScansClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Export convert an existing scan result to a human readable format. If already exists nothing happens -// 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 scanned database. -// scanID - the vulnerability assessment scan Id. -func (client DatabaseVulnerabilityAssessmentScansClient) Export(ctx context.Context, resourceGroupName string, serverName string, databaseName string, scanID string) (result DatabaseVulnerabilityAssessmentScansExport, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseVulnerabilityAssessmentScansClient.Export") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ExportPreparer(ctx, resourceGroupName, serverName, databaseName, scanID) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabaseVulnerabilityAssessmentScansClient", "Export", nil, "Failure preparing request") - return - } - - resp, err := client.ExportSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.DatabaseVulnerabilityAssessmentScansClient", "Export", resp, "Failure sending request") - return - } - - result, err = client.ExportResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabaseVulnerabilityAssessmentScansClient", "Export", resp, "Failure responding to request") - } - - return -} - -// ExportPreparer prepares the Export request. -func (client DatabaseVulnerabilityAssessmentScansClient) ExportPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, scanID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "scanId": autorest.Encode("path", scanID), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vulnerabilityAssessmentName": autorest.Encode("path", "default"), - } - - const APIVersion = "2017-10-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.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/export", pathParameters), - autorest.WithQueryParameters(queryParameters)) - 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 DatabaseVulnerabilityAssessmentScansClient) ExportSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ExportResponder handles the response to the Export request. The method always -// closes the http.Response Body. -func (client DatabaseVulnerabilityAssessmentScansClient) ExportResponder(resp *http.Response) (result DatabaseVulnerabilityAssessmentScansExport, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get gets a vulnerability assessment scan record 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. -// scanID - the vulnerability assessment scan Id of the scan to retrieve. -func (client DatabaseVulnerabilityAssessmentScansClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, scanID string) (result VulnerabilityAssessmentScanRecord, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseVulnerabilityAssessmentScansClient.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, serverName, databaseName, scanID) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabaseVulnerabilityAssessmentScansClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.DatabaseVulnerabilityAssessmentScansClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabaseVulnerabilityAssessmentScansClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client DatabaseVulnerabilityAssessmentScansClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, scanID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "scanId": autorest.Encode("path", scanID), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vulnerabilityAssessmentName": autorest.Encode("path", "default"), - } - - const APIVersion = "2017-10-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}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}", 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 DatabaseVulnerabilityAssessmentScansClient) 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 DatabaseVulnerabilityAssessmentScansClient) GetResponder(resp *http.Response) (result VulnerabilityAssessmentScanRecord, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// InitiateScan executes a Vulnerability Assessment database scan. -// 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. -// scanID - the vulnerability assessment scan Id of the scan to retrieve. -func (client DatabaseVulnerabilityAssessmentScansClient) InitiateScan(ctx context.Context, resourceGroupName string, serverName string, databaseName string, scanID string) (result DatabaseVulnerabilityAssessmentScansInitiateScanFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseVulnerabilityAssessmentScansClient.InitiateScan") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.InitiateScanPreparer(ctx, resourceGroupName, serverName, databaseName, scanID) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabaseVulnerabilityAssessmentScansClient", "InitiateScan", nil, "Failure preparing request") - return - } - - result, err = client.InitiateScanSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabaseVulnerabilityAssessmentScansClient", "InitiateScan", result.Response(), "Failure sending request") - return - } - - return -} - -// InitiateScanPreparer prepares the InitiateScan request. -func (client DatabaseVulnerabilityAssessmentScansClient) InitiateScanPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, scanID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "scanId": autorest.Encode("path", scanID), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vulnerabilityAssessmentName": autorest.Encode("path", "default"), - } - - const APIVersion = "2017-10-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.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// InitiateScanSender sends the InitiateScan request. The method will close the -// http.Response Body if it receives an error. -func (client DatabaseVulnerabilityAssessmentScansClient) InitiateScanSender(req *http.Request) (future DatabaseVulnerabilityAssessmentScansInitiateScanFuture, 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 -} - -// InitiateScanResponder handles the response to the InitiateScan request. The method always -// closes the http.Response Body. -func (client DatabaseVulnerabilityAssessmentScansClient) InitiateScanResponder(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 -} - -// ListByDatabase lists the vulnerability assessment scans 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 DatabaseVulnerabilityAssessmentScansClient) ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result VulnerabilityAssessmentScanRecordListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseVulnerabilityAssessmentScansClient.ListByDatabase") - defer func() { - sc := -1 - if result.vasrlr.Response.Response != nil { - sc = result.vasrlr.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.DatabaseVulnerabilityAssessmentScansClient", "ListByDatabase", nil, "Failure preparing request") - return - } - - resp, err := client.ListByDatabaseSender(req) - if err != nil { - result.vasrlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.DatabaseVulnerabilityAssessmentScansClient", "ListByDatabase", resp, "Failure sending request") - return - } - - result.vasrlr, err = client.ListByDatabaseResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabaseVulnerabilityAssessmentScansClient", "ListByDatabase", resp, "Failure responding to request") - } - - return -} - -// ListByDatabasePreparer prepares the ListByDatabase request. -func (client DatabaseVulnerabilityAssessmentScansClient) 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), - "vulnerabilityAssessmentName": autorest.Encode("path", "default"), - } - - const APIVersion = "2017-10-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}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans", 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 DatabaseVulnerabilityAssessmentScansClient) 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 DatabaseVulnerabilityAssessmentScansClient) ListByDatabaseResponder(resp *http.Response) (result VulnerabilityAssessmentScanRecordListResult, 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 DatabaseVulnerabilityAssessmentScansClient) listByDatabaseNextResults(ctx context.Context, lastResults VulnerabilityAssessmentScanRecordListResult) (result VulnerabilityAssessmentScanRecordListResult, err error) { - req, err := lastResults.vulnerabilityAssessmentScanRecordListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.DatabaseVulnerabilityAssessmentScansClient", "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.DatabaseVulnerabilityAssessmentScansClient", "listByDatabaseNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByDatabaseResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabaseVulnerabilityAssessmentScansClient", "listByDatabaseNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByDatabaseComplete enumerates all values, automatically crossing page boundaries as required. -func (client DatabaseVulnerabilityAssessmentScansClient) ListByDatabaseComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result VulnerabilityAssessmentScanRecordListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseVulnerabilityAssessmentScansClient.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/2018-06-15-preview/sql/elasticpooldatabaseactivities.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/elasticpooldatabaseactivities.go deleted file mode 100644 index dd0e955db87f..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/elasticpooldatabaseactivities.go +++ /dev/null @@ -1,124 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// ElasticPoolDatabaseActivitiesClient is the the Azure SQL Database management API provides a RESTful set of web -// services that interact with Azure SQL Database services to manage your databases. The API enables you to create, -// retrieve, update, and delete databases. -type ElasticPoolDatabaseActivitiesClient struct { - BaseClient -} - -// NewElasticPoolDatabaseActivitiesClient creates an instance of the ElasticPoolDatabaseActivitiesClient client. -func NewElasticPoolDatabaseActivitiesClient(subscriptionID string) ElasticPoolDatabaseActivitiesClient { - return NewElasticPoolDatabaseActivitiesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewElasticPoolDatabaseActivitiesClientWithBaseURI creates an instance of the ElasticPoolDatabaseActivitiesClient -// client. -func NewElasticPoolDatabaseActivitiesClientWithBaseURI(baseURI string, subscriptionID string) ElasticPoolDatabaseActivitiesClient { - return ElasticPoolDatabaseActivitiesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// ListByElasticPool returns activity on databases inside of an elastic pool. -// 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. -// elasticPoolName - the name of the elastic pool. -func (client ElasticPoolDatabaseActivitiesClient) ListByElasticPool(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (result ElasticPoolDatabaseActivityListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ElasticPoolDatabaseActivitiesClient.ListByElasticPool") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListByElasticPoolPreparer(ctx, resourceGroupName, serverName, elasticPoolName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ElasticPoolDatabaseActivitiesClient", "ListByElasticPool", nil, "Failure preparing request") - return - } - - resp, err := client.ListByElasticPoolSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ElasticPoolDatabaseActivitiesClient", "ListByElasticPool", resp, "Failure sending request") - return - } - - result, err = client.ListByElasticPoolResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ElasticPoolDatabaseActivitiesClient", "ListByElasticPool", resp, "Failure responding to request") - } - - return -} - -// ListByElasticPoolPreparer prepares the ListByElasticPool request. -func (client ElasticPoolDatabaseActivitiesClient) ListByElasticPoolPreparer(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "elasticPoolName": autorest.Encode("path", elasticPoolName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-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.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/elasticPoolDatabaseActivity", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByElasticPoolSender sends the ListByElasticPool request. The method will close the -// http.Response Body if it receives an error. -func (client ElasticPoolDatabaseActivitiesClient) ListByElasticPoolSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByElasticPoolResponder handles the response to the ListByElasticPool request. The method always -// closes the http.Response Body. -func (client ElasticPoolDatabaseActivitiesClient) ListByElasticPoolResponder(resp *http.Response) (result ElasticPoolDatabaseActivityListResult, 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/sql/mgmt/2018-06-15-preview/sql/elasticpooloperations.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/elasticpooloperations.go deleted file mode 100644 index c1decafe82ff..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/elasticpooloperations.go +++ /dev/null @@ -1,241 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "github.com/satori/go.uuid" - "net/http" -) - -// ElasticPoolOperationsClient is the the Azure SQL Database management API provides a RESTful set of web services that -// interact with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, -// and delete databases. -type ElasticPoolOperationsClient struct { - BaseClient -} - -// NewElasticPoolOperationsClient creates an instance of the ElasticPoolOperationsClient client. -func NewElasticPoolOperationsClient(subscriptionID string) ElasticPoolOperationsClient { - return NewElasticPoolOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewElasticPoolOperationsClientWithBaseURI creates an instance of the ElasticPoolOperationsClient client. -func NewElasticPoolOperationsClientWithBaseURI(baseURI string, subscriptionID string) ElasticPoolOperationsClient { - return ElasticPoolOperationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Cancel cancels the asynchronous operation on the elastic pool. -// 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. -// operationID - the operation identifier. -func (client ElasticPoolOperationsClient) Cancel(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, operationID uuid.UUID) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ElasticPoolOperationsClient.Cancel") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CancelPreparer(ctx, resourceGroupName, serverName, elasticPoolName, operationID) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ElasticPoolOperationsClient", "Cancel", nil, "Failure preparing request") - return - } - - resp, err := client.CancelSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "sql.ElasticPoolOperationsClient", "Cancel", resp, "Failure sending request") - return - } - - result, err = client.CancelResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ElasticPoolOperationsClient", "Cancel", resp, "Failure responding to request") - } - - return -} - -// CancelPreparer prepares the Cancel request. -func (client ElasticPoolOperationsClient) CancelPreparer(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, operationID uuid.UUID) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "elasticPoolName": autorest.Encode("path", elasticPoolName), - "operationId": autorest.Encode("path", operationID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-10-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.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/operations/{operationId}/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 ElasticPoolOperationsClient) 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 ElasticPoolOperationsClient) 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 -} - -// ListByElasticPool gets a list of operations performed on the elastic pool. -// 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 ElasticPoolOperationsClient) ListByElasticPool(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (result ElasticPoolOperationListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ElasticPoolOperationsClient.ListByElasticPool") - defer func() { - sc := -1 - if result.epolr.Response.Response != nil { - sc = result.epolr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByElasticPoolNextResults - req, err := client.ListByElasticPoolPreparer(ctx, resourceGroupName, serverName, elasticPoolName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ElasticPoolOperationsClient", "ListByElasticPool", nil, "Failure preparing request") - return - } - - resp, err := client.ListByElasticPoolSender(req) - if err != nil { - result.epolr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ElasticPoolOperationsClient", "ListByElasticPool", resp, "Failure sending request") - return - } - - result.epolr, err = client.ListByElasticPoolResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ElasticPoolOperationsClient", "ListByElasticPool", resp, "Failure responding to request") - } - - return -} - -// ListByElasticPoolPreparer prepares the ListByElasticPool request. -func (client ElasticPoolOperationsClient) ListByElasticPoolPreparer(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "elasticPoolName": autorest.Encode("path", elasticPoolName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-10-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}/elasticPools/{elasticPoolName}/operations", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByElasticPoolSender sends the ListByElasticPool request. The method will close the -// http.Response Body if it receives an error. -func (client ElasticPoolOperationsClient) ListByElasticPoolSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByElasticPoolResponder handles the response to the ListByElasticPool request. The method always -// closes the http.Response Body. -func (client ElasticPoolOperationsClient) ListByElasticPoolResponder(resp *http.Response) (result ElasticPoolOperationListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByElasticPoolNextResults retrieves the next set of results, if any. -func (client ElasticPoolOperationsClient) listByElasticPoolNextResults(ctx context.Context, lastResults ElasticPoolOperationListResult) (result ElasticPoolOperationListResult, err error) { - req, err := lastResults.elasticPoolOperationListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.ElasticPoolOperationsClient", "listByElasticPoolNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByElasticPoolSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "sql.ElasticPoolOperationsClient", "listByElasticPoolNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByElasticPoolResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ElasticPoolOperationsClient", "listByElasticPoolNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByElasticPoolComplete enumerates all values, automatically crossing page boundaries as required. -func (client ElasticPoolOperationsClient) ListByElasticPoolComplete(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (result ElasticPoolOperationListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ElasticPoolOperationsClient.ListByElasticPool") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByElasticPool(ctx, resourceGroupName, serverName, elasticPoolName) - return -} diff --git a/services/preview/sql/mgmt/2018-06-15-preview/sql/elasticpools.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/elasticpools.go deleted file mode 100644 index 6504d43ea8af..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/elasticpools.go +++ /dev/null @@ -1,738 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the 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" -) - -// ElasticPoolsClient is the the Azure SQL Database management API provides a RESTful set of web services that interact -// with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, and -// delete databases. -type ElasticPoolsClient struct { - BaseClient -} - -// NewElasticPoolsClient creates an instance of the ElasticPoolsClient client. -func NewElasticPoolsClient(subscriptionID string) ElasticPoolsClient { - return NewElasticPoolsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewElasticPoolsClientWithBaseURI creates an instance of the ElasticPoolsClient client. -func NewElasticPoolsClientWithBaseURI(baseURI string, subscriptionID string) ElasticPoolsClient { - return ElasticPoolsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates an elastic pool. -// 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. -// elasticPoolName - the name of the elastic pool. -// parameters - the elastic pool parameters. -func (client ElasticPoolsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, parameters ElasticPool) (result ElasticPoolsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ElasticPoolsClient.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: false, - Chain: []validation.Constraint{{Target: "parameters.Sku.Name", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("sql.ElasticPoolsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, elasticPoolName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ElasticPoolsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ElasticPoolsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ElasticPoolsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, parameters ElasticPool) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "elasticPoolName": autorest.Encode("path", elasticPoolName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-10-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Kind = 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.Sql/servers/{serverName}/elasticPools/{elasticPoolName}", 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 ElasticPoolsClient) CreateOrUpdateSender(req *http.Request) (future ElasticPoolsCreateOrUpdateFuture, 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 ElasticPoolsClient) CreateOrUpdateResponder(resp *http.Response) (result ElasticPool, 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 elastic pool. -// 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. -// elasticPoolName - the name of the elastic pool. -func (client ElasticPoolsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (result ElasticPoolsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ElasticPoolsClient.Delete") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, elasticPoolName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ElasticPoolsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ElasticPoolsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ElasticPoolsClient) DeletePreparer(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "elasticPoolName": autorest.Encode("path", elasticPoolName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-10-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.Sql/servers/{serverName}/elasticPools/{elasticPoolName}", 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 ElasticPoolsClient) DeleteSender(req *http.Request) (future ElasticPoolsDeleteFuture, 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 ElasticPoolsClient) 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 -} - -// Failover failovers an elastic pool. -// 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. -// elasticPoolName - the name of the elastic pool to failover. -func (client ElasticPoolsClient) Failover(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (result ElasticPoolsFailoverFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ElasticPoolsClient.Failover") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.FailoverPreparer(ctx, resourceGroupName, serverName, elasticPoolName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ElasticPoolsClient", "Failover", nil, "Failure preparing request") - return - } - - result, err = client.FailoverSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ElasticPoolsClient", "Failover", result.Response(), "Failure sending request") - return - } - - return -} - -// FailoverPreparer prepares the Failover request. -func (client ElasticPoolsClient) FailoverPreparer(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "elasticPoolName": autorest.Encode("path", elasticPoolName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "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.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/failover", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// FailoverSender sends the Failover request. The method will close the -// http.Response Body if it receives an error. -func (client ElasticPoolsClient) FailoverSender(req *http.Request) (future ElasticPoolsFailoverFuture, 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 -} - -// FailoverResponder handles the response to the Failover request. The method always -// closes the http.Response Body. -func (client ElasticPoolsClient) FailoverResponder(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 an elastic pool. -// 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. -// elasticPoolName - the name of the elastic pool. -func (client ElasticPoolsClient) Get(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (result ElasticPool, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ElasticPoolsClient.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, serverName, elasticPoolName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ElasticPoolsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ElasticPoolsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ElasticPoolsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ElasticPoolsClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "elasticPoolName": autorest.Encode("path", elasticPoolName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-10-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}/elasticPools/{elasticPoolName}", 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 ElasticPoolsClient) 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 ElasticPoolsClient) GetResponder(resp *http.Response) (result ElasticPool, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByServer gets all elastic pools in 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. -// skip - the number of elements in the collection to skip. -func (client ElasticPoolsClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string, skip *int32) (result ElasticPoolListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ElasticPoolsClient.ListByServer") - defer func() { - sc := -1 - if result.eplr.Response.Response != nil { - sc = result.eplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByServerNextResults - req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName, skip) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ElasticPoolsClient", "ListByServer", nil, "Failure preparing request") - return - } - - resp, err := client.ListByServerSender(req) - if err != nil { - result.eplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ElasticPoolsClient", "ListByServer", resp, "Failure sending request") - return - } - - result.eplr, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ElasticPoolsClient", "ListByServer", resp, "Failure responding to request") - } - - return -} - -// ListByServerPreparer prepares the ListByServer request. -func (client ElasticPoolsClient) ListByServerPreparer(ctx context.Context, resourceGroupName string, serverName string, skip *int32) (*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-10-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if skip != nil { - queryParameters["$skip"] = autorest.Encode("query", *skip) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools", 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 ElasticPoolsClient) 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 ElasticPoolsClient) ListByServerResponder(resp *http.Response) (result ElasticPoolListResult, 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 ElasticPoolsClient) listByServerNextResults(ctx context.Context, lastResults ElasticPoolListResult) (result ElasticPoolListResult, err error) { - req, err := lastResults.elasticPoolListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.ElasticPoolsClient", "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.ElasticPoolsClient", "listByServerNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ElasticPoolsClient", "listByServerNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByServerComplete enumerates all values, automatically crossing page boundaries as required. -func (client ElasticPoolsClient) ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string, skip *int32) (result ElasticPoolListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ElasticPoolsClient.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, skip) - return -} - -// ListMetricDefinitions returns elastic pool metric definitions. -// 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. -// elasticPoolName - the name of the elastic pool. -func (client ElasticPoolsClient) ListMetricDefinitions(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (result MetricDefinitionListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ElasticPoolsClient.ListMetricDefinitions") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListMetricDefinitionsPreparer(ctx, resourceGroupName, serverName, elasticPoolName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ElasticPoolsClient", "ListMetricDefinitions", nil, "Failure preparing request") - return - } - - resp, err := client.ListMetricDefinitionsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ElasticPoolsClient", "ListMetricDefinitions", resp, "Failure sending request") - return - } - - result, err = client.ListMetricDefinitionsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ElasticPoolsClient", "ListMetricDefinitions", resp, "Failure responding to request") - } - - return -} - -// ListMetricDefinitionsPreparer prepares the ListMetricDefinitions request. -func (client ElasticPoolsClient) ListMetricDefinitionsPreparer(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "elasticPoolName": autorest.Encode("path", elasticPoolName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-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.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metricDefinitions", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListMetricDefinitionsSender sends the ListMetricDefinitions request. The method will close the -// http.Response Body if it receives an error. -func (client ElasticPoolsClient) ListMetricDefinitionsSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListMetricDefinitionsResponder handles the response to the ListMetricDefinitions request. The method always -// closes the http.Response Body. -func (client ElasticPoolsClient) ListMetricDefinitionsResponder(resp *http.Response) (result MetricDefinitionListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListMetrics returns elastic pool metrics. -// 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. -// elasticPoolName - the name of the elastic pool. -// filter - an OData filter expression that describes a subset of metrics to return. -func (client ElasticPoolsClient) ListMetrics(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, filter string) (result MetricListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ElasticPoolsClient.ListMetrics") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListMetricsPreparer(ctx, resourceGroupName, serverName, elasticPoolName, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ElasticPoolsClient", "ListMetrics", nil, "Failure preparing request") - return - } - - resp, err := client.ListMetricsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ElasticPoolsClient", "ListMetrics", resp, "Failure sending request") - return - } - - result, err = client.ListMetricsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ElasticPoolsClient", "ListMetrics", resp, "Failure responding to request") - } - - return -} - -// ListMetricsPreparer prepares the ListMetrics request. -func (client ElasticPoolsClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "elasticPoolName": autorest.Encode("path", elasticPoolName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-04-01" - queryParameters := map[string]interface{}{ - "$filter": autorest.Encode("query", filter), - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metrics", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListMetricsSender sends the ListMetrics request. The method will close the -// http.Response Body if it receives an error. -func (client ElasticPoolsClient) ListMetricsSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListMetricsResponder handles the response to the ListMetrics request. The method always -// closes the http.Response Body. -func (client ElasticPoolsClient) ListMetricsResponder(resp *http.Response) (result MetricListResult, 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 elastic pool. -// 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. -// elasticPoolName - the name of the elastic pool. -// parameters - the elastic pool update parameters. -func (client ElasticPoolsClient) Update(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, parameters ElasticPoolUpdate) (result ElasticPoolsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ElasticPoolsClient.Update") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, serverName, elasticPoolName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ElasticPoolsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ElasticPoolsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client ElasticPoolsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, parameters ElasticPoolUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "elasticPoolName": autorest.Encode("path", elasticPoolName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-10-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.Sql/servers/{serverName}/elasticPools/{elasticPoolName}", 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 ElasticPoolsClient) UpdateSender(req *http.Request) (future ElasticPoolsUpdateFuture, 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 ElasticPoolsClient) UpdateResponder(resp *http.Response) (result ElasticPool, 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/sql/mgmt/2018-06-15-preview/sql/encryptionprotectors.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/encryptionprotectors.go deleted file mode 100644 index 4bf6cc3947ab..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/encryptionprotectors.go +++ /dev/null @@ -1,400 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// EncryptionProtectorsClient is the the Azure SQL Database management API provides a RESTful set of web services that -// interact with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, -// and delete databases. -type EncryptionProtectorsClient struct { - BaseClient -} - -// NewEncryptionProtectorsClient creates an instance of the EncryptionProtectorsClient client. -func NewEncryptionProtectorsClient(subscriptionID string) EncryptionProtectorsClient { - return NewEncryptionProtectorsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewEncryptionProtectorsClientWithBaseURI creates an instance of the EncryptionProtectorsClient client. -func NewEncryptionProtectorsClientWithBaseURI(baseURI string, subscriptionID string) EncryptionProtectorsClient { - return EncryptionProtectorsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate updates an existing encryption protector. -// 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. -// parameters - the requested encryption protector resource state. -func (client EncryptionProtectorsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters EncryptionProtector) (result EncryptionProtectorsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/EncryptionProtectorsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.EncryptionProtectorsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.EncryptionProtectorsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client EncryptionProtectorsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, parameters EncryptionProtector) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "encryptionProtectorName": autorest.Encode("path", "current"), - "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, - } - - parameters.Kind = nil - parameters.Location = 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.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}", 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 EncryptionProtectorsClient) CreateOrUpdateSender(req *http.Request) (future EncryptionProtectorsCreateOrUpdateFuture, 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 EncryptionProtectorsClient) CreateOrUpdateResponder(resp *http.Response) (result EncryptionProtector, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get gets a server encryption protector. -// 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 EncryptionProtectorsClient) Get(ctx context.Context, resourceGroupName string, serverName string) (result EncryptionProtector, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/EncryptionProtectorsClient.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, serverName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.EncryptionProtectorsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.EncryptionProtectorsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.EncryptionProtectorsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client EncryptionProtectorsClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "encryptionProtectorName": autorest.Encode("path", "current"), - "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}/encryptionProtector/{encryptionProtectorName}", 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 EncryptionProtectorsClient) 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 EncryptionProtectorsClient) GetResponder(resp *http.Response) (result EncryptionProtector, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByServer gets a list of server encryption protectors -// 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 EncryptionProtectorsClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result EncryptionProtectorListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/EncryptionProtectorsClient.ListByServer") - defer func() { - sc := -1 - if result.eplr.Response.Response != nil { - sc = result.eplr.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.EncryptionProtectorsClient", "ListByServer", nil, "Failure preparing request") - return - } - - resp, err := client.ListByServerSender(req) - if err != nil { - result.eplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.EncryptionProtectorsClient", "ListByServer", resp, "Failure sending request") - return - } - - result.eplr, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.EncryptionProtectorsClient", "ListByServer", resp, "Failure responding to request") - } - - return -} - -// ListByServerPreparer prepares the ListByServer request. -func (client EncryptionProtectorsClient) 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 = "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}/encryptionProtector", 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 EncryptionProtectorsClient) 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 EncryptionProtectorsClient) ListByServerResponder(resp *http.Response) (result EncryptionProtectorListResult, 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 EncryptionProtectorsClient) listByServerNextResults(ctx context.Context, lastResults EncryptionProtectorListResult) (result EncryptionProtectorListResult, err error) { - req, err := lastResults.encryptionProtectorListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.EncryptionProtectorsClient", "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.EncryptionProtectorsClient", "listByServerNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.EncryptionProtectorsClient", "listByServerNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByServerComplete enumerates all values, automatically crossing page boundaries as required. -func (client EncryptionProtectorsClient) ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string) (result EncryptionProtectorListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/EncryptionProtectorsClient.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 -} - -// Revalidate revalidates an existing encryption protector. -// 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 EncryptionProtectorsClient) Revalidate(ctx context.Context, resourceGroupName string, serverName string) (result EncryptionProtectorsRevalidateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/EncryptionProtectorsClient.Revalidate") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RevalidatePreparer(ctx, resourceGroupName, serverName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.EncryptionProtectorsClient", "Revalidate", nil, "Failure preparing request") - return - } - - result, err = client.RevalidateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.EncryptionProtectorsClient", "Revalidate", result.Response(), "Failure sending request") - return - } - - return -} - -// RevalidatePreparer prepares the Revalidate request. -func (client EncryptionProtectorsClient) RevalidatePreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "encryptionProtectorName": autorest.Encode("path", "current"), - "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.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}/revalidate", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RevalidateSender sends the Revalidate request. The method will close the -// http.Response Body if it receives an error. -func (client EncryptionProtectorsClient) RevalidateSender(req *http.Request) (future EncryptionProtectorsRevalidateFuture, 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 -} - -// RevalidateResponder handles the response to the Revalidate request. The method always -// closes the http.Response Body. -func (client EncryptionProtectorsClient) RevalidateResponder(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/sql/mgmt/2018-06-15-preview/sql/extendeddatabaseblobauditingpolicies.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/extendeddatabaseblobauditingpolicies.go deleted file mode 100644 index 7c174fe2ad37..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/extendeddatabaseblobauditingpolicies.go +++ /dev/null @@ -1,210 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// ExtendedDatabaseBlobAuditingPoliciesClient is the the Azure SQL Database management API provides a RESTful set of -// web services that interact with Azure SQL Database services to manage your databases. The API enables you to create, -// retrieve, update, and delete databases. -type ExtendedDatabaseBlobAuditingPoliciesClient struct { - BaseClient -} - -// NewExtendedDatabaseBlobAuditingPoliciesClient creates an instance of the ExtendedDatabaseBlobAuditingPoliciesClient -// client. -func NewExtendedDatabaseBlobAuditingPoliciesClient(subscriptionID string) ExtendedDatabaseBlobAuditingPoliciesClient { - return NewExtendedDatabaseBlobAuditingPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewExtendedDatabaseBlobAuditingPoliciesClientWithBaseURI creates an instance of the -// ExtendedDatabaseBlobAuditingPoliciesClient client. -func NewExtendedDatabaseBlobAuditingPoliciesClientWithBaseURI(baseURI string, subscriptionID string) ExtendedDatabaseBlobAuditingPoliciesClient { - return ExtendedDatabaseBlobAuditingPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates an extended database's blob auditing policy. -// 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. -// parameters - the extended database blob auditing policy. -func (client ExtendedDatabaseBlobAuditingPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters ExtendedDatabaseBlobAuditingPolicy) (result ExtendedDatabaseBlobAuditingPolicy, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedDatabaseBlobAuditingPoliciesClient.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, serverName, databaseName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ExtendedDatabaseBlobAuditingPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ExtendedDatabaseBlobAuditingPoliciesClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ExtendedDatabaseBlobAuditingPoliciesClient", "CreateOrUpdate", resp, "Failure responding to request") - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ExtendedDatabaseBlobAuditingPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters ExtendedDatabaseBlobAuditingPolicy) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "blobAuditingPolicyName": autorest.Encode("path", "default"), - "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.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extendedAuditingSettings/{blobAuditingPolicyName}", 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 ExtendedDatabaseBlobAuditingPoliciesClient) 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 ExtendedDatabaseBlobAuditingPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result ExtendedDatabaseBlobAuditingPolicy, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get gets an extended database's blob auditing policy. -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -// serverName - the name of the server. -// databaseName - the name of the database. -func (client ExtendedDatabaseBlobAuditingPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result ExtendedDatabaseBlobAuditingPolicy, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedDatabaseBlobAuditingPoliciesClient.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, serverName, databaseName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ExtendedDatabaseBlobAuditingPoliciesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ExtendedDatabaseBlobAuditingPoliciesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ExtendedDatabaseBlobAuditingPoliciesClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ExtendedDatabaseBlobAuditingPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "blobAuditingPolicyName": autorest.Encode("path", "default"), - "databaseName": autorest.Encode("path", databaseName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-03-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extendedAuditingSettings/{blobAuditingPolicyName}", 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 ExtendedDatabaseBlobAuditingPoliciesClient) 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 ExtendedDatabaseBlobAuditingPoliciesClient) GetResponder(resp *http.Response) (result ExtendedDatabaseBlobAuditingPolicy, 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/sql/mgmt/2018-06-15-preview/sql/extendedserverblobauditingpolicies.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/extendedserverblobauditingpolicies.go deleted file mode 100644 index 1d8245d7a1a7..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/extendedserverblobauditingpolicies.go +++ /dev/null @@ -1,206 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// ExtendedServerBlobAuditingPoliciesClient is the the Azure SQL Database management API provides a RESTful set of web -// services that interact with Azure SQL Database services to manage your databases. The API enables you to create, -// retrieve, update, and delete databases. -type ExtendedServerBlobAuditingPoliciesClient struct { - BaseClient -} - -// NewExtendedServerBlobAuditingPoliciesClient creates an instance of the ExtendedServerBlobAuditingPoliciesClient -// client. -func NewExtendedServerBlobAuditingPoliciesClient(subscriptionID string) ExtendedServerBlobAuditingPoliciesClient { - return NewExtendedServerBlobAuditingPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewExtendedServerBlobAuditingPoliciesClientWithBaseURI creates an instance of the -// ExtendedServerBlobAuditingPoliciesClient client. -func NewExtendedServerBlobAuditingPoliciesClientWithBaseURI(baseURI string, subscriptionID string) ExtendedServerBlobAuditingPoliciesClient { - return ExtendedServerBlobAuditingPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates an extended server's blob auditing policy. -// 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. -// parameters - properties of extended blob auditing policy -func (client ExtendedServerBlobAuditingPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters ExtendedServerBlobAuditingPolicy) (result ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedServerBlobAuditingPoliciesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ExtendedServerBlobAuditingPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ExtendedServerBlobAuditingPoliciesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ExtendedServerBlobAuditingPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, parameters ExtendedServerBlobAuditingPolicy) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "blobAuditingPolicyName": autorest.Encode("path", "default"), - "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.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings/{blobAuditingPolicyName}", 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 ExtendedServerBlobAuditingPoliciesClient) CreateOrUpdateSender(req *http.Request) (future ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture, 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 ExtendedServerBlobAuditingPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result ExtendedServerBlobAuditingPolicy, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get gets an extended server's blob auditing policy. -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -// serverName - the name of the server. -func (client ExtendedServerBlobAuditingPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string) (result ExtendedServerBlobAuditingPolicy, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedServerBlobAuditingPoliciesClient.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, serverName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ExtendedServerBlobAuditingPoliciesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ExtendedServerBlobAuditingPoliciesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ExtendedServerBlobAuditingPoliciesClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ExtendedServerBlobAuditingPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "blobAuditingPolicyName": autorest.Encode("path", "default"), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-03-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings/{blobAuditingPolicyName}", 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 ExtendedServerBlobAuditingPoliciesClient) 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 ExtendedServerBlobAuditingPoliciesClient) GetResponder(resp *http.Response) (result ExtendedServerBlobAuditingPolicy, 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/sql/mgmt/2018-06-15-preview/sql/failovergroups.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/failovergroups.go deleted file mode 100644 index ea286e1e6aff..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/failovergroups.go +++ /dev/null @@ -1,656 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the 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" -) - -// FailoverGroupsClient is the the Azure SQL Database management API provides a RESTful set of web services that -// interact with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, -// and delete databases. -type FailoverGroupsClient struct { - BaseClient -} - -// NewFailoverGroupsClient creates an instance of the FailoverGroupsClient client. -func NewFailoverGroupsClient(subscriptionID string) FailoverGroupsClient { - return NewFailoverGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewFailoverGroupsClientWithBaseURI creates an instance of the FailoverGroupsClient client. -func NewFailoverGroupsClientWithBaseURI(baseURI string, subscriptionID string) FailoverGroupsClient { - return FailoverGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a failover group. -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -// serverName - the name of the server containing the failover group. -// failoverGroupName - the name of the failover group. -// parameters - the failover group parameters. -func (client FailoverGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string, parameters FailoverGroup) (result FailoverGroupsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FailoverGroupsClient.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.FailoverGroupProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.FailoverGroupProperties.ReadWriteEndpoint", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.FailoverGroupProperties.PartnerServers", Name: validation.Null, Rule: true, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("sql.FailoverGroupsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, failoverGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.FailoverGroupsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.FailoverGroupsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client FailoverGroupsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string, parameters FailoverGroup) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "failoverGroupName": autorest.Encode("path", failoverGroupName), - "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, - } - - parameters.Location = 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.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}", 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 FailoverGroupsClient) CreateOrUpdateSender(req *http.Request) (future FailoverGroupsCreateOrUpdateFuture, 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 FailoverGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result FailoverGroup, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a failover group. -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -// serverName - the name of the server containing the failover group. -// failoverGroupName - the name of the failover group. -func (client FailoverGroupsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string) (result FailoverGroupsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FailoverGroupsClient.Delete") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, failoverGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.FailoverGroupsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.FailoverGroupsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client FailoverGroupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "failoverGroupName": autorest.Encode("path", failoverGroupName), - "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.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}", 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 FailoverGroupsClient) DeleteSender(req *http.Request) (future FailoverGroupsDeleteFuture, 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 FailoverGroupsClient) 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 -} - -// Failover fails over from the current primary server to this 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 containing the failover group. -// failoverGroupName - the name of the failover group. -func (client FailoverGroupsClient) Failover(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string) (result FailoverGroupsFailoverFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FailoverGroupsClient.Failover") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.FailoverPreparer(ctx, resourceGroupName, serverName, failoverGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.FailoverGroupsClient", "Failover", nil, "Failure preparing request") - return - } - - result, err = client.FailoverSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.FailoverGroupsClient", "Failover", result.Response(), "Failure sending request") - return - } - - return -} - -// FailoverPreparer prepares the Failover request. -func (client FailoverGroupsClient) FailoverPreparer(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "failoverGroupName": autorest.Encode("path", failoverGroupName), - "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.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/failover", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// FailoverSender sends the Failover request. The method will close the -// http.Response Body if it receives an error. -func (client FailoverGroupsClient) FailoverSender(req *http.Request) (future FailoverGroupsFailoverFuture, 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 -} - -// FailoverResponder handles the response to the Failover request. The method always -// closes the http.Response Body. -func (client FailoverGroupsClient) FailoverResponder(resp *http.Response) (result FailoverGroup, 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 -} - -// ForceFailoverAllowDataLoss fails over from the current primary server to this server. This operation might result in -// data loss. -// 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 containing the failover group. -// failoverGroupName - the name of the failover group. -func (client FailoverGroupsClient) ForceFailoverAllowDataLoss(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string) (result FailoverGroupsForceFailoverAllowDataLossFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FailoverGroupsClient.ForceFailoverAllowDataLoss") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ForceFailoverAllowDataLossPreparer(ctx, resourceGroupName, serverName, failoverGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.FailoverGroupsClient", "ForceFailoverAllowDataLoss", nil, "Failure preparing request") - return - } - - result, err = client.ForceFailoverAllowDataLossSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.FailoverGroupsClient", "ForceFailoverAllowDataLoss", result.Response(), "Failure sending request") - return - } - - return -} - -// ForceFailoverAllowDataLossPreparer prepares the ForceFailoverAllowDataLoss request. -func (client FailoverGroupsClient) ForceFailoverAllowDataLossPreparer(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "failoverGroupName": autorest.Encode("path", failoverGroupName), - "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.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ForceFailoverAllowDataLossSender sends the ForceFailoverAllowDataLoss request. The method will close the -// http.Response Body if it receives an error. -func (client FailoverGroupsClient) ForceFailoverAllowDataLossSender(req *http.Request) (future FailoverGroupsForceFailoverAllowDataLossFuture, 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 -} - -// ForceFailoverAllowDataLossResponder handles the response to the ForceFailoverAllowDataLoss request. The method always -// closes the http.Response Body. -func (client FailoverGroupsClient) ForceFailoverAllowDataLossResponder(resp *http.Response) (result FailoverGroup, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get gets a failover group. -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -// serverName - the name of the server containing the failover group. -// failoverGroupName - the name of the failover group. -func (client FailoverGroupsClient) Get(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string) (result FailoverGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FailoverGroupsClient.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, serverName, failoverGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.FailoverGroupsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.FailoverGroupsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.FailoverGroupsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client FailoverGroupsClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "failoverGroupName": autorest.Encode("path", failoverGroupName), - "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}/failoverGroups/{failoverGroupName}", 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 FailoverGroupsClient) 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 FailoverGroupsClient) GetResponder(resp *http.Response) (result FailoverGroup, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByServer lists the failover groups in 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 containing the failover group. -func (client FailoverGroupsClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result FailoverGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FailoverGroupsClient.ListByServer") - defer func() { - sc := -1 - if result.fglr.Response.Response != nil { - sc = result.fglr.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.FailoverGroupsClient", "ListByServer", nil, "Failure preparing request") - return - } - - resp, err := client.ListByServerSender(req) - if err != nil { - result.fglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.FailoverGroupsClient", "ListByServer", resp, "Failure sending request") - return - } - - result.fglr, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.FailoverGroupsClient", "ListByServer", resp, "Failure responding to request") - } - - return -} - -// ListByServerPreparer prepares the ListByServer request. -func (client FailoverGroupsClient) 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 = "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}/failoverGroups", 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 FailoverGroupsClient) 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 FailoverGroupsClient) ListByServerResponder(resp *http.Response) (result FailoverGroupListResult, 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 FailoverGroupsClient) listByServerNextResults(ctx context.Context, lastResults FailoverGroupListResult) (result FailoverGroupListResult, err error) { - req, err := lastResults.failoverGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.FailoverGroupsClient", "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.FailoverGroupsClient", "listByServerNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.FailoverGroupsClient", "listByServerNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByServerComplete enumerates all values, automatically crossing page boundaries as required. -func (client FailoverGroupsClient) ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string) (result FailoverGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FailoverGroupsClient.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 -} - -// Update updates a failover group. -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -// serverName - the name of the server containing the failover group. -// failoverGroupName - the name of the failover group. -// parameters - the failover group parameters. -func (client FailoverGroupsClient) Update(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string, parameters FailoverGroupUpdate) (result FailoverGroupsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FailoverGroupsClient.Update") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, serverName, failoverGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.FailoverGroupsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.FailoverGroupsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client FailoverGroupsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string, parameters FailoverGroupUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "failoverGroupName": autorest.Encode("path", failoverGroupName), - "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.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}", 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 FailoverGroupsClient) UpdateSender(req *http.Request) (future FailoverGroupsUpdateFuture, 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 FailoverGroupsClient) UpdateResponder(resp *http.Response) (result FailoverGroup, 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/sql/mgmt/2018-06-15-preview/sql/instancefailovergroups.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/instancefailovergroups.go deleted file mode 100644 index aa0e99af9af5..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/instancefailovergroups.go +++ /dev/null @@ -1,573 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the 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" -) - -// InstanceFailoverGroupsClient is the the Azure SQL Database management API provides a RESTful set of web services -// that interact with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, -// update, and delete databases. -type InstanceFailoverGroupsClient struct { - BaseClient -} - -// NewInstanceFailoverGroupsClient creates an instance of the InstanceFailoverGroupsClient client. -func NewInstanceFailoverGroupsClient(subscriptionID string) InstanceFailoverGroupsClient { - return NewInstanceFailoverGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewInstanceFailoverGroupsClientWithBaseURI creates an instance of the InstanceFailoverGroupsClient client. -func NewInstanceFailoverGroupsClientWithBaseURI(baseURI string, subscriptionID string) InstanceFailoverGroupsClient { - return InstanceFailoverGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a failover group. -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -// locationName - the name of the region where the resource is located. -// failoverGroupName - the name of the failover group. -// parameters - the failover group parameters. -func (client InstanceFailoverGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, locationName string, failoverGroupName string, parameters InstanceFailoverGroup) (result InstanceFailoverGroupsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InstanceFailoverGroupsClient.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.InstanceFailoverGroupProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.InstanceFailoverGroupProperties.ReadWriteEndpoint", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.InstanceFailoverGroupProperties.PartnerRegions", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.InstanceFailoverGroupProperties.ManagedInstancePairs", Name: validation.Null, Rule: true, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("sql.InstanceFailoverGroupsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, locationName, failoverGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client InstanceFailoverGroupsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, locationName string, failoverGroupName string, parameters InstanceFailoverGroup) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "failoverGroupName": autorest.Encode("path", failoverGroupName), - "locationName": autorest.Encode("path", locationName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-10-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.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}", 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 InstanceFailoverGroupsClient) CreateOrUpdateSender(req *http.Request) (future InstanceFailoverGroupsCreateOrUpdateFuture, 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 InstanceFailoverGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result InstanceFailoverGroup, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a failover group. -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -// locationName - the name of the region where the resource is located. -// failoverGroupName - the name of the failover group. -func (client InstanceFailoverGroupsClient) Delete(ctx context.Context, resourceGroupName string, locationName string, failoverGroupName string) (result InstanceFailoverGroupsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InstanceFailoverGroupsClient.Delete") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, locationName, failoverGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client InstanceFailoverGroupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, locationName string, failoverGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "failoverGroupName": autorest.Encode("path", failoverGroupName), - "locationName": autorest.Encode("path", locationName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-10-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.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}", 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 InstanceFailoverGroupsClient) DeleteSender(req *http.Request) (future InstanceFailoverGroupsDeleteFuture, 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 InstanceFailoverGroupsClient) 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 -} - -// Failover fails over from the current primary managed instance to this managed instance. -// 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. -// locationName - the name of the region where the resource is located. -// failoverGroupName - the name of the failover group. -func (client InstanceFailoverGroupsClient) Failover(ctx context.Context, resourceGroupName string, locationName string, failoverGroupName string) (result InstanceFailoverGroupsFailoverFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InstanceFailoverGroupsClient.Failover") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.FailoverPreparer(ctx, resourceGroupName, locationName, failoverGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsClient", "Failover", nil, "Failure preparing request") - return - } - - result, err = client.FailoverSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsClient", "Failover", result.Response(), "Failure sending request") - return - } - - return -} - -// FailoverPreparer prepares the Failover request. -func (client InstanceFailoverGroupsClient) FailoverPreparer(ctx context.Context, resourceGroupName string, locationName string, failoverGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "failoverGroupName": autorest.Encode("path", failoverGroupName), - "locationName": autorest.Encode("path", locationName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-10-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.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/failover", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// FailoverSender sends the Failover request. The method will close the -// http.Response Body if it receives an error. -func (client InstanceFailoverGroupsClient) FailoverSender(req *http.Request) (future InstanceFailoverGroupsFailoverFuture, 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 -} - -// FailoverResponder handles the response to the Failover request. The method always -// closes the http.Response Body. -func (client InstanceFailoverGroupsClient) FailoverResponder(resp *http.Response) (result InstanceFailoverGroup, 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 -} - -// ForceFailoverAllowDataLoss fails over from the current primary managed instance to this managed instance. This -// operation might result in data loss. -// 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. -// locationName - the name of the region where the resource is located. -// failoverGroupName - the name of the failover group. -func (client InstanceFailoverGroupsClient) ForceFailoverAllowDataLoss(ctx context.Context, resourceGroupName string, locationName string, failoverGroupName string) (result InstanceFailoverGroupsForceFailoverAllowDataLossFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InstanceFailoverGroupsClient.ForceFailoverAllowDataLoss") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ForceFailoverAllowDataLossPreparer(ctx, resourceGroupName, locationName, failoverGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsClient", "ForceFailoverAllowDataLoss", nil, "Failure preparing request") - return - } - - result, err = client.ForceFailoverAllowDataLossSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsClient", "ForceFailoverAllowDataLoss", result.Response(), "Failure sending request") - return - } - - return -} - -// ForceFailoverAllowDataLossPreparer prepares the ForceFailoverAllowDataLoss request. -func (client InstanceFailoverGroupsClient) ForceFailoverAllowDataLossPreparer(ctx context.Context, resourceGroupName string, locationName string, failoverGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "failoverGroupName": autorest.Encode("path", failoverGroupName), - "locationName": autorest.Encode("path", locationName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-10-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.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ForceFailoverAllowDataLossSender sends the ForceFailoverAllowDataLoss request. The method will close the -// http.Response Body if it receives an error. -func (client InstanceFailoverGroupsClient) ForceFailoverAllowDataLossSender(req *http.Request) (future InstanceFailoverGroupsForceFailoverAllowDataLossFuture, 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 -} - -// ForceFailoverAllowDataLossResponder handles the response to the ForceFailoverAllowDataLoss request. The method always -// closes the http.Response Body. -func (client InstanceFailoverGroupsClient) ForceFailoverAllowDataLossResponder(resp *http.Response) (result InstanceFailoverGroup, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get gets a failover group. -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -// locationName - the name of the region where the resource is located. -// failoverGroupName - the name of the failover group. -func (client InstanceFailoverGroupsClient) Get(ctx context.Context, resourceGroupName string, locationName string, failoverGroupName string) (result InstanceFailoverGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InstanceFailoverGroupsClient.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, locationName, failoverGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client InstanceFailoverGroupsClient) GetPreparer(ctx context.Context, resourceGroupName string, locationName string, failoverGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "failoverGroupName": autorest.Encode("path", failoverGroupName), - "locationName": autorest.Encode("path", locationName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-10-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/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}", 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 InstanceFailoverGroupsClient) 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 InstanceFailoverGroupsClient) GetResponder(resp *http.Response) (result InstanceFailoverGroup, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByLocation lists the failover groups in a location. -// 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. -// locationName - the name of the region where the resource is located. -func (client InstanceFailoverGroupsClient) ListByLocation(ctx context.Context, resourceGroupName string, locationName string) (result InstanceFailoverGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InstanceFailoverGroupsClient.ListByLocation") - defer func() { - sc := -1 - if result.ifglr.Response.Response != nil { - sc = result.ifglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByLocationNextResults - req, err := client.ListByLocationPreparer(ctx, resourceGroupName, locationName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsClient", "ListByLocation", nil, "Failure preparing request") - return - } - - resp, err := client.ListByLocationSender(req) - if err != nil { - result.ifglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsClient", "ListByLocation", resp, "Failure sending request") - return - } - - result.ifglr, err = client.ListByLocationResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsClient", "ListByLocation", resp, "Failure responding to request") - } - - return -} - -// ListByLocationPreparer prepares the ListByLocation request. -func (client InstanceFailoverGroupsClient) ListByLocationPreparer(ctx context.Context, resourceGroupName string, locationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "locationName": autorest.Encode("path", locationName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-10-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/locations/{locationName}/instanceFailoverGroups", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByLocationSender sends the ListByLocation request. The method will close the -// http.Response Body if it receives an error. -func (client InstanceFailoverGroupsClient) ListByLocationSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByLocationResponder handles the response to the ListByLocation request. The method always -// closes the http.Response Body. -func (client InstanceFailoverGroupsClient) ListByLocationResponder(resp *http.Response) (result InstanceFailoverGroupListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByLocationNextResults retrieves the next set of results, if any. -func (client InstanceFailoverGroupsClient) listByLocationNextResults(ctx context.Context, lastResults InstanceFailoverGroupListResult) (result InstanceFailoverGroupListResult, err error) { - req, err := lastResults.instanceFailoverGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsClient", "listByLocationNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByLocationSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsClient", "listByLocationNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByLocationResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsClient", "listByLocationNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByLocationComplete enumerates all values, automatically crossing page boundaries as required. -func (client InstanceFailoverGroupsClient) ListByLocationComplete(ctx context.Context, resourceGroupName string, locationName string) (result InstanceFailoverGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InstanceFailoverGroupsClient.ListByLocation") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByLocation(ctx, resourceGroupName, locationName) - return -} diff --git a/services/preview/sql/mgmt/2018-06-15-preview/sql/instancepools.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/instancepools.go deleted file mode 100644 index 5e6cddb41eec..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/instancepools.go +++ /dev/null @@ -1,596 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the 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" -) - -// InstancePoolsClient is the the Azure SQL Database management API provides a RESTful set of web services that -// interact with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, -// and delete databases. -type InstancePoolsClient struct { - BaseClient -} - -// NewInstancePoolsClient creates an instance of the InstancePoolsClient client. -func NewInstancePoolsClient(subscriptionID string) InstancePoolsClient { - return NewInstancePoolsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewInstancePoolsClientWithBaseURI creates an instance of the InstancePoolsClient client. -func NewInstancePoolsClientWithBaseURI(baseURI string, subscriptionID string) InstancePoolsClient { - return InstancePoolsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates an instance pool. -// 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. -// instancePoolName - the name of the instance pool to be created or updated. -// parameters - the requested instance pool resource state. -func (client InstancePoolsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, instancePoolName string, parameters InstancePool) (result InstancePoolsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InstancePoolsClient.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: false, - Chain: []validation.Constraint{{Target: "parameters.Sku.Name", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "parameters.InstancePoolProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.InstancePoolProperties.SubnetID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.InstancePoolProperties.VCores", Name: validation.Null, Rule: true, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("sql.InstancePoolsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, instancePoolName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.InstancePoolsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.InstancePoolsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client InstancePoolsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, instancePoolName string, parameters InstancePool) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instancePoolName": autorest.Encode("path", instancePoolName), - "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.Sql/instancePools/{instancePoolName}", 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 InstancePoolsClient) CreateOrUpdateSender(req *http.Request) (future InstancePoolsCreateOrUpdateFuture, 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 InstancePoolsClient) CreateOrUpdateResponder(resp *http.Response) (result InstancePool, 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 instance pool -// 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. -// instancePoolName - the name of the instance pool to be deleted -func (client InstancePoolsClient) Delete(ctx context.Context, resourceGroupName string, instancePoolName string) (result InstancePoolsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InstancePoolsClient.Delete") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, instancePoolName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.InstancePoolsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.InstancePoolsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client InstancePoolsClient) DeletePreparer(ctx context.Context, resourceGroupName string, instancePoolName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instancePoolName": autorest.Encode("path", instancePoolName), - "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.Sql/instancePools/{instancePoolName}", 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 InstancePoolsClient) DeleteSender(req *http.Request) (future InstancePoolsDeleteFuture, 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 InstancePoolsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets an instance pool. -// 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. -// instancePoolName - the name of the instance pool to be retrieved. -func (client InstancePoolsClient) Get(ctx context.Context, resourceGroupName string, instancePoolName string) (result InstancePool, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InstancePoolsClient.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, instancePoolName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.InstancePoolsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.InstancePoolsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.InstancePoolsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client InstancePoolsClient) GetPreparer(ctx context.Context, resourceGroupName string, instancePoolName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instancePoolName": autorest.Encode("path", instancePoolName), - "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.Sql/instancePools/{instancePoolName}", 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 InstancePoolsClient) 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 InstancePoolsClient) GetResponder(resp *http.Response) (result InstancePool, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets a list of all instance pools in the subscription. -func (client InstancePoolsClient) List(ctx context.Context) (result InstancePoolListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InstancePoolsClient.List") - defer func() { - sc := -1 - if result.iplr.Response.Response != nil { - sc = result.iplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.InstancePoolsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.iplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.InstancePoolsClient", "List", resp, "Failure sending request") - return - } - - result.iplr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.InstancePoolsClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client InstancePoolsClient) 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.Sql/instancePools", 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 InstancePoolsClient) 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 InstancePoolsClient) ListResponder(resp *http.Response) (result InstancePoolListResult, 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 InstancePoolsClient) listNextResults(ctx context.Context, lastResults InstancePoolListResult) (result InstancePoolListResult, err error) { - req, err := lastResults.instancePoolListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.InstancePoolsClient", "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, "sql.InstancePoolsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.InstancePoolsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client InstancePoolsClient) ListComplete(ctx context.Context) (result InstancePoolListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InstancePoolsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup gets a list of instance pools in the resource group -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -func (client InstancePoolsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result InstancePoolListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InstancePoolsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.iplr.Response.Response != nil { - sc = result.iplr.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, "sql.InstancePoolsClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.iplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.InstancePoolsClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.iplr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.InstancePoolsClient", "ListByResourceGroup", resp, "Failure responding to request") - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client InstancePoolsClient) 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.Sql/instancePools", 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 InstancePoolsClient) 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 InstancePoolsClient) ListByResourceGroupResponder(resp *http.Response) (result InstancePoolListResult, 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 InstancePoolsClient) listByResourceGroupNextResults(ctx context.Context, lastResults InstancePoolListResult) (result InstancePoolListResult, err error) { - req, err := lastResults.instancePoolListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.InstancePoolsClient", "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, "sql.InstancePoolsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.InstancePoolsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client InstancePoolsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result InstancePoolListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InstancePoolsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// Update updates an instance pool. -// 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. -// instancePoolName - the name of the instance pool to be updated. -// parameters - the requested instance pool resource state. -func (client InstancePoolsClient) Update(ctx context.Context, resourceGroupName string, instancePoolName string, parameters InstancePoolUpdate) (result InstancePoolsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InstancePoolsClient.Update") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, instancePoolName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.InstancePoolsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.InstancePoolsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client InstancePoolsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, instancePoolName string, parameters InstancePoolUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instancePoolName": autorest.Encode("path", instancePoolName), - "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.Sql/instancePools/{instancePoolName}", 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 InstancePoolsClient) UpdateSender(req *http.Request) (future InstancePoolsUpdateFuture, 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 InstancePoolsClient) UpdateResponder(resp *http.Response) (result InstancePool, 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/sql/mgmt/2018-06-15-preview/sql/jobagents.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/jobagents.go deleted file mode 100644 index ee60e7d85f2e..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/jobagents.go +++ /dev/null @@ -1,494 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the 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" -) - -// JobAgentsClient is the the Azure SQL Database management API provides a RESTful set of web services that interact -// with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, and -// delete databases. -type JobAgentsClient struct { - BaseClient -} - -// NewJobAgentsClient creates an instance of the JobAgentsClient client. -func NewJobAgentsClient(subscriptionID string) JobAgentsClient { - return NewJobAgentsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewJobAgentsClientWithBaseURI creates an instance of the JobAgentsClient client. -func NewJobAgentsClientWithBaseURI(baseURI string, subscriptionID string) JobAgentsClient { - return JobAgentsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a job agent. -// 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. -// jobAgentName - the name of the job agent to be created or updated. -// parameters - the requested job agent resource state. -func (client JobAgentsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, parameters JobAgent) (result JobAgentsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobAgentsClient.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: false, - Chain: []validation.Constraint{{Target: "parameters.Sku.Name", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "parameters.JobAgentProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.JobAgentProperties.DatabaseID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("sql.JobAgentsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, jobAgentName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobAgentsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobAgentsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client JobAgentsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, parameters JobAgent) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobAgentName": autorest.Encode("path", jobAgentName), - "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.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}", 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 JobAgentsClient) CreateOrUpdateSender(req *http.Request) (future JobAgentsCreateOrUpdateFuture, 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 JobAgentsClient) CreateOrUpdateResponder(resp *http.Response) (result JobAgent, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a job agent. -// 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. -// jobAgentName - the name of the job agent to be deleted. -func (client JobAgentsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string) (result JobAgentsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobAgentsClient.Delete") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, jobAgentName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobAgentsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobAgentsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client JobAgentsClient) DeletePreparer(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobAgentName": autorest.Encode("path", jobAgentName), - "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.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}", 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 JobAgentsClient) DeleteSender(req *http.Request) (future JobAgentsDeleteFuture, 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 JobAgentsClient) 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 job agent. -// 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. -// jobAgentName - the name of the job agent to be retrieved. -func (client JobAgentsClient) Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string) (result JobAgent, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobAgentsClient.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, serverName, jobAgentName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobAgentsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.JobAgentsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobAgentsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client JobAgentsClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobAgentName": autorest.Encode("path", jobAgentName), - "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}/jobAgents/{jobAgentName}", 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 JobAgentsClient) 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 JobAgentsClient) GetResponder(resp *http.Response) (result JobAgent, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByServer gets a list of job agents in 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 JobAgentsClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result JobAgentListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobAgentsClient.ListByServer") - defer func() { - sc := -1 - if result.jalr.Response.Response != nil { - sc = result.jalr.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.JobAgentsClient", "ListByServer", nil, "Failure preparing request") - return - } - - resp, err := client.ListByServerSender(req) - if err != nil { - result.jalr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.JobAgentsClient", "ListByServer", resp, "Failure sending request") - return - } - - result.jalr, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobAgentsClient", "ListByServer", resp, "Failure responding to request") - } - - return -} - -// ListByServerPreparer prepares the ListByServer request. -func (client JobAgentsClient) 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}/jobAgents", 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 JobAgentsClient) 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 JobAgentsClient) ListByServerResponder(resp *http.Response) (result JobAgentListResult, 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 JobAgentsClient) listByServerNextResults(ctx context.Context, lastResults JobAgentListResult) (result JobAgentListResult, err error) { - req, err := lastResults.jobAgentListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.JobAgentsClient", "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.JobAgentsClient", "listByServerNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobAgentsClient", "listByServerNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByServerComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobAgentsClient) ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string) (result JobAgentListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobAgentsClient.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 -} - -// Update updates a job agent. -// 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. -// jobAgentName - the name of the job agent to be updated. -// parameters - the update to the job agent. -func (client JobAgentsClient) Update(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, parameters JobAgentUpdate) (result JobAgentsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobAgentsClient.Update") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, serverName, jobAgentName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobAgentsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobAgentsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client JobAgentsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, parameters JobAgentUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobAgentName": autorest.Encode("path", jobAgentName), - "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.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}", 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 JobAgentsClient) UpdateSender(req *http.Request) (future JobAgentsUpdateFuture, 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 JobAgentsClient) UpdateResponder(resp *http.Response) (result JobAgent, 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/sql/mgmt/2018-06-15-preview/sql/jobcredentials.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/jobcredentials.go deleted file mode 100644 index 684e3d528af6..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/jobcredentials.go +++ /dev/null @@ -1,419 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the 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" -) - -// JobCredentialsClient is the the Azure SQL Database management API provides a RESTful set of web services that -// interact with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, -// and delete databases. -type JobCredentialsClient struct { - BaseClient -} - -// NewJobCredentialsClient creates an instance of the JobCredentialsClient client. -func NewJobCredentialsClient(subscriptionID string) JobCredentialsClient { - return NewJobCredentialsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewJobCredentialsClientWithBaseURI creates an instance of the JobCredentialsClient client. -func NewJobCredentialsClientWithBaseURI(baseURI string, subscriptionID string) JobCredentialsClient { - return JobCredentialsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a job credential. -// 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. -// jobAgentName - the name of the job agent. -// credentialName - the name of the credential. -// parameters - the requested job credential state. -func (client JobCredentialsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, credentialName string, parameters JobCredential) (result JobCredential, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobCredentialsClient.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: parameters, - Constraints: []validation.Constraint{{Target: "parameters.JobCredentialProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.JobCredentialProperties.Username", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.JobCredentialProperties.Password", Name: validation.Null, Rule: true, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("sql.JobCredentialsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, jobAgentName, credentialName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobCredentialsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.JobCredentialsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobCredentialsClient", "CreateOrUpdate", resp, "Failure responding to request") - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client JobCredentialsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, credentialName string, parameters JobCredential) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "credentialName": autorest.Encode("path", credentialName), - "jobAgentName": autorest.Encode("path", jobAgentName), - "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.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials/{credentialName}", 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 JobCredentialsClient) 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 JobCredentialsClient) CreateOrUpdateResponder(resp *http.Response) (result JobCredential, 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 job credential. -// 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. -// jobAgentName - the name of the job agent. -// credentialName - the name of the credential. -func (client JobCredentialsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, credentialName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobCredentialsClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, jobAgentName, credentialName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobCredentialsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "sql.JobCredentialsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobCredentialsClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client JobCredentialsClient) DeletePreparer(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, credentialName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "credentialName": autorest.Encode("path", credentialName), - "jobAgentName": autorest.Encode("path", jobAgentName), - "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.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials/{credentialName}", 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 JobCredentialsClient) 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 JobCredentialsClient) 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 jobs credential. -// 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. -// jobAgentName - the name of the job agent. -// credentialName - the name of the credential. -func (client JobCredentialsClient) Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, credentialName string) (result JobCredential, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobCredentialsClient.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, serverName, jobAgentName, credentialName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobCredentialsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.JobCredentialsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobCredentialsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client JobCredentialsClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, credentialName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "credentialName": autorest.Encode("path", credentialName), - "jobAgentName": autorest.Encode("path", jobAgentName), - "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}/jobAgents/{jobAgentName}/credentials/{credentialName}", 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 JobCredentialsClient) 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 JobCredentialsClient) GetResponder(resp *http.Response) (result JobCredential, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByAgent gets a list of jobs credentials. -// 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. -// jobAgentName - the name of the job agent. -func (client JobCredentialsClient) ListByAgent(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string) (result JobCredentialListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobCredentialsClient.ListByAgent") - defer func() { - sc := -1 - if result.jclr.Response.Response != nil { - sc = result.jclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByAgentNextResults - req, err := client.ListByAgentPreparer(ctx, resourceGroupName, serverName, jobAgentName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobCredentialsClient", "ListByAgent", nil, "Failure preparing request") - return - } - - resp, err := client.ListByAgentSender(req) - if err != nil { - result.jclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.JobCredentialsClient", "ListByAgent", resp, "Failure sending request") - return - } - - result.jclr, err = client.ListByAgentResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobCredentialsClient", "ListByAgent", resp, "Failure responding to request") - } - - return -} - -// ListByAgentPreparer prepares the ListByAgent request. -func (client JobCredentialsClient) ListByAgentPreparer(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobAgentName": autorest.Encode("path", jobAgentName), - "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}/jobAgents/{jobAgentName}/credentials", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByAgentSender sends the ListByAgent request. The method will close the -// http.Response Body if it receives an error. -func (client JobCredentialsClient) ListByAgentSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByAgentResponder handles the response to the ListByAgent request. The method always -// closes the http.Response Body. -func (client JobCredentialsClient) ListByAgentResponder(resp *http.Response) (result JobCredentialListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByAgentNextResults retrieves the next set of results, if any. -func (client JobCredentialsClient) listByAgentNextResults(ctx context.Context, lastResults JobCredentialListResult) (result JobCredentialListResult, err error) { - req, err := lastResults.jobCredentialListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.JobCredentialsClient", "listByAgentNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByAgentSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "sql.JobCredentialsClient", "listByAgentNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByAgentResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobCredentialsClient", "listByAgentNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByAgentComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobCredentialsClient) ListByAgentComplete(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string) (result JobCredentialListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobCredentialsClient.ListByAgent") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByAgent(ctx, resourceGroupName, serverName, jobAgentName) - return -} diff --git a/services/preview/sql/mgmt/2018-06-15-preview/sql/jobexecutions.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/jobexecutions.go deleted file mode 100644 index eb0535c6f24a..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/jobexecutions.go +++ /dev/null @@ -1,672 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the 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/tracing" - "github.com/satori/go.uuid" - "net/http" -) - -// JobExecutionsClient is the the Azure SQL Database management API provides a RESTful set of web services that -// interact with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, -// and delete databases. -type JobExecutionsClient struct { - BaseClient -} - -// NewJobExecutionsClient creates an instance of the JobExecutionsClient client. -func NewJobExecutionsClient(subscriptionID string) JobExecutionsClient { - return NewJobExecutionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewJobExecutionsClientWithBaseURI creates an instance of the JobExecutionsClient client. -func NewJobExecutionsClientWithBaseURI(baseURI string, subscriptionID string) JobExecutionsClient { - return JobExecutionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Cancel requests cancellation of a job execution. -// 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. -// jobAgentName - the name of the job agent. -// jobName - the name of the job. -// jobExecutionID - the id of the job execution to cancel. -func (client JobExecutionsClient) Cancel(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID uuid.UUID) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobExecutionsClient.Cancel") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CancelPreparer(ctx, resourceGroupName, serverName, jobAgentName, jobName, jobExecutionID) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobExecutionsClient", "Cancel", nil, "Failure preparing request") - return - } - - resp, err := client.CancelSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "sql.JobExecutionsClient", "Cancel", resp, "Failure sending request") - return - } - - result, err = client.CancelResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobExecutionsClient", "Cancel", resp, "Failure responding to request") - } - - return -} - -// CancelPreparer prepares the Cancel request. -func (client JobExecutionsClient) CancelPreparer(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID uuid.UUID) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobAgentName": autorest.Encode("path", jobAgentName), - "jobExecutionId": autorest.Encode("path", jobExecutionID), - "jobName": autorest.Encode("path", jobName), - "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.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/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 JobExecutionsClient) 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 JobExecutionsClient) 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 -} - -// Create starts an elastic job execution. -// 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. -// jobAgentName - the name of the job agent. -// jobName - the name of the job to get. -func (client JobExecutionsClient) Create(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string) (result JobExecutionsCreateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobExecutionsClient.Create") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreatePreparer(ctx, resourceGroupName, serverName, jobAgentName, jobName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobExecutionsClient", "Create", nil, "Failure preparing request") - return - } - - result, err = client.CreateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobExecutionsClient", "Create", result.Response(), "Failure sending request") - return - } - - return -} - -// CreatePreparer prepares the Create request. -func (client JobExecutionsClient) CreatePreparer(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobAgentName": autorest.Encode("path", jobAgentName), - "jobName": autorest.Encode("path", jobName), - "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.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/start", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateSender sends the Create request. The method will close the -// http.Response Body if it receives an error. -func (client JobExecutionsClient) CreateSender(req *http.Request) (future JobExecutionsCreateFuture, 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 JobExecutionsClient) CreateResponder(resp *http.Response) (result JobExecution, 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 -} - -// CreateOrUpdate creates or updates a job execution. -// 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. -// jobAgentName - the name of the job agent. -// jobName - the name of the job to get. -// jobExecutionID - the job execution id to create the job execution under. -func (client JobExecutionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID uuid.UUID) (result JobExecutionsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobExecutionsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, jobAgentName, jobName, jobExecutionID) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobExecutionsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobExecutionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client JobExecutionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID uuid.UUID) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobAgentName": autorest.Encode("path", jobAgentName), - "jobExecutionId": autorest.Encode("path", jobExecutionID), - "jobName": autorest.Encode("path", jobName), - "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.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}", 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 JobExecutionsClient) CreateOrUpdateSender(req *http.Request) (future JobExecutionsCreateOrUpdateFuture, 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 JobExecutionsClient) CreateOrUpdateResponder(resp *http.Response) (result JobExecution, 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 gets a job execution. -// 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. -// jobAgentName - the name of the job agent. -// jobName - the name of the job. -// jobExecutionID - the id of the job execution -func (client JobExecutionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID uuid.UUID) (result JobExecution, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobExecutionsClient.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, serverName, jobAgentName, jobName, jobExecutionID) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobExecutionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.JobExecutionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobExecutionsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client JobExecutionsClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID uuid.UUID) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobAgentName": autorest.Encode("path", jobAgentName), - "jobExecutionId": autorest.Encode("path", jobExecutionID), - "jobName": autorest.Encode("path", jobName), - "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}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}", 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 JobExecutionsClient) 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 JobExecutionsClient) GetResponder(resp *http.Response) (result JobExecution, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByAgent lists all executions in a job agent. -// 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. -// jobAgentName - the name of the job agent. -// createTimeMin - if specified, only job executions created at or after the specified time are included. -// createTimeMax - if specified, only job executions created before the specified time are included. -// endTimeMin - if specified, only job executions completed at or after the specified time are included. -// endTimeMax - if specified, only job executions completed before the specified time are included. -// isActive - if specified, only active or only completed job executions are included. -// skip - the number of elements in the collection to skip. -// top - the number of elements to return from the collection. -func (client JobExecutionsClient) ListByAgent(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, createTimeMin *date.Time, createTimeMax *date.Time, endTimeMin *date.Time, endTimeMax *date.Time, isActive *bool, skip *int32, top *int32) (result JobExecutionListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobExecutionsClient.ListByAgent") - defer func() { - sc := -1 - if result.jelr.Response.Response != nil { - sc = result.jelr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByAgentNextResults - req, err := client.ListByAgentPreparer(ctx, resourceGroupName, serverName, jobAgentName, createTimeMin, createTimeMax, endTimeMin, endTimeMax, isActive, skip, top) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobExecutionsClient", "ListByAgent", nil, "Failure preparing request") - return - } - - resp, err := client.ListByAgentSender(req) - if err != nil { - result.jelr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.JobExecutionsClient", "ListByAgent", resp, "Failure sending request") - return - } - - result.jelr, err = client.ListByAgentResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobExecutionsClient", "ListByAgent", resp, "Failure responding to request") - } - - return -} - -// ListByAgentPreparer prepares the ListByAgent request. -func (client JobExecutionsClient) ListByAgentPreparer(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, createTimeMin *date.Time, createTimeMax *date.Time, endTimeMin *date.Time, endTimeMax *date.Time, isActive *bool, skip *int32, top *int32) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobAgentName": autorest.Encode("path", jobAgentName), - "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, - } - if createTimeMin != nil { - queryParameters["createTimeMin"] = autorest.Encode("query", *createTimeMin) - } - if createTimeMax != nil { - queryParameters["createTimeMax"] = autorest.Encode("query", *createTimeMax) - } - if endTimeMin != nil { - queryParameters["endTimeMin"] = autorest.Encode("query", *endTimeMin) - } - if endTimeMax != nil { - queryParameters["endTimeMax"] = autorest.Encode("query", *endTimeMax) - } - if isActive != nil { - queryParameters["isActive"] = autorest.Encode("query", *isActive) - } - if skip != nil { - queryParameters["$skip"] = autorest.Encode("query", *skip) - } - 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.Sql/servers/{serverName}/jobAgents/{jobAgentName}/executions", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByAgentSender sends the ListByAgent request. The method will close the -// http.Response Body if it receives an error. -func (client JobExecutionsClient) ListByAgentSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByAgentResponder handles the response to the ListByAgent request. The method always -// closes the http.Response Body. -func (client JobExecutionsClient) ListByAgentResponder(resp *http.Response) (result JobExecutionListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByAgentNextResults retrieves the next set of results, if any. -func (client JobExecutionsClient) listByAgentNextResults(ctx context.Context, lastResults JobExecutionListResult) (result JobExecutionListResult, err error) { - req, err := lastResults.jobExecutionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.JobExecutionsClient", "listByAgentNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByAgentSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "sql.JobExecutionsClient", "listByAgentNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByAgentResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobExecutionsClient", "listByAgentNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByAgentComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobExecutionsClient) ListByAgentComplete(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, createTimeMin *date.Time, createTimeMax *date.Time, endTimeMin *date.Time, endTimeMax *date.Time, isActive *bool, skip *int32, top *int32) (result JobExecutionListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobExecutionsClient.ListByAgent") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByAgent(ctx, resourceGroupName, serverName, jobAgentName, createTimeMin, createTimeMax, endTimeMin, endTimeMax, isActive, skip, top) - return -} - -// ListByJob lists a job's executions. -// 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. -// jobAgentName - the name of the job agent. -// jobName - the name of the job to get. -// createTimeMin - if specified, only job executions created at or after the specified time are included. -// createTimeMax - if specified, only job executions created before the specified time are included. -// endTimeMin - if specified, only job executions completed at or after the specified time are included. -// endTimeMax - if specified, only job executions completed before the specified time are included. -// isActive - if specified, only active or only completed job executions are included. -// skip - the number of elements in the collection to skip. -// top - the number of elements to return from the collection. -func (client JobExecutionsClient) ListByJob(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, createTimeMin *date.Time, createTimeMax *date.Time, endTimeMin *date.Time, endTimeMax *date.Time, isActive *bool, skip *int32, top *int32) (result JobExecutionListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobExecutionsClient.ListByJob") - defer func() { - sc := -1 - if result.jelr.Response.Response != nil { - sc = result.jelr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByJobNextResults - req, err := client.ListByJobPreparer(ctx, resourceGroupName, serverName, jobAgentName, jobName, createTimeMin, createTimeMax, endTimeMin, endTimeMax, isActive, skip, top) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobExecutionsClient", "ListByJob", nil, "Failure preparing request") - return - } - - resp, err := client.ListByJobSender(req) - if err != nil { - result.jelr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.JobExecutionsClient", "ListByJob", resp, "Failure sending request") - return - } - - result.jelr, err = client.ListByJobResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobExecutionsClient", "ListByJob", resp, "Failure responding to request") - } - - return -} - -// ListByJobPreparer prepares the ListByJob request. -func (client JobExecutionsClient) ListByJobPreparer(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, createTimeMin *date.Time, createTimeMax *date.Time, endTimeMin *date.Time, endTimeMax *date.Time, isActive *bool, skip *int32, top *int32) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobAgentName": autorest.Encode("path", jobAgentName), - "jobName": autorest.Encode("path", jobName), - "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, - } - if createTimeMin != nil { - queryParameters["createTimeMin"] = autorest.Encode("query", *createTimeMin) - } - if createTimeMax != nil { - queryParameters["createTimeMax"] = autorest.Encode("query", *createTimeMax) - } - if endTimeMin != nil { - queryParameters["endTimeMin"] = autorest.Encode("query", *endTimeMin) - } - if endTimeMax != nil { - queryParameters["endTimeMax"] = autorest.Encode("query", *endTimeMax) - } - if isActive != nil { - queryParameters["isActive"] = autorest.Encode("query", *isActive) - } - if skip != nil { - queryParameters["$skip"] = autorest.Encode("query", *skip) - } - 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.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByJobSender sends the ListByJob request. The method will close the -// http.Response Body if it receives an error. -func (client JobExecutionsClient) ListByJobSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByJobResponder handles the response to the ListByJob request. The method always -// closes the http.Response Body. -func (client JobExecutionsClient) ListByJobResponder(resp *http.Response) (result JobExecutionListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByJobNextResults retrieves the next set of results, if any. -func (client JobExecutionsClient) listByJobNextResults(ctx context.Context, lastResults JobExecutionListResult) (result JobExecutionListResult, err error) { - req, err := lastResults.jobExecutionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.JobExecutionsClient", "listByJobNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByJobSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "sql.JobExecutionsClient", "listByJobNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByJobResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobExecutionsClient", "listByJobNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByJobComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobExecutionsClient) ListByJobComplete(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, createTimeMin *date.Time, createTimeMax *date.Time, endTimeMin *date.Time, endTimeMax *date.Time, isActive *bool, skip *int32, top *int32) (result JobExecutionListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobExecutionsClient.ListByJob") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByJob(ctx, resourceGroupName, serverName, jobAgentName, jobName, createTimeMin, createTimeMax, endTimeMin, endTimeMax, isActive, skip, top) - return -} diff --git a/services/preview/sql/mgmt/2018-06-15-preview/sql/jobs.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/jobs.go deleted file mode 100644 index 2112eef5585f..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/jobs.go +++ /dev/null @@ -1,409 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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 the Azure SQL Database management API provides a RESTful set of web services that interact with -// Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, and delete -// databases. -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)} -} - -// CreateOrUpdate creates or updates a job. -// 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. -// jobAgentName - the name of the job agent. -// jobName - the name of the job to get. -// parameters - the requested job state. -func (client JobsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, parameters Job) (result Job, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobsClient.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, serverName, jobAgentName, jobName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.JobsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobsClient", "CreateOrUpdate", resp, "Failure responding to request") - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client JobsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, parameters Job) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobAgentName": autorest.Encode("path", jobAgentName), - "jobName": autorest.Encode("path", jobName), - "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.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}", 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 JobsClient) 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 JobsClient) CreateOrUpdateResponder(resp *http.Response) (result Job, 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 job. -// 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. -// jobAgentName - the name of the job agent. -// jobName - the name of the job to delete. -func (client JobsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string) (result autorest.Response, 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) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, jobAgentName, jobName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "sql.JobsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobsClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client JobsClient) DeletePreparer(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobAgentName": autorest.Encode("path", jobAgentName), - "jobName": autorest.Encode("path", jobName), - "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.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/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) (*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 JobsClient) 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 job. -// 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. -// jobAgentName - the name of the job agent. -// jobName - the name of the job to get. -func (client JobsClient) Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName 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, resourceGroupName, serverName, jobAgentName, jobName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.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, "sql.JobsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client JobsClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobAgentName": autorest.Encode("path", jobAgentName), - "jobName": autorest.Encode("path", jobName), - "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}/jobAgents/{jobAgentName}/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 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 -} - -// ListByAgent gets a list of jobs. -// 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. -// jobAgentName - the name of the job agent. -func (client JobsClient) ListByAgent(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string) (result JobListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobsClient.ListByAgent") - defer func() { - sc := -1 - if result.jlr.Response.Response != nil { - sc = result.jlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByAgentNextResults - req, err := client.ListByAgentPreparer(ctx, resourceGroupName, serverName, jobAgentName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobsClient", "ListByAgent", nil, "Failure preparing request") - return - } - - resp, err := client.ListByAgentSender(req) - if err != nil { - result.jlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.JobsClient", "ListByAgent", resp, "Failure sending request") - return - } - - result.jlr, err = client.ListByAgentResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobsClient", "ListByAgent", resp, "Failure responding to request") - } - - return -} - -// ListByAgentPreparer prepares the ListByAgent request. -func (client JobsClient) ListByAgentPreparer(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobAgentName": autorest.Encode("path", jobAgentName), - "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}/jobAgents/{jobAgentName}/jobs", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByAgentSender sends the ListByAgent request. The method will close the -// http.Response Body if it receives an error. -func (client JobsClient) ListByAgentSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByAgentResponder handles the response to the ListByAgent request. The method always -// closes the http.Response Body. -func (client JobsClient) ListByAgentResponder(resp *http.Response) (result JobListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByAgentNextResults retrieves the next set of results, if any. -func (client JobsClient) listByAgentNextResults(ctx context.Context, lastResults JobListResult) (result JobListResult, err error) { - req, err := lastResults.jobListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.JobsClient", "listByAgentNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByAgentSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "sql.JobsClient", "listByAgentNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByAgentResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobsClient", "listByAgentNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByAgentComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobsClient) ListByAgentComplete(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string) (result JobListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobsClient.ListByAgent") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByAgent(ctx, resourceGroupName, serverName, jobAgentName) - return -} diff --git a/services/preview/sql/mgmt/2018-06-15-preview/sql/jobstepexecutions.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/jobstepexecutions.go deleted file mode 100644 index 1e12c6aa765c..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/jobstepexecutions.go +++ /dev/null @@ -1,281 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the 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/tracing" - "github.com/satori/go.uuid" - "net/http" -) - -// JobStepExecutionsClient is the the Azure SQL Database management API provides a RESTful set of web services that -// interact with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, -// and delete databases. -type JobStepExecutionsClient struct { - BaseClient -} - -// NewJobStepExecutionsClient creates an instance of the JobStepExecutionsClient client. -func NewJobStepExecutionsClient(subscriptionID string) JobStepExecutionsClient { - return NewJobStepExecutionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewJobStepExecutionsClientWithBaseURI creates an instance of the JobStepExecutionsClient client. -func NewJobStepExecutionsClientWithBaseURI(baseURI string, subscriptionID string) JobStepExecutionsClient { - return JobStepExecutionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets a step execution of a job execution. -// 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. -// jobAgentName - the name of the job agent. -// jobName - the name of the job to get. -// jobExecutionID - the unique id of the job execution -// stepName - the name of the step. -func (client JobStepExecutionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID uuid.UUID, stepName string) (result JobExecution, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobStepExecutionsClient.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, serverName, jobAgentName, jobName, jobExecutionID, stepName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobStepExecutionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.JobStepExecutionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobStepExecutionsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client JobStepExecutionsClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID uuid.UUID, stepName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobAgentName": autorest.Encode("path", jobAgentName), - "jobExecutionId": autorest.Encode("path", jobExecutionID), - "jobName": autorest.Encode("path", jobName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "stepName": autorest.Encode("path", stepName), - "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}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps/{stepName}", 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 JobStepExecutionsClient) 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 JobStepExecutionsClient) GetResponder(resp *http.Response) (result JobExecution, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByJobExecution lists the step executions of a job execution. -// 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. -// jobAgentName - the name of the job agent. -// jobName - the name of the job to get. -// jobExecutionID - the id of the job execution -// createTimeMin - if specified, only job executions created at or after the specified time are included. -// createTimeMax - if specified, only job executions created before the specified time are included. -// endTimeMin - if specified, only job executions completed at or after the specified time are included. -// endTimeMax - if specified, only job executions completed before the specified time are included. -// isActive - if specified, only active or only completed job executions are included. -// skip - the number of elements in the collection to skip. -// top - the number of elements to return from the collection. -func (client JobStepExecutionsClient) ListByJobExecution(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID uuid.UUID, createTimeMin *date.Time, createTimeMax *date.Time, endTimeMin *date.Time, endTimeMax *date.Time, isActive *bool, skip *int32, top *int32) (result JobExecutionListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobStepExecutionsClient.ListByJobExecution") - defer func() { - sc := -1 - if result.jelr.Response.Response != nil { - sc = result.jelr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByJobExecutionNextResults - req, err := client.ListByJobExecutionPreparer(ctx, resourceGroupName, serverName, jobAgentName, jobName, jobExecutionID, createTimeMin, createTimeMax, endTimeMin, endTimeMax, isActive, skip, top) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobStepExecutionsClient", "ListByJobExecution", nil, "Failure preparing request") - return - } - - resp, err := client.ListByJobExecutionSender(req) - if err != nil { - result.jelr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.JobStepExecutionsClient", "ListByJobExecution", resp, "Failure sending request") - return - } - - result.jelr, err = client.ListByJobExecutionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobStepExecutionsClient", "ListByJobExecution", resp, "Failure responding to request") - } - - return -} - -// ListByJobExecutionPreparer prepares the ListByJobExecution request. -func (client JobStepExecutionsClient) ListByJobExecutionPreparer(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID uuid.UUID, createTimeMin *date.Time, createTimeMax *date.Time, endTimeMin *date.Time, endTimeMax *date.Time, isActive *bool, skip *int32, top *int32) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobAgentName": autorest.Encode("path", jobAgentName), - "jobExecutionId": autorest.Encode("path", jobExecutionID), - "jobName": autorest.Encode("path", jobName), - "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, - } - if createTimeMin != nil { - queryParameters["createTimeMin"] = autorest.Encode("query", *createTimeMin) - } - if createTimeMax != nil { - queryParameters["createTimeMax"] = autorest.Encode("query", *createTimeMax) - } - if endTimeMin != nil { - queryParameters["endTimeMin"] = autorest.Encode("query", *endTimeMin) - } - if endTimeMax != nil { - queryParameters["endTimeMax"] = autorest.Encode("query", *endTimeMax) - } - if isActive != nil { - queryParameters["isActive"] = autorest.Encode("query", *isActive) - } - if skip != nil { - queryParameters["$skip"] = autorest.Encode("query", *skip) - } - 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.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByJobExecutionSender sends the ListByJobExecution request. The method will close the -// http.Response Body if it receives an error. -func (client JobStepExecutionsClient) ListByJobExecutionSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByJobExecutionResponder handles the response to the ListByJobExecution request. The method always -// closes the http.Response Body. -func (client JobStepExecutionsClient) ListByJobExecutionResponder(resp *http.Response) (result JobExecutionListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByJobExecutionNextResults retrieves the next set of results, if any. -func (client JobStepExecutionsClient) listByJobExecutionNextResults(ctx context.Context, lastResults JobExecutionListResult) (result JobExecutionListResult, err error) { - req, err := lastResults.jobExecutionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.JobStepExecutionsClient", "listByJobExecutionNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByJobExecutionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "sql.JobStepExecutionsClient", "listByJobExecutionNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByJobExecutionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobStepExecutionsClient", "listByJobExecutionNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByJobExecutionComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobStepExecutionsClient) ListByJobExecutionComplete(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID uuid.UUID, createTimeMin *date.Time, createTimeMax *date.Time, endTimeMin *date.Time, endTimeMax *date.Time, isActive *bool, skip *int32, top *int32) (result JobExecutionListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobStepExecutionsClient.ListByJobExecution") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByJobExecution(ctx, resourceGroupName, serverName, jobAgentName, jobName, jobExecutionID, createTimeMin, createTimeMax, endTimeMin, endTimeMax, isActive, skip, top) - return -} diff --git a/services/preview/sql/mgmt/2018-06-15-preview/sql/jobsteps.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/jobsteps.go deleted file mode 100644 index 15abd56ff2fe..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/jobsteps.go +++ /dev/null @@ -1,643 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the 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" -) - -// JobStepsClient is the the Azure SQL Database management API provides a RESTful set of web services that interact -// with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, and -// delete databases. -type JobStepsClient struct { - BaseClient -} - -// NewJobStepsClient creates an instance of the JobStepsClient client. -func NewJobStepsClient(subscriptionID string) JobStepsClient { - return NewJobStepsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewJobStepsClientWithBaseURI creates an instance of the JobStepsClient client. -func NewJobStepsClientWithBaseURI(baseURI string, subscriptionID string) JobStepsClient { - return JobStepsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a job step. This will implicitly create a new job version. -// 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. -// jobAgentName - the name of the job agent. -// jobName - the name of the job. -// stepName - the name of the job step. -// parameters - the requested state of the job step. -func (client JobStepsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, stepName string, parameters JobStep) (result JobStep, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobStepsClient.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: parameters, - Constraints: []validation.Constraint{{Target: "parameters.JobStepProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.JobStepProperties.TargetGroup", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.JobStepProperties.Credential", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.JobStepProperties.Action", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.JobStepProperties.Action.Value", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "parameters.JobStepProperties.Output", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.JobStepProperties.Output.ServerName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.JobStepProperties.Output.DatabaseName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.JobStepProperties.Output.TableName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.JobStepProperties.Output.Credential", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}}}}); err != nil { - return result, validation.NewError("sql.JobStepsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, jobAgentName, jobName, stepName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobStepsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.JobStepsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobStepsClient", "CreateOrUpdate", resp, "Failure responding to request") - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client JobStepsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, stepName string, parameters JobStep) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobAgentName": autorest.Encode("path", jobAgentName), - "jobName": autorest.Encode("path", jobName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "stepName": autorest.Encode("path", stepName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-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.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}", 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 JobStepsClient) 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 JobStepsClient) CreateOrUpdateResponder(resp *http.Response) (result JobStep, 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 job step. This will implicitly create a new job version. -// 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. -// jobAgentName - the name of the job agent. -// jobName - the name of the job. -// stepName - the name of the job step to delete. -func (client JobStepsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, stepName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobStepsClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, jobAgentName, jobName, stepName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobStepsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "sql.JobStepsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobStepsClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client JobStepsClient) DeletePreparer(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, stepName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobAgentName": autorest.Encode("path", jobAgentName), - "jobName": autorest.Encode("path", jobName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "stepName": autorest.Encode("path", stepName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-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.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}", 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 JobStepsClient) 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 JobStepsClient) 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 job step in a job's current version. -// 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. -// jobAgentName - the name of the job agent. -// jobName - the name of the job. -// stepName - the name of the job step. -func (client JobStepsClient) Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, stepName string) (result JobStep, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobStepsClient.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, serverName, jobAgentName, jobName, stepName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobStepsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.JobStepsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobStepsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client JobStepsClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, stepName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobAgentName": autorest.Encode("path", jobAgentName), - "jobName": autorest.Encode("path", jobName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "stepName": autorest.Encode("path", stepName), - "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}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}", 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 JobStepsClient) 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 JobStepsClient) GetResponder(resp *http.Response) (result JobStep, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetByVersion gets the specified version of a job step. -// 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. -// jobAgentName - the name of the job agent. -// jobName - the name of the job. -// jobVersion - the version of the job to get. -// stepName - the name of the job step. -func (client JobStepsClient) GetByVersion(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobVersion int32, stepName string) (result JobStep, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobStepsClient.GetByVersion") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetByVersionPreparer(ctx, resourceGroupName, serverName, jobAgentName, jobName, jobVersion, stepName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobStepsClient", "GetByVersion", nil, "Failure preparing request") - return - } - - resp, err := client.GetByVersionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.JobStepsClient", "GetByVersion", resp, "Failure sending request") - return - } - - result, err = client.GetByVersionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobStepsClient", "GetByVersion", resp, "Failure responding to request") - } - - return -} - -// GetByVersionPreparer prepares the GetByVersion request. -func (client JobStepsClient) GetByVersionPreparer(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobVersion int32, stepName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobAgentName": autorest.Encode("path", jobAgentName), - "jobName": autorest.Encode("path", jobName), - "jobVersion": autorest.Encode("path", jobVersion), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "stepName": autorest.Encode("path", stepName), - "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}/jobAgents/{jobAgentName}/jobs/{jobName}/versions/{jobVersion}/steps/{stepName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetByVersionSender sends the GetByVersion request. The method will close the -// http.Response Body if it receives an error. -func (client JobStepsClient) GetByVersionSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// GetByVersionResponder handles the response to the GetByVersion request. The method always -// closes the http.Response Body. -func (client JobStepsClient) GetByVersionResponder(resp *http.Response) (result JobStep, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByJob gets all job steps for a job's current version. -// 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. -// jobAgentName - the name of the job agent. -// jobName - the name of the job to get. -func (client JobStepsClient) ListByJob(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string) (result JobStepListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobStepsClient.ListByJob") - defer func() { - sc := -1 - if result.jslr.Response.Response != nil { - sc = result.jslr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByJobNextResults - req, err := client.ListByJobPreparer(ctx, resourceGroupName, serverName, jobAgentName, jobName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobStepsClient", "ListByJob", nil, "Failure preparing request") - return - } - - resp, err := client.ListByJobSender(req) - if err != nil { - result.jslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.JobStepsClient", "ListByJob", resp, "Failure sending request") - return - } - - result.jslr, err = client.ListByJobResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobStepsClient", "ListByJob", resp, "Failure responding to request") - } - - return -} - -// ListByJobPreparer prepares the ListByJob request. -func (client JobStepsClient) ListByJobPreparer(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobAgentName": autorest.Encode("path", jobAgentName), - "jobName": autorest.Encode("path", jobName), - "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}/jobAgents/{jobAgentName}/jobs/{jobName}/steps", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByJobSender sends the ListByJob request. The method will close the -// http.Response Body if it receives an error. -func (client JobStepsClient) ListByJobSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByJobResponder handles the response to the ListByJob request. The method always -// closes the http.Response Body. -func (client JobStepsClient) ListByJobResponder(resp *http.Response) (result JobStepListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByJobNextResults retrieves the next set of results, if any. -func (client JobStepsClient) listByJobNextResults(ctx context.Context, lastResults JobStepListResult) (result JobStepListResult, err error) { - req, err := lastResults.jobStepListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.JobStepsClient", "listByJobNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByJobSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "sql.JobStepsClient", "listByJobNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByJobResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobStepsClient", "listByJobNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByJobComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobStepsClient) ListByJobComplete(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string) (result JobStepListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobStepsClient.ListByJob") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByJob(ctx, resourceGroupName, serverName, jobAgentName, jobName) - return -} - -// ListByVersion gets all job steps in the specified job version. -// 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. -// jobAgentName - the name of the job agent. -// jobName - the name of the job to get. -// jobVersion - the version of the job to get. -func (client JobStepsClient) ListByVersion(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobVersion int32) (result JobStepListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobStepsClient.ListByVersion") - defer func() { - sc := -1 - if result.jslr.Response.Response != nil { - sc = result.jslr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByVersionNextResults - req, err := client.ListByVersionPreparer(ctx, resourceGroupName, serverName, jobAgentName, jobName, jobVersion) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobStepsClient", "ListByVersion", nil, "Failure preparing request") - return - } - - resp, err := client.ListByVersionSender(req) - if err != nil { - result.jslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.JobStepsClient", "ListByVersion", resp, "Failure sending request") - return - } - - result.jslr, err = client.ListByVersionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobStepsClient", "ListByVersion", resp, "Failure responding to request") - } - - return -} - -// ListByVersionPreparer prepares the ListByVersion request. -func (client JobStepsClient) ListByVersionPreparer(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobVersion int32) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobAgentName": autorest.Encode("path", jobAgentName), - "jobName": autorest.Encode("path", jobName), - "jobVersion": autorest.Encode("path", jobVersion), - "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}/jobAgents/{jobAgentName}/jobs/{jobName}/versions/{jobVersion}/steps", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByVersionSender sends the ListByVersion request. The method will close the -// http.Response Body if it receives an error. -func (client JobStepsClient) ListByVersionSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByVersionResponder handles the response to the ListByVersion request. The method always -// closes the http.Response Body. -func (client JobStepsClient) ListByVersionResponder(resp *http.Response) (result JobStepListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByVersionNextResults retrieves the next set of results, if any. -func (client JobStepsClient) listByVersionNextResults(ctx context.Context, lastResults JobStepListResult) (result JobStepListResult, err error) { - req, err := lastResults.jobStepListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.JobStepsClient", "listByVersionNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByVersionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "sql.JobStepsClient", "listByVersionNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByVersionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobStepsClient", "listByVersionNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByVersionComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobStepsClient) ListByVersionComplete(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobVersion int32) (result JobStepListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobStepsClient.ListByVersion") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByVersion(ctx, resourceGroupName, serverName, jobAgentName, jobName, jobVersion) - return -} diff --git a/services/preview/sql/mgmt/2018-06-15-preview/sql/jobtargetexecutions.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/jobtargetexecutions.go deleted file mode 100644 index 726a66db0835..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/jobtargetexecutions.go +++ /dev/null @@ -1,435 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the 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/tracing" - "github.com/satori/go.uuid" - "net/http" -) - -// JobTargetExecutionsClient is the the Azure SQL Database management API provides a RESTful set of web services that -// interact with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, -// and delete databases. -type JobTargetExecutionsClient struct { - BaseClient -} - -// NewJobTargetExecutionsClient creates an instance of the JobTargetExecutionsClient client. -func NewJobTargetExecutionsClient(subscriptionID string) JobTargetExecutionsClient { - return NewJobTargetExecutionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewJobTargetExecutionsClientWithBaseURI creates an instance of the JobTargetExecutionsClient client. -func NewJobTargetExecutionsClientWithBaseURI(baseURI string, subscriptionID string) JobTargetExecutionsClient { - return JobTargetExecutionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets a target execution. -// 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. -// jobAgentName - the name of the job agent. -// jobName - the name of the job to get. -// jobExecutionID - the unique id of the job execution -// stepName - the name of the step. -// targetID - the target id. -func (client JobTargetExecutionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID uuid.UUID, stepName string, targetID uuid.UUID) (result JobExecution, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobTargetExecutionsClient.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, serverName, jobAgentName, jobName, jobExecutionID, stepName, targetID) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobTargetExecutionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.JobTargetExecutionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobTargetExecutionsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client JobTargetExecutionsClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID uuid.UUID, stepName string, targetID uuid.UUID) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobAgentName": autorest.Encode("path", jobAgentName), - "jobExecutionId": autorest.Encode("path", jobExecutionID), - "jobName": autorest.Encode("path", jobName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "stepName": autorest.Encode("path", stepName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "targetId": autorest.Encode("path", targetID), - } - - 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}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps/{stepName}/targets/{targetId}", 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 JobTargetExecutionsClient) 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 JobTargetExecutionsClient) GetResponder(resp *http.Response) (result JobExecution, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByJobExecution lists target executions for all steps of a job execution. -// 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. -// jobAgentName - the name of the job agent. -// jobName - the name of the job to get. -// jobExecutionID - the id of the job execution -// createTimeMin - if specified, only job executions created at or after the specified time are included. -// createTimeMax - if specified, only job executions created before the specified time are included. -// endTimeMin - if specified, only job executions completed at or after the specified time are included. -// endTimeMax - if specified, only job executions completed before the specified time are included. -// isActive - if specified, only active or only completed job executions are included. -// skip - the number of elements in the collection to skip. -// top - the number of elements to return from the collection. -func (client JobTargetExecutionsClient) ListByJobExecution(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID uuid.UUID, createTimeMin *date.Time, createTimeMax *date.Time, endTimeMin *date.Time, endTimeMax *date.Time, isActive *bool, skip *int32, top *int32) (result JobExecutionListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobTargetExecutionsClient.ListByJobExecution") - defer func() { - sc := -1 - if result.jelr.Response.Response != nil { - sc = result.jelr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByJobExecutionNextResults - req, err := client.ListByJobExecutionPreparer(ctx, resourceGroupName, serverName, jobAgentName, jobName, jobExecutionID, createTimeMin, createTimeMax, endTimeMin, endTimeMax, isActive, skip, top) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobTargetExecutionsClient", "ListByJobExecution", nil, "Failure preparing request") - return - } - - resp, err := client.ListByJobExecutionSender(req) - if err != nil { - result.jelr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.JobTargetExecutionsClient", "ListByJobExecution", resp, "Failure sending request") - return - } - - result.jelr, err = client.ListByJobExecutionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobTargetExecutionsClient", "ListByJobExecution", resp, "Failure responding to request") - } - - return -} - -// ListByJobExecutionPreparer prepares the ListByJobExecution request. -func (client JobTargetExecutionsClient) ListByJobExecutionPreparer(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID uuid.UUID, createTimeMin *date.Time, createTimeMax *date.Time, endTimeMin *date.Time, endTimeMax *date.Time, isActive *bool, skip *int32, top *int32) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobAgentName": autorest.Encode("path", jobAgentName), - "jobExecutionId": autorest.Encode("path", jobExecutionID), - "jobName": autorest.Encode("path", jobName), - "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, - } - if createTimeMin != nil { - queryParameters["createTimeMin"] = autorest.Encode("query", *createTimeMin) - } - if createTimeMax != nil { - queryParameters["createTimeMax"] = autorest.Encode("query", *createTimeMax) - } - if endTimeMin != nil { - queryParameters["endTimeMin"] = autorest.Encode("query", *endTimeMin) - } - if endTimeMax != nil { - queryParameters["endTimeMax"] = autorest.Encode("query", *endTimeMax) - } - if isActive != nil { - queryParameters["isActive"] = autorest.Encode("query", *isActive) - } - if skip != nil { - queryParameters["$skip"] = autorest.Encode("query", *skip) - } - 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.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/targets", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByJobExecutionSender sends the ListByJobExecution request. The method will close the -// http.Response Body if it receives an error. -func (client JobTargetExecutionsClient) ListByJobExecutionSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByJobExecutionResponder handles the response to the ListByJobExecution request. The method always -// closes the http.Response Body. -func (client JobTargetExecutionsClient) ListByJobExecutionResponder(resp *http.Response) (result JobExecutionListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByJobExecutionNextResults retrieves the next set of results, if any. -func (client JobTargetExecutionsClient) listByJobExecutionNextResults(ctx context.Context, lastResults JobExecutionListResult) (result JobExecutionListResult, err error) { - req, err := lastResults.jobExecutionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.JobTargetExecutionsClient", "listByJobExecutionNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByJobExecutionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "sql.JobTargetExecutionsClient", "listByJobExecutionNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByJobExecutionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobTargetExecutionsClient", "listByJobExecutionNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByJobExecutionComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobTargetExecutionsClient) ListByJobExecutionComplete(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID uuid.UUID, createTimeMin *date.Time, createTimeMax *date.Time, endTimeMin *date.Time, endTimeMax *date.Time, isActive *bool, skip *int32, top *int32) (result JobExecutionListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobTargetExecutionsClient.ListByJobExecution") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByJobExecution(ctx, resourceGroupName, serverName, jobAgentName, jobName, jobExecutionID, createTimeMin, createTimeMax, endTimeMin, endTimeMax, isActive, skip, top) - return -} - -// ListByStep lists the target executions of a job step execution. -// 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. -// jobAgentName - the name of the job agent. -// jobName - the name of the job to get. -// jobExecutionID - the id of the job execution -// stepName - the name of the step. -// createTimeMin - if specified, only job executions created at or after the specified time are included. -// createTimeMax - if specified, only job executions created before the specified time are included. -// endTimeMin - if specified, only job executions completed at or after the specified time are included. -// endTimeMax - if specified, only job executions completed before the specified time are included. -// isActive - if specified, only active or only completed job executions are included. -// skip - the number of elements in the collection to skip. -// top - the number of elements to return from the collection. -func (client JobTargetExecutionsClient) ListByStep(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID uuid.UUID, stepName string, createTimeMin *date.Time, createTimeMax *date.Time, endTimeMin *date.Time, endTimeMax *date.Time, isActive *bool, skip *int32, top *int32) (result JobExecutionListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobTargetExecutionsClient.ListByStep") - defer func() { - sc := -1 - if result.jelr.Response.Response != nil { - sc = result.jelr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByStepNextResults - req, err := client.ListByStepPreparer(ctx, resourceGroupName, serverName, jobAgentName, jobName, jobExecutionID, stepName, createTimeMin, createTimeMax, endTimeMin, endTimeMax, isActive, skip, top) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobTargetExecutionsClient", "ListByStep", nil, "Failure preparing request") - return - } - - resp, err := client.ListByStepSender(req) - if err != nil { - result.jelr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.JobTargetExecutionsClient", "ListByStep", resp, "Failure sending request") - return - } - - result.jelr, err = client.ListByStepResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobTargetExecutionsClient", "ListByStep", resp, "Failure responding to request") - } - - return -} - -// ListByStepPreparer prepares the ListByStep request. -func (client JobTargetExecutionsClient) ListByStepPreparer(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID uuid.UUID, stepName string, createTimeMin *date.Time, createTimeMax *date.Time, endTimeMin *date.Time, endTimeMax *date.Time, isActive *bool, skip *int32, top *int32) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobAgentName": autorest.Encode("path", jobAgentName), - "jobExecutionId": autorest.Encode("path", jobExecutionID), - "jobName": autorest.Encode("path", jobName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "stepName": autorest.Encode("path", stepName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-03-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if createTimeMin != nil { - queryParameters["createTimeMin"] = autorest.Encode("query", *createTimeMin) - } - if createTimeMax != nil { - queryParameters["createTimeMax"] = autorest.Encode("query", *createTimeMax) - } - if endTimeMin != nil { - queryParameters["endTimeMin"] = autorest.Encode("query", *endTimeMin) - } - if endTimeMax != nil { - queryParameters["endTimeMax"] = autorest.Encode("query", *endTimeMax) - } - if isActive != nil { - queryParameters["isActive"] = autorest.Encode("query", *isActive) - } - if skip != nil { - queryParameters["$skip"] = autorest.Encode("query", *skip) - } - 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.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps/{stepName}/targets", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByStepSender sends the ListByStep request. The method will close the -// http.Response Body if it receives an error. -func (client JobTargetExecutionsClient) ListByStepSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByStepResponder handles the response to the ListByStep request. The method always -// closes the http.Response Body. -func (client JobTargetExecutionsClient) ListByStepResponder(resp *http.Response) (result JobExecutionListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByStepNextResults retrieves the next set of results, if any. -func (client JobTargetExecutionsClient) listByStepNextResults(ctx context.Context, lastResults JobExecutionListResult) (result JobExecutionListResult, err error) { - req, err := lastResults.jobExecutionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.JobTargetExecutionsClient", "listByStepNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByStepSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "sql.JobTargetExecutionsClient", "listByStepNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByStepResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobTargetExecutionsClient", "listByStepNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByStepComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobTargetExecutionsClient) ListByStepComplete(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID uuid.UUID, stepName string, createTimeMin *date.Time, createTimeMax *date.Time, endTimeMin *date.Time, endTimeMax *date.Time, isActive *bool, skip *int32, top *int32) (result JobExecutionListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobTargetExecutionsClient.ListByStep") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByStep(ctx, resourceGroupName, serverName, jobAgentName, jobName, jobExecutionID, stepName, createTimeMin, createTimeMax, endTimeMin, endTimeMax, isActive, skip, top) - return -} diff --git a/services/preview/sql/mgmt/2018-06-15-preview/sql/jobtargetgroups.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/jobtargetgroups.go deleted file mode 100644 index 662b16e9dfb3..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/jobtargetgroups.go +++ /dev/null @@ -1,417 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the 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" -) - -// JobTargetGroupsClient is the the Azure SQL Database management API provides a RESTful set of web services that -// interact with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, -// and delete databases. -type JobTargetGroupsClient struct { - BaseClient -} - -// NewJobTargetGroupsClient creates an instance of the JobTargetGroupsClient client. -func NewJobTargetGroupsClient(subscriptionID string) JobTargetGroupsClient { - return NewJobTargetGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewJobTargetGroupsClientWithBaseURI creates an instance of the JobTargetGroupsClient client. -func NewJobTargetGroupsClientWithBaseURI(baseURI string, subscriptionID string) JobTargetGroupsClient { - return JobTargetGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a target group. -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -// serverName - the name of the server. -// jobAgentName - the name of the job agent. -// targetGroupName - the name of the target group. -// parameters - the requested state of the target group. -func (client JobTargetGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, targetGroupName string, parameters JobTargetGroup) (result JobTargetGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobTargetGroupsClient.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: parameters, - Constraints: []validation.Constraint{{Target: "parameters.JobTargetGroupProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.JobTargetGroupProperties.Members", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("sql.JobTargetGroupsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, jobAgentName, targetGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobTargetGroupsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.JobTargetGroupsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobTargetGroupsClient", "CreateOrUpdate", resp, "Failure responding to request") - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client JobTargetGroupsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, targetGroupName string, parameters JobTargetGroup) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobAgentName": autorest.Encode("path", jobAgentName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "targetGroupName": autorest.Encode("path", targetGroupName), - } - - const APIVersion = "2017-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.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups/{targetGroupName}", 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 JobTargetGroupsClient) 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 JobTargetGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result JobTargetGroup, 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 target group. -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -// serverName - the name of the server. -// jobAgentName - the name of the job agent. -// targetGroupName - the name of the target group. -func (client JobTargetGroupsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, targetGroupName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobTargetGroupsClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, jobAgentName, targetGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobTargetGroupsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "sql.JobTargetGroupsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobTargetGroupsClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client JobTargetGroupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, targetGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobAgentName": autorest.Encode("path", jobAgentName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "targetGroupName": autorest.Encode("path", targetGroupName), - } - - const APIVersion = "2017-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.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups/{targetGroupName}", 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 JobTargetGroupsClient) 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 JobTargetGroupsClient) 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 target group. -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -// serverName - the name of the server. -// jobAgentName - the name of the job agent. -// targetGroupName - the name of the target group. -func (client JobTargetGroupsClient) Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, targetGroupName string) (result JobTargetGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobTargetGroupsClient.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, serverName, jobAgentName, targetGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobTargetGroupsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.JobTargetGroupsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobTargetGroupsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client JobTargetGroupsClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, targetGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobAgentName": autorest.Encode("path", jobAgentName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "targetGroupName": autorest.Encode("path", targetGroupName), - } - - 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}/jobAgents/{jobAgentName}/targetGroups/{targetGroupName}", 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 JobTargetGroupsClient) 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 JobTargetGroupsClient) GetResponder(resp *http.Response) (result JobTargetGroup, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByAgent gets all target groups in an agent. -// 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. -// jobAgentName - the name of the job agent. -func (client JobTargetGroupsClient) ListByAgent(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string) (result JobTargetGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobTargetGroupsClient.ListByAgent") - defer func() { - sc := -1 - if result.jtglr.Response.Response != nil { - sc = result.jtglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByAgentNextResults - req, err := client.ListByAgentPreparer(ctx, resourceGroupName, serverName, jobAgentName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobTargetGroupsClient", "ListByAgent", nil, "Failure preparing request") - return - } - - resp, err := client.ListByAgentSender(req) - if err != nil { - result.jtglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.JobTargetGroupsClient", "ListByAgent", resp, "Failure sending request") - return - } - - result.jtglr, err = client.ListByAgentResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobTargetGroupsClient", "ListByAgent", resp, "Failure responding to request") - } - - return -} - -// ListByAgentPreparer prepares the ListByAgent request. -func (client JobTargetGroupsClient) ListByAgentPreparer(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobAgentName": autorest.Encode("path", jobAgentName), - "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}/jobAgents/{jobAgentName}/targetGroups", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByAgentSender sends the ListByAgent request. The method will close the -// http.Response Body if it receives an error. -func (client JobTargetGroupsClient) ListByAgentSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByAgentResponder handles the response to the ListByAgent request. The method always -// closes the http.Response Body. -func (client JobTargetGroupsClient) ListByAgentResponder(resp *http.Response) (result JobTargetGroupListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByAgentNextResults retrieves the next set of results, if any. -func (client JobTargetGroupsClient) listByAgentNextResults(ctx context.Context, lastResults JobTargetGroupListResult) (result JobTargetGroupListResult, err error) { - req, err := lastResults.jobTargetGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.JobTargetGroupsClient", "listByAgentNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByAgentSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "sql.JobTargetGroupsClient", "listByAgentNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByAgentResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobTargetGroupsClient", "listByAgentNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByAgentComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobTargetGroupsClient) ListByAgentComplete(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string) (result JobTargetGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobTargetGroupsClient.ListByAgent") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByAgent(ctx, resourceGroupName, serverName, jobAgentName) - return -} diff --git a/services/preview/sql/mgmt/2018-06-15-preview/sql/jobversions.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/jobversions.go deleted file mode 100644 index 9b81112ab2a0..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/jobversions.go +++ /dev/null @@ -1,247 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// JobVersionsClient is the the Azure SQL Database management API provides a RESTful set of web services that interact -// with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, and -// delete databases. -type JobVersionsClient struct { - BaseClient -} - -// NewJobVersionsClient creates an instance of the JobVersionsClient client. -func NewJobVersionsClient(subscriptionID string) JobVersionsClient { - return NewJobVersionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewJobVersionsClientWithBaseURI creates an instance of the JobVersionsClient client. -func NewJobVersionsClientWithBaseURI(baseURI string, subscriptionID string) JobVersionsClient { - return JobVersionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets a job version. -// 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. -// jobAgentName - the name of the job agent. -// jobName - the name of the job. -// jobVersion - the version of the job to get. -func (client JobVersionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobVersion int32) (result JobVersion, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobVersionsClient.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, serverName, jobAgentName, jobName, jobVersion) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobVersionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.JobVersionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobVersionsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client JobVersionsClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobVersion int32) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobAgentName": autorest.Encode("path", jobAgentName), - "jobName": autorest.Encode("path", jobName), - "jobVersion": autorest.Encode("path", jobVersion), - "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}/jobAgents/{jobAgentName}/jobs/{jobName}/versions/{jobVersion}", 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 JobVersionsClient) 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 JobVersionsClient) GetResponder(resp *http.Response) (result JobVersion, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByJob gets all versions of a job. -// 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. -// jobAgentName - the name of the job agent. -// jobName - the name of the job to get. -func (client JobVersionsClient) ListByJob(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string) (result JobVersionListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobVersionsClient.ListByJob") - defer func() { - sc := -1 - if result.jvlr.Response.Response != nil { - sc = result.jvlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByJobNextResults - req, err := client.ListByJobPreparer(ctx, resourceGroupName, serverName, jobAgentName, jobName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobVersionsClient", "ListByJob", nil, "Failure preparing request") - return - } - - resp, err := client.ListByJobSender(req) - if err != nil { - result.jvlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.JobVersionsClient", "ListByJob", resp, "Failure sending request") - return - } - - result.jvlr, err = client.ListByJobResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobVersionsClient", "ListByJob", resp, "Failure responding to request") - } - - return -} - -// ListByJobPreparer prepares the ListByJob request. -func (client JobVersionsClient) ListByJobPreparer(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobAgentName": autorest.Encode("path", jobAgentName), - "jobName": autorest.Encode("path", jobName), - "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}/jobAgents/{jobAgentName}/jobs/{jobName}/versions", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByJobSender sends the ListByJob request. The method will close the -// http.Response Body if it receives an error. -func (client JobVersionsClient) ListByJobSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByJobResponder handles the response to the ListByJob request. The method always -// closes the http.Response Body. -func (client JobVersionsClient) ListByJobResponder(resp *http.Response) (result JobVersionListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByJobNextResults retrieves the next set of results, if any. -func (client JobVersionsClient) listByJobNextResults(ctx context.Context, lastResults JobVersionListResult) (result JobVersionListResult, err error) { - req, err := lastResults.jobVersionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.JobVersionsClient", "listByJobNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByJobSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "sql.JobVersionsClient", "listByJobNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByJobResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobVersionsClient", "listByJobNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByJobComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobVersionsClient) ListByJobComplete(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string) (result JobVersionListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobVersionsClient.ListByJob") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByJob(ctx, resourceGroupName, serverName, jobAgentName, jobName) - return -} diff --git a/services/preview/sql/mgmt/2018-06-15-preview/sql/longtermretentionbackups.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/longtermretentionbackups.go deleted file mode 100644 index bdd82ec29414..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/longtermretentionbackups.go +++ /dev/null @@ -1,1118 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// LongTermRetentionBackupsClient is the the Azure SQL Database management API provides a RESTful set of web services -// that interact with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, -// update, and delete databases. -type LongTermRetentionBackupsClient struct { - BaseClient -} - -// NewLongTermRetentionBackupsClient creates an instance of the LongTermRetentionBackupsClient client. -func NewLongTermRetentionBackupsClient(subscriptionID string) LongTermRetentionBackupsClient { - return NewLongTermRetentionBackupsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewLongTermRetentionBackupsClientWithBaseURI creates an instance of the LongTermRetentionBackupsClient client. -func NewLongTermRetentionBackupsClientWithBaseURI(baseURI string, subscriptionID string) LongTermRetentionBackupsClient { - return LongTermRetentionBackupsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Delete deletes a long term retention backup. -// Parameters: -// locationName - the location of the database -// longTermRetentionServerName - the name of the server -// longTermRetentionDatabaseName - the name of the database -// backupName - the backup name. -func (client LongTermRetentionBackupsClient) Delete(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string) (result LongTermRetentionBackupsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupsClient.Delete") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client LongTermRetentionBackupsClient) DeletePreparer(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "backupName": autorest.Encode("path", backupName), - "locationName": autorest.Encode("path", locationName), - "longTermRetentionDatabaseName": autorest.Encode("path", longTermRetentionDatabaseName), - "longTermRetentionServerName": autorest.Encode("path", longTermRetentionServerName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-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.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}", 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 LongTermRetentionBackupsClient) DeleteSender(req *http.Request) (future LongTermRetentionBackupsDeleteFuture, 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 LongTermRetentionBackupsClient) 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 -} - -// DeleteByResourceGroup deletes a long term retention backup. -// 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. -// locationName - the location of the database -// longTermRetentionServerName - the name of the server -// longTermRetentionDatabaseName - the name of the database -// backupName - the backup name. -func (client LongTermRetentionBackupsClient) DeleteByResourceGroup(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string) (result LongTermRetentionBackupsDeleteByResourceGroupFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupsClient.DeleteByResourceGroup") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeleteByResourceGroupPreparer(ctx, resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "DeleteByResourceGroup", nil, "Failure preparing request") - return - } - - result, err = client.DeleteByResourceGroupSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "DeleteByResourceGroup", result.Response(), "Failure sending request") - return - } - - return -} - -// DeleteByResourceGroupPreparer prepares the DeleteByResourceGroup request. -func (client LongTermRetentionBackupsClient) DeleteByResourceGroupPreparer(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "backupName": autorest.Encode("path", backupName), - "locationName": autorest.Encode("path", locationName), - "longTermRetentionDatabaseName": autorest.Encode("path", longTermRetentionDatabaseName), - "longTermRetentionServerName": autorest.Encode("path", longTermRetentionServerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-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.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteByResourceGroupSender sends the DeleteByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client LongTermRetentionBackupsClient) DeleteByResourceGroupSender(req *http.Request) (future LongTermRetentionBackupsDeleteByResourceGroupFuture, 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 -} - -// DeleteByResourceGroupResponder handles the response to the DeleteByResourceGroup request. The method always -// closes the http.Response Body. -func (client LongTermRetentionBackupsClient) DeleteByResourceGroupResponder(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 long term retention backup. -// Parameters: -// locationName - the location of the database. -// longTermRetentionServerName - the name of the server -// longTermRetentionDatabaseName - the name of the database -// backupName - the backup name. -func (client LongTermRetentionBackupsClient) Get(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string) (result LongTermRetentionBackup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupsClient.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, longTermRetentionServerName, longTermRetentionDatabaseName, backupName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client LongTermRetentionBackupsClient) GetPreparer(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "backupName": autorest.Encode("path", backupName), - "locationName": autorest.Encode("path", locationName), - "longTermRetentionDatabaseName": autorest.Encode("path", longTermRetentionDatabaseName), - "longTermRetentionServerName": autorest.Encode("path", longTermRetentionServerName), - "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}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}", 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 LongTermRetentionBackupsClient) 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 LongTermRetentionBackupsClient) GetResponder(resp *http.Response) (result LongTermRetentionBackup, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetByResourceGroup gets a long term retention backup. -// 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. -// locationName - the location of the database. -// longTermRetentionServerName - the name of the server -// longTermRetentionDatabaseName - the name of the database -// backupName - the backup name. -func (client LongTermRetentionBackupsClient) GetByResourceGroup(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string) (result LongTermRetentionBackup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupsClient.GetByResourceGroup") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetByResourceGroupPreparer(ctx, resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "GetByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.GetByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "GetByResourceGroup", resp, "Failure sending request") - return - } - - result, err = client.GetByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "GetByResourceGroup", resp, "Failure responding to request") - } - - return -} - -// GetByResourceGroupPreparer prepares the GetByResourceGroup request. -func (client LongTermRetentionBackupsClient) GetByResourceGroupPreparer(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "backupName": autorest.Encode("path", backupName), - "locationName": autorest.Encode("path", locationName), - "longTermRetentionDatabaseName": autorest.Encode("path", longTermRetentionDatabaseName), - "longTermRetentionServerName": autorest.Encode("path", longTermRetentionServerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "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/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetByResourceGroupSender sends the GetByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client LongTermRetentionBackupsClient) GetByResourceGroupSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// GetByResourceGroupResponder handles the response to the GetByResourceGroup request. The method always -// closes the http.Response Body. -func (client LongTermRetentionBackupsClient) GetByResourceGroupResponder(resp *http.Response) (result LongTermRetentionBackup, 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 lists all long term retention backups for a database. -// Parameters: -// locationName - the location of the database -// longTermRetentionServerName - the name of the server -// longTermRetentionDatabaseName - the name of the database -// onlyLatestPerDatabase - whether or not to only get the latest backup for each database. -// databaseState - whether to query against just live databases, just deleted databases, or all databases. -func (client LongTermRetentionBackupsClient) ListByDatabase(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, onlyLatestPerDatabase *bool, databaseState LongTermRetentionDatabaseState) (result LongTermRetentionBackupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupsClient.ListByDatabase") - defer func() { - sc := -1 - if result.ltrblr.Response.Response != nil { - sc = result.ltrblr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByDatabaseNextResults - req, err := client.ListByDatabasePreparer(ctx, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, onlyLatestPerDatabase, databaseState) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "ListByDatabase", nil, "Failure preparing request") - return - } - - resp, err := client.ListByDatabaseSender(req) - if err != nil { - result.ltrblr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "ListByDatabase", resp, "Failure sending request") - return - } - - result.ltrblr, err = client.ListByDatabaseResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "ListByDatabase", resp, "Failure responding to request") - } - - return -} - -// ListByDatabasePreparer prepares the ListByDatabase request. -func (client LongTermRetentionBackupsClient) ListByDatabasePreparer(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, onlyLatestPerDatabase *bool, databaseState LongTermRetentionDatabaseState) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "locationName": autorest.Encode("path", locationName), - "longTermRetentionDatabaseName": autorest.Encode("path", longTermRetentionDatabaseName), - "longTermRetentionServerName": autorest.Encode("path", longTermRetentionServerName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-03-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if onlyLatestPerDatabase != nil { - queryParameters["onlyLatestPerDatabase"] = autorest.Encode("query", *onlyLatestPerDatabase) - } - if len(string(databaseState)) > 0 { - queryParameters["databaseState"] = autorest.Encode("query", databaseState) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups", 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 LongTermRetentionBackupsClient) 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 LongTermRetentionBackupsClient) ListByDatabaseResponder(resp *http.Response) (result LongTermRetentionBackupListResult, 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 LongTermRetentionBackupsClient) listByDatabaseNextResults(ctx context.Context, lastResults LongTermRetentionBackupListResult) (result LongTermRetentionBackupListResult, err error) { - req, err := lastResults.longTermRetentionBackupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "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.LongTermRetentionBackupsClient", "listByDatabaseNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByDatabaseResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "listByDatabaseNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByDatabaseComplete enumerates all values, automatically crossing page boundaries as required. -func (client LongTermRetentionBackupsClient) ListByDatabaseComplete(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, onlyLatestPerDatabase *bool, databaseState LongTermRetentionDatabaseState) (result LongTermRetentionBackupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupsClient.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, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, onlyLatestPerDatabase, databaseState) - return -} - -// ListByLocation lists the long term retention backups for a given location. -// Parameters: -// locationName - the location of the database -// onlyLatestPerDatabase - whether or not to only get the latest backup for each database. -// databaseState - whether to query against just live databases, just deleted databases, or all databases. -func (client LongTermRetentionBackupsClient) ListByLocation(ctx context.Context, locationName string, onlyLatestPerDatabase *bool, databaseState LongTermRetentionDatabaseState) (result LongTermRetentionBackupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupsClient.ListByLocation") - defer func() { - sc := -1 - if result.ltrblr.Response.Response != nil { - sc = result.ltrblr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByLocationNextResults - req, err := client.ListByLocationPreparer(ctx, locationName, onlyLatestPerDatabase, databaseState) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "ListByLocation", nil, "Failure preparing request") - return - } - - resp, err := client.ListByLocationSender(req) - if err != nil { - result.ltrblr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "ListByLocation", resp, "Failure sending request") - return - } - - result.ltrblr, err = client.ListByLocationResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "ListByLocation", resp, "Failure responding to request") - } - - return -} - -// ListByLocationPreparer prepares the ListByLocation request. -func (client LongTermRetentionBackupsClient) ListByLocationPreparer(ctx context.Context, locationName string, onlyLatestPerDatabase *bool, databaseState LongTermRetentionDatabaseState) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "locationName": autorest.Encode("path", locationName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-03-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if onlyLatestPerDatabase != nil { - queryParameters["onlyLatestPerDatabase"] = autorest.Encode("query", *onlyLatestPerDatabase) - } - if len(string(databaseState)) > 0 { - queryParameters["databaseState"] = autorest.Encode("query", databaseState) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByLocationSender sends the ListByLocation request. The method will close the -// http.Response Body if it receives an error. -func (client LongTermRetentionBackupsClient) ListByLocationSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByLocationResponder handles the response to the ListByLocation request. The method always -// closes the http.Response Body. -func (client LongTermRetentionBackupsClient) ListByLocationResponder(resp *http.Response) (result LongTermRetentionBackupListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByLocationNextResults retrieves the next set of results, if any. -func (client LongTermRetentionBackupsClient) listByLocationNextResults(ctx context.Context, lastResults LongTermRetentionBackupListResult) (result LongTermRetentionBackupListResult, err error) { - req, err := lastResults.longTermRetentionBackupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "listByLocationNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByLocationSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "listByLocationNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByLocationResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "listByLocationNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByLocationComplete enumerates all values, automatically crossing page boundaries as required. -func (client LongTermRetentionBackupsClient) ListByLocationComplete(ctx context.Context, locationName string, onlyLatestPerDatabase *bool, databaseState LongTermRetentionDatabaseState) (result LongTermRetentionBackupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupsClient.ListByLocation") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByLocation(ctx, locationName, onlyLatestPerDatabase, databaseState) - return -} - -// ListByResourceGroupDatabase lists all long term retention backups for 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. -// locationName - the location of the database -// longTermRetentionServerName - the name of the server -// longTermRetentionDatabaseName - the name of the database -// onlyLatestPerDatabase - whether or not to only get the latest backup for each database. -// databaseState - whether to query against just live databases, just deleted databases, or all databases. -func (client LongTermRetentionBackupsClient) ListByResourceGroupDatabase(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, onlyLatestPerDatabase *bool, databaseState LongTermRetentionDatabaseState) (result LongTermRetentionBackupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupsClient.ListByResourceGroupDatabase") - defer func() { - sc := -1 - if result.ltrblr.Response.Response != nil { - sc = result.ltrblr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupDatabaseNextResults - req, err := client.ListByResourceGroupDatabasePreparer(ctx, resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, onlyLatestPerDatabase, databaseState) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "ListByResourceGroupDatabase", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupDatabaseSender(req) - if err != nil { - result.ltrblr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "ListByResourceGroupDatabase", resp, "Failure sending request") - return - } - - result.ltrblr, err = client.ListByResourceGroupDatabaseResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "ListByResourceGroupDatabase", resp, "Failure responding to request") - } - - return -} - -// ListByResourceGroupDatabasePreparer prepares the ListByResourceGroupDatabase request. -func (client LongTermRetentionBackupsClient) ListByResourceGroupDatabasePreparer(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, onlyLatestPerDatabase *bool, databaseState LongTermRetentionDatabaseState) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "locationName": autorest.Encode("path", locationName), - "longTermRetentionDatabaseName": autorest.Encode("path", longTermRetentionDatabaseName), - "longTermRetentionServerName": autorest.Encode("path", longTermRetentionServerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-03-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if onlyLatestPerDatabase != nil { - queryParameters["onlyLatestPerDatabase"] = autorest.Encode("query", *onlyLatestPerDatabase) - } - if len(string(databaseState)) > 0 { - queryParameters["databaseState"] = autorest.Encode("query", databaseState) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupDatabaseSender sends the ListByResourceGroupDatabase request. The method will close the -// http.Response Body if it receives an error. -func (client LongTermRetentionBackupsClient) ListByResourceGroupDatabaseSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByResourceGroupDatabaseResponder handles the response to the ListByResourceGroupDatabase request. The method always -// closes the http.Response Body. -func (client LongTermRetentionBackupsClient) ListByResourceGroupDatabaseResponder(resp *http.Response) (result LongTermRetentionBackupListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupDatabaseNextResults retrieves the next set of results, if any. -func (client LongTermRetentionBackupsClient) listByResourceGroupDatabaseNextResults(ctx context.Context, lastResults LongTermRetentionBackupListResult) (result LongTermRetentionBackupListResult, err error) { - req, err := lastResults.longTermRetentionBackupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "listByResourceGroupDatabaseNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupDatabaseSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "listByResourceGroupDatabaseNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupDatabaseResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "listByResourceGroupDatabaseNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupDatabaseComplete enumerates all values, automatically crossing page boundaries as required. -func (client LongTermRetentionBackupsClient) ListByResourceGroupDatabaseComplete(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, onlyLatestPerDatabase *bool, databaseState LongTermRetentionDatabaseState) (result LongTermRetentionBackupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupsClient.ListByResourceGroupDatabase") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroupDatabase(ctx, resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, onlyLatestPerDatabase, databaseState) - return -} - -// ListByResourceGroupLocation lists the long term retention backups for a given location. -// 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. -// locationName - the location of the database -// onlyLatestPerDatabase - whether or not to only get the latest backup for each database. -// databaseState - whether to query against just live databases, just deleted databases, or all databases. -func (client LongTermRetentionBackupsClient) ListByResourceGroupLocation(ctx context.Context, resourceGroupName string, locationName string, onlyLatestPerDatabase *bool, databaseState LongTermRetentionDatabaseState) (result LongTermRetentionBackupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupsClient.ListByResourceGroupLocation") - defer func() { - sc := -1 - if result.ltrblr.Response.Response != nil { - sc = result.ltrblr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupLocationNextResults - req, err := client.ListByResourceGroupLocationPreparer(ctx, resourceGroupName, locationName, onlyLatestPerDatabase, databaseState) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "ListByResourceGroupLocation", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupLocationSender(req) - if err != nil { - result.ltrblr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "ListByResourceGroupLocation", resp, "Failure sending request") - return - } - - result.ltrblr, err = client.ListByResourceGroupLocationResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "ListByResourceGroupLocation", resp, "Failure responding to request") - } - - return -} - -// ListByResourceGroupLocationPreparer prepares the ListByResourceGroupLocation request. -func (client LongTermRetentionBackupsClient) ListByResourceGroupLocationPreparer(ctx context.Context, resourceGroupName string, locationName string, onlyLatestPerDatabase *bool, databaseState LongTermRetentionDatabaseState) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "locationName": autorest.Encode("path", locationName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-03-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if onlyLatestPerDatabase != nil { - queryParameters["onlyLatestPerDatabase"] = autorest.Encode("query", *onlyLatestPerDatabase) - } - if len(string(databaseState)) > 0 { - queryParameters["databaseState"] = autorest.Encode("query", databaseState) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupLocationSender sends the ListByResourceGroupLocation request. The method will close the -// http.Response Body if it receives an error. -func (client LongTermRetentionBackupsClient) ListByResourceGroupLocationSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByResourceGroupLocationResponder handles the response to the ListByResourceGroupLocation request. The method always -// closes the http.Response Body. -func (client LongTermRetentionBackupsClient) ListByResourceGroupLocationResponder(resp *http.Response) (result LongTermRetentionBackupListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupLocationNextResults retrieves the next set of results, if any. -func (client LongTermRetentionBackupsClient) listByResourceGroupLocationNextResults(ctx context.Context, lastResults LongTermRetentionBackupListResult) (result LongTermRetentionBackupListResult, err error) { - req, err := lastResults.longTermRetentionBackupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "listByResourceGroupLocationNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupLocationSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "listByResourceGroupLocationNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupLocationResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "listByResourceGroupLocationNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupLocationComplete enumerates all values, automatically crossing page boundaries as required. -func (client LongTermRetentionBackupsClient) ListByResourceGroupLocationComplete(ctx context.Context, resourceGroupName string, locationName string, onlyLatestPerDatabase *bool, databaseState LongTermRetentionDatabaseState) (result LongTermRetentionBackupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupsClient.ListByResourceGroupLocation") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroupLocation(ctx, resourceGroupName, locationName, onlyLatestPerDatabase, databaseState) - return -} - -// ListByResourceGroupServer lists the long term retention backups for a given 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. -// locationName - the location of the database -// longTermRetentionServerName - the name of the server -// onlyLatestPerDatabase - whether or not to only get the latest backup for each database. -// databaseState - whether to query against just live databases, just deleted databases, or all databases. -func (client LongTermRetentionBackupsClient) ListByResourceGroupServer(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, onlyLatestPerDatabase *bool, databaseState LongTermRetentionDatabaseState) (result LongTermRetentionBackupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupsClient.ListByResourceGroupServer") - defer func() { - sc := -1 - if result.ltrblr.Response.Response != nil { - sc = result.ltrblr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupServerNextResults - req, err := client.ListByResourceGroupServerPreparer(ctx, resourceGroupName, locationName, longTermRetentionServerName, onlyLatestPerDatabase, databaseState) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "ListByResourceGroupServer", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupServerSender(req) - if err != nil { - result.ltrblr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "ListByResourceGroupServer", resp, "Failure sending request") - return - } - - result.ltrblr, err = client.ListByResourceGroupServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "ListByResourceGroupServer", resp, "Failure responding to request") - } - - return -} - -// ListByResourceGroupServerPreparer prepares the ListByResourceGroupServer request. -func (client LongTermRetentionBackupsClient) ListByResourceGroupServerPreparer(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, onlyLatestPerDatabase *bool, databaseState LongTermRetentionDatabaseState) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "locationName": autorest.Encode("path", locationName), - "longTermRetentionServerName": autorest.Encode("path", longTermRetentionServerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-03-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if onlyLatestPerDatabase != nil { - queryParameters["onlyLatestPerDatabase"] = autorest.Encode("query", *onlyLatestPerDatabase) - } - if len(string(databaseState)) > 0 { - queryParameters["databaseState"] = autorest.Encode("query", databaseState) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionBackups", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupServerSender sends the ListByResourceGroupServer request. The method will close the -// http.Response Body if it receives an error. -func (client LongTermRetentionBackupsClient) ListByResourceGroupServerSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByResourceGroupServerResponder handles the response to the ListByResourceGroupServer request. The method always -// closes the http.Response Body. -func (client LongTermRetentionBackupsClient) ListByResourceGroupServerResponder(resp *http.Response) (result LongTermRetentionBackupListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupServerNextResults retrieves the next set of results, if any. -func (client LongTermRetentionBackupsClient) listByResourceGroupServerNextResults(ctx context.Context, lastResults LongTermRetentionBackupListResult) (result LongTermRetentionBackupListResult, err error) { - req, err := lastResults.longTermRetentionBackupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "listByResourceGroupServerNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupServerSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "listByResourceGroupServerNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "listByResourceGroupServerNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupServerComplete enumerates all values, automatically crossing page boundaries as required. -func (client LongTermRetentionBackupsClient) ListByResourceGroupServerComplete(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, onlyLatestPerDatabase *bool, databaseState LongTermRetentionDatabaseState) (result LongTermRetentionBackupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupsClient.ListByResourceGroupServer") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroupServer(ctx, resourceGroupName, locationName, longTermRetentionServerName, onlyLatestPerDatabase, databaseState) - return -} - -// ListByServer lists the long term retention backups for a given server. -// Parameters: -// locationName - the location of the database -// longTermRetentionServerName - the name of the server -// onlyLatestPerDatabase - whether or not to only get the latest backup for each database. -// databaseState - whether to query against just live databases, just deleted databases, or all databases. -func (client LongTermRetentionBackupsClient) ListByServer(ctx context.Context, locationName string, longTermRetentionServerName string, onlyLatestPerDatabase *bool, databaseState LongTermRetentionDatabaseState) (result LongTermRetentionBackupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupsClient.ListByServer") - defer func() { - sc := -1 - if result.ltrblr.Response.Response != nil { - sc = result.ltrblr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByServerNextResults - req, err := client.ListByServerPreparer(ctx, locationName, longTermRetentionServerName, onlyLatestPerDatabase, databaseState) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "ListByServer", nil, "Failure preparing request") - return - } - - resp, err := client.ListByServerSender(req) - if err != nil { - result.ltrblr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "ListByServer", resp, "Failure sending request") - return - } - - result.ltrblr, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "ListByServer", resp, "Failure responding to request") - } - - return -} - -// ListByServerPreparer prepares the ListByServer request. -func (client LongTermRetentionBackupsClient) ListByServerPreparer(ctx context.Context, locationName string, longTermRetentionServerName string, onlyLatestPerDatabase *bool, databaseState LongTermRetentionDatabaseState) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "locationName": autorest.Encode("path", locationName), - "longTermRetentionServerName": autorest.Encode("path", longTermRetentionServerName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-03-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if onlyLatestPerDatabase != nil { - queryParameters["onlyLatestPerDatabase"] = autorest.Encode("query", *onlyLatestPerDatabase) - } - if len(string(databaseState)) > 0 { - queryParameters["databaseState"] = autorest.Encode("query", databaseState) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionBackups", 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 LongTermRetentionBackupsClient) 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 LongTermRetentionBackupsClient) ListByServerResponder(resp *http.Response) (result LongTermRetentionBackupListResult, 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 LongTermRetentionBackupsClient) listByServerNextResults(ctx context.Context, lastResults LongTermRetentionBackupListResult) (result LongTermRetentionBackupListResult, err error) { - req, err := lastResults.longTermRetentionBackupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "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.LongTermRetentionBackupsClient", "listByServerNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "listByServerNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByServerComplete enumerates all values, automatically crossing page boundaries as required. -func (client LongTermRetentionBackupsClient) ListByServerComplete(ctx context.Context, locationName string, longTermRetentionServerName string, onlyLatestPerDatabase *bool, databaseState LongTermRetentionDatabaseState) (result LongTermRetentionBackupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupsClient.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, locationName, longTermRetentionServerName, onlyLatestPerDatabase, databaseState) - return -} diff --git a/services/preview/sql/mgmt/2018-06-15-preview/sql/managedbackupshorttermretentionpolicies.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/managedbackupshorttermretentionpolicies.go deleted file mode 100644 index dec37cea9ef0..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/managedbackupshorttermretentionpolicies.go +++ /dev/null @@ -1,412 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// ManagedBackupShortTermRetentionPoliciesClient is the the Azure SQL Database management API provides a RESTful set of -// web services that interact with Azure SQL Database services to manage your databases. The API enables you to create, -// retrieve, update, and delete databases. -type ManagedBackupShortTermRetentionPoliciesClient struct { - BaseClient -} - -// NewManagedBackupShortTermRetentionPoliciesClient creates an instance of the -// ManagedBackupShortTermRetentionPoliciesClient client. -func NewManagedBackupShortTermRetentionPoliciesClient(subscriptionID string) ManagedBackupShortTermRetentionPoliciesClient { - return NewManagedBackupShortTermRetentionPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewManagedBackupShortTermRetentionPoliciesClientWithBaseURI creates an instance of the -// ManagedBackupShortTermRetentionPoliciesClient client. -func NewManagedBackupShortTermRetentionPoliciesClientWithBaseURI(baseURI string, subscriptionID string) ManagedBackupShortTermRetentionPoliciesClient { - return ManagedBackupShortTermRetentionPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate updates a managed database's short term retention policy. -// 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. -// managedInstanceName - the name of the managed instance. -// databaseName - the name of the database. -// parameters - the short term retention policy info. -func (client ManagedBackupShortTermRetentionPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedBackupShortTermRetentionPolicy) (result ManagedBackupShortTermRetentionPoliciesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedBackupShortTermRetentionPoliciesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, managedInstanceName, databaseName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedBackupShortTermRetentionPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedBackupShortTermRetentionPoliciesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ManagedBackupShortTermRetentionPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedBackupShortTermRetentionPolicy) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "policyName": autorest.Encode("path", "default"), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-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.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ManagedBackupShortTermRetentionPoliciesClient) CreateOrUpdateSender(req *http.Request) (future ManagedBackupShortTermRetentionPoliciesCreateOrUpdateFuture, 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 ManagedBackupShortTermRetentionPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result ManagedBackupShortTermRetentionPolicy, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get gets a managed database's short term retention policy. -// 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. -// managedInstanceName - the name of the managed instance. -// databaseName - the name of the database. -func (client ManagedBackupShortTermRetentionPoliciesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string) (result ManagedBackupShortTermRetentionPolicy, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedBackupShortTermRetentionPoliciesClient.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, managedInstanceName, databaseName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedBackupShortTermRetentionPoliciesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ManagedBackupShortTermRetentionPoliciesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedBackupShortTermRetentionPoliciesClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ManagedBackupShortTermRetentionPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "policyName": autorest.Encode("path", "default"), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "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/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ManagedBackupShortTermRetentionPoliciesClient) 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 ManagedBackupShortTermRetentionPoliciesClient) GetResponder(resp *http.Response) (result ManagedBackupShortTermRetentionPolicy, 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 gets a managed database's short term retention policy list. -// 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. -// managedInstanceName - the name of the managed instance. -// databaseName - the name of the database. -func (client ManagedBackupShortTermRetentionPoliciesClient) ListByDatabase(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string) (result ManagedBackupShortTermRetentionPolicyListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedBackupShortTermRetentionPoliciesClient.ListByDatabase") - defer func() { - sc := -1 - if result.mbstrplr.Response.Response != nil { - sc = result.mbstrplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByDatabaseNextResults - req, err := client.ListByDatabasePreparer(ctx, resourceGroupName, managedInstanceName, databaseName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedBackupShortTermRetentionPoliciesClient", "ListByDatabase", nil, "Failure preparing request") - return - } - - resp, err := client.ListByDatabaseSender(req) - if err != nil { - result.mbstrplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ManagedBackupShortTermRetentionPoliciesClient", "ListByDatabase", resp, "Failure sending request") - return - } - - result.mbstrplr, err = client.ListByDatabaseResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedBackupShortTermRetentionPoliciesClient", "ListByDatabase", resp, "Failure responding to request") - } - - return -} - -// ListByDatabasePreparer prepares the ListByDatabase request. -func (client ManagedBackupShortTermRetentionPoliciesClient) ListByDatabasePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "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/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies", 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 ManagedBackupShortTermRetentionPoliciesClient) 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 ManagedBackupShortTermRetentionPoliciesClient) ListByDatabaseResponder(resp *http.Response) (result ManagedBackupShortTermRetentionPolicyListResult, 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 ManagedBackupShortTermRetentionPoliciesClient) listByDatabaseNextResults(ctx context.Context, lastResults ManagedBackupShortTermRetentionPolicyListResult) (result ManagedBackupShortTermRetentionPolicyListResult, err error) { - req, err := lastResults.managedBackupShortTermRetentionPolicyListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.ManagedBackupShortTermRetentionPoliciesClient", "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.ManagedBackupShortTermRetentionPoliciesClient", "listByDatabaseNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByDatabaseResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedBackupShortTermRetentionPoliciesClient", "listByDatabaseNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByDatabaseComplete enumerates all values, automatically crossing page boundaries as required. -func (client ManagedBackupShortTermRetentionPoliciesClient) ListByDatabaseComplete(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string) (result ManagedBackupShortTermRetentionPolicyListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedBackupShortTermRetentionPoliciesClient.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, managedInstanceName, databaseName) - return -} - -// Update updates a managed database's short term retention policy. -// 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. -// managedInstanceName - the name of the managed instance. -// databaseName - the name of the database. -// parameters - the short term retention policy info. -func (client ManagedBackupShortTermRetentionPoliciesClient) Update(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedBackupShortTermRetentionPolicy) (result ManagedBackupShortTermRetentionPoliciesUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedBackupShortTermRetentionPoliciesClient.Update") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, managedInstanceName, databaseName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedBackupShortTermRetentionPoliciesClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedBackupShortTermRetentionPoliciesClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client ManagedBackupShortTermRetentionPoliciesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedBackupShortTermRetentionPolicy) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "policyName": autorest.Encode("path", "default"), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-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.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}", 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 ManagedBackupShortTermRetentionPoliciesClient) UpdateSender(req *http.Request) (future ManagedBackupShortTermRetentionPoliciesUpdateFuture, 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 ManagedBackupShortTermRetentionPoliciesClient) UpdateResponder(resp *http.Response) (result ManagedBackupShortTermRetentionPolicy, 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/sql/mgmt/2018-06-15-preview/sql/manageddatabaserestoredetails.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/manageddatabaserestoredetails.go deleted file mode 100644 index 727b63bb9028..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/manageddatabaserestoredetails.go +++ /dev/null @@ -1,125 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// ManagedDatabaseRestoreDetailsClient is the the Azure SQL Database management API provides a RESTful set of web -// services that interact with Azure SQL Database services to manage your databases. The API enables you to create, -// retrieve, update, and delete databases. -type ManagedDatabaseRestoreDetailsClient struct { - BaseClient -} - -// NewManagedDatabaseRestoreDetailsClient creates an instance of the ManagedDatabaseRestoreDetailsClient client. -func NewManagedDatabaseRestoreDetailsClient(subscriptionID string) ManagedDatabaseRestoreDetailsClient { - return NewManagedDatabaseRestoreDetailsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewManagedDatabaseRestoreDetailsClientWithBaseURI creates an instance of the ManagedDatabaseRestoreDetailsClient -// client. -func NewManagedDatabaseRestoreDetailsClientWithBaseURI(baseURI string, subscriptionID string) ManagedDatabaseRestoreDetailsClient { - return ManagedDatabaseRestoreDetailsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets managed database restore details. -// 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. -// managedInstanceName - the name of the managed instance. -// databaseName - the name of the database. -func (client ManagedDatabaseRestoreDetailsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string) (result ManagedDatabaseRestoreDetailsResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseRestoreDetailsClient.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, managedInstanceName, databaseName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseRestoreDetailsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseRestoreDetailsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseRestoreDetailsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ManagedDatabaseRestoreDetailsClient) GetPreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "restoreDetailsName": autorest.Encode("path", "Default"), - "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.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/restoreDetails/{restoreDetailsName}", 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 ManagedDatabaseRestoreDetailsClient) 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 ManagedDatabaseRestoreDetailsClient) GetResponder(resp *http.Response) (result ManagedDatabaseRestoreDetailsResult, 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/sql/mgmt/2018-06-15-preview/sql/manageddatabases.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/manageddatabases.go deleted file mode 100644 index 76430e3bd4dc..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/manageddatabases.go +++ /dev/null @@ -1,573 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the 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" -) - -// ManagedDatabasesClient is the the Azure SQL Database management API provides a RESTful set of web services that -// interact with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, -// and delete databases. -type ManagedDatabasesClient struct { - BaseClient -} - -// NewManagedDatabasesClient creates an instance of the ManagedDatabasesClient client. -func NewManagedDatabasesClient(subscriptionID string) ManagedDatabasesClient { - return NewManagedDatabasesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewManagedDatabasesClientWithBaseURI creates an instance of the ManagedDatabasesClient client. -func NewManagedDatabasesClientWithBaseURI(baseURI string, subscriptionID string) ManagedDatabasesClient { - return ManagedDatabasesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CompleteRestore completes the restore operation on a managed 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. -// managedInstanceName - the name of the managed instance. -// databaseName - the name of the database. -// parameters - the definition for completing the restore of this managed database. -func (client ManagedDatabasesClient) CompleteRestore(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters CompleteDatabaseRestoreDefinition) (result ManagedDatabasesCompleteRestoreFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabasesClient.CompleteRestore") - 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.LastBackupName", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("sql.ManagedDatabasesClient", "CompleteRestore", err.Error()) - } - - req, err := client.CompleteRestorePreparer(ctx, resourceGroupName, managedInstanceName, databaseName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesClient", "CompleteRestore", nil, "Failure preparing request") - return - } - - result, err = client.CompleteRestoreSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesClient", "CompleteRestore", result.Response(), "Failure sending request") - return - } - - return -} - -// CompleteRestorePreparer prepares the CompleteRestore request. -func (client ManagedDatabasesClient) CompleteRestorePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters CompleteDatabaseRestoreDefinition) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/completeRestore", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CompleteRestoreSender sends the CompleteRestore request. The method will close the -// http.Response Body if it receives an error. -func (client ManagedDatabasesClient) CompleteRestoreSender(req *http.Request) (future ManagedDatabasesCompleteRestoreFuture, 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 -} - -// CompleteRestoreResponder handles the response to the CompleteRestore request. The method always -// closes the http.Response Body. -func (client ManagedDatabasesClient) CompleteRestoreResponder(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 -} - -// CreateOrUpdate creates a new database or updates an existing 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. -// managedInstanceName - the name of the managed instance. -// databaseName - the name of the database. -// parameters - the requested database resource state. -func (client ManagedDatabasesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedDatabase) (result ManagedDatabasesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabasesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, managedInstanceName, databaseName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ManagedDatabasesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedDatabase) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "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.Sql/managedInstances/{managedInstanceName}/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 ManagedDatabasesClient) CreateOrUpdateSender(req *http.Request) (future ManagedDatabasesCreateOrUpdateFuture, 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 ManagedDatabasesClient) CreateOrUpdateResponder(resp *http.Response) (result ManagedDatabase, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a managed 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. -// managedInstanceName - the name of the managed instance. -// databaseName - the name of the database. -func (client ManagedDatabasesClient) Delete(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string) (result ManagedDatabasesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabasesClient.Delete") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, managedInstanceName, databaseName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ManagedDatabasesClient) DeletePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "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.Sql/managedInstances/{managedInstanceName}/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 ManagedDatabasesClient) DeleteSender(req *http.Request) (future ManagedDatabasesDeleteFuture, 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 ManagedDatabasesClient) 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 managed 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. -// managedInstanceName - the name of the managed instance. -// databaseName - the name of the database. -func (client ManagedDatabasesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string) (result ManagedDatabase, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabasesClient.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, managedInstanceName, databaseName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ManagedDatabasesClient) GetPreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "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.Sql/managedInstances/{managedInstanceName}/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 ManagedDatabasesClient) 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 ManagedDatabasesClient) GetResponder(resp *http.Response) (result ManagedDatabase, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByInstance gets a list of managed databases. -// 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. -// managedInstanceName - the name of the managed instance. -func (client ManagedDatabasesClient) ListByInstance(ctx context.Context, resourceGroupName string, managedInstanceName string) (result ManagedDatabaseListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabasesClient.ListByInstance") - defer func() { - sc := -1 - if result.mdlr.Response.Response != nil { - sc = result.mdlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByInstanceNextResults - req, err := client.ListByInstancePreparer(ctx, resourceGroupName, managedInstanceName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesClient", "ListByInstance", nil, "Failure preparing request") - return - } - - resp, err := client.ListByInstanceSender(req) - if err != nil { - result.mdlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesClient", "ListByInstance", resp, "Failure sending request") - return - } - - result.mdlr, err = client.ListByInstanceResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesClient", "ListByInstance", resp, "Failure responding to request") - } - - return -} - -// ListByInstancePreparer prepares the ListByInstance request. -func (client ManagedDatabasesClient) ListByInstancePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "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.Sql/managedInstances/{managedInstanceName}/databases", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByInstanceSender sends the ListByInstance request. The method will close the -// http.Response Body if it receives an error. -func (client ManagedDatabasesClient) ListByInstanceSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByInstanceResponder handles the response to the ListByInstance request. The method always -// closes the http.Response Body. -func (client ManagedDatabasesClient) ListByInstanceResponder(resp *http.Response) (result ManagedDatabaseListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByInstanceNextResults retrieves the next set of results, if any. -func (client ManagedDatabasesClient) listByInstanceNextResults(ctx context.Context, lastResults ManagedDatabaseListResult) (result ManagedDatabaseListResult, err error) { - req, err := lastResults.managedDatabaseListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.ManagedDatabasesClient", "listByInstanceNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByInstanceSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "sql.ManagedDatabasesClient", "listByInstanceNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByInstanceResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesClient", "listByInstanceNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByInstanceComplete enumerates all values, automatically crossing page boundaries as required. -func (client ManagedDatabasesClient) ListByInstanceComplete(ctx context.Context, resourceGroupName string, managedInstanceName string) (result ManagedDatabaseListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabasesClient.ListByInstance") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByInstance(ctx, resourceGroupName, managedInstanceName) - return -} - -// Update updates an existing 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. -// managedInstanceName - the name of the managed instance. -// databaseName - the name of the database. -// parameters - the requested database resource state. -func (client ManagedDatabasesClient) Update(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedDatabaseUpdate) (result ManagedDatabasesUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabasesClient.Update") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, managedInstanceName, databaseName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client ManagedDatabasesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedDatabaseUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "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.Sql/managedInstances/{managedInstanceName}/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 ManagedDatabasesClient) UpdateSender(req *http.Request) (future ManagedDatabasesUpdateFuture, 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 ManagedDatabasesClient) UpdateResponder(resp *http.Response) (result ManagedDatabase, 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/sql/mgmt/2018-06-15-preview/sql/manageddatabasesecurityalertpolicies.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/manageddatabasesecurityalertpolicies.go deleted file mode 100644 index 8fc35a56c94f..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/manageddatabasesecurityalertpolicies.go +++ /dev/null @@ -1,328 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// ManagedDatabaseSecurityAlertPoliciesClient is the the Azure SQL Database management API provides a RESTful set of -// web services that interact with Azure SQL Database services to manage your databases. The API enables you to create, -// retrieve, update, and delete databases. -type ManagedDatabaseSecurityAlertPoliciesClient struct { - BaseClient -} - -// NewManagedDatabaseSecurityAlertPoliciesClient creates an instance of the ManagedDatabaseSecurityAlertPoliciesClient -// client. -func NewManagedDatabaseSecurityAlertPoliciesClient(subscriptionID string) ManagedDatabaseSecurityAlertPoliciesClient { - return NewManagedDatabaseSecurityAlertPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewManagedDatabaseSecurityAlertPoliciesClientWithBaseURI creates an instance of the -// ManagedDatabaseSecurityAlertPoliciesClient client. -func NewManagedDatabaseSecurityAlertPoliciesClientWithBaseURI(baseURI string, subscriptionID string) ManagedDatabaseSecurityAlertPoliciesClient { - return ManagedDatabaseSecurityAlertPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a database's security alert policy. -// 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. -// managedInstanceName - the name of the managed instance. -// databaseName - the name of the managed database for which the security alert policy is defined. -// parameters - the database security alert policy. -func (client ManagedDatabaseSecurityAlertPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedDatabaseSecurityAlertPolicy) (result ManagedDatabaseSecurityAlertPolicy, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseSecurityAlertPoliciesClient.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, managedInstanceName, databaseName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseSecurityAlertPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseSecurityAlertPoliciesClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseSecurityAlertPoliciesClient", "CreateOrUpdate", resp, "Failure responding to request") - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ManagedDatabaseSecurityAlertPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedDatabaseSecurityAlertPolicy) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "securityAlertPolicyName": autorest.Encode("path", "default"), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-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.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}", 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 ManagedDatabaseSecurityAlertPoliciesClient) 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 ManagedDatabaseSecurityAlertPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result ManagedDatabaseSecurityAlertPolicy, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get gets a managed database's security alert policy. -// 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. -// managedInstanceName - the name of the managed instance. -// databaseName - the name of the managed database for which the security alert policy is defined. -func (client ManagedDatabaseSecurityAlertPoliciesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string) (result ManagedDatabaseSecurityAlertPolicy, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseSecurityAlertPoliciesClient.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, managedInstanceName, databaseName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseSecurityAlertPoliciesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseSecurityAlertPoliciesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseSecurityAlertPoliciesClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ManagedDatabaseSecurityAlertPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "securityAlertPolicyName": autorest.Encode("path", "default"), - "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/managedInstances/{managedInstanceName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}", 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 ManagedDatabaseSecurityAlertPoliciesClient) 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 ManagedDatabaseSecurityAlertPoliciesClient) GetResponder(resp *http.Response) (result ManagedDatabaseSecurityAlertPolicy, 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 gets a list of managed database's security alert policies. -// 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. -// managedInstanceName - the name of the managed instance. -// databaseName - the name of the managed database for which the security alert policies are defined. -func (client ManagedDatabaseSecurityAlertPoliciesClient) ListByDatabase(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string) (result ManagedDatabaseSecurityAlertPolicyListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseSecurityAlertPoliciesClient.ListByDatabase") - defer func() { - sc := -1 - if result.mdsaplr.Response.Response != nil { - sc = result.mdsaplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByDatabaseNextResults - req, err := client.ListByDatabasePreparer(ctx, resourceGroupName, managedInstanceName, databaseName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseSecurityAlertPoliciesClient", "ListByDatabase", nil, "Failure preparing request") - return - } - - resp, err := client.ListByDatabaseSender(req) - if err != nil { - result.mdsaplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseSecurityAlertPoliciesClient", "ListByDatabase", resp, "Failure sending request") - return - } - - result.mdsaplr, err = client.ListByDatabaseResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseSecurityAlertPoliciesClient", "ListByDatabase", resp, "Failure responding to request") - } - - return -} - -// ListByDatabasePreparer prepares the ListByDatabase request. -func (client ManagedDatabaseSecurityAlertPoliciesClient) ListByDatabasePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "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/managedInstances/{managedInstanceName}/databases/{databaseName}/securityAlertPolicies", 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 ManagedDatabaseSecurityAlertPoliciesClient) 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 ManagedDatabaseSecurityAlertPoliciesClient) ListByDatabaseResponder(resp *http.Response) (result ManagedDatabaseSecurityAlertPolicyListResult, 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 ManagedDatabaseSecurityAlertPoliciesClient) listByDatabaseNextResults(ctx context.Context, lastResults ManagedDatabaseSecurityAlertPolicyListResult) (result ManagedDatabaseSecurityAlertPolicyListResult, err error) { - req, err := lastResults.managedDatabaseSecurityAlertPolicyListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.ManagedDatabaseSecurityAlertPoliciesClient", "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.ManagedDatabaseSecurityAlertPoliciesClient", "listByDatabaseNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByDatabaseResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseSecurityAlertPoliciesClient", "listByDatabaseNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByDatabaseComplete enumerates all values, automatically crossing page boundaries as required. -func (client ManagedDatabaseSecurityAlertPoliciesClient) ListByDatabaseComplete(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string) (result ManagedDatabaseSecurityAlertPolicyListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseSecurityAlertPoliciesClient.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, managedInstanceName, databaseName) - return -} diff --git a/services/preview/sql/mgmt/2018-06-15-preview/sql/manageddatabasesensitivitylabels.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/manageddatabasesensitivitylabels.go deleted file mode 100644 index 657a41c92c88..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/manageddatabasesensitivitylabels.go +++ /dev/null @@ -1,732 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// ManagedDatabaseSensitivityLabelsClient is the the Azure SQL Database management API provides a RESTful set of web -// services that interact with Azure SQL Database services to manage your databases. The API enables you to create, -// retrieve, update, and delete databases. -type ManagedDatabaseSensitivityLabelsClient struct { - BaseClient -} - -// NewManagedDatabaseSensitivityLabelsClient creates an instance of the ManagedDatabaseSensitivityLabelsClient client. -func NewManagedDatabaseSensitivityLabelsClient(subscriptionID string) ManagedDatabaseSensitivityLabelsClient { - return NewManagedDatabaseSensitivityLabelsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewManagedDatabaseSensitivityLabelsClientWithBaseURI creates an instance of the -// ManagedDatabaseSensitivityLabelsClient client. -func NewManagedDatabaseSensitivityLabelsClientWithBaseURI(baseURI string, subscriptionID string) ManagedDatabaseSensitivityLabelsClient { - return ManagedDatabaseSensitivityLabelsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates the sensitivity label of a given column -// 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. -// managedInstanceName - the name of the managed instance. -// databaseName - the name of the database. -// schemaName - the name of the schema. -// tableName - the name of the table. -// columnName - the name of the column. -// parameters - the column sensitivity label resource. -func (client ManagedDatabaseSensitivityLabelsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, columnName string, parameters SensitivityLabel) (result SensitivityLabel, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseSensitivityLabelsClient.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, managedInstanceName, databaseName, schemaName, tableName, columnName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseSensitivityLabelsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseSensitivityLabelsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseSensitivityLabelsClient", "CreateOrUpdate", resp, "Failure responding to request") - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ManagedDatabaseSensitivityLabelsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, columnName string, parameters SensitivityLabel) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "columnName": autorest.Encode("path", columnName), - "databaseName": autorest.Encode("path", databaseName), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "schemaName": autorest.Encode("path", schemaName), - "sensitivityLabelSource": autorest.Encode("path", "current"), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "tableName": autorest.Encode("path", tableName), - } - - 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.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}", 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 ManagedDatabaseSensitivityLabelsClient) 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 ManagedDatabaseSensitivityLabelsClient) CreateOrUpdateResponder(resp *http.Response) (result SensitivityLabel, 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 sensitivity label of a given column -// 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. -// managedInstanceName - the name of the managed instance. -// databaseName - the name of the database. -// schemaName - the name of the schema. -// tableName - the name of the table. -// columnName - the name of the column. -func (client ManagedDatabaseSensitivityLabelsClient) Delete(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, columnName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseSensitivityLabelsClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseSensitivityLabelsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseSensitivityLabelsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseSensitivityLabelsClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ManagedDatabaseSensitivityLabelsClient) DeletePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, columnName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "columnName": autorest.Encode("path", columnName), - "databaseName": autorest.Encode("path", databaseName), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "schemaName": autorest.Encode("path", schemaName), - "sensitivityLabelSource": autorest.Encode("path", "current"), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "tableName": autorest.Encode("path", tableName), - } - - 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.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}", 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 ManagedDatabaseSensitivityLabelsClient) 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 ManagedDatabaseSensitivityLabelsClient) 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 -} - -// DisableRecommendation disables sensitivity recommendations on a given column -// 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. -// managedInstanceName - the name of the managed instance. -// databaseName - the name of the database. -// schemaName - the name of the schema. -// tableName - the name of the table. -// columnName - the name of the column. -func (client ManagedDatabaseSensitivityLabelsClient) DisableRecommendation(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, columnName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseSensitivityLabelsClient.DisableRecommendation") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DisableRecommendationPreparer(ctx, resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseSensitivityLabelsClient", "DisableRecommendation", nil, "Failure preparing request") - return - } - - resp, err := client.DisableRecommendationSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseSensitivityLabelsClient", "DisableRecommendation", resp, "Failure sending request") - return - } - - result, err = client.DisableRecommendationResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseSensitivityLabelsClient", "DisableRecommendation", resp, "Failure responding to request") - } - - return -} - -// DisableRecommendationPreparer prepares the DisableRecommendation request. -func (client ManagedDatabaseSensitivityLabelsClient) DisableRecommendationPreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, columnName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "columnName": autorest.Encode("path", columnName), - "databaseName": autorest.Encode("path", databaseName), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "schemaName": autorest.Encode("path", schemaName), - "sensitivityLabelSource": autorest.Encode("path", "recommended"), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "tableName": autorest.Encode("path", tableName), - } - - 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.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/disable", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DisableRecommendationSender sends the DisableRecommendation request. The method will close the -// http.Response Body if it receives an error. -func (client ManagedDatabaseSensitivityLabelsClient) DisableRecommendationSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// DisableRecommendationResponder handles the response to the DisableRecommendation request. The method always -// closes the http.Response Body. -func (client ManagedDatabaseSensitivityLabelsClient) DisableRecommendationResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// EnableRecommendation enables sensitivity recommendations on a given column (recommendations are enabled by default -// on all columns) -// 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. -// managedInstanceName - the name of the managed instance. -// databaseName - the name of the database. -// schemaName - the name of the schema. -// tableName - the name of the table. -// columnName - the name of the column. -func (client ManagedDatabaseSensitivityLabelsClient) EnableRecommendation(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, columnName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseSensitivityLabelsClient.EnableRecommendation") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.EnableRecommendationPreparer(ctx, resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseSensitivityLabelsClient", "EnableRecommendation", nil, "Failure preparing request") - return - } - - resp, err := client.EnableRecommendationSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseSensitivityLabelsClient", "EnableRecommendation", resp, "Failure sending request") - return - } - - result, err = client.EnableRecommendationResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseSensitivityLabelsClient", "EnableRecommendation", resp, "Failure responding to request") - } - - return -} - -// EnableRecommendationPreparer prepares the EnableRecommendation request. -func (client ManagedDatabaseSensitivityLabelsClient) EnableRecommendationPreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, columnName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "columnName": autorest.Encode("path", columnName), - "databaseName": autorest.Encode("path", databaseName), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "schemaName": autorest.Encode("path", schemaName), - "sensitivityLabelSource": autorest.Encode("path", "recommended"), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "tableName": autorest.Encode("path", tableName), - } - - 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.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/enable", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// EnableRecommendationSender sends the EnableRecommendation request. The method will close the -// http.Response Body if it receives an error. -func (client ManagedDatabaseSensitivityLabelsClient) EnableRecommendationSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// EnableRecommendationResponder handles the response to the EnableRecommendation request. The method always -// closes the http.Response Body. -func (client ManagedDatabaseSensitivityLabelsClient) EnableRecommendationResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the sensitivity label of a given column -// 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. -// managedInstanceName - the name of the managed instance. -// databaseName - the name of the database. -// schemaName - the name of the schema. -// tableName - the name of the table. -// columnName - the name of the column. -// sensitivityLabelSource - the source of the sensitivity label. -func (client ManagedDatabaseSensitivityLabelsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, columnName string, sensitivityLabelSource SensitivityLabelSource) (result SensitivityLabel, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseSensitivityLabelsClient.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, managedInstanceName, databaseName, schemaName, tableName, columnName, sensitivityLabelSource) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseSensitivityLabelsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseSensitivityLabelsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseSensitivityLabelsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ManagedDatabaseSensitivityLabelsClient) GetPreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, columnName string, sensitivityLabelSource SensitivityLabelSource) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "columnName": autorest.Encode("path", columnName), - "databaseName": autorest.Encode("path", databaseName), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "schemaName": autorest.Encode("path", schemaName), - "sensitivityLabelSource": autorest.Encode("path", sensitivityLabelSource), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "tableName": autorest.Encode("path", tableName), - } - - 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.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}", 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 ManagedDatabaseSensitivityLabelsClient) 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 ManagedDatabaseSensitivityLabelsClient) GetResponder(resp *http.Response) (result SensitivityLabel, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListCurrentByDatabase gets the sensitivity labels of a given 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. -// managedInstanceName - the name of the managed instance. -// databaseName - the name of the database. -// filter - an OData filter expression that filters elements in the collection. -func (client ManagedDatabaseSensitivityLabelsClient) ListCurrentByDatabase(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, filter string) (result SensitivityLabelListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseSensitivityLabelsClient.ListCurrentByDatabase") - defer func() { - sc := -1 - if result.sllr.Response.Response != nil { - sc = result.sllr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listCurrentByDatabaseNextResults - req, err := client.ListCurrentByDatabasePreparer(ctx, resourceGroupName, managedInstanceName, databaseName, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseSensitivityLabelsClient", "ListCurrentByDatabase", nil, "Failure preparing request") - return - } - - resp, err := client.ListCurrentByDatabaseSender(req) - if err != nil { - result.sllr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseSensitivityLabelsClient", "ListCurrentByDatabase", resp, "Failure sending request") - return - } - - result.sllr, err = client.ListCurrentByDatabaseResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseSensitivityLabelsClient", "ListCurrentByDatabase", resp, "Failure responding to request") - } - - return -} - -// ListCurrentByDatabasePreparer prepares the ListCurrentByDatabase request. -func (client ManagedDatabaseSensitivityLabelsClient) ListCurrentByDatabasePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/currentSensitivityLabels", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListCurrentByDatabaseSender sends the ListCurrentByDatabase request. The method will close the -// http.Response Body if it receives an error. -func (client ManagedDatabaseSensitivityLabelsClient) ListCurrentByDatabaseSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListCurrentByDatabaseResponder handles the response to the ListCurrentByDatabase request. The method always -// closes the http.Response Body. -func (client ManagedDatabaseSensitivityLabelsClient) ListCurrentByDatabaseResponder(resp *http.Response) (result SensitivityLabelListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listCurrentByDatabaseNextResults retrieves the next set of results, if any. -func (client ManagedDatabaseSensitivityLabelsClient) listCurrentByDatabaseNextResults(ctx context.Context, lastResults SensitivityLabelListResult) (result SensitivityLabelListResult, err error) { - req, err := lastResults.sensitivityLabelListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.ManagedDatabaseSensitivityLabelsClient", "listCurrentByDatabaseNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListCurrentByDatabaseSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "sql.ManagedDatabaseSensitivityLabelsClient", "listCurrentByDatabaseNextResults", resp, "Failure sending next results request") - } - result, err = client.ListCurrentByDatabaseResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseSensitivityLabelsClient", "listCurrentByDatabaseNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListCurrentByDatabaseComplete enumerates all values, automatically crossing page boundaries as required. -func (client ManagedDatabaseSensitivityLabelsClient) ListCurrentByDatabaseComplete(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, filter string) (result SensitivityLabelListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseSensitivityLabelsClient.ListCurrentByDatabase") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListCurrentByDatabase(ctx, resourceGroupName, managedInstanceName, databaseName, filter) - return -} - -// ListRecommendedByDatabase gets the sensitivity labels of a given 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. -// managedInstanceName - the name of the managed instance. -// databaseName - the name of the database. -// includeDisabledRecommendations - specifies whether to include disabled recommendations or not. -// filter - an OData filter expression that filters elements in the collection. -func (client ManagedDatabaseSensitivityLabelsClient) ListRecommendedByDatabase(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, includeDisabledRecommendations *bool, skipToken string, filter string) (result SensitivityLabelListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseSensitivityLabelsClient.ListRecommendedByDatabase") - defer func() { - sc := -1 - if result.sllr.Response.Response != nil { - sc = result.sllr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listRecommendedByDatabaseNextResults - req, err := client.ListRecommendedByDatabasePreparer(ctx, resourceGroupName, managedInstanceName, databaseName, includeDisabledRecommendations, skipToken, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseSensitivityLabelsClient", "ListRecommendedByDatabase", nil, "Failure preparing request") - return - } - - resp, err := client.ListRecommendedByDatabaseSender(req) - if err != nil { - result.sllr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseSensitivityLabelsClient", "ListRecommendedByDatabase", resp, "Failure sending request") - return - } - - result.sllr, err = client.ListRecommendedByDatabaseResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseSensitivityLabelsClient", "ListRecommendedByDatabase", resp, "Failure responding to request") - } - - return -} - -// ListRecommendedByDatabasePreparer prepares the ListRecommendedByDatabase request. -func (client ManagedDatabaseSensitivityLabelsClient) ListRecommendedByDatabasePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, includeDisabledRecommendations *bool, skipToken string, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if includeDisabledRecommendations != nil { - queryParameters["includeDisabledRecommendations"] = autorest.Encode("query", *includeDisabledRecommendations) - } - if len(skipToken) > 0 { - queryParameters["$skipToken"] = autorest.Encode("query", skipToken) - } - 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.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/recommendedSensitivityLabels", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListRecommendedByDatabaseSender sends the ListRecommendedByDatabase request. The method will close the -// http.Response Body if it receives an error. -func (client ManagedDatabaseSensitivityLabelsClient) ListRecommendedByDatabaseSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListRecommendedByDatabaseResponder handles the response to the ListRecommendedByDatabase request. The method always -// closes the http.Response Body. -func (client ManagedDatabaseSensitivityLabelsClient) ListRecommendedByDatabaseResponder(resp *http.Response) (result SensitivityLabelListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listRecommendedByDatabaseNextResults retrieves the next set of results, if any. -func (client ManagedDatabaseSensitivityLabelsClient) listRecommendedByDatabaseNextResults(ctx context.Context, lastResults SensitivityLabelListResult) (result SensitivityLabelListResult, err error) { - req, err := lastResults.sensitivityLabelListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.ManagedDatabaseSensitivityLabelsClient", "listRecommendedByDatabaseNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListRecommendedByDatabaseSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "sql.ManagedDatabaseSensitivityLabelsClient", "listRecommendedByDatabaseNextResults", resp, "Failure sending next results request") - } - result, err = client.ListRecommendedByDatabaseResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseSensitivityLabelsClient", "listRecommendedByDatabaseNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListRecommendedByDatabaseComplete enumerates all values, automatically crossing page boundaries as required. -func (client ManagedDatabaseSensitivityLabelsClient) ListRecommendedByDatabaseComplete(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, includeDisabledRecommendations *bool, skipToken string, filter string) (result SensitivityLabelListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseSensitivityLabelsClient.ListRecommendedByDatabase") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListRecommendedByDatabase(ctx, resourceGroupName, managedInstanceName, databaseName, includeDisabledRecommendations, skipToken, filter) - return -} diff --git a/services/preview/sql/mgmt/2018-06-15-preview/sql/manageddatabasevulnerabilityassessmentrulebaselines.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/manageddatabasevulnerabilityassessmentrulebaselines.go deleted file mode 100644 index 1cb0954cae8a..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/manageddatabasevulnerabilityassessmentrulebaselines.go +++ /dev/null @@ -1,313 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the 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" -) - -// ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient is the the Azure SQL Database management API provides a -// RESTful set of web services that interact with Azure SQL Database services to manage your databases. The API enables -// you to create, retrieve, update, and delete databases. -type ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient struct { - BaseClient -} - -// NewManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient creates an instance of the -// ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient client. -func NewManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient(subscriptionID string) ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient { - return NewManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientWithBaseURI creates an instance of the -// ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient client. -func NewManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientWithBaseURI(baseURI string, subscriptionID string) ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient { - return ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a database's vulnerability assessment rule baseline. -// 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. -// managedInstanceName - the name of the managed instance. -// databaseName - the name of the database for which the vulnerability assessment rule baseline is defined. -// ruleID - the vulnerability assessment rule ID. -// baselineName - the name of the vulnerability assessment rule baseline (default implies a baseline on a -// database level rule and master for server level rule). -// parameters - the requested rule baseline resource. -func (client ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, ruleID string, baselineName VulnerabilityAssessmentPolicyBaselineName, parameters DatabaseVulnerabilityAssessmentRuleBaseline) (result DatabaseVulnerabilityAssessmentRuleBaseline, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient.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: parameters, - Constraints: []validation.Constraint{{Target: "parameters.DatabaseVulnerabilityAssessmentRuleBaselineProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.DatabaseVulnerabilityAssessmentRuleBaselineProperties.BaselineResults", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("sql.ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, managedInstanceName, databaseName, ruleID, baselineName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient", "CreateOrUpdate", resp, "Failure responding to request") - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, ruleID string, baselineName VulnerabilityAssessmentPolicyBaselineName, parameters DatabaseVulnerabilityAssessmentRuleBaseline) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "baselineName": autorest.Encode("path", baselineName), - "databaseName": autorest.Encode("path", databaseName), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "ruleId": autorest.Encode("path", ruleID), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vulnerabilityAssessmentName": autorest.Encode("path", "default"), - } - - const APIVersion = "2017-10-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.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}", 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 ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient) 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 ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient) CreateOrUpdateResponder(resp *http.Response) (result DatabaseVulnerabilityAssessmentRuleBaseline, 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 the database's vulnerability assessment rule baseline. -// 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. -// managedInstanceName - the name of the managed instance. -// databaseName - the name of the database for which the vulnerability assessment rule baseline is defined. -// ruleID - the vulnerability assessment rule ID. -// baselineName - the name of the vulnerability assessment rule baseline (default implies a baseline on a -// database level rule and master for server level rule). -func (client ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient) Delete(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, ruleID string, baselineName VulnerabilityAssessmentPolicyBaselineName) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, managedInstanceName, databaseName, ruleID, baselineName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient) DeletePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, ruleID string, baselineName VulnerabilityAssessmentPolicyBaselineName) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "baselineName": autorest.Encode("path", baselineName), - "databaseName": autorest.Encode("path", databaseName), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "ruleId": autorest.Encode("path", ruleID), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vulnerabilityAssessmentName": autorest.Encode("path", "default"), - } - - const APIVersion = "2017-10-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.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}", 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 ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient) 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 ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient) 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 a database's vulnerability assessment rule baseline. -// 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. -// managedInstanceName - the name of the managed instance. -// databaseName - the name of the database for which the vulnerability assessment rule baseline is defined. -// ruleID - the vulnerability assessment rule ID. -// baselineName - the name of the vulnerability assessment rule baseline (default implies a baseline on a -// database level rule and master for server level rule). -func (client ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, ruleID string, baselineName VulnerabilityAssessmentPolicyBaselineName) (result DatabaseVulnerabilityAssessmentRuleBaseline, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient.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, managedInstanceName, databaseName, ruleID, baselineName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient) GetPreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, ruleID string, baselineName VulnerabilityAssessmentPolicyBaselineName) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "baselineName": autorest.Encode("path", baselineName), - "databaseName": autorest.Encode("path", databaseName), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "ruleId": autorest.Encode("path", ruleID), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vulnerabilityAssessmentName": autorest.Encode("path", "default"), - } - - const APIVersion = "2017-10-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/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}", 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 ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient) 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 ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient) GetResponder(resp *http.Response) (result DatabaseVulnerabilityAssessmentRuleBaseline, 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/sql/mgmt/2018-06-15-preview/sql/manageddatabasevulnerabilityassessments.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/manageddatabasevulnerabilityassessments.go deleted file mode 100644 index 404c29a8c123..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/manageddatabasevulnerabilityassessments.go +++ /dev/null @@ -1,408 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// ManagedDatabaseVulnerabilityAssessmentsClient is the the Azure SQL Database management API provides a RESTful set of -// web services that interact with Azure SQL Database services to manage your databases. The API enables you to create, -// retrieve, update, and delete databases. -type ManagedDatabaseVulnerabilityAssessmentsClient struct { - BaseClient -} - -// NewManagedDatabaseVulnerabilityAssessmentsClient creates an instance of the -// ManagedDatabaseVulnerabilityAssessmentsClient client. -func NewManagedDatabaseVulnerabilityAssessmentsClient(subscriptionID string) ManagedDatabaseVulnerabilityAssessmentsClient { - return NewManagedDatabaseVulnerabilityAssessmentsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewManagedDatabaseVulnerabilityAssessmentsClientWithBaseURI creates an instance of the -// ManagedDatabaseVulnerabilityAssessmentsClient client. -func NewManagedDatabaseVulnerabilityAssessmentsClientWithBaseURI(baseURI string, subscriptionID string) ManagedDatabaseVulnerabilityAssessmentsClient { - return ManagedDatabaseVulnerabilityAssessmentsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates the database's vulnerability assessment. -// 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. -// managedInstanceName - the name of the managed instance. -// databaseName - the name of the database for which the vulnerability assessment is defined. -// parameters - the requested resource. -func (client ManagedDatabaseVulnerabilityAssessmentsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters DatabaseVulnerabilityAssessment) (result DatabaseVulnerabilityAssessment, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseVulnerabilityAssessmentsClient.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, managedInstanceName, databaseName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseVulnerabilityAssessmentsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseVulnerabilityAssessmentsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseVulnerabilityAssessmentsClient", "CreateOrUpdate", resp, "Failure responding to request") - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ManagedDatabaseVulnerabilityAssessmentsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters DatabaseVulnerabilityAssessment) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vulnerabilityAssessmentName": autorest.Encode("path", "default"), - } - - const APIVersion = "2017-10-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.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}", 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 ManagedDatabaseVulnerabilityAssessmentsClient) 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 ManagedDatabaseVulnerabilityAssessmentsClient) CreateOrUpdateResponder(resp *http.Response) (result DatabaseVulnerabilityAssessment, 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 removes the database's vulnerability assessment. -// 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. -// managedInstanceName - the name of the managed instance. -// databaseName - the name of the database for which the vulnerability assessment is defined. -func (client ManagedDatabaseVulnerabilityAssessmentsClient) Delete(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseVulnerabilityAssessmentsClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, managedInstanceName, databaseName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseVulnerabilityAssessmentsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseVulnerabilityAssessmentsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseVulnerabilityAssessmentsClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ManagedDatabaseVulnerabilityAssessmentsClient) DeletePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vulnerabilityAssessmentName": autorest.Encode("path", "default"), - } - - const APIVersion = "2017-10-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.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}", 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 ManagedDatabaseVulnerabilityAssessmentsClient) 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 ManagedDatabaseVulnerabilityAssessmentsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the database's vulnerability assessment. -// 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. -// managedInstanceName - the name of the managed instance. -// databaseName - the name of the database for which the vulnerability assessment is defined. -func (client ManagedDatabaseVulnerabilityAssessmentsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string) (result DatabaseVulnerabilityAssessment, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseVulnerabilityAssessmentsClient.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, managedInstanceName, databaseName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseVulnerabilityAssessmentsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseVulnerabilityAssessmentsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseVulnerabilityAssessmentsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ManagedDatabaseVulnerabilityAssessmentsClient) GetPreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vulnerabilityAssessmentName": autorest.Encode("path", "default"), - } - - const APIVersion = "2017-10-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/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}", 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 ManagedDatabaseVulnerabilityAssessmentsClient) 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 ManagedDatabaseVulnerabilityAssessmentsClient) GetResponder(resp *http.Response) (result DatabaseVulnerabilityAssessment, 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 lists the vulnerability assessments of a managed 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. -// managedInstanceName - the name of the managed instance. -// databaseName - the name of the database for which the vulnerability assessment is defined. -func (client ManagedDatabaseVulnerabilityAssessmentsClient) ListByDatabase(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string) (result DatabaseVulnerabilityAssessmentListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseVulnerabilityAssessmentsClient.ListByDatabase") - defer func() { - sc := -1 - if result.dvalr.Response.Response != nil { - sc = result.dvalr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByDatabaseNextResults - req, err := client.ListByDatabasePreparer(ctx, resourceGroupName, managedInstanceName, databaseName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseVulnerabilityAssessmentsClient", "ListByDatabase", nil, "Failure preparing request") - return - } - - resp, err := client.ListByDatabaseSender(req) - if err != nil { - result.dvalr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseVulnerabilityAssessmentsClient", "ListByDatabase", resp, "Failure sending request") - return - } - - result.dvalr, err = client.ListByDatabaseResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseVulnerabilityAssessmentsClient", "ListByDatabase", resp, "Failure responding to request") - } - - return -} - -// ListByDatabasePreparer prepares the ListByDatabase request. -func (client ManagedDatabaseVulnerabilityAssessmentsClient) ListByDatabasePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-10-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/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments", 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 ManagedDatabaseVulnerabilityAssessmentsClient) 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 ManagedDatabaseVulnerabilityAssessmentsClient) ListByDatabaseResponder(resp *http.Response) (result DatabaseVulnerabilityAssessmentListResult, 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 ManagedDatabaseVulnerabilityAssessmentsClient) listByDatabaseNextResults(ctx context.Context, lastResults DatabaseVulnerabilityAssessmentListResult) (result DatabaseVulnerabilityAssessmentListResult, err error) { - req, err := lastResults.databaseVulnerabilityAssessmentListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.ManagedDatabaseVulnerabilityAssessmentsClient", "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.ManagedDatabaseVulnerabilityAssessmentsClient", "listByDatabaseNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByDatabaseResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseVulnerabilityAssessmentsClient", "listByDatabaseNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByDatabaseComplete enumerates all values, automatically crossing page boundaries as required. -func (client ManagedDatabaseVulnerabilityAssessmentsClient) ListByDatabaseComplete(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string) (result DatabaseVulnerabilityAssessmentListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseVulnerabilityAssessmentsClient.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, managedInstanceName, databaseName) - return -} diff --git a/services/preview/sql/mgmt/2018-06-15-preview/sql/manageddatabasevulnerabilityassessmentscans.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/manageddatabasevulnerabilityassessmentscans.go deleted file mode 100644 index 029bf35400a3..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/manageddatabasevulnerabilityassessmentscans.go +++ /dev/null @@ -1,412 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// ManagedDatabaseVulnerabilityAssessmentScansClient is the the Azure SQL Database management API provides a RESTful -// set of web services that interact with Azure SQL Database services to manage your databases. The API enables you to -// create, retrieve, update, and delete databases. -type ManagedDatabaseVulnerabilityAssessmentScansClient struct { - BaseClient -} - -// NewManagedDatabaseVulnerabilityAssessmentScansClient creates an instance of the -// ManagedDatabaseVulnerabilityAssessmentScansClient client. -func NewManagedDatabaseVulnerabilityAssessmentScansClient(subscriptionID string) ManagedDatabaseVulnerabilityAssessmentScansClient { - return NewManagedDatabaseVulnerabilityAssessmentScansClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewManagedDatabaseVulnerabilityAssessmentScansClientWithBaseURI creates an instance of the -// ManagedDatabaseVulnerabilityAssessmentScansClient client. -func NewManagedDatabaseVulnerabilityAssessmentScansClientWithBaseURI(baseURI string, subscriptionID string) ManagedDatabaseVulnerabilityAssessmentScansClient { - return ManagedDatabaseVulnerabilityAssessmentScansClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Export convert an existing scan result to a human readable format. If already exists nothing happens -// 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. -// managedInstanceName - the name of the managed instance. -// databaseName - the name of the scanned database. -// scanID - the vulnerability assessment scan Id. -func (client ManagedDatabaseVulnerabilityAssessmentScansClient) Export(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, scanID string) (result DatabaseVulnerabilityAssessmentScansExport, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseVulnerabilityAssessmentScansClient.Export") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ExportPreparer(ctx, resourceGroupName, managedInstanceName, databaseName, scanID) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseVulnerabilityAssessmentScansClient", "Export", nil, "Failure preparing request") - return - } - - resp, err := client.ExportSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseVulnerabilityAssessmentScansClient", "Export", resp, "Failure sending request") - return - } - - result, err = client.ExportResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseVulnerabilityAssessmentScansClient", "Export", resp, "Failure responding to request") - } - - return -} - -// ExportPreparer prepares the Export request. -func (client ManagedDatabaseVulnerabilityAssessmentScansClient) ExportPreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, scanID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "scanId": autorest.Encode("path", scanID), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vulnerabilityAssessmentName": autorest.Encode("path", "default"), - } - - const APIVersion = "2017-10-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.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/export", pathParameters), - autorest.WithQueryParameters(queryParameters)) - 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 ManagedDatabaseVulnerabilityAssessmentScansClient) ExportSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ExportResponder handles the response to the Export request. The method always -// closes the http.Response Body. -func (client ManagedDatabaseVulnerabilityAssessmentScansClient) ExportResponder(resp *http.Response) (result DatabaseVulnerabilityAssessmentScansExport, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get gets a vulnerability assessment scan record 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. -// managedInstanceName - the name of the managed instance. -// databaseName - the name of the database. -// scanID - the vulnerability assessment scan Id of the scan to retrieve. -func (client ManagedDatabaseVulnerabilityAssessmentScansClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, scanID string) (result VulnerabilityAssessmentScanRecord, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseVulnerabilityAssessmentScansClient.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, managedInstanceName, databaseName, scanID) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseVulnerabilityAssessmentScansClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseVulnerabilityAssessmentScansClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseVulnerabilityAssessmentScansClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ManagedDatabaseVulnerabilityAssessmentScansClient) GetPreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, scanID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "scanId": autorest.Encode("path", scanID), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vulnerabilityAssessmentName": autorest.Encode("path", "default"), - } - - const APIVersion = "2017-10-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/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}", 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 ManagedDatabaseVulnerabilityAssessmentScansClient) 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 ManagedDatabaseVulnerabilityAssessmentScansClient) GetResponder(resp *http.Response) (result VulnerabilityAssessmentScanRecord, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// InitiateScan executes a Vulnerability Assessment database scan. -// 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. -// managedInstanceName - the name of the managed instance. -// databaseName - the name of the database. -// scanID - the vulnerability assessment scan Id of the scan to retrieve. -func (client ManagedDatabaseVulnerabilityAssessmentScansClient) InitiateScan(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, scanID string) (result ManagedDatabaseVulnerabilityAssessmentScansInitiateScanFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseVulnerabilityAssessmentScansClient.InitiateScan") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.InitiateScanPreparer(ctx, resourceGroupName, managedInstanceName, databaseName, scanID) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseVulnerabilityAssessmentScansClient", "InitiateScan", nil, "Failure preparing request") - return - } - - result, err = client.InitiateScanSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseVulnerabilityAssessmentScansClient", "InitiateScan", result.Response(), "Failure sending request") - return - } - - return -} - -// InitiateScanPreparer prepares the InitiateScan request. -func (client ManagedDatabaseVulnerabilityAssessmentScansClient) InitiateScanPreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, scanID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "scanId": autorest.Encode("path", scanID), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vulnerabilityAssessmentName": autorest.Encode("path", "default"), - } - - const APIVersion = "2017-10-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.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// InitiateScanSender sends the InitiateScan request. The method will close the -// http.Response Body if it receives an error. -func (client ManagedDatabaseVulnerabilityAssessmentScansClient) InitiateScanSender(req *http.Request) (future ManagedDatabaseVulnerabilityAssessmentScansInitiateScanFuture, 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 -} - -// InitiateScanResponder handles the response to the InitiateScan request. The method always -// closes the http.Response Body. -func (client ManagedDatabaseVulnerabilityAssessmentScansClient) InitiateScanResponder(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 -} - -// ListByDatabase lists the vulnerability assessment scans 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. -// managedInstanceName - the name of the managed instance. -// databaseName - the name of the database. -func (client ManagedDatabaseVulnerabilityAssessmentScansClient) ListByDatabase(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string) (result VulnerabilityAssessmentScanRecordListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseVulnerabilityAssessmentScansClient.ListByDatabase") - defer func() { - sc := -1 - if result.vasrlr.Response.Response != nil { - sc = result.vasrlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByDatabaseNextResults - req, err := client.ListByDatabasePreparer(ctx, resourceGroupName, managedInstanceName, databaseName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseVulnerabilityAssessmentScansClient", "ListByDatabase", nil, "Failure preparing request") - return - } - - resp, err := client.ListByDatabaseSender(req) - if err != nil { - result.vasrlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseVulnerabilityAssessmentScansClient", "ListByDatabase", resp, "Failure sending request") - return - } - - result.vasrlr, err = client.ListByDatabaseResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseVulnerabilityAssessmentScansClient", "ListByDatabase", resp, "Failure responding to request") - } - - return -} - -// ListByDatabasePreparer prepares the ListByDatabase request. -func (client ManagedDatabaseVulnerabilityAssessmentScansClient) ListByDatabasePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vulnerabilityAssessmentName": autorest.Encode("path", "default"), - } - - const APIVersion = "2017-10-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/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans", 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 ManagedDatabaseVulnerabilityAssessmentScansClient) 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 ManagedDatabaseVulnerabilityAssessmentScansClient) ListByDatabaseResponder(resp *http.Response) (result VulnerabilityAssessmentScanRecordListResult, 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 ManagedDatabaseVulnerabilityAssessmentScansClient) listByDatabaseNextResults(ctx context.Context, lastResults VulnerabilityAssessmentScanRecordListResult) (result VulnerabilityAssessmentScanRecordListResult, err error) { - req, err := lastResults.vulnerabilityAssessmentScanRecordListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.ManagedDatabaseVulnerabilityAssessmentScansClient", "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.ManagedDatabaseVulnerabilityAssessmentScansClient", "listByDatabaseNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByDatabaseResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseVulnerabilityAssessmentScansClient", "listByDatabaseNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByDatabaseComplete enumerates all values, automatically crossing page boundaries as required. -func (client ManagedDatabaseVulnerabilityAssessmentScansClient) ListByDatabaseComplete(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string) (result VulnerabilityAssessmentScanRecordListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseVulnerabilityAssessmentScansClient.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, managedInstanceName, databaseName) - return -} diff --git a/services/preview/sql/mgmt/2018-06-15-preview/sql/managedinstanceadministrators.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/managedinstanceadministrators.go deleted file mode 100644 index ce3fa15903af..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/managedinstanceadministrators.go +++ /dev/null @@ -1,413 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the 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" -) - -// ManagedInstanceAdministratorsClient is the the Azure SQL Database management API provides a RESTful set of web -// services that interact with Azure SQL Database services to manage your databases. The API enables you to create, -// retrieve, update, and delete databases. -type ManagedInstanceAdministratorsClient struct { - BaseClient -} - -// NewManagedInstanceAdministratorsClient creates an instance of the ManagedInstanceAdministratorsClient client. -func NewManagedInstanceAdministratorsClient(subscriptionID string) ManagedInstanceAdministratorsClient { - return NewManagedInstanceAdministratorsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewManagedInstanceAdministratorsClientWithBaseURI creates an instance of the ManagedInstanceAdministratorsClient -// client. -func NewManagedInstanceAdministratorsClientWithBaseURI(baseURI string, subscriptionID string) ManagedInstanceAdministratorsClient { - return ManagedInstanceAdministratorsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a managed instance administrator. -// 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. -// managedInstanceName - the name of the managed instance. -// administratorName - the requested administrator name. -// parameters - the requested administrator parameters. -func (client ManagedInstanceAdministratorsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, administratorName string, parameters ManagedInstanceAdministrator) (result ManagedInstanceAdministratorsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceAdministratorsClient.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.ManagedInstanceAdministratorProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ManagedInstanceAdministratorProperties.AdministratorType", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ManagedInstanceAdministratorProperties.Login", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ManagedInstanceAdministratorProperties.Sid", Name: validation.Null, Rule: true, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("sql.ManagedInstanceAdministratorsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, managedInstanceName, administratorName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceAdministratorsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceAdministratorsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ManagedInstanceAdministratorsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, administratorName string, parameters ManagedInstanceAdministrator) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "administratorName": autorest.Encode("path", administratorName), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-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.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}", 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 ManagedInstanceAdministratorsClient) CreateOrUpdateSender(req *http.Request) (future ManagedInstanceAdministratorsCreateOrUpdateFuture, 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 ManagedInstanceAdministratorsClient) CreateOrUpdateResponder(resp *http.Response) (result ManagedInstanceAdministrator, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a managed instance administrator. -// 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. -// managedInstanceName - the name of the managed instance. -// administratorName - the administrator name. -func (client ManagedInstanceAdministratorsClient) Delete(ctx context.Context, resourceGroupName string, managedInstanceName string, administratorName string) (result ManagedInstanceAdministratorsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceAdministratorsClient.Delete") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, managedInstanceName, administratorName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceAdministratorsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceAdministratorsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ManagedInstanceAdministratorsClient) DeletePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, administratorName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "administratorName": autorest.Encode("path", administratorName), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-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.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}", 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 ManagedInstanceAdministratorsClient) DeleteSender(req *http.Request) (future ManagedInstanceAdministratorsDeleteFuture, 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 ManagedInstanceAdministratorsClient) 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 a managed instance administrator. -// 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. -// managedInstanceName - the name of the managed instance. -// administratorName - the administrator name. -func (client ManagedInstanceAdministratorsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, administratorName string) (result ManagedInstanceAdministrator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceAdministratorsClient.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, managedInstanceName, administratorName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceAdministratorsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceAdministratorsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceAdministratorsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ManagedInstanceAdministratorsClient) GetPreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, administratorName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "administratorName": autorest.Encode("path", administratorName), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "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/managedInstances/{managedInstanceName}/administrators/{administratorName}", 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 ManagedInstanceAdministratorsClient) 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 ManagedInstanceAdministratorsClient) GetResponder(resp *http.Response) (result ManagedInstanceAdministrator, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByInstance gets a list of managed instance administrators. -// 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. -// managedInstanceName - the name of the managed instance. -func (client ManagedInstanceAdministratorsClient) ListByInstance(ctx context.Context, resourceGroupName string, managedInstanceName string) (result ManagedInstanceAdministratorListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceAdministratorsClient.ListByInstance") - defer func() { - sc := -1 - if result.mialr.Response.Response != nil { - sc = result.mialr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByInstanceNextResults - req, err := client.ListByInstancePreparer(ctx, resourceGroupName, managedInstanceName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceAdministratorsClient", "ListByInstance", nil, "Failure preparing request") - return - } - - resp, err := client.ListByInstanceSender(req) - if err != nil { - result.mialr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceAdministratorsClient", "ListByInstance", resp, "Failure sending request") - return - } - - result.mialr, err = client.ListByInstanceResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceAdministratorsClient", "ListByInstance", resp, "Failure responding to request") - } - - return -} - -// ListByInstancePreparer prepares the ListByInstance request. -func (client ManagedInstanceAdministratorsClient) ListByInstancePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "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/managedInstances/{managedInstanceName}/administrators", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByInstanceSender sends the ListByInstance request. The method will close the -// http.Response Body if it receives an error. -func (client ManagedInstanceAdministratorsClient) ListByInstanceSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByInstanceResponder handles the response to the ListByInstance request. The method always -// closes the http.Response Body. -func (client ManagedInstanceAdministratorsClient) ListByInstanceResponder(resp *http.Response) (result ManagedInstanceAdministratorListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByInstanceNextResults retrieves the next set of results, if any. -func (client ManagedInstanceAdministratorsClient) listByInstanceNextResults(ctx context.Context, lastResults ManagedInstanceAdministratorListResult) (result ManagedInstanceAdministratorListResult, err error) { - req, err := lastResults.managedInstanceAdministratorListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.ManagedInstanceAdministratorsClient", "listByInstanceNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByInstanceSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "sql.ManagedInstanceAdministratorsClient", "listByInstanceNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByInstanceResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceAdministratorsClient", "listByInstanceNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByInstanceComplete enumerates all values, automatically crossing page boundaries as required. -func (client ManagedInstanceAdministratorsClient) ListByInstanceComplete(ctx context.Context, resourceGroupName string, managedInstanceName string) (result ManagedInstanceAdministratorListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceAdministratorsClient.ListByInstance") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByInstance(ctx, resourceGroupName, managedInstanceName) - return -} diff --git a/services/preview/sql/mgmt/2018-06-15-preview/sql/managedinstanceencryptionprotectors.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/managedinstanceencryptionprotectors.go deleted file mode 100644 index 4f0f12f184f1..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/managedinstanceencryptionprotectors.go +++ /dev/null @@ -1,401 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// ManagedInstanceEncryptionProtectorsClient is the the Azure SQL Database management API provides a RESTful set of web -// services that interact with Azure SQL Database services to manage your databases. The API enables you to create, -// retrieve, update, and delete databases. -type ManagedInstanceEncryptionProtectorsClient struct { - BaseClient -} - -// NewManagedInstanceEncryptionProtectorsClient creates an instance of the ManagedInstanceEncryptionProtectorsClient -// client. -func NewManagedInstanceEncryptionProtectorsClient(subscriptionID string) ManagedInstanceEncryptionProtectorsClient { - return NewManagedInstanceEncryptionProtectorsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewManagedInstanceEncryptionProtectorsClientWithBaseURI creates an instance of the -// ManagedInstanceEncryptionProtectorsClient client. -func NewManagedInstanceEncryptionProtectorsClientWithBaseURI(baseURI string, subscriptionID string) ManagedInstanceEncryptionProtectorsClient { - return ManagedInstanceEncryptionProtectorsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate updates an existing encryption protector. -// 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. -// managedInstanceName - the name of the managed instance. -// parameters - the requested encryption protector resource state. -func (client ManagedInstanceEncryptionProtectorsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters ManagedInstanceEncryptionProtector) (result ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceEncryptionProtectorsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, managedInstanceName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceEncryptionProtectorsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceEncryptionProtectorsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ManagedInstanceEncryptionProtectorsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters ManagedInstanceEncryptionProtector) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "encryptionProtectorName": autorest.Encode("path", "current"), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-10-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Kind = 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.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}", 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 ManagedInstanceEncryptionProtectorsClient) CreateOrUpdateSender(req *http.Request) (future ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture, 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 ManagedInstanceEncryptionProtectorsClient) CreateOrUpdateResponder(resp *http.Response) (result ManagedInstanceEncryptionProtector, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get gets a managed instance encryption protector. -// 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. -// managedInstanceName - the name of the managed instance. -func (client ManagedInstanceEncryptionProtectorsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string) (result ManagedInstanceEncryptionProtector, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceEncryptionProtectorsClient.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, managedInstanceName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceEncryptionProtectorsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceEncryptionProtectorsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceEncryptionProtectorsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ManagedInstanceEncryptionProtectorsClient) GetPreparer(ctx context.Context, resourceGroupName string, managedInstanceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "encryptionProtectorName": autorest.Encode("path", "current"), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-10-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/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}", 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 ManagedInstanceEncryptionProtectorsClient) 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 ManagedInstanceEncryptionProtectorsClient) GetResponder(resp *http.Response) (result ManagedInstanceEncryptionProtector, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByInstance gets a list of managed instance encryption protectors -// 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. -// managedInstanceName - the name of the managed instance. -func (client ManagedInstanceEncryptionProtectorsClient) ListByInstance(ctx context.Context, resourceGroupName string, managedInstanceName string) (result ManagedInstanceEncryptionProtectorListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceEncryptionProtectorsClient.ListByInstance") - defer func() { - sc := -1 - if result.mieplr.Response.Response != nil { - sc = result.mieplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByInstanceNextResults - req, err := client.ListByInstancePreparer(ctx, resourceGroupName, managedInstanceName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceEncryptionProtectorsClient", "ListByInstance", nil, "Failure preparing request") - return - } - - resp, err := client.ListByInstanceSender(req) - if err != nil { - result.mieplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceEncryptionProtectorsClient", "ListByInstance", resp, "Failure sending request") - return - } - - result.mieplr, err = client.ListByInstanceResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceEncryptionProtectorsClient", "ListByInstance", resp, "Failure responding to request") - } - - return -} - -// ListByInstancePreparer prepares the ListByInstance request. -func (client ManagedInstanceEncryptionProtectorsClient) ListByInstancePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-10-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/managedInstances/{managedInstanceName}/encryptionProtector", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByInstanceSender sends the ListByInstance request. The method will close the -// http.Response Body if it receives an error. -func (client ManagedInstanceEncryptionProtectorsClient) ListByInstanceSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByInstanceResponder handles the response to the ListByInstance request. The method always -// closes the http.Response Body. -func (client ManagedInstanceEncryptionProtectorsClient) ListByInstanceResponder(resp *http.Response) (result ManagedInstanceEncryptionProtectorListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByInstanceNextResults retrieves the next set of results, if any. -func (client ManagedInstanceEncryptionProtectorsClient) listByInstanceNextResults(ctx context.Context, lastResults ManagedInstanceEncryptionProtectorListResult) (result ManagedInstanceEncryptionProtectorListResult, err error) { - req, err := lastResults.managedInstanceEncryptionProtectorListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.ManagedInstanceEncryptionProtectorsClient", "listByInstanceNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByInstanceSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "sql.ManagedInstanceEncryptionProtectorsClient", "listByInstanceNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByInstanceResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceEncryptionProtectorsClient", "listByInstanceNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByInstanceComplete enumerates all values, automatically crossing page boundaries as required. -func (client ManagedInstanceEncryptionProtectorsClient) ListByInstanceComplete(ctx context.Context, resourceGroupName string, managedInstanceName string) (result ManagedInstanceEncryptionProtectorListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceEncryptionProtectorsClient.ListByInstance") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByInstance(ctx, resourceGroupName, managedInstanceName) - return -} - -// Revalidate revalidates an existing encryption protector. -// 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. -// managedInstanceName - the name of the managed instance. -func (client ManagedInstanceEncryptionProtectorsClient) Revalidate(ctx context.Context, resourceGroupName string, managedInstanceName string) (result ManagedInstanceEncryptionProtectorsRevalidateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceEncryptionProtectorsClient.Revalidate") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RevalidatePreparer(ctx, resourceGroupName, managedInstanceName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceEncryptionProtectorsClient", "Revalidate", nil, "Failure preparing request") - return - } - - result, err = client.RevalidateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceEncryptionProtectorsClient", "Revalidate", result.Response(), "Failure sending request") - return - } - - return -} - -// RevalidatePreparer prepares the Revalidate request. -func (client ManagedInstanceEncryptionProtectorsClient) RevalidatePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "encryptionProtectorName": autorest.Encode("path", "current"), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-10-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.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}/revalidate", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RevalidateSender sends the Revalidate request. The method will close the -// http.Response Body if it receives an error. -func (client ManagedInstanceEncryptionProtectorsClient) RevalidateSender(req *http.Request) (future ManagedInstanceEncryptionProtectorsRevalidateFuture, 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 -} - -// RevalidateResponder handles the response to the Revalidate request. The method always -// closes the http.Response Body. -func (client ManagedInstanceEncryptionProtectorsClient) RevalidateResponder(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/sql/mgmt/2018-06-15-preview/sql/managedinstancekeys.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/managedinstancekeys.go deleted file mode 100644 index 479e108d62a3..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/managedinstancekeys.go +++ /dev/null @@ -1,406 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// ManagedInstanceKeysClient is the the Azure SQL Database management API provides a RESTful set of web services that -// interact with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, -// and delete databases. -type ManagedInstanceKeysClient struct { - BaseClient -} - -// NewManagedInstanceKeysClient creates an instance of the ManagedInstanceKeysClient client. -func NewManagedInstanceKeysClient(subscriptionID string) ManagedInstanceKeysClient { - return NewManagedInstanceKeysClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewManagedInstanceKeysClientWithBaseURI creates an instance of the ManagedInstanceKeysClient client. -func NewManagedInstanceKeysClientWithBaseURI(baseURI string, subscriptionID string) ManagedInstanceKeysClient { - return ManagedInstanceKeysClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a managed instance key. -// 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. -// managedInstanceName - the name of the managed instance. -// keyName - the name of the managed instance key to be operated on (updated or created). -// parameters - the requested managed instance key resource state. -func (client ManagedInstanceKeysClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, keyName string, parameters ManagedInstanceKey) (result ManagedInstanceKeysCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceKeysClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, managedInstanceName, keyName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceKeysClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceKeysClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ManagedInstanceKeysClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, keyName string, parameters ManagedInstanceKey) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "keyName": autorest.Encode("path", keyName), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-10-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Kind = 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.Sql/managedInstances/{managedInstanceName}/keys/{keyName}", 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 ManagedInstanceKeysClient) CreateOrUpdateSender(req *http.Request) (future ManagedInstanceKeysCreateOrUpdateFuture, 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 ManagedInstanceKeysClient) CreateOrUpdateResponder(resp *http.Response) (result ManagedInstanceKey, 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 managed instance key with the given name. -// 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. -// managedInstanceName - the name of the managed instance. -// keyName - the name of the managed instance key to be deleted. -func (client ManagedInstanceKeysClient) Delete(ctx context.Context, resourceGroupName string, managedInstanceName string, keyName string) (result ManagedInstanceKeysDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceKeysClient.Delete") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, managedInstanceName, keyName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceKeysClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceKeysClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ManagedInstanceKeysClient) DeletePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, keyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "keyName": autorest.Encode("path", keyName), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-10-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.Sql/managedInstances/{managedInstanceName}/keys/{keyName}", 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 ManagedInstanceKeysClient) DeleteSender(req *http.Request) (future ManagedInstanceKeysDeleteFuture, 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 ManagedInstanceKeysClient) 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 managed instance key. -// 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. -// managedInstanceName - the name of the managed instance. -// keyName - the name of the managed instance key to be retrieved. -func (client ManagedInstanceKeysClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, keyName string) (result ManagedInstanceKey, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceKeysClient.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, managedInstanceName, keyName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceKeysClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceKeysClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceKeysClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ManagedInstanceKeysClient) GetPreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, keyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "keyName": autorest.Encode("path", keyName), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-10-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/managedInstances/{managedInstanceName}/keys/{keyName}", 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 ManagedInstanceKeysClient) 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 ManagedInstanceKeysClient) GetResponder(resp *http.Response) (result ManagedInstanceKey, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByInstance gets a list of managed instance keys. -// 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. -// managedInstanceName - the name of the managed instance. -// filter - an OData filter expression that filters elements in the collection. -func (client ManagedInstanceKeysClient) ListByInstance(ctx context.Context, resourceGroupName string, managedInstanceName string, filter string) (result ManagedInstanceKeyListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceKeysClient.ListByInstance") - defer func() { - sc := -1 - if result.miklr.Response.Response != nil { - sc = result.miklr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByInstanceNextResults - req, err := client.ListByInstancePreparer(ctx, resourceGroupName, managedInstanceName, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceKeysClient", "ListByInstance", nil, "Failure preparing request") - return - } - - resp, err := client.ListByInstanceSender(req) - if err != nil { - result.miklr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceKeysClient", "ListByInstance", resp, "Failure sending request") - return - } - - result.miklr, err = client.ListByInstanceResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceKeysClient", "ListByInstance", resp, "Failure responding to request") - } - - return -} - -// ListByInstancePreparer prepares the ListByInstance request. -func (client ManagedInstanceKeysClient) ListByInstancePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-10-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByInstanceSender sends the ListByInstance request. The method will close the -// http.Response Body if it receives an error. -func (client ManagedInstanceKeysClient) ListByInstanceSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByInstanceResponder handles the response to the ListByInstance request. The method always -// closes the http.Response Body. -func (client ManagedInstanceKeysClient) ListByInstanceResponder(resp *http.Response) (result ManagedInstanceKeyListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByInstanceNextResults retrieves the next set of results, if any. -func (client ManagedInstanceKeysClient) listByInstanceNextResults(ctx context.Context, lastResults ManagedInstanceKeyListResult) (result ManagedInstanceKeyListResult, err error) { - req, err := lastResults.managedInstanceKeyListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.ManagedInstanceKeysClient", "listByInstanceNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByInstanceSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "sql.ManagedInstanceKeysClient", "listByInstanceNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByInstanceResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceKeysClient", "listByInstanceNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByInstanceComplete enumerates all values, automatically crossing page boundaries as required. -func (client ManagedInstanceKeysClient) ListByInstanceComplete(ctx context.Context, resourceGroupName string, managedInstanceName string, filter string) (result ManagedInstanceKeyListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceKeysClient.ListByInstance") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByInstance(ctx, resourceGroupName, managedInstanceName, filter) - return -} diff --git a/services/preview/sql/mgmt/2018-06-15-preview/sql/managedinstances.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/managedinstances.go deleted file mode 100644 index 3fa203132a2c..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/managedinstances.go +++ /dev/null @@ -1,708 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the 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" -) - -// ManagedInstancesClient is the the Azure SQL Database management API provides a RESTful set of web services that -// interact with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, -// and delete databases. -type ManagedInstancesClient struct { - BaseClient -} - -// NewManagedInstancesClient creates an instance of the ManagedInstancesClient client. -func NewManagedInstancesClient(subscriptionID string) ManagedInstancesClient { - return NewManagedInstancesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewManagedInstancesClientWithBaseURI creates an instance of the ManagedInstancesClient client. -func NewManagedInstancesClientWithBaseURI(baseURI string, subscriptionID string) ManagedInstancesClient { - return ManagedInstancesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a managed instance. -// 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. -// managedInstanceName - the name of the managed instance. -// parameters - the requested managed instance resource state. -func (client ManagedInstancesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters ManagedInstance) (result ManagedInstancesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstancesClient.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: false, - Chain: []validation.Constraint{{Target: "parameters.Sku.Name", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("sql.ManagedInstancesClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, managedInstanceName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstancesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstancesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ManagedInstancesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters ManagedInstance) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "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.Sql/managedInstances/{managedInstanceName}", 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 ManagedInstancesClient) CreateOrUpdateSender(req *http.Request) (future ManagedInstancesCreateOrUpdateFuture, 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 ManagedInstancesClient) CreateOrUpdateResponder(resp *http.Response) (result ManagedInstance, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a managed instance. -// 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. -// managedInstanceName - the name of the managed instance. -func (client ManagedInstancesClient) Delete(ctx context.Context, resourceGroupName string, managedInstanceName string) (result ManagedInstancesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstancesClient.Delete") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, managedInstanceName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstancesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstancesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ManagedInstancesClient) DeletePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "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.Sql/managedInstances/{managedInstanceName}", 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 ManagedInstancesClient) DeleteSender(req *http.Request) (future ManagedInstancesDeleteFuture, 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 ManagedInstancesClient) 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 managed instance. -// 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. -// managedInstanceName - the name of the managed instance. -func (client ManagedInstancesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string) (result ManagedInstance, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstancesClient.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, managedInstanceName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstancesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ManagedInstancesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstancesClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ManagedInstancesClient) GetPreparer(ctx context.Context, resourceGroupName string, managedInstanceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "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.Sql/managedInstances/{managedInstanceName}", 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 ManagedInstancesClient) 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 ManagedInstancesClient) GetResponder(resp *http.Response) (result ManagedInstance, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets a list of all managed instances in the subscription. -func (client ManagedInstancesClient) List(ctx context.Context) (result ManagedInstanceListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstancesClient.List") - defer func() { - sc := -1 - if result.milr.Response.Response != nil { - sc = result.milr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstancesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.milr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ManagedInstancesClient", "List", resp, "Failure sending request") - return - } - - result.milr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstancesClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client ManagedInstancesClient) 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.Sql/managedInstances", 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 ManagedInstancesClient) 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 ManagedInstancesClient) ListResponder(resp *http.Response) (result ManagedInstanceListResult, 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 ManagedInstancesClient) listNextResults(ctx context.Context, lastResults ManagedInstanceListResult) (result ManagedInstanceListResult, err error) { - req, err := lastResults.managedInstanceListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.ManagedInstancesClient", "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, "sql.ManagedInstancesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstancesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ManagedInstancesClient) ListComplete(ctx context.Context) (result ManagedInstanceListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstancesClient.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 -} - -// ListByInstancePool gets a list of all managed instances in an instance pool. -// 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. -// instancePoolName - the instance pool name. -func (client ManagedInstancesClient) ListByInstancePool(ctx context.Context, resourceGroupName string, instancePoolName string) (result ManagedInstanceListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstancesClient.ListByInstancePool") - defer func() { - sc := -1 - if result.milr.Response.Response != nil { - sc = result.milr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByInstancePoolNextResults - req, err := client.ListByInstancePoolPreparer(ctx, resourceGroupName, instancePoolName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstancesClient", "ListByInstancePool", nil, "Failure preparing request") - return - } - - resp, err := client.ListByInstancePoolSender(req) - if err != nil { - result.milr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ManagedInstancesClient", "ListByInstancePool", resp, "Failure sending request") - return - } - - result.milr, err = client.ListByInstancePoolResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstancesClient", "ListByInstancePool", resp, "Failure responding to request") - } - - return -} - -// ListByInstancePoolPreparer prepares the ListByInstancePool request. -func (client ManagedInstancesClient) ListByInstancePoolPreparer(ctx context.Context, resourceGroupName string, instancePoolName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instancePoolName": autorest.Encode("path", instancePoolName), - "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.Sql/instancePools/{instancePoolName}/managedInstances", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByInstancePoolSender sends the ListByInstancePool request. The method will close the -// http.Response Body if it receives an error. -func (client ManagedInstancesClient) ListByInstancePoolSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByInstancePoolResponder handles the response to the ListByInstancePool request. The method always -// closes the http.Response Body. -func (client ManagedInstancesClient) ListByInstancePoolResponder(resp *http.Response) (result ManagedInstanceListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByInstancePoolNextResults retrieves the next set of results, if any. -func (client ManagedInstancesClient) listByInstancePoolNextResults(ctx context.Context, lastResults ManagedInstanceListResult) (result ManagedInstanceListResult, err error) { - req, err := lastResults.managedInstanceListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.ManagedInstancesClient", "listByInstancePoolNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByInstancePoolSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "sql.ManagedInstancesClient", "listByInstancePoolNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByInstancePoolResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstancesClient", "listByInstancePoolNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByInstancePoolComplete enumerates all values, automatically crossing page boundaries as required. -func (client ManagedInstancesClient) ListByInstancePoolComplete(ctx context.Context, resourceGroupName string, instancePoolName string) (result ManagedInstanceListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstancesClient.ListByInstancePool") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByInstancePool(ctx, resourceGroupName, instancePoolName) - return -} - -// ListByResourceGroup gets a list of managed instances in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -func (client ManagedInstancesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ManagedInstanceListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstancesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.milr.Response.Response != nil { - sc = result.milr.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, "sql.ManagedInstancesClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.milr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ManagedInstancesClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.milr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstancesClient", "ListByResourceGroup", resp, "Failure responding to request") - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client ManagedInstancesClient) 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.Sql/managedInstances", 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 ManagedInstancesClient) 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 ManagedInstancesClient) ListByResourceGroupResponder(resp *http.Response) (result ManagedInstanceListResult, 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 ManagedInstancesClient) listByResourceGroupNextResults(ctx context.Context, lastResults ManagedInstanceListResult) (result ManagedInstanceListResult, err error) { - req, err := lastResults.managedInstanceListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.ManagedInstancesClient", "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, "sql.ManagedInstancesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstancesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client ManagedInstancesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ManagedInstanceListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstancesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// Update updates a managed instance. -// 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. -// managedInstanceName - the name of the managed instance. -// parameters - the requested managed instance resource state. -func (client ManagedInstancesClient) Update(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters ManagedInstanceUpdate) (result ManagedInstancesUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstancesClient.Update") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, managedInstanceName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstancesClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstancesClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client ManagedInstancesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters ManagedInstanceUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "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.Sql/managedInstances/{managedInstanceName}", 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 ManagedInstancesClient) UpdateSender(req *http.Request) (future ManagedInstancesUpdateFuture, 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 ManagedInstancesClient) UpdateResponder(resp *http.Response) (result ManagedInstance, 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/sql/mgmt/2018-06-15-preview/sql/managedinstancetdecertificates.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/managedinstancetdecertificates.go deleted file mode 100644 index 90e474de06a2..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/managedinstancetdecertificates.go +++ /dev/null @@ -1,132 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the 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" -) - -// ManagedInstanceTdeCertificatesClient is the the Azure SQL Database management API provides a RESTful set of web -// services that interact with Azure SQL Database services to manage your databases. The API enables you to create, -// retrieve, update, and delete databases. -type ManagedInstanceTdeCertificatesClient struct { - BaseClient -} - -// NewManagedInstanceTdeCertificatesClient creates an instance of the ManagedInstanceTdeCertificatesClient client. -func NewManagedInstanceTdeCertificatesClient(subscriptionID string) ManagedInstanceTdeCertificatesClient { - return NewManagedInstanceTdeCertificatesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewManagedInstanceTdeCertificatesClientWithBaseURI creates an instance of the ManagedInstanceTdeCertificatesClient -// client. -func NewManagedInstanceTdeCertificatesClientWithBaseURI(baseURI string, subscriptionID string) ManagedInstanceTdeCertificatesClient { - return ManagedInstanceTdeCertificatesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Create creates a TDE certificate for a given 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. -// managedInstanceName - the name of the managed instance. -// parameters - the requested TDE certificate to be created or updated. -func (client ManagedInstanceTdeCertificatesClient) Create(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters TdeCertificate) (result ManagedInstanceTdeCertificatesCreateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceTdeCertificatesClient.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.TdeCertificateProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.TdeCertificateProperties.PrivateBlob", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("sql.ManagedInstanceTdeCertificatesClient", "Create", err.Error()) - } - - req, err := client.CreatePreparer(ctx, resourceGroupName, managedInstanceName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceTdeCertificatesClient", "Create", nil, "Failure preparing request") - return - } - - result, err = client.CreateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceTdeCertificatesClient", "Create", result.Response(), "Failure sending request") - return - } - - return -} - -// CreatePreparer prepares the Create request. -func (client ManagedInstanceTdeCertificatesClient) CreatePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters TdeCertificate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-10-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.Sql/managedInstances/{managedInstanceName}/tdeCertificates", 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 ManagedInstanceTdeCertificatesClient) CreateSender(req *http.Request) (future ManagedInstanceTdeCertificatesCreateFuture, 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 ManagedInstanceTdeCertificatesClient) CreateResponder(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/sql/mgmt/2018-06-15-preview/sql/managedinstancevulnerabilityassessments.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/managedinstancevulnerabilityassessments.go deleted file mode 100644 index 240ad4f3d491..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/managedinstancevulnerabilityassessments.go +++ /dev/null @@ -1,408 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the 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" -) - -// ManagedInstanceVulnerabilityAssessmentsClient is the the Azure SQL Database management API provides a RESTful set of -// web services that interact with Azure SQL Database services to manage your databases. The API enables you to create, -// retrieve, update, and delete databases. -type ManagedInstanceVulnerabilityAssessmentsClient struct { - BaseClient -} - -// NewManagedInstanceVulnerabilityAssessmentsClient creates an instance of the -// ManagedInstanceVulnerabilityAssessmentsClient client. -func NewManagedInstanceVulnerabilityAssessmentsClient(subscriptionID string) ManagedInstanceVulnerabilityAssessmentsClient { - return NewManagedInstanceVulnerabilityAssessmentsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewManagedInstanceVulnerabilityAssessmentsClientWithBaseURI creates an instance of the -// ManagedInstanceVulnerabilityAssessmentsClient client. -func NewManagedInstanceVulnerabilityAssessmentsClientWithBaseURI(baseURI string, subscriptionID string) ManagedInstanceVulnerabilityAssessmentsClient { - return ManagedInstanceVulnerabilityAssessmentsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates the managed instance's vulnerability assessment. -// 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. -// managedInstanceName - the name of the managed instance for which the vulnerability assessment is defined. -// parameters - the requested resource. -func (client ManagedInstanceVulnerabilityAssessmentsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters ManagedInstanceVulnerabilityAssessment) (result ManagedInstanceVulnerabilityAssessment, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceVulnerabilityAssessmentsClient.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: parameters, - Constraints: []validation.Constraint{{Target: "parameters.ManagedInstanceVulnerabilityAssessmentProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ManagedInstanceVulnerabilityAssessmentProperties.StorageContainerPath", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("sql.ManagedInstanceVulnerabilityAssessmentsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, managedInstanceName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceVulnerabilityAssessmentsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceVulnerabilityAssessmentsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceVulnerabilityAssessmentsClient", "CreateOrUpdate", resp, "Failure responding to request") - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ManagedInstanceVulnerabilityAssessmentsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters ManagedInstanceVulnerabilityAssessment) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vulnerabilityAssessmentName": autorest.Encode("path", "default"), - } - - 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.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}", 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 ManagedInstanceVulnerabilityAssessmentsClient) 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 ManagedInstanceVulnerabilityAssessmentsClient) CreateOrUpdateResponder(resp *http.Response) (result ManagedInstanceVulnerabilityAssessment, 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 removes the managed instance's vulnerability assessment. -// 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. -// managedInstanceName - the name of the managed instance for which the vulnerability assessment is defined. -func (client ManagedInstanceVulnerabilityAssessmentsClient) Delete(ctx context.Context, resourceGroupName string, managedInstanceName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceVulnerabilityAssessmentsClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, managedInstanceName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceVulnerabilityAssessmentsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceVulnerabilityAssessmentsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceVulnerabilityAssessmentsClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ManagedInstanceVulnerabilityAssessmentsClient) DeletePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vulnerabilityAssessmentName": autorest.Encode("path", "default"), - } - - 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.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}", 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 ManagedInstanceVulnerabilityAssessmentsClient) 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 ManagedInstanceVulnerabilityAssessmentsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the managed instance's vulnerability assessment. -// 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. -// managedInstanceName - the name of the managed instance for which the vulnerability assessment is defined. -func (client ManagedInstanceVulnerabilityAssessmentsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string) (result ManagedInstanceVulnerabilityAssessment, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceVulnerabilityAssessmentsClient.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, managedInstanceName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceVulnerabilityAssessmentsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceVulnerabilityAssessmentsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceVulnerabilityAssessmentsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ManagedInstanceVulnerabilityAssessmentsClient) GetPreparer(ctx context.Context, resourceGroupName string, managedInstanceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vulnerabilityAssessmentName": autorest.Encode("path", "default"), - } - - 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.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}", 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 ManagedInstanceVulnerabilityAssessmentsClient) 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 ManagedInstanceVulnerabilityAssessmentsClient) GetResponder(resp *http.Response) (result ManagedInstanceVulnerabilityAssessment, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByInstance gets the managed instance's vulnerability assessment policies. -// 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. -// managedInstanceName - the name of the managed instance for which the vulnerability assessments is defined. -func (client ManagedInstanceVulnerabilityAssessmentsClient) ListByInstance(ctx context.Context, resourceGroupName string, managedInstanceName string) (result ManagedInstanceVulnerabilityAssessmentListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceVulnerabilityAssessmentsClient.ListByInstance") - defer func() { - sc := -1 - if result.mivalr.Response.Response != nil { - sc = result.mivalr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByInstanceNextResults - req, err := client.ListByInstancePreparer(ctx, resourceGroupName, managedInstanceName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceVulnerabilityAssessmentsClient", "ListByInstance", nil, "Failure preparing request") - return - } - - resp, err := client.ListByInstanceSender(req) - if err != nil { - result.mivalr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceVulnerabilityAssessmentsClient", "ListByInstance", resp, "Failure sending request") - return - } - - result.mivalr, err = client.ListByInstanceResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceVulnerabilityAssessmentsClient", "ListByInstance", resp, "Failure responding to request") - } - - return -} - -// ListByInstancePreparer prepares the ListByInstance request. -func (client ManagedInstanceVulnerabilityAssessmentsClient) ListByInstancePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "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.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByInstanceSender sends the ListByInstance request. The method will close the -// http.Response Body if it receives an error. -func (client ManagedInstanceVulnerabilityAssessmentsClient) ListByInstanceSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByInstanceResponder handles the response to the ListByInstance request. The method always -// closes the http.Response Body. -func (client ManagedInstanceVulnerabilityAssessmentsClient) ListByInstanceResponder(resp *http.Response) (result ManagedInstanceVulnerabilityAssessmentListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByInstanceNextResults retrieves the next set of results, if any. -func (client ManagedInstanceVulnerabilityAssessmentsClient) listByInstanceNextResults(ctx context.Context, lastResults ManagedInstanceVulnerabilityAssessmentListResult) (result ManagedInstanceVulnerabilityAssessmentListResult, err error) { - req, err := lastResults.managedInstanceVulnerabilityAssessmentListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.ManagedInstanceVulnerabilityAssessmentsClient", "listByInstanceNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByInstanceSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "sql.ManagedInstanceVulnerabilityAssessmentsClient", "listByInstanceNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByInstanceResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceVulnerabilityAssessmentsClient", "listByInstanceNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByInstanceComplete enumerates all values, automatically crossing page boundaries as required. -func (client ManagedInstanceVulnerabilityAssessmentsClient) ListByInstanceComplete(ctx context.Context, resourceGroupName string, managedInstanceName string) (result ManagedInstanceVulnerabilityAssessmentListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceVulnerabilityAssessmentsClient.ListByInstance") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByInstance(ctx, resourceGroupName, managedInstanceName) - return -} diff --git a/services/preview/sql/mgmt/2018-06-15-preview/sql/managedrestorabledroppeddatabasebackupshorttermretentionpolicies.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/managedrestorabledroppeddatabasebackupshorttermretentionpolicies.go deleted file mode 100644 index c73f3a87446d..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/managedrestorabledroppeddatabasebackupshorttermretentionpolicies.go +++ /dev/null @@ -1,408 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient is the the Azure SQL Database management API -// provides a RESTful set of web services that interact with Azure SQL Database services to manage your databases. The -// API enables you to create, retrieve, update, and delete databases. -type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient struct { - BaseClient -} - -// NewManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient creates an instance of the -// ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient client. -func NewManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient(subscriptionID string) ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient { - return NewManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientWithBaseURI creates an instance of the -// ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient client. -func NewManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientWithBaseURI(baseURI string, subscriptionID string) ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient { - return ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate sets a database's long term retention policy. -// 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. -// managedInstanceName - the name of the managed instance. -// parameters - the long term retention policy info. -func (client ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, restorableDroppedDatabaseID string, parameters ManagedBackupShortTermRetentionPolicy) (result ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, managedInstanceName, restorableDroppedDatabaseID, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, restorableDroppedDatabaseID string, parameters ManagedBackupShortTermRetentionPolicy) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "policyName": autorest.Encode("path", "default"), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "restorableDroppedDatabaseId": autorest.Encode("path", restorableDroppedDatabaseID), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-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.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) CreateOrUpdateSender(req *http.Request) (future ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCreateOrUpdateFuture, 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 ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result ManagedBackupShortTermRetentionPolicy, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get gets a dropped database's short term retention policy. -// 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. -// managedInstanceName - the name of the managed instance. -func (client ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, restorableDroppedDatabaseID string) (result ManagedBackupShortTermRetentionPolicy, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.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, managedInstanceName, restorableDroppedDatabaseID) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, restorableDroppedDatabaseID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "policyName": autorest.Encode("path", "default"), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "restorableDroppedDatabaseId": autorest.Encode("path", restorableDroppedDatabaseID), - "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/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) 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 ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) GetResponder(resp *http.Response) (result ManagedBackupShortTermRetentionPolicy, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByRestorableDroppedDatabase gets a dropped database's short term retention policy list. -// 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. -// managedInstanceName - the name of the managed instance. -func (client ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) ListByRestorableDroppedDatabase(ctx context.Context, resourceGroupName string, managedInstanceName string, restorableDroppedDatabaseID string) (result ManagedBackupShortTermRetentionPolicyListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.ListByRestorableDroppedDatabase") - defer func() { - sc := -1 - if result.mbstrplr.Response.Response != nil { - sc = result.mbstrplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByRestorableDroppedDatabaseNextResults - req, err := client.ListByRestorableDroppedDatabasePreparer(ctx, resourceGroupName, managedInstanceName, restorableDroppedDatabaseID) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient", "ListByRestorableDroppedDatabase", nil, "Failure preparing request") - return - } - - resp, err := client.ListByRestorableDroppedDatabaseSender(req) - if err != nil { - result.mbstrplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient", "ListByRestorableDroppedDatabase", resp, "Failure sending request") - return - } - - result.mbstrplr, err = client.ListByRestorableDroppedDatabaseResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient", "ListByRestorableDroppedDatabase", resp, "Failure responding to request") - } - - return -} - -// ListByRestorableDroppedDatabasePreparer prepares the ListByRestorableDroppedDatabase request. -func (client ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) ListByRestorableDroppedDatabasePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, restorableDroppedDatabaseID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "restorableDroppedDatabaseId": autorest.Encode("path", restorableDroppedDatabaseID), - "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/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByRestorableDroppedDatabaseSender sends the ListByRestorableDroppedDatabase request. The method will close the -// http.Response Body if it receives an error. -func (client ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) ListByRestorableDroppedDatabaseSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByRestorableDroppedDatabaseResponder handles the response to the ListByRestorableDroppedDatabase request. The method always -// closes the http.Response Body. -func (client ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) ListByRestorableDroppedDatabaseResponder(resp *http.Response) (result ManagedBackupShortTermRetentionPolicyListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByRestorableDroppedDatabaseNextResults retrieves the next set of results, if any. -func (client ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) listByRestorableDroppedDatabaseNextResults(ctx context.Context, lastResults ManagedBackupShortTermRetentionPolicyListResult) (result ManagedBackupShortTermRetentionPolicyListResult, err error) { - req, err := lastResults.managedBackupShortTermRetentionPolicyListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient", "listByRestorableDroppedDatabaseNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByRestorableDroppedDatabaseSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient", "listByRestorableDroppedDatabaseNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByRestorableDroppedDatabaseResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient", "listByRestorableDroppedDatabaseNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByRestorableDroppedDatabaseComplete enumerates all values, automatically crossing page boundaries as required. -func (client ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) ListByRestorableDroppedDatabaseComplete(ctx context.Context, resourceGroupName string, managedInstanceName string, restorableDroppedDatabaseID string) (result ManagedBackupShortTermRetentionPolicyListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.ListByRestorableDroppedDatabase") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByRestorableDroppedDatabase(ctx, resourceGroupName, managedInstanceName, restorableDroppedDatabaseID) - return -} - -// Update sets a database's long term retention policy. -// 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. -// managedInstanceName - the name of the managed instance. -// parameters - the long term retention policy info. -func (client ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) Update(ctx context.Context, resourceGroupName string, managedInstanceName string, restorableDroppedDatabaseID string, parameters ManagedBackupShortTermRetentionPolicy) (result ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.Update") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, managedInstanceName, restorableDroppedDatabaseID, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, restorableDroppedDatabaseID string, parameters ManagedBackupShortTermRetentionPolicy) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "policyName": autorest.Encode("path", "default"), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "restorableDroppedDatabaseId": autorest.Encode("path", restorableDroppedDatabaseID), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-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.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}", 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 ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) UpdateSender(req *http.Request) (future ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesUpdateFuture, 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 ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) UpdateResponder(resp *http.Response) (result ManagedBackupShortTermRetentionPolicy, 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/sql/mgmt/2018-06-15-preview/sql/managedserversecurityalertpolicies.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/managedserversecurityalertpolicies.go deleted file mode 100644 index 15bdbf9f6162..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/managedserversecurityalertpolicies.go +++ /dev/null @@ -1,322 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// ManagedServerSecurityAlertPoliciesClient is the the Azure SQL Database management API provides a RESTful set of web -// services that interact with Azure SQL Database services to manage your databases. The API enables you to create, -// retrieve, update, and delete databases. -type ManagedServerSecurityAlertPoliciesClient struct { - BaseClient -} - -// NewManagedServerSecurityAlertPoliciesClient creates an instance of the ManagedServerSecurityAlertPoliciesClient -// client. -func NewManagedServerSecurityAlertPoliciesClient(subscriptionID string) ManagedServerSecurityAlertPoliciesClient { - return NewManagedServerSecurityAlertPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewManagedServerSecurityAlertPoliciesClientWithBaseURI creates an instance of the -// ManagedServerSecurityAlertPoliciesClient client. -func NewManagedServerSecurityAlertPoliciesClientWithBaseURI(baseURI string, subscriptionID string) ManagedServerSecurityAlertPoliciesClient { - return ManagedServerSecurityAlertPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a threat detection policy. -// 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. -// managedInstanceName - the name of the managed instance. -// parameters - the managed server security alert policy. -func (client ManagedServerSecurityAlertPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters ManagedServerSecurityAlertPolicy) (result ManagedServerSecurityAlertPoliciesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedServerSecurityAlertPoliciesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, managedInstanceName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedServerSecurityAlertPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedServerSecurityAlertPoliciesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ManagedServerSecurityAlertPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters ManagedServerSecurityAlertPolicy) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "securityAlertPolicyName": autorest.Encode("path", "Default"), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-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.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies/{securityAlertPolicyName}", 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 ManagedServerSecurityAlertPoliciesClient) CreateOrUpdateSender(req *http.Request) (future ManagedServerSecurityAlertPoliciesCreateOrUpdateFuture, 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 ManagedServerSecurityAlertPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result ManagedServerSecurityAlertPolicy, 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 get a managed server's threat detection policy. -// 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. -// managedInstanceName - the name of the managed instance. -func (client ManagedServerSecurityAlertPoliciesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string) (result ManagedServerSecurityAlertPolicy, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedServerSecurityAlertPoliciesClient.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, managedInstanceName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedServerSecurityAlertPoliciesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ManagedServerSecurityAlertPoliciesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedServerSecurityAlertPoliciesClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ManagedServerSecurityAlertPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, managedInstanceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "securityAlertPolicyName": autorest.Encode("path", "Default"), - "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/managedInstances/{managedInstanceName}/securityAlertPolicies/{securityAlertPolicyName}", 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 ManagedServerSecurityAlertPoliciesClient) 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 ManagedServerSecurityAlertPoliciesClient) GetResponder(resp *http.Response) (result ManagedServerSecurityAlertPolicy, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByInstance get the managed server's threat detection policies. -// 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. -// managedInstanceName - the name of the managed instance. -func (client ManagedServerSecurityAlertPoliciesClient) ListByInstance(ctx context.Context, resourceGroupName string, managedInstanceName string) (result ManagedServerSecurityAlertPolicyListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedServerSecurityAlertPoliciesClient.ListByInstance") - defer func() { - sc := -1 - if result.mssaplr.Response.Response != nil { - sc = result.mssaplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByInstanceNextResults - req, err := client.ListByInstancePreparer(ctx, resourceGroupName, managedInstanceName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedServerSecurityAlertPoliciesClient", "ListByInstance", nil, "Failure preparing request") - return - } - - resp, err := client.ListByInstanceSender(req) - if err != nil { - result.mssaplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ManagedServerSecurityAlertPoliciesClient", "ListByInstance", resp, "Failure sending request") - return - } - - result.mssaplr, err = client.ListByInstanceResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedServerSecurityAlertPoliciesClient", "ListByInstance", resp, "Failure responding to request") - } - - return -} - -// ListByInstancePreparer prepares the ListByInstance request. -func (client ManagedServerSecurityAlertPoliciesClient) ListByInstancePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "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/managedInstances/{managedInstanceName}/securityAlertPolicies", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByInstanceSender sends the ListByInstance request. The method will close the -// http.Response Body if it receives an error. -func (client ManagedServerSecurityAlertPoliciesClient) ListByInstanceSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByInstanceResponder handles the response to the ListByInstance request. The method always -// closes the http.Response Body. -func (client ManagedServerSecurityAlertPoliciesClient) ListByInstanceResponder(resp *http.Response) (result ManagedServerSecurityAlertPolicyListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByInstanceNextResults retrieves the next set of results, if any. -func (client ManagedServerSecurityAlertPoliciesClient) listByInstanceNextResults(ctx context.Context, lastResults ManagedServerSecurityAlertPolicyListResult) (result ManagedServerSecurityAlertPolicyListResult, err error) { - req, err := lastResults.managedServerSecurityAlertPolicyListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.ManagedServerSecurityAlertPoliciesClient", "listByInstanceNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByInstanceSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "sql.ManagedServerSecurityAlertPoliciesClient", "listByInstanceNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByInstanceResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedServerSecurityAlertPoliciesClient", "listByInstanceNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByInstanceComplete enumerates all values, automatically crossing page boundaries as required. -func (client ManagedServerSecurityAlertPoliciesClient) ListByInstanceComplete(ctx context.Context, resourceGroupName string, managedInstanceName string) (result ManagedServerSecurityAlertPolicyListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedServerSecurityAlertPoliciesClient.ListByInstance") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByInstance(ctx, resourceGroupName, managedInstanceName) - return -} diff --git a/services/preview/sql/mgmt/2018-06-15-preview/sql/models.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/models.go deleted file mode 100644 index f72e6188cb3d..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/models.go +++ /dev/null @@ -1,21172 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "encoding/json" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/date" - "github.com/Azure/go-autorest/autorest/to" - "github.com/Azure/go-autorest/tracing" - "github.com/satori/go.uuid" - "net/http" -) - -// The package's fully qualified name. -const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2018-06-15-preview/sql" - -// AuthenticationType enumerates the values for authentication type. -type AuthenticationType string - -const ( - // ADPassword ... - ADPassword AuthenticationType = "ADPassword" - // SQL ... - SQL AuthenticationType = "SQL" -) - -// PossibleAuthenticationTypeValues returns an array of possible values for the AuthenticationType const type. -func PossibleAuthenticationTypeValues() []AuthenticationType { - return []AuthenticationType{ADPassword, SQL} -} - -// AutomaticTuningDisabledReason enumerates the values for automatic tuning disabled reason. -type AutomaticTuningDisabledReason string - -const ( - // AutoConfigured ... - AutoConfigured AutomaticTuningDisabledReason = "AutoConfigured" - // Default ... - Default AutomaticTuningDisabledReason = "Default" - // Disabled ... - Disabled AutomaticTuningDisabledReason = "Disabled" - // InheritedFromServer ... - InheritedFromServer AutomaticTuningDisabledReason = "InheritedFromServer" - // NotSupported ... - NotSupported AutomaticTuningDisabledReason = "NotSupported" - // QueryStoreOff ... - QueryStoreOff AutomaticTuningDisabledReason = "QueryStoreOff" - // QueryStoreReadOnly ... - QueryStoreReadOnly AutomaticTuningDisabledReason = "QueryStoreReadOnly" -) - -// PossibleAutomaticTuningDisabledReasonValues returns an array of possible values for the AutomaticTuningDisabledReason const type. -func PossibleAutomaticTuningDisabledReasonValues() []AutomaticTuningDisabledReason { - return []AutomaticTuningDisabledReason{AutoConfigured, Default, Disabled, InheritedFromServer, NotSupported, QueryStoreOff, QueryStoreReadOnly} -} - -// AutomaticTuningMode enumerates the values for automatic tuning mode. -type AutomaticTuningMode string - -const ( - // Auto ... - Auto AutomaticTuningMode = "Auto" - // Custom ... - Custom AutomaticTuningMode = "Custom" - // Inherit ... - Inherit AutomaticTuningMode = "Inherit" - // Unspecified ... - Unspecified AutomaticTuningMode = "Unspecified" -) - -// PossibleAutomaticTuningModeValues returns an array of possible values for the AutomaticTuningMode const type. -func PossibleAutomaticTuningModeValues() []AutomaticTuningMode { - return []AutomaticTuningMode{Auto, Custom, Inherit, Unspecified} -} - -// AutomaticTuningOptionModeActual enumerates the values for automatic tuning option mode actual. -type AutomaticTuningOptionModeActual string - -const ( - // Off ... - Off AutomaticTuningOptionModeActual = "Off" - // On ... - On AutomaticTuningOptionModeActual = "On" -) - -// PossibleAutomaticTuningOptionModeActualValues returns an array of possible values for the AutomaticTuningOptionModeActual const type. -func PossibleAutomaticTuningOptionModeActualValues() []AutomaticTuningOptionModeActual { - return []AutomaticTuningOptionModeActual{Off, On} -} - -// AutomaticTuningOptionModeDesired enumerates the values for automatic tuning option mode desired. -type AutomaticTuningOptionModeDesired string - -const ( - // AutomaticTuningOptionModeDesiredDefault ... - AutomaticTuningOptionModeDesiredDefault AutomaticTuningOptionModeDesired = "Default" - // AutomaticTuningOptionModeDesiredOff ... - AutomaticTuningOptionModeDesiredOff AutomaticTuningOptionModeDesired = "Off" - // AutomaticTuningOptionModeDesiredOn ... - AutomaticTuningOptionModeDesiredOn AutomaticTuningOptionModeDesired = "On" -) - -// PossibleAutomaticTuningOptionModeDesiredValues returns an array of possible values for the AutomaticTuningOptionModeDesired const type. -func PossibleAutomaticTuningOptionModeDesiredValues() []AutomaticTuningOptionModeDesired { - return []AutomaticTuningOptionModeDesired{AutomaticTuningOptionModeDesiredDefault, AutomaticTuningOptionModeDesiredOff, AutomaticTuningOptionModeDesiredOn} -} - -// AutomaticTuningServerMode enumerates the values for automatic tuning server mode. -type AutomaticTuningServerMode string - -const ( - // AutomaticTuningServerModeAuto ... - AutomaticTuningServerModeAuto AutomaticTuningServerMode = "Auto" - // AutomaticTuningServerModeCustom ... - AutomaticTuningServerModeCustom AutomaticTuningServerMode = "Custom" - // AutomaticTuningServerModeUnspecified ... - AutomaticTuningServerModeUnspecified AutomaticTuningServerMode = "Unspecified" -) - -// PossibleAutomaticTuningServerModeValues returns an array of possible values for the AutomaticTuningServerMode const type. -func PossibleAutomaticTuningServerModeValues() []AutomaticTuningServerMode { - return []AutomaticTuningServerMode{AutomaticTuningServerModeAuto, AutomaticTuningServerModeCustom, AutomaticTuningServerModeUnspecified} -} - -// AutomaticTuningServerReason enumerates the values for automatic tuning server reason. -type AutomaticTuningServerReason string - -const ( - // AutomaticTuningServerReasonAutoConfigured ... - AutomaticTuningServerReasonAutoConfigured AutomaticTuningServerReason = "AutoConfigured" - // AutomaticTuningServerReasonDefault ... - AutomaticTuningServerReasonDefault AutomaticTuningServerReason = "Default" - // AutomaticTuningServerReasonDisabled ... - AutomaticTuningServerReasonDisabled AutomaticTuningServerReason = "Disabled" -) - -// PossibleAutomaticTuningServerReasonValues returns an array of possible values for the AutomaticTuningServerReason const type. -func PossibleAutomaticTuningServerReasonValues() []AutomaticTuningServerReason { - return []AutomaticTuningServerReason{AutomaticTuningServerReasonAutoConfigured, AutomaticTuningServerReasonDefault, AutomaticTuningServerReasonDisabled} -} - -// BlobAuditingPolicyState enumerates the values for blob auditing policy state. -type BlobAuditingPolicyState string - -const ( - // BlobAuditingPolicyStateDisabled ... - BlobAuditingPolicyStateDisabled BlobAuditingPolicyState = "Disabled" - // BlobAuditingPolicyStateEnabled ... - BlobAuditingPolicyStateEnabled BlobAuditingPolicyState = "Enabled" -) - -// PossibleBlobAuditingPolicyStateValues returns an array of possible values for the BlobAuditingPolicyState const type. -func PossibleBlobAuditingPolicyStateValues() []BlobAuditingPolicyState { - return []BlobAuditingPolicyState{BlobAuditingPolicyStateDisabled, BlobAuditingPolicyStateEnabled} -} - -// CapabilityGroup enumerates the values for capability group. -type CapabilityGroup string - -const ( - // SupportedEditions ... - SupportedEditions CapabilityGroup = "supportedEditions" - // SupportedElasticPoolEditions ... - SupportedElasticPoolEditions CapabilityGroup = "supportedElasticPoolEditions" - // SupportedManagedInstanceVersions ... - SupportedManagedInstanceVersions CapabilityGroup = "supportedManagedInstanceVersions" -) - -// PossibleCapabilityGroupValues returns an array of possible values for the CapabilityGroup const type. -func PossibleCapabilityGroupValues() []CapabilityGroup { - return []CapabilityGroup{SupportedEditions, SupportedElasticPoolEditions, SupportedManagedInstanceVersions} -} - -// CapabilityStatus enumerates the values for capability status. -type CapabilityStatus string - -const ( - // CapabilityStatusAvailable ... - CapabilityStatusAvailable CapabilityStatus = "Available" - // CapabilityStatusDefault ... - CapabilityStatusDefault CapabilityStatus = "Default" - // CapabilityStatusDisabled ... - CapabilityStatusDisabled CapabilityStatus = "Disabled" - // CapabilityStatusVisible ... - CapabilityStatusVisible CapabilityStatus = "Visible" -) - -// PossibleCapabilityStatusValues returns an array of possible values for the CapabilityStatus const type. -func PossibleCapabilityStatusValues() []CapabilityStatus { - return []CapabilityStatus{CapabilityStatusAvailable, CapabilityStatusDefault, CapabilityStatusDisabled, CapabilityStatusVisible} -} - -// CatalogCollationType enumerates the values for catalog collation type. -type CatalogCollationType string - -const ( - // DATABASEDEFAULT ... - DATABASEDEFAULT CatalogCollationType = "DATABASE_DEFAULT" - // SQLLatin1GeneralCP1CIAS ... - SQLLatin1GeneralCP1CIAS CatalogCollationType = "SQL_Latin1_General_CP1_CI_AS" -) - -// PossibleCatalogCollationTypeValues returns an array of possible values for the CatalogCollationType const type. -func PossibleCatalogCollationTypeValues() []CatalogCollationType { - return []CatalogCollationType{DATABASEDEFAULT, SQLLatin1GeneralCP1CIAS} -} - -// CheckNameAvailabilityReason enumerates the values for check name availability reason. -type CheckNameAvailabilityReason string - -const ( - // AlreadyExists ... - AlreadyExists CheckNameAvailabilityReason = "AlreadyExists" - // Invalid ... - Invalid CheckNameAvailabilityReason = "Invalid" -) - -// PossibleCheckNameAvailabilityReasonValues returns an array of possible values for the CheckNameAvailabilityReason const type. -func PossibleCheckNameAvailabilityReasonValues() []CheckNameAvailabilityReason { - return []CheckNameAvailabilityReason{AlreadyExists, Invalid} -} - -// CreateMode enumerates the values for create mode. -type CreateMode string - -const ( - // CreateModeCopy ... - CreateModeCopy CreateMode = "Copy" - // CreateModeDefault ... - CreateModeDefault CreateMode = "Default" - // CreateModeOnlineSecondary ... - CreateModeOnlineSecondary CreateMode = "OnlineSecondary" - // CreateModePointInTimeRestore ... - CreateModePointInTimeRestore CreateMode = "PointInTimeRestore" - // CreateModeRecovery ... - CreateModeRecovery CreateMode = "Recovery" - // CreateModeRestore ... - CreateModeRestore CreateMode = "Restore" - // CreateModeRestoreExternalBackup ... - CreateModeRestoreExternalBackup CreateMode = "RestoreExternalBackup" - // CreateModeRestoreExternalBackupSecondary ... - CreateModeRestoreExternalBackupSecondary CreateMode = "RestoreExternalBackupSecondary" - // CreateModeRestoreLongTermRetentionBackup ... - CreateModeRestoreLongTermRetentionBackup CreateMode = "RestoreLongTermRetentionBackup" - // CreateModeSecondary ... - CreateModeSecondary CreateMode = "Secondary" -) - -// PossibleCreateModeValues returns an array of possible values for the CreateMode const type. -func PossibleCreateModeValues() []CreateMode { - return []CreateMode{CreateModeCopy, CreateModeDefault, CreateModeOnlineSecondary, CreateModePointInTimeRestore, CreateModeRecovery, CreateModeRestore, CreateModeRestoreExternalBackup, CreateModeRestoreExternalBackupSecondary, CreateModeRestoreLongTermRetentionBackup, CreateModeSecondary} -} - -// DatabaseEdition enumerates the values for database edition. -type DatabaseEdition string - -const ( - // Basic ... - Basic DatabaseEdition = "Basic" - // Business ... - Business DatabaseEdition = "Business" - // BusinessCritical ... - BusinessCritical DatabaseEdition = "BusinessCritical" - // DataWarehouse ... - DataWarehouse DatabaseEdition = "DataWarehouse" - // Free ... - Free DatabaseEdition = "Free" - // GeneralPurpose ... - GeneralPurpose DatabaseEdition = "GeneralPurpose" - // Hyperscale ... - Hyperscale DatabaseEdition = "Hyperscale" - // Premium ... - Premium DatabaseEdition = "Premium" - // PremiumRS ... - PremiumRS DatabaseEdition = "PremiumRS" - // Standard ... - Standard DatabaseEdition = "Standard" - // Stretch ... - Stretch DatabaseEdition = "Stretch" - // System ... - System DatabaseEdition = "System" - // System2 ... - System2 DatabaseEdition = "System2" - // Web ... - Web DatabaseEdition = "Web" -) - -// PossibleDatabaseEditionValues returns an array of possible values for the DatabaseEdition const type. -func PossibleDatabaseEditionValues() []DatabaseEdition { - return []DatabaseEdition{Basic, Business, BusinessCritical, DataWarehouse, Free, GeneralPurpose, Hyperscale, Premium, PremiumRS, Standard, Stretch, System, System2, Web} -} - -// DatabaseLicenseType enumerates the values for database license type. -type DatabaseLicenseType string - -const ( - // BasePrice ... - BasePrice DatabaseLicenseType = "BasePrice" - // LicenseIncluded ... - LicenseIncluded DatabaseLicenseType = "LicenseIncluded" -) - -// PossibleDatabaseLicenseTypeValues returns an array of possible values for the DatabaseLicenseType const type. -func PossibleDatabaseLicenseTypeValues() []DatabaseLicenseType { - return []DatabaseLicenseType{BasePrice, LicenseIncluded} -} - -// DatabaseReadScale enumerates the values for database read scale. -type DatabaseReadScale string - -const ( - // DatabaseReadScaleDisabled ... - DatabaseReadScaleDisabled DatabaseReadScale = "Disabled" - // DatabaseReadScaleEnabled ... - DatabaseReadScaleEnabled DatabaseReadScale = "Enabled" -) - -// PossibleDatabaseReadScaleValues returns an array of possible values for the DatabaseReadScale const type. -func PossibleDatabaseReadScaleValues() []DatabaseReadScale { - return []DatabaseReadScale{DatabaseReadScaleDisabled, DatabaseReadScaleEnabled} -} - -// DatabaseStatus enumerates the values for database status. -type DatabaseStatus string - -const ( - // DatabaseStatusAutoClosed ... - DatabaseStatusAutoClosed DatabaseStatus = "AutoClosed" - // DatabaseStatusCopying ... - DatabaseStatusCopying DatabaseStatus = "Copying" - // DatabaseStatusCreating ... - DatabaseStatusCreating DatabaseStatus = "Creating" - // DatabaseStatusDisabled ... - DatabaseStatusDisabled DatabaseStatus = "Disabled" - // DatabaseStatusEmergencyMode ... - DatabaseStatusEmergencyMode DatabaseStatus = "EmergencyMode" - // DatabaseStatusInaccessible ... - DatabaseStatusInaccessible DatabaseStatus = "Inaccessible" - // DatabaseStatusOffline ... - DatabaseStatusOffline DatabaseStatus = "Offline" - // DatabaseStatusOfflineChangingDwPerformanceTiers ... - DatabaseStatusOfflineChangingDwPerformanceTiers DatabaseStatus = "OfflineChangingDwPerformanceTiers" - // DatabaseStatusOfflineSecondary ... - DatabaseStatusOfflineSecondary DatabaseStatus = "OfflineSecondary" - // DatabaseStatusOnline ... - DatabaseStatusOnline DatabaseStatus = "Online" - // DatabaseStatusOnlineChangingDwPerformanceTiers ... - DatabaseStatusOnlineChangingDwPerformanceTiers DatabaseStatus = "OnlineChangingDwPerformanceTiers" - // DatabaseStatusPaused ... - DatabaseStatusPaused DatabaseStatus = "Paused" - // DatabaseStatusPausing ... - DatabaseStatusPausing DatabaseStatus = "Pausing" - // DatabaseStatusRecovering ... - DatabaseStatusRecovering DatabaseStatus = "Recovering" - // DatabaseStatusRecoveryPending ... - DatabaseStatusRecoveryPending DatabaseStatus = "RecoveryPending" - // DatabaseStatusRestoring ... - DatabaseStatusRestoring DatabaseStatus = "Restoring" - // DatabaseStatusResuming ... - DatabaseStatusResuming DatabaseStatus = "Resuming" - // DatabaseStatusScaling ... - DatabaseStatusScaling DatabaseStatus = "Scaling" - // DatabaseStatusShutdown ... - DatabaseStatusShutdown DatabaseStatus = "Shutdown" - // DatabaseStatusStandby ... - DatabaseStatusStandby DatabaseStatus = "Standby" - // DatabaseStatusSuspect ... - DatabaseStatusSuspect DatabaseStatus = "Suspect" -) - -// PossibleDatabaseStatusValues returns an array of possible values for the DatabaseStatus const type. -func PossibleDatabaseStatusValues() []DatabaseStatus { - return []DatabaseStatus{DatabaseStatusAutoClosed, DatabaseStatusCopying, DatabaseStatusCreating, DatabaseStatusDisabled, DatabaseStatusEmergencyMode, DatabaseStatusInaccessible, DatabaseStatusOffline, DatabaseStatusOfflineChangingDwPerformanceTiers, DatabaseStatusOfflineSecondary, DatabaseStatusOnline, DatabaseStatusOnlineChangingDwPerformanceTiers, DatabaseStatusPaused, DatabaseStatusPausing, DatabaseStatusRecovering, DatabaseStatusRecoveryPending, DatabaseStatusRestoring, DatabaseStatusResuming, DatabaseStatusScaling, DatabaseStatusShutdown, DatabaseStatusStandby, DatabaseStatusSuspect} -} - -// DataMaskingFunction enumerates the values for data masking function. -type DataMaskingFunction string - -const ( - // DataMaskingFunctionCCN ... - DataMaskingFunctionCCN DataMaskingFunction = "CCN" - // DataMaskingFunctionDefault ... - DataMaskingFunctionDefault DataMaskingFunction = "Default" - // DataMaskingFunctionEmail ... - DataMaskingFunctionEmail DataMaskingFunction = "Email" - // DataMaskingFunctionNumber ... - DataMaskingFunctionNumber DataMaskingFunction = "Number" - // DataMaskingFunctionSSN ... - DataMaskingFunctionSSN DataMaskingFunction = "SSN" - // DataMaskingFunctionText ... - DataMaskingFunctionText DataMaskingFunction = "Text" -) - -// PossibleDataMaskingFunctionValues returns an array of possible values for the DataMaskingFunction const type. -func PossibleDataMaskingFunctionValues() []DataMaskingFunction { - return []DataMaskingFunction{DataMaskingFunctionCCN, DataMaskingFunctionDefault, DataMaskingFunctionEmail, DataMaskingFunctionNumber, DataMaskingFunctionSSN, DataMaskingFunctionText} -} - -// DataMaskingRuleState enumerates the values for data masking rule state. -type DataMaskingRuleState string - -const ( - // DataMaskingRuleStateDisabled ... - DataMaskingRuleStateDisabled DataMaskingRuleState = "Disabled" - // DataMaskingRuleStateEnabled ... - DataMaskingRuleStateEnabled DataMaskingRuleState = "Enabled" -) - -// PossibleDataMaskingRuleStateValues returns an array of possible values for the DataMaskingRuleState const type. -func PossibleDataMaskingRuleStateValues() []DataMaskingRuleState { - return []DataMaskingRuleState{DataMaskingRuleStateDisabled, DataMaskingRuleStateEnabled} -} - -// DataMaskingState enumerates the values for data masking state. -type DataMaskingState string - -const ( - // DataMaskingStateDisabled ... - DataMaskingStateDisabled DataMaskingState = "Disabled" - // DataMaskingStateEnabled ... - DataMaskingStateEnabled DataMaskingState = "Enabled" -) - -// PossibleDataMaskingStateValues returns an array of possible values for the DataMaskingState const type. -func PossibleDataMaskingStateValues() []DataMaskingState { - return []DataMaskingState{DataMaskingStateDisabled, DataMaskingStateEnabled} -} - -// ElasticPoolEdition enumerates the values for elastic pool edition. -type ElasticPoolEdition string - -const ( - // ElasticPoolEditionBasic ... - ElasticPoolEditionBasic ElasticPoolEdition = "Basic" - // ElasticPoolEditionBusinessCritical ... - ElasticPoolEditionBusinessCritical ElasticPoolEdition = "BusinessCritical" - // ElasticPoolEditionGeneralPurpose ... - ElasticPoolEditionGeneralPurpose ElasticPoolEdition = "GeneralPurpose" - // ElasticPoolEditionPremium ... - ElasticPoolEditionPremium ElasticPoolEdition = "Premium" - // ElasticPoolEditionStandard ... - ElasticPoolEditionStandard ElasticPoolEdition = "Standard" -) - -// PossibleElasticPoolEditionValues returns an array of possible values for the ElasticPoolEdition const type. -func PossibleElasticPoolEditionValues() []ElasticPoolEdition { - return []ElasticPoolEdition{ElasticPoolEditionBasic, ElasticPoolEditionBusinessCritical, ElasticPoolEditionGeneralPurpose, ElasticPoolEditionPremium, ElasticPoolEditionStandard} -} - -// ElasticPoolLicenseType enumerates the values for elastic pool license type. -type ElasticPoolLicenseType string - -const ( - // ElasticPoolLicenseTypeBasePrice ... - ElasticPoolLicenseTypeBasePrice ElasticPoolLicenseType = "BasePrice" - // ElasticPoolLicenseTypeLicenseIncluded ... - ElasticPoolLicenseTypeLicenseIncluded ElasticPoolLicenseType = "LicenseIncluded" -) - -// PossibleElasticPoolLicenseTypeValues returns an array of possible values for the ElasticPoolLicenseType const type. -func PossibleElasticPoolLicenseTypeValues() []ElasticPoolLicenseType { - return []ElasticPoolLicenseType{ElasticPoolLicenseTypeBasePrice, ElasticPoolLicenseTypeLicenseIncluded} -} - -// ElasticPoolState enumerates the values for elastic pool state. -type ElasticPoolState string - -const ( - // ElasticPoolStateCreating ... - ElasticPoolStateCreating ElasticPoolState = "Creating" - // ElasticPoolStateDisabled ... - ElasticPoolStateDisabled ElasticPoolState = "Disabled" - // ElasticPoolStateReady ... - ElasticPoolStateReady ElasticPoolState = "Ready" -) - -// PossibleElasticPoolStateValues returns an array of possible values for the ElasticPoolState const type. -func PossibleElasticPoolStateValues() []ElasticPoolState { - return []ElasticPoolState{ElasticPoolStateCreating, ElasticPoolStateDisabled, ElasticPoolStateReady} -} - -// FailoverGroupReplicationRole enumerates the values for failover group replication role. -type FailoverGroupReplicationRole string - -const ( - // Primary ... - Primary FailoverGroupReplicationRole = "Primary" - // Secondary ... - Secondary FailoverGroupReplicationRole = "Secondary" -) - -// PossibleFailoverGroupReplicationRoleValues returns an array of possible values for the FailoverGroupReplicationRole const type. -func PossibleFailoverGroupReplicationRoleValues() []FailoverGroupReplicationRole { - return []FailoverGroupReplicationRole{Primary, Secondary} -} - -// GeoBackupPolicyState enumerates the values for geo backup policy state. -type GeoBackupPolicyState string - -const ( - // GeoBackupPolicyStateDisabled ... - GeoBackupPolicyStateDisabled GeoBackupPolicyState = "Disabled" - // GeoBackupPolicyStateEnabled ... - GeoBackupPolicyStateEnabled GeoBackupPolicyState = "Enabled" -) - -// PossibleGeoBackupPolicyStateValues returns an array of possible values for the GeoBackupPolicyState const type. -func PossibleGeoBackupPolicyStateValues() []GeoBackupPolicyState { - return []GeoBackupPolicyState{GeoBackupPolicyStateDisabled, GeoBackupPolicyStateEnabled} -} - -// IdentityType enumerates the values for identity type. -type IdentityType string - -const ( - // SystemAssigned ... - SystemAssigned IdentityType = "SystemAssigned" -) - -// PossibleIdentityTypeValues returns an array of possible values for the IdentityType const type. -func PossibleIdentityTypeValues() []IdentityType { - return []IdentityType{SystemAssigned} -} - -// InstanceFailoverGroupReplicationRole enumerates the values for instance failover group replication role. -type InstanceFailoverGroupReplicationRole string - -const ( - // InstanceFailoverGroupReplicationRolePrimary ... - InstanceFailoverGroupReplicationRolePrimary InstanceFailoverGroupReplicationRole = "Primary" - // InstanceFailoverGroupReplicationRoleSecondary ... - InstanceFailoverGroupReplicationRoleSecondary InstanceFailoverGroupReplicationRole = "Secondary" -) - -// PossibleInstanceFailoverGroupReplicationRoleValues returns an array of possible values for the InstanceFailoverGroupReplicationRole const type. -func PossibleInstanceFailoverGroupReplicationRoleValues() []InstanceFailoverGroupReplicationRole { - return []InstanceFailoverGroupReplicationRole{InstanceFailoverGroupReplicationRolePrimary, InstanceFailoverGroupReplicationRoleSecondary} -} - -// InstancePoolLicenseType enumerates the values for instance pool license type. -type InstancePoolLicenseType string - -const ( - // InstancePoolLicenseTypeBasePrice ... - InstancePoolLicenseTypeBasePrice InstancePoolLicenseType = "BasePrice" - // InstancePoolLicenseTypeLicenseIncluded ... - InstancePoolLicenseTypeLicenseIncluded InstancePoolLicenseType = "LicenseIncluded" -) - -// PossibleInstancePoolLicenseTypeValues returns an array of possible values for the InstancePoolLicenseType const type. -func PossibleInstancePoolLicenseTypeValues() []InstancePoolLicenseType { - return []InstancePoolLicenseType{InstancePoolLicenseTypeBasePrice, InstancePoolLicenseTypeLicenseIncluded} -} - -// JobAgentState enumerates the values for job agent state. -type JobAgentState string - -const ( - // JobAgentStateCreating ... - JobAgentStateCreating JobAgentState = "Creating" - // JobAgentStateDeleting ... - JobAgentStateDeleting JobAgentState = "Deleting" - // JobAgentStateDisabled ... - JobAgentStateDisabled JobAgentState = "Disabled" - // JobAgentStateReady ... - JobAgentStateReady JobAgentState = "Ready" - // JobAgentStateUpdating ... - JobAgentStateUpdating JobAgentState = "Updating" -) - -// PossibleJobAgentStateValues returns an array of possible values for the JobAgentState const type. -func PossibleJobAgentStateValues() []JobAgentState { - return []JobAgentState{JobAgentStateCreating, JobAgentStateDeleting, JobAgentStateDisabled, JobAgentStateReady, JobAgentStateUpdating} -} - -// JobExecutionLifecycle enumerates the values for job execution lifecycle. -type JobExecutionLifecycle string - -const ( - // Canceled ... - Canceled JobExecutionLifecycle = "Canceled" - // Created ... - Created JobExecutionLifecycle = "Created" - // Failed ... - Failed JobExecutionLifecycle = "Failed" - // InProgress ... - InProgress JobExecutionLifecycle = "InProgress" - // Skipped ... - Skipped JobExecutionLifecycle = "Skipped" - // Succeeded ... - Succeeded JobExecutionLifecycle = "Succeeded" - // SucceededWithSkipped ... - SucceededWithSkipped JobExecutionLifecycle = "SucceededWithSkipped" - // TimedOut ... - TimedOut JobExecutionLifecycle = "TimedOut" - // WaitingForChildJobExecutions ... - WaitingForChildJobExecutions JobExecutionLifecycle = "WaitingForChildJobExecutions" - // WaitingForRetry ... - WaitingForRetry JobExecutionLifecycle = "WaitingForRetry" -) - -// PossibleJobExecutionLifecycleValues returns an array of possible values for the JobExecutionLifecycle const type. -func PossibleJobExecutionLifecycleValues() []JobExecutionLifecycle { - return []JobExecutionLifecycle{Canceled, Created, Failed, InProgress, Skipped, Succeeded, SucceededWithSkipped, TimedOut, WaitingForChildJobExecutions, WaitingForRetry} -} - -// JobScheduleType enumerates the values for job schedule type. -type JobScheduleType string - -const ( - // Once ... - Once JobScheduleType = "Once" - // Recurring ... - Recurring JobScheduleType = "Recurring" -) - -// PossibleJobScheduleTypeValues returns an array of possible values for the JobScheduleType const type. -func PossibleJobScheduleTypeValues() []JobScheduleType { - return []JobScheduleType{Once, Recurring} -} - -// JobStepActionSource enumerates the values for job step action source. -type JobStepActionSource string - -const ( - // Inline ... - Inline JobStepActionSource = "Inline" -) - -// PossibleJobStepActionSourceValues returns an array of possible values for the JobStepActionSource const type. -func PossibleJobStepActionSourceValues() []JobStepActionSource { - return []JobStepActionSource{Inline} -} - -// JobStepActionType enumerates the values for job step action type. -type JobStepActionType string - -const ( - // TSQL ... - TSQL JobStepActionType = "TSql" -) - -// PossibleJobStepActionTypeValues returns an array of possible values for the JobStepActionType const type. -func PossibleJobStepActionTypeValues() []JobStepActionType { - return []JobStepActionType{TSQL} -} - -// JobStepOutputType enumerates the values for job step output type. -type JobStepOutputType string - -const ( - // SQLDatabase ... - SQLDatabase JobStepOutputType = "SqlDatabase" -) - -// PossibleJobStepOutputTypeValues returns an array of possible values for the JobStepOutputType const type. -func PossibleJobStepOutputTypeValues() []JobStepOutputType { - return []JobStepOutputType{SQLDatabase} -} - -// JobTargetGroupMembershipType enumerates the values for job target group membership type. -type JobTargetGroupMembershipType string - -const ( - // Exclude ... - Exclude JobTargetGroupMembershipType = "Exclude" - // Include ... - Include JobTargetGroupMembershipType = "Include" -) - -// PossibleJobTargetGroupMembershipTypeValues returns an array of possible values for the JobTargetGroupMembershipType const type. -func PossibleJobTargetGroupMembershipTypeValues() []JobTargetGroupMembershipType { - return []JobTargetGroupMembershipType{Exclude, Include} -} - -// JobTargetType enumerates the values for job target type. -type JobTargetType string - -const ( - // JobTargetTypeSQLDatabase ... - JobTargetTypeSQLDatabase JobTargetType = "SqlDatabase" - // JobTargetTypeSQLElasticPool ... - JobTargetTypeSQLElasticPool JobTargetType = "SqlElasticPool" - // JobTargetTypeSQLServer ... - JobTargetTypeSQLServer JobTargetType = "SqlServer" - // JobTargetTypeSQLShardMap ... - JobTargetTypeSQLShardMap JobTargetType = "SqlShardMap" - // JobTargetTypeTargetGroup ... - JobTargetTypeTargetGroup JobTargetType = "TargetGroup" -) - -// PossibleJobTargetTypeValues returns an array of possible values for the JobTargetType const type. -func PossibleJobTargetTypeValues() []JobTargetType { - return []JobTargetType{JobTargetTypeSQLDatabase, JobTargetTypeSQLElasticPool, JobTargetTypeSQLServer, JobTargetTypeSQLShardMap, JobTargetTypeTargetGroup} -} - -// LogSizeUnit enumerates the values for log size unit. -type LogSizeUnit string - -const ( - // Gigabytes ... - Gigabytes LogSizeUnit = "Gigabytes" - // Megabytes ... - Megabytes LogSizeUnit = "Megabytes" - // Percent ... - Percent LogSizeUnit = "Percent" - // Petabytes ... - Petabytes LogSizeUnit = "Petabytes" - // Terabytes ... - Terabytes LogSizeUnit = "Terabytes" -) - -// PossibleLogSizeUnitValues returns an array of possible values for the LogSizeUnit const type. -func PossibleLogSizeUnitValues() []LogSizeUnit { - return []LogSizeUnit{Gigabytes, Megabytes, Percent, Petabytes, Terabytes} -} - -// LongTermRetentionDatabaseState enumerates the values for long term retention database state. -type LongTermRetentionDatabaseState string - -const ( - // All ... - All LongTermRetentionDatabaseState = "All" - // Deleted ... - Deleted LongTermRetentionDatabaseState = "Deleted" - // Live ... - Live LongTermRetentionDatabaseState = "Live" -) - -// PossibleLongTermRetentionDatabaseStateValues returns an array of possible values for the LongTermRetentionDatabaseState const type. -func PossibleLongTermRetentionDatabaseStateValues() []LongTermRetentionDatabaseState { - return []LongTermRetentionDatabaseState{All, Deleted, Live} -} - -// ManagedDatabaseCreateMode enumerates the values for managed database create mode. -type ManagedDatabaseCreateMode string - -const ( - // ManagedDatabaseCreateModeDefault ... - ManagedDatabaseCreateModeDefault ManagedDatabaseCreateMode = "Default" - // ManagedDatabaseCreateModePointInTimeRestore ... - ManagedDatabaseCreateModePointInTimeRestore ManagedDatabaseCreateMode = "PointInTimeRestore" - // ManagedDatabaseCreateModeRecovery ... - ManagedDatabaseCreateModeRecovery ManagedDatabaseCreateMode = "Recovery" - // ManagedDatabaseCreateModeRestoreExternalBackup ... - ManagedDatabaseCreateModeRestoreExternalBackup ManagedDatabaseCreateMode = "RestoreExternalBackup" -) - -// PossibleManagedDatabaseCreateModeValues returns an array of possible values for the ManagedDatabaseCreateMode const type. -func PossibleManagedDatabaseCreateModeValues() []ManagedDatabaseCreateMode { - return []ManagedDatabaseCreateMode{ManagedDatabaseCreateModeDefault, ManagedDatabaseCreateModePointInTimeRestore, ManagedDatabaseCreateModeRecovery, ManagedDatabaseCreateModeRestoreExternalBackup} -} - -// ManagedDatabaseStatus enumerates the values for managed database status. -type ManagedDatabaseStatus string - -const ( - // Creating ... - Creating ManagedDatabaseStatus = "Creating" - // Inaccessible ... - Inaccessible ManagedDatabaseStatus = "Inaccessible" - // Offline ... - Offline ManagedDatabaseStatus = "Offline" - // Online ... - Online ManagedDatabaseStatus = "Online" - // Restoring ... - Restoring ManagedDatabaseStatus = "Restoring" - // Shutdown ... - Shutdown ManagedDatabaseStatus = "Shutdown" - // Updating ... - Updating ManagedDatabaseStatus = "Updating" -) - -// PossibleManagedDatabaseStatusValues returns an array of possible values for the ManagedDatabaseStatus const type. -func PossibleManagedDatabaseStatusValues() []ManagedDatabaseStatus { - return []ManagedDatabaseStatus{Creating, Inaccessible, Offline, Online, Restoring, Shutdown, Updating} -} - -// ManagedInstanceLicenseType enumerates the values for managed instance license type. -type ManagedInstanceLicenseType string - -const ( - // ManagedInstanceLicenseTypeBasePrice ... - ManagedInstanceLicenseTypeBasePrice ManagedInstanceLicenseType = "BasePrice" - // ManagedInstanceLicenseTypeLicenseIncluded ... - ManagedInstanceLicenseTypeLicenseIncluded ManagedInstanceLicenseType = "LicenseIncluded" -) - -// PossibleManagedInstanceLicenseTypeValues returns an array of possible values for the ManagedInstanceLicenseType const type. -func PossibleManagedInstanceLicenseTypeValues() []ManagedInstanceLicenseType { - return []ManagedInstanceLicenseType{ManagedInstanceLicenseTypeBasePrice, ManagedInstanceLicenseTypeLicenseIncluded} -} - -// ManagedInstanceProxyOverride enumerates the values for managed instance proxy override. -type ManagedInstanceProxyOverride string - -const ( - // ManagedInstanceProxyOverrideDefault ... - ManagedInstanceProxyOverrideDefault ManagedInstanceProxyOverride = "Default" - // ManagedInstanceProxyOverrideProxy ... - ManagedInstanceProxyOverrideProxy ManagedInstanceProxyOverride = "Proxy" - // ManagedInstanceProxyOverrideRedirect ... - ManagedInstanceProxyOverrideRedirect ManagedInstanceProxyOverride = "Redirect" -) - -// PossibleManagedInstanceProxyOverrideValues returns an array of possible values for the ManagedInstanceProxyOverride const type. -func PossibleManagedInstanceProxyOverrideValues() []ManagedInstanceProxyOverride { - return []ManagedInstanceProxyOverride{ManagedInstanceProxyOverrideDefault, ManagedInstanceProxyOverrideProxy, ManagedInstanceProxyOverrideRedirect} -} - -// ManagedServerCreateMode enumerates the values for managed server create mode. -type ManagedServerCreateMode string - -const ( - // ManagedServerCreateModeDefault ... - ManagedServerCreateModeDefault ManagedServerCreateMode = "Default" - // ManagedServerCreateModePointInTimeRestore ... - ManagedServerCreateModePointInTimeRestore ManagedServerCreateMode = "PointInTimeRestore" -) - -// PossibleManagedServerCreateModeValues returns an array of possible values for the ManagedServerCreateMode const type. -func PossibleManagedServerCreateModeValues() []ManagedServerCreateMode { - return []ManagedServerCreateMode{ManagedServerCreateModeDefault, ManagedServerCreateModePointInTimeRestore} -} - -// ManagementOperationState enumerates the values for management operation state. -type ManagementOperationState string - -const ( - // ManagementOperationStateCancelInProgress ... - ManagementOperationStateCancelInProgress ManagementOperationState = "CancelInProgress" - // ManagementOperationStateCancelled ... - ManagementOperationStateCancelled ManagementOperationState = "Cancelled" - // ManagementOperationStateFailed ... - ManagementOperationStateFailed ManagementOperationState = "Failed" - // ManagementOperationStateInProgress ... - ManagementOperationStateInProgress ManagementOperationState = "InProgress" - // ManagementOperationStatePending ... - ManagementOperationStatePending ManagementOperationState = "Pending" - // ManagementOperationStateSucceeded ... - ManagementOperationStateSucceeded ManagementOperationState = "Succeeded" -) - -// PossibleManagementOperationStateValues returns an array of possible values for the ManagementOperationState const type. -func PossibleManagementOperationStateValues() []ManagementOperationState { - return []ManagementOperationState{ManagementOperationStateCancelInProgress, ManagementOperationStateCancelled, ManagementOperationStateFailed, ManagementOperationStateInProgress, ManagementOperationStatePending, ManagementOperationStateSucceeded} -} - -// MaxSizeUnit enumerates the values for max size unit. -type MaxSizeUnit string - -const ( - // MaxSizeUnitGigabytes ... - MaxSizeUnitGigabytes MaxSizeUnit = "Gigabytes" - // MaxSizeUnitMegabytes ... - MaxSizeUnitMegabytes MaxSizeUnit = "Megabytes" - // MaxSizeUnitPetabytes ... - MaxSizeUnitPetabytes MaxSizeUnit = "Petabytes" - // MaxSizeUnitTerabytes ... - MaxSizeUnitTerabytes MaxSizeUnit = "Terabytes" -) - -// PossibleMaxSizeUnitValues returns an array of possible values for the MaxSizeUnit const type. -func PossibleMaxSizeUnitValues() []MaxSizeUnit { - return []MaxSizeUnit{MaxSizeUnitGigabytes, MaxSizeUnitMegabytes, MaxSizeUnitPetabytes, MaxSizeUnitTerabytes} -} - -// OperationOrigin enumerates the values for operation origin. -type OperationOrigin string - -const ( - // OperationOriginSystem ... - OperationOriginSystem OperationOrigin = "system" - // OperationOriginUser ... - OperationOriginUser OperationOrigin = "user" -) - -// PossibleOperationOriginValues returns an array of possible values for the OperationOrigin const type. -func PossibleOperationOriginValues() []OperationOrigin { - return []OperationOrigin{OperationOriginSystem, OperationOriginUser} -} - -// PerformanceLevelUnit enumerates the values for performance level unit. -type PerformanceLevelUnit string - -const ( - // DTU ... - DTU PerformanceLevelUnit = "DTU" - // VCores ... - VCores PerformanceLevelUnit = "VCores" -) - -// PossiblePerformanceLevelUnitValues returns an array of possible values for the PerformanceLevelUnit const type. -func PossiblePerformanceLevelUnitValues() []PerformanceLevelUnit { - return []PerformanceLevelUnit{DTU, VCores} -} - -// PrimaryAggregationType enumerates the values for primary aggregation type. -type PrimaryAggregationType string - -const ( - // Average ... - Average PrimaryAggregationType = "Average" - // Count ... - Count PrimaryAggregationType = "Count" - // Maximum ... - Maximum PrimaryAggregationType = "Maximum" - // Minimum ... - Minimum PrimaryAggregationType = "Minimum" - // None ... - None PrimaryAggregationType = "None" - // Total ... - Total PrimaryAggregationType = "Total" -) - -// PossiblePrimaryAggregationTypeValues returns an array of possible values for the PrimaryAggregationType const type. -func PossiblePrimaryAggregationTypeValues() []PrimaryAggregationType { - return []PrimaryAggregationType{Average, Count, Maximum, Minimum, None, Total} -} - -// ProvisioningState enumerates the values for provisioning state. -type ProvisioningState string - -const ( - // ProvisioningStateCanceled ... - ProvisioningStateCanceled ProvisioningState = "Canceled" - // ProvisioningStateCreated ... - ProvisioningStateCreated ProvisioningState = "Created" - // ProvisioningStateFailed ... - ProvisioningStateFailed ProvisioningState = "Failed" - // ProvisioningStateInProgress ... - ProvisioningStateInProgress ProvisioningState = "InProgress" - // ProvisioningStateSucceeded ... - ProvisioningStateSucceeded ProvisioningState = "Succeeded" -) - -// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. -func PossibleProvisioningStateValues() []ProvisioningState { - return []ProvisioningState{ProvisioningStateCanceled, ProvisioningStateCreated, ProvisioningStateFailed, ProvisioningStateInProgress, ProvisioningStateSucceeded} -} - -// ReadOnlyEndpointFailoverPolicy enumerates the values for read only endpoint failover policy. -type ReadOnlyEndpointFailoverPolicy string - -const ( - // ReadOnlyEndpointFailoverPolicyDisabled ... - ReadOnlyEndpointFailoverPolicyDisabled ReadOnlyEndpointFailoverPolicy = "Disabled" - // ReadOnlyEndpointFailoverPolicyEnabled ... - ReadOnlyEndpointFailoverPolicyEnabled ReadOnlyEndpointFailoverPolicy = "Enabled" -) - -// PossibleReadOnlyEndpointFailoverPolicyValues returns an array of possible values for the ReadOnlyEndpointFailoverPolicy const type. -func PossibleReadOnlyEndpointFailoverPolicyValues() []ReadOnlyEndpointFailoverPolicy { - return []ReadOnlyEndpointFailoverPolicy{ReadOnlyEndpointFailoverPolicyDisabled, ReadOnlyEndpointFailoverPolicyEnabled} -} - -// ReadWriteEndpointFailoverPolicy enumerates the values for read write endpoint failover policy. -type ReadWriteEndpointFailoverPolicy string - -const ( - // Automatic ... - Automatic ReadWriteEndpointFailoverPolicy = "Automatic" - // Manual ... - Manual ReadWriteEndpointFailoverPolicy = "Manual" -) - -// PossibleReadWriteEndpointFailoverPolicyValues returns an array of possible values for the ReadWriteEndpointFailoverPolicy const type. -func PossibleReadWriteEndpointFailoverPolicyValues() []ReadWriteEndpointFailoverPolicy { - return []ReadWriteEndpointFailoverPolicy{Automatic, Manual} -} - -// RecommendedIndexAction enumerates the values for recommended index action. -type RecommendedIndexAction string - -const ( - // Create ... - Create RecommendedIndexAction = "Create" - // Drop ... - Drop RecommendedIndexAction = "Drop" - // Rebuild ... - Rebuild RecommendedIndexAction = "Rebuild" -) - -// PossibleRecommendedIndexActionValues returns an array of possible values for the RecommendedIndexAction const type. -func PossibleRecommendedIndexActionValues() []RecommendedIndexAction { - return []RecommendedIndexAction{Create, Drop, Rebuild} -} - -// RecommendedIndexState enumerates the values for recommended index state. -type RecommendedIndexState string - -const ( - // Active ... - Active RecommendedIndexState = "Active" - // Blocked ... - Blocked RecommendedIndexState = "Blocked" - // Executing ... - Executing RecommendedIndexState = "Executing" - // Expired ... - Expired RecommendedIndexState = "Expired" - // Ignored ... - Ignored RecommendedIndexState = "Ignored" - // Pending ... - Pending RecommendedIndexState = "Pending" - // PendingRevert ... - PendingRevert RecommendedIndexState = "Pending Revert" - // Reverted ... - Reverted RecommendedIndexState = "Reverted" - // Reverting ... - Reverting RecommendedIndexState = "Reverting" - // Success ... - Success RecommendedIndexState = "Success" - // Verifying ... - Verifying RecommendedIndexState = "Verifying" -) - -// PossibleRecommendedIndexStateValues returns an array of possible values for the RecommendedIndexState const type. -func PossibleRecommendedIndexStateValues() []RecommendedIndexState { - return []RecommendedIndexState{Active, Blocked, Executing, Expired, Ignored, Pending, PendingRevert, Reverted, Reverting, Success, Verifying} -} - -// RecommendedIndexType enumerates the values for recommended index type. -type RecommendedIndexType string - -const ( - // CLUSTERED ... - CLUSTERED RecommendedIndexType = "CLUSTERED" - // CLUSTEREDCOLUMNSTORE ... - CLUSTEREDCOLUMNSTORE RecommendedIndexType = "CLUSTERED COLUMNSTORE" - // COLUMNSTORE ... - COLUMNSTORE RecommendedIndexType = "COLUMNSTORE" - // NONCLUSTERED ... - NONCLUSTERED RecommendedIndexType = "NONCLUSTERED" -) - -// PossibleRecommendedIndexTypeValues returns an array of possible values for the RecommendedIndexType const type. -func PossibleRecommendedIndexTypeValues() []RecommendedIndexType { - return []RecommendedIndexType{CLUSTERED, CLUSTEREDCOLUMNSTORE, COLUMNSTORE, NONCLUSTERED} -} - -// ReplicationRole enumerates the values for replication role. -type ReplicationRole string - -const ( - // ReplicationRoleCopy ... - ReplicationRoleCopy ReplicationRole = "Copy" - // ReplicationRoleNonReadableSecondary ... - ReplicationRoleNonReadableSecondary ReplicationRole = "NonReadableSecondary" - // ReplicationRolePrimary ... - ReplicationRolePrimary ReplicationRole = "Primary" - // ReplicationRoleSecondary ... - ReplicationRoleSecondary ReplicationRole = "Secondary" - // ReplicationRoleSource ... - ReplicationRoleSource ReplicationRole = "Source" -) - -// PossibleReplicationRoleValues returns an array of possible values for the ReplicationRole const type. -func PossibleReplicationRoleValues() []ReplicationRole { - return []ReplicationRole{ReplicationRoleCopy, ReplicationRoleNonReadableSecondary, ReplicationRolePrimary, ReplicationRoleSecondary, ReplicationRoleSource} -} - -// ReplicationState enumerates the values for replication state. -type ReplicationState string - -const ( - // CATCHUP ... - CATCHUP ReplicationState = "CATCH_UP" - // PENDING ... - PENDING ReplicationState = "PENDING" - // SEEDING ... - SEEDING ReplicationState = "SEEDING" - // SUSPENDED ... - SUSPENDED ReplicationState = "SUSPENDED" -) - -// PossibleReplicationStateValues returns an array of possible values for the ReplicationState const type. -func PossibleReplicationStateValues() []ReplicationState { - return []ReplicationState{CATCHUP, PENDING, SEEDING, SUSPENDED} -} - -// RestorePointType enumerates the values for restore point type. -type RestorePointType string - -const ( - // CONTINUOUS ... - CONTINUOUS RestorePointType = "CONTINUOUS" - // DISCRETE ... - DISCRETE RestorePointType = "DISCRETE" -) - -// PossibleRestorePointTypeValues returns an array of possible values for the RestorePointType const type. -func PossibleRestorePointTypeValues() []RestorePointType { - return []RestorePointType{CONTINUOUS, DISCRETE} -} - -// SampleName enumerates the values for sample name. -type SampleName string - -const ( - // AdventureWorksLT ... - AdventureWorksLT SampleName = "AdventureWorksLT" - // WideWorldImportersFull ... - WideWorldImportersFull SampleName = "WideWorldImportersFull" - // WideWorldImportersStd ... - WideWorldImportersStd SampleName = "WideWorldImportersStd" -) - -// PossibleSampleNameValues returns an array of possible values for the SampleName const type. -func PossibleSampleNameValues() []SampleName { - return []SampleName{AdventureWorksLT, WideWorldImportersFull, WideWorldImportersStd} -} - -// SecurityAlertPolicyEmailAccountAdmins enumerates the values for security alert policy email account admins. -type SecurityAlertPolicyEmailAccountAdmins string - -const ( - // SecurityAlertPolicyEmailAccountAdminsDisabled ... - SecurityAlertPolicyEmailAccountAdminsDisabled SecurityAlertPolicyEmailAccountAdmins = "Disabled" - // SecurityAlertPolicyEmailAccountAdminsEnabled ... - SecurityAlertPolicyEmailAccountAdminsEnabled SecurityAlertPolicyEmailAccountAdmins = "Enabled" -) - -// PossibleSecurityAlertPolicyEmailAccountAdminsValues returns an array of possible values for the SecurityAlertPolicyEmailAccountAdmins const type. -func PossibleSecurityAlertPolicyEmailAccountAdminsValues() []SecurityAlertPolicyEmailAccountAdmins { - return []SecurityAlertPolicyEmailAccountAdmins{SecurityAlertPolicyEmailAccountAdminsDisabled, SecurityAlertPolicyEmailAccountAdminsEnabled} -} - -// SecurityAlertPolicyState enumerates the values for security alert policy state. -type SecurityAlertPolicyState string - -const ( - // SecurityAlertPolicyStateDisabled ... - SecurityAlertPolicyStateDisabled SecurityAlertPolicyState = "Disabled" - // SecurityAlertPolicyStateEnabled ... - SecurityAlertPolicyStateEnabled SecurityAlertPolicyState = "Enabled" - // SecurityAlertPolicyStateNew ... - SecurityAlertPolicyStateNew SecurityAlertPolicyState = "New" -) - -// PossibleSecurityAlertPolicyStateValues returns an array of possible values for the SecurityAlertPolicyState const type. -func PossibleSecurityAlertPolicyStateValues() []SecurityAlertPolicyState { - return []SecurityAlertPolicyState{SecurityAlertPolicyStateDisabled, SecurityAlertPolicyStateEnabled, SecurityAlertPolicyStateNew} -} - -// SecurityAlertPolicyUseServerDefault enumerates the values for security alert policy use server default. -type SecurityAlertPolicyUseServerDefault string - -const ( - // SecurityAlertPolicyUseServerDefaultDisabled ... - SecurityAlertPolicyUseServerDefaultDisabled SecurityAlertPolicyUseServerDefault = "Disabled" - // SecurityAlertPolicyUseServerDefaultEnabled ... - SecurityAlertPolicyUseServerDefaultEnabled SecurityAlertPolicyUseServerDefault = "Enabled" -) - -// PossibleSecurityAlertPolicyUseServerDefaultValues returns an array of possible values for the SecurityAlertPolicyUseServerDefault const type. -func PossibleSecurityAlertPolicyUseServerDefaultValues() []SecurityAlertPolicyUseServerDefault { - return []SecurityAlertPolicyUseServerDefault{SecurityAlertPolicyUseServerDefaultDisabled, SecurityAlertPolicyUseServerDefaultEnabled} -} - -// SensitivityLabelSource enumerates the values for sensitivity label source. -type SensitivityLabelSource string - -const ( - // Current ... - Current SensitivityLabelSource = "current" - // Recommended ... - Recommended SensitivityLabelSource = "recommended" -) - -// PossibleSensitivityLabelSourceValues returns an array of possible values for the SensitivityLabelSource const type. -func PossibleSensitivityLabelSourceValues() []SensitivityLabelSource { - return []SensitivityLabelSource{Current, Recommended} -} - -// ServerConnectionType enumerates the values for server connection type. -type ServerConnectionType string - -const ( - // ServerConnectionTypeDefault ... - ServerConnectionTypeDefault ServerConnectionType = "Default" - // ServerConnectionTypeProxy ... - ServerConnectionTypeProxy ServerConnectionType = "Proxy" - // ServerConnectionTypeRedirect ... - ServerConnectionTypeRedirect ServerConnectionType = "Redirect" -) - -// PossibleServerConnectionTypeValues returns an array of possible values for the ServerConnectionType const type. -func PossibleServerConnectionTypeValues() []ServerConnectionType { - return []ServerConnectionType{ServerConnectionTypeDefault, ServerConnectionTypeProxy, ServerConnectionTypeRedirect} -} - -// ServerKeyType enumerates the values for server key type. -type ServerKeyType string - -const ( - // AzureKeyVault ... - AzureKeyVault ServerKeyType = "AzureKeyVault" - // ServiceManaged ... - ServiceManaged ServerKeyType = "ServiceManaged" -) - -// PossibleServerKeyTypeValues returns an array of possible values for the ServerKeyType const type. -func PossibleServerKeyTypeValues() []ServerKeyType { - return []ServerKeyType{AzureKeyVault, ServiceManaged} -} - -// ServiceObjectiveName enumerates the values for service objective name. -type ServiceObjectiveName string - -const ( - // ServiceObjectiveNameBasic ... - ServiceObjectiveNameBasic ServiceObjectiveName = "Basic" - // ServiceObjectiveNameDS100 ... - ServiceObjectiveNameDS100 ServiceObjectiveName = "DS100" - // ServiceObjectiveNameDS1000 ... - ServiceObjectiveNameDS1000 ServiceObjectiveName = "DS1000" - // ServiceObjectiveNameDS1200 ... - ServiceObjectiveNameDS1200 ServiceObjectiveName = "DS1200" - // ServiceObjectiveNameDS1500 ... - ServiceObjectiveNameDS1500 ServiceObjectiveName = "DS1500" - // ServiceObjectiveNameDS200 ... - ServiceObjectiveNameDS200 ServiceObjectiveName = "DS200" - // ServiceObjectiveNameDS2000 ... - ServiceObjectiveNameDS2000 ServiceObjectiveName = "DS2000" - // ServiceObjectiveNameDS300 ... - ServiceObjectiveNameDS300 ServiceObjectiveName = "DS300" - // ServiceObjectiveNameDS400 ... - ServiceObjectiveNameDS400 ServiceObjectiveName = "DS400" - // ServiceObjectiveNameDS500 ... - ServiceObjectiveNameDS500 ServiceObjectiveName = "DS500" - // ServiceObjectiveNameDS600 ... - ServiceObjectiveNameDS600 ServiceObjectiveName = "DS600" - // ServiceObjectiveNameDW100 ... - ServiceObjectiveNameDW100 ServiceObjectiveName = "DW100" - // ServiceObjectiveNameDW1000 ... - ServiceObjectiveNameDW1000 ServiceObjectiveName = "DW1000" - // ServiceObjectiveNameDW10000c ... - ServiceObjectiveNameDW10000c ServiceObjectiveName = "DW10000c" - // ServiceObjectiveNameDW1000c ... - ServiceObjectiveNameDW1000c ServiceObjectiveName = "DW1000c" - // ServiceObjectiveNameDW1200 ... - ServiceObjectiveNameDW1200 ServiceObjectiveName = "DW1200" - // ServiceObjectiveNameDW1500 ... - ServiceObjectiveNameDW1500 ServiceObjectiveName = "DW1500" - // ServiceObjectiveNameDW15000c ... - ServiceObjectiveNameDW15000c ServiceObjectiveName = "DW15000c" - // ServiceObjectiveNameDW1500c ... - ServiceObjectiveNameDW1500c ServiceObjectiveName = "DW1500c" - // ServiceObjectiveNameDW200 ... - ServiceObjectiveNameDW200 ServiceObjectiveName = "DW200" - // ServiceObjectiveNameDW2000 ... - ServiceObjectiveNameDW2000 ServiceObjectiveName = "DW2000" - // ServiceObjectiveNameDW2000c ... - ServiceObjectiveNameDW2000c ServiceObjectiveName = "DW2000c" - // ServiceObjectiveNameDW2500c ... - ServiceObjectiveNameDW2500c ServiceObjectiveName = "DW2500c" - // ServiceObjectiveNameDW300 ... - ServiceObjectiveNameDW300 ServiceObjectiveName = "DW300" - // ServiceObjectiveNameDW3000 ... - ServiceObjectiveNameDW3000 ServiceObjectiveName = "DW3000" - // ServiceObjectiveNameDW30000c ... - ServiceObjectiveNameDW30000c ServiceObjectiveName = "DW30000c" - // ServiceObjectiveNameDW3000c ... - ServiceObjectiveNameDW3000c ServiceObjectiveName = "DW3000c" - // ServiceObjectiveNameDW400 ... - ServiceObjectiveNameDW400 ServiceObjectiveName = "DW400" - // ServiceObjectiveNameDW500 ... - ServiceObjectiveNameDW500 ServiceObjectiveName = "DW500" - // ServiceObjectiveNameDW5000c ... - ServiceObjectiveNameDW5000c ServiceObjectiveName = "DW5000c" - // ServiceObjectiveNameDW600 ... - ServiceObjectiveNameDW600 ServiceObjectiveName = "DW600" - // ServiceObjectiveNameDW6000 ... - ServiceObjectiveNameDW6000 ServiceObjectiveName = "DW6000" - // ServiceObjectiveNameDW6000c ... - ServiceObjectiveNameDW6000c ServiceObjectiveName = "DW6000c" - // ServiceObjectiveNameDW7500c ... - ServiceObjectiveNameDW7500c ServiceObjectiveName = "DW7500c" - // ServiceObjectiveNameElasticPool ... - ServiceObjectiveNameElasticPool ServiceObjectiveName = "ElasticPool" - // ServiceObjectiveNameFree ... - ServiceObjectiveNameFree ServiceObjectiveName = "Free" - // ServiceObjectiveNameP1 ... - ServiceObjectiveNameP1 ServiceObjectiveName = "P1" - // ServiceObjectiveNameP11 ... - ServiceObjectiveNameP11 ServiceObjectiveName = "P11" - // ServiceObjectiveNameP15 ... - ServiceObjectiveNameP15 ServiceObjectiveName = "P15" - // ServiceObjectiveNameP2 ... - ServiceObjectiveNameP2 ServiceObjectiveName = "P2" - // ServiceObjectiveNameP3 ... - ServiceObjectiveNameP3 ServiceObjectiveName = "P3" - // ServiceObjectiveNameP4 ... - ServiceObjectiveNameP4 ServiceObjectiveName = "P4" - // ServiceObjectiveNameP6 ... - ServiceObjectiveNameP6 ServiceObjectiveName = "P6" - // ServiceObjectiveNamePRS1 ... - ServiceObjectiveNamePRS1 ServiceObjectiveName = "PRS1" - // ServiceObjectiveNamePRS2 ... - ServiceObjectiveNamePRS2 ServiceObjectiveName = "PRS2" - // ServiceObjectiveNamePRS4 ... - ServiceObjectiveNamePRS4 ServiceObjectiveName = "PRS4" - // ServiceObjectiveNamePRS6 ... - ServiceObjectiveNamePRS6 ServiceObjectiveName = "PRS6" - // ServiceObjectiveNameS0 ... - ServiceObjectiveNameS0 ServiceObjectiveName = "S0" - // ServiceObjectiveNameS1 ... - ServiceObjectiveNameS1 ServiceObjectiveName = "S1" - // ServiceObjectiveNameS12 ... - ServiceObjectiveNameS12 ServiceObjectiveName = "S12" - // ServiceObjectiveNameS2 ... - ServiceObjectiveNameS2 ServiceObjectiveName = "S2" - // ServiceObjectiveNameS3 ... - ServiceObjectiveNameS3 ServiceObjectiveName = "S3" - // ServiceObjectiveNameS4 ... - ServiceObjectiveNameS4 ServiceObjectiveName = "S4" - // ServiceObjectiveNameS6 ... - ServiceObjectiveNameS6 ServiceObjectiveName = "S6" - // ServiceObjectiveNameS7 ... - ServiceObjectiveNameS7 ServiceObjectiveName = "S7" - // ServiceObjectiveNameS9 ... - ServiceObjectiveNameS9 ServiceObjectiveName = "S9" - // ServiceObjectiveNameSystem ... - ServiceObjectiveNameSystem ServiceObjectiveName = "System" - // ServiceObjectiveNameSystem0 ... - ServiceObjectiveNameSystem0 ServiceObjectiveName = "System0" - // ServiceObjectiveNameSystem1 ... - ServiceObjectiveNameSystem1 ServiceObjectiveName = "System1" - // ServiceObjectiveNameSystem2 ... - ServiceObjectiveNameSystem2 ServiceObjectiveName = "System2" - // ServiceObjectiveNameSystem2L ... - ServiceObjectiveNameSystem2L ServiceObjectiveName = "System2L" - // ServiceObjectiveNameSystem3 ... - ServiceObjectiveNameSystem3 ServiceObjectiveName = "System3" - // ServiceObjectiveNameSystem3L ... - ServiceObjectiveNameSystem3L ServiceObjectiveName = "System3L" - // ServiceObjectiveNameSystem4 ... - ServiceObjectiveNameSystem4 ServiceObjectiveName = "System4" - // ServiceObjectiveNameSystem4L ... - ServiceObjectiveNameSystem4L ServiceObjectiveName = "System4L" -) - -// PossibleServiceObjectiveNameValues returns an array of possible values for the ServiceObjectiveName const type. -func PossibleServiceObjectiveNameValues() []ServiceObjectiveName { - return []ServiceObjectiveName{ServiceObjectiveNameBasic, ServiceObjectiveNameDS100, ServiceObjectiveNameDS1000, ServiceObjectiveNameDS1200, ServiceObjectiveNameDS1500, ServiceObjectiveNameDS200, ServiceObjectiveNameDS2000, ServiceObjectiveNameDS300, ServiceObjectiveNameDS400, ServiceObjectiveNameDS500, ServiceObjectiveNameDS600, ServiceObjectiveNameDW100, ServiceObjectiveNameDW1000, ServiceObjectiveNameDW10000c, ServiceObjectiveNameDW1000c, ServiceObjectiveNameDW1200, ServiceObjectiveNameDW1500, ServiceObjectiveNameDW15000c, ServiceObjectiveNameDW1500c, ServiceObjectiveNameDW200, ServiceObjectiveNameDW2000, ServiceObjectiveNameDW2000c, ServiceObjectiveNameDW2500c, ServiceObjectiveNameDW300, ServiceObjectiveNameDW3000, ServiceObjectiveNameDW30000c, ServiceObjectiveNameDW3000c, ServiceObjectiveNameDW400, ServiceObjectiveNameDW500, ServiceObjectiveNameDW5000c, ServiceObjectiveNameDW600, ServiceObjectiveNameDW6000, ServiceObjectiveNameDW6000c, ServiceObjectiveNameDW7500c, ServiceObjectiveNameElasticPool, ServiceObjectiveNameFree, ServiceObjectiveNameP1, ServiceObjectiveNameP11, ServiceObjectiveNameP15, ServiceObjectiveNameP2, ServiceObjectiveNameP3, ServiceObjectiveNameP4, ServiceObjectiveNameP6, ServiceObjectiveNamePRS1, ServiceObjectiveNamePRS2, ServiceObjectiveNamePRS4, ServiceObjectiveNamePRS6, ServiceObjectiveNameS0, ServiceObjectiveNameS1, ServiceObjectiveNameS12, ServiceObjectiveNameS2, ServiceObjectiveNameS3, ServiceObjectiveNameS4, ServiceObjectiveNameS6, ServiceObjectiveNameS7, ServiceObjectiveNameS9, ServiceObjectiveNameSystem, ServiceObjectiveNameSystem0, ServiceObjectiveNameSystem1, ServiceObjectiveNameSystem2, ServiceObjectiveNameSystem2L, ServiceObjectiveNameSystem3, ServiceObjectiveNameSystem3L, ServiceObjectiveNameSystem4, ServiceObjectiveNameSystem4L} -} - -// StorageKeyType enumerates the values for storage key type. -type StorageKeyType string - -const ( - // SharedAccessKey ... - SharedAccessKey StorageKeyType = "SharedAccessKey" - // StorageAccessKey ... - StorageAccessKey StorageKeyType = "StorageAccessKey" -) - -// PossibleStorageKeyTypeValues returns an array of possible values for the StorageKeyType const type. -func PossibleStorageKeyTypeValues() []StorageKeyType { - return []StorageKeyType{SharedAccessKey, StorageAccessKey} -} - -// SyncAgentState enumerates the values for sync agent state. -type SyncAgentState string - -const ( - // SyncAgentStateNeverConnected ... - SyncAgentStateNeverConnected SyncAgentState = "NeverConnected" - // SyncAgentStateOffline ... - SyncAgentStateOffline SyncAgentState = "Offline" - // SyncAgentStateOnline ... - SyncAgentStateOnline SyncAgentState = "Online" -) - -// PossibleSyncAgentStateValues returns an array of possible values for the SyncAgentState const type. -func PossibleSyncAgentStateValues() []SyncAgentState { - return []SyncAgentState{SyncAgentStateNeverConnected, SyncAgentStateOffline, SyncAgentStateOnline} -} - -// SyncConflictResolutionPolicy enumerates the values for sync conflict resolution policy. -type SyncConflictResolutionPolicy string - -const ( - // HubWin ... - HubWin SyncConflictResolutionPolicy = "HubWin" - // MemberWin ... - MemberWin SyncConflictResolutionPolicy = "MemberWin" -) - -// PossibleSyncConflictResolutionPolicyValues returns an array of possible values for the SyncConflictResolutionPolicy const type. -func PossibleSyncConflictResolutionPolicyValues() []SyncConflictResolutionPolicy { - return []SyncConflictResolutionPolicy{HubWin, MemberWin} -} - -// SyncDirection enumerates the values for sync direction. -type SyncDirection string - -const ( - // Bidirectional ... - Bidirectional SyncDirection = "Bidirectional" - // OneWayHubToMember ... - OneWayHubToMember SyncDirection = "OneWayHubToMember" - // OneWayMemberToHub ... - OneWayMemberToHub SyncDirection = "OneWayMemberToHub" -) - -// PossibleSyncDirectionValues returns an array of possible values for the SyncDirection const type. -func PossibleSyncDirectionValues() []SyncDirection { - return []SyncDirection{Bidirectional, OneWayHubToMember, OneWayMemberToHub} -} - -// SyncGroupLogType enumerates the values for sync group log type. -type SyncGroupLogType string - -const ( - // SyncGroupLogTypeAll ... - SyncGroupLogTypeAll SyncGroupLogType = "All" - // SyncGroupLogTypeError ... - SyncGroupLogTypeError SyncGroupLogType = "Error" - // SyncGroupLogTypeSuccess ... - SyncGroupLogTypeSuccess SyncGroupLogType = "Success" - // SyncGroupLogTypeWarning ... - SyncGroupLogTypeWarning SyncGroupLogType = "Warning" -) - -// PossibleSyncGroupLogTypeValues returns an array of possible values for the SyncGroupLogType const type. -func PossibleSyncGroupLogTypeValues() []SyncGroupLogType { - return []SyncGroupLogType{SyncGroupLogTypeAll, SyncGroupLogTypeError, SyncGroupLogTypeSuccess, SyncGroupLogTypeWarning} -} - -// SyncGroupState enumerates the values for sync group state. -type SyncGroupState string - -const ( - // Error ... - Error SyncGroupState = "Error" - // Good ... - Good SyncGroupState = "Good" - // NotReady ... - NotReady SyncGroupState = "NotReady" - // Progressing ... - Progressing SyncGroupState = "Progressing" - // Warning ... - Warning SyncGroupState = "Warning" -) - -// PossibleSyncGroupStateValues returns an array of possible values for the SyncGroupState const type. -func PossibleSyncGroupStateValues() []SyncGroupState { - return []SyncGroupState{Error, Good, NotReady, Progressing, Warning} -} - -// SyncMemberDbType enumerates the values for sync member db type. -type SyncMemberDbType string - -const ( - // AzureSQLDatabase ... - AzureSQLDatabase SyncMemberDbType = "AzureSqlDatabase" - // SQLServerDatabase ... - SQLServerDatabase SyncMemberDbType = "SqlServerDatabase" -) - -// PossibleSyncMemberDbTypeValues returns an array of possible values for the SyncMemberDbType const type. -func PossibleSyncMemberDbTypeValues() []SyncMemberDbType { - return []SyncMemberDbType{AzureSQLDatabase, SQLServerDatabase} -} - -// SyncMemberState enumerates the values for sync member state. -type SyncMemberState string - -const ( - // DeProvisioned ... - DeProvisioned SyncMemberState = "DeProvisioned" - // DeProvisionFailed ... - DeProvisionFailed SyncMemberState = "DeProvisionFailed" - // DeProvisioning ... - DeProvisioning SyncMemberState = "DeProvisioning" - // DisabledBackupRestore ... - DisabledBackupRestore SyncMemberState = "DisabledBackupRestore" - // DisabledTombstoneCleanup ... - DisabledTombstoneCleanup SyncMemberState = "DisabledTombstoneCleanup" - // Provisioned ... - Provisioned SyncMemberState = "Provisioned" - // ProvisionFailed ... - ProvisionFailed SyncMemberState = "ProvisionFailed" - // Provisioning ... - Provisioning SyncMemberState = "Provisioning" - // ReprovisionFailed ... - ReprovisionFailed SyncMemberState = "ReprovisionFailed" - // Reprovisioning ... - Reprovisioning SyncMemberState = "Reprovisioning" - // SyncCancelled ... - SyncCancelled SyncMemberState = "SyncCancelled" - // SyncCancelling ... - SyncCancelling SyncMemberState = "SyncCancelling" - // SyncFailed ... - SyncFailed SyncMemberState = "SyncFailed" - // SyncInProgress ... - SyncInProgress SyncMemberState = "SyncInProgress" - // SyncSucceeded ... - SyncSucceeded SyncMemberState = "SyncSucceeded" - // SyncSucceededWithWarnings ... - SyncSucceededWithWarnings SyncMemberState = "SyncSucceededWithWarnings" - // UnProvisioned ... - UnProvisioned SyncMemberState = "UnProvisioned" - // UnReprovisioned ... - UnReprovisioned SyncMemberState = "UnReprovisioned" -) - -// PossibleSyncMemberStateValues returns an array of possible values for the SyncMemberState const type. -func PossibleSyncMemberStateValues() []SyncMemberState { - return []SyncMemberState{DeProvisioned, DeProvisionFailed, DeProvisioning, DisabledBackupRestore, DisabledTombstoneCleanup, Provisioned, ProvisionFailed, Provisioning, ReprovisionFailed, Reprovisioning, SyncCancelled, SyncCancelling, SyncFailed, SyncInProgress, SyncSucceeded, SyncSucceededWithWarnings, UnProvisioned, UnReprovisioned} -} - -// TransparentDataEncryptionActivityStatus enumerates the values for transparent data encryption activity -// status. -type TransparentDataEncryptionActivityStatus string - -const ( - // Decrypting ... - Decrypting TransparentDataEncryptionActivityStatus = "Decrypting" - // Encrypting ... - Encrypting TransparentDataEncryptionActivityStatus = "Encrypting" -) - -// PossibleTransparentDataEncryptionActivityStatusValues returns an array of possible values for the TransparentDataEncryptionActivityStatus const type. -func PossibleTransparentDataEncryptionActivityStatusValues() []TransparentDataEncryptionActivityStatus { - return []TransparentDataEncryptionActivityStatus{Decrypting, Encrypting} -} - -// TransparentDataEncryptionStatus enumerates the values for transparent data encryption status. -type TransparentDataEncryptionStatus string - -const ( - // TransparentDataEncryptionStatusDisabled ... - TransparentDataEncryptionStatusDisabled TransparentDataEncryptionStatus = "Disabled" - // TransparentDataEncryptionStatusEnabled ... - TransparentDataEncryptionStatusEnabled TransparentDataEncryptionStatus = "Enabled" -) - -// PossibleTransparentDataEncryptionStatusValues returns an array of possible values for the TransparentDataEncryptionStatus const type. -func PossibleTransparentDataEncryptionStatusValues() []TransparentDataEncryptionStatus { - return []TransparentDataEncryptionStatus{TransparentDataEncryptionStatusDisabled, TransparentDataEncryptionStatusEnabled} -} - -// UnitDefinitionType enumerates the values for unit definition type. -type UnitDefinitionType string - -const ( - // UnitDefinitionTypeBytes ... - UnitDefinitionTypeBytes UnitDefinitionType = "Bytes" - // UnitDefinitionTypeBytesPerSecond ... - UnitDefinitionTypeBytesPerSecond UnitDefinitionType = "BytesPerSecond" - // UnitDefinitionTypeCount ... - UnitDefinitionTypeCount UnitDefinitionType = "Count" - // UnitDefinitionTypeCountPerSecond ... - UnitDefinitionTypeCountPerSecond UnitDefinitionType = "CountPerSecond" - // UnitDefinitionTypePercent ... - UnitDefinitionTypePercent UnitDefinitionType = "Percent" - // UnitDefinitionTypeSeconds ... - UnitDefinitionTypeSeconds UnitDefinitionType = "Seconds" -) - -// PossibleUnitDefinitionTypeValues returns an array of possible values for the UnitDefinitionType const type. -func PossibleUnitDefinitionTypeValues() []UnitDefinitionType { - return []UnitDefinitionType{UnitDefinitionTypeBytes, UnitDefinitionTypeBytesPerSecond, UnitDefinitionTypeCount, UnitDefinitionTypeCountPerSecond, UnitDefinitionTypePercent, UnitDefinitionTypeSeconds} -} - -// UnitType enumerates the values for unit type. -type UnitType string - -const ( - // UnitTypeBytes ... - UnitTypeBytes UnitType = "bytes" - // UnitTypeBytesPerSecond ... - UnitTypeBytesPerSecond UnitType = "bytesPerSecond" - // UnitTypeCount ... - UnitTypeCount UnitType = "count" - // UnitTypeCountPerSecond ... - UnitTypeCountPerSecond UnitType = "countPerSecond" - // UnitTypePercent ... - UnitTypePercent UnitType = "percent" - // UnitTypeSeconds ... - UnitTypeSeconds UnitType = "seconds" -) - -// PossibleUnitTypeValues returns an array of possible values for the UnitType const type. -func PossibleUnitTypeValues() []UnitType { - return []UnitType{UnitTypeBytes, UnitTypeBytesPerSecond, UnitTypeCount, UnitTypeCountPerSecond, UnitTypePercent, UnitTypeSeconds} -} - -// VirtualNetworkRuleState enumerates the values for virtual network rule state. -type VirtualNetworkRuleState string - -const ( - // VirtualNetworkRuleStateDeleting ... - VirtualNetworkRuleStateDeleting VirtualNetworkRuleState = "Deleting" - // VirtualNetworkRuleStateInitializing ... - VirtualNetworkRuleStateInitializing VirtualNetworkRuleState = "Initializing" - // VirtualNetworkRuleStateInProgress ... - VirtualNetworkRuleStateInProgress VirtualNetworkRuleState = "InProgress" - // VirtualNetworkRuleStateReady ... - VirtualNetworkRuleStateReady VirtualNetworkRuleState = "Ready" - // VirtualNetworkRuleStateUnknown ... - VirtualNetworkRuleStateUnknown VirtualNetworkRuleState = "Unknown" -) - -// PossibleVirtualNetworkRuleStateValues returns an array of possible values for the VirtualNetworkRuleState const type. -func PossibleVirtualNetworkRuleStateValues() []VirtualNetworkRuleState { - return []VirtualNetworkRuleState{VirtualNetworkRuleStateDeleting, VirtualNetworkRuleStateInitializing, VirtualNetworkRuleStateInProgress, VirtualNetworkRuleStateReady, VirtualNetworkRuleStateUnknown} -} - -// VulnerabilityAssessmentPolicyBaselineName enumerates the values for vulnerability assessment policy baseline -// name. -type VulnerabilityAssessmentPolicyBaselineName string - -const ( - // VulnerabilityAssessmentPolicyBaselineNameDefault ... - VulnerabilityAssessmentPolicyBaselineNameDefault VulnerabilityAssessmentPolicyBaselineName = "default" - // VulnerabilityAssessmentPolicyBaselineNameMaster ... - VulnerabilityAssessmentPolicyBaselineNameMaster VulnerabilityAssessmentPolicyBaselineName = "master" -) - -// PossibleVulnerabilityAssessmentPolicyBaselineNameValues returns an array of possible values for the VulnerabilityAssessmentPolicyBaselineName const type. -func PossibleVulnerabilityAssessmentPolicyBaselineNameValues() []VulnerabilityAssessmentPolicyBaselineName { - return []VulnerabilityAssessmentPolicyBaselineName{VulnerabilityAssessmentPolicyBaselineNameDefault, VulnerabilityAssessmentPolicyBaselineNameMaster} -} - -// VulnerabilityAssessmentScanState enumerates the values for vulnerability assessment scan state. -type VulnerabilityAssessmentScanState string - -const ( - // VulnerabilityAssessmentScanStateFailed ... - VulnerabilityAssessmentScanStateFailed VulnerabilityAssessmentScanState = "Failed" - // VulnerabilityAssessmentScanStateFailedToRun ... - VulnerabilityAssessmentScanStateFailedToRun VulnerabilityAssessmentScanState = "FailedToRun" - // VulnerabilityAssessmentScanStateInProgress ... - VulnerabilityAssessmentScanStateInProgress VulnerabilityAssessmentScanState = "InProgress" - // VulnerabilityAssessmentScanStatePassed ... - VulnerabilityAssessmentScanStatePassed VulnerabilityAssessmentScanState = "Passed" -) - -// PossibleVulnerabilityAssessmentScanStateValues returns an array of possible values for the VulnerabilityAssessmentScanState const type. -func PossibleVulnerabilityAssessmentScanStateValues() []VulnerabilityAssessmentScanState { - return []VulnerabilityAssessmentScanState{VulnerabilityAssessmentScanStateFailed, VulnerabilityAssessmentScanStateFailedToRun, VulnerabilityAssessmentScanStateInProgress, VulnerabilityAssessmentScanStatePassed} -} - -// VulnerabilityAssessmentScanTriggerType enumerates the values for vulnerability assessment scan trigger type. -type VulnerabilityAssessmentScanTriggerType string - -const ( - // VulnerabilityAssessmentScanTriggerTypeOnDemand ... - VulnerabilityAssessmentScanTriggerTypeOnDemand VulnerabilityAssessmentScanTriggerType = "OnDemand" - // VulnerabilityAssessmentScanTriggerTypeRecurring ... - VulnerabilityAssessmentScanTriggerTypeRecurring VulnerabilityAssessmentScanTriggerType = "Recurring" -) - -// PossibleVulnerabilityAssessmentScanTriggerTypeValues returns an array of possible values for the VulnerabilityAssessmentScanTriggerType const type. -func PossibleVulnerabilityAssessmentScanTriggerTypeValues() []VulnerabilityAssessmentScanTriggerType { - return []VulnerabilityAssessmentScanTriggerType{VulnerabilityAssessmentScanTriggerTypeOnDemand, VulnerabilityAssessmentScanTriggerTypeRecurring} -} - -// AutomaticTuningOptions automatic tuning properties for individual advisors. -type AutomaticTuningOptions struct { - // DesiredState - Automatic tuning option desired state. Possible values include: 'AutomaticTuningOptionModeDesiredOff', 'AutomaticTuningOptionModeDesiredOn', 'AutomaticTuningOptionModeDesiredDefault' - DesiredState AutomaticTuningOptionModeDesired `json:"desiredState,omitempty"` - // ActualState - READ-ONLY; Automatic tuning option actual state. Possible values include: 'Off', 'On' - ActualState AutomaticTuningOptionModeActual `json:"actualState,omitempty"` - // ReasonCode - READ-ONLY; Reason code if desired and actual state are different. - ReasonCode *int32 `json:"reasonCode,omitempty"` - // ReasonDesc - READ-ONLY; Reason description if desired and actual state are different. Possible values include: 'Default', 'Disabled', 'AutoConfigured', 'InheritedFromServer', 'QueryStoreOff', 'QueryStoreReadOnly', 'NotSupported' - ReasonDesc AutomaticTuningDisabledReason `json:"reasonDesc,omitempty"` -} - -// AutomaticTuningServerOptions automatic tuning properties for individual advisors. -type AutomaticTuningServerOptions struct { - // DesiredState - Automatic tuning option desired state. Possible values include: 'AutomaticTuningOptionModeDesiredOff', 'AutomaticTuningOptionModeDesiredOn', 'AutomaticTuningOptionModeDesiredDefault' - DesiredState AutomaticTuningOptionModeDesired `json:"desiredState,omitempty"` - // ActualState - READ-ONLY; Automatic tuning option actual state. Possible values include: 'Off', 'On' - ActualState AutomaticTuningOptionModeActual `json:"actualState,omitempty"` - // ReasonCode - READ-ONLY; Reason code if desired and actual state are different. - ReasonCode *int32 `json:"reasonCode,omitempty"` - // ReasonDesc - READ-ONLY; Reason description if desired and actual state are different. Possible values include: 'AutomaticTuningServerReasonDefault', 'AutomaticTuningServerReasonDisabled', 'AutomaticTuningServerReasonAutoConfigured' - ReasonDesc AutomaticTuningServerReason `json:"reasonDesc,omitempty"` -} - -// AutomaticTuningServerProperties server-level Automatic Tuning properties. -type AutomaticTuningServerProperties struct { - // DesiredState - Automatic tuning desired state. Possible values include: 'AutomaticTuningServerModeCustom', 'AutomaticTuningServerModeAuto', 'AutomaticTuningServerModeUnspecified' - DesiredState AutomaticTuningServerMode `json:"desiredState,omitempty"` - // ActualState - READ-ONLY; Automatic tuning actual state. Possible values include: 'AutomaticTuningServerModeCustom', 'AutomaticTuningServerModeAuto', 'AutomaticTuningServerModeUnspecified' - ActualState AutomaticTuningServerMode `json:"actualState,omitempty"` - // Options - Automatic tuning options definition. - Options map[string]*AutomaticTuningServerOptions `json:"options"` -} - -// MarshalJSON is the custom marshaler for AutomaticTuningServerProperties. -func (atsp AutomaticTuningServerProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if atsp.DesiredState != "" { - objectMap["desiredState"] = atsp.DesiredState - } - if atsp.Options != nil { - objectMap["options"] = atsp.Options - } - return json.Marshal(objectMap) -} - -// BackupLongTermRetentionPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type BackupLongTermRetentionPoliciesCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *BackupLongTermRetentionPoliciesCreateOrUpdateFuture) Result(client BackupLongTermRetentionPoliciesClient) (bltrp BackupLongTermRetentionPolicy, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.BackupLongTermRetentionPoliciesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if bltrp.Response.Response, err = future.GetResult(sender); err == nil && bltrp.Response.Response.StatusCode != http.StatusNoContent { - bltrp, err = client.CreateOrUpdateResponder(bltrp.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionPoliciesCreateOrUpdateFuture", "Result", bltrp.Response.Response, "Failure responding to request") - } - } - return -} - -// BackupLongTermRetentionPolicy a long term retention policy. -type BackupLongTermRetentionPolicy struct { - autorest.Response `json:"-"` - // LongTermRetentionPolicyProperties - Resource properties. - *LongTermRetentionPolicyProperties `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 BackupLongTermRetentionPolicy. -func (bltrp BackupLongTermRetentionPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if bltrp.LongTermRetentionPolicyProperties != nil { - objectMap["properties"] = bltrp.LongTermRetentionPolicyProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for BackupLongTermRetentionPolicy struct. -func (bltrp *BackupLongTermRetentionPolicy) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var longTermRetentionPolicyProperties LongTermRetentionPolicyProperties - err = json.Unmarshal(*v, &longTermRetentionPolicyProperties) - if err != nil { - return err - } - bltrp.LongTermRetentionPolicyProperties = &longTermRetentionPolicyProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - bltrp.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - bltrp.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - bltrp.Type = &typeVar - } - } - } - - return nil -} - -// BackupShortTermRetentionPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type BackupShortTermRetentionPoliciesCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *BackupShortTermRetentionPoliciesCreateOrUpdateFuture) Result(client BackupShortTermRetentionPoliciesClient) (bstrp BackupShortTermRetentionPolicy, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.BackupShortTermRetentionPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.BackupShortTermRetentionPoliciesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if bstrp.Response.Response, err = future.GetResult(sender); err == nil && bstrp.Response.Response.StatusCode != http.StatusNoContent { - bstrp, err = client.CreateOrUpdateResponder(bstrp.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.BackupShortTermRetentionPoliciesCreateOrUpdateFuture", "Result", bstrp.Response.Response, "Failure responding to request") - } - } - return -} - -// BackupShortTermRetentionPoliciesUpdateFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type BackupShortTermRetentionPoliciesUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *BackupShortTermRetentionPoliciesUpdateFuture) Result(client BackupShortTermRetentionPoliciesClient) (bstrp BackupShortTermRetentionPolicy, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.BackupShortTermRetentionPoliciesUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.BackupShortTermRetentionPoliciesUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if bstrp.Response.Response, err = future.GetResult(sender); err == nil && bstrp.Response.Response.StatusCode != http.StatusNoContent { - bstrp, err = client.UpdateResponder(bstrp.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.BackupShortTermRetentionPoliciesUpdateFuture", "Result", bstrp.Response.Response, "Failure responding to request") - } - } - return -} - -// BackupShortTermRetentionPolicy a short term retention policy. -type BackupShortTermRetentionPolicy struct { - autorest.Response `json:"-"` - // BackupShortTermRetentionPolicyProperties - Resource properties. - *BackupShortTermRetentionPolicyProperties `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 BackupShortTermRetentionPolicy. -func (bstrp BackupShortTermRetentionPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if bstrp.BackupShortTermRetentionPolicyProperties != nil { - objectMap["properties"] = bstrp.BackupShortTermRetentionPolicyProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for BackupShortTermRetentionPolicy struct. -func (bstrp *BackupShortTermRetentionPolicy) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var backupShortTermRetentionPolicyProperties BackupShortTermRetentionPolicyProperties - err = json.Unmarshal(*v, &backupShortTermRetentionPolicyProperties) - if err != nil { - return err - } - bstrp.BackupShortTermRetentionPolicyProperties = &backupShortTermRetentionPolicyProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - bstrp.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - bstrp.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - bstrp.Type = &typeVar - } - } - } - - return nil -} - -// BackupShortTermRetentionPolicyListResult a list of short term retention policies. -type BackupShortTermRetentionPolicyListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]BackupShortTermRetentionPolicy `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// BackupShortTermRetentionPolicyListResultIterator provides access to a complete listing of -// BackupShortTermRetentionPolicy values. -type BackupShortTermRetentionPolicyListResultIterator struct { - i int - page BackupShortTermRetentionPolicyListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *BackupShortTermRetentionPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BackupShortTermRetentionPolicyListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *BackupShortTermRetentionPolicyListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter BackupShortTermRetentionPolicyListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter BackupShortTermRetentionPolicyListResultIterator) Response() BackupShortTermRetentionPolicyListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter BackupShortTermRetentionPolicyListResultIterator) Value() BackupShortTermRetentionPolicy { - if !iter.page.NotDone() { - return BackupShortTermRetentionPolicy{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the BackupShortTermRetentionPolicyListResultIterator type. -func NewBackupShortTermRetentionPolicyListResultIterator(page BackupShortTermRetentionPolicyListResultPage) BackupShortTermRetentionPolicyListResultIterator { - return BackupShortTermRetentionPolicyListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (bstrplr BackupShortTermRetentionPolicyListResult) IsEmpty() bool { - return bstrplr.Value == nil || len(*bstrplr.Value) == 0 -} - -// backupShortTermRetentionPolicyListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (bstrplr BackupShortTermRetentionPolicyListResult) backupShortTermRetentionPolicyListResultPreparer(ctx context.Context) (*http.Request, error) { - if bstrplr.NextLink == nil || len(to.String(bstrplr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(bstrplr.NextLink))) -} - -// BackupShortTermRetentionPolicyListResultPage contains a page of BackupShortTermRetentionPolicy values. -type BackupShortTermRetentionPolicyListResultPage struct { - fn func(context.Context, BackupShortTermRetentionPolicyListResult) (BackupShortTermRetentionPolicyListResult, error) - bstrplr BackupShortTermRetentionPolicyListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *BackupShortTermRetentionPolicyListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BackupShortTermRetentionPolicyListResultPage.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.bstrplr) - if err != nil { - return err - } - page.bstrplr = 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 *BackupShortTermRetentionPolicyListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page BackupShortTermRetentionPolicyListResultPage) NotDone() bool { - return !page.bstrplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page BackupShortTermRetentionPolicyListResultPage) Response() BackupShortTermRetentionPolicyListResult { - return page.bstrplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page BackupShortTermRetentionPolicyListResultPage) Values() []BackupShortTermRetentionPolicy { - if page.bstrplr.IsEmpty() { - return nil - } - return *page.bstrplr.Value -} - -// Creates a new instance of the BackupShortTermRetentionPolicyListResultPage type. -func NewBackupShortTermRetentionPolicyListResultPage(getNextPage func(context.Context, BackupShortTermRetentionPolicyListResult) (BackupShortTermRetentionPolicyListResult, error)) BackupShortTermRetentionPolicyListResultPage { - return BackupShortTermRetentionPolicyListResultPage{fn: getNextPage} -} - -// BackupShortTermRetentionPolicyProperties properties of a short term retention policy -type BackupShortTermRetentionPolicyProperties struct { - // RetentionDays - The backup retention period in days. This is how many days Point-in-Time Restore will be supported. - RetentionDays *int32 `json:"retentionDays,omitempty"` -} - -// CheckNameAvailabilityRequest a request to check whether the specified name for a resource is available. -type CheckNameAvailabilityRequest struct { - // Name - The name whose availability is to be checked. - Name *string `json:"name,omitempty"` - // Type - The type of resource that is used as the scope of the availability check. - Type *string `json:"type,omitempty"` -} - -// CheckNameAvailabilityResponse a response indicating whether the specified name for a resource is -// available. -type CheckNameAvailabilityResponse struct { - autorest.Response `json:"-"` - // Available - READ-ONLY; True if the name is available, otherwise false. - Available *bool `json:"available,omitempty"` - // Message - READ-ONLY; A message explaining why the name is unavailable. Will be null if the name is available. - Message *string `json:"message,omitempty"` - // Name - READ-ONLY; The name whose availability was checked. - Name *string `json:"name,omitempty"` - // Reason - READ-ONLY; The reason code explaining why the name is unavailable. Will be null if the name is available. Possible values include: 'Invalid', 'AlreadyExists' - Reason CheckNameAvailabilityReason `json:"reason,omitempty"` -} - -// CompleteDatabaseRestoreDefinition contains the information necessary to perform a complete database -// restore operation. -type CompleteDatabaseRestoreDefinition struct { - // LastBackupName - The last backup name to apply - LastBackupName *string `json:"lastBackupName,omitempty"` -} - -// CreateDatabaseRestorePointDefinition contains the information necessary to perform a create database -// restore point operation. -type CreateDatabaseRestorePointDefinition struct { - // RestorePointLabel - The restore point label to apply - RestorePointLabel *string `json:"restorePointLabel,omitempty"` -} - -// Database a database resource. -type Database struct { - autorest.Response `json:"-"` - // Sku - The database SKU. - // - // The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API or one of the following commands: - // - // ```azurecli - // az sql db list-editions -l -o table - // ```` - // - // ```powershell - // Get-AzSqlServerServiceObjective -Location - // ```` - Sku *Sku `json:"sku,omitempty"` - // Kind - READ-ONLY; Kind of database. This is metadata used for the Azure portal experience. - Kind *string `json:"kind,omitempty"` - // ManagedBy - READ-ONLY; Resource that manages the database. - ManagedBy *string `json:"managedBy,omitempty"` - // DatabaseProperties - Resource properties. - *DatabaseProperties `json:"properties,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for Database. -func (d Database) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if d.Sku != nil { - objectMap["sku"] = d.Sku - } - if d.DatabaseProperties != nil { - objectMap["properties"] = d.DatabaseProperties - } - 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 Database struct. -func (d *Database) UnmarshalJSON(body []byte) error { - 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 - } - d.Sku = &sku - } - case "kind": - if v != nil { - var kind string - err = json.Unmarshal(*v, &kind) - if err != nil { - return err - } - d.Kind = &kind - } - case "managedBy": - if v != nil { - var managedBy string - err = json.Unmarshal(*v, &managedBy) - if err != nil { - return err - } - d.ManagedBy = &managedBy - } - case "properties": - if v != nil { - var databaseProperties DatabaseProperties - err = json.Unmarshal(*v, &databaseProperties) - if err != nil { - return err - } - d.DatabaseProperties = &databaseProperties - } - 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 "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 -} - -// DatabaseAutomaticTuning database-level Automatic Tuning. -type DatabaseAutomaticTuning struct { - autorest.Response `json:"-"` - // DatabaseAutomaticTuningProperties - Resource properties. - *DatabaseAutomaticTuningProperties `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 DatabaseAutomaticTuning. -func (dat DatabaseAutomaticTuning) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dat.DatabaseAutomaticTuningProperties != nil { - objectMap["properties"] = dat.DatabaseAutomaticTuningProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DatabaseAutomaticTuning struct. -func (dat *DatabaseAutomaticTuning) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var databaseAutomaticTuningProperties DatabaseAutomaticTuningProperties - err = json.Unmarshal(*v, &databaseAutomaticTuningProperties) - if err != nil { - return err - } - dat.DatabaseAutomaticTuningProperties = &databaseAutomaticTuningProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - dat.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - dat.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - dat.Type = &typeVar - } - } - } - - return nil -} - -// DatabaseAutomaticTuningProperties database-level Automatic Tuning properties. -type DatabaseAutomaticTuningProperties struct { - // DesiredState - Automatic tuning desired state. Possible values include: 'Inherit', 'Custom', 'Auto', 'Unspecified' - DesiredState AutomaticTuningMode `json:"desiredState,omitempty"` - // ActualState - READ-ONLY; Automatic tuning actual state. Possible values include: 'Inherit', 'Custom', 'Auto', 'Unspecified' - ActualState AutomaticTuningMode `json:"actualState,omitempty"` - // Options - Automatic tuning options definition. - Options map[string]*AutomaticTuningOptions `json:"options"` -} - -// MarshalJSON is the custom marshaler for DatabaseAutomaticTuningProperties. -func (datp DatabaseAutomaticTuningProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if datp.DesiredState != "" { - objectMap["desiredState"] = datp.DesiredState - } - if datp.Options != nil { - objectMap["options"] = datp.Options - } - return json.Marshal(objectMap) -} - -// DatabaseBlobAuditingPolicy a database blob auditing policy. -type DatabaseBlobAuditingPolicy struct { - autorest.Response `json:"-"` - // Kind - READ-ONLY; Resource kind. - Kind *string `json:"kind,omitempty"` - // DatabaseBlobAuditingPolicyProperties - Resource properties. - *DatabaseBlobAuditingPolicyProperties `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 DatabaseBlobAuditingPolicy. -func (dbap DatabaseBlobAuditingPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dbap.DatabaseBlobAuditingPolicyProperties != nil { - objectMap["properties"] = dbap.DatabaseBlobAuditingPolicyProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DatabaseBlobAuditingPolicy struct. -func (dbap *DatabaseBlobAuditingPolicy) UnmarshalJSON(body []byte) error { - 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 string - err = json.Unmarshal(*v, &kind) - if err != nil { - return err - } - dbap.Kind = &kind - } - case "properties": - if v != nil { - var databaseBlobAuditingPolicyProperties DatabaseBlobAuditingPolicyProperties - err = json.Unmarshal(*v, &databaseBlobAuditingPolicyProperties) - if err != nil { - return err - } - dbap.DatabaseBlobAuditingPolicyProperties = &databaseBlobAuditingPolicyProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - dbap.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - dbap.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - dbap.Type = &typeVar - } - } - } - - 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' - State BlobAuditingPolicyState `json:"state,omitempty"` - // StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint is required. - StorageEndpoint *string `json:"storageEndpoint,omitempty"` - // StorageAccountAccessKey - Specifies the identifier key of the auditing storage account. If state is Enabled and storageEndpoint is specified, storageAccountAccessKey is required. - StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` - // RetentionDays - Specifies the number of days to keep in the audit logs in the storage account. - RetentionDays *int32 `json:"retentionDays,omitempty"` - // AuditActionsAndGroups - Specifies the Actions-Groups and Actions to audit. - // - // The recommended set of action groups to use is the following combination - this will audit all the queries and stored procedures executed against the database, as well as successful and failed logins: - // - // BATCH_COMPLETED_GROUP, - // SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, - // FAILED_DATABASE_AUTHENTICATION_GROUP. - // - // This above combination is also the set that is configured by default when enabling auditing from the Azure portal. - // - // The supported action groups to audit are (note: choose only specific groups that cover your auditing needs. Using unnecessary groups could lead to very large quantities of audit records): - // - // APPLICATION_ROLE_CHANGE_PASSWORD_GROUP - // BACKUP_RESTORE_GROUP - // DATABASE_LOGOUT_GROUP - // DATABASE_OBJECT_CHANGE_GROUP - // DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP - // DATABASE_OBJECT_PERMISSION_CHANGE_GROUP - // DATABASE_OPERATION_GROUP - // DATABASE_PERMISSION_CHANGE_GROUP - // DATABASE_PRINCIPAL_CHANGE_GROUP - // DATABASE_PRINCIPAL_IMPERSONATION_GROUP - // DATABASE_ROLE_MEMBER_CHANGE_GROUP - // FAILED_DATABASE_AUTHENTICATION_GROUP - // SCHEMA_OBJECT_ACCESS_GROUP - // SCHEMA_OBJECT_CHANGE_GROUP - // SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP - // SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP - // SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP - // USER_CHANGE_PASSWORD_GROUP - // BATCH_STARTED_GROUP - // BATCH_COMPLETED_GROUP - // - // These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs. - // - // For more information, see [Database-Level Audit Action Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). - // - // For Database auditing policy, specific Actions can also be specified (note that Actions cannot be specified for Server auditing policy). The supported actions to audit are: - // SELECT - // UPDATE - // INSERT - // DELETE - // EXECUTE - // RECEIVE - // REFERENCES - // - // The general form for defining an action to be audited is: - // {action} ON {object} BY {principal} - // - // Note that in the above format can refer to an object like a table, view, or stored procedure, or an entire database or schema. For the latter cases, the forms DATABASE::{db_name} and SCHEMA::{schema_name} are used, respectively. - // - // For example: - // SELECT on dbo.myTable by public - // SELECT on DATABASE::myDatabase by public - // SELECT on SCHEMA::mySchema by public - // - // For more information, see [Database-Level Audit Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions) - AuditActionsAndGroups *[]string `json:"auditActionsAndGroups,omitempty"` - // StorageAccountSubscriptionID - Specifies the blob storage subscription Id. - StorageAccountSubscriptionID *uuid.UUID `json:"storageAccountSubscriptionId,omitempty"` - // IsStorageSecondaryKeyInUse - Specifies whether storageAccountAccessKey value is the storage's secondary key. - IsStorageSecondaryKeyInUse *bool `json:"isStorageSecondaryKeyInUse,omitempty"` - // IsAzureMonitorTargetEnabled - Specifies whether audit events are sent to Azure Monitor. - // In order to send the events to Azure Monitor, specify 'state' as 'Enabled' and 'isAzureMonitorTargetEnabled' as true. - // - // When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created. - // Note that for server level audit you should use the 'master' database as {databaseName}. - // - // Diagnostic Settings URI format: - // PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview - // - // For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207) - // or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043) - IsAzureMonitorTargetEnabled *bool `json:"isAzureMonitorTargetEnabled,omitempty"` -} - -// DatabaseListResult a list of databases. -type DatabaseListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]Database `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// DatabaseListResultIterator provides access to a complete listing of Database values. -type DatabaseListResultIterator struct { - i int - page DatabaseListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *DatabaseListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *DatabaseListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DatabaseListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter DatabaseListResultIterator) Response() DatabaseListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter DatabaseListResultIterator) Value() Database { - if !iter.page.NotDone() { - return Database{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the DatabaseListResultIterator type. -func NewDatabaseListResultIterator(page DatabaseListResultPage) DatabaseListResultIterator { - return DatabaseListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (dlr DatabaseListResult) IsEmpty() bool { - return dlr.Value == nil || len(*dlr.Value) == 0 -} - -// databaseListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (dlr DatabaseListResult) databaseListResultPreparer(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))) -} - -// DatabaseListResultPage contains a page of Database values. -type DatabaseListResultPage struct { - fn func(context.Context, DatabaseListResult) (DatabaseListResult, error) - dlr DatabaseListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *DatabaseListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseListResultPage.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 *DatabaseListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DatabaseListResultPage) NotDone() bool { - return !page.dlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page DatabaseListResultPage) Response() DatabaseListResult { - return page.dlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page DatabaseListResultPage) Values() []Database { - if page.dlr.IsEmpty() { - return nil - } - return *page.dlr.Value -} - -// Creates a new instance of the DatabaseListResultPage type. -func NewDatabaseListResultPage(getNextPage func(context.Context, DatabaseListResult) (DatabaseListResult, error)) DatabaseListResultPage { - return DatabaseListResultPage{fn: getNextPage} -} - -// DatabaseOperation a database operation. -type DatabaseOperation struct { - // DatabaseOperationProperties - Resource properties. - *DatabaseOperationProperties `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 DatabaseOperation. -func (do DatabaseOperation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if do.DatabaseOperationProperties != nil { - objectMap["properties"] = do.DatabaseOperationProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DatabaseOperation struct. -func (do *DatabaseOperation) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var databaseOperationProperties DatabaseOperationProperties - err = json.Unmarshal(*v, &databaseOperationProperties) - if err != nil { - return err - } - do.DatabaseOperationProperties = &databaseOperationProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - do.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - do.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - do.Type = &typeVar - } - } - } - - return nil -} - -// DatabaseOperationListResult the response to a list database operations request -type DatabaseOperationListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]DatabaseOperation `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// DatabaseOperationListResultIterator provides access to a complete listing of DatabaseOperation values. -type DatabaseOperationListResultIterator struct { - i int - page DatabaseOperationListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *DatabaseOperationListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseOperationListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *DatabaseOperationListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DatabaseOperationListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter DatabaseOperationListResultIterator) Response() DatabaseOperationListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter DatabaseOperationListResultIterator) Value() DatabaseOperation { - if !iter.page.NotDone() { - return DatabaseOperation{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the DatabaseOperationListResultIterator type. -func NewDatabaseOperationListResultIterator(page DatabaseOperationListResultPage) DatabaseOperationListResultIterator { - return DatabaseOperationListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (dolr DatabaseOperationListResult) IsEmpty() bool { - return dolr.Value == nil || len(*dolr.Value) == 0 -} - -// databaseOperationListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (dolr DatabaseOperationListResult) databaseOperationListResultPreparer(ctx context.Context) (*http.Request, error) { - if dolr.NextLink == nil || len(to.String(dolr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(dolr.NextLink))) -} - -// DatabaseOperationListResultPage contains a page of DatabaseOperation values. -type DatabaseOperationListResultPage struct { - fn func(context.Context, DatabaseOperationListResult) (DatabaseOperationListResult, error) - dolr DatabaseOperationListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *DatabaseOperationListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseOperationListResultPage.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.dolr) - if err != nil { - return err - } - page.dolr = 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 *DatabaseOperationListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DatabaseOperationListResultPage) NotDone() bool { - return !page.dolr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page DatabaseOperationListResultPage) Response() DatabaseOperationListResult { - return page.dolr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page DatabaseOperationListResultPage) Values() []DatabaseOperation { - if page.dolr.IsEmpty() { - return nil - } - return *page.dolr.Value -} - -// Creates a new instance of the DatabaseOperationListResultPage type. -func NewDatabaseOperationListResultPage(getNextPage func(context.Context, DatabaseOperationListResult) (DatabaseOperationListResult, error)) DatabaseOperationListResultPage { - return DatabaseOperationListResultPage{fn: getNextPage} -} - -// DatabaseOperationProperties the properties of a database operation. -type DatabaseOperationProperties struct { - // DatabaseName - READ-ONLY; The name of the database the operation is being performed on. - DatabaseName *string `json:"databaseName,omitempty"` - // Operation - READ-ONLY; The name of operation. - Operation *string `json:"operation,omitempty"` - // OperationFriendlyName - READ-ONLY; The friendly name of operation. - OperationFriendlyName *string `json:"operationFriendlyName,omitempty"` - // PercentComplete - READ-ONLY; The percentage of the operation completed. - PercentComplete *int32 `json:"percentComplete,omitempty"` - // ServerName - READ-ONLY; The name of the server. - ServerName *string `json:"serverName,omitempty"` - // StartTime - READ-ONLY; The operation start time. - StartTime *date.Time `json:"startTime,omitempty"` - // State - READ-ONLY; The operation state. Possible values include: 'ManagementOperationStatePending', 'ManagementOperationStateInProgress', 'ManagementOperationStateSucceeded', 'ManagementOperationStateFailed', 'ManagementOperationStateCancelInProgress', 'ManagementOperationStateCancelled' - State ManagementOperationState `json:"state,omitempty"` - // ErrorCode - READ-ONLY; The operation error code. - ErrorCode *int32 `json:"errorCode,omitempty"` - // ErrorDescription - READ-ONLY; The operation error description. - ErrorDescription *string `json:"errorDescription,omitempty"` - // ErrorSeverity - READ-ONLY; The operation error severity. - ErrorSeverity *int32 `json:"errorSeverity,omitempty"` - // IsUserError - READ-ONLY; Whether or not the error is a user error. - IsUserError *bool `json:"isUserError,omitempty"` - // EstimatedCompletionTime - READ-ONLY; The estimated completion time of the operation. - EstimatedCompletionTime *date.Time `json:"estimatedCompletionTime,omitempty"` - // Description - READ-ONLY; The operation description. - Description *string `json:"description,omitempty"` - // IsCancellable - READ-ONLY; Whether the operation can be cancelled. - IsCancellable *bool `json:"isCancellable,omitempty"` -} - -// DatabaseProperties the database's properties. -type DatabaseProperties struct { - // CreateMode - Specifies the mode of database creation. - // - // Default: regular database creation. - // - // Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified as the resource ID of the source database. - // - // Secondary: creates a database as a secondary replica of an existing database. sourceDatabaseId must be specified as the resource ID of the existing primary database. - // - // PointInTimeRestore: Creates a database by restoring a point in time backup of an existing database. sourceDatabaseId must be specified as the resource ID of the existing database, and restorePointInTime must be specified. - // - // Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be specified as the recoverable database resource ID to restore. - // - // Restore: Creates a database by restoring a backup of a deleted database. sourceDatabaseId must be specified. If sourceDatabaseId is the database's original resource ID, then sourceDatabaseDeletionDate must be specified. Otherwise sourceDatabaseId must be the restorable dropped database resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be specified to restore from an earlier point in time. - // - // RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention vault. recoveryServicesRecoveryPointResourceId must be specified as the recovery point resource ID. - // - // Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. Possible values include: 'CreateModeDefault', 'CreateModeCopy', 'CreateModeSecondary', 'CreateModePointInTimeRestore', 'CreateModeRestore', 'CreateModeRecovery', 'CreateModeRestoreExternalBackup', 'CreateModeRestoreExternalBackupSecondary', 'CreateModeRestoreLongTermRetentionBackup', 'CreateModeOnlineSecondary' - CreateMode CreateMode `json:"createMode,omitempty"` - // Collation - The collation of the database. - Collation *string `json:"collation,omitempty"` - // MaxSizeBytes - The max size of the database expressed in bytes. - MaxSizeBytes *int64 `json:"maxSizeBytes,omitempty"` - // SampleName - The name of the sample schema to apply when creating this database. Possible values include: 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull' - SampleName SampleName `json:"sampleName,omitempty"` - // ElasticPoolID - The resource identifier of the elastic pool containing this database. - ElasticPoolID *string `json:"elasticPoolId,omitempty"` - // SourceDatabaseID - The resource identifier of the source database associated with create operation of this database. - SourceDatabaseID *string `json:"sourceDatabaseId,omitempty"` - // Status - READ-ONLY; The status of the database. Possible values include: 'DatabaseStatusOnline', 'DatabaseStatusRestoring', 'DatabaseStatusRecoveryPending', 'DatabaseStatusRecovering', 'DatabaseStatusSuspect', 'DatabaseStatusOffline', 'DatabaseStatusStandby', 'DatabaseStatusShutdown', 'DatabaseStatusEmergencyMode', 'DatabaseStatusAutoClosed', 'DatabaseStatusCopying', 'DatabaseStatusCreating', 'DatabaseStatusInaccessible', 'DatabaseStatusOfflineSecondary', 'DatabaseStatusPausing', 'DatabaseStatusPaused', 'DatabaseStatusResuming', 'DatabaseStatusScaling', 'DatabaseStatusOfflineChangingDwPerformanceTiers', 'DatabaseStatusOnlineChangingDwPerformanceTiers', 'DatabaseStatusDisabled' - Status DatabaseStatus `json:"status,omitempty"` - // DatabaseID - READ-ONLY; The ID of the database. - DatabaseID *uuid.UUID `json:"databaseId,omitempty"` - // CreationDate - READ-ONLY; The creation date of the database (ISO8601 format). - CreationDate *date.Time `json:"creationDate,omitempty"` - // CurrentServiceObjectiveName - READ-ONLY; The current service level objective name of the database. - CurrentServiceObjectiveName *string `json:"currentServiceObjectiveName,omitempty"` - // RequestedServiceObjectiveName - READ-ONLY; The requested service level objective name of the database. - RequestedServiceObjectiveName *string `json:"requestedServiceObjectiveName,omitempty"` - // DefaultSecondaryLocation - READ-ONLY; The default secondary region for this database. - DefaultSecondaryLocation *string `json:"defaultSecondaryLocation,omitempty"` - // FailoverGroupID - READ-ONLY; Failover Group resource identifier that this database belongs to. - FailoverGroupID *string `json:"failoverGroupId,omitempty"` - // RestorePointInTime - Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. - RestorePointInTime *date.Time `json:"restorePointInTime,omitempty"` - // SourceDatabaseDeletionDate - Specifies the time that the database was deleted. - SourceDatabaseDeletionDate *date.Time `json:"sourceDatabaseDeletionDate,omitempty"` - // RecoveryServicesRecoveryPointID - The resource identifier of the recovery point associated with create operation of this database. - RecoveryServicesRecoveryPointID *string `json:"recoveryServicesRecoveryPointId,omitempty"` - // LongTermRetentionBackupResourceID - The resource identifier of the long term retention backup associated with create operation of this database. - LongTermRetentionBackupResourceID *string `json:"longTermRetentionBackupResourceId,omitempty"` - // RecoverableDatabaseID - The resource identifier of the recoverable database associated with create operation of this database. - RecoverableDatabaseID *string `json:"recoverableDatabaseId,omitempty"` - // RestorableDroppedDatabaseID - The resource identifier of the restorable dropped database associated with create operation of this database. - RestorableDroppedDatabaseID *string `json:"restorableDroppedDatabaseId,omitempty"` - // CatalogCollation - Collation of the metadata catalog. Possible values include: 'DATABASEDEFAULT', 'SQLLatin1GeneralCP1CIAS' - CatalogCollation CatalogCollationType `json:"catalogCollation,omitempty"` - // ZoneRedundant - Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones. - ZoneRedundant *bool `json:"zoneRedundant,omitempty"` - // LicenseType - The license type to apply for this database. Possible values include: 'LicenseIncluded', 'BasePrice' - LicenseType DatabaseLicenseType `json:"licenseType,omitempty"` - // MaxLogSizeBytes - READ-ONLY; The max log size for this database. - MaxLogSizeBytes *int64 `json:"maxLogSizeBytes,omitempty"` - // EarliestRestoreDate - READ-ONLY; This records the earliest start date and time that restore is available for this database (ISO8601 format). - EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"` - // ReadScale - If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica. This property is only settable for Premium and Business Critical databases. Possible values include: 'DatabaseReadScaleEnabled', 'DatabaseReadScaleDisabled' - ReadScale DatabaseReadScale `json:"readScale,omitempty"` - // ReadReplicaCount - The number of readonly secondary replicas associated with the database to which readonly application intent connections may be routed. This property is only settable for Hyperscale edition databases. - ReadReplicaCount *int32 `json:"readReplicaCount,omitempty"` - // CurrentSku - READ-ONLY; The name and tier of the SKU. - CurrentSku *Sku `json:"currentSku,omitempty"` - // AutoPauseDelay - Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled - AutoPauseDelay *int32 `json:"autoPauseDelay,omitempty"` - // MinCapacity - Minimal capacity that database will always have allocated, if not paused - MinCapacity *float64 `json:"minCapacity,omitempty"` - // PausedDate - READ-ONLY; The date when database was paused by user configuration or action (ISO8601 format). Null if the database is ready. - PausedDate *date.Time `json:"pausedDate,omitempty"` - // ResumedDate - READ-ONLY; The date when database was resumed by user action or database login (ISO8601 format). Null if the database is paused. - ResumedDate *date.Time `json:"resumedDate,omitempty"` -} - -// DatabasesCreateImportOperationFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type DatabasesCreateImportOperationFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DatabasesCreateImportOperationFuture) Result(client DatabasesClient) (ier ImportExportResponse, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesCreateImportOperationFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.DatabasesCreateImportOperationFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ier.Response.Response, err = future.GetResult(sender); err == nil && ier.Response.Response.StatusCode != http.StatusNoContent { - ier, err = client.CreateImportOperationResponder(ier.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesCreateImportOperationFuture", "Result", ier.Response.Response, "Failure responding to request") - } - } - return -} - -// 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) (d Database, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.DatabasesCreateOrUpdateFuture") - 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, "sql.DatabasesCreateOrUpdateFuture", "Result", d.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, "sql.DatabasesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.DatabasesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// DatabaseSecurityAlertPolicy contains information about a database Threat Detection policy. -type DatabaseSecurityAlertPolicy struct { - autorest.Response `json:"-"` - // Location - The geo-location where the resource lives - Location *string `json:"location,omitempty"` - // Kind - READ-ONLY; Resource kind. - Kind *string `json:"kind,omitempty"` - // DatabaseSecurityAlertPolicyProperties - Properties of the security alert policy. - *DatabaseSecurityAlertPolicyProperties `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 DatabaseSecurityAlertPolicy. -func (dsap DatabaseSecurityAlertPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dsap.Location != nil { - objectMap["location"] = dsap.Location - } - if dsap.DatabaseSecurityAlertPolicyProperties != nil { - objectMap["properties"] = dsap.DatabaseSecurityAlertPolicyProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DatabaseSecurityAlertPolicy struct. -func (dsap *DatabaseSecurityAlertPolicy) UnmarshalJSON(body []byte) error { - 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 - } - dsap.Location = &location - } - case "kind": - if v != nil { - var kind string - err = json.Unmarshal(*v, &kind) - if err != nil { - return err - } - dsap.Kind = &kind - } - case "properties": - if v != nil { - var databaseSecurityAlertPolicyProperties DatabaseSecurityAlertPolicyProperties - err = json.Unmarshal(*v, &databaseSecurityAlertPolicyProperties) - if err != nil { - return err - } - dsap.DatabaseSecurityAlertPolicyProperties = &databaseSecurityAlertPolicyProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - dsap.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - dsap.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - dsap.Type = &typeVar - } - } - } - - return nil -} - -// DatabaseSecurityAlertPolicyProperties properties for a database Threat Detection policy. -type DatabaseSecurityAlertPolicyProperties struct { - // State - Specifies the state of the policy. If state is Enabled, storageEndpoint and storageAccountAccessKey are required. Possible values include: 'SecurityAlertPolicyStateNew', 'SecurityAlertPolicyStateEnabled', 'SecurityAlertPolicyStateDisabled' - State SecurityAlertPolicyState `json:"state,omitempty"` - // DisabledAlerts - Specifies the semicolon-separated list of alerts that are disabled, or empty string to disable no alerts. Possible values: Sql_Injection; Sql_Injection_Vulnerability; Access_Anomaly; Data_Exfiltration; Unsafe_Action. - DisabledAlerts *string `json:"disabledAlerts,omitempty"` - // EmailAddresses - Specifies the semicolon-separated list of e-mail addresses to which the alert is sent. - EmailAddresses *string `json:"emailAddresses,omitempty"` - // EmailAccountAdmins - Specifies that the alert is sent to the account administrators. Possible values include: 'SecurityAlertPolicyEmailAccountAdminsEnabled', 'SecurityAlertPolicyEmailAccountAdminsDisabled' - EmailAccountAdmins SecurityAlertPolicyEmailAccountAdmins `json:"emailAccountAdmins,omitempty"` - // StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs. If state is Enabled, storageEndpoint is required. - StorageEndpoint *string `json:"storageEndpoint,omitempty"` - // StorageAccountAccessKey - Specifies the identifier key of the Threat Detection audit storage account. If state is Enabled, storageAccountAccessKey is required. - StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` - // RetentionDays - Specifies the number of days to keep in the Threat Detection audit logs. - RetentionDays *int32 `json:"retentionDays,omitempty"` - // UseServerDefault - Specifies whether to use the default server policy. Possible values include: 'SecurityAlertPolicyUseServerDefaultEnabled', 'SecurityAlertPolicyUseServerDefaultDisabled' - UseServerDefault SecurityAlertPolicyUseServerDefault `json:"useServerDefault,omitempty"` -} - -// DatabasesExportFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DatabasesExportFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DatabasesExportFuture) Result(client DatabasesClient) (ier ImportExportResponse, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesExportFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.DatabasesExportFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ier.Response.Response, err = future.GetResult(sender); err == nil && ier.Response.Response.StatusCode != http.StatusNoContent { - ier, err = client.ExportResponder(ier.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesExportFuture", "Result", ier.Response.Response, "Failure responding to request") - } - } - return -} - -// DatabasesFailoverFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DatabasesFailoverFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DatabasesFailoverFuture) 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, "sql.DatabasesFailoverFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.DatabasesFailoverFuture") - return - } - ar.Response = future.Response() - return -} - -// DatabasesImportFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DatabasesImportFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DatabasesImportFuture) Result(client DatabasesClient) (ier ImportExportResponse, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesImportFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.DatabasesImportFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ier.Response.Response, err = future.GetResult(sender); err == nil && ier.Response.Response.StatusCode != http.StatusNoContent { - ier, err = client.ImportResponder(ier.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesImportFuture", "Result", ier.Response.Response, "Failure responding to request") - } - } - return -} - -// DatabasesPauseFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DatabasesPauseFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DatabasesPauseFuture) Result(client DatabasesClient) (d Database, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesPauseFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.DatabasesPauseFuture") - 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.PauseResponder(d.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesPauseFuture", "Result", d.Response.Response, "Failure responding to request") - } - } - return -} - -// DatabasesResumeFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DatabasesResumeFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DatabasesResumeFuture) Result(client DatabasesClient) (d Database, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesResumeFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.DatabasesResumeFuture") - 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.ResumeResponder(d.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesResumeFuture", "Result", d.Response.Response, "Failure responding to request") - } - } - return -} - -// 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) (d Database, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.DatabasesUpdateFuture") - 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.UpdateResponder(d.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesUpdateFuture", "Result", d.Response.Response, "Failure responding to request") - } - } - return -} - -// DatabasesUpgradeDataWarehouseFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type DatabasesUpgradeDataWarehouseFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DatabasesUpgradeDataWarehouseFuture) 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, "sql.DatabasesUpgradeDataWarehouseFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.DatabasesUpgradeDataWarehouseFuture") - return - } - ar.Response = future.Response() - return -} - -// DatabaseUpdate a database resource. -type DatabaseUpdate struct { - // Sku - The name and tier of the SKU. - Sku *Sku `json:"sku,omitempty"` - // DatabaseProperties - Resource properties. - *DatabaseProperties `json:"properties,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for DatabaseUpdate. -func (du DatabaseUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if du.Sku != nil { - objectMap["sku"] = du.Sku - } - if du.DatabaseProperties != nil { - objectMap["properties"] = du.DatabaseProperties - } - if du.Tags != nil { - objectMap["tags"] = du.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DatabaseUpdate struct. -func (du *DatabaseUpdate) UnmarshalJSON(body []byte) error { - 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 - } - du.Sku = &sku - } - case "properties": - if v != nil { - var databaseProperties DatabaseProperties - err = json.Unmarshal(*v, &databaseProperties) - if err != nil { - return err - } - du.DatabaseProperties = &databaseProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - du.Tags = tags - } - } - } - - return nil -} - -// DatabaseUsage the database usages. -type DatabaseUsage struct { - // Name - READ-ONLY; The name of the usage metric. - Name *string `json:"name,omitempty"` - // ResourceName - READ-ONLY; The name of the resource. - ResourceName *string `json:"resourceName,omitempty"` - // DisplayName - READ-ONLY; The usage metric display name. - DisplayName *string `json:"displayName,omitempty"` - // CurrentValue - READ-ONLY; The current value of the usage metric. - CurrentValue *float64 `json:"currentValue,omitempty"` - // Limit - READ-ONLY; The current limit of the usage metric. - Limit *float64 `json:"limit,omitempty"` - // Unit - READ-ONLY; The units of the usage metric. - Unit *string `json:"unit,omitempty"` - // NextResetTime - READ-ONLY; The next reset time for the usage metric (ISO8601 format). - NextResetTime *date.Time `json:"nextResetTime,omitempty"` -} - -// DatabaseUsageListResult the response to a list database metrics request. -type DatabaseUsageListResult struct { - autorest.Response `json:"-"` - // Value - The list of database usages for the database. - Value *[]DatabaseUsage `json:"value,omitempty"` -} - -// DatabaseVulnerabilityAssessment a database vulnerability assessment. -type DatabaseVulnerabilityAssessment struct { - autorest.Response `json:"-"` - // DatabaseVulnerabilityAssessmentProperties - Resource properties. - *DatabaseVulnerabilityAssessmentProperties `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 DatabaseVulnerabilityAssessment. -func (dva DatabaseVulnerabilityAssessment) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dva.DatabaseVulnerabilityAssessmentProperties != nil { - objectMap["properties"] = dva.DatabaseVulnerabilityAssessmentProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DatabaseVulnerabilityAssessment struct. -func (dva *DatabaseVulnerabilityAssessment) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var databaseVulnerabilityAssessmentProperties DatabaseVulnerabilityAssessmentProperties - err = json.Unmarshal(*v, &databaseVulnerabilityAssessmentProperties) - if err != nil { - return err - } - dva.DatabaseVulnerabilityAssessmentProperties = &databaseVulnerabilityAssessmentProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - dva.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - dva.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - dva.Type = &typeVar - } - } - } - - return nil -} - -// DatabaseVulnerabilityAssessmentListResult a list of the database's vulnerability assessments. -type DatabaseVulnerabilityAssessmentListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]DatabaseVulnerabilityAssessment `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// DatabaseVulnerabilityAssessmentListResultIterator provides access to a complete listing of -// DatabaseVulnerabilityAssessment values. -type DatabaseVulnerabilityAssessmentListResultIterator struct { - i int - page DatabaseVulnerabilityAssessmentListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *DatabaseVulnerabilityAssessmentListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseVulnerabilityAssessmentListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *DatabaseVulnerabilityAssessmentListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DatabaseVulnerabilityAssessmentListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter DatabaseVulnerabilityAssessmentListResultIterator) Response() DatabaseVulnerabilityAssessmentListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter DatabaseVulnerabilityAssessmentListResultIterator) Value() DatabaseVulnerabilityAssessment { - if !iter.page.NotDone() { - return DatabaseVulnerabilityAssessment{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the DatabaseVulnerabilityAssessmentListResultIterator type. -func NewDatabaseVulnerabilityAssessmentListResultIterator(page DatabaseVulnerabilityAssessmentListResultPage) DatabaseVulnerabilityAssessmentListResultIterator { - return DatabaseVulnerabilityAssessmentListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (dvalr DatabaseVulnerabilityAssessmentListResult) IsEmpty() bool { - return dvalr.Value == nil || len(*dvalr.Value) == 0 -} - -// databaseVulnerabilityAssessmentListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (dvalr DatabaseVulnerabilityAssessmentListResult) databaseVulnerabilityAssessmentListResultPreparer(ctx context.Context) (*http.Request, error) { - if dvalr.NextLink == nil || len(to.String(dvalr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(dvalr.NextLink))) -} - -// DatabaseVulnerabilityAssessmentListResultPage contains a page of DatabaseVulnerabilityAssessment values. -type DatabaseVulnerabilityAssessmentListResultPage struct { - fn func(context.Context, DatabaseVulnerabilityAssessmentListResult) (DatabaseVulnerabilityAssessmentListResult, error) - dvalr DatabaseVulnerabilityAssessmentListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *DatabaseVulnerabilityAssessmentListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseVulnerabilityAssessmentListResultPage.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.dvalr) - if err != nil { - return err - } - page.dvalr = 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 *DatabaseVulnerabilityAssessmentListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DatabaseVulnerabilityAssessmentListResultPage) NotDone() bool { - return !page.dvalr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page DatabaseVulnerabilityAssessmentListResultPage) Response() DatabaseVulnerabilityAssessmentListResult { - return page.dvalr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page DatabaseVulnerabilityAssessmentListResultPage) Values() []DatabaseVulnerabilityAssessment { - if page.dvalr.IsEmpty() { - return nil - } - return *page.dvalr.Value -} - -// Creates a new instance of the DatabaseVulnerabilityAssessmentListResultPage type. -func NewDatabaseVulnerabilityAssessmentListResultPage(getNextPage func(context.Context, DatabaseVulnerabilityAssessmentListResult) (DatabaseVulnerabilityAssessmentListResult, error)) DatabaseVulnerabilityAssessmentListResultPage { - return DatabaseVulnerabilityAssessmentListResultPage{fn: getNextPage} -} - -// DatabaseVulnerabilityAssessmentProperties properties of a database Vulnerability Assessment. -type DatabaseVulnerabilityAssessmentProperties struct { - // StorageContainerPath - A blob storage container path to hold the scan results (e.g. https://myStorage.blob.core.windows.net/VaScans/). It is required if server level vulnerability assessment policy doesn't set - StorageContainerPath *string `json:"storageContainerPath,omitempty"` - // StorageContainerSasKey - A shared access signature (SAS Key) that has write access to the blob container specified in 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't specified, StorageContainerSasKey is required. - StorageContainerSasKey *string `json:"storageContainerSasKey,omitempty"` - // StorageAccountAccessKey - Specifies the identifier key of the storage account for vulnerability assessment scan results. If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is required. - StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` - // RecurringScans - The recurring scans settings - RecurringScans *VulnerabilityAssessmentRecurringScansProperties `json:"recurringScans,omitempty"` -} - -// DatabaseVulnerabilityAssessmentRuleBaseline a database vulnerability assessment rule baseline. -type DatabaseVulnerabilityAssessmentRuleBaseline struct { - autorest.Response `json:"-"` - // DatabaseVulnerabilityAssessmentRuleBaselineProperties - Resource properties. - *DatabaseVulnerabilityAssessmentRuleBaselineProperties `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 DatabaseVulnerabilityAssessmentRuleBaseline. -func (dvarb DatabaseVulnerabilityAssessmentRuleBaseline) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dvarb.DatabaseVulnerabilityAssessmentRuleBaselineProperties != nil { - objectMap["properties"] = dvarb.DatabaseVulnerabilityAssessmentRuleBaselineProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DatabaseVulnerabilityAssessmentRuleBaseline struct. -func (dvarb *DatabaseVulnerabilityAssessmentRuleBaseline) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var databaseVulnerabilityAssessmentRuleBaselineProperties DatabaseVulnerabilityAssessmentRuleBaselineProperties - err = json.Unmarshal(*v, &databaseVulnerabilityAssessmentRuleBaselineProperties) - if err != nil { - return err - } - dvarb.DatabaseVulnerabilityAssessmentRuleBaselineProperties = &databaseVulnerabilityAssessmentRuleBaselineProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - dvarb.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - dvarb.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - dvarb.Type = &typeVar - } - } - } - - return nil -} - -// DatabaseVulnerabilityAssessmentRuleBaselineItem properties for an Azure SQL Database Vulnerability -// Assessment rule baseline's result. -type DatabaseVulnerabilityAssessmentRuleBaselineItem struct { - // Result - The rule baseline result - Result *[]string `json:"result,omitempty"` -} - -// DatabaseVulnerabilityAssessmentRuleBaselineProperties properties of a database Vulnerability Assessment -// rule baseline. -type DatabaseVulnerabilityAssessmentRuleBaselineProperties struct { - // BaselineResults - The rule baseline result - BaselineResults *[]DatabaseVulnerabilityAssessmentRuleBaselineItem `json:"baselineResults,omitempty"` -} - -// DatabaseVulnerabilityAssessmentScanExportProperties properties of the export operation's result. -type DatabaseVulnerabilityAssessmentScanExportProperties struct { - // ExportedReportLocation - READ-ONLY; Location of the exported report (e.g. https://myStorage.blob.core.windows.net/VaScans/scans/serverName/databaseName/scan_scanId.xlsx). - ExportedReportLocation *string `json:"exportedReportLocation,omitempty"` -} - -// DatabaseVulnerabilityAssessmentScansExport a database Vulnerability Assessment scan export resource. -type DatabaseVulnerabilityAssessmentScansExport struct { - autorest.Response `json:"-"` - // DatabaseVulnerabilityAssessmentScanExportProperties - Resource properties. - *DatabaseVulnerabilityAssessmentScanExportProperties `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 DatabaseVulnerabilityAssessmentScansExport. -func (dvase DatabaseVulnerabilityAssessmentScansExport) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dvase.DatabaseVulnerabilityAssessmentScanExportProperties != nil { - objectMap["properties"] = dvase.DatabaseVulnerabilityAssessmentScanExportProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DatabaseVulnerabilityAssessmentScansExport struct. -func (dvase *DatabaseVulnerabilityAssessmentScansExport) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var databaseVulnerabilityAssessmentScanExportProperties DatabaseVulnerabilityAssessmentScanExportProperties - err = json.Unmarshal(*v, &databaseVulnerabilityAssessmentScanExportProperties) - if err != nil { - return err - } - dvase.DatabaseVulnerabilityAssessmentScanExportProperties = &databaseVulnerabilityAssessmentScanExportProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - dvase.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - dvase.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - dvase.Type = &typeVar - } - } - } - - return nil -} - -// DatabaseVulnerabilityAssessmentScansInitiateScanFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type DatabaseVulnerabilityAssessmentScansInitiateScanFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DatabaseVulnerabilityAssessmentScansInitiateScanFuture) Result(client DatabaseVulnerabilityAssessmentScansClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabaseVulnerabilityAssessmentScansInitiateScanFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.DatabaseVulnerabilityAssessmentScansInitiateScanFuture") - return - } - ar.Response = future.Response() - return -} - -// DataMaskingPolicy represents a database data masking policy. -type DataMaskingPolicy struct { - autorest.Response `json:"-"` - // DataMaskingPolicyProperties - The properties of the data masking policy. - *DataMaskingPolicyProperties `json:"properties,omitempty"` - // Location - READ-ONLY; The location of the data masking policy. - Location *string `json:"location,omitempty"` - // Kind - READ-ONLY; The kind of data masking policy. Metadata, used for Azure portal. - Kind *string `json:"kind,omitempty"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for DataMaskingPolicy. -func (dmp DataMaskingPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dmp.DataMaskingPolicyProperties != nil { - objectMap["properties"] = dmp.DataMaskingPolicyProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DataMaskingPolicy struct. -func (dmp *DataMaskingPolicy) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var dataMaskingPolicyProperties DataMaskingPolicyProperties - err = json.Unmarshal(*v, &dataMaskingPolicyProperties) - if err != nil { - return err - } - dmp.DataMaskingPolicyProperties = &dataMaskingPolicyProperties - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - dmp.Location = &location - } - case "kind": - if v != nil { - var kind string - err = json.Unmarshal(*v, &kind) - if err != nil { - return err - } - dmp.Kind = &kind - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - dmp.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - dmp.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - dmp.Type = &typeVar - } - } - } - - return nil -} - -// DataMaskingPolicyProperties the properties of a database data masking policy. -type DataMaskingPolicyProperties struct { - // DataMaskingState - The state of the data masking policy. Possible values include: 'DataMaskingStateDisabled', 'DataMaskingStateEnabled' - DataMaskingState DataMaskingState `json:"dataMaskingState,omitempty"` - // ExemptPrincipals - The list of the exempt principals. Specifies the semicolon-separated list of database users for which the data masking policy does not apply. The specified users receive data results without masking for all of the database queries. - ExemptPrincipals *string `json:"exemptPrincipals,omitempty"` - // ApplicationPrincipals - READ-ONLY; The list of the application principals. This is a legacy parameter and is no longer used. - ApplicationPrincipals *string `json:"applicationPrincipals,omitempty"` - // MaskingLevel - READ-ONLY; The masking level. This is a legacy parameter and is no longer used. - MaskingLevel *string `json:"maskingLevel,omitempty"` -} - -// DataMaskingRule represents a database data masking rule. -type DataMaskingRule struct { - autorest.Response `json:"-"` - // DataMaskingRuleProperties - The properties of the resource. - *DataMaskingRuleProperties `json:"properties,omitempty"` - // Location - READ-ONLY; The location of the data masking rule. - Location *string `json:"location,omitempty"` - // Kind - READ-ONLY; The kind of Data Masking Rule. Metadata, used for Azure portal. - Kind *string `json:"kind,omitempty"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for DataMaskingRule. -func (dmr DataMaskingRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dmr.DataMaskingRuleProperties != nil { - objectMap["properties"] = dmr.DataMaskingRuleProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DataMaskingRule struct. -func (dmr *DataMaskingRule) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var dataMaskingRuleProperties DataMaskingRuleProperties - err = json.Unmarshal(*v, &dataMaskingRuleProperties) - if err != nil { - return err - } - dmr.DataMaskingRuleProperties = &dataMaskingRuleProperties - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - dmr.Location = &location - } - case "kind": - if v != nil { - var kind string - err = json.Unmarshal(*v, &kind) - if err != nil { - return err - } - dmr.Kind = &kind - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - dmr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - dmr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - dmr.Type = &typeVar - } - } - } - - return nil -} - -// DataMaskingRuleListResult the response to a list data masking rules request. -type DataMaskingRuleListResult struct { - autorest.Response `json:"-"` - // Value - The list of database data masking rules. - Value *[]DataMaskingRule `json:"value,omitempty"` -} - -// DataMaskingRuleProperties the properties of a database data masking rule. -type DataMaskingRuleProperties struct { - // ID - READ-ONLY; The rule Id. - ID *string `json:"id,omitempty"` - // AliasName - The alias name. This is a legacy parameter and is no longer used. - AliasName *string `json:"aliasName,omitempty"` - // RuleState - The rule state. Used to delete a rule. To delete an existing rule, specify the schemaName, tableName, columnName, maskingFunction, and specify ruleState as disabled. However, if the rule doesn't already exist, the rule will be created with ruleState set to enabled, regardless of the provided value of ruleState. Possible values include: 'DataMaskingRuleStateDisabled', 'DataMaskingRuleStateEnabled' - RuleState DataMaskingRuleState `json:"ruleState,omitempty"` - // SchemaName - The schema name on which the data masking rule is applied. - SchemaName *string `json:"schemaName,omitempty"` - // TableName - The table name on which the data masking rule is applied. - TableName *string `json:"tableName,omitempty"` - // ColumnName - The column name on which the data masking rule is applied. - ColumnName *string `json:"columnName,omitempty"` - // MaskingFunction - The masking function that is used for the data masking rule. Possible values include: 'DataMaskingFunctionDefault', 'DataMaskingFunctionCCN', 'DataMaskingFunctionEmail', 'DataMaskingFunctionNumber', 'DataMaskingFunctionSSN', 'DataMaskingFunctionText' - MaskingFunction DataMaskingFunction `json:"maskingFunction,omitempty"` - // NumberFrom - The numberFrom property of the masking rule. Required if maskingFunction is set to Number, otherwise this parameter will be ignored. - NumberFrom *string `json:"numberFrom,omitempty"` - // NumberTo - The numberTo property of the data masking rule. Required if maskingFunction is set to Number, otherwise this parameter will be ignored. - NumberTo *string `json:"numberTo,omitempty"` - // PrefixSize - If maskingFunction is set to Text, the number of characters to show unmasked in the beginning of the string. Otherwise, this parameter will be ignored. - PrefixSize *string `json:"prefixSize,omitempty"` - // SuffixSize - If maskingFunction is set to Text, the number of characters to show unmasked at the end of the string. Otherwise, this parameter will be ignored. - SuffixSize *string `json:"suffixSize,omitempty"` - // ReplacementString - If maskingFunction is set to Text, the character to use for masking the unexposed part of the string. Otherwise, this parameter will be ignored. - ReplacementString *string `json:"replacementString,omitempty"` -} - -// EditionCapability the edition capability. -type EditionCapability struct { - // Name - READ-ONLY; The database edition name. - Name *string `json:"name,omitempty"` - // SupportedServiceLevelObjectives - READ-ONLY; The list of supported service objectives for the edition. - SupportedServiceLevelObjectives *[]ServiceObjectiveCapability `json:"supportedServiceLevelObjectives,omitempty"` - // ZoneRedundant - READ-ONLY; Whether or not zone redundancy is supported for the edition. - ZoneRedundant *bool `json:"zoneRedundant,omitempty"` - // Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' - Status CapabilityStatus `json:"status,omitempty"` - // Reason - The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` -} - -// ElasticPool an elastic pool. -type ElasticPool struct { - autorest.Response `json:"-"` - // Sku - The elastic pool SKU. - // - // The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API or the following command: - // - // ```azurecli - // az sql elastic-pool list-editions -l -o table - // ```` - Sku *Sku `json:"sku,omitempty"` - // Kind - READ-ONLY; Kind of elastic pool. This is metadata used for the Azure portal experience. - Kind *string `json:"kind,omitempty"` - // ElasticPoolProperties - Resource properties. - *ElasticPoolProperties `json:"properties,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for ElasticPool. -func (ep ElasticPool) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ep.Sku != nil { - objectMap["sku"] = ep.Sku - } - if ep.ElasticPoolProperties != nil { - objectMap["properties"] = ep.ElasticPoolProperties - } - if ep.Location != nil { - objectMap["location"] = ep.Location - } - if ep.Tags != nil { - objectMap["tags"] = ep.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ElasticPool struct. -func (ep *ElasticPool) UnmarshalJSON(body []byte) error { - 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 - } - ep.Sku = &sku - } - case "kind": - if v != nil { - var kind string - err = json.Unmarshal(*v, &kind) - if err != nil { - return err - } - ep.Kind = &kind - } - case "properties": - if v != nil { - var elasticPoolProperties ElasticPoolProperties - err = json.Unmarshal(*v, &elasticPoolProperties) - if err != nil { - return err - } - ep.ElasticPoolProperties = &elasticPoolProperties - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - ep.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - ep.Tags = tags - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ep.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ep.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ep.Type = &typeVar - } - } - } - - return nil -} - -// ElasticPoolActivity represents the activity on an elastic pool. -type ElasticPoolActivity struct { - // Location - The geo-location where the resource lives - Location *string `json:"location,omitempty"` - // ElasticPoolActivityProperties - The properties representing the resource. - *ElasticPoolActivityProperties `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 ElasticPoolActivity. -func (epa ElasticPoolActivity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if epa.Location != nil { - objectMap["location"] = epa.Location - } - if epa.ElasticPoolActivityProperties != nil { - objectMap["properties"] = epa.ElasticPoolActivityProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ElasticPoolActivity struct. -func (epa *ElasticPoolActivity) UnmarshalJSON(body []byte) error { - 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 - } - epa.Location = &location - } - case "properties": - if v != nil { - var elasticPoolActivityProperties ElasticPoolActivityProperties - err = json.Unmarshal(*v, &elasticPoolActivityProperties) - if err != nil { - return err - } - epa.ElasticPoolActivityProperties = &elasticPoolActivityProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - epa.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - epa.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - epa.Type = &typeVar - } - } - } - - return nil -} - -// ElasticPoolActivityListResult represents the response to a list elastic pool activity request. -type ElasticPoolActivityListResult struct { - autorest.Response `json:"-"` - // Value - The list of elastic pool activities. - Value *[]ElasticPoolActivity `json:"value,omitempty"` -} - -// ElasticPoolActivityProperties represents the properties of an elastic pool. -type ElasticPoolActivityProperties struct { - // EndTime - READ-ONLY; The time the operation finished (ISO8601 format). - EndTime *date.Time `json:"endTime,omitempty"` - // ErrorCode - READ-ONLY; The error code if available. - ErrorCode *int32 `json:"errorCode,omitempty"` - // ErrorMessage - READ-ONLY; The error message if available. - ErrorMessage *string `json:"errorMessage,omitempty"` - // ErrorSeverity - READ-ONLY; The error severity if available. - ErrorSeverity *int32 `json:"errorSeverity,omitempty"` - // Operation - READ-ONLY; The operation name. - Operation *string `json:"operation,omitempty"` - // OperationID - READ-ONLY; The unique operation ID. - OperationID *uuid.UUID `json:"operationId,omitempty"` - // PercentComplete - READ-ONLY; The percentage complete if available. - PercentComplete *int32 `json:"percentComplete,omitempty"` - // RequestedDatabaseDtuMax - READ-ONLY; The requested max DTU per database if available. - RequestedDatabaseDtuMax *int32 `json:"requestedDatabaseDtuMax,omitempty"` - // RequestedDatabaseDtuMin - READ-ONLY; The requested min DTU per database if available. - RequestedDatabaseDtuMin *int32 `json:"requestedDatabaseDtuMin,omitempty"` - // RequestedDtu - READ-ONLY; The requested DTU for the pool if available. - RequestedDtu *int32 `json:"requestedDtu,omitempty"` - // RequestedElasticPoolName - READ-ONLY; The requested name for the elastic pool if available. - RequestedElasticPoolName *string `json:"requestedElasticPoolName,omitempty"` - // RequestedStorageLimitInGB - READ-ONLY; The requested storage limit for the pool in GB if available. - RequestedStorageLimitInGB *int64 `json:"requestedStorageLimitInGB,omitempty"` - // ElasticPoolName - READ-ONLY; The name of the elastic pool. - ElasticPoolName *string `json:"elasticPoolName,omitempty"` - // ServerName - READ-ONLY; The name of the server the elastic pool is in. - ServerName *string `json:"serverName,omitempty"` - // StartTime - READ-ONLY; The time the operation started (ISO8601 format). - StartTime *date.Time `json:"startTime,omitempty"` - // State - READ-ONLY; The current state of the operation. - State *string `json:"state,omitempty"` - // RequestedStorageLimitInMB - READ-ONLY; The requested storage limit in MB. - RequestedStorageLimitInMB *int32 `json:"requestedStorageLimitInMB,omitempty"` - // RequestedDatabaseDtuGuarantee - READ-ONLY; The requested per database DTU guarantee. - RequestedDatabaseDtuGuarantee *int32 `json:"requestedDatabaseDtuGuarantee,omitempty"` - // RequestedDatabaseDtuCap - READ-ONLY; The requested per database DTU cap. - RequestedDatabaseDtuCap *int32 `json:"requestedDatabaseDtuCap,omitempty"` - // RequestedDtuGuarantee - READ-ONLY; The requested DTU guarantee. - RequestedDtuGuarantee *int32 `json:"requestedDtuGuarantee,omitempty"` -} - -// ElasticPoolDatabaseActivity represents the activity on an elastic pool. -type ElasticPoolDatabaseActivity struct { - // Location - The geo-location where the resource lives - Location *string `json:"location,omitempty"` - // ElasticPoolDatabaseActivityProperties - The properties representing the resource. - *ElasticPoolDatabaseActivityProperties `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 ElasticPoolDatabaseActivity. -func (epda ElasticPoolDatabaseActivity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if epda.Location != nil { - objectMap["location"] = epda.Location - } - if epda.ElasticPoolDatabaseActivityProperties != nil { - objectMap["properties"] = epda.ElasticPoolDatabaseActivityProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ElasticPoolDatabaseActivity struct. -func (epda *ElasticPoolDatabaseActivity) UnmarshalJSON(body []byte) error { - 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 - } - epda.Location = &location - } - case "properties": - if v != nil { - var elasticPoolDatabaseActivityProperties ElasticPoolDatabaseActivityProperties - err = json.Unmarshal(*v, &elasticPoolDatabaseActivityProperties) - if err != nil { - return err - } - epda.ElasticPoolDatabaseActivityProperties = &elasticPoolDatabaseActivityProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - epda.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - epda.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - epda.Type = &typeVar - } - } - } - - return nil -} - -// ElasticPoolDatabaseActivityListResult represents the response to a list elastic pool database activity -// request. -type ElasticPoolDatabaseActivityListResult struct { - autorest.Response `json:"-"` - // Value - The list of elastic pool database activities. - Value *[]ElasticPoolDatabaseActivity `json:"value,omitempty"` -} - -// ElasticPoolDatabaseActivityProperties represents the properties of an elastic pool database activity. -type ElasticPoolDatabaseActivityProperties struct { - // DatabaseName - READ-ONLY; The database name. - DatabaseName *string `json:"databaseName,omitempty"` - // EndTime - READ-ONLY; The time the operation finished (ISO8601 format). - EndTime *date.Time `json:"endTime,omitempty"` - // ErrorCode - READ-ONLY; The error code if available. - ErrorCode *int32 `json:"errorCode,omitempty"` - // ErrorMessage - READ-ONLY; The error message if available. - ErrorMessage *string `json:"errorMessage,omitempty"` - // ErrorSeverity - READ-ONLY; The error severity if available. - ErrorSeverity *int32 `json:"errorSeverity,omitempty"` - // Operation - READ-ONLY; The operation name. - Operation *string `json:"operation,omitempty"` - // OperationID - READ-ONLY; The unique operation ID. - OperationID *uuid.UUID `json:"operationId,omitempty"` - // PercentComplete - READ-ONLY; The percentage complete if available. - PercentComplete *int32 `json:"percentComplete,omitempty"` - // RequestedElasticPoolName - READ-ONLY; The name for the elastic pool the database is moving into if available. - RequestedElasticPoolName *string `json:"requestedElasticPoolName,omitempty"` - // CurrentElasticPoolName - READ-ONLY; The name of the current elastic pool the database is in if available. - CurrentElasticPoolName *string `json:"currentElasticPoolName,omitempty"` - // CurrentServiceObjective - READ-ONLY; The name of the current service objective if available. - CurrentServiceObjective *string `json:"currentServiceObjective,omitempty"` - // RequestedServiceObjective - READ-ONLY; The name of the requested service objective if available. - RequestedServiceObjective *string `json:"requestedServiceObjective,omitempty"` - // ServerName - READ-ONLY; The name of the server the elastic pool is in. - ServerName *string `json:"serverName,omitempty"` - // StartTime - READ-ONLY; The time the operation started (ISO8601 format). - StartTime *date.Time `json:"startTime,omitempty"` - // State - READ-ONLY; The current state of the operation. - State *string `json:"state,omitempty"` -} - -// ElasticPoolEditionCapability the elastic pool edition capability. -type ElasticPoolEditionCapability struct { - // Name - READ-ONLY; The elastic pool edition name. - Name *string `json:"name,omitempty"` - // SupportedElasticPoolPerformanceLevels - READ-ONLY; The list of supported elastic pool DTU levels for the edition. - SupportedElasticPoolPerformanceLevels *[]ElasticPoolPerformanceLevelCapability `json:"supportedElasticPoolPerformanceLevels,omitempty"` - // ZoneRedundant - READ-ONLY; Whether or not zone redundancy is supported for the edition. - ZoneRedundant *bool `json:"zoneRedundant,omitempty"` - // Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' - Status CapabilityStatus `json:"status,omitempty"` - // Reason - The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` -} - -// ElasticPoolListResult the result of an elastic pool list request. -type ElasticPoolListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]ElasticPool `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ElasticPoolListResultIterator provides access to a complete listing of ElasticPool values. -type ElasticPoolListResultIterator struct { - i int - page ElasticPoolListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ElasticPoolListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ElasticPoolListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ElasticPoolListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ElasticPoolListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ElasticPoolListResultIterator) Response() ElasticPoolListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ElasticPoolListResultIterator) Value() ElasticPool { - if !iter.page.NotDone() { - return ElasticPool{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ElasticPoolListResultIterator type. -func NewElasticPoolListResultIterator(page ElasticPoolListResultPage) ElasticPoolListResultIterator { - return ElasticPoolListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (eplr ElasticPoolListResult) IsEmpty() bool { - return eplr.Value == nil || len(*eplr.Value) == 0 -} - -// elasticPoolListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (eplr ElasticPoolListResult) elasticPoolListResultPreparer(ctx context.Context) (*http.Request, error) { - if eplr.NextLink == nil || len(to.String(eplr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(eplr.NextLink))) -} - -// ElasticPoolListResultPage contains a page of ElasticPool values. -type ElasticPoolListResultPage struct { - fn func(context.Context, ElasticPoolListResult) (ElasticPoolListResult, error) - eplr ElasticPoolListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ElasticPoolListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ElasticPoolListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - next, err := page.fn(ctx, page.eplr) - if err != nil { - return err - } - page.eplr = next - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ElasticPoolListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ElasticPoolListResultPage) NotDone() bool { - return !page.eplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ElasticPoolListResultPage) Response() ElasticPoolListResult { - return page.eplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ElasticPoolListResultPage) Values() []ElasticPool { - if page.eplr.IsEmpty() { - return nil - } - return *page.eplr.Value -} - -// Creates a new instance of the ElasticPoolListResultPage type. -func NewElasticPoolListResultPage(getNextPage func(context.Context, ElasticPoolListResult) (ElasticPoolListResult, error)) ElasticPoolListResultPage { - return ElasticPoolListResultPage{fn: getNextPage} -} - -// ElasticPoolOperation a elastic pool operation. -type ElasticPoolOperation struct { - // ElasticPoolOperationProperties - Resource properties. - *ElasticPoolOperationProperties `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 ElasticPoolOperation. -func (epo ElasticPoolOperation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if epo.ElasticPoolOperationProperties != nil { - objectMap["properties"] = epo.ElasticPoolOperationProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ElasticPoolOperation struct. -func (epo *ElasticPoolOperation) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var elasticPoolOperationProperties ElasticPoolOperationProperties - err = json.Unmarshal(*v, &elasticPoolOperationProperties) - if err != nil { - return err - } - epo.ElasticPoolOperationProperties = &elasticPoolOperationProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - epo.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - epo.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - epo.Type = &typeVar - } - } - } - - return nil -} - -// ElasticPoolOperationListResult the response to a list elastic pool operations request -type ElasticPoolOperationListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]ElasticPoolOperation `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ElasticPoolOperationListResultIterator provides access to a complete listing of ElasticPoolOperation -// values. -type ElasticPoolOperationListResultIterator struct { - i int - page ElasticPoolOperationListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ElasticPoolOperationListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ElasticPoolOperationListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ElasticPoolOperationListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ElasticPoolOperationListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ElasticPoolOperationListResultIterator) Response() ElasticPoolOperationListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ElasticPoolOperationListResultIterator) Value() ElasticPoolOperation { - if !iter.page.NotDone() { - return ElasticPoolOperation{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ElasticPoolOperationListResultIterator type. -func NewElasticPoolOperationListResultIterator(page ElasticPoolOperationListResultPage) ElasticPoolOperationListResultIterator { - return ElasticPoolOperationListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (epolr ElasticPoolOperationListResult) IsEmpty() bool { - return epolr.Value == nil || len(*epolr.Value) == 0 -} - -// elasticPoolOperationListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (epolr ElasticPoolOperationListResult) elasticPoolOperationListResultPreparer(ctx context.Context) (*http.Request, error) { - if epolr.NextLink == nil || len(to.String(epolr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(epolr.NextLink))) -} - -// ElasticPoolOperationListResultPage contains a page of ElasticPoolOperation values. -type ElasticPoolOperationListResultPage struct { - fn func(context.Context, ElasticPoolOperationListResult) (ElasticPoolOperationListResult, error) - epolr ElasticPoolOperationListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ElasticPoolOperationListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ElasticPoolOperationListResultPage.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.epolr) - if err != nil { - return err - } - page.epolr = 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 *ElasticPoolOperationListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ElasticPoolOperationListResultPage) NotDone() bool { - return !page.epolr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ElasticPoolOperationListResultPage) Response() ElasticPoolOperationListResult { - return page.epolr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ElasticPoolOperationListResultPage) Values() []ElasticPoolOperation { - if page.epolr.IsEmpty() { - return nil - } - return *page.epolr.Value -} - -// Creates a new instance of the ElasticPoolOperationListResultPage type. -func NewElasticPoolOperationListResultPage(getNextPage func(context.Context, ElasticPoolOperationListResult) (ElasticPoolOperationListResult, error)) ElasticPoolOperationListResultPage { - return ElasticPoolOperationListResultPage{fn: getNextPage} -} - -// ElasticPoolOperationProperties the properties of a elastic pool operation. -type ElasticPoolOperationProperties struct { - // ElasticPoolName - READ-ONLY; The name of the elastic pool the operation is being performed on. - ElasticPoolName *string `json:"elasticPoolName,omitempty"` - // Operation - READ-ONLY; The name of operation. - Operation *string `json:"operation,omitempty"` - // OperationFriendlyName - READ-ONLY; The friendly name of operation. - OperationFriendlyName *string `json:"operationFriendlyName,omitempty"` - // PercentComplete - READ-ONLY; The percentage of the operation completed. - PercentComplete *int32 `json:"percentComplete,omitempty"` - // ServerName - READ-ONLY; The name of the server. - ServerName *string `json:"serverName,omitempty"` - // StartTime - READ-ONLY; The operation start time. - StartTime *date.Time `json:"startTime,omitempty"` - // State - READ-ONLY; The operation state. - State *string `json:"state,omitempty"` - // ErrorCode - READ-ONLY; The operation error code. - ErrorCode *int32 `json:"errorCode,omitempty"` - // ErrorDescription - READ-ONLY; The operation error description. - ErrorDescription *string `json:"errorDescription,omitempty"` - // ErrorSeverity - READ-ONLY; The operation error severity. - ErrorSeverity *int32 `json:"errorSeverity,omitempty"` - // IsUserError - READ-ONLY; Whether or not the error is a user error. - IsUserError *bool `json:"isUserError,omitempty"` - // EstimatedCompletionTime - READ-ONLY; The estimated completion time of the operation. - EstimatedCompletionTime *date.Time `json:"estimatedCompletionTime,omitempty"` - // Description - READ-ONLY; The operation description. - Description *string `json:"description,omitempty"` - // IsCancellable - READ-ONLY; Whether the operation can be cancelled. - IsCancellable *bool `json:"isCancellable,omitempty"` -} - -// ElasticPoolPerDatabaseMaxPerformanceLevelCapability the max per-database performance level capability. -type ElasticPoolPerDatabaseMaxPerformanceLevelCapability struct { - // Limit - READ-ONLY; The maximum performance level per database. - Limit *float64 `json:"limit,omitempty"` - // Unit - READ-ONLY; Unit type used to measure performance level. Possible values include: 'DTU', 'VCores' - Unit PerformanceLevelUnit `json:"unit,omitempty"` - // SupportedPerDatabaseMinPerformanceLevels - READ-ONLY; The list of supported min database performance levels. - SupportedPerDatabaseMinPerformanceLevels *[]ElasticPoolPerDatabaseMinPerformanceLevelCapability `json:"supportedPerDatabaseMinPerformanceLevels,omitempty"` - // Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' - Status CapabilityStatus `json:"status,omitempty"` - // Reason - The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` -} - -// ElasticPoolPerDatabaseMinPerformanceLevelCapability the minimum per-database performance level -// capability. -type ElasticPoolPerDatabaseMinPerformanceLevelCapability struct { - // Limit - READ-ONLY; The minimum performance level per database. - Limit *float64 `json:"limit,omitempty"` - // Unit - READ-ONLY; Unit type used to measure performance level. Possible values include: 'DTU', 'VCores' - Unit PerformanceLevelUnit `json:"unit,omitempty"` - // Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' - Status CapabilityStatus `json:"status,omitempty"` - // Reason - The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` -} - -// ElasticPoolPerDatabaseSettings per database settings of an elastic pool. -type ElasticPoolPerDatabaseSettings struct { - // MinCapacity - The minimum capacity all databases are guaranteed. - MinCapacity *float64 `json:"minCapacity,omitempty"` - // MaxCapacity - The maximum capacity any one database can consume. - MaxCapacity *float64 `json:"maxCapacity,omitempty"` -} - -// ElasticPoolPerformanceLevelCapability the Elastic Pool performance level capability. -type ElasticPoolPerformanceLevelCapability struct { - // PerformanceLevel - READ-ONLY; The performance level for the pool. - PerformanceLevel *PerformanceLevelCapability `json:"performanceLevel,omitempty"` - // Sku - READ-ONLY; The sku. - Sku *Sku `json:"sku,omitempty"` - // SupportedLicenseTypes - READ-ONLY; List of supported license types. - SupportedLicenseTypes *[]LicenseTypeCapability `json:"supportedLicenseTypes,omitempty"` - // MaxDatabaseCount - READ-ONLY; The maximum number of databases supported. - MaxDatabaseCount *int32 `json:"maxDatabaseCount,omitempty"` - // IncludedMaxSize - READ-ONLY; The included (free) max size for this performance level. - IncludedMaxSize *MaxSizeCapability `json:"includedMaxSize,omitempty"` - // SupportedMaxSizes - READ-ONLY; The list of supported max sizes. - SupportedMaxSizes *[]MaxSizeRangeCapability `json:"supportedMaxSizes,omitempty"` - // SupportedPerDatabaseMaxSizes - READ-ONLY; The list of supported per database max sizes. - SupportedPerDatabaseMaxSizes *[]MaxSizeRangeCapability `json:"supportedPerDatabaseMaxSizes,omitempty"` - // SupportedPerDatabaseMaxPerformanceLevels - READ-ONLY; The list of supported per database max performance levels. - SupportedPerDatabaseMaxPerformanceLevels *[]ElasticPoolPerDatabaseMaxPerformanceLevelCapability `json:"supportedPerDatabaseMaxPerformanceLevels,omitempty"` - // Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' - Status CapabilityStatus `json:"status,omitempty"` - // Reason - The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` -} - -// ElasticPoolProperties properties of an elastic pool -type ElasticPoolProperties struct { - // State - READ-ONLY; The state of the elastic pool. Possible values include: 'ElasticPoolStateCreating', 'ElasticPoolStateReady', 'ElasticPoolStateDisabled' - State ElasticPoolState `json:"state,omitempty"` - // CreationDate - READ-ONLY; The creation date of the elastic pool (ISO8601 format). - CreationDate *date.Time `json:"creationDate,omitempty"` - // MaxSizeBytes - The storage limit for the database elastic pool in bytes. - MaxSizeBytes *int64 `json:"maxSizeBytes,omitempty"` - // PerDatabaseSettings - The per database settings for the elastic pool. - PerDatabaseSettings *ElasticPoolPerDatabaseSettings `json:"perDatabaseSettings,omitempty"` - // ZoneRedundant - Whether or not this elastic pool is zone redundant, which means the replicas of this elastic pool will be spread across multiple availability zones. - ZoneRedundant *bool `json:"zoneRedundant,omitempty"` - // LicenseType - The license type to apply for this elastic pool. Possible values include: 'ElasticPoolLicenseTypeLicenseIncluded', 'ElasticPoolLicenseTypeBasePrice' - LicenseType ElasticPoolLicenseType `json:"licenseType,omitempty"` -} - -// ElasticPoolsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ElasticPoolsCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ElasticPoolsCreateOrUpdateFuture) Result(client ElasticPoolsClient) (ep ElasticPool, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ElasticPoolsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ElasticPoolsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ep.Response.Response, err = future.GetResult(sender); err == nil && ep.Response.Response.StatusCode != http.StatusNoContent { - ep, err = client.CreateOrUpdateResponder(ep.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ElasticPoolsCreateOrUpdateFuture", "Result", ep.Response.Response, "Failure responding to request") - } - } - return -} - -// ElasticPoolsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ElasticPoolsDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ElasticPoolsDeleteFuture) Result(client ElasticPoolsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ElasticPoolsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ElasticPoolsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ElasticPoolsFailoverFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ElasticPoolsFailoverFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ElasticPoolsFailoverFuture) Result(client ElasticPoolsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ElasticPoolsFailoverFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ElasticPoolsFailoverFuture") - return - } - ar.Response = future.Response() - return -} - -// ElasticPoolsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ElasticPoolsUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ElasticPoolsUpdateFuture) Result(client ElasticPoolsClient) (ep ElasticPool, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ElasticPoolsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ElasticPoolsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ep.Response.Response, err = future.GetResult(sender); err == nil && ep.Response.Response.StatusCode != http.StatusNoContent { - ep, err = client.UpdateResponder(ep.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ElasticPoolsUpdateFuture", "Result", ep.Response.Response, "Failure responding to request") - } - } - return -} - -// ElasticPoolUpdate an elastic pool update. -type ElasticPoolUpdate struct { - Sku *Sku `json:"sku,omitempty"` - // ElasticPoolUpdateProperties - Resource properties. - *ElasticPoolUpdateProperties `json:"properties,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ElasticPoolUpdate. -func (epu ElasticPoolUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if epu.Sku != nil { - objectMap["sku"] = epu.Sku - } - if epu.ElasticPoolUpdateProperties != nil { - objectMap["properties"] = epu.ElasticPoolUpdateProperties - } - if epu.Tags != nil { - objectMap["tags"] = epu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ElasticPoolUpdate struct. -func (epu *ElasticPoolUpdate) UnmarshalJSON(body []byte) error { - 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 - } - epu.Sku = &sku - } - case "properties": - if v != nil { - var elasticPoolUpdateProperties ElasticPoolUpdateProperties - err = json.Unmarshal(*v, &elasticPoolUpdateProperties) - if err != nil { - return err - } - epu.ElasticPoolUpdateProperties = &elasticPoolUpdateProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - epu.Tags = tags - } - } - } - - return nil -} - -// ElasticPoolUpdateProperties properties of an elastic pool -type ElasticPoolUpdateProperties struct { - // MaxSizeBytes - The storage limit for the database elastic pool in bytes. - MaxSizeBytes *int64 `json:"maxSizeBytes,omitempty"` - // PerDatabaseSettings - The per database settings for the elastic pool. - PerDatabaseSettings *ElasticPoolPerDatabaseSettings `json:"perDatabaseSettings,omitempty"` - // ZoneRedundant - Whether or not this elastic pool is zone redundant, which means the replicas of this elastic pool will be spread across multiple availability zones. - ZoneRedundant *bool `json:"zoneRedundant,omitempty"` - // LicenseType - The license type to apply for this elastic pool. Possible values include: 'ElasticPoolLicenseTypeLicenseIncluded', 'ElasticPoolLicenseTypeBasePrice' - LicenseType ElasticPoolLicenseType `json:"licenseType,omitempty"` -} - -// EncryptionProtector the server encryption protector. -type EncryptionProtector struct { - autorest.Response `json:"-"` - // Kind - READ-ONLY; Kind of encryption protector. This is metadata used for the Azure portal experience. - Kind *string `json:"kind,omitempty"` - // Location - READ-ONLY; Resource location. - Location *string `json:"location,omitempty"` - // EncryptionProtectorProperties - Resource properties. - *EncryptionProtectorProperties `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 EncryptionProtector. -func (ep EncryptionProtector) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ep.EncryptionProtectorProperties != nil { - objectMap["properties"] = ep.EncryptionProtectorProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for EncryptionProtector struct. -func (ep *EncryptionProtector) UnmarshalJSON(body []byte) error { - 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 string - err = json.Unmarshal(*v, &kind) - if err != nil { - return err - } - ep.Kind = &kind - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - ep.Location = &location - } - case "properties": - if v != nil { - var encryptionProtectorProperties EncryptionProtectorProperties - err = json.Unmarshal(*v, &encryptionProtectorProperties) - if err != nil { - return err - } - ep.EncryptionProtectorProperties = &encryptionProtectorProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ep.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ep.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ep.Type = &typeVar - } - } - } - - return nil -} - -// EncryptionProtectorListResult a list of server encryption protectors. -type EncryptionProtectorListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]EncryptionProtector `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// EncryptionProtectorListResultIterator provides access to a complete listing of EncryptionProtector -// values. -type EncryptionProtectorListResultIterator struct { - i int - page EncryptionProtectorListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *EncryptionProtectorListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/EncryptionProtectorListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *EncryptionProtectorListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter EncryptionProtectorListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter EncryptionProtectorListResultIterator) Response() EncryptionProtectorListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter EncryptionProtectorListResultIterator) Value() EncryptionProtector { - if !iter.page.NotDone() { - return EncryptionProtector{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the EncryptionProtectorListResultIterator type. -func NewEncryptionProtectorListResultIterator(page EncryptionProtectorListResultPage) EncryptionProtectorListResultIterator { - return EncryptionProtectorListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (eplr EncryptionProtectorListResult) IsEmpty() bool { - return eplr.Value == nil || len(*eplr.Value) == 0 -} - -// encryptionProtectorListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (eplr EncryptionProtectorListResult) encryptionProtectorListResultPreparer(ctx context.Context) (*http.Request, error) { - if eplr.NextLink == nil || len(to.String(eplr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(eplr.NextLink))) -} - -// EncryptionProtectorListResultPage contains a page of EncryptionProtector values. -type EncryptionProtectorListResultPage struct { - fn func(context.Context, EncryptionProtectorListResult) (EncryptionProtectorListResult, error) - eplr EncryptionProtectorListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *EncryptionProtectorListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/EncryptionProtectorListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - next, err := page.fn(ctx, page.eplr) - if err != nil { - return err - } - page.eplr = next - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *EncryptionProtectorListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page EncryptionProtectorListResultPage) NotDone() bool { - return !page.eplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page EncryptionProtectorListResultPage) Response() EncryptionProtectorListResult { - return page.eplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page EncryptionProtectorListResultPage) Values() []EncryptionProtector { - if page.eplr.IsEmpty() { - return nil - } - return *page.eplr.Value -} - -// Creates a new instance of the EncryptionProtectorListResultPage type. -func NewEncryptionProtectorListResultPage(getNextPage func(context.Context, EncryptionProtectorListResult) (EncryptionProtectorListResult, error)) EncryptionProtectorListResultPage { - return EncryptionProtectorListResultPage{fn: getNextPage} -} - -// EncryptionProtectorProperties properties for an encryption protector execution. -type EncryptionProtectorProperties struct { - // Subregion - READ-ONLY; Subregion of the encryption protector. - Subregion *string `json:"subregion,omitempty"` - // ServerKeyName - The name of the server key. - ServerKeyName *string `json:"serverKeyName,omitempty"` - // ServerKeyType - The encryption protector type like 'ServiceManaged', 'AzureKeyVault'. Possible values include: 'ServiceManaged', 'AzureKeyVault' - ServerKeyType ServerKeyType `json:"serverKeyType,omitempty"` - // URI - READ-ONLY; The URI of the server key. - URI *string `json:"uri,omitempty"` - // Thumbprint - READ-ONLY; Thumbprint of the server key. - Thumbprint *string `json:"thumbprint,omitempty"` -} - -// EncryptionProtectorsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type EncryptionProtectorsCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *EncryptionProtectorsCreateOrUpdateFuture) Result(client EncryptionProtectorsClient) (ep EncryptionProtector, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.EncryptionProtectorsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.EncryptionProtectorsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ep.Response.Response, err = future.GetResult(sender); err == nil && ep.Response.Response.StatusCode != http.StatusNoContent { - ep, err = client.CreateOrUpdateResponder(ep.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.EncryptionProtectorsCreateOrUpdateFuture", "Result", ep.Response.Response, "Failure responding to request") - } - } - return -} - -// EncryptionProtectorsRevalidateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type EncryptionProtectorsRevalidateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *EncryptionProtectorsRevalidateFuture) Result(client EncryptionProtectorsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.EncryptionProtectorsRevalidateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.EncryptionProtectorsRevalidateFuture") - return - } - ar.Response = future.Response() - return -} - -// ExportRequest export database parameters. -type ExportRequest struct { - // StorageKeyType - The type of the storage key to use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - StorageKeyType StorageKeyType `json:"storageKeyType,omitempty"` - // StorageKey - The storage key to use. If storage key type is SharedAccessKey, it must be preceded with a "?." - StorageKey *string `json:"storageKey,omitempty"` - // StorageURI - The storage uri to use. - StorageURI *string `json:"storageUri,omitempty"` - // AdministratorLogin - The name of the SQL administrator. - AdministratorLogin *string `json:"administratorLogin,omitempty"` - // AdministratorLoginPassword - The password of the SQL administrator. - AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"` - // AuthenticationType - The authentication type. Possible values include: 'SQL', 'ADPassword' - AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` -} - -// ExtendedDatabaseBlobAuditingPolicy an extended database blob auditing policy. -type ExtendedDatabaseBlobAuditingPolicy struct { - autorest.Response `json:"-"` - // ExtendedDatabaseBlobAuditingPolicyProperties - Resource properties. - *ExtendedDatabaseBlobAuditingPolicyProperties `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 ExtendedDatabaseBlobAuditingPolicy. -func (edbap ExtendedDatabaseBlobAuditingPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if edbap.ExtendedDatabaseBlobAuditingPolicyProperties != nil { - objectMap["properties"] = edbap.ExtendedDatabaseBlobAuditingPolicyProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ExtendedDatabaseBlobAuditingPolicy struct. -func (edbap *ExtendedDatabaseBlobAuditingPolicy) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var extendedDatabaseBlobAuditingPolicyProperties ExtendedDatabaseBlobAuditingPolicyProperties - err = json.Unmarshal(*v, &extendedDatabaseBlobAuditingPolicyProperties) - if err != nil { - return err - } - edbap.ExtendedDatabaseBlobAuditingPolicyProperties = &extendedDatabaseBlobAuditingPolicyProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - edbap.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - edbap.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - edbap.Type = &typeVar - } - } - } - - return nil -} - -// ExtendedDatabaseBlobAuditingPolicyProperties properties of an extended database blob auditing policy. -type ExtendedDatabaseBlobAuditingPolicyProperties struct { - // PredicateExpression - Specifies condition of where clause when creating an audit. - PredicateExpression *string `json:"predicateExpression,omitempty"` - // State - Specifies the state of the policy. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. Possible values include: 'BlobAuditingPolicyStateEnabled', 'BlobAuditingPolicyStateDisabled' - State BlobAuditingPolicyState `json:"state,omitempty"` - // StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint is required. - StorageEndpoint *string `json:"storageEndpoint,omitempty"` - // StorageAccountAccessKey - Specifies the identifier key of the auditing storage account. If state is Enabled and storageEndpoint is specified, storageAccountAccessKey is required. - StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` - // RetentionDays - Specifies the number of days to keep in the audit logs in the storage account. - RetentionDays *int32 `json:"retentionDays,omitempty"` - // AuditActionsAndGroups - Specifies the Actions-Groups and Actions to audit. - // - // The recommended set of action groups to use is the following combination - this will audit all the queries and stored procedures executed against the database, as well as successful and failed logins: - // - // BATCH_COMPLETED_GROUP, - // SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, - // FAILED_DATABASE_AUTHENTICATION_GROUP. - // - // This above combination is also the set that is configured by default when enabling auditing from the Azure portal. - // - // The supported action groups to audit are (note: choose only specific groups that cover your auditing needs. Using unnecessary groups could lead to very large quantities of audit records): - // - // APPLICATION_ROLE_CHANGE_PASSWORD_GROUP - // BACKUP_RESTORE_GROUP - // DATABASE_LOGOUT_GROUP - // DATABASE_OBJECT_CHANGE_GROUP - // DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP - // DATABASE_OBJECT_PERMISSION_CHANGE_GROUP - // DATABASE_OPERATION_GROUP - // DATABASE_PERMISSION_CHANGE_GROUP - // DATABASE_PRINCIPAL_CHANGE_GROUP - // DATABASE_PRINCIPAL_IMPERSONATION_GROUP - // DATABASE_ROLE_MEMBER_CHANGE_GROUP - // FAILED_DATABASE_AUTHENTICATION_GROUP - // SCHEMA_OBJECT_ACCESS_GROUP - // SCHEMA_OBJECT_CHANGE_GROUP - // SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP - // SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP - // SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP - // USER_CHANGE_PASSWORD_GROUP - // BATCH_STARTED_GROUP - // BATCH_COMPLETED_GROUP - // - // These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs. - // - // For more information, see [Database-Level Audit Action Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). - // - // For Database auditing policy, specific Actions can also be specified (note that Actions cannot be specified for Server auditing policy). The supported actions to audit are: - // SELECT - // UPDATE - // INSERT - // DELETE - // EXECUTE - // RECEIVE - // REFERENCES - // - // The general form for defining an action to be audited is: - // {action} ON {object} BY {principal} - // - // Note that in the above format can refer to an object like a table, view, or stored procedure, or an entire database or schema. For the latter cases, the forms DATABASE::{db_name} and SCHEMA::{schema_name} are used, respectively. - // - // For example: - // SELECT on dbo.myTable by public - // SELECT on DATABASE::myDatabase by public - // SELECT on SCHEMA::mySchema by public - // - // For more information, see [Database-Level Audit Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions) - AuditActionsAndGroups *[]string `json:"auditActionsAndGroups,omitempty"` - // StorageAccountSubscriptionID - Specifies the blob storage subscription Id. - StorageAccountSubscriptionID *uuid.UUID `json:"storageAccountSubscriptionId,omitempty"` - // IsStorageSecondaryKeyInUse - Specifies whether storageAccountAccessKey value is the storage's secondary key. - IsStorageSecondaryKeyInUse *bool `json:"isStorageSecondaryKeyInUse,omitempty"` - // IsAzureMonitorTargetEnabled - Specifies whether audit events are sent to Azure Monitor. - // In order to send the events to Azure Monitor, specify 'state' as 'Enabled' and 'isAzureMonitorTargetEnabled' as true. - // - // When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created. - // Note that for server level audit you should use the 'master' database as {databaseName}. - // - // Diagnostic Settings URI format: - // PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview - // - // For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207) - // or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043) - IsAzureMonitorTargetEnabled *bool `json:"isAzureMonitorTargetEnabled,omitempty"` -} - -// ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture) Result(client ExtendedServerBlobAuditingPoliciesClient) (esbap ExtendedServerBlobAuditingPolicy, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if esbap.Response.Response, err = future.GetResult(sender); err == nil && esbap.Response.Response.StatusCode != http.StatusNoContent { - esbap, err = client.CreateOrUpdateResponder(esbap.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture", "Result", esbap.Response.Response, "Failure responding to request") - } - } - return -} - -// ExtendedServerBlobAuditingPolicy an extended server blob auditing policy. -type ExtendedServerBlobAuditingPolicy struct { - autorest.Response `json:"-"` - // ExtendedServerBlobAuditingPolicyProperties - Resource properties. - *ExtendedServerBlobAuditingPolicyProperties `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 ExtendedServerBlobAuditingPolicy. -func (esbap ExtendedServerBlobAuditingPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if esbap.ExtendedServerBlobAuditingPolicyProperties != nil { - objectMap["properties"] = esbap.ExtendedServerBlobAuditingPolicyProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ExtendedServerBlobAuditingPolicy struct. -func (esbap *ExtendedServerBlobAuditingPolicy) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var extendedServerBlobAuditingPolicyProperties ExtendedServerBlobAuditingPolicyProperties - err = json.Unmarshal(*v, &extendedServerBlobAuditingPolicyProperties) - if err != nil { - return err - } - esbap.ExtendedServerBlobAuditingPolicyProperties = &extendedServerBlobAuditingPolicyProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - esbap.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - esbap.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - esbap.Type = &typeVar - } - } - } - - return nil -} - -// ExtendedServerBlobAuditingPolicyProperties properties of an extended server blob auditing policy. -type ExtendedServerBlobAuditingPolicyProperties struct { - // PredicateExpression - Specifies condition of where clause when creating an audit. - PredicateExpression *string `json:"predicateExpression,omitempty"` - // State - Specifies the state of the policy. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. Possible values include: 'BlobAuditingPolicyStateEnabled', 'BlobAuditingPolicyStateDisabled' - State BlobAuditingPolicyState `json:"state,omitempty"` - // StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint is required. - StorageEndpoint *string `json:"storageEndpoint,omitempty"` - // StorageAccountAccessKey - Specifies the identifier key of the auditing storage account. If state is Enabled and storageEndpoint is specified, storageAccountAccessKey is required. - StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` - // RetentionDays - Specifies the number of days to keep in the audit logs in the storage account. - RetentionDays *int32 `json:"retentionDays,omitempty"` - // AuditActionsAndGroups - Specifies the Actions-Groups and Actions to audit. - // - // The recommended set of action groups to use is the following combination - this will audit all the queries and stored procedures executed against the database, as well as successful and failed logins: - // - // BATCH_COMPLETED_GROUP, - // SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, - // FAILED_DATABASE_AUTHENTICATION_GROUP. - // - // This above combination is also the set that is configured by default when enabling auditing from the Azure portal. - // - // The supported action groups to audit are (note: choose only specific groups that cover your auditing needs. Using unnecessary groups could lead to very large quantities of audit records): - // - // APPLICATION_ROLE_CHANGE_PASSWORD_GROUP - // BACKUP_RESTORE_GROUP - // DATABASE_LOGOUT_GROUP - // DATABASE_OBJECT_CHANGE_GROUP - // DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP - // DATABASE_OBJECT_PERMISSION_CHANGE_GROUP - // DATABASE_OPERATION_GROUP - // DATABASE_PERMISSION_CHANGE_GROUP - // DATABASE_PRINCIPAL_CHANGE_GROUP - // DATABASE_PRINCIPAL_IMPERSONATION_GROUP - // DATABASE_ROLE_MEMBER_CHANGE_GROUP - // FAILED_DATABASE_AUTHENTICATION_GROUP - // SCHEMA_OBJECT_ACCESS_GROUP - // SCHEMA_OBJECT_CHANGE_GROUP - // SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP - // SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP - // SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP - // USER_CHANGE_PASSWORD_GROUP - // BATCH_STARTED_GROUP - // BATCH_COMPLETED_GROUP - // - // These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs. - // - // For more information, see [Database-Level Audit Action Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). - // - // For Database auditing policy, specific Actions can also be specified (note that Actions cannot be specified for Server auditing policy). The supported actions to audit are: - // SELECT - // UPDATE - // INSERT - // DELETE - // EXECUTE - // RECEIVE - // REFERENCES - // - // The general form for defining an action to be audited is: - // {action} ON {object} BY {principal} - // - // Note that in the above format can refer to an object like a table, view, or stored procedure, or an entire database or schema. For the latter cases, the forms DATABASE::{db_name} and SCHEMA::{schema_name} are used, respectively. - // - // For example: - // SELECT on dbo.myTable by public - // SELECT on DATABASE::myDatabase by public - // SELECT on SCHEMA::mySchema by public - // - // For more information, see [Database-Level Audit Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions) - AuditActionsAndGroups *[]string `json:"auditActionsAndGroups,omitempty"` - // StorageAccountSubscriptionID - Specifies the blob storage subscription Id. - StorageAccountSubscriptionID *uuid.UUID `json:"storageAccountSubscriptionId,omitempty"` - // IsStorageSecondaryKeyInUse - Specifies whether storageAccountAccessKey value is the storage's secondary key. - IsStorageSecondaryKeyInUse *bool `json:"isStorageSecondaryKeyInUse,omitempty"` - // IsAzureMonitorTargetEnabled - Specifies whether audit events are sent to Azure Monitor. - // In order to send the events to Azure Monitor, specify 'state' as 'Enabled' and 'isAzureMonitorTargetEnabled' as true. - // - // When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created. - // Note that for server level audit you should use the 'master' database as {databaseName}. - // - // Diagnostic Settings URI format: - // PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview - // - // For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207) - // or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043) - IsAzureMonitorTargetEnabled *bool `json:"isAzureMonitorTargetEnabled,omitempty"` -} - -// FailoverGroup a failover group. -type FailoverGroup struct { - autorest.Response `json:"-"` - // Location - READ-ONLY; Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // FailoverGroupProperties - Resource properties. - *FailoverGroupProperties `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 FailoverGroup. -func (fg FailoverGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if fg.Tags != nil { - objectMap["tags"] = fg.Tags - } - if fg.FailoverGroupProperties != nil { - objectMap["properties"] = fg.FailoverGroupProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for FailoverGroup struct. -func (fg *FailoverGroup) UnmarshalJSON(body []byte) error { - 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 - } - fg.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - fg.Tags = tags - } - case "properties": - if v != nil { - var failoverGroupProperties FailoverGroupProperties - err = json.Unmarshal(*v, &failoverGroupProperties) - if err != nil { - return err - } - fg.FailoverGroupProperties = &failoverGroupProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - fg.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - fg.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - fg.Type = &typeVar - } - } - } - - return nil -} - -// FailoverGroupListResult a list of failover groups. -type FailoverGroupListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]FailoverGroup `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// FailoverGroupListResultIterator provides access to a complete listing of FailoverGroup values. -type FailoverGroupListResultIterator struct { - i int - page FailoverGroupListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *FailoverGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FailoverGroupListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *FailoverGroupListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter FailoverGroupListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter FailoverGroupListResultIterator) Response() FailoverGroupListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter FailoverGroupListResultIterator) Value() FailoverGroup { - if !iter.page.NotDone() { - return FailoverGroup{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the FailoverGroupListResultIterator type. -func NewFailoverGroupListResultIterator(page FailoverGroupListResultPage) FailoverGroupListResultIterator { - return FailoverGroupListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (fglr FailoverGroupListResult) IsEmpty() bool { - return fglr.Value == nil || len(*fglr.Value) == 0 -} - -// failoverGroupListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (fglr FailoverGroupListResult) failoverGroupListResultPreparer(ctx context.Context) (*http.Request, error) { - if fglr.NextLink == nil || len(to.String(fglr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(fglr.NextLink))) -} - -// FailoverGroupListResultPage contains a page of FailoverGroup values. -type FailoverGroupListResultPage struct { - fn func(context.Context, FailoverGroupListResult) (FailoverGroupListResult, error) - fglr FailoverGroupListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *FailoverGroupListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FailoverGroupListResultPage.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.fglr) - if err != nil { - return err - } - page.fglr = 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 *FailoverGroupListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page FailoverGroupListResultPage) NotDone() bool { - return !page.fglr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page FailoverGroupListResultPage) Response() FailoverGroupListResult { - return page.fglr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page FailoverGroupListResultPage) Values() []FailoverGroup { - if page.fglr.IsEmpty() { - return nil - } - return *page.fglr.Value -} - -// Creates a new instance of the FailoverGroupListResultPage type. -func NewFailoverGroupListResultPage(getNextPage func(context.Context, FailoverGroupListResult) (FailoverGroupListResult, error)) FailoverGroupListResultPage { - return FailoverGroupListResultPage{fn: getNextPage} -} - -// FailoverGroupProperties properties of a failover group. -type FailoverGroupProperties struct { - // ReadWriteEndpoint - Read-write endpoint of the failover group instance. - ReadWriteEndpoint *FailoverGroupReadWriteEndpoint `json:"readWriteEndpoint,omitempty"` - // ReadOnlyEndpoint - Read-only endpoint of the failover group instance. - ReadOnlyEndpoint *FailoverGroupReadOnlyEndpoint `json:"readOnlyEndpoint,omitempty"` - // ReplicationRole - READ-ONLY; Local replication role of the failover group instance. Possible values include: 'Primary', 'Secondary' - ReplicationRole FailoverGroupReplicationRole `json:"replicationRole,omitempty"` - // ReplicationState - READ-ONLY; Replication state of the failover group instance. - ReplicationState *string `json:"replicationState,omitempty"` - // PartnerServers - List of partner server information for the failover group. - PartnerServers *[]PartnerInfo `json:"partnerServers,omitempty"` - // Databases - List of databases in the failover group. - Databases *[]string `json:"databases,omitempty"` -} - -// FailoverGroupReadOnlyEndpoint read-only endpoint of the failover group instance. -type FailoverGroupReadOnlyEndpoint struct { - // FailoverPolicy - Failover policy of the read-only endpoint for the failover group. Possible values include: 'ReadOnlyEndpointFailoverPolicyDisabled', 'ReadOnlyEndpointFailoverPolicyEnabled' - FailoverPolicy ReadOnlyEndpointFailoverPolicy `json:"failoverPolicy,omitempty"` -} - -// FailoverGroupReadWriteEndpoint read-write endpoint of the failover group instance. -type FailoverGroupReadWriteEndpoint struct { - // FailoverPolicy - Failover policy of the read-write endpoint for the failover group. If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible values include: 'Manual', 'Automatic' - FailoverPolicy ReadWriteEndpointFailoverPolicy `json:"failoverPolicy,omitempty"` - // FailoverWithDataLossGracePeriodMinutes - Grace period before failover with data loss is attempted for the read-write endpoint. If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required. - FailoverWithDataLossGracePeriodMinutes *int32 `json:"failoverWithDataLossGracePeriodMinutes,omitempty"` -} - -// FailoverGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type FailoverGroupsCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *FailoverGroupsCreateOrUpdateFuture) Result(client FailoverGroupsClient) (fg FailoverGroup, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.FailoverGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.FailoverGroupsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if fg.Response.Response, err = future.GetResult(sender); err == nil && fg.Response.Response.StatusCode != http.StatusNoContent { - fg, err = client.CreateOrUpdateResponder(fg.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.FailoverGroupsCreateOrUpdateFuture", "Result", fg.Response.Response, "Failure responding to request") - } - } - return -} - -// FailoverGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type FailoverGroupsDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *FailoverGroupsDeleteFuture) Result(client FailoverGroupsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.FailoverGroupsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.FailoverGroupsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// FailoverGroupsFailoverFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type FailoverGroupsFailoverFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *FailoverGroupsFailoverFuture) Result(client FailoverGroupsClient) (fg FailoverGroup, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.FailoverGroupsFailoverFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.FailoverGroupsFailoverFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if fg.Response.Response, err = future.GetResult(sender); err == nil && fg.Response.Response.StatusCode != http.StatusNoContent { - fg, err = client.FailoverResponder(fg.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.FailoverGroupsFailoverFuture", "Result", fg.Response.Response, "Failure responding to request") - } - } - return -} - -// FailoverGroupsForceFailoverAllowDataLossFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type FailoverGroupsForceFailoverAllowDataLossFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *FailoverGroupsForceFailoverAllowDataLossFuture) Result(client FailoverGroupsClient) (fg FailoverGroup, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.FailoverGroupsForceFailoverAllowDataLossFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.FailoverGroupsForceFailoverAllowDataLossFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if fg.Response.Response, err = future.GetResult(sender); err == nil && fg.Response.Response.StatusCode != http.StatusNoContent { - fg, err = client.ForceFailoverAllowDataLossResponder(fg.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.FailoverGroupsForceFailoverAllowDataLossFuture", "Result", fg.Response.Response, "Failure responding to request") - } - } - return -} - -// FailoverGroupsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type FailoverGroupsUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *FailoverGroupsUpdateFuture) Result(client FailoverGroupsClient) (fg FailoverGroup, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.FailoverGroupsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.FailoverGroupsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if fg.Response.Response, err = future.GetResult(sender); err == nil && fg.Response.Response.StatusCode != http.StatusNoContent { - fg, err = client.UpdateResponder(fg.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.FailoverGroupsUpdateFuture", "Result", fg.Response.Response, "Failure responding to request") - } - } - return -} - -// FailoverGroupUpdate a failover group update request. -type FailoverGroupUpdate struct { - // FailoverGroupUpdateProperties - Resource properties. - *FailoverGroupUpdateProperties `json:"properties,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for FailoverGroupUpdate. -func (fgu FailoverGroupUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if fgu.FailoverGroupUpdateProperties != nil { - objectMap["properties"] = fgu.FailoverGroupUpdateProperties - } - if fgu.Tags != nil { - objectMap["tags"] = fgu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for FailoverGroupUpdate struct. -func (fgu *FailoverGroupUpdate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var failoverGroupUpdateProperties FailoverGroupUpdateProperties - err = json.Unmarshal(*v, &failoverGroupUpdateProperties) - if err != nil { - return err - } - fgu.FailoverGroupUpdateProperties = &failoverGroupUpdateProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - fgu.Tags = tags - } - } - } - - return nil -} - -// FailoverGroupUpdateProperties properties of a failover group update. -type FailoverGroupUpdateProperties struct { - // ReadWriteEndpoint - Read-write endpoint of the failover group instance. - ReadWriteEndpoint *FailoverGroupReadWriteEndpoint `json:"readWriteEndpoint,omitempty"` - // ReadOnlyEndpoint - Read-only endpoint of the failover group instance. - ReadOnlyEndpoint *FailoverGroupReadOnlyEndpoint `json:"readOnlyEndpoint,omitempty"` - // Databases - List of databases in the failover group. - Databases *[]string `json:"databases,omitempty"` -} - -// FirewallRule represents a server firewall rule. -type FirewallRule struct { - autorest.Response `json:"-"` - // Kind - READ-ONLY; Kind of server that contains this firewall rule. - Kind *string `json:"kind,omitempty"` - // Location - READ-ONLY; Location of the server that contains this firewall rule. - Location *string `json:"location,omitempty"` - // FirewallRuleProperties - The properties representing the resource. - *FirewallRuleProperties `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 FirewallRule. -func (fr FirewallRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if fr.FirewallRuleProperties != nil { - objectMap["properties"] = fr.FirewallRuleProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for FirewallRule struct. -func (fr *FirewallRule) UnmarshalJSON(body []byte) error { - 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 string - err = json.Unmarshal(*v, &kind) - if err != nil { - return err - } - fr.Kind = &kind - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - fr.Location = &location - } - case "properties": - if v != nil { - var firewallRuleProperties FirewallRuleProperties - err = json.Unmarshal(*v, &firewallRuleProperties) - if err != nil { - return err - } - fr.FirewallRuleProperties = &firewallRuleProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - fr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - fr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - fr.Type = &typeVar - } - } - } - - return nil -} - -// FirewallRuleListResult represents the response to a List Firewall Rules request. -type FirewallRuleListResult struct { - autorest.Response `json:"-"` - // Value - The list of server firewall rules. - Value *[]FirewallRule `json:"value,omitempty"` -} - -// FirewallRuleProperties represents the properties of a server firewall rule. -type FirewallRuleProperties struct { - // StartIPAddress - The start IP address of the firewall rule. Must be IPv4 format. Use value '0.0.0.0' to represent all Azure-internal IP addresses. - StartIPAddress *string `json:"startIpAddress,omitempty"` - // EndIPAddress - The end IP address of the firewall rule. Must be IPv4 format. Must be greater than or equal to startIpAddress. Use value '0.0.0.0' to represent all Azure-internal IP addresses. - EndIPAddress *string `json:"endIpAddress,omitempty"` -} - -// GeoBackupPolicy a database geo backup policy. -type GeoBackupPolicy struct { - autorest.Response `json:"-"` - // GeoBackupPolicyProperties - The properties of the geo backup policy. - *GeoBackupPolicyProperties `json:"properties,omitempty"` - // Kind - READ-ONLY; Kind of geo backup policy. This is metadata used for the Azure portal experience. - Kind *string `json:"kind,omitempty"` - // Location - READ-ONLY; Backup policy location. - Location *string `json:"location,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 GeoBackupPolicy. -func (gbp GeoBackupPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gbp.GeoBackupPolicyProperties != nil { - objectMap["properties"] = gbp.GeoBackupPolicyProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for GeoBackupPolicy struct. -func (gbp *GeoBackupPolicy) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var geoBackupPolicyProperties GeoBackupPolicyProperties - err = json.Unmarshal(*v, &geoBackupPolicyProperties) - if err != nil { - return err - } - gbp.GeoBackupPolicyProperties = &geoBackupPolicyProperties - } - case "kind": - if v != nil { - var kind string - err = json.Unmarshal(*v, &kind) - if err != nil { - return err - } - gbp.Kind = &kind - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - gbp.Location = &location - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - gbp.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - gbp.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - gbp.Type = &typeVar - } - } - } - - return nil -} - -// GeoBackupPolicyListResult the response to a list geo backup policies request. -type GeoBackupPolicyListResult struct { - autorest.Response `json:"-"` - // Value - The list of geo backup policies. - Value *[]GeoBackupPolicy `json:"value,omitempty"` -} - -// GeoBackupPolicyProperties the properties of the geo backup policy. -type GeoBackupPolicyProperties struct { - // State - The state of the geo backup policy. Possible values include: 'GeoBackupPolicyStateDisabled', 'GeoBackupPolicyStateEnabled' - State GeoBackupPolicyState `json:"state,omitempty"` - // StorageType - READ-ONLY; The storage type of the geo backup policy. - StorageType *string `json:"storageType,omitempty"` -} - -// ImportExportResponse response for Import/Export Get operation. -type ImportExportResponse struct { - autorest.Response `json:"-"` - // ImportExportResponseProperties - The import/export operation properties. - *ImportExportResponseProperties `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 ImportExportResponse. -func (ier ImportExportResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ier.ImportExportResponseProperties != nil { - objectMap["properties"] = ier.ImportExportResponseProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ImportExportResponse struct. -func (ier *ImportExportResponse) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var importExportResponseProperties ImportExportResponseProperties - err = json.Unmarshal(*v, &importExportResponseProperties) - if err != nil { - return err - } - ier.ImportExportResponseProperties = &importExportResponseProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ier.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ier.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ier.Type = &typeVar - } - } - } - - return nil -} - -// ImportExportResponseProperties response for Import/Export Status operation. -type ImportExportResponseProperties struct { - // RequestType - READ-ONLY; The request type of the operation. - RequestType *string `json:"requestType,omitempty"` - // RequestID - READ-ONLY; The request type of the operation. - RequestID *uuid.UUID `json:"requestId,omitempty"` - // ServerName - READ-ONLY; The name of the server. - ServerName *string `json:"serverName,omitempty"` - // DatabaseName - READ-ONLY; The name of the database. - DatabaseName *string `json:"databaseName,omitempty"` - // Status - READ-ONLY; The status message returned from the server. - Status *string `json:"status,omitempty"` - // LastModifiedTime - READ-ONLY; The operation status last modified time. - LastModifiedTime *string `json:"lastModifiedTime,omitempty"` - // QueuedTime - READ-ONLY; The operation queued time. - QueuedTime *string `json:"queuedTime,omitempty"` - // BlobURI - READ-ONLY; The blob uri. - BlobURI *string `json:"blobUri,omitempty"` - // ErrorMessage - READ-ONLY; The error message returned from the server. - ErrorMessage *string `json:"errorMessage,omitempty"` -} - -// ImportExtensionProperties represents the properties for an import operation -type ImportExtensionProperties struct { - // OperationMode - The type of import operation being performed. This is always Import. - OperationMode *string `json:"operationMode,omitempty"` - // StorageKeyType - The type of the storage key to use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - StorageKeyType StorageKeyType `json:"storageKeyType,omitempty"` - // StorageKey - The storage key to use. If storage key type is SharedAccessKey, it must be preceded with a "?." - StorageKey *string `json:"storageKey,omitempty"` - // StorageURI - The storage uri to use. - StorageURI *string `json:"storageUri,omitempty"` - // AdministratorLogin - The name of the SQL administrator. - AdministratorLogin *string `json:"administratorLogin,omitempty"` - // AdministratorLoginPassword - The password of the SQL administrator. - AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"` - // AuthenticationType - The authentication type. Possible values include: 'SQL', 'ADPassword' - AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` -} - -// ImportExtensionRequest import database parameters. -type ImportExtensionRequest struct { - // Name - The name of the extension. - Name *string `json:"name,omitempty"` - // Type - The type of the extension. - Type *string `json:"type,omitempty"` - // ImportExtensionProperties - Represents the properties of the resource. - *ImportExtensionProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for ImportExtensionRequest. -func (ier ImportExtensionRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ier.Name != nil { - objectMap["name"] = ier.Name - } - if ier.Type != nil { - objectMap["type"] = ier.Type - } - if ier.ImportExtensionProperties != nil { - objectMap["properties"] = ier.ImportExtensionProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ImportExtensionRequest struct. -func (ier *ImportExtensionRequest) UnmarshalJSON(body []byte) error { - 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 - } - ier.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ier.Type = &typeVar - } - case "properties": - if v != nil { - var importExtensionProperties ImportExtensionProperties - err = json.Unmarshal(*v, &importExtensionProperties) - if err != nil { - return err - } - ier.ImportExtensionProperties = &importExtensionProperties - } - } - } - - return nil -} - -// ImportRequest import database parameters. -type ImportRequest struct { - // DatabaseName - The name of the database to import. - DatabaseName *string `json:"databaseName,omitempty"` - // Edition - The edition for the database being created. - // - // The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API or one of the following commands: - // - // ```azurecli - // az sql db list-editions -l -o table - // ```` - // - // ```powershell - // Get-AzSqlServerServiceObjective -Location - // ```` - // . Possible values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2', 'GeneralPurpose', 'BusinessCritical', 'Hyperscale' - Edition DatabaseEdition `json:"edition,omitempty"` - // ServiceObjectiveName - The name of the service objective to assign to the database. Possible values include: 'ServiceObjectiveNameSystem', 'ServiceObjectiveNameSystem0', 'ServiceObjectiveNameSystem1', 'ServiceObjectiveNameSystem2', 'ServiceObjectiveNameSystem3', 'ServiceObjectiveNameSystem4', 'ServiceObjectiveNameSystem2L', 'ServiceObjectiveNameSystem3L', 'ServiceObjectiveNameSystem4L', 'ServiceObjectiveNameFree', 'ServiceObjectiveNameBasic', 'ServiceObjectiveNameS0', 'ServiceObjectiveNameS1', 'ServiceObjectiveNameS2', 'ServiceObjectiveNameS3', 'ServiceObjectiveNameS4', 'ServiceObjectiveNameS6', 'ServiceObjectiveNameS7', 'ServiceObjectiveNameS9', 'ServiceObjectiveNameS12', 'ServiceObjectiveNameP1', 'ServiceObjectiveNameP2', 'ServiceObjectiveNameP3', 'ServiceObjectiveNameP4', 'ServiceObjectiveNameP6', 'ServiceObjectiveNameP11', 'ServiceObjectiveNameP15', 'ServiceObjectiveNamePRS1', 'ServiceObjectiveNamePRS2', 'ServiceObjectiveNamePRS4', 'ServiceObjectiveNamePRS6', 'ServiceObjectiveNameDW100', 'ServiceObjectiveNameDW200', 'ServiceObjectiveNameDW300', 'ServiceObjectiveNameDW400', 'ServiceObjectiveNameDW500', 'ServiceObjectiveNameDW600', 'ServiceObjectiveNameDW1000', 'ServiceObjectiveNameDW1200', 'ServiceObjectiveNameDW1000c', 'ServiceObjectiveNameDW1500', 'ServiceObjectiveNameDW1500c', 'ServiceObjectiveNameDW2000', 'ServiceObjectiveNameDW2000c', 'ServiceObjectiveNameDW3000', 'ServiceObjectiveNameDW2500c', 'ServiceObjectiveNameDW3000c', 'ServiceObjectiveNameDW6000', 'ServiceObjectiveNameDW5000c', 'ServiceObjectiveNameDW6000c', 'ServiceObjectiveNameDW7500c', 'ServiceObjectiveNameDW10000c', 'ServiceObjectiveNameDW15000c', 'ServiceObjectiveNameDW30000c', 'ServiceObjectiveNameDS100', 'ServiceObjectiveNameDS200', 'ServiceObjectiveNameDS300', 'ServiceObjectiveNameDS400', 'ServiceObjectiveNameDS500', 'ServiceObjectiveNameDS600', 'ServiceObjectiveNameDS1000', 'ServiceObjectiveNameDS1200', 'ServiceObjectiveNameDS1500', 'ServiceObjectiveNameDS2000', 'ServiceObjectiveNameElasticPool' - ServiceObjectiveName ServiceObjectiveName `json:"serviceObjectiveName,omitempty"` - // MaxSizeBytes - The maximum size for the newly imported database. - MaxSizeBytes *string `json:"maxSizeBytes,omitempty"` - // StorageKeyType - The type of the storage key to use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - StorageKeyType StorageKeyType `json:"storageKeyType,omitempty"` - // StorageKey - The storage key to use. If storage key type is SharedAccessKey, it must be preceded with a "?." - StorageKey *string `json:"storageKey,omitempty"` - // StorageURI - The storage uri to use. - StorageURI *string `json:"storageUri,omitempty"` - // AdministratorLogin - The name of the SQL administrator. - AdministratorLogin *string `json:"administratorLogin,omitempty"` - // AdministratorLoginPassword - The password of the SQL administrator. - AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"` - // AuthenticationType - The authentication type. Possible values include: 'SQL', 'ADPassword' - AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` -} - -// InstanceFailoverGroup an instance failover group. -type InstanceFailoverGroup struct { - autorest.Response `json:"-"` - // InstanceFailoverGroupProperties - Resource properties. - *InstanceFailoverGroupProperties `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 InstanceFailoverGroup. -func (ifg InstanceFailoverGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ifg.InstanceFailoverGroupProperties != nil { - objectMap["properties"] = ifg.InstanceFailoverGroupProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for InstanceFailoverGroup struct. -func (ifg *InstanceFailoverGroup) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var instanceFailoverGroupProperties InstanceFailoverGroupProperties - err = json.Unmarshal(*v, &instanceFailoverGroupProperties) - if err != nil { - return err - } - ifg.InstanceFailoverGroupProperties = &instanceFailoverGroupProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ifg.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ifg.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ifg.Type = &typeVar - } - } - } - - return nil -} - -// InstanceFailoverGroupListResult a list of instance failover groups. -type InstanceFailoverGroupListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]InstanceFailoverGroup `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// InstanceFailoverGroupListResultIterator provides access to a complete listing of InstanceFailoverGroup -// values. -type InstanceFailoverGroupListResultIterator struct { - i int - page InstanceFailoverGroupListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *InstanceFailoverGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InstanceFailoverGroupListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *InstanceFailoverGroupListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter InstanceFailoverGroupListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter InstanceFailoverGroupListResultIterator) Response() InstanceFailoverGroupListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter InstanceFailoverGroupListResultIterator) Value() InstanceFailoverGroup { - if !iter.page.NotDone() { - return InstanceFailoverGroup{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the InstanceFailoverGroupListResultIterator type. -func NewInstanceFailoverGroupListResultIterator(page InstanceFailoverGroupListResultPage) InstanceFailoverGroupListResultIterator { - return InstanceFailoverGroupListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (ifglr InstanceFailoverGroupListResult) IsEmpty() bool { - return ifglr.Value == nil || len(*ifglr.Value) == 0 -} - -// instanceFailoverGroupListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ifglr InstanceFailoverGroupListResult) instanceFailoverGroupListResultPreparer(ctx context.Context) (*http.Request, error) { - if ifglr.NextLink == nil || len(to.String(ifglr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ifglr.NextLink))) -} - -// InstanceFailoverGroupListResultPage contains a page of InstanceFailoverGroup values. -type InstanceFailoverGroupListResultPage struct { - fn func(context.Context, InstanceFailoverGroupListResult) (InstanceFailoverGroupListResult, error) - ifglr InstanceFailoverGroupListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *InstanceFailoverGroupListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InstanceFailoverGroupListResultPage.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.ifglr) - if err != nil { - return err - } - page.ifglr = 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 *InstanceFailoverGroupListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page InstanceFailoverGroupListResultPage) NotDone() bool { - return !page.ifglr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page InstanceFailoverGroupListResultPage) Response() InstanceFailoverGroupListResult { - return page.ifglr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page InstanceFailoverGroupListResultPage) Values() []InstanceFailoverGroup { - if page.ifglr.IsEmpty() { - return nil - } - return *page.ifglr.Value -} - -// Creates a new instance of the InstanceFailoverGroupListResultPage type. -func NewInstanceFailoverGroupListResultPage(getNextPage func(context.Context, InstanceFailoverGroupListResult) (InstanceFailoverGroupListResult, error)) InstanceFailoverGroupListResultPage { - return InstanceFailoverGroupListResultPage{fn: getNextPage} -} - -// InstanceFailoverGroupProperties properties of a instance failover group. -type InstanceFailoverGroupProperties struct { - // ReadWriteEndpoint - Read-write endpoint of the failover group instance. - ReadWriteEndpoint *InstanceFailoverGroupReadWriteEndpoint `json:"readWriteEndpoint,omitempty"` - // ReadOnlyEndpoint - Read-only endpoint of the failover group instance. - ReadOnlyEndpoint *InstanceFailoverGroupReadOnlyEndpoint `json:"readOnlyEndpoint,omitempty"` - // ReplicationRole - READ-ONLY; Local replication role of the failover group instance. Possible values include: 'InstanceFailoverGroupReplicationRolePrimary', 'InstanceFailoverGroupReplicationRoleSecondary' - ReplicationRole InstanceFailoverGroupReplicationRole `json:"replicationRole,omitempty"` - // ReplicationState - READ-ONLY; Replication state of the failover group instance. - ReplicationState *string `json:"replicationState,omitempty"` - // PartnerRegions - Partner region information for the failover group. - PartnerRegions *[]PartnerRegionInfo `json:"partnerRegions,omitempty"` - // ManagedInstancePairs - List of managed instance pairs in the failover group. - ManagedInstancePairs *[]ManagedInstancePairInfo `json:"managedInstancePairs,omitempty"` -} - -// InstanceFailoverGroupReadOnlyEndpoint read-only endpoint of the failover group instance. -type InstanceFailoverGroupReadOnlyEndpoint struct { - // FailoverPolicy - Failover policy of the read-only endpoint for the failover group. Possible values include: 'ReadOnlyEndpointFailoverPolicyDisabled', 'ReadOnlyEndpointFailoverPolicyEnabled' - FailoverPolicy ReadOnlyEndpointFailoverPolicy `json:"failoverPolicy,omitempty"` -} - -// InstanceFailoverGroupReadWriteEndpoint read-write endpoint of the failover group instance. -type InstanceFailoverGroupReadWriteEndpoint struct { - // FailoverPolicy - Failover policy of the read-write endpoint for the failover group. If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible values include: 'Manual', 'Automatic' - FailoverPolicy ReadWriteEndpointFailoverPolicy `json:"failoverPolicy,omitempty"` - // FailoverWithDataLossGracePeriodMinutes - Grace period before failover with data loss is attempted for the read-write endpoint. If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required. - FailoverWithDataLossGracePeriodMinutes *int32 `json:"failoverWithDataLossGracePeriodMinutes,omitempty"` -} - -// InstanceFailoverGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type InstanceFailoverGroupsCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *InstanceFailoverGroupsCreateOrUpdateFuture) Result(client InstanceFailoverGroupsClient) (ifg InstanceFailoverGroup, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.InstanceFailoverGroupsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ifg.Response.Response, err = future.GetResult(sender); err == nil && ifg.Response.Response.StatusCode != http.StatusNoContent { - ifg, err = client.CreateOrUpdateResponder(ifg.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsCreateOrUpdateFuture", "Result", ifg.Response.Response, "Failure responding to request") - } - } - return -} - -// InstanceFailoverGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type InstanceFailoverGroupsDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *InstanceFailoverGroupsDeleteFuture) Result(client InstanceFailoverGroupsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.InstanceFailoverGroupsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// InstanceFailoverGroupsFailoverFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type InstanceFailoverGroupsFailoverFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *InstanceFailoverGroupsFailoverFuture) Result(client InstanceFailoverGroupsClient) (ifg InstanceFailoverGroup, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsFailoverFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.InstanceFailoverGroupsFailoverFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ifg.Response.Response, err = future.GetResult(sender); err == nil && ifg.Response.Response.StatusCode != http.StatusNoContent { - ifg, err = client.FailoverResponder(ifg.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsFailoverFuture", "Result", ifg.Response.Response, "Failure responding to request") - } - } - return -} - -// InstanceFailoverGroupsForceFailoverAllowDataLossFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type InstanceFailoverGroupsForceFailoverAllowDataLossFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *InstanceFailoverGroupsForceFailoverAllowDataLossFuture) Result(client InstanceFailoverGroupsClient) (ifg InstanceFailoverGroup, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsForceFailoverAllowDataLossFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.InstanceFailoverGroupsForceFailoverAllowDataLossFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ifg.Response.Response, err = future.GetResult(sender); err == nil && ifg.Response.Response.StatusCode != http.StatusNoContent { - ifg, err = client.ForceFailoverAllowDataLossResponder(ifg.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsForceFailoverAllowDataLossFuture", "Result", ifg.Response.Response, "Failure responding to request") - } - } - return -} - -// InstancePool an Azure SQL instance pool. -type InstancePool struct { - autorest.Response `json:"-"` - // Sku - The name and tier of the SKU. - Sku *Sku `json:"sku,omitempty"` - // InstancePoolProperties - Resource properties. - *InstancePoolProperties `json:"properties,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for InstancePool. -func (IP InstancePool) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if IP.Sku != nil { - objectMap["sku"] = IP.Sku - } - if IP.InstancePoolProperties != nil { - objectMap["properties"] = IP.InstancePoolProperties - } - if IP.Location != nil { - objectMap["location"] = IP.Location - } - if IP.Tags != nil { - objectMap["tags"] = IP.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for InstancePool struct. -func (IP *InstancePool) UnmarshalJSON(body []byte) error { - 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 - } - IP.Sku = &sku - } - case "properties": - if v != nil { - var instancePoolProperties InstancePoolProperties - err = json.Unmarshal(*v, &instancePoolProperties) - if err != nil { - return err - } - IP.InstancePoolProperties = &instancePoolProperties - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - IP.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - IP.Tags = tags - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - IP.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - IP.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - IP.Type = &typeVar - } - } - } - - return nil -} - -// InstancePoolListResult a list of Azure SQL instance pools. -type InstancePoolListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]InstancePool `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// InstancePoolListResultIterator provides access to a complete listing of InstancePool values. -type InstancePoolListResultIterator struct { - i int - page InstancePoolListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *InstancePoolListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InstancePoolListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *InstancePoolListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter InstancePoolListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter InstancePoolListResultIterator) Response() InstancePoolListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter InstancePoolListResultIterator) Value() InstancePool { - if !iter.page.NotDone() { - return InstancePool{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the InstancePoolListResultIterator type. -func NewInstancePoolListResultIterator(page InstancePoolListResultPage) InstancePoolListResultIterator { - return InstancePoolListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (iplr InstancePoolListResult) IsEmpty() bool { - return iplr.Value == nil || len(*iplr.Value) == 0 -} - -// instancePoolListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (iplr InstancePoolListResult) instancePoolListResultPreparer(ctx context.Context) (*http.Request, error) { - if iplr.NextLink == nil || len(to.String(iplr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(iplr.NextLink))) -} - -// InstancePoolListResultPage contains a page of InstancePool values. -type InstancePoolListResultPage struct { - fn func(context.Context, InstancePoolListResult) (InstancePoolListResult, error) - iplr InstancePoolListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *InstancePoolListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InstancePoolListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - next, err := page.fn(ctx, page.iplr) - if err != nil { - return err - } - page.iplr = next - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *InstancePoolListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page InstancePoolListResultPage) NotDone() bool { - return !page.iplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page InstancePoolListResultPage) Response() InstancePoolListResult { - return page.iplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page InstancePoolListResultPage) Values() []InstancePool { - if page.iplr.IsEmpty() { - return nil - } - return *page.iplr.Value -} - -// Creates a new instance of the InstancePoolListResultPage type. -func NewInstancePoolListResultPage(getNextPage func(context.Context, InstancePoolListResult) (InstancePoolListResult, error)) InstancePoolListResultPage { - return InstancePoolListResultPage{fn: getNextPage} -} - -// InstancePoolProperties properties of an instance pool. -type InstancePoolProperties struct { - // SubnetID - Resource ID of the subnet to place this instance pool in. - SubnetID *string `json:"subnetId,omitempty"` - // VCores - Count of vCores belonging to this instance pool. - VCores *int32 `json:"vCores,omitempty"` - // LicenseType - The license type. Possible values are 'LicenseIncluded' (price for SQL license is included) and 'BasePrice' (without SQL license price). Possible values include: 'InstancePoolLicenseTypeLicenseIncluded', 'InstancePoolLicenseTypeBasePrice' - LicenseType InstancePoolLicenseType `json:"licenseType,omitempty"` -} - -// InstancePoolsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type InstancePoolsCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *InstancePoolsCreateOrUpdateFuture) Result(client InstancePoolsClient) (IP InstancePool, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.InstancePoolsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.InstancePoolsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if IP.Response.Response, err = future.GetResult(sender); err == nil && IP.Response.Response.StatusCode != http.StatusNoContent { - IP, err = client.CreateOrUpdateResponder(IP.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.InstancePoolsCreateOrUpdateFuture", "Result", IP.Response.Response, "Failure responding to request") - } - } - return -} - -// InstancePoolsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type InstancePoolsDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *InstancePoolsDeleteFuture) Result(client InstancePoolsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.InstancePoolsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.InstancePoolsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// InstancePoolsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type InstancePoolsUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *InstancePoolsUpdateFuture) Result(client InstancePoolsClient) (IP InstancePool, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.InstancePoolsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.InstancePoolsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if IP.Response.Response, err = future.GetResult(sender); err == nil && IP.Response.Response.StatusCode != http.StatusNoContent { - IP, err = client.UpdateResponder(IP.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.InstancePoolsUpdateFuture", "Result", IP.Response.Response, "Failure responding to request") - } - } - return -} - -// InstancePoolUpdate an update to an Instance pool. -type InstancePoolUpdate struct { - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for InstancePoolUpdate. -func (ipu InstancePoolUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ipu.Tags != nil { - objectMap["tags"] = ipu.Tags - } - return json.Marshal(objectMap) -} - -// Job a job. -type Job struct { - autorest.Response `json:"-"` - // JobProperties - Resource properties. - *JobProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for Job. -func (j Job) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if j.JobProperties != nil { - objectMap["properties"] = j.JobProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Job struct. -func (j *Job) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var jobProperties JobProperties - err = json.Unmarshal(*v, &jobProperties) - if err != nil { - return err - } - j.JobProperties = &jobProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - j.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - j.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - j.Type = &typeVar - } - } - } - - return nil -} - -// JobAgent an Azure SQL job agent. -type JobAgent struct { - autorest.Response `json:"-"` - // Sku - The name and tier of the SKU. - Sku *Sku `json:"sku,omitempty"` - // JobAgentProperties - Resource properties. - *JobAgentProperties `json:"properties,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for JobAgent. -func (ja JobAgent) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ja.Sku != nil { - objectMap["sku"] = ja.Sku - } - if ja.JobAgentProperties != nil { - objectMap["properties"] = ja.JobAgentProperties - } - if ja.Location != nil { - objectMap["location"] = ja.Location - } - if ja.Tags != nil { - objectMap["tags"] = ja.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for JobAgent struct. -func (ja *JobAgent) UnmarshalJSON(body []byte) error { - 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 - } - ja.Sku = &sku - } - case "properties": - if v != nil { - var jobAgentProperties JobAgentProperties - err = json.Unmarshal(*v, &jobAgentProperties) - if err != nil { - return err - } - ja.JobAgentProperties = &jobAgentProperties - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - ja.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - ja.Tags = tags - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ja.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ja.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ja.Type = &typeVar - } - } - } - - return nil -} - -// JobAgentListResult a list of Azure SQL job agents. -type JobAgentListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]JobAgent `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// JobAgentListResultIterator provides access to a complete listing of JobAgent values. -type JobAgentListResultIterator struct { - i int - page JobAgentListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *JobAgentListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobAgentListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *JobAgentListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter JobAgentListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter JobAgentListResultIterator) Response() JobAgentListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter JobAgentListResultIterator) Value() JobAgent { - if !iter.page.NotDone() { - return JobAgent{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the JobAgentListResultIterator type. -func NewJobAgentListResultIterator(page JobAgentListResultPage) JobAgentListResultIterator { - return JobAgentListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (jalr JobAgentListResult) IsEmpty() bool { - return jalr.Value == nil || len(*jalr.Value) == 0 -} - -// jobAgentListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (jalr JobAgentListResult) jobAgentListResultPreparer(ctx context.Context) (*http.Request, error) { - if jalr.NextLink == nil || len(to.String(jalr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(jalr.NextLink))) -} - -// JobAgentListResultPage contains a page of JobAgent values. -type JobAgentListResultPage struct { - fn func(context.Context, JobAgentListResult) (JobAgentListResult, error) - jalr JobAgentListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *JobAgentListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobAgentListResultPage.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.jalr) - if err != nil { - return err - } - page.jalr = 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 *JobAgentListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page JobAgentListResultPage) NotDone() bool { - return !page.jalr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page JobAgentListResultPage) Response() JobAgentListResult { - return page.jalr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page JobAgentListResultPage) Values() []JobAgent { - if page.jalr.IsEmpty() { - return nil - } - return *page.jalr.Value -} - -// Creates a new instance of the JobAgentListResultPage type. -func NewJobAgentListResultPage(getNextPage func(context.Context, JobAgentListResult) (JobAgentListResult, error)) JobAgentListResultPage { - return JobAgentListResultPage{fn: getNextPage} -} - -// JobAgentProperties properties of a job agent. -type JobAgentProperties struct { - // DatabaseID - Resource ID of the database to store job metadata in. - DatabaseID *string `json:"databaseId,omitempty"` - // State - READ-ONLY; The state of the job agent. Possible values include: 'JobAgentStateCreating', 'JobAgentStateReady', 'JobAgentStateUpdating', 'JobAgentStateDeleting', 'JobAgentStateDisabled' - State JobAgentState `json:"state,omitempty"` -} - -// JobAgentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type JobAgentsCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *JobAgentsCreateOrUpdateFuture) Result(client JobAgentsClient) (ja JobAgent, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobAgentsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.JobAgentsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ja.Response.Response, err = future.GetResult(sender); err == nil && ja.Response.Response.StatusCode != http.StatusNoContent { - ja, err = client.CreateOrUpdateResponder(ja.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobAgentsCreateOrUpdateFuture", "Result", ja.Response.Response, "Failure responding to request") - } - } - return -} - -// JobAgentsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type JobAgentsDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *JobAgentsDeleteFuture) Result(client JobAgentsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobAgentsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.JobAgentsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// JobAgentsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type JobAgentsUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *JobAgentsUpdateFuture) Result(client JobAgentsClient) (ja JobAgent, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobAgentsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.JobAgentsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ja.Response.Response, err = future.GetResult(sender); err == nil && ja.Response.Response.StatusCode != http.StatusNoContent { - ja, err = client.UpdateResponder(ja.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobAgentsUpdateFuture", "Result", ja.Response.Response, "Failure responding to request") - } - } - return -} - -// JobAgentUpdate an update to an Azure SQL job agent. -type JobAgentUpdate struct { - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for JobAgentUpdate. -func (jau JobAgentUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if jau.Tags != nil { - objectMap["tags"] = jau.Tags - } - return json.Marshal(objectMap) -} - -// JobCredential a stored credential that can be used by a job to connect to target databases. -type JobCredential struct { - autorest.Response `json:"-"` - // JobCredentialProperties - Resource properties. - *JobCredentialProperties `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 JobCredential. -func (jc JobCredential) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if jc.JobCredentialProperties != nil { - objectMap["properties"] = jc.JobCredentialProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for JobCredential struct. -func (jc *JobCredential) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var jobCredentialProperties JobCredentialProperties - err = json.Unmarshal(*v, &jobCredentialProperties) - if err != nil { - return err - } - jc.JobCredentialProperties = &jobCredentialProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - jc.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - jc.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - jc.Type = &typeVar - } - } - } - - return nil -} - -// JobCredentialListResult a list of job credentials. -type JobCredentialListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]JobCredential `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// JobCredentialListResultIterator provides access to a complete listing of JobCredential values. -type JobCredentialListResultIterator struct { - i int - page JobCredentialListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *JobCredentialListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobCredentialListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *JobCredentialListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter JobCredentialListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter JobCredentialListResultIterator) Response() JobCredentialListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter JobCredentialListResultIterator) Value() JobCredential { - if !iter.page.NotDone() { - return JobCredential{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the JobCredentialListResultIterator type. -func NewJobCredentialListResultIterator(page JobCredentialListResultPage) JobCredentialListResultIterator { - return JobCredentialListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (jclr JobCredentialListResult) IsEmpty() bool { - return jclr.Value == nil || len(*jclr.Value) == 0 -} - -// jobCredentialListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (jclr JobCredentialListResult) jobCredentialListResultPreparer(ctx context.Context) (*http.Request, error) { - if jclr.NextLink == nil || len(to.String(jclr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(jclr.NextLink))) -} - -// JobCredentialListResultPage contains a page of JobCredential values. -type JobCredentialListResultPage struct { - fn func(context.Context, JobCredentialListResult) (JobCredentialListResult, error) - jclr JobCredentialListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *JobCredentialListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobCredentialListResultPage.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.jclr) - if err != nil { - return err - } - page.jclr = 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 *JobCredentialListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page JobCredentialListResultPage) NotDone() bool { - return !page.jclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page JobCredentialListResultPage) Response() JobCredentialListResult { - return page.jclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page JobCredentialListResultPage) Values() []JobCredential { - if page.jclr.IsEmpty() { - return nil - } - return *page.jclr.Value -} - -// Creates a new instance of the JobCredentialListResultPage type. -func NewJobCredentialListResultPage(getNextPage func(context.Context, JobCredentialListResult) (JobCredentialListResult, error)) JobCredentialListResultPage { - return JobCredentialListResultPage{fn: getNextPage} -} - -// JobCredentialProperties properties of a job credential. -type JobCredentialProperties struct { - // Username - The credential user name. - Username *string `json:"username,omitempty"` - // Password - The credential password. - Password *string `json:"password,omitempty"` -} - -// JobExecution an execution of a job -type JobExecution struct { - autorest.Response `json:"-"` - // JobExecutionProperties - Resource properties. - *JobExecutionProperties `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 JobExecution. -func (je JobExecution) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if je.JobExecutionProperties != nil { - objectMap["properties"] = je.JobExecutionProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for JobExecution struct. -func (je *JobExecution) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var jobExecutionProperties JobExecutionProperties - err = json.Unmarshal(*v, &jobExecutionProperties) - if err != nil { - return err - } - je.JobExecutionProperties = &jobExecutionProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - je.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - je.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - je.Type = &typeVar - } - } - } - - return nil -} - -// JobExecutionListResult a list of job executions. -type JobExecutionListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]JobExecution `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// JobExecutionListResultIterator provides access to a complete listing of JobExecution values. -type JobExecutionListResultIterator struct { - i int - page JobExecutionListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *JobExecutionListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobExecutionListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *JobExecutionListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter JobExecutionListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter JobExecutionListResultIterator) Response() JobExecutionListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter JobExecutionListResultIterator) Value() JobExecution { - if !iter.page.NotDone() { - return JobExecution{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the JobExecutionListResultIterator type. -func NewJobExecutionListResultIterator(page JobExecutionListResultPage) JobExecutionListResultIterator { - return JobExecutionListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (jelr JobExecutionListResult) IsEmpty() bool { - return jelr.Value == nil || len(*jelr.Value) == 0 -} - -// jobExecutionListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (jelr JobExecutionListResult) jobExecutionListResultPreparer(ctx context.Context) (*http.Request, error) { - if jelr.NextLink == nil || len(to.String(jelr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(jelr.NextLink))) -} - -// JobExecutionListResultPage contains a page of JobExecution values. -type JobExecutionListResultPage struct { - fn func(context.Context, JobExecutionListResult) (JobExecutionListResult, error) - jelr JobExecutionListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *JobExecutionListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobExecutionListResultPage.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.jelr) - if err != nil { - return err - } - page.jelr = 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 *JobExecutionListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page JobExecutionListResultPage) NotDone() bool { - return !page.jelr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page JobExecutionListResultPage) Response() JobExecutionListResult { - return page.jelr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page JobExecutionListResultPage) Values() []JobExecution { - if page.jelr.IsEmpty() { - return nil - } - return *page.jelr.Value -} - -// Creates a new instance of the JobExecutionListResultPage type. -func NewJobExecutionListResultPage(getNextPage func(context.Context, JobExecutionListResult) (JobExecutionListResult, error)) JobExecutionListResultPage { - return JobExecutionListResultPage{fn: getNextPage} -} - -// JobExecutionProperties properties for an Azure SQL Database Elastic job execution. -type JobExecutionProperties struct { - // JobVersion - READ-ONLY; The job version number. - JobVersion *int32 `json:"jobVersion,omitempty"` - // StepName - READ-ONLY; The job step name. - StepName *string `json:"stepName,omitempty"` - // StepID - READ-ONLY; The job step id. - StepID *int32 `json:"stepId,omitempty"` - // JobExecutionID - READ-ONLY; The unique identifier of the job execution. - JobExecutionID *uuid.UUID `json:"jobExecutionId,omitempty"` - // Lifecycle - READ-ONLY; The detailed state of the job execution. Possible values include: 'Created', 'InProgress', 'WaitingForChildJobExecutions', 'WaitingForRetry', 'Succeeded', 'SucceededWithSkipped', 'Failed', 'TimedOut', 'Canceled', 'Skipped' - Lifecycle JobExecutionLifecycle `json:"lifecycle,omitempty"` - // ProvisioningState - READ-ONLY; The ARM provisioning state of the job execution. Possible values include: 'ProvisioningStateCreated', 'ProvisioningStateInProgress', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // CreateTime - READ-ONLY; The time that the job execution was created. - CreateTime *date.Time `json:"createTime,omitempty"` - // StartTime - READ-ONLY; The time that the job execution started. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - READ-ONLY; The time that the job execution completed. - EndTime *date.Time `json:"endTime,omitempty"` - // CurrentAttempts - Number of times the job execution has been attempted. - CurrentAttempts *int32 `json:"currentAttempts,omitempty"` - // CurrentAttemptStartTime - READ-ONLY; Start time of the current attempt. - CurrentAttemptStartTime *date.Time `json:"currentAttemptStartTime,omitempty"` - // LastMessage - READ-ONLY; The last status or error message. - LastMessage *string `json:"lastMessage,omitempty"` - // Target - READ-ONLY; The target that this execution is executed on. - Target *JobExecutionTarget `json:"target,omitempty"` -} - -// JobExecutionsCreateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type JobExecutionsCreateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *JobExecutionsCreateFuture) Result(client JobExecutionsClient) (je JobExecution, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobExecutionsCreateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.JobExecutionsCreateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if je.Response.Response, err = future.GetResult(sender); err == nil && je.Response.Response.StatusCode != http.StatusNoContent { - je, err = client.CreateResponder(je.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobExecutionsCreateFuture", "Result", je.Response.Response, "Failure responding to request") - } - } - return -} - -// JobExecutionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type JobExecutionsCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *JobExecutionsCreateOrUpdateFuture) Result(client JobExecutionsClient) (je JobExecution, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobExecutionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.JobExecutionsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if je.Response.Response, err = future.GetResult(sender); err == nil && je.Response.Response.StatusCode != http.StatusNoContent { - je, err = client.CreateOrUpdateResponder(je.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.JobExecutionsCreateOrUpdateFuture", "Result", je.Response.Response, "Failure responding to request") - } - } - return -} - -// JobExecutionTarget the target that a job execution is executed on. -type JobExecutionTarget struct { - // Type - READ-ONLY; The type of the target. Possible values include: 'JobTargetTypeTargetGroup', 'JobTargetTypeSQLDatabase', 'JobTargetTypeSQLElasticPool', 'JobTargetTypeSQLShardMap', 'JobTargetTypeSQLServer' - Type JobTargetType `json:"type,omitempty"` - // ServerName - READ-ONLY; The server name. - ServerName *string `json:"serverName,omitempty"` - // DatabaseName - READ-ONLY; The database name. - DatabaseName *string `json:"databaseName,omitempty"` -} - -// JobListResult a list of jobs. -type JobListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]Job `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// JobListResultIterator provides access to a complete listing of Job values. -type JobListResultIterator struct { - i int - page JobListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *JobListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *JobListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter JobListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter JobListResultIterator) Response() JobListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter JobListResultIterator) Value() Job { - if !iter.page.NotDone() { - return Job{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the JobListResultIterator type. -func NewJobListResultIterator(page JobListResultPage) JobListResultIterator { - return JobListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (jlr JobListResult) IsEmpty() bool { - return jlr.Value == nil || len(*jlr.Value) == 0 -} - -// jobListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (jlr JobListResult) jobListResultPreparer(ctx context.Context) (*http.Request, error) { - if jlr.NextLink == nil || len(to.String(jlr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(jlr.NextLink))) -} - -// JobListResultPage contains a page of Job values. -type JobListResultPage struct { - fn func(context.Context, JobListResult) (JobListResult, error) - jlr JobListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *JobListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobListResultPage.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.jlr) - if err != nil { - return err - } - page.jlr = 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 *JobListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page JobListResultPage) NotDone() bool { - return !page.jlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page JobListResultPage) Response() JobListResult { - return page.jlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page JobListResultPage) Values() []Job { - if page.jlr.IsEmpty() { - return nil - } - return *page.jlr.Value -} - -// Creates a new instance of the JobListResultPage type. -func NewJobListResultPage(getNextPage func(context.Context, JobListResult) (JobListResult, error)) JobListResultPage { - return JobListResultPage{fn: getNextPage} -} - -// JobProperties properties of a job. -type JobProperties struct { - // Description - User-defined description of the job. - Description *string `json:"description,omitempty"` - // Version - READ-ONLY; The job version number. - Version *int32 `json:"version,omitempty"` - // Schedule - Schedule properties of the job. - Schedule *JobSchedule `json:"schedule,omitempty"` -} - -// JobSchedule scheduling properties of a job. -type JobSchedule struct { - // StartTime - Schedule start time. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - Schedule end time. - EndTime *date.Time `json:"endTime,omitempty"` - // Type - Schedule interval type. Possible values include: 'Once', 'Recurring' - Type JobScheduleType `json:"type,omitempty"` - // Enabled - Whether or not the schedule is enabled. - Enabled *bool `json:"enabled,omitempty"` - // Interval - Value of the schedule's recurring interval, if the schedule type is recurring. ISO8601 duration format. - Interval *string `json:"interval,omitempty"` -} - -// JobStep a job step. -type JobStep struct { - autorest.Response `json:"-"` - // JobStepProperties - Resource properties. - *JobStepProperties `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 JobStep. -func (js JobStep) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if js.JobStepProperties != nil { - objectMap["properties"] = js.JobStepProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for JobStep struct. -func (js *JobStep) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var jobStepProperties JobStepProperties - err = json.Unmarshal(*v, &jobStepProperties) - if err != nil { - return err - } - js.JobStepProperties = &jobStepProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - js.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - js.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - js.Type = &typeVar - } - } - } - - return nil -} - -// JobStepAction the action to be executed by a job step. -type JobStepAction struct { - // Type - Type of action being executed by the job step. Possible values include: 'TSQL' - Type JobStepActionType `json:"type,omitempty"` - // Source - The source of the action to execute. Possible values include: 'Inline' - Source JobStepActionSource `json:"source,omitempty"` - // Value - The action value, for example the text of the T-SQL script to execute. - Value *string `json:"value,omitempty"` -} - -// JobStepExecutionOptions the execution options of a job step. -type JobStepExecutionOptions struct { - // TimeoutSeconds - Execution timeout for the job step. - TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"` - // RetryAttempts - Maximum number of times the job step will be reattempted if the first attempt fails. - RetryAttempts *int32 `json:"retryAttempts,omitempty"` - // InitialRetryIntervalSeconds - Initial delay between retries for job step execution. - InitialRetryIntervalSeconds *int32 `json:"initialRetryIntervalSeconds,omitempty"` - // MaximumRetryIntervalSeconds - The maximum amount of time to wait between retries for job step execution. - MaximumRetryIntervalSeconds *int32 `json:"maximumRetryIntervalSeconds,omitempty"` - // RetryIntervalBackoffMultiplier - The backoff multiplier for the time between retries. - RetryIntervalBackoffMultiplier *float64 `json:"retryIntervalBackoffMultiplier,omitempty"` -} - -// JobStepListResult a list of job steps. -type JobStepListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]JobStep `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// JobStepListResultIterator provides access to a complete listing of JobStep values. -type JobStepListResultIterator struct { - i int - page JobStepListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *JobStepListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobStepListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *JobStepListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter JobStepListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter JobStepListResultIterator) Response() JobStepListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter JobStepListResultIterator) Value() JobStep { - if !iter.page.NotDone() { - return JobStep{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the JobStepListResultIterator type. -func NewJobStepListResultIterator(page JobStepListResultPage) JobStepListResultIterator { - return JobStepListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (jslr JobStepListResult) IsEmpty() bool { - return jslr.Value == nil || len(*jslr.Value) == 0 -} - -// jobStepListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (jslr JobStepListResult) jobStepListResultPreparer(ctx context.Context) (*http.Request, error) { - if jslr.NextLink == nil || len(to.String(jslr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(jslr.NextLink))) -} - -// JobStepListResultPage contains a page of JobStep values. -type JobStepListResultPage struct { - fn func(context.Context, JobStepListResult) (JobStepListResult, error) - jslr JobStepListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *JobStepListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobStepListResultPage.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.jslr) - if err != nil { - return err - } - page.jslr = 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 *JobStepListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page JobStepListResultPage) NotDone() bool { - return !page.jslr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page JobStepListResultPage) Response() JobStepListResult { - return page.jslr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page JobStepListResultPage) Values() []JobStep { - if page.jslr.IsEmpty() { - return nil - } - return *page.jslr.Value -} - -// Creates a new instance of the JobStepListResultPage type. -func NewJobStepListResultPage(getNextPage func(context.Context, JobStepListResult) (JobStepListResult, error)) JobStepListResultPage { - return JobStepListResultPage{fn: getNextPage} -} - -// JobStepOutput the output configuration of a job step. -type JobStepOutput struct { - // Type - The output destination type. Possible values include: 'SQLDatabase' - Type JobStepOutputType `json:"type,omitempty"` - // SubscriptionID - The output destination subscription id. - SubscriptionID *uuid.UUID `json:"subscriptionId,omitempty"` - // ResourceGroupName - The output destination resource group. - ResourceGroupName *string `json:"resourceGroupName,omitempty"` - // ServerName - The output destination server name. - ServerName *string `json:"serverName,omitempty"` - // DatabaseName - The output destination database. - DatabaseName *string `json:"databaseName,omitempty"` - // SchemaName - The output destination schema. - SchemaName *string `json:"schemaName,omitempty"` - // TableName - The output destination table. - TableName *string `json:"tableName,omitempty"` - // Credential - The resource ID of the credential to use to connect to the output destination. - Credential *string `json:"credential,omitempty"` -} - -// JobStepProperties properties of a job step. -type JobStepProperties struct { - // StepID - The job step's index within the job. If not specified when creating the job step, it will be created as the last step. If not specified when updating the job step, the step id is not modified. - StepID *int32 `json:"stepId,omitempty"` - // TargetGroup - The resource ID of the target group that the job step will be executed on. - TargetGroup *string `json:"targetGroup,omitempty"` - // Credential - The resource ID of the job credential that will be used to connect to the targets. - Credential *string `json:"credential,omitempty"` - // Action - The action payload of the job step. - Action *JobStepAction `json:"action,omitempty"` - // Output - Output destination properties of the job step. - Output *JobStepOutput `json:"output,omitempty"` - // ExecutionOptions - Execution options for the job step. - ExecutionOptions *JobStepExecutionOptions `json:"executionOptions,omitempty"` -} - -// JobTarget a job target, for example a specific database or a container of databases that is evaluated -// during job execution. -type JobTarget struct { - // MembershipType - Whether the target is included or excluded from the group. Possible values include: 'Include', 'Exclude' - MembershipType JobTargetGroupMembershipType `json:"membershipType,omitempty"` - // Type - The target type. Possible values include: 'JobTargetTypeTargetGroup', 'JobTargetTypeSQLDatabase', 'JobTargetTypeSQLElasticPool', 'JobTargetTypeSQLShardMap', 'JobTargetTypeSQLServer' - Type JobTargetType `json:"type,omitempty"` - // ServerName - The target server name. - ServerName *string `json:"serverName,omitempty"` - // DatabaseName - The target database name. - DatabaseName *string `json:"databaseName,omitempty"` - // ElasticPoolName - The target elastic pool name. - ElasticPoolName *string `json:"elasticPoolName,omitempty"` - // ShardMapName - The target shard map. - ShardMapName *string `json:"shardMapName,omitempty"` - // RefreshCredential - The resource ID of the credential that is used during job execution to connect to the target and determine the list of databases inside the target. - RefreshCredential *string `json:"refreshCredential,omitempty"` -} - -// JobTargetGroup a group of job targets. -type JobTargetGroup struct { - autorest.Response `json:"-"` - // JobTargetGroupProperties - Resource properties. - *JobTargetGroupProperties `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 JobTargetGroup. -func (jtg JobTargetGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if jtg.JobTargetGroupProperties != nil { - objectMap["properties"] = jtg.JobTargetGroupProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for JobTargetGroup struct. -func (jtg *JobTargetGroup) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var jobTargetGroupProperties JobTargetGroupProperties - err = json.Unmarshal(*v, &jobTargetGroupProperties) - if err != nil { - return err - } - jtg.JobTargetGroupProperties = &jobTargetGroupProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - jtg.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - jtg.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - jtg.Type = &typeVar - } - } - } - - return nil -} - -// JobTargetGroupListResult a list of target groups. -type JobTargetGroupListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]JobTargetGroup `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// JobTargetGroupListResultIterator provides access to a complete listing of JobTargetGroup values. -type JobTargetGroupListResultIterator struct { - i int - page JobTargetGroupListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *JobTargetGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobTargetGroupListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *JobTargetGroupListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter JobTargetGroupListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter JobTargetGroupListResultIterator) Response() JobTargetGroupListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter JobTargetGroupListResultIterator) Value() JobTargetGroup { - if !iter.page.NotDone() { - return JobTargetGroup{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the JobTargetGroupListResultIterator type. -func NewJobTargetGroupListResultIterator(page JobTargetGroupListResultPage) JobTargetGroupListResultIterator { - return JobTargetGroupListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (jtglr JobTargetGroupListResult) IsEmpty() bool { - return jtglr.Value == nil || len(*jtglr.Value) == 0 -} - -// jobTargetGroupListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (jtglr JobTargetGroupListResult) jobTargetGroupListResultPreparer(ctx context.Context) (*http.Request, error) { - if jtglr.NextLink == nil || len(to.String(jtglr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(jtglr.NextLink))) -} - -// JobTargetGroupListResultPage contains a page of JobTargetGroup values. -type JobTargetGroupListResultPage struct { - fn func(context.Context, JobTargetGroupListResult) (JobTargetGroupListResult, error) - jtglr JobTargetGroupListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *JobTargetGroupListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobTargetGroupListResultPage.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.jtglr) - if err != nil { - return err - } - page.jtglr = 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 *JobTargetGroupListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page JobTargetGroupListResultPage) NotDone() bool { - return !page.jtglr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page JobTargetGroupListResultPage) Response() JobTargetGroupListResult { - return page.jtglr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page JobTargetGroupListResultPage) Values() []JobTargetGroup { - if page.jtglr.IsEmpty() { - return nil - } - return *page.jtglr.Value -} - -// Creates a new instance of the JobTargetGroupListResultPage type. -func NewJobTargetGroupListResultPage(getNextPage func(context.Context, JobTargetGroupListResult) (JobTargetGroupListResult, error)) JobTargetGroupListResultPage { - return JobTargetGroupListResultPage{fn: getNextPage} -} - -// JobTargetGroupProperties properties of job target group. -type JobTargetGroupProperties struct { - // Members - Members of the target group. - Members *[]JobTarget `json:"members,omitempty"` -} - -// JobVersion a job version. -type JobVersion 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"` -} - -// JobVersionListResult a list of job versions. -type JobVersionListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]JobVersion `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// JobVersionListResultIterator provides access to a complete listing of JobVersion values. -type JobVersionListResultIterator struct { - i int - page JobVersionListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *JobVersionListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobVersionListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *JobVersionListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter JobVersionListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter JobVersionListResultIterator) Response() JobVersionListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter JobVersionListResultIterator) Value() JobVersion { - if !iter.page.NotDone() { - return JobVersion{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the JobVersionListResultIterator type. -func NewJobVersionListResultIterator(page JobVersionListResultPage) JobVersionListResultIterator { - return JobVersionListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (jvlr JobVersionListResult) IsEmpty() bool { - return jvlr.Value == nil || len(*jvlr.Value) == 0 -} - -// jobVersionListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (jvlr JobVersionListResult) jobVersionListResultPreparer(ctx context.Context) (*http.Request, error) { - if jvlr.NextLink == nil || len(to.String(jvlr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(jvlr.NextLink))) -} - -// JobVersionListResultPage contains a page of JobVersion values. -type JobVersionListResultPage struct { - fn func(context.Context, JobVersionListResult) (JobVersionListResult, error) - jvlr JobVersionListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *JobVersionListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobVersionListResultPage.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.jvlr) - if err != nil { - return err - } - page.jvlr = 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 *JobVersionListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page JobVersionListResultPage) NotDone() bool { - return !page.jvlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page JobVersionListResultPage) Response() JobVersionListResult { - return page.jvlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page JobVersionListResultPage) Values() []JobVersion { - if page.jvlr.IsEmpty() { - return nil - } - return *page.jvlr.Value -} - -// Creates a new instance of the JobVersionListResultPage type. -func NewJobVersionListResultPage(getNextPage func(context.Context, JobVersionListResult) (JobVersionListResult, error)) JobVersionListResultPage { - return JobVersionListResultPage{fn: getNextPage} -} - -// LicenseTypeCapability the license type capability -type LicenseTypeCapability struct { - // Name - READ-ONLY; License type identifier. - Name *string `json:"name,omitempty"` - // Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' - Status CapabilityStatus `json:"status,omitempty"` - // Reason - The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` -} - -// LocationCapabilities the location capability. -type LocationCapabilities struct { - autorest.Response `json:"-"` - // Name - READ-ONLY; The location name. - Name *string `json:"name,omitempty"` - // SupportedServerVersions - READ-ONLY; The list of supported server versions. - SupportedServerVersions *[]ServerVersionCapability `json:"supportedServerVersions,omitempty"` - // SupportedManagedInstanceVersions - READ-ONLY; The list of supported managed instance versions. - SupportedManagedInstanceVersions *[]ManagedInstanceVersionCapability `json:"supportedManagedInstanceVersions,omitempty"` - // Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' - Status CapabilityStatus `json:"status,omitempty"` - // Reason - The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` -} - -// LogicalServerSecurityAlertPolicyListResult a list of the server's security alert policies. -type LogicalServerSecurityAlertPolicyListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]ServerSecurityAlertPolicy `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// LogicalServerSecurityAlertPolicyListResultIterator provides access to a complete listing of -// ServerSecurityAlertPolicy values. -type LogicalServerSecurityAlertPolicyListResultIterator struct { - i int - page LogicalServerSecurityAlertPolicyListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *LogicalServerSecurityAlertPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LogicalServerSecurityAlertPolicyListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *LogicalServerSecurityAlertPolicyListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter LogicalServerSecurityAlertPolicyListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter LogicalServerSecurityAlertPolicyListResultIterator) Response() LogicalServerSecurityAlertPolicyListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter LogicalServerSecurityAlertPolicyListResultIterator) Value() ServerSecurityAlertPolicy { - if !iter.page.NotDone() { - return ServerSecurityAlertPolicy{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the LogicalServerSecurityAlertPolicyListResultIterator type. -func NewLogicalServerSecurityAlertPolicyListResultIterator(page LogicalServerSecurityAlertPolicyListResultPage) LogicalServerSecurityAlertPolicyListResultIterator { - return LogicalServerSecurityAlertPolicyListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lssaplr LogicalServerSecurityAlertPolicyListResult) IsEmpty() bool { - return lssaplr.Value == nil || len(*lssaplr.Value) == 0 -} - -// logicalServerSecurityAlertPolicyListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lssaplr LogicalServerSecurityAlertPolicyListResult) logicalServerSecurityAlertPolicyListResultPreparer(ctx context.Context) (*http.Request, error) { - if lssaplr.NextLink == nil || len(to.String(lssaplr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lssaplr.NextLink))) -} - -// LogicalServerSecurityAlertPolicyListResultPage contains a page of ServerSecurityAlertPolicy values. -type LogicalServerSecurityAlertPolicyListResultPage struct { - fn func(context.Context, LogicalServerSecurityAlertPolicyListResult) (LogicalServerSecurityAlertPolicyListResult, error) - lssaplr LogicalServerSecurityAlertPolicyListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *LogicalServerSecurityAlertPolicyListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LogicalServerSecurityAlertPolicyListResultPage.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.lssaplr) - if err != nil { - return err - } - page.lssaplr = 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 *LogicalServerSecurityAlertPolicyListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page LogicalServerSecurityAlertPolicyListResultPage) NotDone() bool { - return !page.lssaplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page LogicalServerSecurityAlertPolicyListResultPage) Response() LogicalServerSecurityAlertPolicyListResult { - return page.lssaplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page LogicalServerSecurityAlertPolicyListResultPage) Values() []ServerSecurityAlertPolicy { - if page.lssaplr.IsEmpty() { - return nil - } - return *page.lssaplr.Value -} - -// Creates a new instance of the LogicalServerSecurityAlertPolicyListResultPage type. -func NewLogicalServerSecurityAlertPolicyListResultPage(getNextPage func(context.Context, LogicalServerSecurityAlertPolicyListResult) (LogicalServerSecurityAlertPolicyListResult, error)) LogicalServerSecurityAlertPolicyListResultPage { - return LogicalServerSecurityAlertPolicyListResultPage{fn: getNextPage} -} - -// LogSizeCapability the log size capability. -type LogSizeCapability struct { - // Limit - READ-ONLY; The log size limit (see 'unit' for the units). - Limit *int32 `json:"limit,omitempty"` - // Unit - READ-ONLY; The units that the limit is expressed in. Possible values include: 'Megabytes', 'Gigabytes', 'Terabytes', 'Petabytes', 'Percent' - Unit LogSizeUnit `json:"unit,omitempty"` -} - -// LongTermRetentionBackup a long term retention backup. -type LongTermRetentionBackup struct { - autorest.Response `json:"-"` - // LongTermRetentionBackupProperties - Resource properties. - *LongTermRetentionBackupProperties `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 LongTermRetentionBackup. -func (ltrb LongTermRetentionBackup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ltrb.LongTermRetentionBackupProperties != nil { - objectMap["properties"] = ltrb.LongTermRetentionBackupProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for LongTermRetentionBackup struct. -func (ltrb *LongTermRetentionBackup) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var longTermRetentionBackupProperties LongTermRetentionBackupProperties - err = json.Unmarshal(*v, &longTermRetentionBackupProperties) - if err != nil { - return err - } - ltrb.LongTermRetentionBackupProperties = &longTermRetentionBackupProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ltrb.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ltrb.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ltrb.Type = &typeVar - } - } - } - - return nil -} - -// LongTermRetentionBackupListResult a list of long term retention backups. -type LongTermRetentionBackupListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]LongTermRetentionBackup `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// LongTermRetentionBackupListResultIterator provides access to a complete listing of -// LongTermRetentionBackup values. -type LongTermRetentionBackupListResultIterator struct { - i int - page LongTermRetentionBackupListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *LongTermRetentionBackupListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *LongTermRetentionBackupListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter LongTermRetentionBackupListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter LongTermRetentionBackupListResultIterator) Response() LongTermRetentionBackupListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter LongTermRetentionBackupListResultIterator) Value() LongTermRetentionBackup { - if !iter.page.NotDone() { - return LongTermRetentionBackup{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the LongTermRetentionBackupListResultIterator type. -func NewLongTermRetentionBackupListResultIterator(page LongTermRetentionBackupListResultPage) LongTermRetentionBackupListResultIterator { - return LongTermRetentionBackupListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (ltrblr LongTermRetentionBackupListResult) IsEmpty() bool { - return ltrblr.Value == nil || len(*ltrblr.Value) == 0 -} - -// longTermRetentionBackupListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ltrblr LongTermRetentionBackupListResult) longTermRetentionBackupListResultPreparer(ctx context.Context) (*http.Request, error) { - if ltrblr.NextLink == nil || len(to.String(ltrblr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ltrblr.NextLink))) -} - -// LongTermRetentionBackupListResultPage contains a page of LongTermRetentionBackup values. -type LongTermRetentionBackupListResultPage struct { - fn func(context.Context, LongTermRetentionBackupListResult) (LongTermRetentionBackupListResult, error) - ltrblr LongTermRetentionBackupListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *LongTermRetentionBackupListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupListResultPage.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.ltrblr) - if err != nil { - return err - } - page.ltrblr = 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 *LongTermRetentionBackupListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page LongTermRetentionBackupListResultPage) NotDone() bool { - return !page.ltrblr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page LongTermRetentionBackupListResultPage) Response() LongTermRetentionBackupListResult { - return page.ltrblr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page LongTermRetentionBackupListResultPage) Values() []LongTermRetentionBackup { - if page.ltrblr.IsEmpty() { - return nil - } - return *page.ltrblr.Value -} - -// Creates a new instance of the LongTermRetentionBackupListResultPage type. -func NewLongTermRetentionBackupListResultPage(getNextPage func(context.Context, LongTermRetentionBackupListResult) (LongTermRetentionBackupListResult, error)) LongTermRetentionBackupListResultPage { - return LongTermRetentionBackupListResultPage{fn: getNextPage} -} - -// LongTermRetentionBackupProperties properties of a long term retention backup -type LongTermRetentionBackupProperties struct { - // ServerName - READ-ONLY; The server name that the backup database belong to. - ServerName *string `json:"serverName,omitempty"` - // ServerCreateTime - READ-ONLY; The create time of the server. - ServerCreateTime *date.Time `json:"serverCreateTime,omitempty"` - // DatabaseName - READ-ONLY; The name of the database the backup belong to - DatabaseName *string `json:"databaseName,omitempty"` - // DatabaseDeletionTime - READ-ONLY; The delete time of the database - DatabaseDeletionTime *date.Time `json:"databaseDeletionTime,omitempty"` - // BackupTime - READ-ONLY; The time the backup was taken - BackupTime *date.Time `json:"backupTime,omitempty"` - // BackupExpirationTime - READ-ONLY; The time the long term retention backup will expire. - BackupExpirationTime *date.Time `json:"backupExpirationTime,omitempty"` -} - -// LongTermRetentionBackupsDeleteByResourceGroupFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type LongTermRetentionBackupsDeleteByResourceGroupFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *LongTermRetentionBackupsDeleteByResourceGroupFuture) Result(client LongTermRetentionBackupsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsDeleteByResourceGroupFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.LongTermRetentionBackupsDeleteByResourceGroupFuture") - return - } - ar.Response = future.Response() - return -} - -// LongTermRetentionBackupsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type LongTermRetentionBackupsDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *LongTermRetentionBackupsDeleteFuture) Result(client LongTermRetentionBackupsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.LongTermRetentionBackupsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// LongTermRetentionPolicyProperties properties of a long term retention policy -type LongTermRetentionPolicyProperties struct { - // WeeklyRetention - The weekly retention policy for an LTR backup in an ISO 8601 format. - WeeklyRetention *string `json:"weeklyRetention,omitempty"` - // MonthlyRetention - The monthly retention policy for an LTR backup in an ISO 8601 format. - MonthlyRetention *string `json:"monthlyRetention,omitempty"` - // YearlyRetention - The yearly retention policy for an LTR backup in an ISO 8601 format. - YearlyRetention *string `json:"yearlyRetention,omitempty"` - // WeekOfYear - The week of year to take the yearly backup in an ISO 8601 format. - WeekOfYear *int32 `json:"weekOfYear,omitempty"` -} - -// ManagedBackupShortTermRetentionPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving -// the results of a long-running operation. -type ManagedBackupShortTermRetentionPoliciesCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ManagedBackupShortTermRetentionPoliciesCreateOrUpdateFuture) Result(client ManagedBackupShortTermRetentionPoliciesClient) (mbstrp ManagedBackupShortTermRetentionPolicy, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedBackupShortTermRetentionPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ManagedBackupShortTermRetentionPoliciesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if mbstrp.Response.Response, err = future.GetResult(sender); err == nil && mbstrp.Response.Response.StatusCode != http.StatusNoContent { - mbstrp, err = client.CreateOrUpdateResponder(mbstrp.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedBackupShortTermRetentionPoliciesCreateOrUpdateFuture", "Result", mbstrp.Response.Response, "Failure responding to request") - } - } - return -} - -// ManagedBackupShortTermRetentionPoliciesUpdateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type ManagedBackupShortTermRetentionPoliciesUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ManagedBackupShortTermRetentionPoliciesUpdateFuture) Result(client ManagedBackupShortTermRetentionPoliciesClient) (mbstrp ManagedBackupShortTermRetentionPolicy, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedBackupShortTermRetentionPoliciesUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ManagedBackupShortTermRetentionPoliciesUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if mbstrp.Response.Response, err = future.GetResult(sender); err == nil && mbstrp.Response.Response.StatusCode != http.StatusNoContent { - mbstrp, err = client.UpdateResponder(mbstrp.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedBackupShortTermRetentionPoliciesUpdateFuture", "Result", mbstrp.Response.Response, "Failure responding to request") - } - } - return -} - -// ManagedBackupShortTermRetentionPolicy a short term retention policy. -type ManagedBackupShortTermRetentionPolicy struct { - autorest.Response `json:"-"` - // ManagedBackupShortTermRetentionPolicyProperties - Resource properties. - *ManagedBackupShortTermRetentionPolicyProperties `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 ManagedBackupShortTermRetentionPolicy. -func (mbstrp ManagedBackupShortTermRetentionPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if mbstrp.ManagedBackupShortTermRetentionPolicyProperties != nil { - objectMap["properties"] = mbstrp.ManagedBackupShortTermRetentionPolicyProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ManagedBackupShortTermRetentionPolicy struct. -func (mbstrp *ManagedBackupShortTermRetentionPolicy) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var managedBackupShortTermRetentionPolicyProperties ManagedBackupShortTermRetentionPolicyProperties - err = json.Unmarshal(*v, &managedBackupShortTermRetentionPolicyProperties) - if err != nil { - return err - } - mbstrp.ManagedBackupShortTermRetentionPolicyProperties = &managedBackupShortTermRetentionPolicyProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - mbstrp.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - mbstrp.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - mbstrp.Type = &typeVar - } - } - } - - return nil -} - -// ManagedBackupShortTermRetentionPolicyListResult a list of short term retention policies. -type ManagedBackupShortTermRetentionPolicyListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]ManagedBackupShortTermRetentionPolicy `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ManagedBackupShortTermRetentionPolicyListResultIterator provides access to a complete listing of -// ManagedBackupShortTermRetentionPolicy values. -type ManagedBackupShortTermRetentionPolicyListResultIterator struct { - i int - page ManagedBackupShortTermRetentionPolicyListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ManagedBackupShortTermRetentionPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedBackupShortTermRetentionPolicyListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ManagedBackupShortTermRetentionPolicyListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ManagedBackupShortTermRetentionPolicyListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ManagedBackupShortTermRetentionPolicyListResultIterator) Response() ManagedBackupShortTermRetentionPolicyListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ManagedBackupShortTermRetentionPolicyListResultIterator) Value() ManagedBackupShortTermRetentionPolicy { - if !iter.page.NotDone() { - return ManagedBackupShortTermRetentionPolicy{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ManagedBackupShortTermRetentionPolicyListResultIterator type. -func NewManagedBackupShortTermRetentionPolicyListResultIterator(page ManagedBackupShortTermRetentionPolicyListResultPage) ManagedBackupShortTermRetentionPolicyListResultIterator { - return ManagedBackupShortTermRetentionPolicyListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (mbstrplr ManagedBackupShortTermRetentionPolicyListResult) IsEmpty() bool { - return mbstrplr.Value == nil || len(*mbstrplr.Value) == 0 -} - -// managedBackupShortTermRetentionPolicyListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (mbstrplr ManagedBackupShortTermRetentionPolicyListResult) managedBackupShortTermRetentionPolicyListResultPreparer(ctx context.Context) (*http.Request, error) { - if mbstrplr.NextLink == nil || len(to.String(mbstrplr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(mbstrplr.NextLink))) -} - -// ManagedBackupShortTermRetentionPolicyListResultPage contains a page of -// ManagedBackupShortTermRetentionPolicy values. -type ManagedBackupShortTermRetentionPolicyListResultPage struct { - fn func(context.Context, ManagedBackupShortTermRetentionPolicyListResult) (ManagedBackupShortTermRetentionPolicyListResult, error) - mbstrplr ManagedBackupShortTermRetentionPolicyListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ManagedBackupShortTermRetentionPolicyListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedBackupShortTermRetentionPolicyListResultPage.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.mbstrplr) - if err != nil { - return err - } - page.mbstrplr = 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 *ManagedBackupShortTermRetentionPolicyListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ManagedBackupShortTermRetentionPolicyListResultPage) NotDone() bool { - return !page.mbstrplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ManagedBackupShortTermRetentionPolicyListResultPage) Response() ManagedBackupShortTermRetentionPolicyListResult { - return page.mbstrplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ManagedBackupShortTermRetentionPolicyListResultPage) Values() []ManagedBackupShortTermRetentionPolicy { - if page.mbstrplr.IsEmpty() { - return nil - } - return *page.mbstrplr.Value -} - -// Creates a new instance of the ManagedBackupShortTermRetentionPolicyListResultPage type. -func NewManagedBackupShortTermRetentionPolicyListResultPage(getNextPage func(context.Context, ManagedBackupShortTermRetentionPolicyListResult) (ManagedBackupShortTermRetentionPolicyListResult, error)) ManagedBackupShortTermRetentionPolicyListResultPage { - return ManagedBackupShortTermRetentionPolicyListResultPage{fn: getNextPage} -} - -// ManagedBackupShortTermRetentionPolicyProperties properties of a short term retention policy -type ManagedBackupShortTermRetentionPolicyProperties struct { - // RetentionDays - The backup retention period in days. This is how many days Point-in-Time Restore will be supported. - RetentionDays *int32 `json:"retentionDays,omitempty"` -} - -// ManagedDatabase a managed database resource. -type ManagedDatabase struct { - autorest.Response `json:"-"` - // ManagedDatabaseProperties - Resource properties. - *ManagedDatabaseProperties `json:"properties,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for ManagedDatabase. -func (md ManagedDatabase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if md.ManagedDatabaseProperties != nil { - objectMap["properties"] = md.ManagedDatabaseProperties - } - if md.Location != nil { - objectMap["location"] = md.Location - } - if md.Tags != nil { - objectMap["tags"] = md.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ManagedDatabase struct. -func (md *ManagedDatabase) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var managedDatabaseProperties ManagedDatabaseProperties - err = json.Unmarshal(*v, &managedDatabaseProperties) - if err != nil { - return err - } - md.ManagedDatabaseProperties = &managedDatabaseProperties - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - md.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - md.Tags = tags - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - md.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - md.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - md.Type = &typeVar - } - } - } - - return nil -} - -// ManagedDatabaseListResult a list of managed databases. -type ManagedDatabaseListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]ManagedDatabase `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ManagedDatabaseListResultIterator provides access to a complete listing of ManagedDatabase values. -type ManagedDatabaseListResultIterator struct { - i int - page ManagedDatabaseListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ManagedDatabaseListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ManagedDatabaseListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ManagedDatabaseListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ManagedDatabaseListResultIterator) Response() ManagedDatabaseListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ManagedDatabaseListResultIterator) Value() ManagedDatabase { - if !iter.page.NotDone() { - return ManagedDatabase{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ManagedDatabaseListResultIterator type. -func NewManagedDatabaseListResultIterator(page ManagedDatabaseListResultPage) ManagedDatabaseListResultIterator { - return ManagedDatabaseListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (mdlr ManagedDatabaseListResult) IsEmpty() bool { - return mdlr.Value == nil || len(*mdlr.Value) == 0 -} - -// managedDatabaseListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (mdlr ManagedDatabaseListResult) managedDatabaseListResultPreparer(ctx context.Context) (*http.Request, error) { - if mdlr.NextLink == nil || len(to.String(mdlr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(mdlr.NextLink))) -} - -// ManagedDatabaseListResultPage contains a page of ManagedDatabase values. -type ManagedDatabaseListResultPage struct { - fn func(context.Context, ManagedDatabaseListResult) (ManagedDatabaseListResult, error) - mdlr ManagedDatabaseListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ManagedDatabaseListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseListResultPage.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.mdlr) - if err != nil { - return err - } - page.mdlr = 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 *ManagedDatabaseListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ManagedDatabaseListResultPage) NotDone() bool { - return !page.mdlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ManagedDatabaseListResultPage) Response() ManagedDatabaseListResult { - return page.mdlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ManagedDatabaseListResultPage) Values() []ManagedDatabase { - if page.mdlr.IsEmpty() { - return nil - } - return *page.mdlr.Value -} - -// Creates a new instance of the ManagedDatabaseListResultPage type. -func NewManagedDatabaseListResultPage(getNextPage func(context.Context, ManagedDatabaseListResult) (ManagedDatabaseListResult, error)) ManagedDatabaseListResultPage { - return ManagedDatabaseListResultPage{fn: getNextPage} -} - -// ManagedDatabaseProperties the managed database's properties. -type ManagedDatabaseProperties struct { - // Collation - Collation of the managed database. - Collation *string `json:"collation,omitempty"` - // Status - READ-ONLY; Status of the database. Possible values include: 'Online', 'Offline', 'Shutdown', 'Creating', 'Inaccessible', 'Restoring', 'Updating' - Status ManagedDatabaseStatus `json:"status,omitempty"` - // CreationDate - READ-ONLY; Creation date of the database. - CreationDate *date.Time `json:"creationDate,omitempty"` - // EarliestRestorePoint - READ-ONLY; Earliest restore point in time for point in time restore. - EarliestRestorePoint *date.Time `json:"earliestRestorePoint,omitempty"` - // RestorePointInTime - Conditional. If createMode is PointInTimeRestore, this value is required. Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. - RestorePointInTime *date.Time `json:"restorePointInTime,omitempty"` - // DefaultSecondaryLocation - READ-ONLY; Geo paired region. - DefaultSecondaryLocation *string `json:"defaultSecondaryLocation,omitempty"` - // CatalogCollation - Collation of the metadata catalog. Possible values include: 'DATABASEDEFAULT', 'SQLLatin1GeneralCP1CIAS' - CatalogCollation CatalogCollationType `json:"catalogCollation,omitempty"` - // CreateMode - Managed database create mode. PointInTimeRestore: Create a database by restoring a point in time backup of an existing database. SourceDatabaseName, SourceManagedInstanceName and PointInTime must be specified. RestoreExternalBackup: Create a database by restoring from external backup files. Collation, StorageContainerUri and StorageContainerSasToken must be specified. Recovery: Creates a database by restoring a geo-replicated backup. RecoverableDatabaseId must be specified as the recoverable database resource ID to restore. Possible values include: 'ManagedDatabaseCreateModeDefault', 'ManagedDatabaseCreateModeRestoreExternalBackup', 'ManagedDatabaseCreateModePointInTimeRestore', 'ManagedDatabaseCreateModeRecovery' - CreateMode ManagedDatabaseCreateMode `json:"createMode,omitempty"` - // StorageContainerURI - Conditional. If createMode is RestoreExternalBackup, this value is required. Specifies the uri of the storage container where backups for this restore are stored. - StorageContainerURI *string `json:"storageContainerUri,omitempty"` - // SourceDatabaseID - The resource identifier of the source database associated with create operation of this database. - SourceDatabaseID *string `json:"sourceDatabaseId,omitempty"` - // RestorableDroppedDatabaseID - The restorable dropped database resource id to restore when creating this database. - RestorableDroppedDatabaseID *string `json:"restorableDroppedDatabaseId,omitempty"` - // StorageContainerSasToken - Conditional. If createMode is RestoreExternalBackup, this value is required. Specifies the storage container sas token. - StorageContainerSasToken *string `json:"storageContainerSasToken,omitempty"` - // FailoverGroupID - READ-ONLY; Instance Failover Group resource identifier that this managed database belongs to. - FailoverGroupID *string `json:"failoverGroupId,omitempty"` - // RecoverableDatabaseID - The resource identifier of the recoverable database associated with create operation of this database. - RecoverableDatabaseID *string `json:"recoverableDatabaseId,omitempty"` -} - -// ManagedDatabaseRestoreDetailsProperties the managed database's restore details properties. -type ManagedDatabaseRestoreDetailsProperties struct { - // Status - READ-ONLY; Restore status. - Status *string `json:"status,omitempty"` - // CurrentRestoringFileName - READ-ONLY; Current restoring file name. - CurrentRestoringFileName *string `json:"currentRestoringFileName,omitempty"` - // LastRestoredFileName - READ-ONLY; Last restored file name. - LastRestoredFileName *string `json:"lastRestoredFileName,omitempty"` - // LastRestoredFileTime - READ-ONLY; Last restored file time. - LastRestoredFileTime *date.Time `json:"lastRestoredFileTime,omitempty"` - // PercentCompleted - READ-ONLY; Percent completed. - PercentCompleted *float64 `json:"percentCompleted,omitempty"` - // UnrestorableFiles - READ-ONLY; List of unrestorable files. - UnrestorableFiles *[]string `json:"unrestorableFiles,omitempty"` - // NumberOfFilesDetected - READ-ONLY; Number of files detected. - NumberOfFilesDetected *int64 `json:"numberOfFilesDetected,omitempty"` - // LastUploadedFileName - READ-ONLY; Last uploaded file name. - LastUploadedFileName *string `json:"lastUploadedFileName,omitempty"` - // LastUploadedFileTime - READ-ONLY; Last uploaded file time. - LastUploadedFileTime *date.Time `json:"lastUploadedFileTime,omitempty"` - // BlockReason - READ-ONLY; The reason why restore is in Blocked state. - BlockReason *string `json:"blockReason,omitempty"` -} - -// ManagedDatabaseRestoreDetailsResult a managed database restore details. -type ManagedDatabaseRestoreDetailsResult struct { - autorest.Response `json:"-"` - // ManagedDatabaseRestoreDetailsProperties - Resource properties. - *ManagedDatabaseRestoreDetailsProperties `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 ManagedDatabaseRestoreDetailsResult. -func (mdrdr ManagedDatabaseRestoreDetailsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if mdrdr.ManagedDatabaseRestoreDetailsProperties != nil { - objectMap["properties"] = mdrdr.ManagedDatabaseRestoreDetailsProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ManagedDatabaseRestoreDetailsResult struct. -func (mdrdr *ManagedDatabaseRestoreDetailsResult) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var managedDatabaseRestoreDetailsProperties ManagedDatabaseRestoreDetailsProperties - err = json.Unmarshal(*v, &managedDatabaseRestoreDetailsProperties) - if err != nil { - return err - } - mdrdr.ManagedDatabaseRestoreDetailsProperties = &managedDatabaseRestoreDetailsProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - mdrdr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - mdrdr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - mdrdr.Type = &typeVar - } - } - } - - return nil -} - -// ManagedDatabasesCompleteRestoreFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ManagedDatabasesCompleteRestoreFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ManagedDatabasesCompleteRestoreFuture) Result(client ManagedDatabasesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesCompleteRestoreFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ManagedDatabasesCompleteRestoreFuture") - return - } - ar.Response = future.Response() - return -} - -// ManagedDatabasesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ManagedDatabasesCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ManagedDatabasesCreateOrUpdateFuture) Result(client ManagedDatabasesClient) (md ManagedDatabase, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ManagedDatabasesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if md.Response.Response, err = future.GetResult(sender); err == nil && md.Response.Response.StatusCode != http.StatusNoContent { - md, err = client.CreateOrUpdateResponder(md.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesCreateOrUpdateFuture", "Result", md.Response.Response, "Failure responding to request") - } - } - return -} - -// ManagedDatabasesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ManagedDatabasesDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ManagedDatabasesDeleteFuture) Result(client ManagedDatabasesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ManagedDatabasesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ManagedDatabaseSecurityAlertPolicy a managed database security alert policy. -type ManagedDatabaseSecurityAlertPolicy struct { - autorest.Response `json:"-"` - // SecurityAlertPolicyProperties - Resource properties. - *SecurityAlertPolicyProperties `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 ManagedDatabaseSecurityAlertPolicy. -func (mdsap ManagedDatabaseSecurityAlertPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if mdsap.SecurityAlertPolicyProperties != nil { - objectMap["properties"] = mdsap.SecurityAlertPolicyProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ManagedDatabaseSecurityAlertPolicy struct. -func (mdsap *ManagedDatabaseSecurityAlertPolicy) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var securityAlertPolicyProperties SecurityAlertPolicyProperties - err = json.Unmarshal(*v, &securityAlertPolicyProperties) - if err != nil { - return err - } - mdsap.SecurityAlertPolicyProperties = &securityAlertPolicyProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - mdsap.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - mdsap.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - mdsap.Type = &typeVar - } - } - } - - return nil -} - -// ManagedDatabaseSecurityAlertPolicyListResult a list of the managed database's security alert policies. -type ManagedDatabaseSecurityAlertPolicyListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]ManagedDatabaseSecurityAlertPolicy `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ManagedDatabaseSecurityAlertPolicyListResultIterator provides access to a complete listing of -// ManagedDatabaseSecurityAlertPolicy values. -type ManagedDatabaseSecurityAlertPolicyListResultIterator struct { - i int - page ManagedDatabaseSecurityAlertPolicyListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ManagedDatabaseSecurityAlertPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseSecurityAlertPolicyListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ManagedDatabaseSecurityAlertPolicyListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ManagedDatabaseSecurityAlertPolicyListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ManagedDatabaseSecurityAlertPolicyListResultIterator) Response() ManagedDatabaseSecurityAlertPolicyListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ManagedDatabaseSecurityAlertPolicyListResultIterator) Value() ManagedDatabaseSecurityAlertPolicy { - if !iter.page.NotDone() { - return ManagedDatabaseSecurityAlertPolicy{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ManagedDatabaseSecurityAlertPolicyListResultIterator type. -func NewManagedDatabaseSecurityAlertPolicyListResultIterator(page ManagedDatabaseSecurityAlertPolicyListResultPage) ManagedDatabaseSecurityAlertPolicyListResultIterator { - return ManagedDatabaseSecurityAlertPolicyListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (mdsaplr ManagedDatabaseSecurityAlertPolicyListResult) IsEmpty() bool { - return mdsaplr.Value == nil || len(*mdsaplr.Value) == 0 -} - -// managedDatabaseSecurityAlertPolicyListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (mdsaplr ManagedDatabaseSecurityAlertPolicyListResult) managedDatabaseSecurityAlertPolicyListResultPreparer(ctx context.Context) (*http.Request, error) { - if mdsaplr.NextLink == nil || len(to.String(mdsaplr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(mdsaplr.NextLink))) -} - -// ManagedDatabaseSecurityAlertPolicyListResultPage contains a page of ManagedDatabaseSecurityAlertPolicy -// values. -type ManagedDatabaseSecurityAlertPolicyListResultPage struct { - fn func(context.Context, ManagedDatabaseSecurityAlertPolicyListResult) (ManagedDatabaseSecurityAlertPolicyListResult, error) - mdsaplr ManagedDatabaseSecurityAlertPolicyListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ManagedDatabaseSecurityAlertPolicyListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseSecurityAlertPolicyListResultPage.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.mdsaplr) - if err != nil { - return err - } - page.mdsaplr = 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 *ManagedDatabaseSecurityAlertPolicyListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ManagedDatabaseSecurityAlertPolicyListResultPage) NotDone() bool { - return !page.mdsaplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ManagedDatabaseSecurityAlertPolicyListResultPage) Response() ManagedDatabaseSecurityAlertPolicyListResult { - return page.mdsaplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ManagedDatabaseSecurityAlertPolicyListResultPage) Values() []ManagedDatabaseSecurityAlertPolicy { - if page.mdsaplr.IsEmpty() { - return nil - } - return *page.mdsaplr.Value -} - -// Creates a new instance of the ManagedDatabaseSecurityAlertPolicyListResultPage type. -func NewManagedDatabaseSecurityAlertPolicyListResultPage(getNextPage func(context.Context, ManagedDatabaseSecurityAlertPolicyListResult) (ManagedDatabaseSecurityAlertPolicyListResult, error)) ManagedDatabaseSecurityAlertPolicyListResultPage { - return ManagedDatabaseSecurityAlertPolicyListResultPage{fn: getNextPage} -} - -// ManagedDatabasesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ManagedDatabasesUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ManagedDatabasesUpdateFuture) Result(client ManagedDatabasesClient) (md ManagedDatabase, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ManagedDatabasesUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if md.Response.Response, err = future.GetResult(sender); err == nil && md.Response.Response.StatusCode != http.StatusNoContent { - md, err = client.UpdateResponder(md.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesUpdateFuture", "Result", md.Response.Response, "Failure responding to request") - } - } - return -} - -// ManagedDatabaseUpdate an managed database update. -type ManagedDatabaseUpdate struct { - // ManagedDatabaseProperties - Resource properties. - *ManagedDatabaseProperties `json:"properties,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ManagedDatabaseUpdate. -func (mdu ManagedDatabaseUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if mdu.ManagedDatabaseProperties != nil { - objectMap["properties"] = mdu.ManagedDatabaseProperties - } - if mdu.Tags != nil { - objectMap["tags"] = mdu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ManagedDatabaseUpdate struct. -func (mdu *ManagedDatabaseUpdate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var managedDatabaseProperties ManagedDatabaseProperties - err = json.Unmarshal(*v, &managedDatabaseProperties) - if err != nil { - return err - } - mdu.ManagedDatabaseProperties = &managedDatabaseProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - mdu.Tags = tags - } - } - } - - return nil -} - -// ManagedDatabaseVulnerabilityAssessmentScansInitiateScanFuture an abstraction for monitoring and -// retrieving the results of a long-running operation. -type ManagedDatabaseVulnerabilityAssessmentScansInitiateScanFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ManagedDatabaseVulnerabilityAssessmentScansInitiateScanFuture) Result(client ManagedDatabaseVulnerabilityAssessmentScansClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseVulnerabilityAssessmentScansInitiateScanFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ManagedDatabaseVulnerabilityAssessmentScansInitiateScanFuture") - return - } - ar.Response = future.Response() - return -} - -// ManagedInstance an Azure SQL managed instance. -type ManagedInstance struct { - autorest.Response `json:"-"` - // Identity - The Azure Active Directory identity of the managed instance. - Identity *ResourceIdentity `json:"identity,omitempty"` - // Sku - Managed instance SKU. Allowed values for sku.name: GP_Gen4, GP_Gen5, BC_Gen4, BC_Gen5 - Sku *Sku `json:"sku,omitempty"` - // ManagedInstanceProperties - Resource properties. - *ManagedInstanceProperties `json:"properties,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for ManagedInstance. -func (mi ManagedInstance) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if mi.Identity != nil { - objectMap["identity"] = mi.Identity - } - if mi.Sku != nil { - objectMap["sku"] = mi.Sku - } - if mi.ManagedInstanceProperties != nil { - objectMap["properties"] = mi.ManagedInstanceProperties - } - if mi.Location != nil { - objectMap["location"] = mi.Location - } - if mi.Tags != nil { - objectMap["tags"] = mi.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ManagedInstance struct. -func (mi *ManagedInstance) UnmarshalJSON(body []byte) error { - 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 ResourceIdentity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - mi.Identity = &identity - } - case "sku": - if v != nil { - var sku Sku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - mi.Sku = &sku - } - case "properties": - if v != nil { - var managedInstanceProperties ManagedInstanceProperties - err = json.Unmarshal(*v, &managedInstanceProperties) - if err != nil { - return err - } - mi.ManagedInstanceProperties = &managedInstanceProperties - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - mi.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - mi.Tags = tags - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - mi.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - mi.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - mi.Type = &typeVar - } - } - } - - return nil -} - -// ManagedInstanceAdministrator an Azure SQL managed instance administrator. -type ManagedInstanceAdministrator struct { - autorest.Response `json:"-"` - // ManagedInstanceAdministratorProperties - Resource properties. - *ManagedInstanceAdministratorProperties `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 ManagedInstanceAdministrator. -func (mia ManagedInstanceAdministrator) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if mia.ManagedInstanceAdministratorProperties != nil { - objectMap["properties"] = mia.ManagedInstanceAdministratorProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ManagedInstanceAdministrator struct. -func (mia *ManagedInstanceAdministrator) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var managedInstanceAdministratorProperties ManagedInstanceAdministratorProperties - err = json.Unmarshal(*v, &managedInstanceAdministratorProperties) - if err != nil { - return err - } - mia.ManagedInstanceAdministratorProperties = &managedInstanceAdministratorProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - mia.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - mia.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - mia.Type = &typeVar - } - } - } - - return nil -} - -// ManagedInstanceAdministratorListResult a list of managed instance administrators. -type ManagedInstanceAdministratorListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]ManagedInstanceAdministrator `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ManagedInstanceAdministratorListResultIterator provides access to a complete listing of -// ManagedInstanceAdministrator values. -type ManagedInstanceAdministratorListResultIterator struct { - i int - page ManagedInstanceAdministratorListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ManagedInstanceAdministratorListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceAdministratorListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ManagedInstanceAdministratorListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ManagedInstanceAdministratorListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ManagedInstanceAdministratorListResultIterator) Response() ManagedInstanceAdministratorListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ManagedInstanceAdministratorListResultIterator) Value() ManagedInstanceAdministrator { - if !iter.page.NotDone() { - return ManagedInstanceAdministrator{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ManagedInstanceAdministratorListResultIterator type. -func NewManagedInstanceAdministratorListResultIterator(page ManagedInstanceAdministratorListResultPage) ManagedInstanceAdministratorListResultIterator { - return ManagedInstanceAdministratorListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (mialr ManagedInstanceAdministratorListResult) IsEmpty() bool { - return mialr.Value == nil || len(*mialr.Value) == 0 -} - -// managedInstanceAdministratorListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (mialr ManagedInstanceAdministratorListResult) managedInstanceAdministratorListResultPreparer(ctx context.Context) (*http.Request, error) { - if mialr.NextLink == nil || len(to.String(mialr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(mialr.NextLink))) -} - -// ManagedInstanceAdministratorListResultPage contains a page of ManagedInstanceAdministrator values. -type ManagedInstanceAdministratorListResultPage struct { - fn func(context.Context, ManagedInstanceAdministratorListResult) (ManagedInstanceAdministratorListResult, error) - mialr ManagedInstanceAdministratorListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ManagedInstanceAdministratorListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceAdministratorListResultPage.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.mialr) - if err != nil { - return err - } - page.mialr = 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 *ManagedInstanceAdministratorListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ManagedInstanceAdministratorListResultPage) NotDone() bool { - return !page.mialr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ManagedInstanceAdministratorListResultPage) Response() ManagedInstanceAdministratorListResult { - return page.mialr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ManagedInstanceAdministratorListResultPage) Values() []ManagedInstanceAdministrator { - if page.mialr.IsEmpty() { - return nil - } - return *page.mialr.Value -} - -// Creates a new instance of the ManagedInstanceAdministratorListResultPage type. -func NewManagedInstanceAdministratorListResultPage(getNextPage func(context.Context, ManagedInstanceAdministratorListResult) (ManagedInstanceAdministratorListResult, error)) ManagedInstanceAdministratorListResultPage { - return ManagedInstanceAdministratorListResultPage{fn: getNextPage} -} - -// ManagedInstanceAdministratorProperties the properties of a managed instance administrator. -type ManagedInstanceAdministratorProperties struct { - // AdministratorType - Type of the managed instance administrator. - AdministratorType *string `json:"administratorType,omitempty"` - // Login - Login name of the managed instance administrator. - Login *string `json:"login,omitempty"` - // Sid - SID (object ID) of the managed instance administrator. - Sid *uuid.UUID `json:"sid,omitempty"` - // TenantID - Tenant ID of the managed instance administrator. - TenantID *uuid.UUID `json:"tenantId,omitempty"` -} - -// ManagedInstanceAdministratorsCreateOrUpdateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type ManagedInstanceAdministratorsCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ManagedInstanceAdministratorsCreateOrUpdateFuture) Result(client ManagedInstanceAdministratorsClient) (mia ManagedInstanceAdministrator, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceAdministratorsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ManagedInstanceAdministratorsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if mia.Response.Response, err = future.GetResult(sender); err == nil && mia.Response.Response.StatusCode != http.StatusNoContent { - mia, err = client.CreateOrUpdateResponder(mia.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceAdministratorsCreateOrUpdateFuture", "Result", mia.Response.Response, "Failure responding to request") - } - } - return -} - -// ManagedInstanceAdministratorsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ManagedInstanceAdministratorsDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ManagedInstanceAdministratorsDeleteFuture) Result(client ManagedInstanceAdministratorsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceAdministratorsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ManagedInstanceAdministratorsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ManagedInstanceEditionCapability the managed server capability -type ManagedInstanceEditionCapability struct { - // Name - READ-ONLY; The managed server version name. - Name *string `json:"name,omitempty"` - // SupportedFamilies - READ-ONLY; The supported families. - SupportedFamilies *[]ManagedInstanceFamilyCapability `json:"supportedFamilies,omitempty"` - // Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' - Status CapabilityStatus `json:"status,omitempty"` - // Reason - The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` -} - -// ManagedInstanceEncryptionProtector the managed instance encryption protector. -type ManagedInstanceEncryptionProtector struct { - autorest.Response `json:"-"` - // Kind - READ-ONLY; Kind of encryption protector. This is metadata used for the Azure portal experience. - Kind *string `json:"kind,omitempty"` - // ManagedInstanceEncryptionProtectorProperties - Resource properties. - *ManagedInstanceEncryptionProtectorProperties `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 ManagedInstanceEncryptionProtector. -func (miep ManagedInstanceEncryptionProtector) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if miep.ManagedInstanceEncryptionProtectorProperties != nil { - objectMap["properties"] = miep.ManagedInstanceEncryptionProtectorProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ManagedInstanceEncryptionProtector struct. -func (miep *ManagedInstanceEncryptionProtector) UnmarshalJSON(body []byte) error { - 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 string - err = json.Unmarshal(*v, &kind) - if err != nil { - return err - } - miep.Kind = &kind - } - case "properties": - if v != nil { - var managedInstanceEncryptionProtectorProperties ManagedInstanceEncryptionProtectorProperties - err = json.Unmarshal(*v, &managedInstanceEncryptionProtectorProperties) - if err != nil { - return err - } - miep.ManagedInstanceEncryptionProtectorProperties = &managedInstanceEncryptionProtectorProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - miep.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - miep.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - miep.Type = &typeVar - } - } - } - - return nil -} - -// ManagedInstanceEncryptionProtectorListResult a list of managed instance encryption protectors. -type ManagedInstanceEncryptionProtectorListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]ManagedInstanceEncryptionProtector `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ManagedInstanceEncryptionProtectorListResultIterator provides access to a complete listing of -// ManagedInstanceEncryptionProtector values. -type ManagedInstanceEncryptionProtectorListResultIterator struct { - i int - page ManagedInstanceEncryptionProtectorListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ManagedInstanceEncryptionProtectorListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceEncryptionProtectorListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ManagedInstanceEncryptionProtectorListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ManagedInstanceEncryptionProtectorListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ManagedInstanceEncryptionProtectorListResultIterator) Response() ManagedInstanceEncryptionProtectorListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ManagedInstanceEncryptionProtectorListResultIterator) Value() ManagedInstanceEncryptionProtector { - if !iter.page.NotDone() { - return ManagedInstanceEncryptionProtector{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ManagedInstanceEncryptionProtectorListResultIterator type. -func NewManagedInstanceEncryptionProtectorListResultIterator(page ManagedInstanceEncryptionProtectorListResultPage) ManagedInstanceEncryptionProtectorListResultIterator { - return ManagedInstanceEncryptionProtectorListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (mieplr ManagedInstanceEncryptionProtectorListResult) IsEmpty() bool { - return mieplr.Value == nil || len(*mieplr.Value) == 0 -} - -// managedInstanceEncryptionProtectorListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (mieplr ManagedInstanceEncryptionProtectorListResult) managedInstanceEncryptionProtectorListResultPreparer(ctx context.Context) (*http.Request, error) { - if mieplr.NextLink == nil || len(to.String(mieplr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(mieplr.NextLink))) -} - -// ManagedInstanceEncryptionProtectorListResultPage contains a page of ManagedInstanceEncryptionProtector -// values. -type ManagedInstanceEncryptionProtectorListResultPage struct { - fn func(context.Context, ManagedInstanceEncryptionProtectorListResult) (ManagedInstanceEncryptionProtectorListResult, error) - mieplr ManagedInstanceEncryptionProtectorListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ManagedInstanceEncryptionProtectorListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceEncryptionProtectorListResultPage.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.mieplr) - if err != nil { - return err - } - page.mieplr = 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 *ManagedInstanceEncryptionProtectorListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ManagedInstanceEncryptionProtectorListResultPage) NotDone() bool { - return !page.mieplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ManagedInstanceEncryptionProtectorListResultPage) Response() ManagedInstanceEncryptionProtectorListResult { - return page.mieplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ManagedInstanceEncryptionProtectorListResultPage) Values() []ManagedInstanceEncryptionProtector { - if page.mieplr.IsEmpty() { - return nil - } - return *page.mieplr.Value -} - -// Creates a new instance of the ManagedInstanceEncryptionProtectorListResultPage type. -func NewManagedInstanceEncryptionProtectorListResultPage(getNextPage func(context.Context, ManagedInstanceEncryptionProtectorListResult) (ManagedInstanceEncryptionProtectorListResult, error)) ManagedInstanceEncryptionProtectorListResultPage { - return ManagedInstanceEncryptionProtectorListResultPage{fn: getNextPage} -} - -// ManagedInstanceEncryptionProtectorProperties properties for an encryption protector execution. -type ManagedInstanceEncryptionProtectorProperties struct { - // ServerKeyName - The name of the managed instance key. - ServerKeyName *string `json:"serverKeyName,omitempty"` - // ServerKeyType - The encryption protector type like 'ServiceManaged', 'AzureKeyVault'. Possible values include: 'ServiceManaged', 'AzureKeyVault' - ServerKeyType ServerKeyType `json:"serverKeyType,omitempty"` - // URI - READ-ONLY; The URI of the server key. - URI *string `json:"uri,omitempty"` - // Thumbprint - READ-ONLY; Thumbprint of the server key. - Thumbprint *string `json:"thumbprint,omitempty"` -} - -// ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture) Result(client ManagedInstanceEncryptionProtectorsClient) (miep ManagedInstanceEncryptionProtector, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if miep.Response.Response, err = future.GetResult(sender); err == nil && miep.Response.Response.StatusCode != http.StatusNoContent { - miep, err = client.CreateOrUpdateResponder(miep.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture", "Result", miep.Response.Response, "Failure responding to request") - } - } - return -} - -// ManagedInstanceEncryptionProtectorsRevalidateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type ManagedInstanceEncryptionProtectorsRevalidateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ManagedInstanceEncryptionProtectorsRevalidateFuture) Result(client ManagedInstanceEncryptionProtectorsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceEncryptionProtectorsRevalidateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ManagedInstanceEncryptionProtectorsRevalidateFuture") - return - } - ar.Response = future.Response() - return -} - -// ManagedInstanceFamilyCapability the managed server family capability. -type ManagedInstanceFamilyCapability struct { - // Name - READ-ONLY; Family name. - Name *string `json:"name,omitempty"` - // Sku - READ-ONLY; SKU name. - Sku *string `json:"sku,omitempty"` - // SupportedLicenseTypes - READ-ONLY; List of supported license types. - SupportedLicenseTypes *[]LicenseTypeCapability `json:"supportedLicenseTypes,omitempty"` - // SupportedVcoresValues - READ-ONLY; List of supported virtual cores values. - SupportedVcoresValues *[]ManagedInstanceVcoresCapability `json:"supportedVcoresValues,omitempty"` - // IncludedMaxSize - READ-ONLY; Included size. - IncludedMaxSize *MaxSizeCapability `json:"includedMaxSize,omitempty"` - // SupportedStorageSizes - READ-ONLY; Storage size ranges. - SupportedStorageSizes *[]MaxSizeRangeCapability `json:"supportedStorageSizes,omitempty"` - // Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' - Status CapabilityStatus `json:"status,omitempty"` - // Reason - The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` -} - -// ManagedInstanceKey a managed instance key. -type ManagedInstanceKey struct { - autorest.Response `json:"-"` - // Kind - READ-ONLY; Kind of encryption protector. This is metadata used for the Azure portal experience. - Kind *string `json:"kind,omitempty"` - // ManagedInstanceKeyProperties - Resource properties. - *ManagedInstanceKeyProperties `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 ManagedInstanceKey. -func (mik ManagedInstanceKey) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if mik.ManagedInstanceKeyProperties != nil { - objectMap["properties"] = mik.ManagedInstanceKeyProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ManagedInstanceKey struct. -func (mik *ManagedInstanceKey) UnmarshalJSON(body []byte) error { - 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 string - err = json.Unmarshal(*v, &kind) - if err != nil { - return err - } - mik.Kind = &kind - } - case "properties": - if v != nil { - var managedInstanceKeyProperties ManagedInstanceKeyProperties - err = json.Unmarshal(*v, &managedInstanceKeyProperties) - if err != nil { - return err - } - mik.ManagedInstanceKeyProperties = &managedInstanceKeyProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - mik.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - mik.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - mik.Type = &typeVar - } - } - } - - return nil -} - -// ManagedInstanceKeyListResult a list of managed instance keys. -type ManagedInstanceKeyListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]ManagedInstanceKey `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ManagedInstanceKeyListResultIterator provides access to a complete listing of ManagedInstanceKey values. -type ManagedInstanceKeyListResultIterator struct { - i int - page ManagedInstanceKeyListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ManagedInstanceKeyListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceKeyListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ManagedInstanceKeyListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ManagedInstanceKeyListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ManagedInstanceKeyListResultIterator) Response() ManagedInstanceKeyListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ManagedInstanceKeyListResultIterator) Value() ManagedInstanceKey { - if !iter.page.NotDone() { - return ManagedInstanceKey{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ManagedInstanceKeyListResultIterator type. -func NewManagedInstanceKeyListResultIterator(page ManagedInstanceKeyListResultPage) ManagedInstanceKeyListResultIterator { - return ManagedInstanceKeyListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (miklr ManagedInstanceKeyListResult) IsEmpty() bool { - return miklr.Value == nil || len(*miklr.Value) == 0 -} - -// managedInstanceKeyListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (miklr ManagedInstanceKeyListResult) managedInstanceKeyListResultPreparer(ctx context.Context) (*http.Request, error) { - if miklr.NextLink == nil || len(to.String(miklr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(miklr.NextLink))) -} - -// ManagedInstanceKeyListResultPage contains a page of ManagedInstanceKey values. -type ManagedInstanceKeyListResultPage struct { - fn func(context.Context, ManagedInstanceKeyListResult) (ManagedInstanceKeyListResult, error) - miklr ManagedInstanceKeyListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ManagedInstanceKeyListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceKeyListResultPage.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.miklr) - if err != nil { - return err - } - page.miklr = 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 *ManagedInstanceKeyListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ManagedInstanceKeyListResultPage) NotDone() bool { - return !page.miklr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ManagedInstanceKeyListResultPage) Response() ManagedInstanceKeyListResult { - return page.miklr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ManagedInstanceKeyListResultPage) Values() []ManagedInstanceKey { - if page.miklr.IsEmpty() { - return nil - } - return *page.miklr.Value -} - -// Creates a new instance of the ManagedInstanceKeyListResultPage type. -func NewManagedInstanceKeyListResultPage(getNextPage func(context.Context, ManagedInstanceKeyListResult) (ManagedInstanceKeyListResult, error)) ManagedInstanceKeyListResultPage { - return ManagedInstanceKeyListResultPage{fn: getNextPage} -} - -// ManagedInstanceKeyProperties properties for a key execution. -type ManagedInstanceKeyProperties struct { - // ServerKeyType - The key type like 'ServiceManaged', 'AzureKeyVault'. Possible values include: 'ServiceManaged', 'AzureKeyVault' - ServerKeyType ServerKeyType `json:"serverKeyType,omitempty"` - // URI - The URI of the key. If the ServerKeyType is AzureKeyVault, then the URI is required. - URI *string `json:"uri,omitempty"` - // Thumbprint - READ-ONLY; Thumbprint of the key. - Thumbprint *string `json:"thumbprint,omitempty"` - // CreationDate - READ-ONLY; The key creation date. - CreationDate *date.Time `json:"creationDate,omitempty"` -} - -// ManagedInstanceKeysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ManagedInstanceKeysCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ManagedInstanceKeysCreateOrUpdateFuture) Result(client ManagedInstanceKeysClient) (mik ManagedInstanceKey, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceKeysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ManagedInstanceKeysCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if mik.Response.Response, err = future.GetResult(sender); err == nil && mik.Response.Response.StatusCode != http.StatusNoContent { - mik, err = client.CreateOrUpdateResponder(mik.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceKeysCreateOrUpdateFuture", "Result", mik.Response.Response, "Failure responding to request") - } - } - return -} - -// ManagedInstanceKeysDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ManagedInstanceKeysDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ManagedInstanceKeysDeleteFuture) Result(client ManagedInstanceKeysClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceKeysDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ManagedInstanceKeysDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ManagedInstanceListResult a list of managed instances. -type ManagedInstanceListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]ManagedInstance `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ManagedInstanceListResultIterator provides access to a complete listing of ManagedInstance values. -type ManagedInstanceListResultIterator struct { - i int - page ManagedInstanceListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ManagedInstanceListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ManagedInstanceListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ManagedInstanceListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ManagedInstanceListResultIterator) Response() ManagedInstanceListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ManagedInstanceListResultIterator) Value() ManagedInstance { - if !iter.page.NotDone() { - return ManagedInstance{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ManagedInstanceListResultIterator type. -func NewManagedInstanceListResultIterator(page ManagedInstanceListResultPage) ManagedInstanceListResultIterator { - return ManagedInstanceListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (milr ManagedInstanceListResult) IsEmpty() bool { - return milr.Value == nil || len(*milr.Value) == 0 -} - -// managedInstanceListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (milr ManagedInstanceListResult) managedInstanceListResultPreparer(ctx context.Context) (*http.Request, error) { - if milr.NextLink == nil || len(to.String(milr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(milr.NextLink))) -} - -// ManagedInstanceListResultPage contains a page of ManagedInstance values. -type ManagedInstanceListResultPage struct { - fn func(context.Context, ManagedInstanceListResult) (ManagedInstanceListResult, error) - milr ManagedInstanceListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ManagedInstanceListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceListResultPage.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.milr) - if err != nil { - return err - } - page.milr = 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 *ManagedInstanceListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ManagedInstanceListResultPage) NotDone() bool { - return !page.milr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ManagedInstanceListResultPage) Response() ManagedInstanceListResult { - return page.milr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ManagedInstanceListResultPage) Values() []ManagedInstance { - if page.milr.IsEmpty() { - return nil - } - return *page.milr.Value -} - -// Creates a new instance of the ManagedInstanceListResultPage type. -func NewManagedInstanceListResultPage(getNextPage func(context.Context, ManagedInstanceListResult) (ManagedInstanceListResult, error)) ManagedInstanceListResultPage { - return ManagedInstanceListResultPage{fn: getNextPage} -} - -// ManagedInstancePairInfo pairs of Managed Instances in the failover group. -type ManagedInstancePairInfo struct { - // PrimaryManagedInstanceID - Id of Primary Managed Instance in pair. - PrimaryManagedInstanceID *string `json:"primaryManagedInstanceId,omitempty"` - // PartnerManagedInstanceID - Id of Partner Managed Instance in pair. - PartnerManagedInstanceID *string `json:"partnerManagedInstanceId,omitempty"` -} - -// ManagedInstanceProperties the properties of a managed instance. -type ManagedInstanceProperties struct { - // ManagedInstanceCreateMode - Specifies the mode of database creation. - // - // Default: Regular instance creation. - // - // Restore: Creates an instance by restoring a set of backups to specific point in time. RestorePointInTime and SourceManagedInstanceId must be specified. Possible values include: 'ManagedServerCreateModeDefault', 'ManagedServerCreateModePointInTimeRestore' - ManagedInstanceCreateMode ManagedServerCreateMode `json:"managedInstanceCreateMode,omitempty"` - // FullyQualifiedDomainName - READ-ONLY; The fully qualified domain name of the managed instance. - FullyQualifiedDomainName *string `json:"fullyQualifiedDomainName,omitempty"` - // AdministratorLogin - Administrator username for the managed instance. Can only be specified when the managed instance is being created (and is required for creation). - AdministratorLogin *string `json:"administratorLogin,omitempty"` - // AdministratorLoginPassword - The administrator login password (required for managed instance creation). - AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"` - // SubnetID - Subnet resource ID for the managed instance. - SubnetID *string `json:"subnetId,omitempty"` - // State - READ-ONLY; The state of the managed instance. - State *string `json:"state,omitempty"` - // LicenseType - The license type. Possible values are 'LicenseIncluded' (regular price inclusive of a new SQL license) and 'BasePrice' (discounted AHB price for bringing your own SQL licenses). Possible values include: 'ManagedInstanceLicenseTypeLicenseIncluded', 'ManagedInstanceLicenseTypeBasePrice' - LicenseType ManagedInstanceLicenseType `json:"licenseType,omitempty"` - // VCores - The number of vCores. Allowed values: 8, 16, 24, 32, 40, 64, 80. - VCores *int32 `json:"vCores,omitempty"` - // StorageSizeInGB - Storage size in GB. Minimum value: 32. Maximum value: 8192. Increments of 32 GB allowed only. - StorageSizeInGB *int32 `json:"storageSizeInGB,omitempty"` - // Collation - Collation of the managed instance. - Collation *string `json:"collation,omitempty"` - // DNSZone - READ-ONLY; The Dns Zone that the managed instance is in. - DNSZone *string `json:"dnsZone,omitempty"` - // DNSZonePartner - The resource id of another managed instance whose DNS zone this managed instance will share after creation. - DNSZonePartner *string `json:"dnsZonePartner,omitempty"` - // PublicDataEndpointEnabled - Whether or not the public data endpoint is enabled. - PublicDataEndpointEnabled *bool `json:"publicDataEndpointEnabled,omitempty"` - // SourceManagedInstanceID - The resource identifier of the source managed instance associated with create operation of this instance. - SourceManagedInstanceID *string `json:"sourceManagedInstanceId,omitempty"` - // RestorePointInTime - Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. - RestorePointInTime *date.Time `json:"restorePointInTime,omitempty"` - // ProxyOverride - Connection type used for connecting to the instance. Possible values include: 'ManagedInstanceProxyOverrideProxy', 'ManagedInstanceProxyOverrideRedirect', 'ManagedInstanceProxyOverrideDefault' - ProxyOverride ManagedInstanceProxyOverride `json:"proxyOverride,omitempty"` - // TimezoneID - Id of the timezone. Allowed values are timezones supported by Windows. - // Windows keeps details on supported timezones, including the id, in registry under - // KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones. - // You can get those registry values via SQL Server by querying SELECT name AS timezone_id FROM sys.time_zone_info. - // List of Ids can also be obtained by executing [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell. - // An example of valid timezone id is "Pacific Standard Time" or "W. Europe Standard Time". - TimezoneID *string `json:"timezoneId,omitempty"` - // InstancePoolID - The Id of the instance pool this managed server belongs to. - InstancePoolID *string `json:"instancePoolId,omitempty"` -} - -// ManagedInstancesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ManagedInstancesCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ManagedInstancesCreateOrUpdateFuture) Result(client ManagedInstancesClient) (mi ManagedInstance, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstancesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ManagedInstancesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { - mi, err = client.CreateOrUpdateResponder(mi.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstancesCreateOrUpdateFuture", "Result", mi.Response.Response, "Failure responding to request") - } - } - return -} - -// ManagedInstancesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ManagedInstancesDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ManagedInstancesDeleteFuture) Result(client ManagedInstancesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstancesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ManagedInstancesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ManagedInstancesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ManagedInstancesUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ManagedInstancesUpdateFuture) Result(client ManagedInstancesClient) (mi ManagedInstance, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstancesUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ManagedInstancesUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent { - mi, err = client.UpdateResponder(mi.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstancesUpdateFuture", "Result", mi.Response.Response, "Failure responding to request") - } - } - return -} - -// ManagedInstanceTdeCertificatesCreateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ManagedInstanceTdeCertificatesCreateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ManagedInstanceTdeCertificatesCreateFuture) Result(client ManagedInstanceTdeCertificatesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedInstanceTdeCertificatesCreateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ManagedInstanceTdeCertificatesCreateFuture") - return - } - ar.Response = future.Response() - return -} - -// ManagedInstanceUpdate an update request for an Azure SQL Database managed instance. -type ManagedInstanceUpdate struct { - // Sku - Managed instance sku - Sku *Sku `json:"sku,omitempty"` - // ManagedInstanceProperties - Resource properties. - *ManagedInstanceProperties `json:"properties,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ManagedInstanceUpdate. -func (miu ManagedInstanceUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if miu.Sku != nil { - objectMap["sku"] = miu.Sku - } - if miu.ManagedInstanceProperties != nil { - objectMap["properties"] = miu.ManagedInstanceProperties - } - if miu.Tags != nil { - objectMap["tags"] = miu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ManagedInstanceUpdate struct. -func (miu *ManagedInstanceUpdate) UnmarshalJSON(body []byte) error { - 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 - } - miu.Sku = &sku - } - case "properties": - if v != nil { - var managedInstanceProperties ManagedInstanceProperties - err = json.Unmarshal(*v, &managedInstanceProperties) - if err != nil { - return err - } - miu.ManagedInstanceProperties = &managedInstanceProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - miu.Tags = tags - } - } - } - - return nil -} - -// ManagedInstanceVcoresCapability the managed instance virtual cores capability. -type ManagedInstanceVcoresCapability struct { - // Name - READ-ONLY; The virtual cores identifier. - Name *string `json:"name,omitempty"` - // Value - READ-ONLY; The virtual cores value. - Value *int32 `json:"value,omitempty"` - // Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' - Status CapabilityStatus `json:"status,omitempty"` - // Reason - The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` -} - -// ManagedInstanceVersionCapability the managed instance capability -type ManagedInstanceVersionCapability struct { - // Name - READ-ONLY; The server version name. - Name *string `json:"name,omitempty"` - // SupportedEditions - READ-ONLY; The list of supported managed instance editions. - SupportedEditions *[]ManagedInstanceEditionCapability `json:"supportedEditions,omitempty"` - // Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' - Status CapabilityStatus `json:"status,omitempty"` - // Reason - The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` -} - -// ManagedInstanceVulnerabilityAssessment a managed instance vulnerability assessment. -type ManagedInstanceVulnerabilityAssessment struct { - autorest.Response `json:"-"` - // ManagedInstanceVulnerabilityAssessmentProperties - Resource properties. - *ManagedInstanceVulnerabilityAssessmentProperties `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 ManagedInstanceVulnerabilityAssessment. -func (miva ManagedInstanceVulnerabilityAssessment) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if miva.ManagedInstanceVulnerabilityAssessmentProperties != nil { - objectMap["properties"] = miva.ManagedInstanceVulnerabilityAssessmentProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ManagedInstanceVulnerabilityAssessment struct. -func (miva *ManagedInstanceVulnerabilityAssessment) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var managedInstanceVulnerabilityAssessmentProperties ManagedInstanceVulnerabilityAssessmentProperties - err = json.Unmarshal(*v, &managedInstanceVulnerabilityAssessmentProperties) - if err != nil { - return err - } - miva.ManagedInstanceVulnerabilityAssessmentProperties = &managedInstanceVulnerabilityAssessmentProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - miva.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - miva.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - miva.Type = &typeVar - } - } - } - - return nil -} - -// ManagedInstanceVulnerabilityAssessmentListResult a list of the ManagedInstance's vulnerability -// assessments. -type ManagedInstanceVulnerabilityAssessmentListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]ManagedInstanceVulnerabilityAssessment `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ManagedInstanceVulnerabilityAssessmentListResultIterator provides access to a complete listing of -// ManagedInstanceVulnerabilityAssessment values. -type ManagedInstanceVulnerabilityAssessmentListResultIterator struct { - i int - page ManagedInstanceVulnerabilityAssessmentListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ManagedInstanceVulnerabilityAssessmentListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceVulnerabilityAssessmentListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ManagedInstanceVulnerabilityAssessmentListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ManagedInstanceVulnerabilityAssessmentListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ManagedInstanceVulnerabilityAssessmentListResultIterator) Response() ManagedInstanceVulnerabilityAssessmentListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ManagedInstanceVulnerabilityAssessmentListResultIterator) Value() ManagedInstanceVulnerabilityAssessment { - if !iter.page.NotDone() { - return ManagedInstanceVulnerabilityAssessment{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ManagedInstanceVulnerabilityAssessmentListResultIterator type. -func NewManagedInstanceVulnerabilityAssessmentListResultIterator(page ManagedInstanceVulnerabilityAssessmentListResultPage) ManagedInstanceVulnerabilityAssessmentListResultIterator { - return ManagedInstanceVulnerabilityAssessmentListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (mivalr ManagedInstanceVulnerabilityAssessmentListResult) IsEmpty() bool { - return mivalr.Value == nil || len(*mivalr.Value) == 0 -} - -// managedInstanceVulnerabilityAssessmentListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (mivalr ManagedInstanceVulnerabilityAssessmentListResult) managedInstanceVulnerabilityAssessmentListResultPreparer(ctx context.Context) (*http.Request, error) { - if mivalr.NextLink == nil || len(to.String(mivalr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(mivalr.NextLink))) -} - -// ManagedInstanceVulnerabilityAssessmentListResultPage contains a page of -// ManagedInstanceVulnerabilityAssessment values. -type ManagedInstanceVulnerabilityAssessmentListResultPage struct { - fn func(context.Context, ManagedInstanceVulnerabilityAssessmentListResult) (ManagedInstanceVulnerabilityAssessmentListResult, error) - mivalr ManagedInstanceVulnerabilityAssessmentListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ManagedInstanceVulnerabilityAssessmentListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceVulnerabilityAssessmentListResultPage.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.mivalr) - if err != nil { - return err - } - page.mivalr = 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 *ManagedInstanceVulnerabilityAssessmentListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ManagedInstanceVulnerabilityAssessmentListResultPage) NotDone() bool { - return !page.mivalr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ManagedInstanceVulnerabilityAssessmentListResultPage) Response() ManagedInstanceVulnerabilityAssessmentListResult { - return page.mivalr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ManagedInstanceVulnerabilityAssessmentListResultPage) Values() []ManagedInstanceVulnerabilityAssessment { - if page.mivalr.IsEmpty() { - return nil - } - return *page.mivalr.Value -} - -// Creates a new instance of the ManagedInstanceVulnerabilityAssessmentListResultPage type. -func NewManagedInstanceVulnerabilityAssessmentListResultPage(getNextPage func(context.Context, ManagedInstanceVulnerabilityAssessmentListResult) (ManagedInstanceVulnerabilityAssessmentListResult, error)) ManagedInstanceVulnerabilityAssessmentListResultPage { - return ManagedInstanceVulnerabilityAssessmentListResultPage{fn: getNextPage} -} - -// ManagedInstanceVulnerabilityAssessmentProperties properties of a managed instance vulnerability -// assessment. -type ManagedInstanceVulnerabilityAssessmentProperties struct { - // StorageContainerPath - A blob storage container path to hold the scan results (e.g. https://myStorage.blob.core.windows.net/VaScans/). - StorageContainerPath *string `json:"storageContainerPath,omitempty"` - // StorageContainerSasKey - A shared access signature (SAS Key) that has write access to the blob container specified in 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't specified, StorageContainerSasKey is required. - StorageContainerSasKey *string `json:"storageContainerSasKey,omitempty"` - // StorageAccountAccessKey - Specifies the identifier key of the storage account for vulnerability assessment scan results. If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is required. - StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` - // RecurringScans - The recurring scans settings - RecurringScans *VulnerabilityAssessmentRecurringScansProperties `json:"recurringScans,omitempty"` -} - -// ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCreateOrUpdateFuture an abstraction for -// monitoring and retrieving the results of a long-running operation. -type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCreateOrUpdateFuture) Result(client ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) (mbstrp ManagedBackupShortTermRetentionPolicy, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if mbstrp.Response.Response, err = future.GetResult(sender); err == nil && mbstrp.Response.Response.StatusCode != http.StatusNoContent { - mbstrp, err = client.CreateOrUpdateResponder(mbstrp.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCreateOrUpdateFuture", "Result", mbstrp.Response.Response, "Failure responding to request") - } - } - return -} - -// ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesUpdateFuture an abstraction for -// monitoring and retrieving the results of a long-running operation. -type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesUpdateFuture) Result(client ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) (mbstrp ManagedBackupShortTermRetentionPolicy, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if mbstrp.Response.Response, err = future.GetResult(sender); err == nil && mbstrp.Response.Response.StatusCode != http.StatusNoContent { - mbstrp, err = client.UpdateResponder(mbstrp.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesUpdateFuture", "Result", mbstrp.Response.Response, "Failure responding to request") - } - } - return -} - -// ManagedServerSecurityAlertPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type ManagedServerSecurityAlertPoliciesCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ManagedServerSecurityAlertPoliciesCreateOrUpdateFuture) Result(client ManagedServerSecurityAlertPoliciesClient) (mssap ManagedServerSecurityAlertPolicy, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedServerSecurityAlertPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ManagedServerSecurityAlertPoliciesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if mssap.Response.Response, err = future.GetResult(sender); err == nil && mssap.Response.Response.StatusCode != http.StatusNoContent { - mssap, err = client.CreateOrUpdateResponder(mssap.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedServerSecurityAlertPoliciesCreateOrUpdateFuture", "Result", mssap.Response.Response, "Failure responding to request") - } - } - return -} - -// ManagedServerSecurityAlertPolicy a managed server security alert policy. -type ManagedServerSecurityAlertPolicy struct { - autorest.Response `json:"-"` - // SecurityAlertPolicyProperties - Resource properties. - *SecurityAlertPolicyProperties `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 ManagedServerSecurityAlertPolicy. -func (mssap ManagedServerSecurityAlertPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if mssap.SecurityAlertPolicyProperties != nil { - objectMap["properties"] = mssap.SecurityAlertPolicyProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ManagedServerSecurityAlertPolicy struct. -func (mssap *ManagedServerSecurityAlertPolicy) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var securityAlertPolicyProperties SecurityAlertPolicyProperties - err = json.Unmarshal(*v, &securityAlertPolicyProperties) - if err != nil { - return err - } - mssap.SecurityAlertPolicyProperties = &securityAlertPolicyProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - mssap.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - mssap.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - mssap.Type = &typeVar - } - } - } - - return nil -} - -// ManagedServerSecurityAlertPolicyListResult a list of the managed Server's security alert policies. -type ManagedServerSecurityAlertPolicyListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]ManagedServerSecurityAlertPolicy `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ManagedServerSecurityAlertPolicyListResultIterator provides access to a complete listing of -// ManagedServerSecurityAlertPolicy values. -type ManagedServerSecurityAlertPolicyListResultIterator struct { - i int - page ManagedServerSecurityAlertPolicyListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ManagedServerSecurityAlertPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedServerSecurityAlertPolicyListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ManagedServerSecurityAlertPolicyListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ManagedServerSecurityAlertPolicyListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ManagedServerSecurityAlertPolicyListResultIterator) Response() ManagedServerSecurityAlertPolicyListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ManagedServerSecurityAlertPolicyListResultIterator) Value() ManagedServerSecurityAlertPolicy { - if !iter.page.NotDone() { - return ManagedServerSecurityAlertPolicy{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ManagedServerSecurityAlertPolicyListResultIterator type. -func NewManagedServerSecurityAlertPolicyListResultIterator(page ManagedServerSecurityAlertPolicyListResultPage) ManagedServerSecurityAlertPolicyListResultIterator { - return ManagedServerSecurityAlertPolicyListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (mssaplr ManagedServerSecurityAlertPolicyListResult) IsEmpty() bool { - return mssaplr.Value == nil || len(*mssaplr.Value) == 0 -} - -// managedServerSecurityAlertPolicyListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (mssaplr ManagedServerSecurityAlertPolicyListResult) managedServerSecurityAlertPolicyListResultPreparer(ctx context.Context) (*http.Request, error) { - if mssaplr.NextLink == nil || len(to.String(mssaplr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(mssaplr.NextLink))) -} - -// ManagedServerSecurityAlertPolicyListResultPage contains a page of ManagedServerSecurityAlertPolicy -// values. -type ManagedServerSecurityAlertPolicyListResultPage struct { - fn func(context.Context, ManagedServerSecurityAlertPolicyListResult) (ManagedServerSecurityAlertPolicyListResult, error) - mssaplr ManagedServerSecurityAlertPolicyListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ManagedServerSecurityAlertPolicyListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedServerSecurityAlertPolicyListResultPage.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.mssaplr) - if err != nil { - return err - } - page.mssaplr = 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 *ManagedServerSecurityAlertPolicyListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ManagedServerSecurityAlertPolicyListResultPage) NotDone() bool { - return !page.mssaplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ManagedServerSecurityAlertPolicyListResultPage) Response() ManagedServerSecurityAlertPolicyListResult { - return page.mssaplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ManagedServerSecurityAlertPolicyListResultPage) Values() []ManagedServerSecurityAlertPolicy { - if page.mssaplr.IsEmpty() { - return nil - } - return *page.mssaplr.Value -} - -// Creates a new instance of the ManagedServerSecurityAlertPolicyListResultPage type. -func NewManagedServerSecurityAlertPolicyListResultPage(getNextPage func(context.Context, ManagedServerSecurityAlertPolicyListResult) (ManagedServerSecurityAlertPolicyListResult, error)) ManagedServerSecurityAlertPolicyListResultPage { - return ManagedServerSecurityAlertPolicyListResultPage{fn: getNextPage} -} - -// MaxSizeCapability the maximum size capability. -type MaxSizeCapability struct { - // Limit - READ-ONLY; The maximum size limit (see 'unit' for the units). - Limit *int32 `json:"limit,omitempty"` - // Unit - READ-ONLY; The units that the limit is expressed in. Possible values include: 'MaxSizeUnitMegabytes', 'MaxSizeUnitGigabytes', 'MaxSizeUnitTerabytes', 'MaxSizeUnitPetabytes' - Unit MaxSizeUnit `json:"unit,omitempty"` -} - -// MaxSizeRangeCapability the maximum size range capability. -type MaxSizeRangeCapability struct { - // MinValue - READ-ONLY; Minimum value. - MinValue *MaxSizeCapability `json:"minValue,omitempty"` - // MaxValue - READ-ONLY; Maximum value. - MaxValue *MaxSizeCapability `json:"maxValue,omitempty"` - // ScaleSize - READ-ONLY; Scale/step size for discrete values between the minimum value and the maximum value. - ScaleSize *MaxSizeCapability `json:"scaleSize,omitempty"` - // LogSize - READ-ONLY; Size of transaction log. - LogSize *LogSizeCapability `json:"logSize,omitempty"` - // Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' - Status CapabilityStatus `json:"status,omitempty"` - // Reason - The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` -} - -// Metric database metrics. -type Metric struct { - // StartTime - READ-ONLY; The start time for the metric (ISO-8601 format). - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - READ-ONLY; The end time for the metric (ISO-8601 format). - EndTime *date.Time `json:"endTime,omitempty"` - // TimeGrain - READ-ONLY; The time step to be used to summarize the metric values. - TimeGrain *string `json:"timeGrain,omitempty"` - // Unit - READ-ONLY; The unit of the metric. Possible values include: 'UnitTypeCount', 'UnitTypeBytes', 'UnitTypeSeconds', 'UnitTypePercent', 'UnitTypeCountPerSecond', 'UnitTypeBytesPerSecond' - Unit UnitType `json:"unit,omitempty"` - // Name - READ-ONLY; The name information for the metric. - Name *MetricName `json:"name,omitempty"` - // MetricValues - READ-ONLY; The metric values for the specified time window and timestep. - MetricValues *[]MetricValue `json:"metricValues,omitempty"` -} - -// MetricAvailability a metric availability value. -type MetricAvailability struct { - // Retention - READ-ONLY; The length of retention for the database metric. - Retention *string `json:"retention,omitempty"` - // TimeGrain - READ-ONLY; The granularity of the database metric. - TimeGrain *string `json:"timeGrain,omitempty"` -} - -// MetricDefinition a database metric definition. -type MetricDefinition struct { - // Name - READ-ONLY; The name information for the metric. - Name *MetricName `json:"name,omitempty"` - // PrimaryAggregationType - READ-ONLY; The primary aggregation type defining how metric values are displayed. Possible values include: 'None', 'Average', 'Count', 'Minimum', 'Maximum', 'Total' - PrimaryAggregationType PrimaryAggregationType `json:"primaryAggregationType,omitempty"` - // ResourceURI - READ-ONLY; The resource uri of the database. - ResourceURI *string `json:"resourceUri,omitempty"` - // Unit - READ-ONLY; The unit of the metric. Possible values include: 'UnitDefinitionTypeCount', 'UnitDefinitionTypeBytes', 'UnitDefinitionTypeSeconds', 'UnitDefinitionTypePercent', 'UnitDefinitionTypeCountPerSecond', 'UnitDefinitionTypeBytesPerSecond' - Unit UnitDefinitionType `json:"unit,omitempty"` - // MetricAvailabilities - READ-ONLY; The list of database metric availabilities for the metric. - MetricAvailabilities *[]MetricAvailability `json:"metricAvailabilities,omitempty"` -} - -// MetricDefinitionListResult the response to a list database metric definitions request. -type MetricDefinitionListResult struct { - autorest.Response `json:"-"` - // Value - The list of metric definitions for the database. - Value *[]MetricDefinition `json:"value,omitempty"` -} - -// MetricListResult the response to a list database metrics request. -type MetricListResult struct { - autorest.Response `json:"-"` - // Value - The list of metrics for the database. - Value *[]Metric `json:"value,omitempty"` -} - -// MetricName a database metric name. -type MetricName struct { - // Value - READ-ONLY; The name of the database metric. - Value *string `json:"value,omitempty"` - // LocalizedValue - READ-ONLY; The friendly name of the database metric. - LocalizedValue *string `json:"localizedValue,omitempty"` -} - -// MetricValue represents database metrics. -type MetricValue struct { - // Count - READ-ONLY; The number of values for the metric. - Count *float64 `json:"count,omitempty"` - // Average - READ-ONLY; The average value of the metric. - Average *float64 `json:"average,omitempty"` - // Maximum - READ-ONLY; The max value of the metric. - Maximum *float64 `json:"maximum,omitempty"` - // Minimum - READ-ONLY; The min value of the metric. - Minimum *float64 `json:"minimum,omitempty"` - // Timestamp - READ-ONLY; The metric timestamp (ISO-8601 format). - Timestamp *date.Time `json:"timestamp,omitempty"` - // Total - READ-ONLY; The total value of the metric. - Total *float64 `json:"total,omitempty"` -} - -// Name ARM Usage Name -type Name struct { - // Value - Usage name value - Value *string `json:"value,omitempty"` - // LocalizedValue - Usage name localized value. - LocalizedValue *string `json:"localizedValue,omitempty"` -} - -// Operation SQL REST API operation definition. -type Operation struct { - // Name - READ-ONLY; The name of the operation being performed on this particular object. - Name *string `json:"name,omitempty"` - // Display - READ-ONLY; The localized display information for this particular operation / action. - Display *OperationDisplay `json:"display,omitempty"` - // Origin - READ-ONLY; The intended executor of the operation. Possible values include: 'OperationOriginUser', 'OperationOriginSystem' - Origin OperationOrigin `json:"origin,omitempty"` - // Properties - READ-ONLY; Additional descriptions for the operation. - Properties map[string]interface{} `json:"properties"` -} - -// MarshalJSON is the custom marshaler for Operation. -func (o Operation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// OperationDisplay display metadata associated with the operation. -type OperationDisplay struct { - // Provider - READ-ONLY; The localized friendly form of the resource provider name. - Provider *string `json:"provider,omitempty"` - // Resource - READ-ONLY; The localized friendly form of the resource type related to this action/operation. - Resource *string `json:"resource,omitempty"` - // Operation - READ-ONLY; The localized friendly name for the operation. - Operation *string `json:"operation,omitempty"` - // Description - READ-ONLY; The localized friendly description for the operation. - Description *string `json:"description,omitempty"` -} - -// OperationImpact the impact of an operation, both in absolute and relative terms. -type OperationImpact struct { - // Name - READ-ONLY; The name of the impact dimension. - Name *string `json:"name,omitempty"` - // Unit - READ-ONLY; The unit in which estimated impact to dimension is measured. - Unit *string `json:"unit,omitempty"` - // ChangeValueAbsolute - READ-ONLY; The absolute impact to dimension. - ChangeValueAbsolute *float64 `json:"changeValueAbsolute,omitempty"` - // ChangeValueRelative - READ-ONLY; The relative impact to dimension (null if not applicable) - ChangeValueRelative *float64 `json:"changeValueRelative,omitempty"` -} - -// OperationListResult result of the request to list SQL operations. -type OperationListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]Operation `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// OperationListResultIterator provides access to a complete listing of Operation values. -type OperationListResultIterator struct { - i int - page OperationListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *OperationListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter OperationListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter OperationListResultIterator) Response() OperationListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter OperationListResultIterator) Value() Operation { - if !iter.page.NotDone() { - return Operation{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the OperationListResultIterator type. -func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { - return OperationListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (olr OperationListResult) IsEmpty() bool { - return olr.Value == nil || len(*olr.Value) == 0 -} - -// operationListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { - if olr.NextLink == nil || len(to.String(olr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(olr.NextLink))) -} - -// OperationListResultPage contains a page of Operation values. -type OperationListResultPage struct { - fn func(context.Context, OperationListResult) (OperationListResult, error) - olr OperationListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - next, err := page.fn(ctx, page.olr) - if err != nil { - return err - } - page.olr = next - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *OperationListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page OperationListResultPage) NotDone() bool { - return !page.olr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page OperationListResultPage) Response() OperationListResult { - return page.olr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page OperationListResultPage) Values() []Operation { - if page.olr.IsEmpty() { - return nil - } - return *page.olr.Value -} - -// Creates a new instance of the OperationListResultPage type. -func NewOperationListResultPage(getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { - return OperationListResultPage{fn: getNextPage} -} - -// PartnerInfo partner server information for the failover group. -type PartnerInfo struct { - // ID - Resource identifier of the partner server. - ID *string `json:"id,omitempty"` - // Location - READ-ONLY; Geo location of the partner server. - Location *string `json:"location,omitempty"` - // ReplicationRole - READ-ONLY; Replication role of the partner server. Possible values include: 'Primary', 'Secondary' - ReplicationRole FailoverGroupReplicationRole `json:"replicationRole,omitempty"` -} - -// PartnerRegionInfo partner region information for the failover group. -type PartnerRegionInfo struct { - // Location - Geo location of the partner managed instances. - Location *string `json:"location,omitempty"` - // ReplicationRole - READ-ONLY; Replication role of the partner managed instances. Possible values include: 'InstanceFailoverGroupReplicationRolePrimary', 'InstanceFailoverGroupReplicationRoleSecondary' - ReplicationRole InstanceFailoverGroupReplicationRole `json:"replicationRole,omitempty"` -} - -// PerformanceLevelCapability the performance level capability. -type PerformanceLevelCapability struct { - // Value - READ-ONLY; Performance level value. - Value *float64 `json:"value,omitempty"` - // Unit - READ-ONLY; Unit type used to measure performance level. Possible values include: 'DTU', 'VCores' - Unit PerformanceLevelUnit `json:"unit,omitempty"` -} - -// PrivateEndpointConnection a private endpoint connection -type PrivateEndpointConnection struct { - autorest.Response `json:"-"` - // PrivateEndpointConnectionProperties - Resource properties. - *PrivateEndpointConnectionProperties `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 PrivateEndpointConnection. -func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pec.PrivateEndpointConnectionProperties != nil { - objectMap["properties"] = pec.PrivateEndpointConnectionProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct. -func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var privateEndpointConnectionProperties PrivateEndpointConnectionProperties - err = json.Unmarshal(*v, &privateEndpointConnectionProperties) - if err != nil { - return err - } - pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - pec.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - pec.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - pec.Type = &typeVar - } - } - } - - return nil -} - -// PrivateEndpointConnectionListResult a list of private endpoint connections. -type PrivateEndpointConnectionListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]PrivateEndpointConnection `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// PrivateEndpointConnectionListResultIterator provides access to a complete listing of -// PrivateEndpointConnection values. -type PrivateEndpointConnectionListResultIterator struct { - i int - page PrivateEndpointConnectionListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *PrivateEndpointConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *PrivateEndpointConnectionListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter PrivateEndpointConnectionListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter PrivateEndpointConnectionListResultIterator) Response() PrivateEndpointConnectionListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter PrivateEndpointConnectionListResultIterator) Value() PrivateEndpointConnection { - if !iter.page.NotDone() { - return PrivateEndpointConnection{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the PrivateEndpointConnectionListResultIterator type. -func NewPrivateEndpointConnectionListResultIterator(page PrivateEndpointConnectionListResultPage) PrivateEndpointConnectionListResultIterator { - return PrivateEndpointConnectionListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (peclr PrivateEndpointConnectionListResult) IsEmpty() bool { - return peclr.Value == nil || len(*peclr.Value) == 0 -} - -// privateEndpointConnectionListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (peclr PrivateEndpointConnectionListResult) privateEndpointConnectionListResultPreparer(ctx context.Context) (*http.Request, error) { - if peclr.NextLink == nil || len(to.String(peclr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(peclr.NextLink))) -} - -// PrivateEndpointConnectionListResultPage contains a page of PrivateEndpointConnection values. -type PrivateEndpointConnectionListResultPage struct { - fn func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error) - peclr PrivateEndpointConnectionListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *PrivateEndpointConnectionListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - next, err := page.fn(ctx, page.peclr) - if err != nil { - return err - } - page.peclr = 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 *PrivateEndpointConnectionListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page PrivateEndpointConnectionListResultPage) NotDone() bool { - return !page.peclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page PrivateEndpointConnectionListResultPage) Response() PrivateEndpointConnectionListResult { - return page.peclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page PrivateEndpointConnectionListResultPage) Values() []PrivateEndpointConnection { - if page.peclr.IsEmpty() { - return nil - } - return *page.peclr.Value -} - -// Creates a new instance of the PrivateEndpointConnectionListResultPage type. -func NewPrivateEndpointConnectionListResultPage(getNextPage func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error)) PrivateEndpointConnectionListResultPage { - return PrivateEndpointConnectionListResultPage{fn: getNextPage} -} - -// PrivateEndpointConnectionProperties properties of a private endpoint connection. -type PrivateEndpointConnectionProperties struct { - // PrivateEndpoint - Private endpoint which the connection belongs to. - PrivateEndpoint *PrivateEndpointProperty `json:"privateEndpoint,omitempty"` - // PrivateLinkServiceConnectionState - Connection state of the private endpoint connection. - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionStateProperty `json:"privateLinkServiceConnectionState,omitempty"` - // ProvisioningState - READ-ONLY; State of the private endpoint connection. - ProvisioningState *string `json:"provisioningState,omitempty"` -} - -// PrivateEndpointConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type PrivateEndpointConnectionsCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) Result(client PrivateEndpointConnectionsClient) (pec PrivateEndpointConnection, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.PrivateEndpointConnectionsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if pec.Response.Response, err = future.GetResult(sender); err == nil && pec.Response.Response.StatusCode != http.StatusNoContent { - pec, err = client.CreateOrUpdateResponder(pec.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", pec.Response.Response, "Failure responding to request") - } - } - return -} - -// PrivateEndpointConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type PrivateEndpointConnectionsDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *PrivateEndpointConnectionsDeleteFuture) Result(client PrivateEndpointConnectionsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.PrivateEndpointConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.PrivateEndpointConnectionsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// PrivateEndpointProperty ... -type PrivateEndpointProperty struct { - // ID - Resource id of the private endpoint. - ID *string `json:"id,omitempty"` -} - -// PrivateLinkResource a private link resource -type PrivateLinkResource struct { - autorest.Response `json:"-"` - // Properties - READ-ONLY; The private link resource group id. - Properties *PrivateLinkResourceProperties `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"` -} - -// PrivateLinkResourceListResult a list of private link resources -type PrivateLinkResourceListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]PrivateLinkResource `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// PrivateLinkResourceListResultIterator provides access to a complete listing of PrivateLinkResource -// values. -type PrivateLinkResourceListResultIterator struct { - i int - page PrivateLinkResourceListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *PrivateLinkResourceListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourceListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *PrivateLinkResourceListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter PrivateLinkResourceListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter PrivateLinkResourceListResultIterator) Response() PrivateLinkResourceListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter PrivateLinkResourceListResultIterator) Value() PrivateLinkResource { - if !iter.page.NotDone() { - return PrivateLinkResource{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the PrivateLinkResourceListResultIterator type. -func NewPrivateLinkResourceListResultIterator(page PrivateLinkResourceListResultPage) PrivateLinkResourceListResultIterator { - return PrivateLinkResourceListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (plrlr PrivateLinkResourceListResult) IsEmpty() bool { - return plrlr.Value == nil || len(*plrlr.Value) == 0 -} - -// privateLinkResourceListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (plrlr PrivateLinkResourceListResult) privateLinkResourceListResultPreparer(ctx context.Context) (*http.Request, error) { - if plrlr.NextLink == nil || len(to.String(plrlr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(plrlr.NextLink))) -} - -// PrivateLinkResourceListResultPage contains a page of PrivateLinkResource values. -type PrivateLinkResourceListResultPage struct { - fn func(context.Context, PrivateLinkResourceListResult) (PrivateLinkResourceListResult, error) - plrlr PrivateLinkResourceListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *PrivateLinkResourceListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourceListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - next, err := page.fn(ctx, page.plrlr) - if err != nil { - return err - } - page.plrlr = 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 *PrivateLinkResourceListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page PrivateLinkResourceListResultPage) NotDone() bool { - return !page.plrlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page PrivateLinkResourceListResultPage) Response() PrivateLinkResourceListResult { - return page.plrlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page PrivateLinkResourceListResultPage) Values() []PrivateLinkResource { - if page.plrlr.IsEmpty() { - return nil - } - return *page.plrlr.Value -} - -// Creates a new instance of the PrivateLinkResourceListResultPage type. -func NewPrivateLinkResourceListResultPage(getNextPage func(context.Context, PrivateLinkResourceListResult) (PrivateLinkResourceListResult, error)) PrivateLinkResourceListResultPage { - return PrivateLinkResourceListResultPage{fn: getNextPage} -} - -// PrivateLinkResourceProperties properties of a private link resource. -type PrivateLinkResourceProperties struct { - // GroupID - READ-ONLY; The private link resource group id. - GroupID *string `json:"groupId,omitempty"` - // RequiredMembers - READ-ONLY; The private link resource required member names. - RequiredMembers *[]string `json:"requiredMembers,omitempty"` -} - -// PrivateLinkServiceConnectionStateProperty ... -type PrivateLinkServiceConnectionStateProperty struct { - // Status - The private link service connection status. - Status *string `json:"status,omitempty"` - // Description - The private link service connection description. - Description *string `json:"description,omitempty"` - // ActionsRequired - READ-ONLY; The actions required for private link service connection. - ActionsRequired *string `json:"actionsRequired,omitempty"` -} - -// ProxyResource ARM proxy resource. -type ProxyResource struct { - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` -} - -// RecommendedElasticPool represents a recommended elastic pool. -type RecommendedElasticPool struct { - autorest.Response `json:"-"` - // RecommendedElasticPoolProperties - The properties representing the resource. - *RecommendedElasticPoolProperties `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 RecommendedElasticPool. -func (rep RecommendedElasticPool) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rep.RecommendedElasticPoolProperties != nil { - objectMap["properties"] = rep.RecommendedElasticPoolProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for RecommendedElasticPool struct. -func (rep *RecommendedElasticPool) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var recommendedElasticPoolProperties RecommendedElasticPoolProperties - err = json.Unmarshal(*v, &recommendedElasticPoolProperties) - if err != nil { - return err - } - rep.RecommendedElasticPoolProperties = &recommendedElasticPoolProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - rep.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - rep.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - rep.Type = &typeVar - } - } - } - - return nil -} - -// RecommendedElasticPoolListMetricsResult represents the response to a list recommended elastic pool -// metrics request. -type RecommendedElasticPoolListMetricsResult struct { - autorest.Response `json:"-"` - // Value - The list of recommended elastic pools metrics. - Value *[]RecommendedElasticPoolMetric `json:"value,omitempty"` -} - -// RecommendedElasticPoolListResult represents the response to a list recommended elastic pool request. -type RecommendedElasticPoolListResult struct { - autorest.Response `json:"-"` - // Value - The list of recommended elastic pools hosted in the server. - Value *[]RecommendedElasticPool `json:"value,omitempty"` -} - -// RecommendedElasticPoolMetric represents recommended elastic pool metric. -type RecommendedElasticPoolMetric struct { - // DateTime - The time of metric (ISO8601 format). - DateTime *date.Time `json:"dateTime,omitempty"` - // Dtu - Gets or sets the DTUs (Database Transaction Units). See https://azure.microsoft.com/documentation/articles/sql-database-what-is-a-dtu/ - Dtu *float64 `json:"dtu,omitempty"` - // SizeGB - Gets or sets size in gigabytes. - SizeGB *float64 `json:"sizeGB,omitempty"` -} - -// RecommendedElasticPoolProperties represents the properties of a recommended elastic pool. -type RecommendedElasticPoolProperties struct { - // DatabaseEdition - READ-ONLY; The edition of the recommended elastic pool. The ElasticPoolEdition enumeration contains all the valid editions. Possible values include: 'ElasticPoolEditionBasic', 'ElasticPoolEditionStandard', 'ElasticPoolEditionPremium', 'ElasticPoolEditionGeneralPurpose', 'ElasticPoolEditionBusinessCritical' - DatabaseEdition ElasticPoolEdition `json:"databaseEdition,omitempty"` - // Dtu - The DTU for the recommended elastic pool. - Dtu *float64 `json:"dtu,omitempty"` - // DatabaseDtuMin - The minimum DTU for the database. - DatabaseDtuMin *float64 `json:"databaseDtuMin,omitempty"` - // DatabaseDtuMax - The maximum DTU for the database. - DatabaseDtuMax *float64 `json:"databaseDtuMax,omitempty"` - // StorageMB - Gets storage size in megabytes. - StorageMB *float64 `json:"storageMB,omitempty"` - // ObservationPeriodStart - READ-ONLY; The observation period start (ISO8601 format). - ObservationPeriodStart *date.Time `json:"observationPeriodStart,omitempty"` - // ObservationPeriodEnd - READ-ONLY; The observation period start (ISO8601 format). - ObservationPeriodEnd *date.Time `json:"observationPeriodEnd,omitempty"` - // MaxObservedDtu - READ-ONLY; Gets maximum observed DTU. - MaxObservedDtu *float64 `json:"maxObservedDtu,omitempty"` - // MaxObservedStorageMB - READ-ONLY; Gets maximum observed storage in megabytes. - MaxObservedStorageMB *float64 `json:"maxObservedStorageMB,omitempty"` - // Databases - READ-ONLY; The list of databases in this pool. Expanded property - Databases *[]TrackedResource `json:"databases,omitempty"` - // Metrics - READ-ONLY; The list of databases housed in the server. Expanded property - Metrics *[]RecommendedElasticPoolMetric `json:"metrics,omitempty"` -} - -// RecommendedIndex represents a database recommended index. -type RecommendedIndex struct { - // RecommendedIndexProperties - READ-ONLY; The properties representing the resource. - *RecommendedIndexProperties `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 RecommendedIndex. -func (ri RecommendedIndex) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for RecommendedIndex struct. -func (ri *RecommendedIndex) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var recommendedIndexProperties RecommendedIndexProperties - err = json.Unmarshal(*v, &recommendedIndexProperties) - if err != nil { - return err - } - ri.RecommendedIndexProperties = &recommendedIndexProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ri.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ri.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ri.Type = &typeVar - } - } - } - - return nil -} - -// RecommendedIndexProperties represents the properties of a database recommended index. -type RecommendedIndexProperties struct { - // Action - READ-ONLY; The proposed index action. You can create a missing index, drop an unused index, or rebuild an existing index to improve its performance. Possible values include: 'Create', 'Drop', 'Rebuild' - Action RecommendedIndexAction `json:"action,omitempty"` - // State - READ-ONLY; The current recommendation state. Possible values include: 'Active', 'Pending', 'Executing', 'Verifying', 'PendingRevert', 'Reverting', 'Reverted', 'Ignored', 'Expired', 'Blocked', 'Success' - State RecommendedIndexState `json:"state,omitempty"` - // Created - READ-ONLY; The UTC datetime showing when this resource was created (ISO8601 format). - Created *date.Time `json:"created,omitempty"` - // LastModified - READ-ONLY; The UTC datetime of when was this resource last changed (ISO8601 format). - LastModified *date.Time `json:"lastModified,omitempty"` - // IndexType - READ-ONLY; The type of index (CLUSTERED, NONCLUSTERED, COLUMNSTORE, CLUSTERED COLUMNSTORE). Possible values include: 'CLUSTERED', 'NONCLUSTERED', 'COLUMNSTORE', 'CLUSTEREDCOLUMNSTORE' - IndexType RecommendedIndexType `json:"indexType,omitempty"` - // Schema - READ-ONLY; The schema where table to build index over resides - Schema *string `json:"schema,omitempty"` - // Table - READ-ONLY; The table on which to build index. - Table *string `json:"table,omitempty"` - // Columns - READ-ONLY; Columns over which to build index - Columns *[]string `json:"columns,omitempty"` - // IncludedColumns - READ-ONLY; The list of column names to be included in the index - IncludedColumns *[]string `json:"includedColumns,omitempty"` - // IndexScript - READ-ONLY; The full build index script - IndexScript *string `json:"indexScript,omitempty"` - // EstimatedImpact - READ-ONLY; The estimated impact of doing recommended index action. - EstimatedImpact *[]OperationImpact `json:"estimatedImpact,omitempty"` - // ReportedImpact - READ-ONLY; The values reported after index action is complete. - ReportedImpact *[]OperationImpact `json:"reportedImpact,omitempty"` -} - -// RecoverableDatabase a recoverable database -type RecoverableDatabase struct { - autorest.Response `json:"-"` - // RecoverableDatabaseProperties - The properties of a recoverable database - *RecoverableDatabaseProperties `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 RecoverableDatabase. -func (rd RecoverableDatabase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rd.RecoverableDatabaseProperties != nil { - objectMap["properties"] = rd.RecoverableDatabaseProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for RecoverableDatabase struct. -func (rd *RecoverableDatabase) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var recoverableDatabaseProperties RecoverableDatabaseProperties - err = json.Unmarshal(*v, &recoverableDatabaseProperties) - if err != nil { - return err - } - rd.RecoverableDatabaseProperties = &recoverableDatabaseProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - rd.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - rd.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - rd.Type = &typeVar - } - } - } - - return nil -} - -// RecoverableDatabaseListResult the response to a list recoverable databases request -type RecoverableDatabaseListResult struct { - autorest.Response `json:"-"` - // Value - A list of recoverable databases - Value *[]RecoverableDatabase `json:"value,omitempty"` -} - -// RecoverableDatabaseProperties the properties of a recoverable database -type RecoverableDatabaseProperties struct { - // Edition - READ-ONLY; The edition of the database - Edition *string `json:"edition,omitempty"` - // ServiceLevelObjective - READ-ONLY; The service level objective name of the database - ServiceLevelObjective *string `json:"serviceLevelObjective,omitempty"` - // ElasticPoolName - READ-ONLY; The elastic pool name of the database - ElasticPoolName *string `json:"elasticPoolName,omitempty"` - // LastAvailableBackupDate - READ-ONLY; The last available backup date of the database (ISO8601 format) - LastAvailableBackupDate *date.Time `json:"lastAvailableBackupDate,omitempty"` -} - -// RecoverableManagedDatabase a recoverable managed database resource. -type RecoverableManagedDatabase struct { - autorest.Response `json:"-"` - // RecoverableManagedDatabaseProperties - Resource properties. - *RecoverableManagedDatabaseProperties `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 RecoverableManagedDatabase. -func (rmd RecoverableManagedDatabase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rmd.RecoverableManagedDatabaseProperties != nil { - objectMap["properties"] = rmd.RecoverableManagedDatabaseProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for RecoverableManagedDatabase struct. -func (rmd *RecoverableManagedDatabase) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var recoverableManagedDatabaseProperties RecoverableManagedDatabaseProperties - err = json.Unmarshal(*v, &recoverableManagedDatabaseProperties) - if err != nil { - return err - } - rmd.RecoverableManagedDatabaseProperties = &recoverableManagedDatabaseProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - rmd.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - rmd.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - rmd.Type = &typeVar - } - } - } - - return nil -} - -// RecoverableManagedDatabaseListResult a list of recoverable managed databases. -type RecoverableManagedDatabaseListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]RecoverableManagedDatabase `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// RecoverableManagedDatabaseListResultIterator provides access to a complete listing of -// RecoverableManagedDatabase values. -type RecoverableManagedDatabaseListResultIterator struct { - i int - page RecoverableManagedDatabaseListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *RecoverableManagedDatabaseListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RecoverableManagedDatabaseListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *RecoverableManagedDatabaseListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter RecoverableManagedDatabaseListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter RecoverableManagedDatabaseListResultIterator) Response() RecoverableManagedDatabaseListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter RecoverableManagedDatabaseListResultIterator) Value() RecoverableManagedDatabase { - if !iter.page.NotDone() { - return RecoverableManagedDatabase{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the RecoverableManagedDatabaseListResultIterator type. -func NewRecoverableManagedDatabaseListResultIterator(page RecoverableManagedDatabaseListResultPage) RecoverableManagedDatabaseListResultIterator { - return RecoverableManagedDatabaseListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rmdlr RecoverableManagedDatabaseListResult) IsEmpty() bool { - return rmdlr.Value == nil || len(*rmdlr.Value) == 0 -} - -// recoverableManagedDatabaseListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rmdlr RecoverableManagedDatabaseListResult) recoverableManagedDatabaseListResultPreparer(ctx context.Context) (*http.Request, error) { - if rmdlr.NextLink == nil || len(to.String(rmdlr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rmdlr.NextLink))) -} - -// RecoverableManagedDatabaseListResultPage contains a page of RecoverableManagedDatabase values. -type RecoverableManagedDatabaseListResultPage struct { - fn func(context.Context, RecoverableManagedDatabaseListResult) (RecoverableManagedDatabaseListResult, error) - rmdlr RecoverableManagedDatabaseListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *RecoverableManagedDatabaseListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RecoverableManagedDatabaseListResultPage.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.rmdlr) - if err != nil { - return err - } - page.rmdlr = 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 *RecoverableManagedDatabaseListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page RecoverableManagedDatabaseListResultPage) NotDone() bool { - return !page.rmdlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page RecoverableManagedDatabaseListResultPage) Response() RecoverableManagedDatabaseListResult { - return page.rmdlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page RecoverableManagedDatabaseListResultPage) Values() []RecoverableManagedDatabase { - if page.rmdlr.IsEmpty() { - return nil - } - return *page.rmdlr.Value -} - -// Creates a new instance of the RecoverableManagedDatabaseListResultPage type. -func NewRecoverableManagedDatabaseListResultPage(getNextPage func(context.Context, RecoverableManagedDatabaseListResult) (RecoverableManagedDatabaseListResult, error)) RecoverableManagedDatabaseListResultPage { - return RecoverableManagedDatabaseListResultPage{fn: getNextPage} -} - -// RecoverableManagedDatabaseProperties the recoverable managed database's properties. -type RecoverableManagedDatabaseProperties struct { - // LastAvailableBackupDate - READ-ONLY; The last available backup date. - LastAvailableBackupDate *string `json:"lastAvailableBackupDate,omitempty"` -} - -// ReplicationLink represents a database replication link. -type ReplicationLink struct { - autorest.Response `json:"-"` - // Location - READ-ONLY; Location of the server that contains this firewall rule. - Location *string `json:"location,omitempty"` - // ReplicationLinkProperties - The properties representing the resource. - *ReplicationLinkProperties `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 ReplicationLink. -func (rl ReplicationLink) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rl.ReplicationLinkProperties != nil { - objectMap["properties"] = rl.ReplicationLinkProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ReplicationLink struct. -func (rl *ReplicationLink) UnmarshalJSON(body []byte) error { - 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 - } - rl.Location = &location - } - case "properties": - if v != nil { - var replicationLinkProperties ReplicationLinkProperties - err = json.Unmarshal(*v, &replicationLinkProperties) - if err != nil { - return err - } - rl.ReplicationLinkProperties = &replicationLinkProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - rl.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - rl.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - rl.Type = &typeVar - } - } - } - - return nil -} - -// ReplicationLinkListResult represents the response to a List database replication link request. -type ReplicationLinkListResult struct { - autorest.Response `json:"-"` - // Value - The list of database replication links housed in the database. - Value *[]ReplicationLink `json:"value,omitempty"` -} - -// ReplicationLinkProperties represents the properties of a database replication link. -type ReplicationLinkProperties struct { - // IsTerminationAllowed - READ-ONLY; Legacy value indicating whether termination is allowed. Currently always returns true. - IsTerminationAllowed *bool `json:"isTerminationAllowed,omitempty"` - // ReplicationMode - READ-ONLY; Replication mode of this replication link. - ReplicationMode *string `json:"replicationMode,omitempty"` - // PartnerServer - READ-ONLY; The name of the server hosting the partner database. - PartnerServer *string `json:"partnerServer,omitempty"` - // PartnerDatabase - READ-ONLY; The name of the partner database. - PartnerDatabase *string `json:"partnerDatabase,omitempty"` - // PartnerLocation - READ-ONLY; The Azure Region of the partner database. - PartnerLocation *string `json:"partnerLocation,omitempty"` - // Role - READ-ONLY; The role of the database in the replication link. Possible values include: 'ReplicationRolePrimary', 'ReplicationRoleSecondary', 'ReplicationRoleNonReadableSecondary', 'ReplicationRoleSource', 'ReplicationRoleCopy' - Role ReplicationRole `json:"role,omitempty"` - // PartnerRole - READ-ONLY; The role of the partner database in the replication link. Possible values include: 'ReplicationRolePrimary', 'ReplicationRoleSecondary', 'ReplicationRoleNonReadableSecondary', 'ReplicationRoleSource', 'ReplicationRoleCopy' - PartnerRole ReplicationRole `json:"partnerRole,omitempty"` - // StartTime - READ-ONLY; The start time for the replication link. - StartTime *date.Time `json:"startTime,omitempty"` - // PercentComplete - READ-ONLY; The percentage of seeding complete for the replication link. - PercentComplete *int32 `json:"percentComplete,omitempty"` - // ReplicationState - READ-ONLY; The replication state for the replication link. Possible values include: 'PENDING', 'SEEDING', 'CATCHUP', 'SUSPENDED' - ReplicationState ReplicationState `json:"replicationState,omitempty"` -} - -// ReplicationLinksFailoverAllowDataLossFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type ReplicationLinksFailoverAllowDataLossFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ReplicationLinksFailoverAllowDataLossFuture) Result(client ReplicationLinksClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ReplicationLinksFailoverAllowDataLossFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ReplicationLinksFailoverAllowDataLossFuture") - return - } - ar.Response = future.Response() - return -} - -// ReplicationLinksFailoverFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ReplicationLinksFailoverFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ReplicationLinksFailoverFuture) Result(client ReplicationLinksClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ReplicationLinksFailoverFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ReplicationLinksFailoverFuture") - return - } - ar.Response = future.Response() - return -} - -// Resource ARM resource. -type Resource struct { - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` -} - -// ResourceIdentity azure Active Directory identity configuration for a resource. -type ResourceIdentity struct { - // PrincipalID - READ-ONLY; The Azure Active Directory principal id. - PrincipalID *uuid.UUID `json:"principalId,omitempty"` - // Type - The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal for the resource. Possible values include: 'SystemAssigned' - Type IdentityType `json:"type,omitempty"` - // TenantID - READ-ONLY; The Azure Active Directory tenant id. - TenantID *uuid.UUID `json:"tenantId,omitempty"` -} - -// ResourceMoveDefinition contains the information necessary to perform a resource move (rename). -type ResourceMoveDefinition struct { - // ID - The target ID for the resource - ID *string `json:"id,omitempty"` -} - -// RestorableDroppedDatabase a restorable dropped database -type RestorableDroppedDatabase struct { - autorest.Response `json:"-"` - // Location - READ-ONLY; The geo-location where the resource lives - Location *string `json:"location,omitempty"` - // RestorableDroppedDatabaseProperties - The properties of a restorable dropped database - *RestorableDroppedDatabaseProperties `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 RestorableDroppedDatabase. -func (rdd RestorableDroppedDatabase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rdd.RestorableDroppedDatabaseProperties != nil { - objectMap["properties"] = rdd.RestorableDroppedDatabaseProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for RestorableDroppedDatabase struct. -func (rdd *RestorableDroppedDatabase) UnmarshalJSON(body []byte) error { - 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 - } - rdd.Location = &location - } - case "properties": - if v != nil { - var restorableDroppedDatabaseProperties RestorableDroppedDatabaseProperties - err = json.Unmarshal(*v, &restorableDroppedDatabaseProperties) - if err != nil { - return err - } - rdd.RestorableDroppedDatabaseProperties = &restorableDroppedDatabaseProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - rdd.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - rdd.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - rdd.Type = &typeVar - } - } - } - - return nil -} - -// RestorableDroppedDatabaseListResult the response to a list restorable dropped databases request -type RestorableDroppedDatabaseListResult struct { - autorest.Response `json:"-"` - // Value - A list of restorable dropped databases - Value *[]RestorableDroppedDatabase `json:"value,omitempty"` -} - -// RestorableDroppedDatabaseProperties the properties of a restorable dropped database -type RestorableDroppedDatabaseProperties struct { - // DatabaseName - READ-ONLY; The name of the database - DatabaseName *string `json:"databaseName,omitempty"` - // Edition - READ-ONLY; The edition of the database - Edition *string `json:"edition,omitempty"` - // MaxSizeBytes - READ-ONLY; The max size in bytes of the database - MaxSizeBytes *string `json:"maxSizeBytes,omitempty"` - // ServiceLevelObjective - READ-ONLY; The service level objective name of the database - ServiceLevelObjective *string `json:"serviceLevelObjective,omitempty"` - // ElasticPoolName - READ-ONLY; The elastic pool name of the database - ElasticPoolName *string `json:"elasticPoolName,omitempty"` - // CreationDate - READ-ONLY; The creation date of the database (ISO8601 format) - CreationDate *date.Time `json:"creationDate,omitempty"` - // DeletionDate - READ-ONLY; The deletion date of the database (ISO8601 format) - DeletionDate *date.Time `json:"deletionDate,omitempty"` - // EarliestRestoreDate - READ-ONLY; The earliest restore date of the database (ISO8601 format) - EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"` -} - -// RestorableDroppedManagedDatabase a restorable dropped managed database resource. -type RestorableDroppedManagedDatabase struct { - autorest.Response `json:"-"` - // RestorableDroppedManagedDatabaseProperties - Resource properties. - *RestorableDroppedManagedDatabaseProperties `json:"properties,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for RestorableDroppedManagedDatabase. -func (rdmd RestorableDroppedManagedDatabase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rdmd.RestorableDroppedManagedDatabaseProperties != nil { - objectMap["properties"] = rdmd.RestorableDroppedManagedDatabaseProperties - } - if rdmd.Location != nil { - objectMap["location"] = rdmd.Location - } - if rdmd.Tags != nil { - objectMap["tags"] = rdmd.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for RestorableDroppedManagedDatabase struct. -func (rdmd *RestorableDroppedManagedDatabase) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var restorableDroppedManagedDatabaseProperties RestorableDroppedManagedDatabaseProperties - err = json.Unmarshal(*v, &restorableDroppedManagedDatabaseProperties) - if err != nil { - return err - } - rdmd.RestorableDroppedManagedDatabaseProperties = &restorableDroppedManagedDatabaseProperties - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - rdmd.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - rdmd.Tags = tags - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - rdmd.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - rdmd.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - rdmd.Type = &typeVar - } - } - } - - return nil -} - -// RestorableDroppedManagedDatabaseListResult a list of restorable dropped managed databases. -type RestorableDroppedManagedDatabaseListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]RestorableDroppedManagedDatabase `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// RestorableDroppedManagedDatabaseListResultIterator provides access to a complete listing of -// RestorableDroppedManagedDatabase values. -type RestorableDroppedManagedDatabaseListResultIterator struct { - i int - page RestorableDroppedManagedDatabaseListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *RestorableDroppedManagedDatabaseListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RestorableDroppedManagedDatabaseListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *RestorableDroppedManagedDatabaseListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter RestorableDroppedManagedDatabaseListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter RestorableDroppedManagedDatabaseListResultIterator) Response() RestorableDroppedManagedDatabaseListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter RestorableDroppedManagedDatabaseListResultIterator) Value() RestorableDroppedManagedDatabase { - if !iter.page.NotDone() { - return RestorableDroppedManagedDatabase{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the RestorableDroppedManagedDatabaseListResultIterator type. -func NewRestorableDroppedManagedDatabaseListResultIterator(page RestorableDroppedManagedDatabaseListResultPage) RestorableDroppedManagedDatabaseListResultIterator { - return RestorableDroppedManagedDatabaseListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rdmdlr RestorableDroppedManagedDatabaseListResult) IsEmpty() bool { - return rdmdlr.Value == nil || len(*rdmdlr.Value) == 0 -} - -// restorableDroppedManagedDatabaseListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rdmdlr RestorableDroppedManagedDatabaseListResult) restorableDroppedManagedDatabaseListResultPreparer(ctx context.Context) (*http.Request, error) { - if rdmdlr.NextLink == nil || len(to.String(rdmdlr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rdmdlr.NextLink))) -} - -// RestorableDroppedManagedDatabaseListResultPage contains a page of RestorableDroppedManagedDatabase -// values. -type RestorableDroppedManagedDatabaseListResultPage struct { - fn func(context.Context, RestorableDroppedManagedDatabaseListResult) (RestorableDroppedManagedDatabaseListResult, error) - rdmdlr RestorableDroppedManagedDatabaseListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *RestorableDroppedManagedDatabaseListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RestorableDroppedManagedDatabaseListResultPage.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.rdmdlr) - if err != nil { - return err - } - page.rdmdlr = 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 *RestorableDroppedManagedDatabaseListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page RestorableDroppedManagedDatabaseListResultPage) NotDone() bool { - return !page.rdmdlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page RestorableDroppedManagedDatabaseListResultPage) Response() RestorableDroppedManagedDatabaseListResult { - return page.rdmdlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page RestorableDroppedManagedDatabaseListResultPage) Values() []RestorableDroppedManagedDatabase { - if page.rdmdlr.IsEmpty() { - return nil - } - return *page.rdmdlr.Value -} - -// Creates a new instance of the RestorableDroppedManagedDatabaseListResultPage type. -func NewRestorableDroppedManagedDatabaseListResultPage(getNextPage func(context.Context, RestorableDroppedManagedDatabaseListResult) (RestorableDroppedManagedDatabaseListResult, error)) RestorableDroppedManagedDatabaseListResultPage { - return RestorableDroppedManagedDatabaseListResultPage{fn: getNextPage} -} - -// RestorableDroppedManagedDatabaseProperties the restorable dropped managed database's properties. -type RestorableDroppedManagedDatabaseProperties struct { - // DatabaseName - READ-ONLY; The name of the database. - DatabaseName *string `json:"databaseName,omitempty"` - // CreationDate - READ-ONLY; The creation date of the database (ISO8601 format). - CreationDate *date.Time `json:"creationDate,omitempty"` - // DeletionDate - READ-ONLY; The deletion date of the database (ISO8601 format). - DeletionDate *date.Time `json:"deletionDate,omitempty"` - // EarliestRestoreDate - READ-ONLY; The earliest restore date of the database (ISO8601 format). - EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"` -} - -// RestorePoint database restore points. -type RestorePoint struct { - autorest.Response `json:"-"` - // Location - READ-ONLY; Resource location. - Location *string `json:"location,omitempty"` - // RestorePointProperties - Resource properties. - *RestorePointProperties `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 RestorePoint. -func (rp RestorePoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rp.RestorePointProperties != nil { - objectMap["properties"] = rp.RestorePointProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for RestorePoint struct. -func (rp *RestorePoint) UnmarshalJSON(body []byte) error { - 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 - } - rp.Location = &location - } - case "properties": - if v != nil { - var restorePointProperties RestorePointProperties - err = json.Unmarshal(*v, &restorePointProperties) - if err != nil { - return err - } - rp.RestorePointProperties = &restorePointProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - rp.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - rp.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - rp.Type = &typeVar - } - } - } - - return nil -} - -// RestorePointListResult a list of long term retention backups. -type RestorePointListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]RestorePoint `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// RestorePointProperties properties of a database restore point -type RestorePointProperties struct { - // RestorePointType - READ-ONLY; The type of restore point. Possible values include: 'CONTINUOUS', 'DISCRETE' - RestorePointType RestorePointType `json:"restorePointType,omitempty"` - // EarliestRestoreDate - READ-ONLY; The earliest time to which this database can be restored - EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"` - // RestorePointCreationDate - READ-ONLY; The time the backup was taken - RestorePointCreationDate *date.Time `json:"restorePointCreationDate,omitempty"` - // RestorePointLabel - READ-ONLY; The label of restore point for backup request by user - RestorePointLabel *string `json:"restorePointLabel,omitempty"` -} - -// RestorePointsCreateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type RestorePointsCreateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *RestorePointsCreateFuture) Result(client RestorePointsClient) (rp RestorePoint, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.RestorePointsCreateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.RestorePointsCreateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { - rp, err = client.CreateResponder(rp.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.RestorePointsCreateFuture", "Result", rp.Response.Response, "Failure responding to request") - } - } - return -} - -// SecurityAlertPolicyProperties properties of a security alert policy. -type SecurityAlertPolicyProperties struct { - // State - Specifies the state of the policy, whether it is enabled or disabled or a policy has not been applied yet on the specific database. Possible values include: 'SecurityAlertPolicyStateNew', 'SecurityAlertPolicyStateEnabled', 'SecurityAlertPolicyStateDisabled' - State SecurityAlertPolicyState `json:"state,omitempty"` - // DisabledAlerts - Specifies an array of alerts that are disabled. Allowed values are: Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action - DisabledAlerts *[]string `json:"disabledAlerts,omitempty"` - // EmailAddresses - Specifies an array of e-mail addresses to which the alert is sent. - EmailAddresses *[]string `json:"emailAddresses,omitempty"` - // EmailAccountAdmins - Specifies that the alert is sent to the account administrators. - EmailAccountAdmins *bool `json:"emailAccountAdmins,omitempty"` - // StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs. - StorageEndpoint *string `json:"storageEndpoint,omitempty"` - // StorageAccountAccessKey - Specifies the identifier key of the Threat Detection audit storage account. - StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` - // RetentionDays - Specifies the number of days to keep in the Threat Detection audit logs. - RetentionDays *int32 `json:"retentionDays,omitempty"` - // CreationTime - READ-ONLY; Specifies the UTC creation time of the policy. - CreationTime *date.Time `json:"creationTime,omitempty"` -} - -// SensitivityLabel a sensitivity label. -type SensitivityLabel struct { - autorest.Response `json:"-"` - // SensitivityLabelProperties - Resource properties. - *SensitivityLabelProperties `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 SensitivityLabel. -func (sl SensitivityLabel) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sl.SensitivityLabelProperties != nil { - objectMap["properties"] = sl.SensitivityLabelProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SensitivityLabel struct. -func (sl *SensitivityLabel) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var sensitivityLabelProperties SensitivityLabelProperties - err = json.Unmarshal(*v, &sensitivityLabelProperties) - if err != nil { - return err - } - sl.SensitivityLabelProperties = &sensitivityLabelProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - sl.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - sl.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - sl.Type = &typeVar - } - } - } - - return nil -} - -// SensitivityLabelListResult a list of sensitivity labels. -type SensitivityLabelListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]SensitivityLabel `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// SensitivityLabelListResultIterator provides access to a complete listing of SensitivityLabel values. -type SensitivityLabelListResultIterator struct { - i int - page SensitivityLabelListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *SensitivityLabelListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SensitivityLabelListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *SensitivityLabelListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SensitivityLabelListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter SensitivityLabelListResultIterator) Response() SensitivityLabelListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter SensitivityLabelListResultIterator) Value() SensitivityLabel { - if !iter.page.NotDone() { - return SensitivityLabel{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the SensitivityLabelListResultIterator type. -func NewSensitivityLabelListResultIterator(page SensitivityLabelListResultPage) SensitivityLabelListResultIterator { - return SensitivityLabelListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (sllr SensitivityLabelListResult) IsEmpty() bool { - return sllr.Value == nil || len(*sllr.Value) == 0 -} - -// sensitivityLabelListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (sllr SensitivityLabelListResult) sensitivityLabelListResultPreparer(ctx context.Context) (*http.Request, error) { - if sllr.NextLink == nil || len(to.String(sllr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(sllr.NextLink))) -} - -// SensitivityLabelListResultPage contains a page of SensitivityLabel values. -type SensitivityLabelListResultPage struct { - fn func(context.Context, SensitivityLabelListResult) (SensitivityLabelListResult, error) - sllr SensitivityLabelListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *SensitivityLabelListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SensitivityLabelListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - next, err := page.fn(ctx, page.sllr) - if err != nil { - return err - } - page.sllr = next - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *SensitivityLabelListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SensitivityLabelListResultPage) NotDone() bool { - return !page.sllr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page SensitivityLabelListResultPage) Response() SensitivityLabelListResult { - return page.sllr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page SensitivityLabelListResultPage) Values() []SensitivityLabel { - if page.sllr.IsEmpty() { - return nil - } - return *page.sllr.Value -} - -// Creates a new instance of the SensitivityLabelListResultPage type. -func NewSensitivityLabelListResultPage(getNextPage func(context.Context, SensitivityLabelListResult) (SensitivityLabelListResult, error)) SensitivityLabelListResultPage { - return SensitivityLabelListResultPage{fn: getNextPage} -} - -// SensitivityLabelProperties properties of a sensitivity label. -type SensitivityLabelProperties struct { - // LabelName - The label name. - LabelName *string `json:"labelName,omitempty"` - // LabelID - The label ID. - LabelID *string `json:"labelId,omitempty"` - // InformationType - The information type. - InformationType *string `json:"informationType,omitempty"` - // InformationTypeID - The information type ID. - InformationTypeID *string `json:"informationTypeId,omitempty"` - // IsDisabled - READ-ONLY; Is sensitivity recommendation disabled. Applicable for recommended sensitivity label only. Specifies whether the sensitivity recommendation on this column is disabled (dismissed) or not. - IsDisabled *bool `json:"isDisabled,omitempty"` -} - -// Server an Azure SQL Database server. -type Server struct { - autorest.Response `json:"-"` - // Identity - The Azure Active Directory identity of the server. - Identity *ResourceIdentity `json:"identity,omitempty"` - // Kind - READ-ONLY; Kind of sql server. This is metadata used for the Azure portal experience. - Kind *string `json:"kind,omitempty"` - // ServerProperties - Resource properties. - *ServerProperties `json:"properties,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for Server. -func (s Server) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if s.Identity != nil { - objectMap["identity"] = s.Identity - } - if s.ServerProperties != nil { - objectMap["properties"] = s.ServerProperties - } - if s.Location != nil { - objectMap["location"] = s.Location - } - if s.Tags != nil { - objectMap["tags"] = s.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Server struct. -func (s *Server) UnmarshalJSON(body []byte) error { - 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 ResourceIdentity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - s.Identity = &identity - } - case "kind": - if v != nil { - var kind string - err = json.Unmarshal(*v, &kind) - if err != nil { - return err - } - s.Kind = &kind - } - case "properties": - if v != nil { - var serverProperties ServerProperties - err = json.Unmarshal(*v, &serverProperties) - if err != nil { - return err - } - s.ServerProperties = &serverProperties - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - s.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - s.Tags = tags - } - case "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 -} - -// ServerAdministratorListResult the response to a list Active Directory Administrators request. -type ServerAdministratorListResult struct { - autorest.Response `json:"-"` - // Value - The list of server Active Directory Administrators for the server. - Value *[]ServerAzureADAdministrator `json:"value,omitempty"` -} - -// ServerAdministratorProperties the properties of an server Administrator. -type ServerAdministratorProperties struct { - // AdministratorType - The type of administrator. - AdministratorType *string `json:"administratorType,omitempty"` - // Login - The server administrator login value. - Login *string `json:"login,omitempty"` - // Sid - The server administrator Sid (Secure ID). - Sid *uuid.UUID `json:"sid,omitempty"` - // TenantID - The server Active Directory Administrator tenant id. - TenantID *uuid.UUID `json:"tenantId,omitempty"` -} - -// ServerAutomaticTuning server-level Automatic Tuning. -type ServerAutomaticTuning struct { - autorest.Response `json:"-"` - // AutomaticTuningServerProperties - Resource properties. - *AutomaticTuningServerProperties `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 ServerAutomaticTuning. -func (sat ServerAutomaticTuning) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sat.AutomaticTuningServerProperties != nil { - objectMap["properties"] = sat.AutomaticTuningServerProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ServerAutomaticTuning struct. -func (sat *ServerAutomaticTuning) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var automaticTuningServerProperties AutomaticTuningServerProperties - err = json.Unmarshal(*v, &automaticTuningServerProperties) - if err != nil { - return err - } - sat.AutomaticTuningServerProperties = &automaticTuningServerProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - sat.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - sat.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - sat.Type = &typeVar - } - } - } - - return nil -} - -// ServerAzureADAdministrator an server Active Directory Administrator. -type ServerAzureADAdministrator struct { - autorest.Response `json:"-"` - // ServerAdministratorProperties - The properties of the resource. - *ServerAdministratorProperties `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 ServerAzureADAdministrator. -func (saaa ServerAzureADAdministrator) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if saaa.ServerAdministratorProperties != nil { - objectMap["properties"] = saaa.ServerAdministratorProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ServerAzureADAdministrator struct. -func (saaa *ServerAzureADAdministrator) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var serverAdministratorProperties ServerAdministratorProperties - err = json.Unmarshal(*v, &serverAdministratorProperties) - if err != nil { - return err - } - saaa.ServerAdministratorProperties = &serverAdministratorProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - saaa.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - saaa.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - saaa.Type = &typeVar - } - } - } - - return nil -} - -// ServerAzureADAdministratorsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type ServerAzureADAdministratorsCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ServerAzureADAdministratorsCreateOrUpdateFuture) Result(client ServerAzureADAdministratorsClient) (saaa ServerAzureADAdministrator, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerAzureADAdministratorsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ServerAzureADAdministratorsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if saaa.Response.Response, err = future.GetResult(sender); err == nil && saaa.Response.Response.StatusCode != http.StatusNoContent { - saaa, err = client.CreateOrUpdateResponder(saaa.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerAzureADAdministratorsCreateOrUpdateFuture", "Result", saaa.Response.Response, "Failure responding to request") - } - } - return -} - -// ServerAzureADAdministratorsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ServerAzureADAdministratorsDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ServerAzureADAdministratorsDeleteFuture) Result(client ServerAzureADAdministratorsClient) (saaa ServerAzureADAdministrator, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerAzureADAdministratorsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ServerAzureADAdministratorsDeleteFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if saaa.Response.Response, err = future.GetResult(sender); err == nil && saaa.Response.Response.StatusCode != http.StatusNoContent { - saaa, err = client.DeleteResponder(saaa.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerAzureADAdministratorsDeleteFuture", "Result", saaa.Response.Response, "Failure responding to request") - } - } - return -} - -// ServerBlobAuditingPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type ServerBlobAuditingPoliciesCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ServerBlobAuditingPoliciesCreateOrUpdateFuture) Result(client ServerBlobAuditingPoliciesClient) (sbap ServerBlobAuditingPolicy, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerBlobAuditingPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ServerBlobAuditingPoliciesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if sbap.Response.Response, err = future.GetResult(sender); err == nil && sbap.Response.Response.StatusCode != http.StatusNoContent { - sbap, err = client.CreateOrUpdateResponder(sbap.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerBlobAuditingPoliciesCreateOrUpdateFuture", "Result", sbap.Response.Response, "Failure responding to request") - } - } - return -} - -// ServerBlobAuditingPolicy a server blob auditing policy. -type ServerBlobAuditingPolicy struct { - autorest.Response `json:"-"` - // ServerBlobAuditingPolicyProperties - Resource properties. - *ServerBlobAuditingPolicyProperties `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 ServerBlobAuditingPolicy. -func (sbap ServerBlobAuditingPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sbap.ServerBlobAuditingPolicyProperties != nil { - objectMap["properties"] = sbap.ServerBlobAuditingPolicyProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ServerBlobAuditingPolicy struct. -func (sbap *ServerBlobAuditingPolicy) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var serverBlobAuditingPolicyProperties ServerBlobAuditingPolicyProperties - err = json.Unmarshal(*v, &serverBlobAuditingPolicyProperties) - if err != nil { - return err - } - sbap.ServerBlobAuditingPolicyProperties = &serverBlobAuditingPolicyProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - sbap.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - sbap.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - sbap.Type = &typeVar - } - } - } - - 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' - State BlobAuditingPolicyState `json:"state,omitempty"` - // StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint is required. - StorageEndpoint *string `json:"storageEndpoint,omitempty"` - // StorageAccountAccessKey - Specifies the identifier key of the auditing storage account. If state is Enabled and storageEndpoint is specified, storageAccountAccessKey is required. - StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` - // RetentionDays - Specifies the number of days to keep in the audit logs in the storage account. - RetentionDays *int32 `json:"retentionDays,omitempty"` - // AuditActionsAndGroups - Specifies the Actions-Groups and Actions to audit. - // - // The recommended set of action groups to use is the following combination - this will audit all the queries and stored procedures executed against the database, as well as successful and failed logins: - // - // BATCH_COMPLETED_GROUP, - // SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, - // FAILED_DATABASE_AUTHENTICATION_GROUP. - // - // This above combination is also the set that is configured by default when enabling auditing from the Azure portal. - // - // The supported action groups to audit are (note: choose only specific groups that cover your auditing needs. Using unnecessary groups could lead to very large quantities of audit records): - // - // APPLICATION_ROLE_CHANGE_PASSWORD_GROUP - // BACKUP_RESTORE_GROUP - // DATABASE_LOGOUT_GROUP - // DATABASE_OBJECT_CHANGE_GROUP - // DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP - // DATABASE_OBJECT_PERMISSION_CHANGE_GROUP - // DATABASE_OPERATION_GROUP - // DATABASE_PERMISSION_CHANGE_GROUP - // DATABASE_PRINCIPAL_CHANGE_GROUP - // DATABASE_PRINCIPAL_IMPERSONATION_GROUP - // DATABASE_ROLE_MEMBER_CHANGE_GROUP - // FAILED_DATABASE_AUTHENTICATION_GROUP - // SCHEMA_OBJECT_ACCESS_GROUP - // SCHEMA_OBJECT_CHANGE_GROUP - // SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP - // SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP - // SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP - // USER_CHANGE_PASSWORD_GROUP - // BATCH_STARTED_GROUP - // BATCH_COMPLETED_GROUP - // - // These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs. - // - // For more information, see [Database-Level Audit Action Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). - // - // For Database auditing policy, specific Actions can also be specified (note that Actions cannot be specified for Server auditing policy). The supported actions to audit are: - // SELECT - // UPDATE - // INSERT - // DELETE - // EXECUTE - // RECEIVE - // REFERENCES - // - // The general form for defining an action to be audited is: - // {action} ON {object} BY {principal} - // - // Note that in the above format can refer to an object like a table, view, or stored procedure, or an entire database or schema. For the latter cases, the forms DATABASE::{db_name} and SCHEMA::{schema_name} are used, respectively. - // - // For example: - // SELECT on dbo.myTable by public - // SELECT on DATABASE::myDatabase by public - // SELECT on SCHEMA::mySchema by public - // - // For more information, see [Database-Level Audit Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions) - AuditActionsAndGroups *[]string `json:"auditActionsAndGroups,omitempty"` - // StorageAccountSubscriptionID - Specifies the blob storage subscription Id. - StorageAccountSubscriptionID *uuid.UUID `json:"storageAccountSubscriptionId,omitempty"` - // IsStorageSecondaryKeyInUse - Specifies whether storageAccountAccessKey value is the storage's secondary key. - IsStorageSecondaryKeyInUse *bool `json:"isStorageSecondaryKeyInUse,omitempty"` - // IsAzureMonitorTargetEnabled - Specifies whether audit events are sent to Azure Monitor. - // In order to send the events to Azure Monitor, specify 'state' as 'Enabled' and 'isAzureMonitorTargetEnabled' as true. - // - // When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created. - // Note that for server level audit you should use the 'master' database as {databaseName}. - // - // Diagnostic Settings URI format: - // PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview - // - // For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207) - // or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043) - IsAzureMonitorTargetEnabled *bool `json:"isAzureMonitorTargetEnabled,omitempty"` -} - -// ServerCommunicationLink server communication link. -type ServerCommunicationLink struct { - autorest.Response `json:"-"` - // ServerCommunicationLinkProperties - The properties of resource. - *ServerCommunicationLinkProperties `json:"properties,omitempty"` - // Location - READ-ONLY; Communication link location. - Location *string `json:"location,omitempty"` - // Kind - READ-ONLY; Communication link kind. This property is used for Azure Portal metadata. - Kind *string `json:"kind,omitempty"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for ServerCommunicationLink. -func (scl ServerCommunicationLink) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if scl.ServerCommunicationLinkProperties != nil { - objectMap["properties"] = scl.ServerCommunicationLinkProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ServerCommunicationLink struct. -func (scl *ServerCommunicationLink) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var serverCommunicationLinkProperties ServerCommunicationLinkProperties - err = json.Unmarshal(*v, &serverCommunicationLinkProperties) - if err != nil { - return err - } - scl.ServerCommunicationLinkProperties = &serverCommunicationLinkProperties - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - scl.Location = &location - } - case "kind": - if v != nil { - var kind string - err = json.Unmarshal(*v, &kind) - if err != nil { - return err - } - scl.Kind = &kind - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - scl.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - scl.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - scl.Type = &typeVar - } - } - } - - return nil -} - -// ServerCommunicationLinkListResult a list of server communication links. -type ServerCommunicationLinkListResult struct { - autorest.Response `json:"-"` - // Value - The list of server communication links. - Value *[]ServerCommunicationLink `json:"value,omitempty"` -} - -// ServerCommunicationLinkProperties the properties of a server communication link. -type ServerCommunicationLinkProperties struct { - // State - READ-ONLY; The state. - State *string `json:"state,omitempty"` - // PartnerServer - The name of the partner server. - PartnerServer *string `json:"partnerServer,omitempty"` -} - -// ServerCommunicationLinksCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type ServerCommunicationLinksCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ServerCommunicationLinksCreateOrUpdateFuture) Result(client ServerCommunicationLinksClient) (scl ServerCommunicationLink, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerCommunicationLinksCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ServerCommunicationLinksCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if scl.Response.Response, err = future.GetResult(sender); err == nil && scl.Response.Response.StatusCode != http.StatusNoContent { - scl, err = client.CreateOrUpdateResponder(scl.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerCommunicationLinksCreateOrUpdateFuture", "Result", scl.Response.Response, "Failure responding to request") - } - } - return -} - -// ServerConnectionPolicy a server secure connection policy. -type ServerConnectionPolicy struct { - autorest.Response `json:"-"` - // Kind - READ-ONLY; Metadata used for the Azure portal experience. - Kind *string `json:"kind,omitempty"` - // Location - READ-ONLY; Resource location. - Location *string `json:"location,omitempty"` - // ServerConnectionPolicyProperties - The properties of the server secure connection policy. - *ServerConnectionPolicyProperties `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 ServerConnectionPolicy. -func (scp ServerConnectionPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if scp.ServerConnectionPolicyProperties != nil { - objectMap["properties"] = scp.ServerConnectionPolicyProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ServerConnectionPolicy struct. -func (scp *ServerConnectionPolicy) UnmarshalJSON(body []byte) error { - 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 string - err = json.Unmarshal(*v, &kind) - if err != nil { - return err - } - scp.Kind = &kind - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - scp.Location = &location - } - case "properties": - if v != nil { - var serverConnectionPolicyProperties ServerConnectionPolicyProperties - err = json.Unmarshal(*v, &serverConnectionPolicyProperties) - if err != nil { - return err - } - scp.ServerConnectionPolicyProperties = &serverConnectionPolicyProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - scp.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - scp.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - scp.Type = &typeVar - } - } - } - - return nil -} - -// ServerConnectionPolicyProperties the properties of a server secure connection policy. -type ServerConnectionPolicyProperties struct { - // ConnectionType - The server connection type. Possible values include: 'ServerConnectionTypeDefault', 'ServerConnectionTypeProxy', 'ServerConnectionTypeRedirect' - ConnectionType ServerConnectionType `json:"connectionType,omitempty"` -} - -// ServerDNSAlias a server DNS alias. -type ServerDNSAlias struct { - autorest.Response `json:"-"` - // ServerDNSAliasProperties - Resource properties. - *ServerDNSAliasProperties `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 ServerDNSAlias. -func (sda ServerDNSAlias) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sda.ServerDNSAliasProperties != nil { - objectMap["properties"] = sda.ServerDNSAliasProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ServerDNSAlias struct. -func (sda *ServerDNSAlias) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var serverDNSAliasProperties ServerDNSAliasProperties - err = json.Unmarshal(*v, &serverDNSAliasProperties) - if err != nil { - return err - } - sda.ServerDNSAliasProperties = &serverDNSAliasProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - sda.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - sda.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - sda.Type = &typeVar - } - } - } - - return nil -} - -// ServerDNSAliasAcquisition a server DNS alias acquisition request. -type ServerDNSAliasAcquisition struct { - // OldServerDNSAliasID - The id of the server alias that will be acquired to point to this server instead. - OldServerDNSAliasID *string `json:"oldServerDnsAliasId,omitempty"` -} - -// ServerDNSAliasesAcquireFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ServerDNSAliasesAcquireFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ServerDNSAliasesAcquireFuture) Result(client ServerDNSAliasesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerDNSAliasesAcquireFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ServerDNSAliasesAcquireFuture") - return - } - ar.Response = future.Response() - return -} - -// ServerDNSAliasesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ServerDNSAliasesCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ServerDNSAliasesCreateOrUpdateFuture) Result(client ServerDNSAliasesClient) (sda ServerDNSAlias, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerDNSAliasesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ServerDNSAliasesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if sda.Response.Response, err = future.GetResult(sender); err == nil && sda.Response.Response.StatusCode != http.StatusNoContent { - sda, err = client.CreateOrUpdateResponder(sda.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerDNSAliasesCreateOrUpdateFuture", "Result", sda.Response.Response, "Failure responding to request") - } - } - return -} - -// ServerDNSAliasesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ServerDNSAliasesDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ServerDNSAliasesDeleteFuture) Result(client ServerDNSAliasesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerDNSAliasesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ServerDNSAliasesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ServerDNSAliasListResult a list of server DNS aliases. -type ServerDNSAliasListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]ServerDNSAlias `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ServerDNSAliasListResultIterator provides access to a complete listing of ServerDNSAlias values. -type ServerDNSAliasListResultIterator struct { - i int - page ServerDNSAliasListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ServerDNSAliasListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServerDNSAliasListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ServerDNSAliasListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ServerDNSAliasListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ServerDNSAliasListResultIterator) Response() ServerDNSAliasListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ServerDNSAliasListResultIterator) Value() ServerDNSAlias { - if !iter.page.NotDone() { - return ServerDNSAlias{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ServerDNSAliasListResultIterator type. -func NewServerDNSAliasListResultIterator(page ServerDNSAliasListResultPage) ServerDNSAliasListResultIterator { - return ServerDNSAliasListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (sdalr ServerDNSAliasListResult) IsEmpty() bool { - return sdalr.Value == nil || len(*sdalr.Value) == 0 -} - -// serverDNSAliasListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (sdalr ServerDNSAliasListResult) serverDNSAliasListResultPreparer(ctx context.Context) (*http.Request, error) { - if sdalr.NextLink == nil || len(to.String(sdalr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(sdalr.NextLink))) -} - -// ServerDNSAliasListResultPage contains a page of ServerDNSAlias values. -type ServerDNSAliasListResultPage struct { - fn func(context.Context, ServerDNSAliasListResult) (ServerDNSAliasListResult, error) - sdalr ServerDNSAliasListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ServerDNSAliasListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServerDNSAliasListResultPage.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.sdalr) - if err != nil { - return err - } - page.sdalr = 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 *ServerDNSAliasListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ServerDNSAliasListResultPage) NotDone() bool { - return !page.sdalr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ServerDNSAliasListResultPage) Response() ServerDNSAliasListResult { - return page.sdalr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ServerDNSAliasListResultPage) Values() []ServerDNSAlias { - if page.sdalr.IsEmpty() { - return nil - } - return *page.sdalr.Value -} - -// Creates a new instance of the ServerDNSAliasListResultPage type. -func NewServerDNSAliasListResultPage(getNextPage func(context.Context, ServerDNSAliasListResult) (ServerDNSAliasListResult, error)) ServerDNSAliasListResultPage { - return ServerDNSAliasListResultPage{fn: getNextPage} -} - -// ServerDNSAliasProperties properties of a server DNS alias. -type ServerDNSAliasProperties struct { - // AzureDNSRecord - READ-ONLY; The fully qualified DNS record for alias - AzureDNSRecord *string `json:"azureDnsRecord,omitempty"` -} - -// ServerKey a server key. -type ServerKey struct { - autorest.Response `json:"-"` - // Kind - Kind of encryption protector. This is metadata used for the Azure portal experience. - Kind *string `json:"kind,omitempty"` - // Location - READ-ONLY; Resource location. - Location *string `json:"location,omitempty"` - // ServerKeyProperties - Resource properties. - *ServerKeyProperties `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 ServerKey. -func (sk ServerKey) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sk.Kind != nil { - objectMap["kind"] = sk.Kind - } - if sk.ServerKeyProperties != nil { - objectMap["properties"] = sk.ServerKeyProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ServerKey struct. -func (sk *ServerKey) UnmarshalJSON(body []byte) error { - 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 string - err = json.Unmarshal(*v, &kind) - if err != nil { - return err - } - sk.Kind = &kind - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - sk.Location = &location - } - case "properties": - if v != nil { - var serverKeyProperties ServerKeyProperties - err = json.Unmarshal(*v, &serverKeyProperties) - if err != nil { - return err - } - sk.ServerKeyProperties = &serverKeyProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - sk.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - sk.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - sk.Type = &typeVar - } - } - } - - return nil -} - -// ServerKeyListResult a list of server keys. -type ServerKeyListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]ServerKey `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ServerKeyListResultIterator provides access to a complete listing of ServerKey values. -type ServerKeyListResultIterator struct { - i int - page ServerKeyListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ServerKeyListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServerKeyListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ServerKeyListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ServerKeyListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ServerKeyListResultIterator) Response() ServerKeyListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ServerKeyListResultIterator) Value() ServerKey { - if !iter.page.NotDone() { - return ServerKey{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ServerKeyListResultIterator type. -func NewServerKeyListResultIterator(page ServerKeyListResultPage) ServerKeyListResultIterator { - return ServerKeyListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (sklr ServerKeyListResult) IsEmpty() bool { - return sklr.Value == nil || len(*sklr.Value) == 0 -} - -// serverKeyListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (sklr ServerKeyListResult) serverKeyListResultPreparer(ctx context.Context) (*http.Request, error) { - if sklr.NextLink == nil || len(to.String(sklr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(sklr.NextLink))) -} - -// ServerKeyListResultPage contains a page of ServerKey values. -type ServerKeyListResultPage struct { - fn func(context.Context, ServerKeyListResult) (ServerKeyListResult, error) - sklr ServerKeyListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ServerKeyListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServerKeyListResultPage.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.sklr) - if err != nil { - return err - } - page.sklr = 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 *ServerKeyListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ServerKeyListResultPage) NotDone() bool { - return !page.sklr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ServerKeyListResultPage) Response() ServerKeyListResult { - return page.sklr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ServerKeyListResultPage) Values() []ServerKey { - if page.sklr.IsEmpty() { - return nil - } - return *page.sklr.Value -} - -// Creates a new instance of the ServerKeyListResultPage type. -func NewServerKeyListResultPage(getNextPage func(context.Context, ServerKeyListResult) (ServerKeyListResult, error)) ServerKeyListResultPage { - return ServerKeyListResultPage{fn: getNextPage} -} - -// ServerKeyProperties properties for a server key execution. -type ServerKeyProperties struct { - // Subregion - READ-ONLY; Subregion of the server key. - Subregion *string `json:"subregion,omitempty"` - // ServerKeyType - The server key type like 'ServiceManaged', 'AzureKeyVault'. Possible values include: 'ServiceManaged', 'AzureKeyVault' - ServerKeyType ServerKeyType `json:"serverKeyType,omitempty"` - // URI - The URI of the server key. - URI *string `json:"uri,omitempty"` - // Thumbprint - Thumbprint of the server key. - Thumbprint *string `json:"thumbprint,omitempty"` - // CreationDate - The server key creation date. - CreationDate *date.Time `json:"creationDate,omitempty"` -} - -// ServerKeysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ServerKeysCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ServerKeysCreateOrUpdateFuture) Result(client ServerKeysClient) (sk ServerKey, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerKeysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ServerKeysCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if sk.Response.Response, err = future.GetResult(sender); err == nil && sk.Response.Response.StatusCode != http.StatusNoContent { - sk, err = client.CreateOrUpdateResponder(sk.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerKeysCreateOrUpdateFuture", "Result", sk.Response.Response, "Failure responding to request") - } - } - return -} - -// ServerKeysDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ServerKeysDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ServerKeysDeleteFuture) Result(client ServerKeysClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerKeysDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ServerKeysDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ServerListResult a list of servers. -type ServerListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]Server `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ServerListResultIterator provides access to a complete listing of Server values. -type ServerListResultIterator struct { - i int - page ServerListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ServerListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServerListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ServerListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ServerListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ServerListResultIterator) Response() ServerListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ServerListResultIterator) Value() Server { - if !iter.page.NotDone() { - return Server{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ServerListResultIterator type. -func NewServerListResultIterator(page ServerListResultPage) ServerListResultIterator { - return ServerListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (slr ServerListResult) IsEmpty() bool { - return slr.Value == nil || len(*slr.Value) == 0 -} - -// serverListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (slr ServerListResult) serverListResultPreparer(ctx context.Context) (*http.Request, error) { - if slr.NextLink == nil || len(to.String(slr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(slr.NextLink))) -} - -// ServerListResultPage contains a page of Server values. -type ServerListResultPage struct { - fn func(context.Context, ServerListResult) (ServerListResult, error) - slr ServerListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ServerListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServerListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - next, err := page.fn(ctx, page.slr) - if err != nil { - return err - } - page.slr = next - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ServerListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ServerListResultPage) NotDone() bool { - return !page.slr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ServerListResultPage) Response() ServerListResult { - return page.slr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ServerListResultPage) Values() []Server { - if page.slr.IsEmpty() { - return nil - } - return *page.slr.Value -} - -// Creates a new instance of the ServerListResultPage type. -func NewServerListResultPage(getNextPage func(context.Context, ServerListResult) (ServerListResult, error)) ServerListResultPage { - return ServerListResultPage{fn: getNextPage} -} - -// ServerProperties the properties of a server. -type ServerProperties struct { - // AdministratorLogin - Administrator username for the server. Once created it cannot be changed. - AdministratorLogin *string `json:"administratorLogin,omitempty"` - // AdministratorLoginPassword - The administrator login password (required for server creation). - AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"` - // Version - The version of the server. - Version *string `json:"version,omitempty"` - // State - READ-ONLY; The state of the server. - State *string `json:"state,omitempty"` - // FullyQualifiedDomainName - READ-ONLY; The fully qualified domain name of the server. - FullyQualifiedDomainName *string `json:"fullyQualifiedDomainName,omitempty"` -} - -// ServersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ServersCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ServersCreateOrUpdateFuture) Result(client ServersClient) (s Server, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ServersCreateOrUpdateFuture") - 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, "sql.ServersCreateOrUpdateFuture", "Result", s.Response.Response, "Failure responding to request") - } - } - return -} - -// ServersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ServersDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ServersDeleteFuture) Result(client ServersClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServersDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ServersDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ServerSecurityAlertPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type ServerSecurityAlertPoliciesCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ServerSecurityAlertPoliciesCreateOrUpdateFuture) Result(client ServerSecurityAlertPoliciesClient) (ssap ServerSecurityAlertPolicy, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerSecurityAlertPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ServerSecurityAlertPoliciesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ssap.Response.Response, err = future.GetResult(sender); err == nil && ssap.Response.Response.StatusCode != http.StatusNoContent { - ssap, err = client.CreateOrUpdateResponder(ssap.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerSecurityAlertPoliciesCreateOrUpdateFuture", "Result", ssap.Response.Response, "Failure responding to request") - } - } - return -} - -// ServerSecurityAlertPolicy a server security alert policy. -type ServerSecurityAlertPolicy struct { - autorest.Response `json:"-"` - // SecurityAlertPolicyProperties - Resource properties. - *SecurityAlertPolicyProperties `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 ServerSecurityAlertPolicy. -func (ssap ServerSecurityAlertPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ssap.SecurityAlertPolicyProperties != nil { - objectMap["properties"] = ssap.SecurityAlertPolicyProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ServerSecurityAlertPolicy struct. -func (ssap *ServerSecurityAlertPolicy) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var securityAlertPolicyProperties SecurityAlertPolicyProperties - err = json.Unmarshal(*v, &securityAlertPolicyProperties) - if err != nil { - return err - } - ssap.SecurityAlertPolicyProperties = &securityAlertPolicyProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ssap.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ssap.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ssap.Type = &typeVar - } - } - } - - return nil -} - -// ServersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ServersUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ServersUpdateFuture) Result(client ServersClient) (s Server, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServersUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ServersUpdateFuture") - 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.UpdateResponder(s.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServersUpdateFuture", "Result", s.Response.Response, "Failure responding to request") - } - } - return -} - -// ServerUpdate an update request for an Azure SQL Database server. -type ServerUpdate struct { - // ServerProperties - Resource properties. - *ServerProperties `json:"properties,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ServerUpdate. -func (su ServerUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if su.ServerProperties != nil { - objectMap["properties"] = su.ServerProperties - } - if su.Tags != nil { - objectMap["tags"] = su.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ServerUpdate struct. -func (su *ServerUpdate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var serverProperties ServerProperties - err = json.Unmarshal(*v, &serverProperties) - if err != nil { - return err - } - su.ServerProperties = &serverProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - su.Tags = tags - } - } - } - - return nil -} - -// ServerUsage represents server metrics. -type ServerUsage struct { - // Name - READ-ONLY; Name of the server usage metric. - Name *string `json:"name,omitempty"` - // ResourceName - READ-ONLY; The name of the resource. - ResourceName *string `json:"resourceName,omitempty"` - // DisplayName - READ-ONLY; The metric display name. - DisplayName *string `json:"displayName,omitempty"` - // CurrentValue - READ-ONLY; The current value of the metric. - CurrentValue *float64 `json:"currentValue,omitempty"` - // Limit - READ-ONLY; The current limit of the metric. - Limit *float64 `json:"limit,omitempty"` - // Unit - READ-ONLY; The units of the metric. - Unit *string `json:"unit,omitempty"` - // NextResetTime - READ-ONLY; The next reset time for the metric (ISO8601 format). - NextResetTime *date.Time `json:"nextResetTime,omitempty"` -} - -// ServerUsageListResult represents the response to a list server metrics request. -type ServerUsageListResult struct { - autorest.Response `json:"-"` - // Value - The list of server metrics for the server. - Value *[]ServerUsage `json:"value,omitempty"` -} - -// ServerVersionCapability the server capability -type ServerVersionCapability struct { - // Name - READ-ONLY; The server version name. - Name *string `json:"name,omitempty"` - // SupportedEditions - READ-ONLY; The list of supported database editions. - SupportedEditions *[]EditionCapability `json:"supportedEditions,omitempty"` - // SupportedElasticPoolEditions - READ-ONLY; The list of supported elastic pool editions. - SupportedElasticPoolEditions *[]ElasticPoolEditionCapability `json:"supportedElasticPoolEditions,omitempty"` - // Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' - Status CapabilityStatus `json:"status,omitempty"` - // Reason - The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` -} - -// ServerVulnerabilityAssessment a server vulnerability assessment. -type ServerVulnerabilityAssessment struct { - autorest.Response `json:"-"` - // ServerVulnerabilityAssessmentProperties - Resource properties. - *ServerVulnerabilityAssessmentProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for ServerVulnerabilityAssessment. -func (sva ServerVulnerabilityAssessment) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sva.ServerVulnerabilityAssessmentProperties != nil { - objectMap["properties"] = sva.ServerVulnerabilityAssessmentProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ServerVulnerabilityAssessment struct. -func (sva *ServerVulnerabilityAssessment) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var serverVulnerabilityAssessmentProperties ServerVulnerabilityAssessmentProperties - err = json.Unmarshal(*v, &serverVulnerabilityAssessmentProperties) - if err != nil { - return err - } - sva.ServerVulnerabilityAssessmentProperties = &serverVulnerabilityAssessmentProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - sva.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - sva.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - sva.Type = &typeVar - } - } - } - - return nil -} - -// ServerVulnerabilityAssessmentListResult a list of the server's vulnerability assessments. -type ServerVulnerabilityAssessmentListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]ServerVulnerabilityAssessment `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ServerVulnerabilityAssessmentListResultIterator provides access to a complete listing of -// ServerVulnerabilityAssessment values. -type ServerVulnerabilityAssessmentListResultIterator struct { - i int - page ServerVulnerabilityAssessmentListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ServerVulnerabilityAssessmentListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServerVulnerabilityAssessmentListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ServerVulnerabilityAssessmentListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ServerVulnerabilityAssessmentListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ServerVulnerabilityAssessmentListResultIterator) Response() ServerVulnerabilityAssessmentListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ServerVulnerabilityAssessmentListResultIterator) Value() ServerVulnerabilityAssessment { - if !iter.page.NotDone() { - return ServerVulnerabilityAssessment{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ServerVulnerabilityAssessmentListResultIterator type. -func NewServerVulnerabilityAssessmentListResultIterator(page ServerVulnerabilityAssessmentListResultPage) ServerVulnerabilityAssessmentListResultIterator { - return ServerVulnerabilityAssessmentListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (svalr ServerVulnerabilityAssessmentListResult) IsEmpty() bool { - return svalr.Value == nil || len(*svalr.Value) == 0 -} - -// serverVulnerabilityAssessmentListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (svalr ServerVulnerabilityAssessmentListResult) serverVulnerabilityAssessmentListResultPreparer(ctx context.Context) (*http.Request, error) { - if svalr.NextLink == nil || len(to.String(svalr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(svalr.NextLink))) -} - -// ServerVulnerabilityAssessmentListResultPage contains a page of ServerVulnerabilityAssessment values. -type ServerVulnerabilityAssessmentListResultPage struct { - fn func(context.Context, ServerVulnerabilityAssessmentListResult) (ServerVulnerabilityAssessmentListResult, error) - svalr ServerVulnerabilityAssessmentListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ServerVulnerabilityAssessmentListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServerVulnerabilityAssessmentListResultPage.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.svalr) - if err != nil { - return err - } - page.svalr = 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 *ServerVulnerabilityAssessmentListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ServerVulnerabilityAssessmentListResultPage) NotDone() bool { - return !page.svalr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ServerVulnerabilityAssessmentListResultPage) Response() ServerVulnerabilityAssessmentListResult { - return page.svalr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ServerVulnerabilityAssessmentListResultPage) Values() []ServerVulnerabilityAssessment { - if page.svalr.IsEmpty() { - return nil - } - return *page.svalr.Value -} - -// Creates a new instance of the ServerVulnerabilityAssessmentListResultPage type. -func NewServerVulnerabilityAssessmentListResultPage(getNextPage func(context.Context, ServerVulnerabilityAssessmentListResult) (ServerVulnerabilityAssessmentListResult, error)) ServerVulnerabilityAssessmentListResultPage { - return ServerVulnerabilityAssessmentListResultPage{fn: getNextPage} -} - -// ServerVulnerabilityAssessmentProperties properties of a server Vulnerability Assessment. -type ServerVulnerabilityAssessmentProperties struct { - // StorageContainerPath - A blob storage container path to hold the scan results (e.g. https://myStorage.blob.core.windows.net/VaScans/). - StorageContainerPath *string `json:"storageContainerPath,omitempty"` - // StorageContainerSasKey - A shared access signature (SAS Key) that has write access to the blob container specified in 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't specified, StorageContainerSasKey is required. - StorageContainerSasKey *string `json:"storageContainerSasKey,omitempty"` - // StorageAccountAccessKey - Specifies the identifier key of the storage account for vulnerability assessment scan results. If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is required. - StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` - // RecurringScans - The recurring scans settings - RecurringScans *VulnerabilityAssessmentRecurringScansProperties `json:"recurringScans,omitempty"` -} - -// ServiceObjective represents a database service objective. -type ServiceObjective struct { - autorest.Response `json:"-"` - // ServiceObjectiveProperties - Represents the properties of the resource. - *ServiceObjectiveProperties `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 ServiceObjective. -func (so ServiceObjective) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if so.ServiceObjectiveProperties != nil { - objectMap["properties"] = so.ServiceObjectiveProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ServiceObjective struct. -func (so *ServiceObjective) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var serviceObjectiveProperties ServiceObjectiveProperties - err = json.Unmarshal(*v, &serviceObjectiveProperties) - if err != nil { - return err - } - so.ServiceObjectiveProperties = &serviceObjectiveProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - so.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - so.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - so.Type = &typeVar - } - } - } - - return nil -} - -// ServiceObjectiveCapability the service objectives capability. -type ServiceObjectiveCapability struct { - // ID - READ-ONLY; The unique ID of the service objective. - ID *uuid.UUID `json:"id,omitempty"` - // Name - READ-ONLY; The service objective name. - Name *string `json:"name,omitempty"` - // SupportedMaxSizes - READ-ONLY; The list of supported maximum database sizes. - SupportedMaxSizes *[]MaxSizeRangeCapability `json:"supportedMaxSizes,omitempty"` - // PerformanceLevel - READ-ONLY; The performance level. - PerformanceLevel *PerformanceLevelCapability `json:"performanceLevel,omitempty"` - // Sku - READ-ONLY; The sku. - Sku *Sku `json:"sku,omitempty"` - // SupportedLicenseTypes - READ-ONLY; List of supported license types. - SupportedLicenseTypes *[]LicenseTypeCapability `json:"supportedLicenseTypes,omitempty"` - // IncludedMaxSize - READ-ONLY; The included (free) max size. - IncludedMaxSize *MaxSizeCapability `json:"includedMaxSize,omitempty"` - // Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' - Status CapabilityStatus `json:"status,omitempty"` - // Reason - The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` -} - -// ServiceObjectiveListResult represents the response to a get database service objectives request. -type ServiceObjectiveListResult struct { - autorest.Response `json:"-"` - // Value - The list of database service objectives. - Value *[]ServiceObjective `json:"value,omitempty"` -} - -// ServiceObjectiveProperties represents the properties of a database service objective. -type ServiceObjectiveProperties struct { - // ServiceObjectiveName - READ-ONLY; The name for the service objective. - ServiceObjectiveName *string `json:"serviceObjectiveName,omitempty"` - // IsDefault - READ-ONLY; Gets whether the service level objective is the default service objective. - IsDefault *bool `json:"isDefault,omitempty"` - // IsSystem - READ-ONLY; Gets whether the service level objective is a system service objective. - IsSystem *bool `json:"isSystem,omitempty"` - // Description - READ-ONLY; The description for the service level objective. - Description *string `json:"description,omitempty"` - // Enabled - READ-ONLY; Gets whether the service level objective is enabled. - Enabled *bool `json:"enabled,omitempty"` -} - -// ServiceTierAdvisor represents a Service Tier Advisor. -type ServiceTierAdvisor struct { - autorest.Response `json:"-"` - // ServiceTierAdvisorProperties - READ-ONLY; The properties representing the resource. - *ServiceTierAdvisorProperties `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 ServiceTierAdvisor. -func (sta ServiceTierAdvisor) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ServiceTierAdvisor struct. -func (sta *ServiceTierAdvisor) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var serviceTierAdvisorProperties ServiceTierAdvisorProperties - err = json.Unmarshal(*v, &serviceTierAdvisorProperties) - if err != nil { - return err - } - sta.ServiceTierAdvisorProperties = &serviceTierAdvisorProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - sta.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - sta.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - sta.Type = &typeVar - } - } - } - - return nil -} - -// ServiceTierAdvisorListResult represents the response to a list service tier advisor request. -type ServiceTierAdvisorListResult struct { - autorest.Response `json:"-"` - // Value - The list of service tier advisors for specified database. - Value *[]ServiceTierAdvisor `json:"value,omitempty"` -} - -// ServiceTierAdvisorProperties represents the properties of a Service Tier Advisor. -type ServiceTierAdvisorProperties struct { - // ObservationPeriodStart - READ-ONLY; The observation period start (ISO8601 format). - ObservationPeriodStart *date.Time `json:"observationPeriodStart,omitempty"` - // ObservationPeriodEnd - READ-ONLY; The observation period start (ISO8601 format). - ObservationPeriodEnd *date.Time `json:"observationPeriodEnd,omitempty"` - // ActiveTimeRatio - READ-ONLY; The activeTimeRatio for service tier advisor. - ActiveTimeRatio *float64 `json:"activeTimeRatio,omitempty"` - // MinDtu - READ-ONLY; Gets or sets minDtu for service tier advisor. - MinDtu *float64 `json:"minDtu,omitempty"` - // AvgDtu - READ-ONLY; Gets or sets avgDtu for service tier advisor. - AvgDtu *float64 `json:"avgDtu,omitempty"` - // MaxDtu - READ-ONLY; Gets or sets maxDtu for service tier advisor. - MaxDtu *float64 `json:"maxDtu,omitempty"` - // MaxSizeInGB - READ-ONLY; Gets or sets maxSizeInGB for service tier advisor. - MaxSizeInGB *float64 `json:"maxSizeInGB,omitempty"` - // ServiceLevelObjectiveUsageMetrics - READ-ONLY; Gets or sets serviceLevelObjectiveUsageMetrics for the service tier advisor. - ServiceLevelObjectiveUsageMetrics *[]SloUsageMetric `json:"serviceLevelObjectiveUsageMetrics,omitempty"` - // CurrentServiceLevelObjective - READ-ONLY; Gets or sets currentServiceLevelObjective for service tier advisor. - CurrentServiceLevelObjective *string `json:"currentServiceLevelObjective,omitempty"` - // CurrentServiceLevelObjectiveID - READ-ONLY; Gets or sets currentServiceLevelObjectiveId for service tier advisor. - CurrentServiceLevelObjectiveID *uuid.UUID `json:"currentServiceLevelObjectiveId,omitempty"` - // UsageBasedRecommendationServiceLevelObjective - READ-ONLY; Gets or sets usageBasedRecommendationServiceLevelObjective for service tier advisor. - UsageBasedRecommendationServiceLevelObjective *string `json:"usageBasedRecommendationServiceLevelObjective,omitempty"` - // UsageBasedRecommendationServiceLevelObjectiveID - READ-ONLY; Gets or sets usageBasedRecommendationServiceLevelObjectiveId for service tier advisor. - UsageBasedRecommendationServiceLevelObjectiveID *uuid.UUID `json:"usageBasedRecommendationServiceLevelObjectiveId,omitempty"` - // DatabaseSizeBasedRecommendationServiceLevelObjective - READ-ONLY; Gets or sets databaseSizeBasedRecommendationServiceLevelObjective for service tier advisor. - DatabaseSizeBasedRecommendationServiceLevelObjective *string `json:"databaseSizeBasedRecommendationServiceLevelObjective,omitempty"` - // DatabaseSizeBasedRecommendationServiceLevelObjectiveID - READ-ONLY; Gets or sets databaseSizeBasedRecommendationServiceLevelObjectiveId for service tier advisor. - DatabaseSizeBasedRecommendationServiceLevelObjectiveID *uuid.UUID `json:"databaseSizeBasedRecommendationServiceLevelObjectiveId,omitempty"` - // DisasterPlanBasedRecommendationServiceLevelObjective - READ-ONLY; Gets or sets disasterPlanBasedRecommendationServiceLevelObjective for service tier advisor. - DisasterPlanBasedRecommendationServiceLevelObjective *string `json:"disasterPlanBasedRecommendationServiceLevelObjective,omitempty"` - // DisasterPlanBasedRecommendationServiceLevelObjectiveID - READ-ONLY; Gets or sets disasterPlanBasedRecommendationServiceLevelObjectiveId for service tier advisor. - DisasterPlanBasedRecommendationServiceLevelObjectiveID *uuid.UUID `json:"disasterPlanBasedRecommendationServiceLevelObjectiveId,omitempty"` - // OverallRecommendationServiceLevelObjective - READ-ONLY; Gets or sets overallRecommendationServiceLevelObjective for service tier advisor. - OverallRecommendationServiceLevelObjective *string `json:"overallRecommendationServiceLevelObjective,omitempty"` - // OverallRecommendationServiceLevelObjectiveID - READ-ONLY; Gets or sets overallRecommendationServiceLevelObjectiveId for service tier advisor. - OverallRecommendationServiceLevelObjectiveID *uuid.UUID `json:"overallRecommendationServiceLevelObjectiveId,omitempty"` - // Confidence - READ-ONLY; Gets or sets confidence for service tier advisor. - Confidence *float64 `json:"confidence,omitempty"` -} - -// Sku an ARM Resource SKU. -type Sku struct { - // Name - The name of the SKU, typically, a letter + Number code, e.g. P3. - Name *string `json:"name,omitempty"` - // Tier - The tier or edition of the particular SKU, e.g. Basic, Premium. - Tier *string `json:"tier,omitempty"` - // Size - Size of the particular SKU - Size *string `json:"size,omitempty"` - // Family - If the service has different generations of hardware, for the same SKU, then that can be captured here. - Family *string `json:"family,omitempty"` - // Capacity - Capacity of the particular SKU. - Capacity *int32 `json:"capacity,omitempty"` -} - -// SloUsageMetric a Slo Usage Metric. -type SloUsageMetric struct { - // ServiceLevelObjective - READ-ONLY; The serviceLevelObjective for SLO usage metric. Possible values include: 'ServiceObjectiveNameSystem', 'ServiceObjectiveNameSystem0', 'ServiceObjectiveNameSystem1', 'ServiceObjectiveNameSystem2', 'ServiceObjectiveNameSystem3', 'ServiceObjectiveNameSystem4', 'ServiceObjectiveNameSystem2L', 'ServiceObjectiveNameSystem3L', 'ServiceObjectiveNameSystem4L', 'ServiceObjectiveNameFree', 'ServiceObjectiveNameBasic', 'ServiceObjectiveNameS0', 'ServiceObjectiveNameS1', 'ServiceObjectiveNameS2', 'ServiceObjectiveNameS3', 'ServiceObjectiveNameS4', 'ServiceObjectiveNameS6', 'ServiceObjectiveNameS7', 'ServiceObjectiveNameS9', 'ServiceObjectiveNameS12', 'ServiceObjectiveNameP1', 'ServiceObjectiveNameP2', 'ServiceObjectiveNameP3', 'ServiceObjectiveNameP4', 'ServiceObjectiveNameP6', 'ServiceObjectiveNameP11', 'ServiceObjectiveNameP15', 'ServiceObjectiveNamePRS1', 'ServiceObjectiveNamePRS2', 'ServiceObjectiveNamePRS4', 'ServiceObjectiveNamePRS6', 'ServiceObjectiveNameDW100', 'ServiceObjectiveNameDW200', 'ServiceObjectiveNameDW300', 'ServiceObjectiveNameDW400', 'ServiceObjectiveNameDW500', 'ServiceObjectiveNameDW600', 'ServiceObjectiveNameDW1000', 'ServiceObjectiveNameDW1200', 'ServiceObjectiveNameDW1000c', 'ServiceObjectiveNameDW1500', 'ServiceObjectiveNameDW1500c', 'ServiceObjectiveNameDW2000', 'ServiceObjectiveNameDW2000c', 'ServiceObjectiveNameDW3000', 'ServiceObjectiveNameDW2500c', 'ServiceObjectiveNameDW3000c', 'ServiceObjectiveNameDW6000', 'ServiceObjectiveNameDW5000c', 'ServiceObjectiveNameDW6000c', 'ServiceObjectiveNameDW7500c', 'ServiceObjectiveNameDW10000c', 'ServiceObjectiveNameDW15000c', 'ServiceObjectiveNameDW30000c', 'ServiceObjectiveNameDS100', 'ServiceObjectiveNameDS200', 'ServiceObjectiveNameDS300', 'ServiceObjectiveNameDS400', 'ServiceObjectiveNameDS500', 'ServiceObjectiveNameDS600', 'ServiceObjectiveNameDS1000', 'ServiceObjectiveNameDS1200', 'ServiceObjectiveNameDS1500', 'ServiceObjectiveNameDS2000', 'ServiceObjectiveNameElasticPool' - ServiceLevelObjective ServiceObjectiveName `json:"serviceLevelObjective,omitempty"` - // ServiceLevelObjectiveID - READ-ONLY; The serviceLevelObjectiveId for SLO usage metric. - ServiceLevelObjectiveID *uuid.UUID `json:"serviceLevelObjectiveId,omitempty"` - // InRangeTimeRatio - READ-ONLY; Gets or sets inRangeTimeRatio for SLO usage metric. - InRangeTimeRatio *float64 `json:"inRangeTimeRatio,omitempty"` -} - -// SubscriptionUsage usage Metric of a Subscription in a Location. -type SubscriptionUsage struct { - autorest.Response `json:"-"` - // SubscriptionUsageProperties - Resource properties. - *SubscriptionUsageProperties `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 SubscriptionUsage. -func (su SubscriptionUsage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if su.SubscriptionUsageProperties != nil { - objectMap["properties"] = su.SubscriptionUsageProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SubscriptionUsage struct. -func (su *SubscriptionUsage) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var subscriptionUsageProperties SubscriptionUsageProperties - err = json.Unmarshal(*v, &subscriptionUsageProperties) - if err != nil { - return err - } - su.SubscriptionUsageProperties = &subscriptionUsageProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - su.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - su.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - su.Type = &typeVar - } - } - } - - return nil -} - -// SubscriptionUsageListResult a list of subscription usage metrics in a location. -type SubscriptionUsageListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]SubscriptionUsage `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// SubscriptionUsageListResultIterator provides access to a complete listing of SubscriptionUsage values. -type SubscriptionUsageListResultIterator struct { - i int - page SubscriptionUsageListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *SubscriptionUsageListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionUsageListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *SubscriptionUsageListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SubscriptionUsageListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter SubscriptionUsageListResultIterator) Response() SubscriptionUsageListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter SubscriptionUsageListResultIterator) Value() SubscriptionUsage { - if !iter.page.NotDone() { - return SubscriptionUsage{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the SubscriptionUsageListResultIterator type. -func NewSubscriptionUsageListResultIterator(page SubscriptionUsageListResultPage) SubscriptionUsageListResultIterator { - return SubscriptionUsageListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (sulr SubscriptionUsageListResult) IsEmpty() bool { - return sulr.Value == nil || len(*sulr.Value) == 0 -} - -// subscriptionUsageListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (sulr SubscriptionUsageListResult) subscriptionUsageListResultPreparer(ctx context.Context) (*http.Request, error) { - if sulr.NextLink == nil || len(to.String(sulr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(sulr.NextLink))) -} - -// SubscriptionUsageListResultPage contains a page of SubscriptionUsage values. -type SubscriptionUsageListResultPage struct { - fn func(context.Context, SubscriptionUsageListResult) (SubscriptionUsageListResult, error) - sulr SubscriptionUsageListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *SubscriptionUsageListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionUsageListResultPage.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.sulr) - if err != nil { - return err - } - page.sulr = 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 *SubscriptionUsageListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SubscriptionUsageListResultPage) NotDone() bool { - return !page.sulr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page SubscriptionUsageListResultPage) Response() SubscriptionUsageListResult { - return page.sulr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page SubscriptionUsageListResultPage) Values() []SubscriptionUsage { - if page.sulr.IsEmpty() { - return nil - } - return *page.sulr.Value -} - -// Creates a new instance of the SubscriptionUsageListResultPage type. -func NewSubscriptionUsageListResultPage(getNextPage func(context.Context, SubscriptionUsageListResult) (SubscriptionUsageListResult, error)) SubscriptionUsageListResultPage { - return SubscriptionUsageListResultPage{fn: getNextPage} -} - -// SubscriptionUsageProperties properties of a subscription usage. -type SubscriptionUsageProperties struct { - // DisplayName - READ-ONLY; User-readable name of the metric. - DisplayName *string `json:"displayName,omitempty"` - // CurrentValue - READ-ONLY; Current value of the metric. - CurrentValue *float64 `json:"currentValue,omitempty"` - // Limit - READ-ONLY; Boundary value of the metric. - Limit *float64 `json:"limit,omitempty"` - // Unit - READ-ONLY; Unit of the metric. - Unit *string `json:"unit,omitempty"` -} - -// SyncAgent an Azure SQL Database sync agent. -type SyncAgent struct { - autorest.Response `json:"-"` - // SyncAgentProperties - Resource properties. - *SyncAgentProperties `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 SyncAgent. -func (sa SyncAgent) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sa.SyncAgentProperties != nil { - objectMap["properties"] = sa.SyncAgentProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SyncAgent struct. -func (sa *SyncAgent) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var syncAgentProperties SyncAgentProperties - err = json.Unmarshal(*v, &syncAgentProperties) - if err != nil { - return err - } - sa.SyncAgentProperties = &syncAgentProperties - } - 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 -} - -// SyncAgentKeyProperties properties of an Azure SQL Database sync agent key. -type SyncAgentKeyProperties struct { - autorest.Response `json:"-"` - // SyncAgentKey - READ-ONLY; Key of sync agent. - SyncAgentKey *string `json:"syncAgentKey,omitempty"` -} - -// SyncAgentLinkedDatabase an Azure SQL Database sync agent linked database. -type SyncAgentLinkedDatabase struct { - // SyncAgentLinkedDatabaseProperties - Resource properties. - *SyncAgentLinkedDatabaseProperties `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 SyncAgentLinkedDatabase. -func (sald SyncAgentLinkedDatabase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sald.SyncAgentLinkedDatabaseProperties != nil { - objectMap["properties"] = sald.SyncAgentLinkedDatabaseProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SyncAgentLinkedDatabase struct. -func (sald *SyncAgentLinkedDatabase) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var syncAgentLinkedDatabaseProperties SyncAgentLinkedDatabaseProperties - err = json.Unmarshal(*v, &syncAgentLinkedDatabaseProperties) - if err != nil { - return err - } - sald.SyncAgentLinkedDatabaseProperties = &syncAgentLinkedDatabaseProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - sald.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - sald.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - sald.Type = &typeVar - } - } - } - - return nil -} - -// SyncAgentLinkedDatabaseListResult a list of sync agent linked databases. -type SyncAgentLinkedDatabaseListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]SyncAgentLinkedDatabase `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// SyncAgentLinkedDatabaseListResultIterator provides access to a complete listing of -// SyncAgentLinkedDatabase values. -type SyncAgentLinkedDatabaseListResultIterator struct { - i int - page SyncAgentLinkedDatabaseListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *SyncAgentLinkedDatabaseListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncAgentLinkedDatabaseListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *SyncAgentLinkedDatabaseListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SyncAgentLinkedDatabaseListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter SyncAgentLinkedDatabaseListResultIterator) Response() SyncAgentLinkedDatabaseListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter SyncAgentLinkedDatabaseListResultIterator) Value() SyncAgentLinkedDatabase { - if !iter.page.NotDone() { - return SyncAgentLinkedDatabase{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the SyncAgentLinkedDatabaseListResultIterator type. -func NewSyncAgentLinkedDatabaseListResultIterator(page SyncAgentLinkedDatabaseListResultPage) SyncAgentLinkedDatabaseListResultIterator { - return SyncAgentLinkedDatabaseListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (saldlr SyncAgentLinkedDatabaseListResult) IsEmpty() bool { - return saldlr.Value == nil || len(*saldlr.Value) == 0 -} - -// syncAgentLinkedDatabaseListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (saldlr SyncAgentLinkedDatabaseListResult) syncAgentLinkedDatabaseListResultPreparer(ctx context.Context) (*http.Request, error) { - if saldlr.NextLink == nil || len(to.String(saldlr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(saldlr.NextLink))) -} - -// SyncAgentLinkedDatabaseListResultPage contains a page of SyncAgentLinkedDatabase values. -type SyncAgentLinkedDatabaseListResultPage struct { - fn func(context.Context, SyncAgentLinkedDatabaseListResult) (SyncAgentLinkedDatabaseListResult, error) - saldlr SyncAgentLinkedDatabaseListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *SyncAgentLinkedDatabaseListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncAgentLinkedDatabaseListResultPage.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.saldlr) - if err != nil { - return err - } - page.saldlr = 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 *SyncAgentLinkedDatabaseListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SyncAgentLinkedDatabaseListResultPage) NotDone() bool { - return !page.saldlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page SyncAgentLinkedDatabaseListResultPage) Response() SyncAgentLinkedDatabaseListResult { - return page.saldlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page SyncAgentLinkedDatabaseListResultPage) Values() []SyncAgentLinkedDatabase { - if page.saldlr.IsEmpty() { - return nil - } - return *page.saldlr.Value -} - -// Creates a new instance of the SyncAgentLinkedDatabaseListResultPage type. -func NewSyncAgentLinkedDatabaseListResultPage(getNextPage func(context.Context, SyncAgentLinkedDatabaseListResult) (SyncAgentLinkedDatabaseListResult, error)) SyncAgentLinkedDatabaseListResultPage { - return SyncAgentLinkedDatabaseListResultPage{fn: getNextPage} -} - -// SyncAgentLinkedDatabaseProperties properties of an Azure SQL Database sync agent linked database. -type SyncAgentLinkedDatabaseProperties struct { - // DatabaseType - READ-ONLY; Type of the sync agent linked database. Possible values include: 'AzureSQLDatabase', 'SQLServerDatabase' - DatabaseType SyncMemberDbType `json:"databaseType,omitempty"` - // DatabaseID - READ-ONLY; Id of the sync agent linked database. - DatabaseID *string `json:"databaseId,omitempty"` - // Description - READ-ONLY; Description of the sync agent linked database. - Description *string `json:"description,omitempty"` - // ServerName - READ-ONLY; Server name of the sync agent linked database. - ServerName *string `json:"serverName,omitempty"` - // DatabaseName - READ-ONLY; Database name of the sync agent linked database. - DatabaseName *string `json:"databaseName,omitempty"` - // UserName - READ-ONLY; User name of the sync agent linked database. - UserName *string `json:"userName,omitempty"` -} - -// SyncAgentListResult a list of sync agents. -type SyncAgentListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]SyncAgent `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// SyncAgentListResultIterator provides access to a complete listing of SyncAgent values. -type SyncAgentListResultIterator struct { - i int - page SyncAgentListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *SyncAgentListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncAgentListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *SyncAgentListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SyncAgentListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter SyncAgentListResultIterator) Response() SyncAgentListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter SyncAgentListResultIterator) Value() SyncAgent { - if !iter.page.NotDone() { - return SyncAgent{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the SyncAgentListResultIterator type. -func NewSyncAgentListResultIterator(page SyncAgentListResultPage) SyncAgentListResultIterator { - return SyncAgentListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (salr SyncAgentListResult) IsEmpty() bool { - return salr.Value == nil || len(*salr.Value) == 0 -} - -// syncAgentListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (salr SyncAgentListResult) syncAgentListResultPreparer(ctx context.Context) (*http.Request, error) { - if salr.NextLink == nil || len(to.String(salr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(salr.NextLink))) -} - -// SyncAgentListResultPage contains a page of SyncAgent values. -type SyncAgentListResultPage struct { - fn func(context.Context, SyncAgentListResult) (SyncAgentListResult, error) - salr SyncAgentListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *SyncAgentListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncAgentListResultPage.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.salr) - if err != nil { - return err - } - page.salr = 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 *SyncAgentListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SyncAgentListResultPage) NotDone() bool { - return !page.salr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page SyncAgentListResultPage) Response() SyncAgentListResult { - return page.salr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page SyncAgentListResultPage) Values() []SyncAgent { - if page.salr.IsEmpty() { - return nil - } - return *page.salr.Value -} - -// Creates a new instance of the SyncAgentListResultPage type. -func NewSyncAgentListResultPage(getNextPage func(context.Context, SyncAgentListResult) (SyncAgentListResult, error)) SyncAgentListResultPage { - return SyncAgentListResultPage{fn: getNextPage} -} - -// SyncAgentProperties properties of an Azure SQL Database sync agent. -type SyncAgentProperties struct { - // Name - READ-ONLY; Name of the sync agent. - Name *string `json:"name,omitempty"` - // SyncDatabaseID - ARM resource id of the sync database in the sync agent. - SyncDatabaseID *string `json:"syncDatabaseId,omitempty"` - // LastAliveTime - READ-ONLY; Last alive time of the sync agent. - LastAliveTime *date.Time `json:"lastAliveTime,omitempty"` - // State - READ-ONLY; State of the sync agent. Possible values include: 'SyncAgentStateOnline', 'SyncAgentStateOffline', 'SyncAgentStateNeverConnected' - State SyncAgentState `json:"state,omitempty"` - // IsUpToDate - READ-ONLY; If the sync agent version is up to date. - IsUpToDate *bool `json:"isUpToDate,omitempty"` - // ExpiryTime - READ-ONLY; Expiration time of the sync agent version. - ExpiryTime *date.Time `json:"expiryTime,omitempty"` - // Version - READ-ONLY; Version of the sync agent. - Version *string `json:"version,omitempty"` -} - -// SyncAgentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type SyncAgentsCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *SyncAgentsCreateOrUpdateFuture) Result(client SyncAgentsClient) (sa SyncAgent, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncAgentsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.SyncAgentsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if sa.Response.Response, err = future.GetResult(sender); err == nil && sa.Response.Response.StatusCode != http.StatusNoContent { - sa, err = client.CreateOrUpdateResponder(sa.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncAgentsCreateOrUpdateFuture", "Result", sa.Response.Response, "Failure responding to request") - } - } - return -} - -// SyncAgentsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type SyncAgentsDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *SyncAgentsDeleteFuture) Result(client SyncAgentsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncAgentsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.SyncAgentsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// SyncDatabaseIDListResult a list of sync database ID properties. -type SyncDatabaseIDListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]SyncDatabaseIDProperties `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// SyncDatabaseIDListResultIterator provides access to a complete listing of SyncDatabaseIDProperties -// values. -type SyncDatabaseIDListResultIterator struct { - i int - page SyncDatabaseIDListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *SyncDatabaseIDListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncDatabaseIDListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *SyncDatabaseIDListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SyncDatabaseIDListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter SyncDatabaseIDListResultIterator) Response() SyncDatabaseIDListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter SyncDatabaseIDListResultIterator) Value() SyncDatabaseIDProperties { - if !iter.page.NotDone() { - return SyncDatabaseIDProperties{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the SyncDatabaseIDListResultIterator type. -func NewSyncDatabaseIDListResultIterator(page SyncDatabaseIDListResultPage) SyncDatabaseIDListResultIterator { - return SyncDatabaseIDListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (sdilr SyncDatabaseIDListResult) IsEmpty() bool { - return sdilr.Value == nil || len(*sdilr.Value) == 0 -} - -// syncDatabaseIDListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (sdilr SyncDatabaseIDListResult) syncDatabaseIDListResultPreparer(ctx context.Context) (*http.Request, error) { - if sdilr.NextLink == nil || len(to.String(sdilr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(sdilr.NextLink))) -} - -// SyncDatabaseIDListResultPage contains a page of SyncDatabaseIDProperties values. -type SyncDatabaseIDListResultPage struct { - fn func(context.Context, SyncDatabaseIDListResult) (SyncDatabaseIDListResult, error) - sdilr SyncDatabaseIDListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *SyncDatabaseIDListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncDatabaseIDListResultPage.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.sdilr) - if err != nil { - return err - } - page.sdilr = 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 *SyncDatabaseIDListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SyncDatabaseIDListResultPage) NotDone() bool { - return !page.sdilr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page SyncDatabaseIDListResultPage) Response() SyncDatabaseIDListResult { - return page.sdilr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page SyncDatabaseIDListResultPage) Values() []SyncDatabaseIDProperties { - if page.sdilr.IsEmpty() { - return nil - } - return *page.sdilr.Value -} - -// Creates a new instance of the SyncDatabaseIDListResultPage type. -func NewSyncDatabaseIDListResultPage(getNextPage func(context.Context, SyncDatabaseIDListResult) (SyncDatabaseIDListResult, error)) SyncDatabaseIDListResultPage { - return SyncDatabaseIDListResultPage{fn: getNextPage} -} - -// SyncDatabaseIDProperties properties of the sync database id. -type SyncDatabaseIDProperties struct { - // ID - READ-ONLY; ARM resource id of sync database. - ID *string `json:"id,omitempty"` -} - -// SyncFullSchemaProperties properties of the database full schema. -type SyncFullSchemaProperties struct { - // Tables - READ-ONLY; List of tables in the database full schema. - Tables *[]SyncFullSchemaTable `json:"tables,omitempty"` - // LastUpdateTime - READ-ONLY; Last update time of the database schema. - LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"` -} - -// SyncFullSchemaPropertiesListResult a list of sync schema properties. -type SyncFullSchemaPropertiesListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]SyncFullSchemaProperties `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// SyncFullSchemaPropertiesListResultIterator provides access to a complete listing of -// SyncFullSchemaProperties values. -type SyncFullSchemaPropertiesListResultIterator struct { - i int - page SyncFullSchemaPropertiesListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *SyncFullSchemaPropertiesListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncFullSchemaPropertiesListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *SyncFullSchemaPropertiesListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SyncFullSchemaPropertiesListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter SyncFullSchemaPropertiesListResultIterator) Response() SyncFullSchemaPropertiesListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter SyncFullSchemaPropertiesListResultIterator) Value() SyncFullSchemaProperties { - if !iter.page.NotDone() { - return SyncFullSchemaProperties{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the SyncFullSchemaPropertiesListResultIterator type. -func NewSyncFullSchemaPropertiesListResultIterator(page SyncFullSchemaPropertiesListResultPage) SyncFullSchemaPropertiesListResultIterator { - return SyncFullSchemaPropertiesListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (sfsplr SyncFullSchemaPropertiesListResult) IsEmpty() bool { - return sfsplr.Value == nil || len(*sfsplr.Value) == 0 -} - -// syncFullSchemaPropertiesListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (sfsplr SyncFullSchemaPropertiesListResult) syncFullSchemaPropertiesListResultPreparer(ctx context.Context) (*http.Request, error) { - if sfsplr.NextLink == nil || len(to.String(sfsplr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(sfsplr.NextLink))) -} - -// SyncFullSchemaPropertiesListResultPage contains a page of SyncFullSchemaProperties values. -type SyncFullSchemaPropertiesListResultPage struct { - fn func(context.Context, SyncFullSchemaPropertiesListResult) (SyncFullSchemaPropertiesListResult, error) - sfsplr SyncFullSchemaPropertiesListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *SyncFullSchemaPropertiesListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncFullSchemaPropertiesListResultPage.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.sfsplr) - if err != nil { - return err - } - page.sfsplr = 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 *SyncFullSchemaPropertiesListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SyncFullSchemaPropertiesListResultPage) NotDone() bool { - return !page.sfsplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page SyncFullSchemaPropertiesListResultPage) Response() SyncFullSchemaPropertiesListResult { - return page.sfsplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page SyncFullSchemaPropertiesListResultPage) Values() []SyncFullSchemaProperties { - if page.sfsplr.IsEmpty() { - return nil - } - return *page.sfsplr.Value -} - -// Creates a new instance of the SyncFullSchemaPropertiesListResultPage type. -func NewSyncFullSchemaPropertiesListResultPage(getNextPage func(context.Context, SyncFullSchemaPropertiesListResult) (SyncFullSchemaPropertiesListResult, error)) SyncFullSchemaPropertiesListResultPage { - return SyncFullSchemaPropertiesListResultPage{fn: getNextPage} -} - -// SyncFullSchemaTable properties of the table in the database full schema. -type SyncFullSchemaTable struct { - // Columns - READ-ONLY; List of columns in the table of database full schema. - Columns *[]SyncFullSchemaTableColumn `json:"columns,omitempty"` - // ErrorID - READ-ONLY; Error id of the table. - ErrorID *string `json:"errorId,omitempty"` - // HasError - READ-ONLY; If there is error in the table. - HasError *bool `json:"hasError,omitempty"` - // Name - READ-ONLY; Name of the table. - Name *string `json:"name,omitempty"` - // QuotedName - READ-ONLY; Quoted name of the table. - QuotedName *string `json:"quotedName,omitempty"` -} - -// SyncFullSchemaTableColumn properties of the column in the table of database full schema. -type SyncFullSchemaTableColumn struct { - // DataSize - READ-ONLY; Data size of the column. - DataSize *string `json:"dataSize,omitempty"` - // DataType - READ-ONLY; Data type of the column. - DataType *string `json:"dataType,omitempty"` - // ErrorID - READ-ONLY; Error id of the column. - ErrorID *string `json:"errorId,omitempty"` - // HasError - READ-ONLY; If there is error in the table. - HasError *bool `json:"hasError,omitempty"` - // IsPrimaryKey - READ-ONLY; If it is the primary key of the table. - IsPrimaryKey *bool `json:"isPrimaryKey,omitempty"` - // Name - READ-ONLY; Name of the column. - Name *string `json:"name,omitempty"` - // QuotedName - READ-ONLY; Quoted name of the column. - QuotedName *string `json:"quotedName,omitempty"` -} - -// SyncGroup an Azure SQL Database sync group. -type SyncGroup struct { - autorest.Response `json:"-"` - // SyncGroupProperties - Resource properties. - *SyncGroupProperties `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 SyncGroup. -func (sg SyncGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sg.SyncGroupProperties != nil { - objectMap["properties"] = sg.SyncGroupProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SyncGroup struct. -func (sg *SyncGroup) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var syncGroupProperties SyncGroupProperties - err = json.Unmarshal(*v, &syncGroupProperties) - if err != nil { - return err - } - sg.SyncGroupProperties = &syncGroupProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - sg.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - sg.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - sg.Type = &typeVar - } - } - } - - return nil -} - -// SyncGroupListResult a list of sync groups. -type SyncGroupListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]SyncGroup `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// SyncGroupListResultIterator provides access to a complete listing of SyncGroup values. -type SyncGroupListResultIterator struct { - i int - page SyncGroupListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *SyncGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncGroupListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *SyncGroupListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SyncGroupListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter SyncGroupListResultIterator) Response() SyncGroupListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter SyncGroupListResultIterator) Value() SyncGroup { - if !iter.page.NotDone() { - return SyncGroup{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the SyncGroupListResultIterator type. -func NewSyncGroupListResultIterator(page SyncGroupListResultPage) SyncGroupListResultIterator { - return SyncGroupListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (sglr SyncGroupListResult) IsEmpty() bool { - return sglr.Value == nil || len(*sglr.Value) == 0 -} - -// syncGroupListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (sglr SyncGroupListResult) syncGroupListResultPreparer(ctx context.Context) (*http.Request, error) { - if sglr.NextLink == nil || len(to.String(sglr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(sglr.NextLink))) -} - -// SyncGroupListResultPage contains a page of SyncGroup values. -type SyncGroupListResultPage struct { - fn func(context.Context, SyncGroupListResult) (SyncGroupListResult, error) - sglr SyncGroupListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *SyncGroupListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncGroupListResultPage.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.sglr) - if err != nil { - return err - } - page.sglr = 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 *SyncGroupListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SyncGroupListResultPage) NotDone() bool { - return !page.sglr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page SyncGroupListResultPage) Response() SyncGroupListResult { - return page.sglr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page SyncGroupListResultPage) Values() []SyncGroup { - if page.sglr.IsEmpty() { - return nil - } - return *page.sglr.Value -} - -// Creates a new instance of the SyncGroupListResultPage type. -func NewSyncGroupListResultPage(getNextPage func(context.Context, SyncGroupListResult) (SyncGroupListResult, error)) SyncGroupListResultPage { - return SyncGroupListResultPage{fn: getNextPage} -} - -// SyncGroupLogListResult a list of sync group log properties. -type SyncGroupLogListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]SyncGroupLogProperties `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// SyncGroupLogListResultIterator provides access to a complete listing of SyncGroupLogProperties values. -type SyncGroupLogListResultIterator struct { - i int - page SyncGroupLogListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *SyncGroupLogListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncGroupLogListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *SyncGroupLogListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SyncGroupLogListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter SyncGroupLogListResultIterator) Response() SyncGroupLogListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter SyncGroupLogListResultIterator) Value() SyncGroupLogProperties { - if !iter.page.NotDone() { - return SyncGroupLogProperties{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the SyncGroupLogListResultIterator type. -func NewSyncGroupLogListResultIterator(page SyncGroupLogListResultPage) SyncGroupLogListResultIterator { - return SyncGroupLogListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (sgllr SyncGroupLogListResult) IsEmpty() bool { - return sgllr.Value == nil || len(*sgllr.Value) == 0 -} - -// syncGroupLogListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (sgllr SyncGroupLogListResult) syncGroupLogListResultPreparer(ctx context.Context) (*http.Request, error) { - if sgllr.NextLink == nil || len(to.String(sgllr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(sgllr.NextLink))) -} - -// SyncGroupLogListResultPage contains a page of SyncGroupLogProperties values. -type SyncGroupLogListResultPage struct { - fn func(context.Context, SyncGroupLogListResult) (SyncGroupLogListResult, error) - sgllr SyncGroupLogListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *SyncGroupLogListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncGroupLogListResultPage.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.sgllr) - if err != nil { - return err - } - page.sgllr = 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 *SyncGroupLogListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SyncGroupLogListResultPage) NotDone() bool { - return !page.sgllr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page SyncGroupLogListResultPage) Response() SyncGroupLogListResult { - return page.sgllr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page SyncGroupLogListResultPage) Values() []SyncGroupLogProperties { - if page.sgllr.IsEmpty() { - return nil - } - return *page.sgllr.Value -} - -// Creates a new instance of the SyncGroupLogListResultPage type. -func NewSyncGroupLogListResultPage(getNextPage func(context.Context, SyncGroupLogListResult) (SyncGroupLogListResult, error)) SyncGroupLogListResultPage { - return SyncGroupLogListResultPage{fn: getNextPage} -} - -// SyncGroupLogProperties properties of an Azure SQL Database sync group log. -type SyncGroupLogProperties struct { - // Timestamp - READ-ONLY; Timestamp of the sync group log. - Timestamp *date.Time `json:"timestamp,omitempty"` - // Type - READ-ONLY; Type of the sync group log. Possible values include: 'SyncGroupLogTypeAll', 'SyncGroupLogTypeError', 'SyncGroupLogTypeWarning', 'SyncGroupLogTypeSuccess' - Type SyncGroupLogType `json:"type,omitempty"` - // Source - READ-ONLY; Source of the sync group log. - Source *string `json:"source,omitempty"` - // Details - READ-ONLY; Details of the sync group log. - Details *string `json:"details,omitempty"` - // TracingID - READ-ONLY; TracingId of the sync group log. - TracingID *uuid.UUID `json:"tracingId,omitempty"` - // OperationStatus - READ-ONLY; OperationStatus of the sync group log. - OperationStatus *string `json:"operationStatus,omitempty"` -} - -// SyncGroupProperties properties of a sync group. -type SyncGroupProperties struct { - // Interval - Sync interval of the sync group. - Interval *int32 `json:"interval,omitempty"` - // LastSyncTime - READ-ONLY; Last sync time of the sync group. - LastSyncTime *date.Time `json:"lastSyncTime,omitempty"` - // ConflictResolutionPolicy - Conflict resolution policy of the sync group. Possible values include: 'HubWin', 'MemberWin' - ConflictResolutionPolicy SyncConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"` - // SyncDatabaseID - ARM resource id of the sync database in the sync group. - SyncDatabaseID *string `json:"syncDatabaseId,omitempty"` - // HubDatabaseUserName - User name for the sync group hub database credential. - HubDatabaseUserName *string `json:"hubDatabaseUserName,omitempty"` - // HubDatabasePassword - Password for the sync group hub database credential. - HubDatabasePassword *string `json:"hubDatabasePassword,omitempty"` - // SyncState - READ-ONLY; Sync state of the sync group. Possible values include: 'NotReady', 'Error', 'Warning', 'Progressing', 'Good' - SyncState SyncGroupState `json:"syncState,omitempty"` - // Schema - Sync schema of the sync group. - Schema *SyncGroupSchema `json:"schema,omitempty"` -} - -// SyncGroupSchema properties of sync group schema. -type SyncGroupSchema struct { - // Tables - List of tables in sync group schema. - Tables *[]SyncGroupSchemaTable `json:"tables,omitempty"` - // MasterSyncMemberName - Name of master sync member where the schema is from. - MasterSyncMemberName *string `json:"masterSyncMemberName,omitempty"` -} - -// SyncGroupSchemaTable properties of table in sync group schema. -type SyncGroupSchemaTable struct { - // Columns - List of columns in sync group schema. - Columns *[]SyncGroupSchemaTableColumn `json:"columns,omitempty"` - // QuotedName - Quoted name of sync group schema table. - QuotedName *string `json:"quotedName,omitempty"` -} - -// SyncGroupSchemaTableColumn properties of column in sync group table. -type SyncGroupSchemaTableColumn struct { - // QuotedName - Quoted name of sync group table column. - QuotedName *string `json:"quotedName,omitempty"` - // DataSize - Data size of the column. - DataSize *string `json:"dataSize,omitempty"` - // DataType - Data type of the column. - DataType *string `json:"dataType,omitempty"` -} - -// SyncGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type SyncGroupsCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *SyncGroupsCreateOrUpdateFuture) Result(client SyncGroupsClient) (sg SyncGroup, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.SyncGroupsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if sg.Response.Response, err = future.GetResult(sender); err == nil && sg.Response.Response.StatusCode != http.StatusNoContent { - sg, err = client.CreateOrUpdateResponder(sg.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncGroupsCreateOrUpdateFuture", "Result", sg.Response.Response, "Failure responding to request") - } - } - return -} - -// SyncGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type SyncGroupsDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *SyncGroupsDeleteFuture) Result(client SyncGroupsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncGroupsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.SyncGroupsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// SyncGroupsRefreshHubSchemaFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type SyncGroupsRefreshHubSchemaFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *SyncGroupsRefreshHubSchemaFuture) Result(client SyncGroupsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncGroupsRefreshHubSchemaFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.SyncGroupsRefreshHubSchemaFuture") - return - } - ar.Response = future.Response() - return -} - -// SyncGroupsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type SyncGroupsUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *SyncGroupsUpdateFuture) Result(client SyncGroupsClient) (sg SyncGroup, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncGroupsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.SyncGroupsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if sg.Response.Response, err = future.GetResult(sender); err == nil && sg.Response.Response.StatusCode != http.StatusNoContent { - sg, err = client.UpdateResponder(sg.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncGroupsUpdateFuture", "Result", sg.Response.Response, "Failure responding to request") - } - } - return -} - -// SyncMember an Azure SQL Database sync member. -type SyncMember struct { - autorest.Response `json:"-"` - // SyncMemberProperties - Resource properties. - *SyncMemberProperties `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 SyncMember. -func (sm SyncMember) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sm.SyncMemberProperties != nil { - objectMap["properties"] = sm.SyncMemberProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SyncMember struct. -func (sm *SyncMember) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var syncMemberProperties SyncMemberProperties - err = json.Unmarshal(*v, &syncMemberProperties) - if err != nil { - return err - } - sm.SyncMemberProperties = &syncMemberProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - sm.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - sm.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - sm.Type = &typeVar - } - } - } - - return nil -} - -// SyncMemberListResult a list of Azure SQL Database sync members. -type SyncMemberListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]SyncMember `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// SyncMemberListResultIterator provides access to a complete listing of SyncMember values. -type SyncMemberListResultIterator struct { - i int - page SyncMemberListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *SyncMemberListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncMemberListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *SyncMemberListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SyncMemberListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter SyncMemberListResultIterator) Response() SyncMemberListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter SyncMemberListResultIterator) Value() SyncMember { - if !iter.page.NotDone() { - return SyncMember{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the SyncMemberListResultIterator type. -func NewSyncMemberListResultIterator(page SyncMemberListResultPage) SyncMemberListResultIterator { - return SyncMemberListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (smlr SyncMemberListResult) IsEmpty() bool { - return smlr.Value == nil || len(*smlr.Value) == 0 -} - -// syncMemberListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (smlr SyncMemberListResult) syncMemberListResultPreparer(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(smlr.NextLink))) -} - -// SyncMemberListResultPage contains a page of SyncMember values. -type SyncMemberListResultPage struct { - fn func(context.Context, SyncMemberListResult) (SyncMemberListResult, error) - smlr SyncMemberListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *SyncMemberListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncMemberListResultPage.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.smlr) - if err != nil { - return err - } - 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 *SyncMemberListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SyncMemberListResultPage) NotDone() bool { - return !page.smlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page SyncMemberListResultPage) Response() SyncMemberListResult { - return page.smlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page SyncMemberListResultPage) Values() []SyncMember { - if page.smlr.IsEmpty() { - return nil - } - return *page.smlr.Value -} - -// Creates a new instance of the SyncMemberListResultPage type. -func NewSyncMemberListResultPage(getNextPage func(context.Context, SyncMemberListResult) (SyncMemberListResult, error)) SyncMemberListResultPage { - return SyncMemberListResultPage{fn: getNextPage} -} - -// SyncMemberProperties properties of a sync member. -type SyncMemberProperties struct { - // DatabaseType - Database type of the sync member. Possible values include: 'AzureSQLDatabase', 'SQLServerDatabase' - DatabaseType SyncMemberDbType `json:"databaseType,omitempty"` - // SyncAgentID - ARM resource id of the sync agent in the sync member. - SyncAgentID *string `json:"syncAgentId,omitempty"` - // SQLServerDatabaseID - SQL Server database id of the sync member. - SQLServerDatabaseID *uuid.UUID `json:"sqlServerDatabaseId,omitempty"` - // ServerName - Server name of the member database in the sync member - ServerName *string `json:"serverName,omitempty"` - // DatabaseName - Database name of the member database in the sync member. - DatabaseName *string `json:"databaseName,omitempty"` - // UserName - User name of the member database in the sync member. - UserName *string `json:"userName,omitempty"` - // Password - Password of the member database in the sync member. - Password *string `json:"password,omitempty"` - // SyncDirection - Sync direction of the sync member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', 'OneWayHubToMember' - SyncDirection SyncDirection `json:"syncDirection,omitempty"` - // SyncState - READ-ONLY; Sync state of the sync member. Possible values include: 'SyncInProgress', 'SyncSucceeded', 'SyncFailed', 'DisabledTombstoneCleanup', 'DisabledBackupRestore', 'SyncSucceededWithWarnings', 'SyncCancelling', 'SyncCancelled', 'UnProvisioned', 'Provisioning', 'Provisioned', 'ProvisionFailed', 'DeProvisioning', 'DeProvisioned', 'DeProvisionFailed', 'Reprovisioning', 'ReprovisionFailed', 'UnReprovisioned' - SyncState SyncMemberState `json:"syncState,omitempty"` -} - -// SyncMembersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type SyncMembersCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *SyncMembersCreateOrUpdateFuture) Result(client SyncMembersClient) (sm SyncMember, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncMembersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.SyncMembersCreateOrUpdateFuture") - 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.CreateOrUpdateResponder(sm.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncMembersCreateOrUpdateFuture", "Result", sm.Response.Response, "Failure responding to request") - } - } - return -} - -// SyncMembersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type SyncMembersDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *SyncMembersDeleteFuture) Result(client SyncMembersClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncMembersDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.SyncMembersDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// SyncMembersRefreshMemberSchemaFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type SyncMembersRefreshMemberSchemaFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *SyncMembersRefreshMemberSchemaFuture) Result(client SyncMembersClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncMembersRefreshMemberSchemaFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.SyncMembersRefreshMemberSchemaFuture") - return - } - ar.Response = future.Response() - return -} - -// SyncMembersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type SyncMembersUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *SyncMembersUpdateFuture) Result(client SyncMembersClient) (sm SyncMember, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncMembersUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.SyncMembersUpdateFuture") - 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, "sql.SyncMembersUpdateFuture", "Result", sm.Response.Response, "Failure responding to request") - } - } - return -} - -// TdeCertificate a TDE certificate that can be uploaded into a server. -type TdeCertificate struct { - // TdeCertificateProperties - Resource properties. - *TdeCertificateProperties `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 TdeCertificate. -func (tc TdeCertificate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if tc.TdeCertificateProperties != nil { - objectMap["properties"] = tc.TdeCertificateProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for TdeCertificate struct. -func (tc *TdeCertificate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var tdeCertificateProperties TdeCertificateProperties - err = json.Unmarshal(*v, &tdeCertificateProperties) - if err != nil { - return err - } - tc.TdeCertificateProperties = &tdeCertificateProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - tc.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - tc.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - tc.Type = &typeVar - } - } - } - - return nil -} - -// TdeCertificateProperties properties of a TDE certificate. -type TdeCertificateProperties struct { - // PrivateBlob - The base64 encoded certificate private blob. - PrivateBlob *string `json:"privateBlob,omitempty"` - // CertPassword - The certificate password. - CertPassword *string `json:"certPassword,omitempty"` -} - -// TdeCertificatesCreateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type TdeCertificatesCreateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *TdeCertificatesCreateFuture) Result(client TdeCertificatesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.TdeCertificatesCreateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.TdeCertificatesCreateFuture") - return - } - ar.Response = future.Response() - return -} - -// TrackedResource ARM tracked top level resource. -type TrackedResource struct { - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for TrackedResource. -func (tr TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if tr.Location != nil { - objectMap["location"] = tr.Location - } - if tr.Tags != nil { - objectMap["tags"] = tr.Tags - } - return json.Marshal(objectMap) -} - -// TransparentDataEncryption represents a database transparent data encryption configuration. -type TransparentDataEncryption struct { - autorest.Response `json:"-"` - // Location - READ-ONLY; Resource location. - Location *string `json:"location,omitempty"` - // TransparentDataEncryptionProperties - Represents the properties of the resource. - *TransparentDataEncryptionProperties `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 TransparentDataEncryption. -func (tde TransparentDataEncryption) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if tde.TransparentDataEncryptionProperties != nil { - objectMap["properties"] = tde.TransparentDataEncryptionProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for TransparentDataEncryption struct. -func (tde *TransparentDataEncryption) UnmarshalJSON(body []byte) error { - 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 - } - tde.Location = &location - } - case "properties": - if v != nil { - var transparentDataEncryptionProperties TransparentDataEncryptionProperties - err = json.Unmarshal(*v, &transparentDataEncryptionProperties) - if err != nil { - return err - } - tde.TransparentDataEncryptionProperties = &transparentDataEncryptionProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - tde.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - tde.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - tde.Type = &typeVar - } - } - } - - return nil -} - -// TransparentDataEncryptionActivity represents a database transparent data encryption Scan. -type TransparentDataEncryptionActivity struct { - // Location - READ-ONLY; Resource location. - Location *string `json:"location,omitempty"` - // TransparentDataEncryptionActivityProperties - Represents the properties of the resource. - *TransparentDataEncryptionActivityProperties `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 TransparentDataEncryptionActivity. -func (tdea TransparentDataEncryptionActivity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if tdea.TransparentDataEncryptionActivityProperties != nil { - objectMap["properties"] = tdea.TransparentDataEncryptionActivityProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for TransparentDataEncryptionActivity struct. -func (tdea *TransparentDataEncryptionActivity) UnmarshalJSON(body []byte) error { - 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 - } - tdea.Location = &location - } - case "properties": - if v != nil { - var transparentDataEncryptionActivityProperties TransparentDataEncryptionActivityProperties - err = json.Unmarshal(*v, &transparentDataEncryptionActivityProperties) - if err != nil { - return err - } - tdea.TransparentDataEncryptionActivityProperties = &transparentDataEncryptionActivityProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - tdea.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - tdea.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - tdea.Type = &typeVar - } - } - } - - return nil -} - -// TransparentDataEncryptionActivityListResult represents the response to a list database transparent data -// encryption activity request. -type TransparentDataEncryptionActivityListResult struct { - autorest.Response `json:"-"` - // Value - The list of database transparent data encryption activities. - Value *[]TransparentDataEncryptionActivity `json:"value,omitempty"` -} - -// TransparentDataEncryptionActivityProperties represents the properties of a database transparent data -// encryption Scan. -type TransparentDataEncryptionActivityProperties struct { - // Status - READ-ONLY; The status of the database. Possible values include: 'Encrypting', 'Decrypting' - Status TransparentDataEncryptionActivityStatus `json:"status,omitempty"` - // PercentComplete - READ-ONLY; The percent complete of the transparent data encryption scan for a database. - PercentComplete *float64 `json:"percentComplete,omitempty"` -} - -// TransparentDataEncryptionProperties represents the properties of a database transparent data encryption. -type TransparentDataEncryptionProperties struct { - // Status - The status of the database transparent data encryption. Possible values include: 'TransparentDataEncryptionStatusEnabled', 'TransparentDataEncryptionStatusDisabled' - Status TransparentDataEncryptionStatus `json:"status,omitempty"` -} - -// Usage ARM usage. -type Usage struct { - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *Name `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Unit - READ-ONLY; Usage unit. - Unit *string `json:"unit,omitempty"` - // CurrentValue - READ-ONLY; Usage current value. - CurrentValue *int32 `json:"currentValue,omitempty"` - // Limit - READ-ONLY; Usage limit. - Limit *int32 `json:"limit,omitempty"` - // RequestedLimit - READ-ONLY; Usage requested limit. - RequestedLimit *int32 `json:"requestedLimit,omitempty"` -} - -// UsageListResult a list of usages. -type UsageListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]Usage `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// UsageListResultIterator provides access to a complete listing of Usage values. -type UsageListResultIterator struct { - i int - page UsageListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *UsageListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/UsageListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *UsageListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter UsageListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter UsageListResultIterator) Response() UsageListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter UsageListResultIterator) Value() Usage { - if !iter.page.NotDone() { - return Usage{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the UsageListResultIterator type. -func NewUsageListResultIterator(page UsageListResultPage) UsageListResultIterator { - return UsageListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (ulr UsageListResult) IsEmpty() bool { - return ulr.Value == nil || len(*ulr.Value) == 0 -} - -// usageListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ulr UsageListResult) usageListResultPreparer(ctx context.Context) (*http.Request, error) { - if ulr.NextLink == nil || len(to.String(ulr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ulr.NextLink))) -} - -// UsageListResultPage contains a page of Usage values. -type UsageListResultPage struct { - fn func(context.Context, UsageListResult) (UsageListResult, error) - ulr UsageListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *UsageListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/UsageListResultPage.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.ulr) - if err != nil { - return err - } - page.ulr = 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 *UsageListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page UsageListResultPage) NotDone() bool { - return !page.ulr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page UsageListResultPage) Response() UsageListResult { - return page.ulr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page UsageListResultPage) Values() []Usage { - if page.ulr.IsEmpty() { - return nil - } - return *page.ulr.Value -} - -// Creates a new instance of the UsageListResultPage type. -func NewUsageListResultPage(getNextPage func(context.Context, UsageListResult) (UsageListResult, error)) UsageListResultPage { - return UsageListResultPage{fn: getNextPage} -} - -// VirtualCluster an Azure SQL virtual cluster. -type VirtualCluster struct { - autorest.Response `json:"-"` - // VirtualClusterProperties - Resource properties. - *VirtualClusterProperties `json:"properties,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualCluster. -func (vc VirtualCluster) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vc.VirtualClusterProperties != nil { - objectMap["properties"] = vc.VirtualClusterProperties - } - if vc.Location != nil { - objectMap["location"] = vc.Location - } - if vc.Tags != nil { - objectMap["tags"] = vc.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualCluster struct. -func (vc *VirtualCluster) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualClusterProperties VirtualClusterProperties - err = json.Unmarshal(*v, &virtualClusterProperties) - if err != nil { - return err - } - vc.VirtualClusterProperties = &virtualClusterProperties - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - vc.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vc.Tags = tags - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vc.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vc.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vc.Type = &typeVar - } - } - } - - return nil -} - -// VirtualClusterListResult a list of virtual clusters. -type VirtualClusterListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]VirtualCluster `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualClusterListResultIterator provides access to a complete listing of VirtualCluster values. -type VirtualClusterListResultIterator struct { - i int - page VirtualClusterListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualClusterListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualClusterListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualClusterListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualClusterListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualClusterListResultIterator) Response() VirtualClusterListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualClusterListResultIterator) Value() VirtualCluster { - if !iter.page.NotDone() { - return VirtualCluster{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualClusterListResultIterator type. -func NewVirtualClusterListResultIterator(page VirtualClusterListResultPage) VirtualClusterListResultIterator { - return VirtualClusterListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vclr VirtualClusterListResult) IsEmpty() bool { - return vclr.Value == nil || len(*vclr.Value) == 0 -} - -// virtualClusterListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vclr VirtualClusterListResult) virtualClusterListResultPreparer(ctx context.Context) (*http.Request, error) { - if vclr.NextLink == nil || len(to.String(vclr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vclr.NextLink))) -} - -// VirtualClusterListResultPage contains a page of VirtualCluster values. -type VirtualClusterListResultPage struct { - fn func(context.Context, VirtualClusterListResult) (VirtualClusterListResult, error) - vclr VirtualClusterListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualClusterListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualClusterListResultPage.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.vclr) - if err != nil { - return err - } - page.vclr = 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 *VirtualClusterListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualClusterListResultPage) NotDone() bool { - return !page.vclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualClusterListResultPage) Response() VirtualClusterListResult { - return page.vclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualClusterListResultPage) Values() []VirtualCluster { - if page.vclr.IsEmpty() { - return nil - } - return *page.vclr.Value -} - -// Creates a new instance of the VirtualClusterListResultPage type. -func NewVirtualClusterListResultPage(getNextPage func(context.Context, VirtualClusterListResult) (VirtualClusterListResult, error)) VirtualClusterListResultPage { - return VirtualClusterListResultPage{fn: getNextPage} -} - -// VirtualClusterProperties the properties of a virtual cluster. -type VirtualClusterProperties struct { - // SubnetID - READ-ONLY; Subnet resource ID for the virtual cluster. - SubnetID *string `json:"subnetId,omitempty"` - // Family - If the service has different generations of hardware, for the same SKU, then that can be captured here. - Family *string `json:"family,omitempty"` - // ChildResources - READ-ONLY; List of resources in this virtual cluster. - ChildResources *[]string `json:"childResources,omitempty"` -} - -// VirtualClustersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualClustersDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualClustersDeleteFuture) Result(client VirtualClustersClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.VirtualClustersDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.VirtualClustersDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualClustersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualClustersUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualClustersUpdateFuture) Result(client VirtualClustersClient) (vc VirtualCluster, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.VirtualClustersUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.VirtualClustersUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vc.Response.Response, err = future.GetResult(sender); err == nil && vc.Response.Response.StatusCode != http.StatusNoContent { - vc, err = client.UpdateResponder(vc.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.VirtualClustersUpdateFuture", "Result", vc.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualClusterUpdate an update request for an Azure SQL Database virtual cluster. -type VirtualClusterUpdate struct { - // VirtualClusterProperties - Resource properties. - *VirtualClusterProperties `json:"properties,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VirtualClusterUpdate. -func (vcu VirtualClusterUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vcu.VirtualClusterProperties != nil { - objectMap["properties"] = vcu.VirtualClusterProperties - } - if vcu.Tags != nil { - objectMap["tags"] = vcu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualClusterUpdate struct. -func (vcu *VirtualClusterUpdate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualClusterProperties VirtualClusterProperties - err = json.Unmarshal(*v, &virtualClusterProperties) - if err != nil { - return err - } - vcu.VirtualClusterProperties = &virtualClusterProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vcu.Tags = tags - } - } - } - - return nil -} - -// VirtualNetworkRule a virtual network rule. -type VirtualNetworkRule struct { - autorest.Response `json:"-"` - // VirtualNetworkRuleProperties - Resource properties. - *VirtualNetworkRuleProperties `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 VirtualNetworkRule. -func (vnr VirtualNetworkRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vnr.VirtualNetworkRuleProperties != nil { - objectMap["properties"] = vnr.VirtualNetworkRuleProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualNetworkRule struct. -func (vnr *VirtualNetworkRule) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualNetworkRuleProperties VirtualNetworkRuleProperties - err = json.Unmarshal(*v, &virtualNetworkRuleProperties) - if err != nil { - return err - } - vnr.VirtualNetworkRuleProperties = &virtualNetworkRuleProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vnr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vnr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vnr.Type = &typeVar - } - } - } - - return nil -} - -// VirtualNetworkRuleListResult a list of virtual network rules. -type VirtualNetworkRuleListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]VirtualNetworkRule `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualNetworkRuleListResultIterator provides access to a complete listing of VirtualNetworkRule values. -type VirtualNetworkRuleListResultIterator struct { - i int - page VirtualNetworkRuleListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualNetworkRuleListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkRuleListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualNetworkRuleListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualNetworkRuleListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualNetworkRuleListResultIterator) Response() VirtualNetworkRuleListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualNetworkRuleListResultIterator) Value() VirtualNetworkRule { - if !iter.page.NotDone() { - return VirtualNetworkRule{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualNetworkRuleListResultIterator type. -func NewVirtualNetworkRuleListResultIterator(page VirtualNetworkRuleListResultPage) VirtualNetworkRuleListResultIterator { - return VirtualNetworkRuleListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vnrlr VirtualNetworkRuleListResult) IsEmpty() bool { - return vnrlr.Value == nil || len(*vnrlr.Value) == 0 -} - -// virtualNetworkRuleListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vnrlr VirtualNetworkRuleListResult) virtualNetworkRuleListResultPreparer(ctx context.Context) (*http.Request, error) { - if vnrlr.NextLink == nil || len(to.String(vnrlr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vnrlr.NextLink))) -} - -// VirtualNetworkRuleListResultPage contains a page of VirtualNetworkRule values. -type VirtualNetworkRuleListResultPage struct { - fn func(context.Context, VirtualNetworkRuleListResult) (VirtualNetworkRuleListResult, error) - vnrlr VirtualNetworkRuleListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualNetworkRuleListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkRuleListResultPage.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.vnrlr) - if err != nil { - return err - } - page.vnrlr = 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 *VirtualNetworkRuleListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualNetworkRuleListResultPage) NotDone() bool { - return !page.vnrlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualNetworkRuleListResultPage) Response() VirtualNetworkRuleListResult { - return page.vnrlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualNetworkRuleListResultPage) Values() []VirtualNetworkRule { - if page.vnrlr.IsEmpty() { - return nil - } - return *page.vnrlr.Value -} - -// Creates a new instance of the VirtualNetworkRuleListResultPage type. -func NewVirtualNetworkRuleListResultPage(getNextPage func(context.Context, VirtualNetworkRuleListResult) (VirtualNetworkRuleListResult, error)) VirtualNetworkRuleListResultPage { - return VirtualNetworkRuleListResultPage{fn: getNextPage} -} - -// VirtualNetworkRuleProperties properties of a virtual network rule. -type VirtualNetworkRuleProperties struct { - // VirtualNetworkSubnetID - The ARM resource id of the virtual network subnet. - VirtualNetworkSubnetID *string `json:"virtualNetworkSubnetId,omitempty"` - // IgnoreMissingVnetServiceEndpoint - Create firewall rule before the virtual network has vnet service endpoint enabled. - IgnoreMissingVnetServiceEndpoint *bool `json:"ignoreMissingVnetServiceEndpoint,omitempty"` - // State - READ-ONLY; Virtual Network Rule State. Possible values include: 'VirtualNetworkRuleStateInitializing', 'VirtualNetworkRuleStateInProgress', 'VirtualNetworkRuleStateReady', 'VirtualNetworkRuleStateDeleting', 'VirtualNetworkRuleStateUnknown' - State VirtualNetworkRuleState `json:"state,omitempty"` -} - -// VirtualNetworkRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualNetworkRulesCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualNetworkRulesCreateOrUpdateFuture) Result(client VirtualNetworkRulesClient) (vnr VirtualNetworkRule, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.VirtualNetworkRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.VirtualNetworkRulesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vnr.Response.Response, err = future.GetResult(sender); err == nil && vnr.Response.Response.StatusCode != http.StatusNoContent { - vnr, err = client.CreateOrUpdateResponder(vnr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.VirtualNetworkRulesCreateOrUpdateFuture", "Result", vnr.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkRulesDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualNetworkRulesDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualNetworkRulesDeleteFuture) Result(client VirtualNetworkRulesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.VirtualNetworkRulesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.VirtualNetworkRulesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VulnerabilityAssessmentRecurringScansProperties properties of a Vulnerability Assessment recurring -// scans. -type VulnerabilityAssessmentRecurringScansProperties struct { - // IsEnabled - Recurring scans state. - IsEnabled *bool `json:"isEnabled,omitempty"` - // EmailSubscriptionAdmins - Specifies that the schedule scan notification will be is sent to the subscription administrators. - EmailSubscriptionAdmins *bool `json:"emailSubscriptionAdmins,omitempty"` - // Emails - Specifies an array of e-mail addresses to which the scan notification is sent. - Emails *[]string `json:"emails,omitempty"` -} - -// VulnerabilityAssessmentScanError properties of a vulnerability assessment scan error. -type VulnerabilityAssessmentScanError struct { - // Code - READ-ONLY; The error code. - Code *string `json:"code,omitempty"` - // Message - READ-ONLY; The error message. - Message *string `json:"message,omitempty"` -} - -// VulnerabilityAssessmentScanRecord a vulnerability assessment scan record. -type VulnerabilityAssessmentScanRecord struct { - autorest.Response `json:"-"` - // VulnerabilityAssessmentScanRecordProperties - Resource properties. - *VulnerabilityAssessmentScanRecordProperties `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 VulnerabilityAssessmentScanRecord. -func (vasr VulnerabilityAssessmentScanRecord) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vasr.VulnerabilityAssessmentScanRecordProperties != nil { - objectMap["properties"] = vasr.VulnerabilityAssessmentScanRecordProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VulnerabilityAssessmentScanRecord struct. -func (vasr *VulnerabilityAssessmentScanRecord) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var vulnerabilityAssessmentScanRecordProperties VulnerabilityAssessmentScanRecordProperties - err = json.Unmarshal(*v, &vulnerabilityAssessmentScanRecordProperties) - if err != nil { - return err - } - vasr.VulnerabilityAssessmentScanRecordProperties = &vulnerabilityAssessmentScanRecordProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vasr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vasr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vasr.Type = &typeVar - } - } - } - - return nil -} - -// VulnerabilityAssessmentScanRecordListResult a list of vulnerability assessment scan records. -type VulnerabilityAssessmentScanRecordListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]VulnerabilityAssessmentScanRecord `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// VulnerabilityAssessmentScanRecordListResultIterator provides access to a complete listing of -// VulnerabilityAssessmentScanRecord values. -type VulnerabilityAssessmentScanRecordListResultIterator struct { - i int - page VulnerabilityAssessmentScanRecordListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VulnerabilityAssessmentScanRecordListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VulnerabilityAssessmentScanRecordListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VulnerabilityAssessmentScanRecordListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VulnerabilityAssessmentScanRecordListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VulnerabilityAssessmentScanRecordListResultIterator) Response() VulnerabilityAssessmentScanRecordListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VulnerabilityAssessmentScanRecordListResultIterator) Value() VulnerabilityAssessmentScanRecord { - if !iter.page.NotDone() { - return VulnerabilityAssessmentScanRecord{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VulnerabilityAssessmentScanRecordListResultIterator type. -func NewVulnerabilityAssessmentScanRecordListResultIterator(page VulnerabilityAssessmentScanRecordListResultPage) VulnerabilityAssessmentScanRecordListResultIterator { - return VulnerabilityAssessmentScanRecordListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vasrlr VulnerabilityAssessmentScanRecordListResult) IsEmpty() bool { - return vasrlr.Value == nil || len(*vasrlr.Value) == 0 -} - -// vulnerabilityAssessmentScanRecordListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vasrlr VulnerabilityAssessmentScanRecordListResult) vulnerabilityAssessmentScanRecordListResultPreparer(ctx context.Context) (*http.Request, error) { - if vasrlr.NextLink == nil || len(to.String(vasrlr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vasrlr.NextLink))) -} - -// VulnerabilityAssessmentScanRecordListResultPage contains a page of VulnerabilityAssessmentScanRecord -// values. -type VulnerabilityAssessmentScanRecordListResultPage struct { - fn func(context.Context, VulnerabilityAssessmentScanRecordListResult) (VulnerabilityAssessmentScanRecordListResult, error) - vasrlr VulnerabilityAssessmentScanRecordListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VulnerabilityAssessmentScanRecordListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VulnerabilityAssessmentScanRecordListResultPage.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.vasrlr) - if err != nil { - return err - } - page.vasrlr = 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 *VulnerabilityAssessmentScanRecordListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VulnerabilityAssessmentScanRecordListResultPage) NotDone() bool { - return !page.vasrlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VulnerabilityAssessmentScanRecordListResultPage) Response() VulnerabilityAssessmentScanRecordListResult { - return page.vasrlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VulnerabilityAssessmentScanRecordListResultPage) Values() []VulnerabilityAssessmentScanRecord { - if page.vasrlr.IsEmpty() { - return nil - } - return *page.vasrlr.Value -} - -// Creates a new instance of the VulnerabilityAssessmentScanRecordListResultPage type. -func NewVulnerabilityAssessmentScanRecordListResultPage(getNextPage func(context.Context, VulnerabilityAssessmentScanRecordListResult) (VulnerabilityAssessmentScanRecordListResult, error)) VulnerabilityAssessmentScanRecordListResultPage { - return VulnerabilityAssessmentScanRecordListResultPage{fn: getNextPage} -} - -// VulnerabilityAssessmentScanRecordProperties properties of a vulnerability assessment scan record. -type VulnerabilityAssessmentScanRecordProperties struct { - // ScanID - READ-ONLY; The scan ID. - ScanID *string `json:"scanId,omitempty"` - // TriggerType - READ-ONLY; The scan trigger type. Possible values include: 'VulnerabilityAssessmentScanTriggerTypeOnDemand', 'VulnerabilityAssessmentScanTriggerTypeRecurring' - TriggerType VulnerabilityAssessmentScanTriggerType `json:"triggerType,omitempty"` - // State - READ-ONLY; The scan status. Possible values include: 'VulnerabilityAssessmentScanStatePassed', 'VulnerabilityAssessmentScanStateFailed', 'VulnerabilityAssessmentScanStateFailedToRun', 'VulnerabilityAssessmentScanStateInProgress' - State VulnerabilityAssessmentScanState `json:"state,omitempty"` - // StartTime - READ-ONLY; The scan start time (UTC). - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - READ-ONLY; The scan end time (UTC). - EndTime *date.Time `json:"endTime,omitempty"` - // Errors - READ-ONLY; The scan errors. - Errors *[]VulnerabilityAssessmentScanError `json:"errors,omitempty"` - // StorageContainerPath - READ-ONLY; The scan results storage container path. - StorageContainerPath *string `json:"storageContainerPath,omitempty"` - // NumberOfFailedSecurityChecks - READ-ONLY; The number of failed security checks. - NumberOfFailedSecurityChecks *int32 `json:"numberOfFailedSecurityChecks,omitempty"` -} diff --git a/services/preview/sql/mgmt/2018-06-15-preview/sql/privateendpointconnections.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/privateendpointconnections.go deleted file mode 100644 index 1113d763dd5f..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/privateendpointconnections.go +++ /dev/null @@ -1,410 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// PrivateEndpointConnectionsClient is the the Azure SQL Database management API provides a RESTful set of web services -// that interact with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, -// update, and delete databases. -type PrivateEndpointConnectionsClient struct { - BaseClient -} - -// NewPrivateEndpointConnectionsClient creates an instance of the PrivateEndpointConnectionsClient client. -func NewPrivateEndpointConnectionsClient(subscriptionID string) PrivateEndpointConnectionsClient { - return NewPrivateEndpointConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewPrivateEndpointConnectionsClientWithBaseURI creates an instance of the PrivateEndpointConnectionsClient client. -func NewPrivateEndpointConnectionsClientWithBaseURI(baseURI string, subscriptionID string) PrivateEndpointConnectionsClient { - return PrivateEndpointConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate approve or reject a private endpoint connection with a given name. -// 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 PrivateEndpointConnectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection) (result PrivateEndpointConnectionsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.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.PrivateEndpointConnectionProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.PrivateEndpointConnectionProperties.PrivateLinkServiceConnectionState", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.PrivateEndpointConnectionProperties.PrivateLinkServiceConnectionState.Status", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.PrivateEndpointConnectionProperties.PrivateLinkServiceConnectionState.Description", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}}}}); err != nil { - return result, validation.NewError("sql.PrivateEndpointConnectionsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, privateEndpointConnectionName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.PrivateEndpointConnectionsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.PrivateEndpointConnectionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client PrivateEndpointConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "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.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}", 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 PrivateEndpointConnectionsClient) CreateOrUpdateSender(req *http.Request) (future PrivateEndpointConnectionsCreateOrUpdateFuture, 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 PrivateEndpointConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result PrivateEndpointConnection, 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 private endpoint connection with a given name. -// 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 PrivateEndpointConnectionsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string) (result PrivateEndpointConnectionsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.Delete") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, privateEndpointConnectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.PrivateEndpointConnectionsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.PrivateEndpointConnectionsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client PrivateEndpointConnectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "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.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateEndpointConnectionsClient) DeleteSender(req *http.Request) (future PrivateEndpointConnectionsDeleteFuture, err error) { - 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 PrivateEndpointConnectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets a private endpoint connection. -// 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. -// privateEndpointConnectionName - the name of the private endpoint connection. -func (client PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string) (result PrivateEndpointConnection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, serverName, privateEndpointConnectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.PrivateEndpointConnectionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.PrivateEndpointConnectionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.PrivateEndpointConnectionsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client PrivateEndpointConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "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.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateEndpointConnectionsClient) GetSender(req *http.Request) (*http.Response, error) { - 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 PrivateEndpointConnectionsClient) GetResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByServer gets all private endpoint connections on 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 PrivateEndpointConnectionsClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result PrivateEndpointConnectionListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.ListByServer") - defer func() { - sc := -1 - if result.peclr.Response.Response != nil { - sc = result.peclr.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.PrivateEndpointConnectionsClient", "ListByServer", nil, "Failure preparing request") - return - } - - resp, err := client.ListByServerSender(req) - if err != nil { - result.peclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.PrivateEndpointConnectionsClient", "ListByServer", resp, "Failure sending request") - return - } - - result.peclr, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.PrivateEndpointConnectionsClient", "ListByServer", resp, "Failure responding to request") - } - - return -} - -// ListByServerPreparer prepares the ListByServer request. -func (client PrivateEndpointConnectionsClient) 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 = "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.Sql/servers/{serverName}/privateEndpointConnections", 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 PrivateEndpointConnectionsClient) 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 PrivateEndpointConnectionsClient) ListByServerResponder(resp *http.Response) (result PrivateEndpointConnectionListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByServerNextResults retrieves the next set of results, if any. -func (client PrivateEndpointConnectionsClient) listByServerNextResults(ctx context.Context, lastResults PrivateEndpointConnectionListResult) (result PrivateEndpointConnectionListResult, err error) { - req, err := lastResults.privateEndpointConnectionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.PrivateEndpointConnectionsClient", "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.PrivateEndpointConnectionsClient", "listByServerNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.PrivateEndpointConnectionsClient", "listByServerNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByServerComplete enumerates all values, automatically crossing page boundaries as required. -func (client PrivateEndpointConnectionsClient) ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string) (result PrivateEndpointConnectionListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.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/2018-06-15-preview/sql/privatelinkresources.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/privatelinkresources.go deleted file mode 100644 index c528eb552e25..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/privatelinkresources.go +++ /dev/null @@ -1,239 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// PrivateLinkResourcesClient is the the Azure SQL Database management API provides a RESTful set of web services that -// interact with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, -// and delete databases. -type PrivateLinkResourcesClient struct { - BaseClient -} - -// NewPrivateLinkResourcesClient creates an instance of the PrivateLinkResourcesClient client. -func NewPrivateLinkResourcesClient(subscriptionID string) PrivateLinkResourcesClient { - return NewPrivateLinkResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewPrivateLinkResourcesClientWithBaseURI creates an instance of the PrivateLinkResourcesClient client. -func NewPrivateLinkResourcesClientWithBaseURI(baseURI string, subscriptionID string) PrivateLinkResourcesClient { - return PrivateLinkResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets a private link resource for SQL 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. -// groupName - the name of the private link resource. -func (client PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupName string, serverName string, groupName string) (result PrivateLinkResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourcesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, serverName, groupName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.PrivateLinkResourcesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.PrivateLinkResourcesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.PrivateLinkResourcesClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client PrivateLinkResourcesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, groupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "groupName": autorest.Encode("path", groupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "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.Sql/servers/{serverName}/privateLinkResources/{groupName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateLinkResourcesClient) GetSender(req *http.Request) (*http.Response, error) { - 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 PrivateLinkResourcesClient) GetResponder(resp *http.Response) (result PrivateLinkResource, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByServer gets the private link resources for SQL 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 PrivateLinkResourcesClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result PrivateLinkResourceListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourcesClient.ListByServer") - defer func() { - sc := -1 - if result.plrlr.Response.Response != nil { - sc = result.plrlr.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.PrivateLinkResourcesClient", "ListByServer", nil, "Failure preparing request") - return - } - - resp, err := client.ListByServerSender(req) - if err != nil { - result.plrlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.PrivateLinkResourcesClient", "ListByServer", resp, "Failure sending request") - return - } - - result.plrlr, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.PrivateLinkResourcesClient", "ListByServer", resp, "Failure responding to request") - } - - return -} - -// ListByServerPreparer prepares the ListByServer request. -func (client PrivateLinkResourcesClient) 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 = "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.Sql/servers/{serverName}/privateLinkResources", 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 PrivateLinkResourcesClient) 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 PrivateLinkResourcesClient) ListByServerResponder(resp *http.Response) (result PrivateLinkResourceListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByServerNextResults retrieves the next set of results, if any. -func (client PrivateLinkResourcesClient) listByServerNextResults(ctx context.Context, lastResults PrivateLinkResourceListResult) (result PrivateLinkResourceListResult, err error) { - req, err := lastResults.privateLinkResourceListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.PrivateLinkResourcesClient", "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.PrivateLinkResourcesClient", "listByServerNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.PrivateLinkResourcesClient", "listByServerNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByServerComplete enumerates all values, automatically crossing page boundaries as required. -func (client PrivateLinkResourcesClient) ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string) (result PrivateLinkResourceListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourcesClient.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/2018-06-15-preview/sql/recommendedelasticpools.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/recommendedelasticpools.go deleted file mode 100644 index bc6f306fc31f..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/recommendedelasticpools.go +++ /dev/null @@ -1,281 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// RecommendedElasticPoolsClient is the the Azure SQL Database management API provides a RESTful set of web services -// that interact with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, -// update, and delete databases. -type RecommendedElasticPoolsClient struct { - BaseClient -} - -// NewRecommendedElasticPoolsClient creates an instance of the RecommendedElasticPoolsClient client. -func NewRecommendedElasticPoolsClient(subscriptionID string) RecommendedElasticPoolsClient { - return NewRecommendedElasticPoolsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewRecommendedElasticPoolsClientWithBaseURI creates an instance of the RecommendedElasticPoolsClient client. -func NewRecommendedElasticPoolsClientWithBaseURI(baseURI string, subscriptionID string) RecommendedElasticPoolsClient { - return RecommendedElasticPoolsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets a recommended elastic pool. -// 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. -// recommendedElasticPoolName - the name of the recommended elastic pool to be retrieved. -func (client RecommendedElasticPoolsClient) Get(ctx context.Context, resourceGroupName string, serverName string, recommendedElasticPoolName string) (result RecommendedElasticPool, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RecommendedElasticPoolsClient.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, serverName, recommendedElasticPoolName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.RecommendedElasticPoolsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.RecommendedElasticPoolsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.RecommendedElasticPoolsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client RecommendedElasticPoolsClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, recommendedElasticPoolName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "recommendedElasticPoolName": autorest.Encode("path", recommendedElasticPoolName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-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.Sql/servers/{serverName}/recommendedElasticPools/{recommendedElasticPoolName}", 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 RecommendedElasticPoolsClient) 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 RecommendedElasticPoolsClient) GetResponder(resp *http.Response) (result RecommendedElasticPool, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByServer returns recommended elastic pools. -// 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 RecommendedElasticPoolsClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result RecommendedElasticPoolListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RecommendedElasticPoolsClient.ListByServer") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.RecommendedElasticPoolsClient", "ListByServer", nil, "Failure preparing request") - return - } - - resp, err := client.ListByServerSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.RecommendedElasticPoolsClient", "ListByServer", resp, "Failure sending request") - return - } - - result, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.RecommendedElasticPoolsClient", "ListByServer", resp, "Failure responding to request") - } - - return -} - -// ListByServerPreparer prepares the ListByServer request. -func (client RecommendedElasticPoolsClient) 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 = "2014-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.Sql/servers/{serverName}/recommendedElasticPools", 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 RecommendedElasticPoolsClient) 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 RecommendedElasticPoolsClient) ListByServerResponder(resp *http.Response) (result RecommendedElasticPoolListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListMetrics returns recommended elastic pool metrics. -// 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. -// recommendedElasticPoolName - the name of the recommended elastic pool to be retrieved. -func (client RecommendedElasticPoolsClient) ListMetrics(ctx context.Context, resourceGroupName string, serverName string, recommendedElasticPoolName string) (result RecommendedElasticPoolListMetricsResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RecommendedElasticPoolsClient.ListMetrics") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListMetricsPreparer(ctx, resourceGroupName, serverName, recommendedElasticPoolName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.RecommendedElasticPoolsClient", "ListMetrics", nil, "Failure preparing request") - return - } - - resp, err := client.ListMetricsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.RecommendedElasticPoolsClient", "ListMetrics", resp, "Failure sending request") - return - } - - result, err = client.ListMetricsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.RecommendedElasticPoolsClient", "ListMetrics", resp, "Failure responding to request") - } - - return -} - -// ListMetricsPreparer prepares the ListMetrics request. -func (client RecommendedElasticPoolsClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, serverName string, recommendedElasticPoolName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "recommendedElasticPoolName": autorest.Encode("path", recommendedElasticPoolName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-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.Sql/servers/{serverName}/recommendedElasticPools/{recommendedElasticPoolName}/metrics", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListMetricsSender sends the ListMetrics request. The method will close the -// http.Response Body if it receives an error. -func (client RecommendedElasticPoolsClient) ListMetricsSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListMetricsResponder handles the response to the ListMetrics request. The method always -// closes the http.Response Body. -func (client RecommendedElasticPoolsClient) ListMetricsResponder(resp *http.Response) (result RecommendedElasticPoolListMetricsResult, 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/sql/mgmt/2018-06-15-preview/sql/recoverablemanageddatabases.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/recoverablemanageddatabases.go deleted file mode 100644 index 8a2200979761..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/recoverablemanageddatabases.go +++ /dev/null @@ -1,238 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// RecoverableManagedDatabasesClient is the the Azure SQL Database management API provides a RESTful set of web -// services that interact with Azure SQL Database services to manage your databases. The API enables you to create, -// retrieve, update, and delete databases. -type RecoverableManagedDatabasesClient struct { - BaseClient -} - -// NewRecoverableManagedDatabasesClient creates an instance of the RecoverableManagedDatabasesClient client. -func NewRecoverableManagedDatabasesClient(subscriptionID string) RecoverableManagedDatabasesClient { - return NewRecoverableManagedDatabasesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewRecoverableManagedDatabasesClientWithBaseURI creates an instance of the RecoverableManagedDatabasesClient client. -func NewRecoverableManagedDatabasesClientWithBaseURI(baseURI string, subscriptionID string) RecoverableManagedDatabasesClient { - return RecoverableManagedDatabasesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets a recoverable managed 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. -// managedInstanceName - the name of the managed instance. -func (client RecoverableManagedDatabasesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, recoverableDatabaseName string) (result RecoverableManagedDatabase, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RecoverableManagedDatabasesClient.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, managedInstanceName, recoverableDatabaseName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.RecoverableManagedDatabasesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.RecoverableManagedDatabasesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.RecoverableManagedDatabasesClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client RecoverableManagedDatabasesClient) GetPreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, recoverableDatabaseName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "recoverableDatabaseName": autorest.Encode("path", recoverableDatabaseName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-10-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/managedInstances/{managedInstanceName}/recoverableDatabases/{recoverableDatabaseName}", 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 RecoverableManagedDatabasesClient) 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 RecoverableManagedDatabasesClient) GetResponder(resp *http.Response) (result RecoverableManagedDatabase, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByInstance gets a list of recoverable managed databases. -// 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. -// managedInstanceName - the name of the managed instance. -func (client RecoverableManagedDatabasesClient) ListByInstance(ctx context.Context, resourceGroupName string, managedInstanceName string) (result RecoverableManagedDatabaseListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RecoverableManagedDatabasesClient.ListByInstance") - defer func() { - sc := -1 - if result.rmdlr.Response.Response != nil { - sc = result.rmdlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByInstanceNextResults - req, err := client.ListByInstancePreparer(ctx, resourceGroupName, managedInstanceName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.RecoverableManagedDatabasesClient", "ListByInstance", nil, "Failure preparing request") - return - } - - resp, err := client.ListByInstanceSender(req) - if err != nil { - result.rmdlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.RecoverableManagedDatabasesClient", "ListByInstance", resp, "Failure sending request") - return - } - - result.rmdlr, err = client.ListByInstanceResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.RecoverableManagedDatabasesClient", "ListByInstance", resp, "Failure responding to request") - } - - return -} - -// ListByInstancePreparer prepares the ListByInstance request. -func (client RecoverableManagedDatabasesClient) ListByInstancePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-10-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/managedInstances/{managedInstanceName}/recoverableDatabases", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByInstanceSender sends the ListByInstance request. The method will close the -// http.Response Body if it receives an error. -func (client RecoverableManagedDatabasesClient) ListByInstanceSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByInstanceResponder handles the response to the ListByInstance request. The method always -// closes the http.Response Body. -func (client RecoverableManagedDatabasesClient) ListByInstanceResponder(resp *http.Response) (result RecoverableManagedDatabaseListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByInstanceNextResults retrieves the next set of results, if any. -func (client RecoverableManagedDatabasesClient) listByInstanceNextResults(ctx context.Context, lastResults RecoverableManagedDatabaseListResult) (result RecoverableManagedDatabaseListResult, err error) { - req, err := lastResults.recoverableManagedDatabaseListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.RecoverableManagedDatabasesClient", "listByInstanceNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByInstanceSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "sql.RecoverableManagedDatabasesClient", "listByInstanceNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByInstanceResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.RecoverableManagedDatabasesClient", "listByInstanceNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByInstanceComplete enumerates all values, automatically crossing page boundaries as required. -func (client RecoverableManagedDatabasesClient) ListByInstanceComplete(ctx context.Context, resourceGroupName string, managedInstanceName string) (result RecoverableManagedDatabaseListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RecoverableManagedDatabasesClient.ListByInstance") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByInstance(ctx, resourceGroupName, managedInstanceName) - return -} diff --git a/services/preview/sql/mgmt/2018-06-15-preview/sql/replicationlinks.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/replicationlinks.go deleted file mode 100644 index 4122dbff6cef..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/replicationlinks.go +++ /dev/null @@ -1,449 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// ReplicationLinksClient is the the Azure SQL Database management API provides a RESTful set of web services that -// interact with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, -// and delete databases. -type ReplicationLinksClient struct { - BaseClient -} - -// NewReplicationLinksClient creates an instance of the ReplicationLinksClient client. -func NewReplicationLinksClient(subscriptionID string) ReplicationLinksClient { - return NewReplicationLinksClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewReplicationLinksClientWithBaseURI creates an instance of the ReplicationLinksClient client. -func NewReplicationLinksClientWithBaseURI(baseURI string, subscriptionID string) ReplicationLinksClient { - return ReplicationLinksClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Delete deletes a database replication link. Cannot be done during failover. -// 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 that has the replication link to be dropped. -// linkID - the ID of the replication link to be deleted. -func (client ReplicationLinksClient) Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationLinksClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, databaseName, linkID) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ReplicationLinksClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "sql.ReplicationLinksClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ReplicationLinksClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ReplicationLinksClient) DeletePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "linkId": autorest.Encode("path", linkID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-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.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}", 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 ReplicationLinksClient) 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 ReplicationLinksClient) 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 -} - -// Failover sets which replica database is primary by failing over from the current primary replica 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 that has the replication link to be failed over. -// linkID - the ID of the replication link to be failed over. -func (client ReplicationLinksClient) Failover(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string) (result ReplicationLinksFailoverFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationLinksClient.Failover") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.FailoverPreparer(ctx, resourceGroupName, serverName, databaseName, linkID) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ReplicationLinksClient", "Failover", nil, "Failure preparing request") - return - } - - result, err = client.FailoverSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ReplicationLinksClient", "Failover", result.Response(), "Failure sending request") - return - } - - return -} - -// FailoverPreparer prepares the Failover request. -func (client ReplicationLinksClient) FailoverPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "linkId": autorest.Encode("path", linkID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-04-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/failover", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// FailoverSender sends the Failover request. The method will close the -// http.Response Body if it receives an error. -func (client ReplicationLinksClient) FailoverSender(req *http.Request) (future ReplicationLinksFailoverFuture, 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 -} - -// FailoverResponder handles the response to the Failover request. The method always -// closes the http.Response Body. -func (client ReplicationLinksClient) FailoverResponder(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 -} - -// FailoverAllowDataLoss sets which replica database is primary by failing over from the current primary replica -// database. This operation might result in data loss. -// 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 that has the replication link to be failed over. -// linkID - the ID of the replication link to be failed over. -func (client ReplicationLinksClient) FailoverAllowDataLoss(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string) (result ReplicationLinksFailoverAllowDataLossFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationLinksClient.FailoverAllowDataLoss") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.FailoverAllowDataLossPreparer(ctx, resourceGroupName, serverName, databaseName, linkID) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ReplicationLinksClient", "FailoverAllowDataLoss", nil, "Failure preparing request") - return - } - - result, err = client.FailoverAllowDataLossSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ReplicationLinksClient", "FailoverAllowDataLoss", result.Response(), "Failure sending request") - return - } - - return -} - -// FailoverAllowDataLossPreparer prepares the FailoverAllowDataLoss request. -func (client ReplicationLinksClient) FailoverAllowDataLossPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "linkId": autorest.Encode("path", linkID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-04-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/forceFailoverAllowDataLoss", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// FailoverAllowDataLossSender sends the FailoverAllowDataLoss request. The method will close the -// http.Response Body if it receives an error. -func (client ReplicationLinksClient) FailoverAllowDataLossSender(req *http.Request) (future ReplicationLinksFailoverAllowDataLossFuture, 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 -} - -// FailoverAllowDataLossResponder handles the response to the FailoverAllowDataLoss request. The method always -// closes the http.Response Body. -func (client ReplicationLinksClient) FailoverAllowDataLossResponder(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 database replication link. -// 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 to get the link for. -// linkID - the replication link ID to be retrieved. -func (client ReplicationLinksClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string) (result ReplicationLink, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationLinksClient.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, serverName, databaseName, linkID) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ReplicationLinksClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ReplicationLinksClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ReplicationLinksClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ReplicationLinksClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "linkId": autorest.Encode("path", linkID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-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.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}", 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 ReplicationLinksClient) 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 ReplicationLinksClient) GetResponder(resp *http.Response) (result ReplicationLink, 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 lists a database's replication links. -// 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 to retrieve links for. -func (client ReplicationLinksClient) ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result ReplicationLinkListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationLinksClient.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, serverName, databaseName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ReplicationLinksClient", "ListByDatabase", nil, "Failure preparing request") - return - } - - resp, err := client.ListByDatabaseSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ReplicationLinksClient", "ListByDatabase", resp, "Failure sending request") - return - } - - result, err = client.ListByDatabaseResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ReplicationLinksClient", "ListByDatabase", resp, "Failure responding to request") - } - - return -} - -// ListByDatabasePreparer prepares the ListByDatabase request. -func (client ReplicationLinksClient) 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 = "2014-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.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks", 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 ReplicationLinksClient) 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 ReplicationLinksClient) ListByDatabaseResponder(resp *http.Response) (result ReplicationLinkListResult, 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/sql/mgmt/2018-06-15-preview/sql/restorabledroppedmanageddatabases.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/restorabledroppedmanageddatabases.go deleted file mode 100644 index b9bd15b1a36b..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/restorabledroppedmanageddatabases.go +++ /dev/null @@ -1,240 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// RestorableDroppedManagedDatabasesClient is the the Azure SQL Database management API provides a RESTful set of web -// services that interact with Azure SQL Database services to manage your databases. The API enables you to create, -// retrieve, update, and delete databases. -type RestorableDroppedManagedDatabasesClient struct { - BaseClient -} - -// NewRestorableDroppedManagedDatabasesClient creates an instance of the RestorableDroppedManagedDatabasesClient -// client. -func NewRestorableDroppedManagedDatabasesClient(subscriptionID string) RestorableDroppedManagedDatabasesClient { - return NewRestorableDroppedManagedDatabasesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewRestorableDroppedManagedDatabasesClientWithBaseURI creates an instance of the -// RestorableDroppedManagedDatabasesClient client. -func NewRestorableDroppedManagedDatabasesClientWithBaseURI(baseURI string, subscriptionID string) RestorableDroppedManagedDatabasesClient { - return RestorableDroppedManagedDatabasesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets a restorable dropped managed 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. -// managedInstanceName - the name of the managed instance. -func (client RestorableDroppedManagedDatabasesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, restorableDroppedDatabaseID string) (result RestorableDroppedManagedDatabase, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RestorableDroppedManagedDatabasesClient.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, managedInstanceName, restorableDroppedDatabaseID) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.RestorableDroppedManagedDatabasesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.RestorableDroppedManagedDatabasesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.RestorableDroppedManagedDatabasesClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client RestorableDroppedManagedDatabasesClient) GetPreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, restorableDroppedDatabaseID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "restorableDroppedDatabaseId": autorest.Encode("path", restorableDroppedDatabaseID), - "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/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}", 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 RestorableDroppedManagedDatabasesClient) 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 RestorableDroppedManagedDatabasesClient) GetResponder(resp *http.Response) (result RestorableDroppedManagedDatabase, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByInstance gets a list of restorable dropped managed databases. -// 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. -// managedInstanceName - the name of the managed instance. -func (client RestorableDroppedManagedDatabasesClient) ListByInstance(ctx context.Context, resourceGroupName string, managedInstanceName string) (result RestorableDroppedManagedDatabaseListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RestorableDroppedManagedDatabasesClient.ListByInstance") - defer func() { - sc := -1 - if result.rdmdlr.Response.Response != nil { - sc = result.rdmdlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByInstanceNextResults - req, err := client.ListByInstancePreparer(ctx, resourceGroupName, managedInstanceName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.RestorableDroppedManagedDatabasesClient", "ListByInstance", nil, "Failure preparing request") - return - } - - resp, err := client.ListByInstanceSender(req) - if err != nil { - result.rdmdlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.RestorableDroppedManagedDatabasesClient", "ListByInstance", resp, "Failure sending request") - return - } - - result.rdmdlr, err = client.ListByInstanceResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.RestorableDroppedManagedDatabasesClient", "ListByInstance", resp, "Failure responding to request") - } - - return -} - -// ListByInstancePreparer prepares the ListByInstance request. -func (client RestorableDroppedManagedDatabasesClient) ListByInstancePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "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/managedInstances/{managedInstanceName}/restorableDroppedDatabases", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByInstanceSender sends the ListByInstance request. The method will close the -// http.Response Body if it receives an error. -func (client RestorableDroppedManagedDatabasesClient) ListByInstanceSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByInstanceResponder handles the response to the ListByInstance request. The method always -// closes the http.Response Body. -func (client RestorableDroppedManagedDatabasesClient) ListByInstanceResponder(resp *http.Response) (result RestorableDroppedManagedDatabaseListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByInstanceNextResults retrieves the next set of results, if any. -func (client RestorableDroppedManagedDatabasesClient) listByInstanceNextResults(ctx context.Context, lastResults RestorableDroppedManagedDatabaseListResult) (result RestorableDroppedManagedDatabaseListResult, err error) { - req, err := lastResults.restorableDroppedManagedDatabaseListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.RestorableDroppedManagedDatabasesClient", "listByInstanceNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByInstanceSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "sql.RestorableDroppedManagedDatabasesClient", "listByInstanceNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByInstanceResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.RestorableDroppedManagedDatabasesClient", "listByInstanceNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByInstanceComplete enumerates all values, automatically crossing page boundaries as required. -func (client RestorableDroppedManagedDatabasesClient) ListByInstanceComplete(ctx context.Context, resourceGroupName string, managedInstanceName string) (result RestorableDroppedManagedDatabaseListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RestorableDroppedManagedDatabasesClient.ListByInstance") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByInstance(ctx, resourceGroupName, managedInstanceName) - return -} diff --git a/services/preview/sql/mgmt/2018-06-15-preview/sql/restorepoints.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/restorepoints.go deleted file mode 100644 index 8ae3d7ba5caf..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/restorepoints.go +++ /dev/null @@ -1,376 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the 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" -) - -// RestorePointsClient is the the Azure SQL Database management API provides a RESTful set of web services that -// interact with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, -// and delete databases. -type RestorePointsClient struct { - BaseClient -} - -// NewRestorePointsClient creates an instance of the RestorePointsClient client. -func NewRestorePointsClient(subscriptionID string) RestorePointsClient { - return NewRestorePointsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewRestorePointsClientWithBaseURI creates an instance of the RestorePointsClient client. -func NewRestorePointsClientWithBaseURI(baseURI string, subscriptionID string) RestorePointsClient { - return RestorePointsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Create creates a restore point for a data warehouse. -// 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. -// parameters - the definition for creating the restore point of this database. -func (client RestorePointsClient) Create(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters CreateDatabaseRestorePointDefinition) (result RestorePointsCreateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointsClient.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.RestorePointLabel", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("sql.RestorePointsClient", "Create", err.Error()) - } - - req, err := client.CreatePreparer(ctx, resourceGroupName, serverName, databaseName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.RestorePointsClient", "Create", nil, "Failure preparing request") - return - } - - result, err = client.CreateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.RestorePointsClient", "Create", result.Response(), "Failure sending request") - return - } - - return -} - -// CreatePreparer prepares the Create request. -func (client RestorePointsClient) CreatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters CreateDatabaseRestorePointDefinition) (*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.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints", 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 RestorePointsClient) CreateSender(req *http.Request) (future RestorePointsCreateFuture, 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 RestorePointsClient) CreateResponder(resp *http.Response) (result RestorePoint, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a restore point. -// 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. -// restorePointName - the name of the restore point. -func (client RestorePointsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, restorePointName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointsClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, databaseName, restorePointName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.RestorePointsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "sql.RestorePointsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.RestorePointsClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client RestorePointsClient) DeletePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, restorePointName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "restorePointName": autorest.Encode("path", restorePointName), - "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.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints/{restorePointName}", 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 RestorePointsClient) 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 RestorePointsClient) 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 a restore point. -// 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. -// restorePointName - the name of the restore point. -func (client RestorePointsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, restorePointName string) (result RestorePoint, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointsClient.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, serverName, databaseName, restorePointName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.RestorePointsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.RestorePointsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.RestorePointsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client RestorePointsClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, restorePointName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "restorePointName": autorest.Encode("path", restorePointName), - "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}/restorePoints/{restorePointName}", 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 RestorePointsClient) 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 RestorePointsClient) GetResponder(resp *http.Response) (result RestorePoint, 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 gets a list of database restore points. -// 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 RestorePointsClient) ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result RestorePointListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointsClient.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, serverName, databaseName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.RestorePointsClient", "ListByDatabase", nil, "Failure preparing request") - return - } - - resp, err := client.ListByDatabaseSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.RestorePointsClient", "ListByDatabase", resp, "Failure sending request") - return - } - - result, err = client.ListByDatabaseResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.RestorePointsClient", "ListByDatabase", resp, "Failure responding to request") - } - - return -} - -// ListByDatabasePreparer prepares the ListByDatabase request. -func (client RestorePointsClient) 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}/restorePoints", 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 RestorePointsClient) 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 RestorePointsClient) ListByDatabaseResponder(resp *http.Response) (result RestorePointListResult, 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/sql/mgmt/2018-06-15-preview/sql/sensitivitylabels.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/sensitivitylabels.go deleted file mode 100644 index a267ca01c530..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/sensitivitylabels.go +++ /dev/null @@ -1,731 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// SensitivityLabelsClient is the the Azure SQL Database management API provides a RESTful set of web services that -// interact with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, -// and delete databases. -type SensitivityLabelsClient struct { - BaseClient -} - -// NewSensitivityLabelsClient creates an instance of the SensitivityLabelsClient client. -func NewSensitivityLabelsClient(subscriptionID string) SensitivityLabelsClient { - return NewSensitivityLabelsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewSensitivityLabelsClientWithBaseURI creates an instance of the SensitivityLabelsClient client. -func NewSensitivityLabelsClientWithBaseURI(baseURI string, subscriptionID string) SensitivityLabelsClient { - return SensitivityLabelsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates the sensitivity label of a given column -// 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. -// schemaName - the name of the schema. -// tableName - the name of the table. -// columnName - the name of the column. -// parameters - the column sensitivity label resource. -func (client SensitivityLabelsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, columnName string, parameters SensitivityLabel) (result SensitivityLabel, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SensitivityLabelsClient.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, serverName, databaseName, schemaName, tableName, columnName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SensitivityLabelsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.SensitivityLabelsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SensitivityLabelsClient", "CreateOrUpdate", resp, "Failure responding to request") - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client SensitivityLabelsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, columnName string, parameters SensitivityLabel) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "columnName": autorest.Encode("path", columnName), - "databaseName": autorest.Encode("path", databaseName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "schemaName": autorest.Encode("path", schemaName), - "sensitivityLabelSource": autorest.Encode("path", "current"), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "tableName": autorest.Encode("path", tableName), - } - - const APIVersion = "2017-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.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}", 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 SensitivityLabelsClient) 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 SensitivityLabelsClient) CreateOrUpdateResponder(resp *http.Response) (result SensitivityLabel, 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 sensitivity label of a given column -// 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. -// schemaName - the name of the schema. -// tableName - the name of the table. -// columnName - the name of the column. -func (client SensitivityLabelsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, columnName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SensitivityLabelsClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, databaseName, schemaName, tableName, columnName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SensitivityLabelsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "sql.SensitivityLabelsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SensitivityLabelsClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client SensitivityLabelsClient) DeletePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, columnName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "columnName": autorest.Encode("path", columnName), - "databaseName": autorest.Encode("path", databaseName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "schemaName": autorest.Encode("path", schemaName), - "sensitivityLabelSource": autorest.Encode("path", "current"), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "tableName": autorest.Encode("path", tableName), - } - - const APIVersion = "2017-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.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}", 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 SensitivityLabelsClient) 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 SensitivityLabelsClient) 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 -} - -// DisableRecommendation disables sensitivity recommendations on a given column -// 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. -// schemaName - the name of the schema. -// tableName - the name of the table. -// columnName - the name of the column. -func (client SensitivityLabelsClient) DisableRecommendation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, columnName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SensitivityLabelsClient.DisableRecommendation") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DisableRecommendationPreparer(ctx, resourceGroupName, serverName, databaseName, schemaName, tableName, columnName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SensitivityLabelsClient", "DisableRecommendation", nil, "Failure preparing request") - return - } - - resp, err := client.DisableRecommendationSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "sql.SensitivityLabelsClient", "DisableRecommendation", resp, "Failure sending request") - return - } - - result, err = client.DisableRecommendationResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SensitivityLabelsClient", "DisableRecommendation", resp, "Failure responding to request") - } - - return -} - -// DisableRecommendationPreparer prepares the DisableRecommendation request. -func (client SensitivityLabelsClient) DisableRecommendationPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, columnName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "columnName": autorest.Encode("path", columnName), - "databaseName": autorest.Encode("path", databaseName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "schemaName": autorest.Encode("path", schemaName), - "sensitivityLabelSource": autorest.Encode("path", "recommended"), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "tableName": autorest.Encode("path", tableName), - } - - const APIVersion = "2017-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.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/disable", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DisableRecommendationSender sends the DisableRecommendation request. The method will close the -// http.Response Body if it receives an error. -func (client SensitivityLabelsClient) DisableRecommendationSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// DisableRecommendationResponder handles the response to the DisableRecommendation request. The method always -// closes the http.Response Body. -func (client SensitivityLabelsClient) DisableRecommendationResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// EnableRecommendation enables sensitivity recommendations on a given column (recommendations are enabled by default -// on all columns) -// 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. -// schemaName - the name of the schema. -// tableName - the name of the table. -// columnName - the name of the column. -func (client SensitivityLabelsClient) EnableRecommendation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, columnName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SensitivityLabelsClient.EnableRecommendation") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.EnableRecommendationPreparer(ctx, resourceGroupName, serverName, databaseName, schemaName, tableName, columnName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SensitivityLabelsClient", "EnableRecommendation", nil, "Failure preparing request") - return - } - - resp, err := client.EnableRecommendationSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "sql.SensitivityLabelsClient", "EnableRecommendation", resp, "Failure sending request") - return - } - - result, err = client.EnableRecommendationResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SensitivityLabelsClient", "EnableRecommendation", resp, "Failure responding to request") - } - - return -} - -// EnableRecommendationPreparer prepares the EnableRecommendation request. -func (client SensitivityLabelsClient) EnableRecommendationPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, columnName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "columnName": autorest.Encode("path", columnName), - "databaseName": autorest.Encode("path", databaseName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "schemaName": autorest.Encode("path", schemaName), - "sensitivityLabelSource": autorest.Encode("path", "recommended"), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "tableName": autorest.Encode("path", tableName), - } - - const APIVersion = "2017-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.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/enable", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// EnableRecommendationSender sends the EnableRecommendation request. The method will close the -// http.Response Body if it receives an error. -func (client SensitivityLabelsClient) EnableRecommendationSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// EnableRecommendationResponder handles the response to the EnableRecommendation request. The method always -// closes the http.Response Body. -func (client SensitivityLabelsClient) EnableRecommendationResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the sensitivity label of a given column -// 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. -// schemaName - the name of the schema. -// tableName - the name of the table. -// columnName - the name of the column. -// sensitivityLabelSource - the source of the sensitivity label. -func (client SensitivityLabelsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, columnName string, sensitivityLabelSource SensitivityLabelSource) (result SensitivityLabel, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SensitivityLabelsClient.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, serverName, databaseName, schemaName, tableName, columnName, sensitivityLabelSource) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SensitivityLabelsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.SensitivityLabelsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SensitivityLabelsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client SensitivityLabelsClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, columnName string, sensitivityLabelSource SensitivityLabelSource) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "columnName": autorest.Encode("path", columnName), - "databaseName": autorest.Encode("path", databaseName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "schemaName": autorest.Encode("path", schemaName), - "sensitivityLabelSource": autorest.Encode("path", sensitivityLabelSource), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "tableName": autorest.Encode("path", tableName), - } - - 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}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}", 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 SensitivityLabelsClient) 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 SensitivityLabelsClient) GetResponder(resp *http.Response) (result SensitivityLabel, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListCurrentByDatabase gets the sensitivity labels of a given 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. -// filter - an OData filter expression that filters elements in the collection. -func (client SensitivityLabelsClient) ListCurrentByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string, filter string) (result SensitivityLabelListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SensitivityLabelsClient.ListCurrentByDatabase") - defer func() { - sc := -1 - if result.sllr.Response.Response != nil { - sc = result.sllr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listCurrentByDatabaseNextResults - req, err := client.ListCurrentByDatabasePreparer(ctx, resourceGroupName, serverName, databaseName, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SensitivityLabelsClient", "ListCurrentByDatabase", nil, "Failure preparing request") - return - } - - resp, err := client.ListCurrentByDatabaseSender(req) - if err != nil { - result.sllr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.SensitivityLabelsClient", "ListCurrentByDatabase", resp, "Failure sending request") - return - } - - result.sllr, err = client.ListCurrentByDatabaseResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SensitivityLabelsClient", "ListCurrentByDatabase", resp, "Failure responding to request") - } - - return -} - -// ListCurrentByDatabasePreparer prepares the ListCurrentByDatabase request. -func (client SensitivityLabelsClient) ListCurrentByDatabasePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, filter 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, - } - 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.Sql/servers/{serverName}/databases/{databaseName}/currentSensitivityLabels", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListCurrentByDatabaseSender sends the ListCurrentByDatabase request. The method will close the -// http.Response Body if it receives an error. -func (client SensitivityLabelsClient) ListCurrentByDatabaseSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListCurrentByDatabaseResponder handles the response to the ListCurrentByDatabase request. The method always -// closes the http.Response Body. -func (client SensitivityLabelsClient) ListCurrentByDatabaseResponder(resp *http.Response) (result SensitivityLabelListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listCurrentByDatabaseNextResults retrieves the next set of results, if any. -func (client SensitivityLabelsClient) listCurrentByDatabaseNextResults(ctx context.Context, lastResults SensitivityLabelListResult) (result SensitivityLabelListResult, err error) { - req, err := lastResults.sensitivityLabelListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.SensitivityLabelsClient", "listCurrentByDatabaseNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListCurrentByDatabaseSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "sql.SensitivityLabelsClient", "listCurrentByDatabaseNextResults", resp, "Failure sending next results request") - } - result, err = client.ListCurrentByDatabaseResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SensitivityLabelsClient", "listCurrentByDatabaseNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListCurrentByDatabaseComplete enumerates all values, automatically crossing page boundaries as required. -func (client SensitivityLabelsClient) ListCurrentByDatabaseComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, filter string) (result SensitivityLabelListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SensitivityLabelsClient.ListCurrentByDatabase") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListCurrentByDatabase(ctx, resourceGroupName, serverName, databaseName, filter) - return -} - -// ListRecommendedByDatabase gets the sensitivity labels of a given 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. -// includeDisabledRecommendations - specifies whether to include disabled recommendations or not. -// filter - an OData filter expression that filters elements in the collection. -func (client SensitivityLabelsClient) ListRecommendedByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string, includeDisabledRecommendations *bool, skipToken string, filter string) (result SensitivityLabelListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SensitivityLabelsClient.ListRecommendedByDatabase") - defer func() { - sc := -1 - if result.sllr.Response.Response != nil { - sc = result.sllr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listRecommendedByDatabaseNextResults - req, err := client.ListRecommendedByDatabasePreparer(ctx, resourceGroupName, serverName, databaseName, includeDisabledRecommendations, skipToken, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SensitivityLabelsClient", "ListRecommendedByDatabase", nil, "Failure preparing request") - return - } - - resp, err := client.ListRecommendedByDatabaseSender(req) - if err != nil { - result.sllr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.SensitivityLabelsClient", "ListRecommendedByDatabase", resp, "Failure sending request") - return - } - - result.sllr, err = client.ListRecommendedByDatabaseResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SensitivityLabelsClient", "ListRecommendedByDatabase", resp, "Failure responding to request") - } - - return -} - -// ListRecommendedByDatabasePreparer prepares the ListRecommendedByDatabase request. -func (client SensitivityLabelsClient) ListRecommendedByDatabasePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, includeDisabledRecommendations *bool, skipToken string, filter 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, - } - if includeDisabledRecommendations != nil { - queryParameters["includeDisabledRecommendations"] = autorest.Encode("query", *includeDisabledRecommendations) - } - if len(skipToken) > 0 { - queryParameters["$skipToken"] = autorest.Encode("query", skipToken) - } - 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.Sql/servers/{serverName}/databases/{databaseName}/recommendedSensitivityLabels", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListRecommendedByDatabaseSender sends the ListRecommendedByDatabase request. The method will close the -// http.Response Body if it receives an error. -func (client SensitivityLabelsClient) ListRecommendedByDatabaseSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListRecommendedByDatabaseResponder handles the response to the ListRecommendedByDatabase request. The method always -// closes the http.Response Body. -func (client SensitivityLabelsClient) ListRecommendedByDatabaseResponder(resp *http.Response) (result SensitivityLabelListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listRecommendedByDatabaseNextResults retrieves the next set of results, if any. -func (client SensitivityLabelsClient) listRecommendedByDatabaseNextResults(ctx context.Context, lastResults SensitivityLabelListResult) (result SensitivityLabelListResult, err error) { - req, err := lastResults.sensitivityLabelListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.SensitivityLabelsClient", "listRecommendedByDatabaseNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListRecommendedByDatabaseSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "sql.SensitivityLabelsClient", "listRecommendedByDatabaseNextResults", resp, "Failure sending next results request") - } - result, err = client.ListRecommendedByDatabaseResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SensitivityLabelsClient", "listRecommendedByDatabaseNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListRecommendedByDatabaseComplete enumerates all values, automatically crossing page boundaries as required. -func (client SensitivityLabelsClient) ListRecommendedByDatabaseComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, includeDisabledRecommendations *bool, skipToken string, filter string) (result SensitivityLabelListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SensitivityLabelsClient.ListRecommendedByDatabase") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListRecommendedByDatabase(ctx, resourceGroupName, serverName, databaseName, includeDisabledRecommendations, skipToken, filter) - return -} diff --git a/services/preview/sql/mgmt/2018-06-15-preview/sql/serverautomatictuning.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/serverautomatictuning.go deleted file mode 100644 index 00e40cce10dd..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/serverautomatictuning.go +++ /dev/null @@ -1,202 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// ServerAutomaticTuningClient is the the Azure SQL Database management API provides a RESTful set of web services that -// interact with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, -// and delete databases. -type ServerAutomaticTuningClient struct { - BaseClient -} - -// NewServerAutomaticTuningClient creates an instance of the ServerAutomaticTuningClient client. -func NewServerAutomaticTuningClient(subscriptionID string) ServerAutomaticTuningClient { - return NewServerAutomaticTuningClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewServerAutomaticTuningClientWithBaseURI creates an instance of the ServerAutomaticTuningClient client. -func NewServerAutomaticTuningClientWithBaseURI(baseURI string, subscriptionID string) ServerAutomaticTuningClient { - return ServerAutomaticTuningClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get retrieves server automatic tuning options. -// 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 ServerAutomaticTuningClient) Get(ctx context.Context, resourceGroupName string, serverName string) (result ServerAutomaticTuning, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServerAutomaticTuningClient.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, serverName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerAutomaticTuningClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ServerAutomaticTuningClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerAutomaticTuningClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ServerAutomaticTuningClient) GetPreparer(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}/automaticTuning/current", 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 ServerAutomaticTuningClient) 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 ServerAutomaticTuningClient) GetResponder(resp *http.Response) (result ServerAutomaticTuning, 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 automatic tuning options on 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. -// parameters - the requested automatic tuning resource state. -func (client ServerAutomaticTuningClient) Update(ctx context.Context, resourceGroupName string, serverName string, parameters ServerAutomaticTuning) (result ServerAutomaticTuning, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServerAutomaticTuningClient.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, serverName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerAutomaticTuningClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ServerAutomaticTuningClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerAutomaticTuningClient", "Update", resp, "Failure responding to request") - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client ServerAutomaticTuningClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, parameters ServerAutomaticTuning) (*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.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/automaticTuning/current", 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 ServerAutomaticTuningClient) 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 ServerAutomaticTuningClient) UpdateResponder(resp *http.Response) (result ServerAutomaticTuning, 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/sql/mgmt/2018-06-15-preview/sql/serverblobauditingpolicies.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/serverblobauditingpolicies.go deleted file mode 100644 index 48d2fde5ed0d..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/serverblobauditingpolicies.go +++ /dev/null @@ -1,320 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// ServerBlobAuditingPoliciesClient is the the Azure SQL Database management API provides a RESTful set of web services -// that interact with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, -// update, and delete databases. -type ServerBlobAuditingPoliciesClient struct { - BaseClient -} - -// NewServerBlobAuditingPoliciesClient creates an instance of the ServerBlobAuditingPoliciesClient client. -func NewServerBlobAuditingPoliciesClient(subscriptionID string) ServerBlobAuditingPoliciesClient { - return NewServerBlobAuditingPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewServerBlobAuditingPoliciesClientWithBaseURI creates an instance of the ServerBlobAuditingPoliciesClient client. -func NewServerBlobAuditingPoliciesClientWithBaseURI(baseURI string, subscriptionID string) ServerBlobAuditingPoliciesClient { - return ServerBlobAuditingPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a server's blob auditing policy. -// 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. -// parameters - properties of blob auditing policy -func (client ServerBlobAuditingPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters ServerBlobAuditingPolicy) (result ServerBlobAuditingPoliciesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServerBlobAuditingPoliciesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerBlobAuditingPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerBlobAuditingPoliciesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ServerBlobAuditingPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, parameters ServerBlobAuditingPolicy) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "blobAuditingPolicyName": autorest.Encode("path", "default"), - "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.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings/{blobAuditingPolicyName}", 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 ServerBlobAuditingPoliciesClient) CreateOrUpdateSender(req *http.Request) (future ServerBlobAuditingPoliciesCreateOrUpdateFuture, 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 ServerBlobAuditingPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result ServerBlobAuditingPolicy, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get gets a server's blob auditing policy. -// 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) Get(ctx context.Context, resourceGroupName string, serverName string) (result ServerBlobAuditingPolicy, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServerBlobAuditingPoliciesClient.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, serverName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerBlobAuditingPoliciesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ServerBlobAuditingPoliciesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerBlobAuditingPoliciesClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ServerBlobAuditingPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "blobAuditingPolicyName": autorest.Encode("path", "default"), - "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/{blobAuditingPolicyName}", 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 ServerBlobAuditingPoliciesClient) 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 ServerBlobAuditingPoliciesClient) GetResponder(resp *http.Response) (result ServerBlobAuditingPolicy, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - 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/2018-06-15-preview/sql/serverdnsaliases.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/serverdnsaliases.go deleted file mode 100644 index 51074322a772..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/serverdnsaliases.go +++ /dev/null @@ -1,479 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// ServerDNSAliasesClient is the the Azure SQL Database management API provides a RESTful set of web services that -// interact with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, -// and delete databases. -type ServerDNSAliasesClient struct { - BaseClient -} - -// NewServerDNSAliasesClient creates an instance of the ServerDNSAliasesClient client. -func NewServerDNSAliasesClient(subscriptionID string) ServerDNSAliasesClient { - return NewServerDNSAliasesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewServerDNSAliasesClientWithBaseURI creates an instance of the ServerDNSAliasesClient client. -func NewServerDNSAliasesClientWithBaseURI(baseURI string, subscriptionID string) ServerDNSAliasesClient { - return ServerDNSAliasesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Acquire acquires server DNS alias from another 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 that the alias is pointing to. -// DNSAliasName - the name of the server dns alias. -func (client ServerDNSAliasesClient) Acquire(ctx context.Context, resourceGroupName string, serverName string, DNSAliasName string, parameters ServerDNSAliasAcquisition) (result ServerDNSAliasesAcquireFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServerDNSAliasesClient.Acquire") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.AcquirePreparer(ctx, resourceGroupName, serverName, DNSAliasName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerDNSAliasesClient", "Acquire", nil, "Failure preparing request") - return - } - - result, err = client.AcquireSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerDNSAliasesClient", "Acquire", result.Response(), "Failure sending request") - return - } - - return -} - -// AcquirePreparer prepares the Acquire request. -func (client ServerDNSAliasesClient) AcquirePreparer(ctx context.Context, resourceGroupName string, serverName string, DNSAliasName string, parameters ServerDNSAliasAcquisition) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "dnsAliasName": autorest.Encode("path", DNSAliasName), - "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.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}/acquire", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// AcquireSender sends the Acquire request. The method will close the -// http.Response Body if it receives an error. -func (client ServerDNSAliasesClient) AcquireSender(req *http.Request) (future ServerDNSAliasesAcquireFuture, 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 -} - -// AcquireResponder handles the response to the Acquire request. The method always -// closes the http.Response Body. -func (client ServerDNSAliasesClient) AcquireResponder(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 -} - -// CreateOrUpdate creates a server dns alias. -// 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 that the alias is pointing to. -// DNSAliasName - the name of the server DNS alias. -func (client ServerDNSAliasesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, DNSAliasName string) (result ServerDNSAliasesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServerDNSAliasesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, DNSAliasName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerDNSAliasesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerDNSAliasesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ServerDNSAliasesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, DNSAliasName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "dnsAliasName": autorest.Encode("path", DNSAliasName), - "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.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}", 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 ServerDNSAliasesClient) CreateOrUpdateSender(req *http.Request) (future ServerDNSAliasesCreateOrUpdateFuture, 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 ServerDNSAliasesClient) CreateOrUpdateResponder(resp *http.Response) (result ServerDNSAlias, 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 server DNS alias with the given name. -// 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 that the alias is pointing to. -// DNSAliasName - the name of the server DNS alias. -func (client ServerDNSAliasesClient) Delete(ctx context.Context, resourceGroupName string, serverName string, DNSAliasName string) (result ServerDNSAliasesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServerDNSAliasesClient.Delete") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, DNSAliasName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerDNSAliasesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerDNSAliasesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ServerDNSAliasesClient) DeletePreparer(ctx context.Context, resourceGroupName string, serverName string, DNSAliasName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "dnsAliasName": autorest.Encode("path", DNSAliasName), - "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.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}", 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 ServerDNSAliasesClient) DeleteSender(req *http.Request) (future ServerDNSAliasesDeleteFuture, 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 ServerDNSAliasesClient) 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 server DNS alias. -// 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 that the alias is pointing to. -// DNSAliasName - the name of the server DNS alias. -func (client ServerDNSAliasesClient) Get(ctx context.Context, resourceGroupName string, serverName string, DNSAliasName string) (result ServerDNSAlias, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServerDNSAliasesClient.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, serverName, DNSAliasName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerDNSAliasesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ServerDNSAliasesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerDNSAliasesClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ServerDNSAliasesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, DNSAliasName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "dnsAliasName": autorest.Encode("path", DNSAliasName), - "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}/dnsAliases/{dnsAliasName}", 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 ServerDNSAliasesClient) 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 ServerDNSAliasesClient) GetResponder(resp *http.Response) (result ServerDNSAlias, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByServer gets a list of server DNS aliases for 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 that the alias is pointing to. -func (client ServerDNSAliasesClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result ServerDNSAliasListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServerDNSAliasesClient.ListByServer") - defer func() { - sc := -1 - if result.sdalr.Response.Response != nil { - sc = result.sdalr.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.ServerDNSAliasesClient", "ListByServer", nil, "Failure preparing request") - return - } - - resp, err := client.ListByServerSender(req) - if err != nil { - result.sdalr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ServerDNSAliasesClient", "ListByServer", resp, "Failure sending request") - return - } - - result.sdalr, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerDNSAliasesClient", "ListByServer", resp, "Failure responding to request") - } - - return -} - -// ListByServerPreparer prepares the ListByServer request. -func (client ServerDNSAliasesClient) 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}/dnsAliases", 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 ServerDNSAliasesClient) 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 ServerDNSAliasesClient) ListByServerResponder(resp *http.Response) (result ServerDNSAliasListResult, 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 ServerDNSAliasesClient) listByServerNextResults(ctx context.Context, lastResults ServerDNSAliasListResult) (result ServerDNSAliasListResult, err error) { - req, err := lastResults.serverDNSAliasListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.ServerDNSAliasesClient", "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.ServerDNSAliasesClient", "listByServerNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerDNSAliasesClient", "listByServerNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByServerComplete enumerates all values, automatically crossing page boundaries as required. -func (client ServerDNSAliasesClient) ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string) (result ServerDNSAliasListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServerDNSAliasesClient.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/2018-06-15-preview/sql/servers.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/servers.go deleted file mode 100644 index 388a123d7685..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/servers.go +++ /dev/null @@ -1,669 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the 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" -) - -// ServersClient is the the Azure SQL Database management API provides a RESTful set of web services that interact with -// Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, and delete -// databases. -type ServersClient struct { - BaseClient -} - -// NewServersClient creates an instance of the ServersClient client. -func NewServersClient(subscriptionID string) ServersClient { - return NewServersClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewServersClientWithBaseURI creates an instance of the ServersClient client. -func NewServersClientWithBaseURI(baseURI string, subscriptionID string) ServersClient { - return ServersClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CheckNameAvailability determines whether a resource can be created with the specified name. -// Parameters: -// parameters - the parameters to request for name availability. -func (client ServersClient) CheckNameAvailability(ctx context.Context, parameters CheckNameAvailabilityRequest) (result CheckNameAvailabilityResponse, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServersClient.CheckNameAvailability") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.Type", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("sql.ServersClient", "CheckNameAvailability", err.Error()) - } - - req, err := client.CheckNameAvailabilityPreparer(ctx, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServersClient", "CheckNameAvailability", nil, "Failure preparing request") - return - } - - resp, err := client.CheckNameAvailabilitySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ServersClient", "CheckNameAvailability", resp, "Failure sending request") - return - } - - result, err = client.CheckNameAvailabilityResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServersClient", "CheckNameAvailability", resp, "Failure responding to request") - } - - return -} - -// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request. -func (client ServersClient) CheckNameAvailabilityPreparer(ctx context.Context, parameters CheckNameAvailabilityRequest) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-04-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Sql/checkNameAvailability", 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 ServersClient) 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 ServersClient) CheckNameAvailabilityResponder(resp *http.Response) (result CheckNameAvailabilityResponse, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// CreateOrUpdate creates or updates 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. -// parameters - the requested server resource state. -func (client ServersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters Server) (result ServersCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServersClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServersClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServersClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ServersClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, parameters Server) (*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 = "2015-05-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Kind = 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.Sql/servers/{serverName}", 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 ServersClient) CreateOrUpdateSender(req *http.Request) (future ServersCreateOrUpdateFuture, 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 ServersClient) CreateOrUpdateResponder(resp *http.Response) (result Server, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a 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 ServersClient) Delete(ctx context.Context, resourceGroupName string, serverName string) (result ServersDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServersClient.Delete") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, serverName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServersClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServersClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ServersClient) DeletePreparer(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 = "2015-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.Sql/servers/{serverName}", 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 ServersClient) DeleteSender(req *http.Request) (future ServersDeleteFuture, 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 ServersClient) 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 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 ServersClient) Get(ctx context.Context, resourceGroupName string, serverName string) (result Server, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServersClient.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, serverName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServersClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ServersClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServersClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ServersClient) GetPreparer(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 = "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}", 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 ServersClient) 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 ServersClient) GetResponder(resp *http.Response) (result Server, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets a list of all servers in the subscription. -func (client ServersClient) List(ctx context.Context) (result ServerListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServersClient.List") - defer func() { - sc := -1 - if result.slr.Response.Response != nil { - sc = result.slr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServersClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.slr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ServersClient", "List", resp, "Failure sending request") - return - } - - result.slr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServersClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client ServersClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "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}/providers/Microsoft.Sql/servers", 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 ServersClient) 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 ServersClient) ListResponder(resp *http.Response) (result ServerListResult, 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 ServersClient) listNextResults(ctx context.Context, lastResults ServerListResult) (result ServerListResult, err error) { - req, err := lastResults.serverListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.ServersClient", "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, "sql.ServersClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServersClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ServersClient) ListComplete(ctx context.Context) (result ServerListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServersClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup gets a list of servers in a resource groups. -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -func (client ServersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ServerListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServersClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.slr.Response.Response != nil { - sc = result.slr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServersClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.slr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ServersClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.slr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServersClient", "ListByResourceGroup", resp, "Failure responding to request") - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client ServersClient) 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-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", 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 ServersClient) 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 ServersClient) ListByResourceGroupResponder(resp *http.Response) (result ServerListResult, 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 ServersClient) listByResourceGroupNextResults(ctx context.Context, lastResults ServerListResult) (result ServerListResult, err error) { - req, err := lastResults.serverListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.ServersClient", "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, "sql.ServersClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServersClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client ServersClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ServerListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServersClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// Update updates a 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. -// parameters - the requested server resource state. -func (client ServersClient) Update(ctx context.Context, resourceGroupName string, serverName string, parameters ServerUpdate) (result ServersUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServersClient.Update") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, serverName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServersClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServersClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client ServersClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, parameters ServerUpdate) (*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 = "2015-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.Sql/servers/{serverName}", 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 ServersClient) UpdateSender(req *http.Request) (future ServersUpdateFuture, 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 ServersClient) UpdateResponder(resp *http.Response) (result Server, 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/sql/mgmt/2018-06-15-preview/sql/servervulnerabilityassessments.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/servervulnerabilityassessments.go deleted file mode 100644 index 9496d7ee7833..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/servervulnerabilityassessments.go +++ /dev/null @@ -1,407 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the 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" -) - -// ServerVulnerabilityAssessmentsClient is the the Azure SQL Database management API provides a RESTful set of web -// services that interact with Azure SQL Database services to manage your databases. The API enables you to create, -// retrieve, update, and delete databases. -type ServerVulnerabilityAssessmentsClient struct { - BaseClient -} - -// NewServerVulnerabilityAssessmentsClient creates an instance of the ServerVulnerabilityAssessmentsClient client. -func NewServerVulnerabilityAssessmentsClient(subscriptionID string) ServerVulnerabilityAssessmentsClient { - return NewServerVulnerabilityAssessmentsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewServerVulnerabilityAssessmentsClientWithBaseURI creates an instance of the ServerVulnerabilityAssessmentsClient -// client. -func NewServerVulnerabilityAssessmentsClientWithBaseURI(baseURI string, subscriptionID string) ServerVulnerabilityAssessmentsClient { - return ServerVulnerabilityAssessmentsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates the server's vulnerability assessment. -// 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 for which the vulnerability assessment is defined. -// parameters - the requested resource. -func (client ServerVulnerabilityAssessmentsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters ServerVulnerabilityAssessment) (result ServerVulnerabilityAssessment, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServerVulnerabilityAssessmentsClient.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: parameters, - Constraints: []validation.Constraint{{Target: "parameters.ServerVulnerabilityAssessmentProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ServerVulnerabilityAssessmentProperties.StorageContainerPath", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("sql.ServerVulnerabilityAssessmentsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerVulnerabilityAssessmentsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ServerVulnerabilityAssessmentsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerVulnerabilityAssessmentsClient", "CreateOrUpdate", resp, "Failure responding to request") - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ServerVulnerabilityAssessmentsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, parameters ServerVulnerabilityAssessment) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vulnerabilityAssessmentName": autorest.Encode("path", "default"), - } - - 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.Sql/servers/{serverName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}", 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 ServerVulnerabilityAssessmentsClient) 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 ServerVulnerabilityAssessmentsClient) CreateOrUpdateResponder(resp *http.Response) (result ServerVulnerabilityAssessment, 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 removes the server's vulnerability assessment. -// 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 for which the vulnerability assessment is defined. -func (client ServerVulnerabilityAssessmentsClient) Delete(ctx context.Context, resourceGroupName string, serverName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServerVulnerabilityAssessmentsClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, serverName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerVulnerabilityAssessmentsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "sql.ServerVulnerabilityAssessmentsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerVulnerabilityAssessmentsClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ServerVulnerabilityAssessmentsClient) DeletePreparer(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), - "vulnerabilityAssessmentName": autorest.Encode("path", "default"), - } - - 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.Sql/servers/{serverName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}", 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 ServerVulnerabilityAssessmentsClient) 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 ServerVulnerabilityAssessmentsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the server's vulnerability assessment. -// 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 for which the vulnerability assessment is defined. -func (client ServerVulnerabilityAssessmentsClient) Get(ctx context.Context, resourceGroupName string, serverName string) (result ServerVulnerabilityAssessment, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServerVulnerabilityAssessmentsClient.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, serverName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerVulnerabilityAssessmentsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ServerVulnerabilityAssessmentsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerVulnerabilityAssessmentsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ServerVulnerabilityAssessmentsClient) GetPreparer(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), - "vulnerabilityAssessmentName": autorest.Encode("path", "default"), - } - - 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.Sql/servers/{serverName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}", 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 ServerVulnerabilityAssessmentsClient) 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 ServerVulnerabilityAssessmentsClient) GetResponder(resp *http.Response) (result ServerVulnerabilityAssessment, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByServer lists the vulnerability assessment policies associated with 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 ServerVulnerabilityAssessmentsClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result ServerVulnerabilityAssessmentListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServerVulnerabilityAssessmentsClient.ListByServer") - defer func() { - sc := -1 - if result.svalr.Response.Response != nil { - sc = result.svalr.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.ServerVulnerabilityAssessmentsClient", "ListByServer", nil, "Failure preparing request") - return - } - - resp, err := client.ListByServerSender(req) - if err != nil { - result.svalr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ServerVulnerabilityAssessmentsClient", "ListByServer", resp, "Failure sending request") - return - } - - result.svalr, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerVulnerabilityAssessmentsClient", "ListByServer", resp, "Failure responding to request") - } - - return -} - -// ListByServerPreparer prepares the ListByServer request. -func (client ServerVulnerabilityAssessmentsClient) 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 = "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.Sql/servers/{serverName}/vulnerabilityAssessments", 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 ServerVulnerabilityAssessmentsClient) 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 ServerVulnerabilityAssessmentsClient) ListByServerResponder(resp *http.Response) (result ServerVulnerabilityAssessmentListResult, 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 ServerVulnerabilityAssessmentsClient) listByServerNextResults(ctx context.Context, lastResults ServerVulnerabilityAssessmentListResult) (result ServerVulnerabilityAssessmentListResult, err error) { - req, err := lastResults.serverVulnerabilityAssessmentListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.ServerVulnerabilityAssessmentsClient", "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.ServerVulnerabilityAssessmentsClient", "listByServerNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerVulnerabilityAssessmentsClient", "listByServerNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByServerComplete enumerates all values, automatically crossing page boundaries as required. -func (client ServerVulnerabilityAssessmentsClient) ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string) (result ServerVulnerabilityAssessmentListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServerVulnerabilityAssessmentsClient.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/2018-06-15-preview/sql/sqlapi/interfaces.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/sqlapi/interfaces.go deleted file mode 100644 index eca55bd60218..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/sqlapi/interfaces.go +++ /dev/null @@ -1,863 +0,0 @@ -package sqlapi - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by 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/sql/mgmt/2018-06-15-preview/sql" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/date" - "github.com/satori/go.uuid" -) - -// RecoverableDatabasesClientAPI contains the set of methods on the RecoverableDatabasesClient type. -type RecoverableDatabasesClientAPI interface { - Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.RecoverableDatabase, err error) - ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.RecoverableDatabaseListResult, err error) -} - -var _ RecoverableDatabasesClientAPI = (*sql.RecoverableDatabasesClient)(nil) - -// RestorableDroppedDatabasesClientAPI contains the set of methods on the RestorableDroppedDatabasesClient type. -type RestorableDroppedDatabasesClientAPI interface { - Get(ctx context.Context, resourceGroupName string, serverName string, restorableDroppededDatabaseID string) (result sql.RestorableDroppedDatabase, err error) - ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.RestorableDroppedDatabaseListResult, err error) -} - -var _ RestorableDroppedDatabasesClientAPI = (*sql.RestorableDroppedDatabasesClient)(nil) - -// ServersClientAPI contains the set of methods on the ServersClient type. -type ServersClientAPI interface { - CheckNameAvailability(ctx context.Context, parameters sql.CheckNameAvailabilityRequest) (result sql.CheckNameAvailabilityResponse, err error) - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters sql.Server) (result sql.ServersCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, serverName string) (result sql.ServersDeleteFuture, err error) - Get(ctx context.Context, resourceGroupName string, serverName string) (result sql.Server, err error) - List(ctx context.Context) (result sql.ServerListResultPage, err error) - ListByResourceGroup(ctx context.Context, resourceGroupName string) (result sql.ServerListResultPage, err error) - Update(ctx context.Context, resourceGroupName string, serverName string, parameters sql.ServerUpdate) (result sql.ServersUpdateFuture, err error) -} - -var _ ServersClientAPI = (*sql.ServersClient)(nil) - -// ServerConnectionPoliciesClientAPI contains the set of methods on the ServerConnectionPoliciesClient type. -type ServerConnectionPoliciesClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters sql.ServerConnectionPolicy) (result sql.ServerConnectionPolicy, err error) - Get(ctx context.Context, resourceGroupName string, serverName string) (result sql.ServerConnectionPolicy, err error) -} - -var _ ServerConnectionPoliciesClientAPI = (*sql.ServerConnectionPoliciesClient)(nil) - -// DatabaseThreatDetectionPoliciesClientAPI contains the set of methods on the DatabaseThreatDetectionPoliciesClient type. -type DatabaseThreatDetectionPoliciesClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.DatabaseSecurityAlertPolicy) (result sql.DatabaseSecurityAlertPolicy, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.DatabaseSecurityAlertPolicy, err error) -} - -var _ DatabaseThreatDetectionPoliciesClientAPI = (*sql.DatabaseThreatDetectionPoliciesClient)(nil) - -// DataMaskingPoliciesClientAPI contains the set of methods on the DataMaskingPoliciesClient type. -type DataMaskingPoliciesClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.DataMaskingPolicy) (result sql.DataMaskingPolicy, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.DataMaskingPolicy, err error) -} - -var _ DataMaskingPoliciesClientAPI = (*sql.DataMaskingPoliciesClient)(nil) - -// DataMaskingRulesClientAPI contains the set of methods on the DataMaskingRulesClient type. -type DataMaskingRulesClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, dataMaskingRuleName string, parameters sql.DataMaskingRule) (result sql.DataMaskingRule, err error) - ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.DataMaskingRuleListResult, err error) -} - -var _ DataMaskingRulesClientAPI = (*sql.DataMaskingRulesClient)(nil) - -// FirewallRulesClientAPI contains the set of methods on the FirewallRulesClient type. -type FirewallRulesClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, parameters sql.FirewallRule) (result sql.FirewallRule, err error) - Delete(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string) (result autorest.Response, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string) (result sql.FirewallRule, err error) - ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.FirewallRuleListResult, err error) -} - -var _ FirewallRulesClientAPI = (*sql.FirewallRulesClient)(nil) - -// GeoBackupPoliciesClientAPI contains the set of methods on the GeoBackupPoliciesClient type. -type GeoBackupPoliciesClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.GeoBackupPolicy) (result sql.GeoBackupPolicy, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.GeoBackupPolicy, err error) - ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.GeoBackupPolicyListResult, err error) -} - -var _ GeoBackupPoliciesClientAPI = (*sql.GeoBackupPoliciesClient)(nil) - -// DatabasesClientAPI contains the set of methods on the DatabasesClient type. -type DatabasesClientAPI interface { - CreateImportOperation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.ImportExtensionRequest) (result sql.DatabasesCreateImportOperationFuture, err error) - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.Database) (result sql.DatabasesCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.DatabasesDeleteFuture, err error) - Export(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.ExportRequest) (result sql.DatabasesExportFuture, err error) - Failover(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.DatabasesFailoverFuture, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.Database, err error) - Import(ctx context.Context, resourceGroupName string, serverName string, parameters sql.ImportRequest) (result sql.DatabasesImportFuture, err error) - ListByElasticPool(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (result sql.DatabaseListResultPage, err error) - ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.DatabaseListResultPage, err error) - ListMetricDefinitions(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.MetricDefinitionListResult, err error) - ListMetrics(ctx context.Context, resourceGroupName string, serverName string, databaseName string, filter string) (result sql.MetricListResult, err error) - Pause(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.DatabasesPauseFuture, err error) - Rename(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.ResourceMoveDefinition) (result autorest.Response, err error) - Resume(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.DatabasesResumeFuture, err error) - Update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.DatabaseUpdate) (result sql.DatabasesUpdateFuture, err error) - UpgradeDataWarehouse(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.DatabasesUpgradeDataWarehouseFuture, err error) -} - -var _ DatabasesClientAPI = (*sql.DatabasesClient)(nil) - -// ElasticPoolsClientAPI contains the set of methods on the ElasticPoolsClient type. -type ElasticPoolsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, parameters sql.ElasticPool) (result sql.ElasticPoolsCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (result sql.ElasticPoolsDeleteFuture, err error) - Failover(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (result sql.ElasticPoolsFailoverFuture, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (result sql.ElasticPool, err error) - ListByServer(ctx context.Context, resourceGroupName string, serverName string, skip *int32) (result sql.ElasticPoolListResultPage, err error) - ListMetricDefinitions(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (result sql.MetricDefinitionListResult, err error) - ListMetrics(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, filter string) (result sql.MetricListResult, err error) - Update(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, parameters sql.ElasticPoolUpdate) (result sql.ElasticPoolsUpdateFuture, err error) -} - -var _ ElasticPoolsClientAPI = (*sql.ElasticPoolsClient)(nil) - -// RecommendedElasticPoolsClientAPI contains the set of methods on the RecommendedElasticPoolsClient type. -type RecommendedElasticPoolsClientAPI interface { - Get(ctx context.Context, resourceGroupName string, serverName string, recommendedElasticPoolName string) (result sql.RecommendedElasticPool, err error) - ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.RecommendedElasticPoolListResult, err error) - ListMetrics(ctx context.Context, resourceGroupName string, serverName string, recommendedElasticPoolName string) (result sql.RecommendedElasticPoolListMetricsResult, err error) -} - -var _ RecommendedElasticPoolsClientAPI = (*sql.RecommendedElasticPoolsClient)(nil) - -// ReplicationLinksClientAPI contains the set of methods on the ReplicationLinksClient type. -type ReplicationLinksClientAPI interface { - Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string) (result autorest.Response, err error) - Failover(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string) (result sql.ReplicationLinksFailoverFuture, err error) - FailoverAllowDataLoss(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string) (result sql.ReplicationLinksFailoverAllowDataLossFuture, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string) (result sql.ReplicationLink, err error) - ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.ReplicationLinkListResult, err error) -} - -var _ ReplicationLinksClientAPI = (*sql.ReplicationLinksClient)(nil) - -// ServerAzureADAdministratorsClientAPI contains the set of methods on the ServerAzureADAdministratorsClient type. -type ServerAzureADAdministratorsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, properties sql.ServerAzureADAdministrator) (result sql.ServerAzureADAdministratorsCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, serverName string) (result sql.ServerAzureADAdministratorsDeleteFuture, err error) - Get(ctx context.Context, resourceGroupName string, serverName string) (result sql.ServerAzureADAdministrator, err error) - ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.ServerAdministratorListResult, err error) -} - -var _ ServerAzureADAdministratorsClientAPI = (*sql.ServerAzureADAdministratorsClient)(nil) - -// ServerCommunicationLinksClientAPI contains the set of methods on the ServerCommunicationLinksClient type. -type ServerCommunicationLinksClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, communicationLinkName string, parameters sql.ServerCommunicationLink) (result sql.ServerCommunicationLinksCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, serverName string, communicationLinkName string) (result autorest.Response, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, communicationLinkName string) (result sql.ServerCommunicationLink, err error) - ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.ServerCommunicationLinkListResult, err error) -} - -var _ ServerCommunicationLinksClientAPI = (*sql.ServerCommunicationLinksClient)(nil) - -// ServiceObjectivesClientAPI contains the set of methods on the ServiceObjectivesClient type. -type ServiceObjectivesClientAPI interface { - Get(ctx context.Context, resourceGroupName string, serverName string, serviceObjectiveName string) (result sql.ServiceObjective, err error) - ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.ServiceObjectiveListResult, err error) -} - -var _ ServiceObjectivesClientAPI = (*sql.ServiceObjectivesClient)(nil) - -// ElasticPoolActivitiesClientAPI contains the set of methods on the ElasticPoolActivitiesClient type. -type ElasticPoolActivitiesClientAPI interface { - ListByElasticPool(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (result sql.ElasticPoolActivityListResult, err error) -} - -var _ ElasticPoolActivitiesClientAPI = (*sql.ElasticPoolActivitiesClient)(nil) - -// ElasticPoolDatabaseActivitiesClientAPI contains the set of methods on the ElasticPoolDatabaseActivitiesClient type. -type ElasticPoolDatabaseActivitiesClientAPI interface { - ListByElasticPool(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (result sql.ElasticPoolDatabaseActivityListResult, err error) -} - -var _ ElasticPoolDatabaseActivitiesClientAPI = (*sql.ElasticPoolDatabaseActivitiesClient)(nil) - -// ServiceTierAdvisorsClientAPI contains the set of methods on the ServiceTierAdvisorsClient type. -type ServiceTierAdvisorsClientAPI interface { - Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, serviceTierAdvisorName string) (result sql.ServiceTierAdvisor, err error) - ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.ServiceTierAdvisorListResult, err error) -} - -var _ ServiceTierAdvisorsClientAPI = (*sql.ServiceTierAdvisorsClient)(nil) - -// TransparentDataEncryptionsClientAPI contains the set of methods on the TransparentDataEncryptionsClient type. -type TransparentDataEncryptionsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.TransparentDataEncryption) (result sql.TransparentDataEncryption, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.TransparentDataEncryption, err error) -} - -var _ TransparentDataEncryptionsClientAPI = (*sql.TransparentDataEncryptionsClient)(nil) - -// TransparentDataEncryptionActivitiesClientAPI contains the set of methods on the TransparentDataEncryptionActivitiesClient type. -type TransparentDataEncryptionActivitiesClientAPI interface { - ListByConfiguration(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.TransparentDataEncryptionActivityListResult, err error) -} - -var _ TransparentDataEncryptionActivitiesClientAPI = (*sql.TransparentDataEncryptionActivitiesClient)(nil) - -// ServerUsagesClientAPI contains the set of methods on the ServerUsagesClient type. -type ServerUsagesClientAPI interface { - ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.ServerUsageListResult, err error) -} - -var _ ServerUsagesClientAPI = (*sql.ServerUsagesClient)(nil) - -// DatabaseUsagesClientAPI contains the set of methods on the DatabaseUsagesClient type. -type DatabaseUsagesClientAPI interface { - ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.DatabaseUsageListResult, err error) -} - -var _ DatabaseUsagesClientAPI = (*sql.DatabaseUsagesClient)(nil) - -// DatabaseAutomaticTuningClientAPI contains the set of methods on the DatabaseAutomaticTuningClient type. -type DatabaseAutomaticTuningClientAPI interface { - Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.DatabaseAutomaticTuning, err error) - Update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.DatabaseAutomaticTuning) (result sql.DatabaseAutomaticTuning, err error) -} - -var _ DatabaseAutomaticTuningClientAPI = (*sql.DatabaseAutomaticTuningClient)(nil) - -// EncryptionProtectorsClientAPI contains the set of methods on the EncryptionProtectorsClient type. -type EncryptionProtectorsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters sql.EncryptionProtector) (result sql.EncryptionProtectorsCreateOrUpdateFuture, err error) - Get(ctx context.Context, resourceGroupName string, serverName string) (result sql.EncryptionProtector, err error) - ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.EncryptionProtectorListResultPage, err error) - Revalidate(ctx context.Context, resourceGroupName string, serverName string) (result sql.EncryptionProtectorsRevalidateFuture, err error) -} - -var _ EncryptionProtectorsClientAPI = (*sql.EncryptionProtectorsClient)(nil) - -// FailoverGroupsClientAPI contains the set of methods on the FailoverGroupsClient type. -type FailoverGroupsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string, parameters sql.FailoverGroup) (result sql.FailoverGroupsCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string) (result sql.FailoverGroupsDeleteFuture, err error) - Failover(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string) (result sql.FailoverGroupsFailoverFuture, err error) - ForceFailoverAllowDataLoss(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string) (result sql.FailoverGroupsForceFailoverAllowDataLossFuture, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string) (result sql.FailoverGroup, err error) - ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.FailoverGroupListResultPage, err error) - Update(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string, parameters sql.FailoverGroupUpdate) (result sql.FailoverGroupsUpdateFuture, err error) -} - -var _ FailoverGroupsClientAPI = (*sql.FailoverGroupsClient)(nil) - -// OperationsClientAPI contains the set of methods on the OperationsClient type. -type OperationsClientAPI interface { - List(ctx context.Context) (result sql.OperationListResultPage, err error) -} - -var _ OperationsClientAPI = (*sql.OperationsClient)(nil) - -// ServerKeysClientAPI contains the set of methods on the ServerKeysClient type. -type ServerKeysClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, keyName string, parameters sql.ServerKey) (result sql.ServerKeysCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, serverName string, keyName string) (result sql.ServerKeysDeleteFuture, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, keyName string) (result sql.ServerKey, err error) - ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.ServerKeyListResultPage, err error) -} - -var _ ServerKeysClientAPI = (*sql.ServerKeysClient)(nil) - -// SyncAgentsClientAPI contains the set of methods on the SyncAgentsClient type. -type SyncAgentsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, syncAgentName string, parameters sql.SyncAgent) (result sql.SyncAgentsCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, serverName string, syncAgentName string) (result sql.SyncAgentsDeleteFuture, err error) - GenerateKey(ctx context.Context, resourceGroupName string, serverName string, syncAgentName string) (result sql.SyncAgentKeyProperties, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, syncAgentName string) (result sql.SyncAgent, err error) - ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.SyncAgentListResultPage, err error) - ListLinkedDatabases(ctx context.Context, resourceGroupName string, serverName string, syncAgentName string) (result sql.SyncAgentLinkedDatabaseListResultPage, err error) -} - -var _ SyncAgentsClientAPI = (*sql.SyncAgentsClient)(nil) - -// SyncGroupsClientAPI contains the set of methods on the SyncGroupsClient type. -type SyncGroupsClientAPI interface { - CancelSync(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result autorest.Response, err error) - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, parameters sql.SyncGroup) (result sql.SyncGroupsCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result sql.SyncGroupsDeleteFuture, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result sql.SyncGroup, err error) - ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.SyncGroupListResultPage, err error) - ListHubSchemas(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result sql.SyncFullSchemaPropertiesListResultPage, err error) - ListLogs(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, startTime string, endTime string, typeParameter string, continuationToken string) (result sql.SyncGroupLogListResultPage, err error) - ListSyncDatabaseIds(ctx context.Context, locationName string) (result sql.SyncDatabaseIDListResultPage, err error) - RefreshHubSchema(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result sql.SyncGroupsRefreshHubSchemaFuture, err error) - TriggerSync(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result autorest.Response, err error) - Update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, parameters sql.SyncGroup) (result sql.SyncGroupsUpdateFuture, err error) -} - -var _ SyncGroupsClientAPI = (*sql.SyncGroupsClient)(nil) - -// SyncMembersClientAPI contains the set of methods on the SyncMembersClient type. -type SyncMembersClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string, parameters sql.SyncMember) (result sql.SyncMembersCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string) (result sql.SyncMembersDeleteFuture, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string) (result sql.SyncMember, err error) - ListBySyncGroup(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result sql.SyncMemberListResultPage, err error) - ListMemberSchemas(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string) (result sql.SyncFullSchemaPropertiesListResultPage, err error) - RefreshMemberSchema(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string) (result sql.SyncMembersRefreshMemberSchemaFuture, err error) - Update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string, parameters sql.SyncMember) (result sql.SyncMembersUpdateFuture, err error) -} - -var _ SyncMembersClientAPI = (*sql.SyncMembersClient)(nil) - -// SubscriptionUsagesClientAPI contains the set of methods on the SubscriptionUsagesClient type. -type SubscriptionUsagesClientAPI interface { - Get(ctx context.Context, locationName string, usageName string) (result sql.SubscriptionUsage, err error) - ListByLocation(ctx context.Context, locationName string) (result sql.SubscriptionUsageListResultPage, err error) -} - -var _ SubscriptionUsagesClientAPI = (*sql.SubscriptionUsagesClient)(nil) - -// VirtualClustersClientAPI contains the set of methods on the VirtualClustersClient type. -type VirtualClustersClientAPI interface { - Delete(ctx context.Context, resourceGroupName string, virtualClusterName string) (result sql.VirtualClustersDeleteFuture, err error) - Get(ctx context.Context, resourceGroupName string, virtualClusterName string) (result sql.VirtualCluster, err error) - List(ctx context.Context) (result sql.VirtualClusterListResultPage, err error) - ListByResourceGroup(ctx context.Context, resourceGroupName string) (result sql.VirtualClusterListResultPage, err error) - Update(ctx context.Context, resourceGroupName string, virtualClusterName string, parameters sql.VirtualClusterUpdate) (result sql.VirtualClustersUpdateFuture, err error) -} - -var _ VirtualClustersClientAPI = (*sql.VirtualClustersClient)(nil) - -// VirtualNetworkRulesClientAPI contains the set of methods on the VirtualNetworkRulesClient type. -type VirtualNetworkRulesClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, parameters sql.VirtualNetworkRule) (result sql.VirtualNetworkRulesCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string) (result sql.VirtualNetworkRulesDeleteFuture, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string) (result sql.VirtualNetworkRule, err error) - ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.VirtualNetworkRuleListResultPage, err error) -} - -var _ VirtualNetworkRulesClientAPI = (*sql.VirtualNetworkRulesClient)(nil) - -// ExtendedDatabaseBlobAuditingPoliciesClientAPI contains the set of methods on the ExtendedDatabaseBlobAuditingPoliciesClient type. -type ExtendedDatabaseBlobAuditingPoliciesClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.ExtendedDatabaseBlobAuditingPolicy) (result sql.ExtendedDatabaseBlobAuditingPolicy, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.ExtendedDatabaseBlobAuditingPolicy, err error) -} - -var _ ExtendedDatabaseBlobAuditingPoliciesClientAPI = (*sql.ExtendedDatabaseBlobAuditingPoliciesClient)(nil) - -// ExtendedServerBlobAuditingPoliciesClientAPI contains the set of methods on the ExtendedServerBlobAuditingPoliciesClient type. -type ExtendedServerBlobAuditingPoliciesClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters sql.ExtendedServerBlobAuditingPolicy) (result sql.ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture, err error) - Get(ctx context.Context, resourceGroupName string, serverName string) (result sql.ExtendedServerBlobAuditingPolicy, err error) -} - -var _ ExtendedServerBlobAuditingPoliciesClientAPI = (*sql.ExtendedServerBlobAuditingPoliciesClient)(nil) - -// ServerBlobAuditingPoliciesClientAPI contains the set of methods on the ServerBlobAuditingPoliciesClient type. -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) - -// DatabaseBlobAuditingPoliciesClientAPI contains the set of methods on the DatabaseBlobAuditingPoliciesClient type. -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) - -// DatabaseVulnerabilityAssessmentRuleBaselinesClientAPI contains the set of methods on the DatabaseVulnerabilityAssessmentRuleBaselinesClient type. -type DatabaseVulnerabilityAssessmentRuleBaselinesClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, ruleID string, baselineName sql.VulnerabilityAssessmentPolicyBaselineName, parameters sql.DatabaseVulnerabilityAssessmentRuleBaseline) (result sql.DatabaseVulnerabilityAssessmentRuleBaseline, err error) - Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, ruleID string, baselineName sql.VulnerabilityAssessmentPolicyBaselineName) (result autorest.Response, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, ruleID string, baselineName sql.VulnerabilityAssessmentPolicyBaselineName) (result sql.DatabaseVulnerabilityAssessmentRuleBaseline, err error) -} - -var _ DatabaseVulnerabilityAssessmentRuleBaselinesClientAPI = (*sql.DatabaseVulnerabilityAssessmentRuleBaselinesClient)(nil) - -// DatabaseVulnerabilityAssessmentsClientAPI contains the set of methods on the DatabaseVulnerabilityAssessmentsClient type. -type DatabaseVulnerabilityAssessmentsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.DatabaseVulnerabilityAssessment) (result sql.DatabaseVulnerabilityAssessment, err error) - Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result autorest.Response, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.DatabaseVulnerabilityAssessment, err error) - ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.DatabaseVulnerabilityAssessmentListResultPage, err error) -} - -var _ DatabaseVulnerabilityAssessmentsClientAPI = (*sql.DatabaseVulnerabilityAssessmentsClient)(nil) - -// JobAgentsClientAPI contains the set of methods on the JobAgentsClient type. -type JobAgentsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, parameters sql.JobAgent) (result sql.JobAgentsCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string) (result sql.JobAgentsDeleteFuture, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string) (result sql.JobAgent, err error) - ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.JobAgentListResultPage, err error) - Update(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, parameters sql.JobAgentUpdate) (result sql.JobAgentsUpdateFuture, err error) -} - -var _ JobAgentsClientAPI = (*sql.JobAgentsClient)(nil) - -// JobCredentialsClientAPI contains the set of methods on the JobCredentialsClient type. -type JobCredentialsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, credentialName string, parameters sql.JobCredential) (result sql.JobCredential, err error) - Delete(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, credentialName string) (result autorest.Response, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, credentialName string) (result sql.JobCredential, err error) - ListByAgent(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string) (result sql.JobCredentialListResultPage, err error) -} - -var _ JobCredentialsClientAPI = (*sql.JobCredentialsClient)(nil) - -// JobExecutionsClientAPI contains the set of methods on the JobExecutionsClient type. -type JobExecutionsClientAPI interface { - Cancel(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID uuid.UUID) (result autorest.Response, err error) - Create(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string) (result sql.JobExecutionsCreateFuture, err error) - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID uuid.UUID) (result sql.JobExecutionsCreateOrUpdateFuture, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID uuid.UUID) (result sql.JobExecution, err error) - ListByAgent(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, createTimeMin *date.Time, createTimeMax *date.Time, endTimeMin *date.Time, endTimeMax *date.Time, isActive *bool, skip *int32, top *int32) (result sql.JobExecutionListResultPage, err error) - ListByJob(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, createTimeMin *date.Time, createTimeMax *date.Time, endTimeMin *date.Time, endTimeMax *date.Time, isActive *bool, skip *int32, top *int32) (result sql.JobExecutionListResultPage, err error) -} - -var _ JobExecutionsClientAPI = (*sql.JobExecutionsClient)(nil) - -// JobsClientAPI contains the set of methods on the JobsClient type. -type JobsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, parameters sql.Job) (result sql.Job, err error) - Delete(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string) (result autorest.Response, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string) (result sql.Job, err error) - ListByAgent(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string) (result sql.JobListResultPage, err error) -} - -var _ JobsClientAPI = (*sql.JobsClient)(nil) - -// JobStepExecutionsClientAPI contains the set of methods on the JobStepExecutionsClient type. -type JobStepExecutionsClientAPI interface { - Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID uuid.UUID, stepName string) (result sql.JobExecution, err error) - ListByJobExecution(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID uuid.UUID, createTimeMin *date.Time, createTimeMax *date.Time, endTimeMin *date.Time, endTimeMax *date.Time, isActive *bool, skip *int32, top *int32) (result sql.JobExecutionListResultPage, err error) -} - -var _ JobStepExecutionsClientAPI = (*sql.JobStepExecutionsClient)(nil) - -// JobStepsClientAPI contains the set of methods on the JobStepsClient type. -type JobStepsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, stepName string, parameters sql.JobStep) (result sql.JobStep, err error) - Delete(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, stepName string) (result autorest.Response, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, stepName string) (result sql.JobStep, err error) - GetByVersion(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobVersion int32, stepName string) (result sql.JobStep, err error) - ListByJob(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string) (result sql.JobStepListResultPage, err error) - ListByVersion(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobVersion int32) (result sql.JobStepListResultPage, err error) -} - -var _ JobStepsClientAPI = (*sql.JobStepsClient)(nil) - -// JobTargetExecutionsClientAPI contains the set of methods on the JobTargetExecutionsClient type. -type JobTargetExecutionsClientAPI interface { - Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID uuid.UUID, stepName string, targetID uuid.UUID) (result sql.JobExecution, err error) - ListByJobExecution(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID uuid.UUID, createTimeMin *date.Time, createTimeMax *date.Time, endTimeMin *date.Time, endTimeMax *date.Time, isActive *bool, skip *int32, top *int32) (result sql.JobExecutionListResultPage, err error) - ListByStep(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID uuid.UUID, stepName string, createTimeMin *date.Time, createTimeMax *date.Time, endTimeMin *date.Time, endTimeMax *date.Time, isActive *bool, skip *int32, top *int32) (result sql.JobExecutionListResultPage, err error) -} - -var _ JobTargetExecutionsClientAPI = (*sql.JobTargetExecutionsClient)(nil) - -// JobTargetGroupsClientAPI contains the set of methods on the JobTargetGroupsClient type. -type JobTargetGroupsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, targetGroupName string, parameters sql.JobTargetGroup) (result sql.JobTargetGroup, err error) - Delete(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, targetGroupName string) (result autorest.Response, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, targetGroupName string) (result sql.JobTargetGroup, err error) - ListByAgent(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string) (result sql.JobTargetGroupListResultPage, err error) -} - -var _ JobTargetGroupsClientAPI = (*sql.JobTargetGroupsClient)(nil) - -// JobVersionsClientAPI contains the set of methods on the JobVersionsClient type. -type JobVersionsClientAPI interface { - Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobVersion int32) (result sql.JobVersion, err error) - ListByJob(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string) (result sql.JobVersionListResultPage, err error) -} - -var _ JobVersionsClientAPI = (*sql.JobVersionsClient)(nil) - -// LongTermRetentionBackupsClientAPI contains the set of methods on the LongTermRetentionBackupsClient type. -type LongTermRetentionBackupsClientAPI interface { - Delete(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string) (result sql.LongTermRetentionBackupsDeleteFuture, err error) - DeleteByResourceGroup(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string) (result sql.LongTermRetentionBackupsDeleteByResourceGroupFuture, err error) - Get(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string) (result sql.LongTermRetentionBackup, err error) - GetByResourceGroup(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string) (result sql.LongTermRetentionBackup, err error) - ListByDatabase(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, onlyLatestPerDatabase *bool, databaseState sql.LongTermRetentionDatabaseState) (result sql.LongTermRetentionBackupListResultPage, err error) - ListByLocation(ctx context.Context, locationName string, onlyLatestPerDatabase *bool, databaseState sql.LongTermRetentionDatabaseState) (result sql.LongTermRetentionBackupListResultPage, err error) - ListByResourceGroupDatabase(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, onlyLatestPerDatabase *bool, databaseState sql.LongTermRetentionDatabaseState) (result sql.LongTermRetentionBackupListResultPage, err error) - ListByResourceGroupLocation(ctx context.Context, resourceGroupName string, locationName string, onlyLatestPerDatabase *bool, databaseState sql.LongTermRetentionDatabaseState) (result sql.LongTermRetentionBackupListResultPage, err error) - ListByResourceGroupServer(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, onlyLatestPerDatabase *bool, databaseState sql.LongTermRetentionDatabaseState) (result sql.LongTermRetentionBackupListResultPage, err error) - ListByServer(ctx context.Context, locationName string, longTermRetentionServerName string, onlyLatestPerDatabase *bool, databaseState sql.LongTermRetentionDatabaseState) (result sql.LongTermRetentionBackupListResultPage, err error) -} - -var _ LongTermRetentionBackupsClientAPI = (*sql.LongTermRetentionBackupsClient)(nil) - -// BackupLongTermRetentionPoliciesClientAPI contains the set of methods on the BackupLongTermRetentionPoliciesClient type. -type BackupLongTermRetentionPoliciesClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.BackupLongTermRetentionPolicy) (result sql.BackupLongTermRetentionPoliciesCreateOrUpdateFuture, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.BackupLongTermRetentionPolicy, err error) - ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.BackupLongTermRetentionPolicy, err error) -} - -var _ BackupLongTermRetentionPoliciesClientAPI = (*sql.BackupLongTermRetentionPoliciesClient)(nil) - -// ManagedBackupShortTermRetentionPoliciesClientAPI contains the set of methods on the ManagedBackupShortTermRetentionPoliciesClient type. -type ManagedBackupShortTermRetentionPoliciesClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters sql.ManagedBackupShortTermRetentionPolicy) (result sql.ManagedBackupShortTermRetentionPoliciesCreateOrUpdateFuture, err error) - Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string) (result sql.ManagedBackupShortTermRetentionPolicy, err error) - ListByDatabase(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string) (result sql.ManagedBackupShortTermRetentionPolicyListResultPage, err error) - Update(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters sql.ManagedBackupShortTermRetentionPolicy) (result sql.ManagedBackupShortTermRetentionPoliciesUpdateFuture, err error) -} - -var _ ManagedBackupShortTermRetentionPoliciesClientAPI = (*sql.ManagedBackupShortTermRetentionPoliciesClient)(nil) - -// ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientAPI contains the set of methods on the ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient type. -type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, restorableDroppedDatabaseID string, parameters sql.ManagedBackupShortTermRetentionPolicy) (result sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCreateOrUpdateFuture, err error) - Get(ctx context.Context, resourceGroupName string, managedInstanceName string, restorableDroppedDatabaseID string) (result sql.ManagedBackupShortTermRetentionPolicy, err error) - ListByRestorableDroppedDatabase(ctx context.Context, resourceGroupName string, managedInstanceName string, restorableDroppedDatabaseID string) (result sql.ManagedBackupShortTermRetentionPolicyListResultPage, err error) - Update(ctx context.Context, resourceGroupName string, managedInstanceName string, restorableDroppedDatabaseID string, parameters sql.ManagedBackupShortTermRetentionPolicy) (result sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesUpdateFuture, err error) -} - -var _ ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientAPI = (*sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient)(nil) - -// ServerAutomaticTuningClientAPI contains the set of methods on the ServerAutomaticTuningClient type. -type ServerAutomaticTuningClientAPI interface { - Get(ctx context.Context, resourceGroupName string, serverName string) (result sql.ServerAutomaticTuning, err error) - Update(ctx context.Context, resourceGroupName string, serverName string, parameters sql.ServerAutomaticTuning) (result sql.ServerAutomaticTuning, err error) -} - -var _ ServerAutomaticTuningClientAPI = (*sql.ServerAutomaticTuningClient)(nil) - -// ServerDNSAliasesClientAPI contains the set of methods on the ServerDNSAliasesClient type. -type ServerDNSAliasesClientAPI interface { - Acquire(ctx context.Context, resourceGroupName string, serverName string, DNSAliasName string, parameters sql.ServerDNSAliasAcquisition) (result sql.ServerDNSAliasesAcquireFuture, err error) - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, DNSAliasName string) (result sql.ServerDNSAliasesCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, serverName string, DNSAliasName string) (result sql.ServerDNSAliasesDeleteFuture, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, DNSAliasName string) (result sql.ServerDNSAlias, err error) - ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.ServerDNSAliasListResultPage, err error) -} - -var _ ServerDNSAliasesClientAPI = (*sql.ServerDNSAliasesClient)(nil) - -// ServerSecurityAlertPoliciesClientAPI contains the set of methods on the ServerSecurityAlertPoliciesClient type. -type ServerSecurityAlertPoliciesClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters sql.ServerSecurityAlertPolicy) (result sql.ServerSecurityAlertPoliciesCreateOrUpdateFuture, err error) - Get(ctx context.Context, resourceGroupName string, serverName string) (result sql.ServerSecurityAlertPolicy, err error) - ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.LogicalServerSecurityAlertPolicyListResultPage, err error) -} - -var _ ServerSecurityAlertPoliciesClientAPI = (*sql.ServerSecurityAlertPoliciesClient)(nil) - -// RestorableDroppedManagedDatabasesClientAPI contains the set of methods on the RestorableDroppedManagedDatabasesClient type. -type RestorableDroppedManagedDatabasesClientAPI interface { - Get(ctx context.Context, resourceGroupName string, managedInstanceName string, restorableDroppedDatabaseID string) (result sql.RestorableDroppedManagedDatabase, err error) - ListByInstance(ctx context.Context, resourceGroupName string, managedInstanceName string) (result sql.RestorableDroppedManagedDatabaseListResultPage, err error) -} - -var _ RestorableDroppedManagedDatabasesClientAPI = (*sql.RestorableDroppedManagedDatabasesClient)(nil) - -// RestorePointsClientAPI contains the set of methods on the RestorePointsClient type. -type RestorePointsClientAPI interface { - Create(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.CreateDatabaseRestorePointDefinition) (result sql.RestorePointsCreateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, restorePointName string) (result autorest.Response, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, restorePointName string) (result sql.RestorePoint, err error) - ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.RestorePointListResult, err error) -} - -var _ RestorePointsClientAPI = (*sql.RestorePointsClient)(nil) - -// ManagedDatabaseSecurityAlertPoliciesClientAPI contains the set of methods on the ManagedDatabaseSecurityAlertPoliciesClient type. -type ManagedDatabaseSecurityAlertPoliciesClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters sql.ManagedDatabaseSecurityAlertPolicy) (result sql.ManagedDatabaseSecurityAlertPolicy, err error) - Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string) (result sql.ManagedDatabaseSecurityAlertPolicy, err error) - ListByDatabase(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string) (result sql.ManagedDatabaseSecurityAlertPolicyListResultPage, err error) -} - -var _ ManagedDatabaseSecurityAlertPoliciesClientAPI = (*sql.ManagedDatabaseSecurityAlertPoliciesClient)(nil) - -// ManagedServerSecurityAlertPoliciesClientAPI contains the set of methods on the ManagedServerSecurityAlertPoliciesClient type. -type ManagedServerSecurityAlertPoliciesClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters sql.ManagedServerSecurityAlertPolicy) (result sql.ManagedServerSecurityAlertPoliciesCreateOrUpdateFuture, err error) - Get(ctx context.Context, resourceGroupName string, managedInstanceName string) (result sql.ManagedServerSecurityAlertPolicy, err error) - ListByInstance(ctx context.Context, resourceGroupName string, managedInstanceName string) (result sql.ManagedServerSecurityAlertPolicyListResultPage, err error) -} - -var _ ManagedServerSecurityAlertPoliciesClientAPI = (*sql.ManagedServerSecurityAlertPoliciesClient)(nil) - -// SensitivityLabelsClientAPI contains the set of methods on the SensitivityLabelsClient type. -type SensitivityLabelsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, columnName string, parameters sql.SensitivityLabel) (result sql.SensitivityLabel, err error) - Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, columnName string) (result autorest.Response, err error) - DisableRecommendation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, columnName string) (result autorest.Response, err error) - EnableRecommendation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, columnName string) (result autorest.Response, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, columnName string, sensitivityLabelSource sql.SensitivityLabelSource) (result sql.SensitivityLabel, err error) - ListCurrentByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string, filter string) (result sql.SensitivityLabelListResultPage, err error) - ListRecommendedByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string, includeDisabledRecommendations *bool, skipToken string, filter string) (result sql.SensitivityLabelListResultPage, err error) -} - -var _ SensitivityLabelsClientAPI = (*sql.SensitivityLabelsClient)(nil) - -// ManagedInstanceAdministratorsClientAPI contains the set of methods on the ManagedInstanceAdministratorsClient type. -type ManagedInstanceAdministratorsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, administratorName string, parameters sql.ManagedInstanceAdministrator) (result sql.ManagedInstanceAdministratorsCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, managedInstanceName string, administratorName string) (result sql.ManagedInstanceAdministratorsDeleteFuture, err error) - Get(ctx context.Context, resourceGroupName string, managedInstanceName string, administratorName string) (result sql.ManagedInstanceAdministrator, err error) - ListByInstance(ctx context.Context, resourceGroupName string, managedInstanceName string) (result sql.ManagedInstanceAdministratorListResultPage, err error) -} - -var _ ManagedInstanceAdministratorsClientAPI = (*sql.ManagedInstanceAdministratorsClient)(nil) - -// DatabaseOperationsClientAPI contains the set of methods on the DatabaseOperationsClient type. -type DatabaseOperationsClientAPI interface { - Cancel(ctx context.Context, resourceGroupName string, serverName string, databaseName string, operationID uuid.UUID) (result autorest.Response, err error) - ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.DatabaseOperationListResultPage, err error) -} - -var _ DatabaseOperationsClientAPI = (*sql.DatabaseOperationsClient)(nil) - -// ElasticPoolOperationsClientAPI contains the set of methods on the ElasticPoolOperationsClient type. -type ElasticPoolOperationsClientAPI interface { - Cancel(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, operationID uuid.UUID) (result autorest.Response, err error) - ListByElasticPool(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (result sql.ElasticPoolOperationListResultPage, err error) -} - -var _ ElasticPoolOperationsClientAPI = (*sql.ElasticPoolOperationsClient)(nil) - -// CapabilitiesClientAPI contains the set of methods on the CapabilitiesClient type. -type CapabilitiesClientAPI interface { - ListByLocation(ctx context.Context, locationName string, include sql.CapabilityGroup) (result sql.LocationCapabilities, err error) -} - -var _ CapabilitiesClientAPI = (*sql.CapabilitiesClient)(nil) - -// DatabaseVulnerabilityAssessmentScansClientAPI contains the set of methods on the DatabaseVulnerabilityAssessmentScansClient type. -type DatabaseVulnerabilityAssessmentScansClientAPI interface { - Export(ctx context.Context, resourceGroupName string, serverName string, databaseName string, scanID string) (result sql.DatabaseVulnerabilityAssessmentScansExport, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, scanID string) (result sql.VulnerabilityAssessmentScanRecord, err error) - InitiateScan(ctx context.Context, resourceGroupName string, serverName string, databaseName string, scanID string) (result sql.DatabaseVulnerabilityAssessmentScansInitiateScanFuture, err error) - ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.VulnerabilityAssessmentScanRecordListResultPage, err error) -} - -var _ DatabaseVulnerabilityAssessmentScansClientAPI = (*sql.DatabaseVulnerabilityAssessmentScansClient)(nil) - -// ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientAPI contains the set of methods on the ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient type. -type ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, ruleID string, baselineName sql.VulnerabilityAssessmentPolicyBaselineName, parameters sql.DatabaseVulnerabilityAssessmentRuleBaseline) (result sql.DatabaseVulnerabilityAssessmentRuleBaseline, err error) - Delete(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, ruleID string, baselineName sql.VulnerabilityAssessmentPolicyBaselineName) (result autorest.Response, err error) - Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, ruleID string, baselineName sql.VulnerabilityAssessmentPolicyBaselineName) (result sql.DatabaseVulnerabilityAssessmentRuleBaseline, err error) -} - -var _ ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientAPI = (*sql.ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient)(nil) - -// ManagedDatabaseVulnerabilityAssessmentScansClientAPI contains the set of methods on the ManagedDatabaseVulnerabilityAssessmentScansClient type. -type ManagedDatabaseVulnerabilityAssessmentScansClientAPI interface { - Export(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, scanID string) (result sql.DatabaseVulnerabilityAssessmentScansExport, err error) - Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, scanID string) (result sql.VulnerabilityAssessmentScanRecord, err error) - InitiateScan(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, scanID string) (result sql.ManagedDatabaseVulnerabilityAssessmentScansInitiateScanFuture, err error) - ListByDatabase(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string) (result sql.VulnerabilityAssessmentScanRecordListResultPage, err error) -} - -var _ ManagedDatabaseVulnerabilityAssessmentScansClientAPI = (*sql.ManagedDatabaseVulnerabilityAssessmentScansClient)(nil) - -// ManagedDatabaseVulnerabilityAssessmentsClientAPI contains the set of methods on the ManagedDatabaseVulnerabilityAssessmentsClient type. -type ManagedDatabaseVulnerabilityAssessmentsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters sql.DatabaseVulnerabilityAssessment) (result sql.DatabaseVulnerabilityAssessment, err error) - Delete(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string) (result autorest.Response, err error) - Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string) (result sql.DatabaseVulnerabilityAssessment, err error) - ListByDatabase(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string) (result sql.DatabaseVulnerabilityAssessmentListResultPage, err error) -} - -var _ ManagedDatabaseVulnerabilityAssessmentsClientAPI = (*sql.ManagedDatabaseVulnerabilityAssessmentsClient)(nil) - -// InstanceFailoverGroupsClientAPI contains the set of methods on the InstanceFailoverGroupsClient type. -type InstanceFailoverGroupsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, locationName string, failoverGroupName string, parameters sql.InstanceFailoverGroup) (result sql.InstanceFailoverGroupsCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, locationName string, failoverGroupName string) (result sql.InstanceFailoverGroupsDeleteFuture, err error) - Failover(ctx context.Context, resourceGroupName string, locationName string, failoverGroupName string) (result sql.InstanceFailoverGroupsFailoverFuture, err error) - ForceFailoverAllowDataLoss(ctx context.Context, resourceGroupName string, locationName string, failoverGroupName string) (result sql.InstanceFailoverGroupsForceFailoverAllowDataLossFuture, err error) - Get(ctx context.Context, resourceGroupName string, locationName string, failoverGroupName string) (result sql.InstanceFailoverGroup, err error) - ListByLocation(ctx context.Context, resourceGroupName string, locationName string) (result sql.InstanceFailoverGroupListResultPage, err error) -} - -var _ InstanceFailoverGroupsClientAPI = (*sql.InstanceFailoverGroupsClient)(nil) - -// BackupShortTermRetentionPoliciesClientAPI contains the set of methods on the BackupShortTermRetentionPoliciesClient type. -type BackupShortTermRetentionPoliciesClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.BackupShortTermRetentionPolicy) (result sql.BackupShortTermRetentionPoliciesCreateOrUpdateFuture, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.BackupShortTermRetentionPolicy, err error) - ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.BackupShortTermRetentionPolicyListResultPage, err error) - Update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.BackupShortTermRetentionPolicy) (result sql.BackupShortTermRetentionPoliciesUpdateFuture, err error) -} - -var _ BackupShortTermRetentionPoliciesClientAPI = (*sql.BackupShortTermRetentionPoliciesClient)(nil) - -// TdeCertificatesClientAPI contains the set of methods on the TdeCertificatesClient type. -type TdeCertificatesClientAPI interface { - Create(ctx context.Context, resourceGroupName string, serverName string, parameters sql.TdeCertificate) (result sql.TdeCertificatesCreateFuture, err error) -} - -var _ TdeCertificatesClientAPI = (*sql.TdeCertificatesClient)(nil) - -// ManagedInstanceTdeCertificatesClientAPI contains the set of methods on the ManagedInstanceTdeCertificatesClient type. -type ManagedInstanceTdeCertificatesClientAPI interface { - Create(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters sql.TdeCertificate) (result sql.ManagedInstanceTdeCertificatesCreateFuture, err error) -} - -var _ ManagedInstanceTdeCertificatesClientAPI = (*sql.ManagedInstanceTdeCertificatesClient)(nil) - -// ManagedInstanceKeysClientAPI contains the set of methods on the ManagedInstanceKeysClient type. -type ManagedInstanceKeysClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, keyName string, parameters sql.ManagedInstanceKey) (result sql.ManagedInstanceKeysCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, managedInstanceName string, keyName string) (result sql.ManagedInstanceKeysDeleteFuture, err error) - Get(ctx context.Context, resourceGroupName string, managedInstanceName string, keyName string) (result sql.ManagedInstanceKey, err error) - ListByInstance(ctx context.Context, resourceGroupName string, managedInstanceName string, filter string) (result sql.ManagedInstanceKeyListResultPage, err error) -} - -var _ ManagedInstanceKeysClientAPI = (*sql.ManagedInstanceKeysClient)(nil) - -// ManagedInstanceEncryptionProtectorsClientAPI contains the set of methods on the ManagedInstanceEncryptionProtectorsClient type. -type ManagedInstanceEncryptionProtectorsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters sql.ManagedInstanceEncryptionProtector) (result sql.ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture, err error) - Get(ctx context.Context, resourceGroupName string, managedInstanceName string) (result sql.ManagedInstanceEncryptionProtector, err error) - ListByInstance(ctx context.Context, resourceGroupName string, managedInstanceName string) (result sql.ManagedInstanceEncryptionProtectorListResultPage, err error) - Revalidate(ctx context.Context, resourceGroupName string, managedInstanceName string) (result sql.ManagedInstanceEncryptionProtectorsRevalidateFuture, err error) -} - -var _ ManagedInstanceEncryptionProtectorsClientAPI = (*sql.ManagedInstanceEncryptionProtectorsClient)(nil) - -// RecoverableManagedDatabasesClientAPI contains the set of methods on the RecoverableManagedDatabasesClient type. -type RecoverableManagedDatabasesClientAPI interface { - Get(ctx context.Context, resourceGroupName string, managedInstanceName string, recoverableDatabaseName string) (result sql.RecoverableManagedDatabase, err error) - ListByInstance(ctx context.Context, resourceGroupName string, managedInstanceName string) (result sql.RecoverableManagedDatabaseListResultPage, err error) -} - -var _ RecoverableManagedDatabasesClientAPI = (*sql.RecoverableManagedDatabasesClient)(nil) - -// ManagedInstanceVulnerabilityAssessmentsClientAPI contains the set of methods on the ManagedInstanceVulnerabilityAssessmentsClient type. -type ManagedInstanceVulnerabilityAssessmentsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters sql.ManagedInstanceVulnerabilityAssessment) (result sql.ManagedInstanceVulnerabilityAssessment, err error) - Delete(ctx context.Context, resourceGroupName string, managedInstanceName string) (result autorest.Response, err error) - Get(ctx context.Context, resourceGroupName string, managedInstanceName string) (result sql.ManagedInstanceVulnerabilityAssessment, err error) - ListByInstance(ctx context.Context, resourceGroupName string, managedInstanceName string) (result sql.ManagedInstanceVulnerabilityAssessmentListResultPage, err error) -} - -var _ ManagedInstanceVulnerabilityAssessmentsClientAPI = (*sql.ManagedInstanceVulnerabilityAssessmentsClient)(nil) - -// ServerVulnerabilityAssessmentsClientAPI contains the set of methods on the ServerVulnerabilityAssessmentsClient type. -type ServerVulnerabilityAssessmentsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters sql.ServerVulnerabilityAssessment) (result sql.ServerVulnerabilityAssessment, err error) - Delete(ctx context.Context, resourceGroupName string, serverName string) (result autorest.Response, err error) - Get(ctx context.Context, resourceGroupName string, serverName string) (result sql.ServerVulnerabilityAssessment, err error) - ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.ServerVulnerabilityAssessmentListResultPage, err error) -} - -var _ ServerVulnerabilityAssessmentsClientAPI = (*sql.ServerVulnerabilityAssessmentsClient)(nil) - -// ManagedDatabaseSensitivityLabelsClientAPI contains the set of methods on the ManagedDatabaseSensitivityLabelsClient type. -type ManagedDatabaseSensitivityLabelsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, columnName string, parameters sql.SensitivityLabel) (result sql.SensitivityLabel, err error) - Delete(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, columnName string) (result autorest.Response, err error) - DisableRecommendation(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, columnName string) (result autorest.Response, err error) - EnableRecommendation(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, columnName string) (result autorest.Response, err error) - Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, columnName string, sensitivityLabelSource sql.SensitivityLabelSource) (result sql.SensitivityLabel, err error) - ListCurrentByDatabase(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, filter string) (result sql.SensitivityLabelListResultPage, err error) - ListRecommendedByDatabase(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, includeDisabledRecommendations *bool, skipToken string, filter string) (result sql.SensitivityLabelListResultPage, err error) -} - -var _ ManagedDatabaseSensitivityLabelsClientAPI = (*sql.ManagedDatabaseSensitivityLabelsClient)(nil) - -// InstancePoolsClientAPI contains the set of methods on the InstancePoolsClient type. -type InstancePoolsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, instancePoolName string, parameters sql.InstancePool) (result sql.InstancePoolsCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, instancePoolName string) (result sql.InstancePoolsDeleteFuture, err error) - Get(ctx context.Context, resourceGroupName string, instancePoolName string) (result sql.InstancePool, err error) - List(ctx context.Context) (result sql.InstancePoolListResultPage, err error) - ListByResourceGroup(ctx context.Context, resourceGroupName string) (result sql.InstancePoolListResultPage, err error) - Update(ctx context.Context, resourceGroupName string, instancePoolName string, parameters sql.InstancePoolUpdate) (result sql.InstancePoolsUpdateFuture, err error) -} - -var _ InstancePoolsClientAPI = (*sql.InstancePoolsClient)(nil) - -// UsagesClientAPI contains the set of methods on the UsagesClient type. -type UsagesClientAPI interface { - ListByInstancePool(ctx context.Context, resourceGroupName string, instancePoolName string, expandChildren *bool) (result sql.UsageListResultPage, err error) -} - -var _ UsagesClientAPI = (*sql.UsagesClient)(nil) - -// ManagedInstancesClientAPI contains the set of methods on the ManagedInstancesClient type. -type ManagedInstancesClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters sql.ManagedInstance) (result sql.ManagedInstancesCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, managedInstanceName string) (result sql.ManagedInstancesDeleteFuture, err error) - Get(ctx context.Context, resourceGroupName string, managedInstanceName string) (result sql.ManagedInstance, err error) - List(ctx context.Context) (result sql.ManagedInstanceListResultPage, err error) - ListByInstancePool(ctx context.Context, resourceGroupName string, instancePoolName string) (result sql.ManagedInstanceListResultPage, err error) - ListByResourceGroup(ctx context.Context, resourceGroupName string) (result sql.ManagedInstanceListResultPage, err error) - Update(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters sql.ManagedInstanceUpdate) (result sql.ManagedInstancesUpdateFuture, err error) -} - -var _ ManagedInstancesClientAPI = (*sql.ManagedInstancesClient)(nil) - -// ManagedDatabaseRestoreDetailsClientAPI contains the set of methods on the ManagedDatabaseRestoreDetailsClient type. -type ManagedDatabaseRestoreDetailsClientAPI interface { - Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string) (result sql.ManagedDatabaseRestoreDetailsResult, err error) -} - -var _ ManagedDatabaseRestoreDetailsClientAPI = (*sql.ManagedDatabaseRestoreDetailsClient)(nil) - -// ManagedDatabasesClientAPI contains the set of methods on the ManagedDatabasesClient type. -type ManagedDatabasesClientAPI interface { - CompleteRestore(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters sql.CompleteDatabaseRestoreDefinition) (result sql.ManagedDatabasesCompleteRestoreFuture, err error) - CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters sql.ManagedDatabase) (result sql.ManagedDatabasesCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string) (result sql.ManagedDatabasesDeleteFuture, err error) - Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string) (result sql.ManagedDatabase, err error) - ListByInstance(ctx context.Context, resourceGroupName string, managedInstanceName string) (result sql.ManagedDatabaseListResultPage, err error) - Update(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters sql.ManagedDatabaseUpdate) (result sql.ManagedDatabasesUpdateFuture, err error) -} - -var _ ManagedDatabasesClientAPI = (*sql.ManagedDatabasesClient)(nil) - -// PrivateEndpointConnectionsClientAPI contains the set of methods on the PrivateEndpointConnectionsClient type. -type PrivateEndpointConnectionsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters sql.PrivateEndpointConnection) (result sql.PrivateEndpointConnectionsCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string) (result sql.PrivateEndpointConnectionsDeleteFuture, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string) (result sql.PrivateEndpointConnection, err error) - ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.PrivateEndpointConnectionListResultPage, err error) -} - -var _ PrivateEndpointConnectionsClientAPI = (*sql.PrivateEndpointConnectionsClient)(nil) - -// PrivateLinkResourcesClientAPI contains the set of methods on the PrivateLinkResourcesClient type. -type PrivateLinkResourcesClientAPI interface { - Get(ctx context.Context, resourceGroupName string, serverName string, groupName string) (result sql.PrivateLinkResource, err error) - ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.PrivateLinkResourceListResultPage, err error) -} - -var _ PrivateLinkResourcesClientAPI = (*sql.PrivateLinkResourcesClient)(nil) diff --git a/services/preview/sql/mgmt/2018-06-15-preview/sql/subscriptionusages.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/subscriptionusages.go deleted file mode 100644 index 05a7a1840a7a..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/subscriptionusages.go +++ /dev/null @@ -1,233 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// SubscriptionUsagesClient is the the Azure SQL Database management API provides a RESTful set of web services that -// interact with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, -// and delete databases. -type SubscriptionUsagesClient struct { - BaseClient -} - -// NewSubscriptionUsagesClient creates an instance of the SubscriptionUsagesClient client. -func NewSubscriptionUsagesClient(subscriptionID string) SubscriptionUsagesClient { - return NewSubscriptionUsagesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewSubscriptionUsagesClientWithBaseURI creates an instance of the SubscriptionUsagesClient client. -func NewSubscriptionUsagesClientWithBaseURI(baseURI string, subscriptionID string) SubscriptionUsagesClient { - return SubscriptionUsagesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets a subscription usage metric. -// Parameters: -// locationName - the name of the region where the resource is located. -// usageName - name of usage metric to return. -func (client SubscriptionUsagesClient) Get(ctx context.Context, locationName string, usageName string) (result SubscriptionUsage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionUsagesClient.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, usageName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SubscriptionUsagesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.SubscriptionUsagesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SubscriptionUsagesClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client SubscriptionUsagesClient) GetPreparer(ctx context.Context, locationName string, usageName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "locationName": autorest.Encode("path", locationName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "usageName": autorest.Encode("path", usageName), - } - - 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}/providers/Microsoft.Sql/locations/{locationName}/usages/{usageName}", 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 SubscriptionUsagesClient) 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 SubscriptionUsagesClient) GetResponder(resp *http.Response) (result SubscriptionUsage, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByLocation gets all subscription usage metrics in a given location. -// Parameters: -// locationName - the name of the region where the resource is located. -func (client SubscriptionUsagesClient) ListByLocation(ctx context.Context, locationName string) (result SubscriptionUsageListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionUsagesClient.ListByLocation") - defer func() { - sc := -1 - if result.sulr.Response.Response != nil { - sc = result.sulr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByLocationNextResults - req, err := client.ListByLocationPreparer(ctx, locationName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SubscriptionUsagesClient", "ListByLocation", nil, "Failure preparing request") - return - } - - resp, err := client.ListByLocationSender(req) - if err != nil { - result.sulr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.SubscriptionUsagesClient", "ListByLocation", resp, "Failure sending request") - return - } - - result.sulr, err = client.ListByLocationResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SubscriptionUsagesClient", "ListByLocation", resp, "Failure responding to request") - } - - return -} - -// ListByLocationPreparer prepares the ListByLocation request. -func (client SubscriptionUsagesClient) ListByLocationPreparer(ctx context.Context, locationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "locationName": autorest.Encode("path", locationName), - "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}/providers/Microsoft.Sql/locations/{locationName}/usages", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByLocationSender sends the ListByLocation request. The method will close the -// http.Response Body if it receives an error. -func (client SubscriptionUsagesClient) ListByLocationSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByLocationResponder handles the response to the ListByLocation request. The method always -// closes the http.Response Body. -func (client SubscriptionUsagesClient) ListByLocationResponder(resp *http.Response) (result SubscriptionUsageListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByLocationNextResults retrieves the next set of results, if any. -func (client SubscriptionUsagesClient) listByLocationNextResults(ctx context.Context, lastResults SubscriptionUsageListResult) (result SubscriptionUsageListResult, err error) { - req, err := lastResults.subscriptionUsageListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.SubscriptionUsagesClient", "listByLocationNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByLocationSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "sql.SubscriptionUsagesClient", "listByLocationNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByLocationResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SubscriptionUsagesClient", "listByLocationNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByLocationComplete enumerates all values, automatically crossing page boundaries as required. -func (client SubscriptionUsagesClient) ListByLocationComplete(ctx context.Context, locationName string) (result SubscriptionUsageListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionUsagesClient.ListByLocation") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByLocation(ctx, locationName) - return -} diff --git a/services/preview/sql/mgmt/2018-06-15-preview/sql/syncagents.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/syncagents.go deleted file mode 100644 index 83d69dca7838..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/syncagents.go +++ /dev/null @@ -1,599 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// SyncAgentsClient is the the Azure SQL Database management API provides a RESTful set of web services that interact -// with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, and -// delete databases. -type SyncAgentsClient struct { - BaseClient -} - -// NewSyncAgentsClient creates an instance of the SyncAgentsClient client. -func NewSyncAgentsClient(subscriptionID string) SyncAgentsClient { - return NewSyncAgentsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewSyncAgentsClientWithBaseURI creates an instance of the SyncAgentsClient client. -func NewSyncAgentsClientWithBaseURI(baseURI string, subscriptionID string) SyncAgentsClient { - return SyncAgentsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a sync agent. -// 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 on which the sync agent is hosted. -// syncAgentName - the name of the sync agent. -// parameters - the requested sync agent resource state. -func (client SyncAgentsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, syncAgentName string, parameters SyncAgent) (result SyncAgentsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncAgentsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, syncAgentName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncAgentsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncAgentsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client SyncAgentsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, syncAgentName string, parameters SyncAgent) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "syncAgentName": autorest.Encode("path", syncAgentName), - } - - const APIVersion = "2015-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.Sql/servers/{serverName}/syncAgents/{syncAgentName}", 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 SyncAgentsClient) CreateOrUpdateSender(req *http.Request) (future SyncAgentsCreateOrUpdateFuture, 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 SyncAgentsClient) CreateOrUpdateResponder(resp *http.Response) (result SyncAgent, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a sync agent. -// 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 on which the sync agent is hosted. -// syncAgentName - the name of the sync agent. -func (client SyncAgentsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, syncAgentName string) (result SyncAgentsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncAgentsClient.Delete") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, syncAgentName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncAgentsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncAgentsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client SyncAgentsClient) DeletePreparer(ctx context.Context, resourceGroupName string, serverName string, syncAgentName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "syncAgentName": autorest.Encode("path", syncAgentName), - } - - const APIVersion = "2015-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.Sql/servers/{serverName}/syncAgents/{syncAgentName}", 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 SyncAgentsClient) DeleteSender(req *http.Request) (future SyncAgentsDeleteFuture, 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 SyncAgentsClient) 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 -} - -// GenerateKey generates a sync agent key. -// 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 on which the sync agent is hosted. -// syncAgentName - the name of the sync agent. -func (client SyncAgentsClient) GenerateKey(ctx context.Context, resourceGroupName string, serverName string, syncAgentName string) (result SyncAgentKeyProperties, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncAgentsClient.GenerateKey") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GenerateKeyPreparer(ctx, resourceGroupName, serverName, syncAgentName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncAgentsClient", "GenerateKey", nil, "Failure preparing request") - return - } - - resp, err := client.GenerateKeySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.SyncAgentsClient", "GenerateKey", resp, "Failure sending request") - return - } - - result, err = client.GenerateKeyResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncAgentsClient", "GenerateKey", resp, "Failure responding to request") - } - - return -} - -// GenerateKeyPreparer prepares the GenerateKey request. -func (client SyncAgentsClient) GenerateKeyPreparer(ctx context.Context, resourceGroupName string, serverName string, syncAgentName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "syncAgentName": autorest.Encode("path", syncAgentName), - } - - const APIVersion = "2015-05-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.Sql/servers/{serverName}/syncAgents/{syncAgentName}/generateKey", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GenerateKeySender sends the GenerateKey request. The method will close the -// http.Response Body if it receives an error. -func (client SyncAgentsClient) GenerateKeySender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// GenerateKeyResponder handles the response to the GenerateKey request. The method always -// closes the http.Response Body. -func (client SyncAgentsClient) GenerateKeyResponder(resp *http.Response) (result SyncAgentKeyProperties, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get gets a sync agent. -// 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 on which the sync agent is hosted. -// syncAgentName - the name of the sync agent. -func (client SyncAgentsClient) Get(ctx context.Context, resourceGroupName string, serverName string, syncAgentName string) (result SyncAgent, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncAgentsClient.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, serverName, syncAgentName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncAgentsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.SyncAgentsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncAgentsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client SyncAgentsClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, syncAgentName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "syncAgentName": autorest.Encode("path", syncAgentName), - } - - 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}/syncAgents/{syncAgentName}", 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 SyncAgentsClient) 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 SyncAgentsClient) GetResponder(resp *http.Response) (result SyncAgent, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByServer lists sync agents in 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 on which the sync agent is hosted. -func (client SyncAgentsClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result SyncAgentListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncAgentsClient.ListByServer") - defer func() { - sc := -1 - if result.salr.Response.Response != nil { - sc = result.salr.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.SyncAgentsClient", "ListByServer", nil, "Failure preparing request") - return - } - - resp, err := client.ListByServerSender(req) - if err != nil { - result.salr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.SyncAgentsClient", "ListByServer", resp, "Failure sending request") - return - } - - result.salr, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncAgentsClient", "ListByServer", resp, "Failure responding to request") - } - - return -} - -// ListByServerPreparer prepares the ListByServer request. -func (client SyncAgentsClient) 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 = "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}/syncAgents", 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 SyncAgentsClient) 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 SyncAgentsClient) ListByServerResponder(resp *http.Response) (result SyncAgentListResult, 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 SyncAgentsClient) listByServerNextResults(ctx context.Context, lastResults SyncAgentListResult) (result SyncAgentListResult, err error) { - req, err := lastResults.syncAgentListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.SyncAgentsClient", "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.SyncAgentsClient", "listByServerNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncAgentsClient", "listByServerNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByServerComplete enumerates all values, automatically crossing page boundaries as required. -func (client SyncAgentsClient) ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string) (result SyncAgentListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncAgentsClient.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 -} - -// ListLinkedDatabases lists databases linked to a sync agent. -// 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 on which the sync agent is hosted. -// syncAgentName - the name of the sync agent. -func (client SyncAgentsClient) ListLinkedDatabases(ctx context.Context, resourceGroupName string, serverName string, syncAgentName string) (result SyncAgentLinkedDatabaseListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncAgentsClient.ListLinkedDatabases") - defer func() { - sc := -1 - if result.saldlr.Response.Response != nil { - sc = result.saldlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listLinkedDatabasesNextResults - req, err := client.ListLinkedDatabasesPreparer(ctx, resourceGroupName, serverName, syncAgentName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncAgentsClient", "ListLinkedDatabases", nil, "Failure preparing request") - return - } - - resp, err := client.ListLinkedDatabasesSender(req) - if err != nil { - result.saldlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.SyncAgentsClient", "ListLinkedDatabases", resp, "Failure sending request") - return - } - - result.saldlr, err = client.ListLinkedDatabasesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncAgentsClient", "ListLinkedDatabases", resp, "Failure responding to request") - } - - return -} - -// ListLinkedDatabasesPreparer prepares the ListLinkedDatabases request. -func (client SyncAgentsClient) ListLinkedDatabasesPreparer(ctx context.Context, resourceGroupName string, serverName string, syncAgentName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "syncAgentName": autorest.Encode("path", syncAgentName), - } - - 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}/syncAgents/{syncAgentName}/linkedDatabases", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListLinkedDatabasesSender sends the ListLinkedDatabases request. The method will close the -// http.Response Body if it receives an error. -func (client SyncAgentsClient) ListLinkedDatabasesSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListLinkedDatabasesResponder handles the response to the ListLinkedDatabases request. The method always -// closes the http.Response Body. -func (client SyncAgentsClient) ListLinkedDatabasesResponder(resp *http.Response) (result SyncAgentLinkedDatabaseListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listLinkedDatabasesNextResults retrieves the next set of results, if any. -func (client SyncAgentsClient) listLinkedDatabasesNextResults(ctx context.Context, lastResults SyncAgentLinkedDatabaseListResult) (result SyncAgentLinkedDatabaseListResult, err error) { - req, err := lastResults.syncAgentLinkedDatabaseListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.SyncAgentsClient", "listLinkedDatabasesNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListLinkedDatabasesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "sql.SyncAgentsClient", "listLinkedDatabasesNextResults", resp, "Failure sending next results request") - } - result, err = client.ListLinkedDatabasesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncAgentsClient", "listLinkedDatabasesNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListLinkedDatabasesComplete enumerates all values, automatically crossing page boundaries as required. -func (client SyncAgentsClient) ListLinkedDatabasesComplete(ctx context.Context, resourceGroupName string, serverName string, syncAgentName string) (result SyncAgentLinkedDatabaseListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncAgentsClient.ListLinkedDatabases") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListLinkedDatabases(ctx, resourceGroupName, serverName, syncAgentName) - return -} diff --git a/services/preview/sql/mgmt/2018-06-15-preview/sql/syncgroups.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/syncgroups.go deleted file mode 100644 index f16c28c30198..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/syncgroups.go +++ /dev/null @@ -1,1100 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// SyncGroupsClient is the the Azure SQL Database management API provides a RESTful set of web services that interact -// with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, and -// delete databases. -type SyncGroupsClient struct { - BaseClient -} - -// NewSyncGroupsClient creates an instance of the SyncGroupsClient client. -func NewSyncGroupsClient(subscriptionID string) SyncGroupsClient { - return NewSyncGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewSyncGroupsClientWithBaseURI creates an instance of the SyncGroupsClient client. -func NewSyncGroupsClientWithBaseURI(baseURI string, subscriptionID string) SyncGroupsClient { - return SyncGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CancelSync cancels a sync group synchronization. -// 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 on which the sync group is hosted. -// syncGroupName - the name of the sync group. -func (client SyncGroupsClient) CancelSync(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncGroupsClient.CancelSync") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CancelSyncPreparer(ctx, resourceGroupName, serverName, databaseName, syncGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncGroupsClient", "CancelSync", nil, "Failure preparing request") - return - } - - resp, err := client.CancelSyncSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "sql.SyncGroupsClient", "CancelSync", resp, "Failure sending request") - return - } - - result, err = client.CancelSyncResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncGroupsClient", "CancelSync", resp, "Failure responding to request") - } - - return -} - -// CancelSyncPreparer prepares the CancelSync request. -func (client SyncGroupsClient) CancelSyncPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName 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), - "syncGroupName": autorest.Encode("path", syncGroupName), - } - - const APIVersion = "2015-05-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.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/cancelSync", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CancelSyncSender sends the CancelSync request. The method will close the -// http.Response Body if it receives an error. -func (client SyncGroupsClient) CancelSyncSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// CancelSyncResponder handles the response to the CancelSync request. The method always -// closes the http.Response Body. -func (client SyncGroupsClient) CancelSyncResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// CreateOrUpdate creates or updates a sync group. -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -// serverName - the name of the server. -// databaseName - the name of the database on which the sync group is hosted. -// syncGroupName - the name of the sync group. -// parameters - the requested sync group resource state. -func (client SyncGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, parameters SyncGroup) (result SyncGroupsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncGroupsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, databaseName, syncGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncGroupsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncGroupsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client SyncGroupsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, parameters SyncGroup) (*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), - "syncGroupName": autorest.Encode("path", syncGroupName), - } - - const APIVersion = "2015-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.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}", 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 SyncGroupsClient) CreateOrUpdateSender(req *http.Request) (future SyncGroupsCreateOrUpdateFuture, 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 SyncGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result SyncGroup, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a sync group. -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -// serverName - the name of the server. -// databaseName - the name of the database on which the sync group is hosted. -// syncGroupName - the name of the sync group. -func (client SyncGroupsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result SyncGroupsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncGroupsClient.Delete") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, databaseName, syncGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncGroupsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncGroupsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client SyncGroupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName 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), - "syncGroupName": autorest.Encode("path", syncGroupName), - } - - const APIVersion = "2015-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.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}", 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 SyncGroupsClient) DeleteSender(req *http.Request) (future SyncGroupsDeleteFuture, 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 SyncGroupsClient) 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 sync group. -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -// serverName - the name of the server. -// databaseName - the name of the database on which the sync group is hosted. -// syncGroupName - the name of the sync group. -func (client SyncGroupsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result SyncGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncGroupsClient.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, serverName, databaseName, syncGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncGroupsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.SyncGroupsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncGroupsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client SyncGroupsClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName 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), - "syncGroupName": autorest.Encode("path", syncGroupName), - } - - 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}/syncGroups/{syncGroupName}", 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 SyncGroupsClient) 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 SyncGroupsClient) GetResponder(resp *http.Response) (result SyncGroup, 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 lists sync groups under a hub 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 on which the sync group is hosted. -func (client SyncGroupsClient) ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result SyncGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncGroupsClient.ListByDatabase") - defer func() { - sc := -1 - if result.sglr.Response.Response != nil { - sc = result.sglr.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.SyncGroupsClient", "ListByDatabase", nil, "Failure preparing request") - return - } - - resp, err := client.ListByDatabaseSender(req) - if err != nil { - result.sglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.SyncGroupsClient", "ListByDatabase", resp, "Failure sending request") - return - } - - result.sglr, err = client.ListByDatabaseResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncGroupsClient", "ListByDatabase", resp, "Failure responding to request") - } - - return -} - -// ListByDatabasePreparer prepares the ListByDatabase request. -func (client SyncGroupsClient) 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}/syncGroups", 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 SyncGroupsClient) 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 SyncGroupsClient) ListByDatabaseResponder(resp *http.Response) (result SyncGroupListResult, 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 SyncGroupsClient) listByDatabaseNextResults(ctx context.Context, lastResults SyncGroupListResult) (result SyncGroupListResult, err error) { - req, err := lastResults.syncGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.SyncGroupsClient", "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.SyncGroupsClient", "listByDatabaseNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByDatabaseResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncGroupsClient", "listByDatabaseNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByDatabaseComplete enumerates all values, automatically crossing page boundaries as required. -func (client SyncGroupsClient) ListByDatabaseComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result SyncGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncGroupsClient.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 -} - -// ListHubSchemas gets a collection of hub database schemas. -// 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 on which the sync group is hosted. -// syncGroupName - the name of the sync group. -func (client SyncGroupsClient) ListHubSchemas(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result SyncFullSchemaPropertiesListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncGroupsClient.ListHubSchemas") - defer func() { - sc := -1 - if result.sfsplr.Response.Response != nil { - sc = result.sfsplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listHubSchemasNextResults - req, err := client.ListHubSchemasPreparer(ctx, resourceGroupName, serverName, databaseName, syncGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncGroupsClient", "ListHubSchemas", nil, "Failure preparing request") - return - } - - resp, err := client.ListHubSchemasSender(req) - if err != nil { - result.sfsplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.SyncGroupsClient", "ListHubSchemas", resp, "Failure sending request") - return - } - - result.sfsplr, err = client.ListHubSchemasResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncGroupsClient", "ListHubSchemas", resp, "Failure responding to request") - } - - return -} - -// ListHubSchemasPreparer prepares the ListHubSchemas request. -func (client SyncGroupsClient) ListHubSchemasPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName 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), - "syncGroupName": autorest.Encode("path", syncGroupName), - } - - 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}/syncGroups/{syncGroupName}/hubSchemas", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListHubSchemasSender sends the ListHubSchemas request. The method will close the -// http.Response Body if it receives an error. -func (client SyncGroupsClient) ListHubSchemasSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListHubSchemasResponder handles the response to the ListHubSchemas request. The method always -// closes the http.Response Body. -func (client SyncGroupsClient) ListHubSchemasResponder(resp *http.Response) (result SyncFullSchemaPropertiesListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listHubSchemasNextResults retrieves the next set of results, if any. -func (client SyncGroupsClient) listHubSchemasNextResults(ctx context.Context, lastResults SyncFullSchemaPropertiesListResult) (result SyncFullSchemaPropertiesListResult, err error) { - req, err := lastResults.syncFullSchemaPropertiesListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.SyncGroupsClient", "listHubSchemasNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListHubSchemasSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "sql.SyncGroupsClient", "listHubSchemasNextResults", resp, "Failure sending next results request") - } - result, err = client.ListHubSchemasResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncGroupsClient", "listHubSchemasNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListHubSchemasComplete enumerates all values, automatically crossing page boundaries as required. -func (client SyncGroupsClient) ListHubSchemasComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result SyncFullSchemaPropertiesListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncGroupsClient.ListHubSchemas") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListHubSchemas(ctx, resourceGroupName, serverName, databaseName, syncGroupName) - return -} - -// ListLogs gets a collection of sync group logs. -// 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 on which the sync group is hosted. -// syncGroupName - the name of the sync group. -// startTime - get logs generated after this time. -// endTime - get logs generated before this time. -// typeParameter - the types of logs to retrieve. -// continuationToken - the continuation token for this operation. -func (client SyncGroupsClient) ListLogs(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, startTime string, endTime string, typeParameter string, continuationToken string) (result SyncGroupLogListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncGroupsClient.ListLogs") - defer func() { - sc := -1 - if result.sgllr.Response.Response != nil { - sc = result.sgllr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listLogsNextResults - req, err := client.ListLogsPreparer(ctx, resourceGroupName, serverName, databaseName, syncGroupName, startTime, endTime, typeParameter, continuationToken) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncGroupsClient", "ListLogs", nil, "Failure preparing request") - return - } - - resp, err := client.ListLogsSender(req) - if err != nil { - result.sgllr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.SyncGroupsClient", "ListLogs", resp, "Failure sending request") - return - } - - result.sgllr, err = client.ListLogsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncGroupsClient", "ListLogs", resp, "Failure responding to request") - } - - return -} - -// ListLogsPreparer prepares the ListLogs request. -func (client SyncGroupsClient) ListLogsPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, startTime string, endTime string, typeParameter string, continuationToken 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), - "syncGroupName": autorest.Encode("path", syncGroupName), - } - - const APIVersion = "2015-05-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - "endTime": autorest.Encode("query", endTime), - "startTime": autorest.Encode("query", startTime), - "type": autorest.Encode("query", typeParameter), - } - if len(continuationToken) > 0 { - queryParameters["continuationToken"] = autorest.Encode("query", continuationToken) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/logs", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListLogsSender sends the ListLogs request. The method will close the -// http.Response Body if it receives an error. -func (client SyncGroupsClient) ListLogsSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListLogsResponder handles the response to the ListLogs request. The method always -// closes the http.Response Body. -func (client SyncGroupsClient) ListLogsResponder(resp *http.Response) (result SyncGroupLogListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listLogsNextResults retrieves the next set of results, if any. -func (client SyncGroupsClient) listLogsNextResults(ctx context.Context, lastResults SyncGroupLogListResult) (result SyncGroupLogListResult, err error) { - req, err := lastResults.syncGroupLogListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.SyncGroupsClient", "listLogsNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListLogsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "sql.SyncGroupsClient", "listLogsNextResults", resp, "Failure sending next results request") - } - result, err = client.ListLogsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncGroupsClient", "listLogsNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListLogsComplete enumerates all values, automatically crossing page boundaries as required. -func (client SyncGroupsClient) ListLogsComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, startTime string, endTime string, typeParameter string, continuationToken string) (result SyncGroupLogListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncGroupsClient.ListLogs") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListLogs(ctx, resourceGroupName, serverName, databaseName, syncGroupName, startTime, endTime, typeParameter, continuationToken) - return -} - -// ListSyncDatabaseIds gets a collection of sync database ids. -// Parameters: -// locationName - the name of the region where the resource is located. -func (client SyncGroupsClient) ListSyncDatabaseIds(ctx context.Context, locationName string) (result SyncDatabaseIDListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncGroupsClient.ListSyncDatabaseIds") - defer func() { - sc := -1 - if result.sdilr.Response.Response != nil { - sc = result.sdilr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listSyncDatabaseIdsNextResults - req, err := client.ListSyncDatabaseIdsPreparer(ctx, locationName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncGroupsClient", "ListSyncDatabaseIds", nil, "Failure preparing request") - return - } - - resp, err := client.ListSyncDatabaseIdsSender(req) - if err != nil { - result.sdilr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.SyncGroupsClient", "ListSyncDatabaseIds", resp, "Failure sending request") - return - } - - result.sdilr, err = client.ListSyncDatabaseIdsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncGroupsClient", "ListSyncDatabaseIds", resp, "Failure responding to request") - } - - return -} - -// ListSyncDatabaseIdsPreparer prepares the ListSyncDatabaseIds request. -func (client SyncGroupsClient) ListSyncDatabaseIdsPreparer(ctx context.Context, locationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "locationName": autorest.Encode("path", locationName), - "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}/providers/Microsoft.Sql/locations/{locationName}/syncDatabaseIds", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSyncDatabaseIdsSender sends the ListSyncDatabaseIds request. The method will close the -// http.Response Body if it receives an error. -func (client SyncGroupsClient) ListSyncDatabaseIdsSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListSyncDatabaseIdsResponder handles the response to the ListSyncDatabaseIds request. The method always -// closes the http.Response Body. -func (client SyncGroupsClient) ListSyncDatabaseIdsResponder(resp *http.Response) (result SyncDatabaseIDListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listSyncDatabaseIdsNextResults retrieves the next set of results, if any. -func (client SyncGroupsClient) listSyncDatabaseIdsNextResults(ctx context.Context, lastResults SyncDatabaseIDListResult) (result SyncDatabaseIDListResult, err error) { - req, err := lastResults.syncDatabaseIDListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.SyncGroupsClient", "listSyncDatabaseIdsNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSyncDatabaseIdsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "sql.SyncGroupsClient", "listSyncDatabaseIdsNextResults", resp, "Failure sending next results request") - } - result, err = client.ListSyncDatabaseIdsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncGroupsClient", "listSyncDatabaseIdsNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListSyncDatabaseIdsComplete enumerates all values, automatically crossing page boundaries as required. -func (client SyncGroupsClient) ListSyncDatabaseIdsComplete(ctx context.Context, locationName string) (result SyncDatabaseIDListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncGroupsClient.ListSyncDatabaseIds") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListSyncDatabaseIds(ctx, locationName) - return -} - -// RefreshHubSchema refreshes a hub database schema. -// 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 on which the sync group is hosted. -// syncGroupName - the name of the sync group. -func (client SyncGroupsClient) RefreshHubSchema(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result SyncGroupsRefreshHubSchemaFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncGroupsClient.RefreshHubSchema") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RefreshHubSchemaPreparer(ctx, resourceGroupName, serverName, databaseName, syncGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncGroupsClient", "RefreshHubSchema", nil, "Failure preparing request") - return - } - - result, err = client.RefreshHubSchemaSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncGroupsClient", "RefreshHubSchema", result.Response(), "Failure sending request") - return - } - - return -} - -// RefreshHubSchemaPreparer prepares the RefreshHubSchema request. -func (client SyncGroupsClient) RefreshHubSchemaPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName 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), - "syncGroupName": autorest.Encode("path", syncGroupName), - } - - const APIVersion = "2015-05-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.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/refreshHubSchema", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RefreshHubSchemaSender sends the RefreshHubSchema request. The method will close the -// http.Response Body if it receives an error. -func (client SyncGroupsClient) RefreshHubSchemaSender(req *http.Request) (future SyncGroupsRefreshHubSchemaFuture, 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 -} - -// RefreshHubSchemaResponder handles the response to the RefreshHubSchema request. The method always -// closes the http.Response Body. -func (client SyncGroupsClient) RefreshHubSchemaResponder(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 -} - -// TriggerSync triggers a sync group synchronization. -// 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 on which the sync group is hosted. -// syncGroupName - the name of the sync group. -func (client SyncGroupsClient) TriggerSync(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncGroupsClient.TriggerSync") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.TriggerSyncPreparer(ctx, resourceGroupName, serverName, databaseName, syncGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncGroupsClient", "TriggerSync", nil, "Failure preparing request") - return - } - - resp, err := client.TriggerSyncSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "sql.SyncGroupsClient", "TriggerSync", resp, "Failure sending request") - return - } - - result, err = client.TriggerSyncResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncGroupsClient", "TriggerSync", resp, "Failure responding to request") - } - - return -} - -// TriggerSyncPreparer prepares the TriggerSync request. -func (client SyncGroupsClient) TriggerSyncPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName 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), - "syncGroupName": autorest.Encode("path", syncGroupName), - } - - const APIVersion = "2015-05-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.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/triggerSync", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// TriggerSyncSender sends the TriggerSync request. The method will close the -// http.Response Body if it receives an error. -func (client SyncGroupsClient) TriggerSyncSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// TriggerSyncResponder handles the response to the TriggerSync request. The method always -// closes the http.Response Body. -func (client SyncGroupsClient) TriggerSyncResponder(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 sync group. -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -// serverName - the name of the server. -// databaseName - the name of the database on which the sync group is hosted. -// syncGroupName - the name of the sync group. -// parameters - the requested sync group resource state. -func (client SyncGroupsClient) Update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, parameters SyncGroup) (result SyncGroupsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncGroupsClient.Update") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, serverName, databaseName, syncGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncGroupsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncGroupsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client SyncGroupsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, parameters SyncGroup) (*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), - "syncGroupName": autorest.Encode("path", syncGroupName), - } - - const APIVersion = "2015-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.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}", 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 SyncGroupsClient) UpdateSender(req *http.Request) (future SyncGroupsUpdateFuture, 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 SyncGroupsClient) UpdateResponder(resp *http.Response) (result SyncGroup, 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/sql/mgmt/2018-06-15-preview/sql/syncmembers.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/syncmembers.go deleted file mode 100644 index 3bf30d6226c7..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/syncmembers.go +++ /dev/null @@ -1,709 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// SyncMembersClient is the the Azure SQL Database management API provides a RESTful set of web services that interact -// with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, and -// delete databases. -type SyncMembersClient struct { - BaseClient -} - -// NewSyncMembersClient creates an instance of the SyncMembersClient client. -func NewSyncMembersClient(subscriptionID string) SyncMembersClient { - return NewSyncMembersClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewSyncMembersClientWithBaseURI creates an instance of the SyncMembersClient client. -func NewSyncMembersClientWithBaseURI(baseURI string, subscriptionID string) SyncMembersClient { - return SyncMembersClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a sync member. -// 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 on which the sync group is hosted. -// syncGroupName - the name of the sync group on which the sync member is hosted. -// syncMemberName - the name of the sync member. -// parameters - the requested sync member resource state. -func (client SyncMembersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string, parameters SyncMember) (result SyncMembersCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncMembersClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncMembersClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncMembersClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client SyncMembersClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string, parameters SyncMember) (*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), - "syncGroupName": autorest.Encode("path", syncGroupName), - "syncMemberName": autorest.Encode("path", syncMemberName), - } - - const APIVersion = "2015-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.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}", 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 SyncMembersClient) CreateOrUpdateSender(req *http.Request) (future SyncMembersCreateOrUpdateFuture, 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 SyncMembersClient) CreateOrUpdateResponder(resp *http.Response) (result SyncMember, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a sync member. -// 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 on which the sync group is hosted. -// syncGroupName - the name of the sync group on which the sync member is hosted. -// syncMemberName - the name of the sync member. -func (client SyncMembersClient) Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string) (result SyncMembersDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncMembersClient.Delete") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncMembersClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncMembersClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client SyncMembersClient) DeletePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName 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), - "syncGroupName": autorest.Encode("path", syncGroupName), - "syncMemberName": autorest.Encode("path", syncMemberName), - } - - const APIVersion = "2015-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.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}", 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 SyncMembersClient) DeleteSender(req *http.Request) (future SyncMembersDeleteFuture, 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 SyncMembersClient) 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 sync member. -// 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 on which the sync group is hosted. -// syncGroupName - the name of the sync group on which the sync member is hosted. -// syncMemberName - the name of the sync member. -func (client SyncMembersClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string) (result SyncMember, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncMembersClient.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, serverName, databaseName, syncGroupName, syncMemberName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncMembersClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.SyncMembersClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncMembersClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client SyncMembersClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName 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), - "syncGroupName": autorest.Encode("path", syncGroupName), - "syncMemberName": autorest.Encode("path", syncMemberName), - } - - 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}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}", 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 SyncMembersClient) 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 SyncMembersClient) GetResponder(resp *http.Response) (result SyncMember, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListBySyncGroup lists sync members in the given sync group. -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -// serverName - the name of the server. -// databaseName - the name of the database on which the sync group is hosted. -// syncGroupName - the name of the sync group. -func (client SyncMembersClient) ListBySyncGroup(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result SyncMemberListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncMembersClient.ListBySyncGroup") - defer func() { - sc := -1 - if result.smlr.Response.Response != nil { - sc = result.smlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listBySyncGroupNextResults - req, err := client.ListBySyncGroupPreparer(ctx, resourceGroupName, serverName, databaseName, syncGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncMembersClient", "ListBySyncGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListBySyncGroupSender(req) - if err != nil { - result.smlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.SyncMembersClient", "ListBySyncGroup", resp, "Failure sending request") - return - } - - result.smlr, err = client.ListBySyncGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncMembersClient", "ListBySyncGroup", resp, "Failure responding to request") - } - - return -} - -// ListBySyncGroupPreparer prepares the ListBySyncGroup request. -func (client SyncMembersClient) ListBySyncGroupPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName 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), - "syncGroupName": autorest.Encode("path", syncGroupName), - } - - 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}/syncGroups/{syncGroupName}/syncMembers", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListBySyncGroupSender sends the ListBySyncGroup request. The method will close the -// http.Response Body if it receives an error. -func (client SyncMembersClient) ListBySyncGroupSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListBySyncGroupResponder handles the response to the ListBySyncGroup request. The method always -// closes the http.Response Body. -func (client SyncMembersClient) ListBySyncGroupResponder(resp *http.Response) (result SyncMemberListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listBySyncGroupNextResults retrieves the next set of results, if any. -func (client SyncMembersClient) listBySyncGroupNextResults(ctx context.Context, lastResults SyncMemberListResult) (result SyncMemberListResult, err error) { - req, err := lastResults.syncMemberListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.SyncMembersClient", "listBySyncGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListBySyncGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "sql.SyncMembersClient", "listBySyncGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListBySyncGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncMembersClient", "listBySyncGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListBySyncGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client SyncMembersClient) ListBySyncGroupComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result SyncMemberListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncMembersClient.ListBySyncGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListBySyncGroup(ctx, resourceGroupName, serverName, databaseName, syncGroupName) - return -} - -// ListMemberSchemas gets a sync member database schema. -// 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 on which the sync group is hosted. -// syncGroupName - the name of the sync group on which the sync member is hosted. -// syncMemberName - the name of the sync member. -func (client SyncMembersClient) ListMemberSchemas(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string) (result SyncFullSchemaPropertiesListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncMembersClient.ListMemberSchemas") - defer func() { - sc := -1 - if result.sfsplr.Response.Response != nil { - sc = result.sfsplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listMemberSchemasNextResults - req, err := client.ListMemberSchemasPreparer(ctx, resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncMembersClient", "ListMemberSchemas", nil, "Failure preparing request") - return - } - - resp, err := client.ListMemberSchemasSender(req) - if err != nil { - result.sfsplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.SyncMembersClient", "ListMemberSchemas", resp, "Failure sending request") - return - } - - result.sfsplr, err = client.ListMemberSchemasResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncMembersClient", "ListMemberSchemas", resp, "Failure responding to request") - } - - return -} - -// ListMemberSchemasPreparer prepares the ListMemberSchemas request. -func (client SyncMembersClient) ListMemberSchemasPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName 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), - "syncGroupName": autorest.Encode("path", syncGroupName), - "syncMemberName": autorest.Encode("path", syncMemberName), - } - - 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}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}/schemas", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListMemberSchemasSender sends the ListMemberSchemas request. The method will close the -// http.Response Body if it receives an error. -func (client SyncMembersClient) ListMemberSchemasSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListMemberSchemasResponder handles the response to the ListMemberSchemas request. The method always -// closes the http.Response Body. -func (client SyncMembersClient) ListMemberSchemasResponder(resp *http.Response) (result SyncFullSchemaPropertiesListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listMemberSchemasNextResults retrieves the next set of results, if any. -func (client SyncMembersClient) listMemberSchemasNextResults(ctx context.Context, lastResults SyncFullSchemaPropertiesListResult) (result SyncFullSchemaPropertiesListResult, err error) { - req, err := lastResults.syncFullSchemaPropertiesListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.SyncMembersClient", "listMemberSchemasNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListMemberSchemasSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "sql.SyncMembersClient", "listMemberSchemasNextResults", resp, "Failure sending next results request") - } - result, err = client.ListMemberSchemasResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncMembersClient", "listMemberSchemasNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListMemberSchemasComplete enumerates all values, automatically crossing page boundaries as required. -func (client SyncMembersClient) ListMemberSchemasComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string) (result SyncFullSchemaPropertiesListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncMembersClient.ListMemberSchemas") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListMemberSchemas(ctx, resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName) - return -} - -// RefreshMemberSchema refreshes a sync member database schema. -// 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 on which the sync group is hosted. -// syncGroupName - the name of the sync group on which the sync member is hosted. -// syncMemberName - the name of the sync member. -func (client SyncMembersClient) RefreshMemberSchema(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string) (result SyncMembersRefreshMemberSchemaFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncMembersClient.RefreshMemberSchema") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RefreshMemberSchemaPreparer(ctx, resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncMembersClient", "RefreshMemberSchema", nil, "Failure preparing request") - return - } - - result, err = client.RefreshMemberSchemaSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncMembersClient", "RefreshMemberSchema", result.Response(), "Failure sending request") - return - } - - return -} - -// RefreshMemberSchemaPreparer prepares the RefreshMemberSchema request. -func (client SyncMembersClient) RefreshMemberSchemaPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName 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), - "syncGroupName": autorest.Encode("path", syncGroupName), - "syncMemberName": autorest.Encode("path", syncMemberName), - } - - const APIVersion = "2015-05-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.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}/refreshSchema", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RefreshMemberSchemaSender sends the RefreshMemberSchema request. The method will close the -// http.Response Body if it receives an error. -func (client SyncMembersClient) RefreshMemberSchemaSender(req *http.Request) (future SyncMembersRefreshMemberSchemaFuture, 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 -} - -// RefreshMemberSchemaResponder handles the response to the RefreshMemberSchema request. The method always -// closes the http.Response Body. -func (client SyncMembersClient) RefreshMemberSchemaResponder(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 an existing sync member. -// 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 on which the sync group is hosted. -// syncGroupName - the name of the sync group on which the sync member is hosted. -// syncMemberName - the name of the sync member. -// parameters - the requested sync member resource state. -func (client SyncMembersClient) Update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string, parameters SyncMember) (result SyncMembersUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SyncMembersClient.Update") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncMembersClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.SyncMembersClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client SyncMembersClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string, parameters SyncMember) (*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), - "syncGroupName": autorest.Encode("path", syncGroupName), - "syncMemberName": autorest.Encode("path", syncMemberName), - } - - const APIVersion = "2015-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.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}", 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 SyncMembersClient) UpdateSender(req *http.Request) (future SyncMembersUpdateFuture, 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 SyncMembersClient) UpdateResponder(resp *http.Response) (result SyncMember, 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/sql/mgmt/2018-06-15-preview/sql/tdecertificates.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/tdecertificates.go deleted file mode 100644 index 0b0d20cbae93..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/tdecertificates.go +++ /dev/null @@ -1,131 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the 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" -) - -// TdeCertificatesClient is the the Azure SQL Database management API provides a RESTful set of web services that -// interact with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, -// and delete databases. -type TdeCertificatesClient struct { - BaseClient -} - -// NewTdeCertificatesClient creates an instance of the TdeCertificatesClient client. -func NewTdeCertificatesClient(subscriptionID string) TdeCertificatesClient { - return NewTdeCertificatesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewTdeCertificatesClientWithBaseURI creates an instance of the TdeCertificatesClient client. -func NewTdeCertificatesClientWithBaseURI(baseURI string, subscriptionID string) TdeCertificatesClient { - return TdeCertificatesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Create creates a TDE certificate for a given 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. -// parameters - the requested TDE certificate to be created or updated. -func (client TdeCertificatesClient) Create(ctx context.Context, resourceGroupName string, serverName string, parameters TdeCertificate) (result TdeCertificatesCreateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/TdeCertificatesClient.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.TdeCertificateProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.TdeCertificateProperties.PrivateBlob", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("sql.TdeCertificatesClient", "Create", err.Error()) - } - - req, err := client.CreatePreparer(ctx, resourceGroupName, serverName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.TdeCertificatesClient", "Create", nil, "Failure preparing request") - return - } - - result, err = client.CreateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.TdeCertificatesClient", "Create", result.Response(), "Failure sending request") - return - } - - return -} - -// CreatePreparer prepares the Create request. -func (client TdeCertificatesClient) CreatePreparer(ctx context.Context, resourceGroupName string, serverName string, parameters TdeCertificate) (*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-10-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.Sql/servers/{serverName}/tdeCertificates", 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 TdeCertificatesClient) CreateSender(req *http.Request) (future TdeCertificatesCreateFuture, 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 TdeCertificatesClient) CreateResponder(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/sql/mgmt/2018-06-15-preview/sql/transparentdataencryptionactivities.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/transparentdataencryptionactivities.go deleted file mode 100644 index 2c8c003fc3b7..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/transparentdataencryptionactivities.go +++ /dev/null @@ -1,126 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// TransparentDataEncryptionActivitiesClient is the the Azure SQL Database management API provides a RESTful set of web -// services that interact with Azure SQL Database services to manage your databases. The API enables you to create, -// retrieve, update, and delete databases. -type TransparentDataEncryptionActivitiesClient struct { - BaseClient -} - -// NewTransparentDataEncryptionActivitiesClient creates an instance of the TransparentDataEncryptionActivitiesClient -// client. -func NewTransparentDataEncryptionActivitiesClient(subscriptionID string) TransparentDataEncryptionActivitiesClient { - return NewTransparentDataEncryptionActivitiesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewTransparentDataEncryptionActivitiesClientWithBaseURI creates an instance of the -// TransparentDataEncryptionActivitiesClient client. -func NewTransparentDataEncryptionActivitiesClientWithBaseURI(baseURI string, subscriptionID string) TransparentDataEncryptionActivitiesClient { - return TransparentDataEncryptionActivitiesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// ListByConfiguration returns a database's transparent data encryption operation result. -// 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 for which the transparent data encryption applies. -func (client TransparentDataEncryptionActivitiesClient) ListByConfiguration(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result TransparentDataEncryptionActivityListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/TransparentDataEncryptionActivitiesClient.ListByConfiguration") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListByConfigurationPreparer(ctx, resourceGroupName, serverName, databaseName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.TransparentDataEncryptionActivitiesClient", "ListByConfiguration", nil, "Failure preparing request") - return - } - - resp, err := client.ListByConfigurationSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.TransparentDataEncryptionActivitiesClient", "ListByConfiguration", resp, "Failure sending request") - return - } - - result, err = client.ListByConfigurationResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.TransparentDataEncryptionActivitiesClient", "ListByConfiguration", resp, "Failure responding to request") - } - - return -} - -// ListByConfigurationPreparer prepares the ListByConfiguration request. -func (client TransparentDataEncryptionActivitiesClient) ListByConfigurationPreparer(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), - "transparentDataEncryptionName": autorest.Encode("path", "current"), - } - - const APIVersion = "2014-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.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{transparentDataEncryptionName}/operationResults", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByConfigurationSender sends the ListByConfiguration request. The method will close the -// http.Response Body if it receives an error. -func (client TransparentDataEncryptionActivitiesClient) ListByConfigurationSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByConfigurationResponder handles the response to the ListByConfiguration request. The method always -// closes the http.Response Body. -func (client TransparentDataEncryptionActivitiesClient) ListByConfigurationResponder(resp *http.Response) (result TransparentDataEncryptionActivityListResult, 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/sql/mgmt/2018-06-15-preview/sql/usages.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/usages.go deleted file mode 100644 index 86f2d3b92500..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/usages.go +++ /dev/null @@ -1,163 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// UsagesClient is the the Azure SQL Database management API provides a RESTful set of web services that interact with -// Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, and delete -// databases. -type UsagesClient struct { - BaseClient -} - -// NewUsagesClient creates an instance of the UsagesClient client. -func NewUsagesClient(subscriptionID string) UsagesClient { - return NewUsagesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewUsagesClientWithBaseURI creates an instance of the UsagesClient client. -func NewUsagesClientWithBaseURI(baseURI string, subscriptionID string) UsagesClient { - return UsagesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// ListByInstancePool gets all instance pool usage metrics -// 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. -// instancePoolName - the name of the instance pool to be retrieved. -// expandChildren - optional request parameter to include managed instance usages within the instance pool. -func (client UsagesClient) ListByInstancePool(ctx context.Context, resourceGroupName string, instancePoolName string, expandChildren *bool) (result UsageListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/UsagesClient.ListByInstancePool") - defer func() { - sc := -1 - if result.ulr.Response.Response != nil { - sc = result.ulr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByInstancePoolNextResults - req, err := client.ListByInstancePoolPreparer(ctx, resourceGroupName, instancePoolName, expandChildren) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.UsagesClient", "ListByInstancePool", nil, "Failure preparing request") - return - } - - resp, err := client.ListByInstancePoolSender(req) - if err != nil { - result.ulr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.UsagesClient", "ListByInstancePool", resp, "Failure sending request") - return - } - - result.ulr, err = client.ListByInstancePoolResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.UsagesClient", "ListByInstancePool", resp, "Failure responding to request") - } - - return -} - -// ListByInstancePoolPreparer prepares the ListByInstancePool request. -func (client UsagesClient) ListByInstancePoolPreparer(ctx context.Context, resourceGroupName string, instancePoolName string, expandChildren *bool) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instancePoolName": autorest.Encode("path", instancePoolName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if expandChildren != nil { - queryParameters["expandChildren"] = autorest.Encode("query", *expandChildren) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}/usages", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByInstancePoolSender sends the ListByInstancePool request. The method will close the -// http.Response Body if it receives an error. -func (client UsagesClient) ListByInstancePoolSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByInstancePoolResponder handles the response to the ListByInstancePool request. The method always -// closes the http.Response Body. -func (client UsagesClient) ListByInstancePoolResponder(resp *http.Response) (result UsageListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByInstancePoolNextResults retrieves the next set of results, if any. -func (client UsagesClient) listByInstancePoolNextResults(ctx context.Context, lastResults UsageListResult) (result UsageListResult, err error) { - req, err := lastResults.usageListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.UsagesClient", "listByInstancePoolNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByInstancePoolSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "sql.UsagesClient", "listByInstancePoolNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByInstancePoolResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.UsagesClient", "listByInstancePoolNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByInstancePoolComplete enumerates all values, automatically crossing page boundaries as required. -func (client UsagesClient) ListByInstancePoolComplete(ctx context.Context, resourceGroupName string, instancePoolName string, expandChildren *bool) (result UsageListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/UsagesClient.ListByInstancePool") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByInstancePool(ctx, resourceGroupName, instancePoolName, expandChildren) - return -} diff --git a/services/preview/sql/mgmt/2018-06-15-preview/sql/virtualclusters.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/virtualclusters.go deleted file mode 100644 index ffea75716e96..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/virtualclusters.go +++ /dev/null @@ -1,503 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// VirtualClustersClient is the the Azure SQL Database management API provides a RESTful set of web services that -// interact with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, -// and delete databases. -type VirtualClustersClient struct { - BaseClient -} - -// NewVirtualClustersClient creates an instance of the VirtualClustersClient client. -func NewVirtualClustersClient(subscriptionID string) VirtualClustersClient { - return NewVirtualClustersClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualClustersClientWithBaseURI creates an instance of the VirtualClustersClient client. -func NewVirtualClustersClientWithBaseURI(baseURI string, subscriptionID string) VirtualClustersClient { - return VirtualClustersClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Delete deletes a virtual cluster. -// 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. -// virtualClusterName - the name of the virtual cluster. -func (client VirtualClustersClient) Delete(ctx context.Context, resourceGroupName string, virtualClusterName string) (result VirtualClustersDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualClustersClient.Delete") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, virtualClusterName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.VirtualClustersClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.VirtualClustersClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualClustersClient) DeletePreparer(ctx context.Context, resourceGroupName string, virtualClusterName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualClusterName": autorest.Encode("path", virtualClusterName), - } - - const APIVersion = "2015-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.Sql/virtualClusters/{virtualClusterName}", 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 VirtualClustersClient) DeleteSender(req *http.Request) (future VirtualClustersDeleteFuture, 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 VirtualClustersClient) 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 virtual cluster. -// 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. -// virtualClusterName - the name of the virtual cluster. -func (client VirtualClustersClient) Get(ctx context.Context, resourceGroupName string, virtualClusterName string) (result VirtualCluster, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualClustersClient.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, virtualClusterName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.VirtualClustersClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.VirtualClustersClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.VirtualClustersClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualClustersClient) GetPreparer(ctx context.Context, resourceGroupName string, virtualClusterName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualClusterName": autorest.Encode("path", virtualClusterName), - } - - 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/virtualClusters/{virtualClusterName}", 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 VirtualClustersClient) 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 VirtualClustersClient) GetResponder(resp *http.Response) (result VirtualCluster, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets a list of all virtualClusters in the subscription. -func (client VirtualClustersClient) List(ctx context.Context) (result VirtualClusterListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualClustersClient.List") - defer func() { - sc := -1 - if result.vclr.Response.Response != nil { - sc = result.vclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.VirtualClustersClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.vclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.VirtualClustersClient", "List", resp, "Failure sending request") - return - } - - result.vclr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.VirtualClustersClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualClustersClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "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}/providers/Microsoft.Sql/virtualClusters", 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 VirtualClustersClient) 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 VirtualClustersClient) ListResponder(resp *http.Response) (result VirtualClusterListResult, 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 VirtualClustersClient) listNextResults(ctx context.Context, lastResults VirtualClusterListResult) (result VirtualClusterListResult, err error) { - req, err := lastResults.virtualClusterListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.VirtualClustersClient", "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, "sql.VirtualClustersClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.VirtualClustersClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualClustersClient) ListComplete(ctx context.Context) (result VirtualClusterListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualClustersClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup gets a list of virtual clusters in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -func (client VirtualClustersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result VirtualClusterListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualClustersClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.vclr.Response.Response != nil { - sc = result.vclr.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, "sql.VirtualClustersClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.vclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.VirtualClustersClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.vclr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.VirtualClustersClient", "ListByResourceGroup", resp, "Failure responding to request") - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client VirtualClustersClient) 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-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/virtualClusters", 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 VirtualClustersClient) 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 VirtualClustersClient) ListByResourceGroupResponder(resp *http.Response) (result VirtualClusterListResult, 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 VirtualClustersClient) listByResourceGroupNextResults(ctx context.Context, lastResults VirtualClusterListResult) (result VirtualClusterListResult, err error) { - req, err := lastResults.virtualClusterListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.VirtualClustersClient", "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, "sql.VirtualClustersClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.VirtualClustersClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualClustersClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result VirtualClusterListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualClustersClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// Update updates a virtual cluster. -// 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. -// virtualClusterName - the name of the virtual cluster. -// parameters - the requested managed instance resource state. -func (client VirtualClustersClient) Update(ctx context.Context, resourceGroupName string, virtualClusterName string, parameters VirtualClusterUpdate) (result VirtualClustersUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualClustersClient.Update") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, virtualClusterName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.VirtualClustersClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.VirtualClustersClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client VirtualClustersClient) UpdatePreparer(ctx context.Context, resourceGroupName string, virtualClusterName string, parameters VirtualClusterUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualClusterName": autorest.Encode("path", virtualClusterName), - } - - const APIVersion = "2015-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.Sql/virtualClusters/{virtualClusterName}", 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 VirtualClustersClient) UpdateSender(req *http.Request) (future VirtualClustersUpdateFuture, 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 VirtualClustersClient) UpdateResponder(resp *http.Response) (result VirtualCluster, 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/sql/mgmt/2018-06-15-preview/sql/virtualnetworkrules.go b/services/preview/sql/mgmt/2018-06-15-preview/sql/virtualnetworkrules.go deleted file mode 100644 index 492473c92165..000000000000 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/virtualnetworkrules.go +++ /dev/null @@ -1,409 +0,0 @@ -package sql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the 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" -) - -// VirtualNetworkRulesClient is the the Azure SQL Database management API provides a RESTful set of web services that -// interact with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, -// and delete databases. -type VirtualNetworkRulesClient struct { - BaseClient -} - -// NewVirtualNetworkRulesClient creates an instance of the VirtualNetworkRulesClient client. -func NewVirtualNetworkRulesClient(subscriptionID string) VirtualNetworkRulesClient { - return NewVirtualNetworkRulesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualNetworkRulesClientWithBaseURI creates an instance of the VirtualNetworkRulesClient client. -func NewVirtualNetworkRulesClientWithBaseURI(baseURI string, subscriptionID string) VirtualNetworkRulesClient { - return VirtualNetworkRulesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates an existing virtual network rule. -// 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. -// virtualNetworkRuleName - the name of the virtual network rule. -// parameters - the requested virtual Network Rule Resource state. -func (client VirtualNetworkRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, parameters VirtualNetworkRule) (result VirtualNetworkRulesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkRulesClient.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.VirtualNetworkRuleProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkRuleProperties.VirtualNetworkSubnetID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("sql.VirtualNetworkRulesClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, virtualNetworkRuleName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.VirtualNetworkRulesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.VirtualNetworkRulesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualNetworkRulesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, parameters VirtualNetworkRule) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkRuleName": autorest.Encode("path", virtualNetworkRuleName), - } - - const APIVersion = "2015-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.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}", 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 VirtualNetworkRulesClient) CreateOrUpdateSender(req *http.Request) (future VirtualNetworkRulesCreateOrUpdateFuture, 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 VirtualNetworkRulesClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualNetworkRule, 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 virtual network rule with the given name. -// 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. -// virtualNetworkRuleName - the name of the virtual network rule. -func (client VirtualNetworkRulesClient) Delete(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string) (result VirtualNetworkRulesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkRulesClient.Delete") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, virtualNetworkRuleName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.VirtualNetworkRulesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.VirtualNetworkRulesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualNetworkRulesClient) DeletePreparer(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkRuleName": autorest.Encode("path", virtualNetworkRuleName), - } - - const APIVersion = "2015-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.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}", 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 VirtualNetworkRulesClient) DeleteSender(req *http.Request) (future VirtualNetworkRulesDeleteFuture, 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 VirtualNetworkRulesClient) 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 virtual network rule. -// 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. -// virtualNetworkRuleName - the name of the virtual network rule. -func (client VirtualNetworkRulesClient) Get(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string) (result VirtualNetworkRule, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkRulesClient.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, serverName, virtualNetworkRuleName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.VirtualNetworkRulesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.VirtualNetworkRulesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.VirtualNetworkRulesClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualNetworkRulesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkRuleName": autorest.Encode("path", virtualNetworkRuleName), - } - - 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}/virtualNetworkRules/{virtualNetworkRuleName}", 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 VirtualNetworkRulesClient) 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 VirtualNetworkRulesClient) GetResponder(resp *http.Response) (result VirtualNetworkRule, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByServer gets a list of virtual network rules in 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 VirtualNetworkRulesClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result VirtualNetworkRuleListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkRulesClient.ListByServer") - defer func() { - sc := -1 - if result.vnrlr.Response.Response != nil { - sc = result.vnrlr.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.VirtualNetworkRulesClient", "ListByServer", nil, "Failure preparing request") - return - } - - resp, err := client.ListByServerSender(req) - if err != nil { - result.vnrlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.VirtualNetworkRulesClient", "ListByServer", resp, "Failure sending request") - return - } - - result.vnrlr, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.VirtualNetworkRulesClient", "ListByServer", resp, "Failure responding to request") - } - - return -} - -// ListByServerPreparer prepares the ListByServer request. -func (client VirtualNetworkRulesClient) 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 = "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}/virtualNetworkRules", 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 VirtualNetworkRulesClient) 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 VirtualNetworkRulesClient) ListByServerResponder(resp *http.Response) (result VirtualNetworkRuleListResult, 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 VirtualNetworkRulesClient) listByServerNextResults(ctx context.Context, lastResults VirtualNetworkRuleListResult) (result VirtualNetworkRuleListResult, err error) { - req, err := lastResults.virtualNetworkRuleListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.VirtualNetworkRulesClient", "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.VirtualNetworkRulesClient", "listByServerNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.VirtualNetworkRulesClient", "listByServerNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByServerComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualNetworkRulesClient) ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string) (result VirtualNetworkRuleListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkRulesClient.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/sqlvirtualmachine/mgmt/2017-03-01-preview/sqlvirtualmachine/models.go b/services/preview/sqlvirtualmachine/mgmt/2017-03-01-preview/sqlvirtualmachine/models.go index 95ed1722326a..2be41094dae8 100644 --- a/services/preview/sqlvirtualmachine/mgmt/2017-03-01-preview/sqlvirtualmachine/models.go +++ b/services/preview/sqlvirtualmachine/mgmt/2017-03-01-preview/sqlvirtualmachine/models.go @@ -272,6 +272,23 @@ func PossibleSQLWorkloadTypeValues() []SQLWorkloadType { return []SQLWorkloadType{DW, GENERAL, OLTP} } +// StorageWorkloadType enumerates the values for storage workload type. +type StorageWorkloadType string + +const ( + // StorageWorkloadTypeDW ... + StorageWorkloadTypeDW StorageWorkloadType = "DW" + // StorageWorkloadTypeGENERAL ... + StorageWorkloadTypeGENERAL StorageWorkloadType = "GENERAL" + // StorageWorkloadTypeOLTP ... + StorageWorkloadTypeOLTP StorageWorkloadType = "OLTP" +) + +// PossibleStorageWorkloadTypeValues returns an array of possible values for the StorageWorkloadType const type. +func PossibleStorageWorkloadTypeValues() []StorageWorkloadType { + return []StorageWorkloadType{StorageWorkloadTypeDW, StorageWorkloadTypeGENERAL, StorageWorkloadTypeOLTP} +} + // AdditionalFeaturesServerConfigurations additional SQL Server feature settings. type AdditionalFeaturesServerConfigurations struct { // IsRServicesEnabled - Enable or disable R services (SQL 2016 onwards). @@ -1348,6 +1365,8 @@ type Properties struct { KeyVaultCredentialSettings *KeyVaultCredentialSettings `json:"keyVaultCredentialSettings,omitempty"` // ServerConfigurationsManagementSettings - SQL Server configuration management settings. ServerConfigurationsManagementSettings *ServerConfigurationsManagementSettings `json:"serverConfigurationsManagementSettings,omitempty"` + // StorageConfigurationSettings - Storage Configuration Settings. + StorageConfigurationSettings *StorageConfigurationSettings `json:"storageConfigurationSettings,omitempty"` } // ProxyResource ARM proxy resource. @@ -1404,6 +1423,14 @@ type SQLConnectivityUpdateSettings struct { SQLAuthUpdatePassword *string `json:"sqlAuthUpdatePassword,omitempty"` } +// SQLStorageSettings set disk storage settings for SQL Server. +type SQLStorageSettings struct { + // Luns - Logical Unit Numbers for the disks. + Luns *[]int32 `json:"luns,omitempty"` + // DefaultFilePath - SQL Server default file path + DefaultFilePath *string `json:"defaultFilePath,omitempty"` +} + // SQLStorageUpdateSettings set disk storage settings for SQL Server. type SQLStorageUpdateSettings struct { // DiskCount - Virtual machine disk count. @@ -1616,6 +1643,20 @@ type SQLWorkloadTypeUpdateSettings struct { SQLWorkloadType SQLWorkloadType `json:"sqlWorkloadType,omitempty"` } +// StorageConfigurationSettings storage Configurations for SQL Data, Log and TempDb. +type StorageConfigurationSettings struct { + // SQLDataSettings - SQL Server Data Storage Settings. + SQLDataSettings *SQLStorageSettings `json:"sqlDataSettings,omitempty"` + // SQLLogSettings - SQL Server Log Storage Settings. + SQLLogSettings *SQLStorageSettings `json:"sqlLogSettings,omitempty"` + // SQLTempDbSettings - SQL Server TempDb Storage Settings. + SQLTempDbSettings *SQLStorageSettings `json:"sqlTempDbSettings,omitempty"` + // DiskConfigurationType - Disk configuration to apply to SQL Server. Possible values include: 'NEW', 'EXTEND', 'ADD' + DiskConfigurationType DiskConfigurationType `json:"diskConfigurationType,omitempty"` + // StorageWorkloadType - Storage workload type. Possible values include: 'StorageWorkloadTypeGENERAL', 'StorageWorkloadTypeOLTP', 'StorageWorkloadTypeDW' + StorageWorkloadType StorageWorkloadType `json:"storageWorkloadType,omitempty"` +} + // TrackedResource ARM tracked top level resource. type TrackedResource struct { // Location - Resource location. diff --git a/services/preview/sqlvirtualmachine/mgmt/2017-03-01-preview/sqlvirtualmachine/sqlvirtualmachineapi/interfaces.go b/services/preview/sqlvirtualmachine/mgmt/2017-03-01-preview/sqlvirtualmachine/sqlvirtualmachineapi/interfaces.go index 5b767f58666e..65cee379b0d0 100644 --- a/services/preview/sqlvirtualmachine/mgmt/2017-03-01-preview/sqlvirtualmachine/sqlvirtualmachineapi/interfaces.go +++ b/services/preview/sqlvirtualmachine/mgmt/2017-03-01-preview/sqlvirtualmachine/sqlvirtualmachineapi/interfaces.go @@ -58,6 +58,7 @@ type SQLVirtualMachinesClientAPI interface { Get(ctx context.Context, resourceGroupName string, SQLVirtualMachineName string, expand string) (result sqlvirtualmachine.SQLVirtualMachine, err error) List(ctx context.Context) (result sqlvirtualmachine.ListResultPage, err error) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result sqlvirtualmachine.ListResultPage, err error) + ListBySQLVMGroup(ctx context.Context, resourceGroupName string, SQLVirtualMachineGroupName string) (result sqlvirtualmachine.ListResultPage, err error) Update(ctx context.Context, resourceGroupName string, SQLVirtualMachineName string, parameters sqlvirtualmachine.Update) (result sqlvirtualmachine.SQLVirtualMachinesUpdateFutureType, err error) } diff --git a/services/preview/sqlvirtualmachine/mgmt/2017-03-01-preview/sqlvirtualmachine/sqlvirtualmachines.go b/services/preview/sqlvirtualmachine/mgmt/2017-03-01-preview/sqlvirtualmachine/sqlvirtualmachines.go index a7e6269dfccc..67d4e85ecac2 100644 --- a/services/preview/sqlvirtualmachine/mgmt/2017-03-01-preview/sqlvirtualmachine/sqlvirtualmachines.go +++ b/services/preview/sqlvirtualmachine/mgmt/2017-03-01-preview/sqlvirtualmachine/sqlvirtualmachines.go @@ -507,6 +507,122 @@ func (client SQLVirtualMachinesClient) ListByResourceGroupComplete(ctx context.C return } +// ListBySQLVMGroup gets the list of sql virtual machines in a SQL virtual machine group. +// Parameters: +// resourceGroupName - name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. +// SQLVirtualMachineGroupName - name of the SQL virtual machine group. +func (client SQLVirtualMachinesClient) ListBySQLVMGroup(ctx context.Context, resourceGroupName string, SQLVirtualMachineGroupName string) (result ListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLVirtualMachinesClient.ListBySQLVMGroup") + defer func() { + sc := -1 + if result.lr.Response.Response != nil { + sc = result.lr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listBySQLVMGroupNextResults + req, err := client.ListBySQLVMGroupPreparer(ctx, resourceGroupName, SQLVirtualMachineGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "sqlvirtualmachine.SQLVirtualMachinesClient", "ListBySQLVMGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySQLVMGroupSender(req) + if err != nil { + result.lr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sqlvirtualmachine.SQLVirtualMachinesClient", "ListBySQLVMGroup", resp, "Failure sending request") + return + } + + result.lr, err = client.ListBySQLVMGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sqlvirtualmachine.SQLVirtualMachinesClient", "ListBySQLVMGroup", resp, "Failure responding to request") + } + + return +} + +// ListBySQLVMGroupPreparer prepares the ListBySQLVMGroup request. +func (client SQLVirtualMachinesClient) ListBySQLVMGroupPreparer(ctx context.Context, resourceGroupName string, SQLVirtualMachineGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sqlVirtualMachineGroupName": autorest.Encode("path", SQLVirtualMachineGroupName), + "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.SqlVirtualMachine/sqlVirtualMachineGroups/{sqlVirtualMachineGroupName}/sqlVirtualMachines", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySQLVMGroupSender sends the ListBySQLVMGroup request. The method will close the +// http.Response Body if it receives an error. +func (client SQLVirtualMachinesClient) ListBySQLVMGroupSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListBySQLVMGroupResponder handles the response to the ListBySQLVMGroup request. The method always +// closes the http.Response Body. +func (client SQLVirtualMachinesClient) ListBySQLVMGroupResponder(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 +} + +// listBySQLVMGroupNextResults retrieves the next set of results, if any. +func (client SQLVirtualMachinesClient) listBySQLVMGroupNextResults(ctx context.Context, lastResults ListResult) (result ListResult, err error) { + req, err := lastResults.listResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "sqlvirtualmachine.SQLVirtualMachinesClient", "listBySQLVMGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySQLVMGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "sqlvirtualmachine.SQLVirtualMachinesClient", "listBySQLVMGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySQLVMGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sqlvirtualmachine.SQLVirtualMachinesClient", "listBySQLVMGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySQLVMGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client SQLVirtualMachinesClient) ListBySQLVMGroupComplete(ctx context.Context, resourceGroupName string, SQLVirtualMachineGroupName string) (result ListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLVirtualMachinesClient.ListBySQLVMGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListBySQLVMGroup(ctx, resourceGroupName, SQLVirtualMachineGroupName) + return +} + // Update updates a SQL virtual machine. // Parameters: // resourceGroupName - name of the resource group that contains the resource. You can obtain this value from diff --git a/services/recoveryservices/mgmt/2016-12-01/backup/backupapi/interfaces.go b/services/recoveryservices/mgmt/2016-12-01/backup/backupapi/interfaces.go index e4d3b8d1d244..151f504f7d2a 100644 --- a/services/recoveryservices/mgmt/2016-12-01/backup/backupapi/interfaces.go +++ b/services/recoveryservices/mgmt/2016-12-01/backup/backupapi/interfaces.go @@ -23,14 +23,6 @@ import ( "github.com/Azure/go-autorest/autorest" ) -// ResourceVaultConfigsClientAPI contains the set of methods on the ResourceVaultConfigsClient type. -type ResourceVaultConfigsClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string) (result backup.ResourceVaultConfigResource, err error) - Update(ctx context.Context, vaultName string, resourceGroupName string, parameters backup.ResourceVaultConfigResource) (result backup.ResourceVaultConfigResource, err error) -} - -var _ ResourceVaultConfigsClientAPI = (*backup.ResourceVaultConfigsClient)(nil) - // EnginesClientAPI contains the set of methods on the EnginesClient type. type EnginesClientAPI interface { Get(ctx context.Context, vaultName string, resourceGroupName string, backupEngineName string, filter string, skipToken string) (result backup.EngineBaseResource, err error) @@ -78,15 +70,6 @@ type ProtectionContainerOperationResultsClientAPI interface { var _ ProtectionContainerOperationResultsClientAPI = (*backup.ProtectionContainerOperationResultsClient)(nil) -// ProtectedItemsClientAPI contains the set of methods on the ProtectedItemsClient type. -type ProtectedItemsClientAPI interface { - CreateOrUpdate(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, parameters backup.ProtectedItemResource) (result backup.ProtectedItemResource, err error) - Delete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string) (result autorest.Response, err error) - Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (result backup.ProtectedItemResource, err error) -} - -var _ ProtectedItemsClientAPI = (*backup.ProtectedItemsClient)(nil) - // BackupsClientAPI contains the set of methods on the BackupsClient type. type BackupsClientAPI interface { Trigger(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, parameters backup.RequestResource) (result autorest.Response, err error) @@ -94,13 +77,6 @@ type BackupsClientAPI interface { var _ BackupsClientAPI = (*backup.BackupsClient)(nil) -// ProtectedItemOperationResultsClientAPI contains the set of methods on the ProtectedItemOperationResultsClient type. -type ProtectedItemOperationResultsClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, operationID string) (result backup.ProtectedItemResource, err error) -} - -var _ ProtectedItemOperationResultsClientAPI = (*backup.ProtectedItemOperationResultsClient)(nil) - // ProtectedItemOperationStatusesClientAPI contains the set of methods on the ProtectedItemOperationStatusesClient type. type ProtectedItemOperationStatusesClientAPI interface { Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, operationID string) (result backup.OperationStatus, err error) @@ -108,14 +84,6 @@ type ProtectedItemOperationStatusesClientAPI interface { var _ ProtectedItemOperationStatusesClientAPI = (*backup.ProtectedItemOperationStatusesClient)(nil) -// RecoveryPointsClientAPI contains the set of methods on the RecoveryPointsClient type. -type RecoveryPointsClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string) (result backup.RecoveryPointResource, err error) - List(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (result backup.RecoveryPointResourceListPage, err error) -} - -var _ RecoveryPointsClientAPI = (*backup.RecoveryPointsClient)(nil) - // ItemLevelRecoveryConnectionsClientAPI contains the set of methods on the ItemLevelRecoveryConnectionsClient type. type ItemLevelRecoveryConnectionsClientAPI interface { Provision(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, parameters backup.ILRRequestResource) (result autorest.Response, err error) @@ -124,27 +92,6 @@ type ItemLevelRecoveryConnectionsClientAPI interface { var _ ItemLevelRecoveryConnectionsClientAPI = (*backup.ItemLevelRecoveryConnectionsClient)(nil) -// RestoresClientAPI contains the set of methods on the RestoresClient type. -type RestoresClientAPI interface { - Trigger(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, parameters backup.RestoreRequestResource) (result autorest.Response, err error) -} - -var _ RestoresClientAPI = (*backup.RestoresClient)(nil) - -// JobCancellationsClientAPI contains the set of methods on the JobCancellationsClient type. -type JobCancellationsClientAPI interface { - Trigger(ctx context.Context, vaultName string, resourceGroupName string, jobName string) (result autorest.Response, err error) -} - -var _ JobCancellationsClientAPI = (*backup.JobCancellationsClient)(nil) - -// JobOperationResultsClientAPI contains the set of methods on the JobOperationResultsClient type. -type JobOperationResultsClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string, jobName string, operationID string) (result autorest.Response, err error) -} - -var _ JobOperationResultsClientAPI = (*backup.JobOperationResultsClient)(nil) - // OperationResultsClientAPI contains the set of methods on the OperationResultsClient type. type OperationResultsClientAPI interface { Get(ctx context.Context, vaultName string, resourceGroupName string, operationID string) (result autorest.Response, err error) @@ -161,20 +108,11 @@ var _ OperationStatusesClientAPI = (*backup.OperationStatusesClient)(nil) // ProtectionPoliciesClientAPI contains the set of methods on the ProtectionPoliciesClient type. type ProtectionPoliciesClientAPI interface { - CreateOrUpdate(ctx context.Context, vaultName string, resourceGroupName string, policyName string, parameters backup.ProtectionPolicyResource) (result backup.ProtectionPolicyResource, err error) Delete(ctx context.Context, vaultName string, resourceGroupName string, policyName string) (result autorest.Response, err error) - Get(ctx context.Context, vaultName string, resourceGroupName string, policyName string) (result backup.ProtectionPolicyResource, err error) } var _ ProtectionPoliciesClientAPI = (*backup.ProtectionPoliciesClient)(nil) -// ProtectionPolicyOperationResultsClientAPI contains the set of methods on the ProtectionPolicyOperationResultsClient type. -type ProtectionPolicyOperationResultsClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string, policyName string, operationID string) (result backup.ProtectionPolicyResource, err error) -} - -var _ ProtectionPolicyOperationResultsClientAPI = (*backup.ProtectionPolicyOperationResultsClient)(nil) - // ProtectionPolicyOperationStatusesClientAPI contains the set of methods on the ProtectionPolicyOperationStatusesClient type. type ProtectionPolicyOperationStatusesClientAPI interface { Get(ctx context.Context, vaultName string, resourceGroupName string, policyName string, operationID string) (result backup.OperationStatus, err error) diff --git a/services/recoveryservices/mgmt/2016-12-01/backup/jobcancellations.go b/services/recoveryservices/mgmt/2016-12-01/backup/jobcancellations.go deleted file mode 100644 index 9e6511d770f8..000000000000 --- a/services/recoveryservices/mgmt/2016-12-01/backup/jobcancellations.go +++ /dev/null @@ -1,120 +0,0 @@ -package backup - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// JobCancellationsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type JobCancellationsClient struct { - BaseClient -} - -// NewJobCancellationsClient creates an instance of the JobCancellationsClient client. -func NewJobCancellationsClient(subscriptionID string) JobCancellationsClient { - return NewJobCancellationsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewJobCancellationsClientWithBaseURI creates an instance of the JobCancellationsClient client. -func NewJobCancellationsClientWithBaseURI(baseURI string, subscriptionID string) JobCancellationsClient { - return JobCancellationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Trigger cancels a job. This is an asynchronous operation. To know the status of the cancellation, call -// GetCancelOperationResult API. -// Parameters: -// vaultName - the name of the recovery services vault. -// resourceGroupName - the name of the resource group where the recovery services vault is present. -// jobName - name of the job to cancel. -func (client JobCancellationsClient) Trigger(ctx context.Context, vaultName string, resourceGroupName string, jobName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobCancellationsClient.Trigger") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.TriggerPreparer(ctx, vaultName, resourceGroupName, jobName) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.JobCancellationsClient", "Trigger", nil, "Failure preparing request") - return - } - - resp, err := client.TriggerSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "backup.JobCancellationsClient", "Trigger", resp, "Failure sending request") - return - } - - result, err = client.TriggerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.JobCancellationsClient", "Trigger", resp, "Failure responding to request") - } - - return -} - -// TriggerPreparer prepares the Trigger request. -func (client JobCancellationsClient) TriggerPreparer(ctx context.Context, vaultName string, 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), - "vaultName": autorest.Encode("path", vaultName), - } - - const APIVersion = "2016-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.RecoveryServices/vaults/{vaultName}/backupJobs/{jobName}/cancel", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// TriggerSender sends the Trigger request. The method will close the -// http.Response Body if it receives an error. -func (client JobCancellationsClient) TriggerSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// TriggerResponder handles the response to the Trigger request. The method always -// closes the http.Response Body. -func (client JobCancellationsClient) TriggerResponder(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/recoveryservices/mgmt/2016-12-01/backup/joboperationresults.go b/services/recoveryservices/mgmt/2016-12-01/backup/joboperationresults.go deleted file mode 100644 index 2140da9fcca5..000000000000 --- a/services/recoveryservices/mgmt/2016-12-01/backup/joboperationresults.go +++ /dev/null @@ -1,122 +0,0 @@ -package backup - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// JobOperationResultsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type JobOperationResultsClient struct { - BaseClient -} - -// NewJobOperationResultsClient creates an instance of the JobOperationResultsClient client. -func NewJobOperationResultsClient(subscriptionID string) JobOperationResultsClient { - return NewJobOperationResultsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewJobOperationResultsClientWithBaseURI creates an instance of the JobOperationResultsClient client. -func NewJobOperationResultsClientWithBaseURI(baseURI string, subscriptionID string) JobOperationResultsClient { - return JobOperationResultsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get fetches the result of any operation. -// the operation. -// Parameters: -// vaultName - the name of the recovery services vault. -// resourceGroupName - the name of the resource group where the recovery services vault is present. -// jobName - job name whose operation result has to be fetched. -// operationID - operationID which represents the operation whose result has to be fetched. -func (client JobOperationResultsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, jobName string, operationID string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobOperationResultsClient.Get") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, vaultName, resourceGroupName, jobName, operationID) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.JobOperationResultsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "backup.JobOperationResultsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.JobOperationResultsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client JobOperationResultsClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, jobName string, operationID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobName": autorest.Encode("path", jobName), - "operationId": autorest.Encode("path", operationID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vaultName": autorest.Encode("path", vaultName), - } - - const APIVersion = "2016-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.RecoveryServices/vaults/{vaultName}/backupJobs/{jobName}/operationResults/{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 JobOperationResultsClient) 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 JobOperationResultsClient) GetResponder(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 -} diff --git a/services/recoveryservices/mgmt/2016-12-01/backup/models.go b/services/recoveryservices/mgmt/2016-12-01/backup/models.go index 9ce8a646a248..7afb064a654f 100644 --- a/services/recoveryservices/mgmt/2016-12-01/backup/models.go +++ b/services/recoveryservices/mgmt/2016-12-01/backup/models.go @@ -125,110 +125,6 @@ func PossibleContainerTypeBasicProtectionContainerValues() []ContainerTypeBasicP return []ContainerTypeBasicProtectionContainer{ContainerTypeAzureBackupServerContainer1, ContainerTypeAzureSQLContainer1, ContainerTypeAzureWorkloadContainer, ContainerTypeDPMContainer1, ContainerTypeGenericContainer1, ContainerTypeIaaSVMContainer, ContainerTypeMicrosoftClassicComputevirtualMachines, ContainerTypeMicrosoftComputevirtualMachines, ContainerTypeProtectionContainer, ContainerTypeSQLAGWorkLoadContainer1, ContainerTypeStorageContainer1, ContainerTypeVMAppContainer1, ContainerTypeWindows1} } -// CopyOptions enumerates the values for copy options. -type CopyOptions string - -const ( - // CopyOptionsCreateCopy ... - CopyOptionsCreateCopy CopyOptions = "CreateCopy" - // CopyOptionsFailOnConflict ... - CopyOptionsFailOnConflict CopyOptions = "FailOnConflict" - // CopyOptionsInvalid ... - CopyOptionsInvalid CopyOptions = "Invalid" - // CopyOptionsOverwrite ... - CopyOptionsOverwrite CopyOptions = "Overwrite" - // CopyOptionsSkip ... - CopyOptionsSkip CopyOptions = "Skip" -) - -// PossibleCopyOptionsValues returns an array of possible values for the CopyOptions const type. -func PossibleCopyOptionsValues() []CopyOptions { - return []CopyOptions{CopyOptionsCreateCopy, CopyOptionsFailOnConflict, CopyOptionsInvalid, CopyOptionsOverwrite, CopyOptionsSkip} -} - -// CreateMode enumerates the values for create mode. -type CreateMode string - -const ( - // CreateModeDefault ... - CreateModeDefault CreateMode = "Default" - // CreateModeInvalid ... - CreateModeInvalid CreateMode = "Invalid" - // CreateModeRecover ... - CreateModeRecover CreateMode = "Recover" -) - -// PossibleCreateModeValues returns an array of possible values for the CreateMode const type. -func PossibleCreateModeValues() []CreateMode { - return []CreateMode{CreateModeDefault, CreateModeInvalid, CreateModeRecover} -} - -// DataSourceType enumerates the values for data source type. -type DataSourceType string - -const ( - // DataSourceTypeAzureFileShare ... - DataSourceTypeAzureFileShare DataSourceType = "AzureFileShare" - // DataSourceTypeAzureSQLDb ... - DataSourceTypeAzureSQLDb DataSourceType = "AzureSqlDb" - // DataSourceTypeClient ... - DataSourceTypeClient DataSourceType = "Client" - // DataSourceTypeExchange ... - DataSourceTypeExchange DataSourceType = "Exchange" - // DataSourceTypeFileFolder ... - DataSourceTypeFileFolder DataSourceType = "FileFolder" - // DataSourceTypeGenericDataSource ... - DataSourceTypeGenericDataSource DataSourceType = "GenericDataSource" - // DataSourceTypeInvalid ... - DataSourceTypeInvalid DataSourceType = "Invalid" - // DataSourceTypeSAPAseDatabase ... - DataSourceTypeSAPAseDatabase DataSourceType = "SAPAseDatabase" - // DataSourceTypeSAPHanaDatabase ... - DataSourceTypeSAPHanaDatabase DataSourceType = "SAPHanaDatabase" - // DataSourceTypeSharepoint ... - DataSourceTypeSharepoint DataSourceType = "Sharepoint" - // DataSourceTypeSQLDataBase ... - DataSourceTypeSQLDataBase DataSourceType = "SQLDataBase" - // DataSourceTypeSQLDB ... - DataSourceTypeSQLDB DataSourceType = "SQLDB" - // DataSourceTypeSystemState ... - DataSourceTypeSystemState DataSourceType = "SystemState" - // DataSourceTypeVM ... - DataSourceTypeVM DataSourceType = "VM" - // DataSourceTypeVMwareVM ... - DataSourceTypeVMwareVM DataSourceType = "VMwareVM" -) - -// PossibleDataSourceTypeValues returns an array of possible values for the DataSourceType const type. -func PossibleDataSourceTypeValues() []DataSourceType { - return []DataSourceType{DataSourceTypeAzureFileShare, DataSourceTypeAzureSQLDb, DataSourceTypeClient, DataSourceTypeExchange, DataSourceTypeFileFolder, DataSourceTypeGenericDataSource, DataSourceTypeInvalid, DataSourceTypeSAPAseDatabase, DataSourceTypeSAPHanaDatabase, DataSourceTypeSharepoint, DataSourceTypeSQLDataBase, DataSourceTypeSQLDB, DataSourceTypeSystemState, DataSourceTypeVM, DataSourceTypeVMwareVM} -} - -// 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} -} - // EngineType enumerates the values for engine type. type EngineType string @@ -246,42 +142,6 @@ func PossibleEngineTypeValues() []EngineType { return []EngineType{BackupEngineTypeAzureBackupServerEngine, BackupEngineTypeBackupEngineBase, BackupEngineTypeDpmBackupEngine} } -// EnhancedSecurityState enumerates the values for enhanced security state. -type EnhancedSecurityState string - -const ( - // EnhancedSecurityStateDisabled ... - EnhancedSecurityStateDisabled EnhancedSecurityState = "Disabled" - // EnhancedSecurityStateEnabled ... - EnhancedSecurityStateEnabled EnhancedSecurityState = "Enabled" - // EnhancedSecurityStateInvalid ... - EnhancedSecurityStateInvalid EnhancedSecurityState = "Invalid" -) - -// PossibleEnhancedSecurityStateValues returns an array of possible values for the EnhancedSecurityState const type. -func PossibleEnhancedSecurityStateValues() []EnhancedSecurityState { - return []EnhancedSecurityState{EnhancedSecurityStateDisabled, EnhancedSecurityStateEnabled, EnhancedSecurityStateInvalid} -} - -// HealthStatus enumerates the values for health status. -type HealthStatus string - -const ( - // HealthStatusActionRequired ... - HealthStatusActionRequired HealthStatus = "ActionRequired" - // HealthStatusActionSuggested ... - HealthStatusActionSuggested HealthStatus = "ActionSuggested" - // HealthStatusInvalid ... - HealthStatusInvalid HealthStatus = "Invalid" - // HealthStatusPassed ... - HealthStatusPassed HealthStatus = "Passed" -) - -// PossibleHealthStatusValues returns an array of possible values for the HealthStatus const type. -func PossibleHealthStatusValues() []HealthStatus { - return []HealthStatus{HealthStatusActionRequired, HealthStatusActionSuggested, HealthStatusInvalid, HealthStatusPassed} -} - // InquiryStatus enumerates the values for inquiry status. type InquiryStatus string @@ -340,25 +200,6 @@ func PossibleItemTypeValues() []ItemType { return []ItemType{ItemTypeAzureFileShare, ItemTypeAzureSQLDb, ItemTypeClient, ItemTypeExchange, ItemTypeFileFolder, ItemTypeGenericDataSource, ItemTypeInvalid, ItemTypeSAPAseDatabase, ItemTypeSAPHanaDatabase, ItemTypeSharepoint, ItemTypeSQLDataBase, ItemTypeSQLDB, ItemTypeSystemState, ItemTypeVM, ItemTypeVMwareVM} } -// LastBackupStatus enumerates the values for last backup status. -type LastBackupStatus string - -const ( - // LastBackupStatusHealthy ... - LastBackupStatusHealthy LastBackupStatus = "Healthy" - // LastBackupStatusInvalid ... - LastBackupStatusInvalid LastBackupStatus = "Invalid" - // LastBackupStatusIRPending ... - LastBackupStatusIRPending LastBackupStatus = "IRPending" - // LastBackupStatusUnhealthy ... - LastBackupStatusUnhealthy LastBackupStatus = "Unhealthy" -) - -// PossibleLastBackupStatusValues returns an array of possible values for the LastBackupStatus const type. -func PossibleLastBackupStatusValues() []LastBackupStatus { - return []LastBackupStatus{LastBackupStatusHealthy, LastBackupStatusInvalid, LastBackupStatusIRPending, LastBackupStatusUnhealthy} -} - // ManagementType enumerates the values for management type. type ManagementType string @@ -388,68 +229,6 @@ func PossibleManagementTypeValues() []ManagementType { return []ManagementType{ManagementTypeAzureBackupServer, ManagementTypeAzureIaasVM, ManagementTypeAzureSQL, ManagementTypeAzureStorage, ManagementTypeAzureWorkload, ManagementTypeDefaultBackup, ManagementTypeDPM, ManagementTypeInvalid, ManagementTypeMAB} } -// ManagementTypeBasicProtectionPolicy enumerates the values for management type basic protection policy. -type ManagementTypeBasicProtectionPolicy string - -const ( - // BackupManagementTypeAzureIaasVM ... - BackupManagementTypeAzureIaasVM ManagementTypeBasicProtectionPolicy = "AzureIaasVM" - // BackupManagementTypeAzureSQL ... - BackupManagementTypeAzureSQL ManagementTypeBasicProtectionPolicy = "AzureSql" - // BackupManagementTypeAzureStorage ... - BackupManagementTypeAzureStorage ManagementTypeBasicProtectionPolicy = "AzureStorage" - // BackupManagementTypeAzureWorkload ... - BackupManagementTypeAzureWorkload ManagementTypeBasicProtectionPolicy = "AzureWorkload" - // BackupManagementTypeGenericProtectionPolicy ... - BackupManagementTypeGenericProtectionPolicy ManagementTypeBasicProtectionPolicy = "GenericProtectionPolicy" - // BackupManagementTypeMAB ... - BackupManagementTypeMAB ManagementTypeBasicProtectionPolicy = "MAB" - // BackupManagementTypeProtectionPolicy ... - BackupManagementTypeProtectionPolicy ManagementTypeBasicProtectionPolicy = "ProtectionPolicy" -) - -// PossibleManagementTypeBasicProtectionPolicyValues returns an array of possible values for the ManagementTypeBasicProtectionPolicy const type. -func PossibleManagementTypeBasicProtectionPolicyValues() []ManagementTypeBasicProtectionPolicy { - return []ManagementTypeBasicProtectionPolicy{BackupManagementTypeAzureIaasVM, BackupManagementTypeAzureSQL, BackupManagementTypeAzureStorage, BackupManagementTypeAzureWorkload, BackupManagementTypeGenericProtectionPolicy, BackupManagementTypeMAB, BackupManagementTypeProtectionPolicy} -} - -// MonthOfYear enumerates the values for month of year. -type MonthOfYear string - -const ( - // MonthOfYearApril ... - MonthOfYearApril MonthOfYear = "April" - // MonthOfYearAugust ... - MonthOfYearAugust MonthOfYear = "August" - // MonthOfYearDecember ... - MonthOfYearDecember MonthOfYear = "December" - // MonthOfYearFebruary ... - MonthOfYearFebruary MonthOfYear = "February" - // MonthOfYearInvalid ... - MonthOfYearInvalid MonthOfYear = "Invalid" - // MonthOfYearJanuary ... - MonthOfYearJanuary MonthOfYear = "January" - // MonthOfYearJuly ... - MonthOfYearJuly MonthOfYear = "July" - // MonthOfYearJune ... - MonthOfYearJune MonthOfYear = "June" - // MonthOfYearMarch ... - MonthOfYearMarch MonthOfYear = "March" - // MonthOfYearMay ... - MonthOfYearMay MonthOfYear = "May" - // MonthOfYearNovember ... - MonthOfYearNovember MonthOfYear = "November" - // MonthOfYearOctober ... - MonthOfYearOctober MonthOfYear = "October" - // MonthOfYearSeptember ... - MonthOfYearSeptember MonthOfYear = "September" -) - -// PossibleMonthOfYearValues returns an array of possible values for the MonthOfYear const type. -func PossibleMonthOfYearValues() []MonthOfYear { - return []MonthOfYear{MonthOfYearApril, MonthOfYearAugust, MonthOfYearDecember, MonthOfYearFebruary, MonthOfYearInvalid, MonthOfYearJanuary, MonthOfYearJuly, MonthOfYearJune, MonthOfYearMarch, MonthOfYearMay, MonthOfYearNovember, MonthOfYearOctober, MonthOfYearSeptember} -} - // ObjectType enumerates the values for object type. type ObjectType string @@ -473,6 +252,8 @@ func PossibleObjectTypeValues() []ObjectType { type ObjectTypeBasicILRRequest string const ( + // ObjectTypeAzureFileShareProvisionILRRequest ... + ObjectTypeAzureFileShareProvisionILRRequest ObjectTypeBasicILRRequest = "AzureFileShareProvisionILRRequest" // ObjectTypeIaasVMILRRegistrationRequest ... ObjectTypeIaasVMILRRegistrationRequest ObjectTypeBasicILRRequest = "IaasVMILRRegistrationRequest" // ObjectTypeILRRequest ... @@ -481,7 +262,7 @@ const ( // PossibleObjectTypeBasicILRRequestValues returns an array of possible values for the ObjectTypeBasicILRRequest const type. func PossibleObjectTypeBasicILRRequestValues() []ObjectTypeBasicILRRequest { - return []ObjectTypeBasicILRRequest{ObjectTypeIaasVMILRRegistrationRequest, ObjectTypeILRRequest} + return []ObjectTypeBasicILRRequest{ObjectTypeAzureFileShareProvisionILRRequest, ObjectTypeIaasVMILRRegistrationRequest, ObjectTypeILRRequest} } // ObjectTypeBasicOperationStatusExtendedInfo enumerates the values for object type basic operation status @@ -508,60 +289,13 @@ func PossibleObjectTypeBasicOperationStatusExtendedInfoValues() []ObjectTypeBasi type ObjectTypeBasicRecoveryPoint string const ( - // ObjectTypeAzureFileShareRecoveryPoint ... - ObjectTypeAzureFileShareRecoveryPoint ObjectTypeBasicRecoveryPoint = "AzureFileShareRecoveryPoint" - // ObjectTypeAzureWorkloadPointInTimeRecoveryPoint ... - ObjectTypeAzureWorkloadPointInTimeRecoveryPoint ObjectTypeBasicRecoveryPoint = "AzureWorkloadPointInTimeRecoveryPoint" - // ObjectTypeAzureWorkloadRecoveryPoint ... - ObjectTypeAzureWorkloadRecoveryPoint ObjectTypeBasicRecoveryPoint = "AzureWorkloadRecoveryPoint" - // ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint ... - ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint ObjectTypeBasicRecoveryPoint = "AzureWorkloadSAPHanaPointInTimeRecoveryPoint" - // ObjectTypeAzureWorkloadSAPHanaRecoveryPoint ... - ObjectTypeAzureWorkloadSAPHanaRecoveryPoint ObjectTypeBasicRecoveryPoint = "AzureWorkloadSAPHanaRecoveryPoint" - // ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint ... - ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint ObjectTypeBasicRecoveryPoint = "AzureWorkloadSQLPointInTimeRecoveryPoint" - // ObjectTypeAzureWorkloadSQLRecoveryPoint ... - ObjectTypeAzureWorkloadSQLRecoveryPoint ObjectTypeBasicRecoveryPoint = "AzureWorkloadSQLRecoveryPoint" - // ObjectTypeGenericRecoveryPoint ... - ObjectTypeGenericRecoveryPoint ObjectTypeBasicRecoveryPoint = "GenericRecoveryPoint" - // ObjectTypeIaasVMRecoveryPoint ... - ObjectTypeIaasVMRecoveryPoint ObjectTypeBasicRecoveryPoint = "IaasVMRecoveryPoint" // ObjectTypeRecoveryPoint ... ObjectTypeRecoveryPoint ObjectTypeBasicRecoveryPoint = "RecoveryPoint" ) // PossibleObjectTypeBasicRecoveryPointValues returns an array of possible values for the ObjectTypeBasicRecoveryPoint const type. func PossibleObjectTypeBasicRecoveryPointValues() []ObjectTypeBasicRecoveryPoint { - return []ObjectTypeBasicRecoveryPoint{ObjectTypeAzureFileShareRecoveryPoint, ObjectTypeAzureWorkloadPointInTimeRecoveryPoint, ObjectTypeAzureWorkloadRecoveryPoint, ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint, ObjectTypeAzureWorkloadSAPHanaRecoveryPoint, ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint, ObjectTypeAzureWorkloadSQLRecoveryPoint, ObjectTypeGenericRecoveryPoint, ObjectTypeIaasVMRecoveryPoint, ObjectTypeRecoveryPoint} -} - -// ObjectTypeBasicRestoreRequest enumerates the values for object type basic restore request. -type ObjectTypeBasicRestoreRequest string - -const ( - // ObjectTypeAzureFileShareRestoreRequest ... - ObjectTypeAzureFileShareRestoreRequest ObjectTypeBasicRestoreRequest = "AzureFileShareRestoreRequest" - // ObjectTypeAzureWorkloadPointInTimeRestoreRequest ... - ObjectTypeAzureWorkloadPointInTimeRestoreRequest ObjectTypeBasicRestoreRequest = "AzureWorkloadPointInTimeRestoreRequest" - // ObjectTypeAzureWorkloadRestoreRequest ... - ObjectTypeAzureWorkloadRestoreRequest ObjectTypeBasicRestoreRequest = "AzureWorkloadRestoreRequest" - // ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest ... - ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest ObjectTypeBasicRestoreRequest = "AzureWorkloadSAPHanaPointInTimeRestoreRequest" - // ObjectTypeAzureWorkloadSAPHanaRestoreRequest ... - ObjectTypeAzureWorkloadSAPHanaRestoreRequest ObjectTypeBasicRestoreRequest = "AzureWorkloadSAPHanaRestoreRequest" - // ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest ... - ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest ObjectTypeBasicRestoreRequest = "AzureWorkloadSQLPointInTimeRestoreRequest" - // ObjectTypeAzureWorkloadSQLRestoreRequest ... - ObjectTypeAzureWorkloadSQLRestoreRequest ObjectTypeBasicRestoreRequest = "AzureWorkloadSQLRestoreRequest" - // ObjectTypeIaasVMRestoreRequest ... - ObjectTypeIaasVMRestoreRequest ObjectTypeBasicRestoreRequest = "IaasVMRestoreRequest" - // ObjectTypeRestoreRequest ... - ObjectTypeRestoreRequest ObjectTypeBasicRestoreRequest = "RestoreRequest" -) - -// PossibleObjectTypeBasicRestoreRequestValues returns an array of possible values for the ObjectTypeBasicRestoreRequest const type. -func PossibleObjectTypeBasicRestoreRequestValues() []ObjectTypeBasicRestoreRequest { - return []ObjectTypeBasicRestoreRequest{ObjectTypeAzureFileShareRestoreRequest, ObjectTypeAzureWorkloadPointInTimeRestoreRequest, ObjectTypeAzureWorkloadRestoreRequest, ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest, ObjectTypeAzureWorkloadSAPHanaRestoreRequest, ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest, ObjectTypeAzureWorkloadSQLRestoreRequest, ObjectTypeIaasVMRestoreRequest, ObjectTypeRestoreRequest} + return []ObjectTypeBasicRecoveryPoint{ObjectTypeRecoveryPoint} } // OperationStatusValues enumerates the values for operation status values. @@ -602,44 +336,6 @@ func PossibleOperationTypeValues() []OperationType { return []OperationType{OperationTypeInvalid, OperationTypeRegister, OperationTypeReregister} } -// OverwriteOptions enumerates the values for overwrite options. -type OverwriteOptions string - -const ( - // OverwriteOptionsFailOnConflict ... - OverwriteOptionsFailOnConflict OverwriteOptions = "FailOnConflict" - // OverwriteOptionsInvalid ... - OverwriteOptionsInvalid OverwriteOptions = "Invalid" - // OverwriteOptionsOverwrite ... - OverwriteOptionsOverwrite OverwriteOptions = "Overwrite" -) - -// PossibleOverwriteOptionsValues returns an array of possible values for the OverwriteOptions const type. -func PossibleOverwriteOptionsValues() []OverwriteOptions { - return []OverwriteOptions{OverwriteOptionsFailOnConflict, OverwriteOptionsInvalid, OverwriteOptionsOverwrite} -} - -// PolicyType enumerates the values for policy type. -type PolicyType string - -const ( - // PolicyTypeCopyOnlyFull ... - PolicyTypeCopyOnlyFull PolicyType = "CopyOnlyFull" - // PolicyTypeDifferential ... - PolicyTypeDifferential PolicyType = "Differential" - // PolicyTypeFull ... - PolicyTypeFull PolicyType = "Full" - // PolicyTypeInvalid ... - PolicyTypeInvalid PolicyType = "Invalid" - // PolicyTypeLog ... - PolicyTypeLog PolicyType = "Log" -) - -// PossiblePolicyTypeValues returns an array of possible values for the PolicyType const type. -func PossiblePolicyTypeValues() []PolicyType { - return []PolicyType{PolicyTypeCopyOnlyFull, PolicyTypeDifferential, PolicyTypeFull, PolicyTypeInvalid, PolicyTypeLog} -} - // ProtectableContainerType enumerates the values for protectable container type. type ProtectableContainerType string @@ -671,8 +367,6 @@ const ( ProtectableItemTypeMicrosoftClassicComputevirtualMachines ProtectableItemType = "Microsoft.ClassicCompute/virtualMachines" // ProtectableItemTypeMicrosoftComputevirtualMachines ... ProtectableItemTypeMicrosoftComputevirtualMachines ProtectableItemType = "Microsoft.Compute/virtualMachines" - // ProtectableItemTypeSAPAseDatabase ... - ProtectableItemTypeSAPAseDatabase ProtectableItemType = "SAPAseDatabase" // ProtectableItemTypeSAPAseSystem ... ProtectableItemTypeSAPAseSystem ProtectableItemType = "SAPAseSystem" // ProtectableItemTypeSAPHanaDatabase ... @@ -691,111 +385,7 @@ const ( // PossibleProtectableItemTypeValues returns an array of possible values for the ProtectableItemType const type. func PossibleProtectableItemTypeValues() []ProtectableItemType { - return []ProtectableItemType{ProtectableItemTypeAzureFileShare, ProtectableItemTypeAzureVMWorkloadProtectableItem, ProtectableItemTypeIaaSVMProtectableItem, ProtectableItemTypeMicrosoftClassicComputevirtualMachines, ProtectableItemTypeMicrosoftComputevirtualMachines, ProtectableItemTypeSAPAseDatabase, ProtectableItemTypeSAPAseSystem, ProtectableItemTypeSAPHanaDatabase, ProtectableItemTypeSAPHanaSystem, ProtectableItemTypeSQLAvailabilityGroupContainer, ProtectableItemTypeSQLDataBase, ProtectableItemTypeSQLInstance, ProtectableItemTypeWorkloadProtectableItem} -} - -// ProtectedItemHealthStatus enumerates the values for protected item health status. -type ProtectedItemHealthStatus string - -const ( - // ProtectedItemHealthStatusHealthy ... - ProtectedItemHealthStatusHealthy ProtectedItemHealthStatus = "Healthy" - // ProtectedItemHealthStatusInvalid ... - ProtectedItemHealthStatusInvalid ProtectedItemHealthStatus = "Invalid" - // ProtectedItemHealthStatusIRPending ... - ProtectedItemHealthStatusIRPending ProtectedItemHealthStatus = "IRPending" - // ProtectedItemHealthStatusNotReachable ... - ProtectedItemHealthStatusNotReachable ProtectedItemHealthStatus = "NotReachable" - // ProtectedItemHealthStatusUnhealthy ... - ProtectedItemHealthStatusUnhealthy ProtectedItemHealthStatus = "Unhealthy" -) - -// PossibleProtectedItemHealthStatusValues returns an array of possible values for the ProtectedItemHealthStatus const type. -func PossibleProtectedItemHealthStatusValues() []ProtectedItemHealthStatus { - return []ProtectedItemHealthStatus{ProtectedItemHealthStatusHealthy, ProtectedItemHealthStatusInvalid, ProtectedItemHealthStatusIRPending, ProtectedItemHealthStatusNotReachable, ProtectedItemHealthStatusUnhealthy} -} - -// ProtectedItemState enumerates the values for protected item state. -type ProtectedItemState string - -const ( - // ProtectedItemStateInvalid ... - ProtectedItemStateInvalid ProtectedItemState = "Invalid" - // ProtectedItemStateIRPending ... - ProtectedItemStateIRPending ProtectedItemState = "IRPending" - // ProtectedItemStateProtected ... - ProtectedItemStateProtected ProtectedItemState = "Protected" - // ProtectedItemStateProtectionError ... - ProtectedItemStateProtectionError ProtectedItemState = "ProtectionError" - // ProtectedItemStateProtectionPaused ... - ProtectedItemStateProtectionPaused ProtectedItemState = "ProtectionPaused" - // ProtectedItemStateProtectionStopped ... - ProtectedItemStateProtectionStopped ProtectedItemState = "ProtectionStopped" -) - -// PossibleProtectedItemStateValues returns an array of possible values for the ProtectedItemState const type. -func PossibleProtectedItemStateValues() []ProtectedItemState { - return []ProtectedItemState{ProtectedItemStateInvalid, ProtectedItemStateIRPending, ProtectedItemStateProtected, ProtectedItemStateProtectionError, ProtectedItemStateProtectionPaused, ProtectedItemStateProtectionStopped} -} - -// ProtectedItemType enumerates the values for protected item type. -type ProtectedItemType string - -const ( - // ProtectedItemTypeAzureFileShareProtectedItem ... - ProtectedItemTypeAzureFileShareProtectedItem ProtectedItemType = "AzureFileShareProtectedItem" - // ProtectedItemTypeAzureIaaSVMProtectedItem ... - ProtectedItemTypeAzureIaaSVMProtectedItem ProtectedItemType = "AzureIaaSVMProtectedItem" - // ProtectedItemTypeAzureVMWorkloadProtectedItem ... - ProtectedItemTypeAzureVMWorkloadProtectedItem ProtectedItemType = "AzureVmWorkloadProtectedItem" - // ProtectedItemTypeAzureVMWorkloadSAPAseDatabase ... - ProtectedItemTypeAzureVMWorkloadSAPAseDatabase ProtectedItemType = "AzureVmWorkloadSAPAseDatabase" - // ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase ... - ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase ProtectedItemType = "AzureVmWorkloadSAPHanaDatabase" - // ProtectedItemTypeAzureVMWorkloadSQLDatabase ... - ProtectedItemTypeAzureVMWorkloadSQLDatabase ProtectedItemType = "AzureVmWorkloadSQLDatabase" - // ProtectedItemTypeDPMProtectedItem ... - ProtectedItemTypeDPMProtectedItem ProtectedItemType = "DPMProtectedItem" - // ProtectedItemTypeGenericProtectedItem ... - ProtectedItemTypeGenericProtectedItem ProtectedItemType = "GenericProtectedItem" - // ProtectedItemTypeMabFileFolderProtectedItem ... - ProtectedItemTypeMabFileFolderProtectedItem ProtectedItemType = "MabFileFolderProtectedItem" - // ProtectedItemTypeMicrosoftClassicComputevirtualMachines ... - ProtectedItemTypeMicrosoftClassicComputevirtualMachines ProtectedItemType = "Microsoft.ClassicCompute/virtualMachines" - // ProtectedItemTypeMicrosoftComputevirtualMachines ... - ProtectedItemTypeMicrosoftComputevirtualMachines ProtectedItemType = "Microsoft.Compute/virtualMachines" - // ProtectedItemTypeMicrosoftSqlserversdatabases ... - ProtectedItemTypeMicrosoftSqlserversdatabases ProtectedItemType = "Microsoft.Sql/servers/databases" - // ProtectedItemTypeProtectedItem ... - ProtectedItemTypeProtectedItem ProtectedItemType = "ProtectedItem" -) - -// PossibleProtectedItemTypeValues returns an array of possible values for the ProtectedItemType const type. -func PossibleProtectedItemTypeValues() []ProtectedItemType { - return []ProtectedItemType{ProtectedItemTypeAzureFileShareProtectedItem, ProtectedItemTypeAzureIaaSVMProtectedItem, ProtectedItemTypeAzureVMWorkloadProtectedItem, ProtectedItemTypeAzureVMWorkloadSAPAseDatabase, ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase, ProtectedItemTypeAzureVMWorkloadSQLDatabase, ProtectedItemTypeDPMProtectedItem, ProtectedItemTypeGenericProtectedItem, ProtectedItemTypeMabFileFolderProtectedItem, ProtectedItemTypeMicrosoftClassicComputevirtualMachines, ProtectedItemTypeMicrosoftComputevirtualMachines, ProtectedItemTypeMicrosoftSqlserversdatabases, ProtectedItemTypeProtectedItem} -} - -// ProtectionState enumerates the values for protection state. -type ProtectionState string - -const ( - // ProtectionStateInvalid ... - ProtectionStateInvalid ProtectionState = "Invalid" - // ProtectionStateIRPending ... - ProtectionStateIRPending ProtectionState = "IRPending" - // ProtectionStateProtected ... - ProtectionStateProtected ProtectionState = "Protected" - // ProtectionStateProtectionError ... - ProtectionStateProtectionError ProtectionState = "ProtectionError" - // ProtectionStateProtectionPaused ... - ProtectionStateProtectionPaused ProtectionState = "ProtectionPaused" - // ProtectionStateProtectionStopped ... - ProtectionStateProtectionStopped ProtectionState = "ProtectionStopped" -) - -// PossibleProtectionStateValues returns an array of possible values for the ProtectionState const type. -func PossibleProtectionStateValues() []ProtectionState { - return []ProtectionState{ProtectionStateInvalid, ProtectionStateIRPending, ProtectionStateProtected, ProtectionStateProtectionError, ProtectionStateProtectionPaused, ProtectionStateProtectionStopped} + return []ProtectableItemType{ProtectableItemTypeAzureFileShare, ProtectableItemTypeAzureVMWorkloadProtectableItem, ProtectableItemTypeIaaSVMProtectableItem, ProtectableItemTypeMicrosoftClassicComputevirtualMachines, ProtectableItemTypeMicrosoftComputevirtualMachines, ProtectableItemTypeSAPAseSystem, ProtectableItemTypeSAPHanaDatabase, ProtectableItemTypeSAPHanaSystem, ProtectableItemTypeSQLAvailabilityGroupContainer, ProtectableItemTypeSQLDataBase, ProtectableItemTypeSQLInstance, ProtectableItemTypeWorkloadProtectableItem} } // ProtectionStatus enumerates the values for protection status. @@ -819,211 +409,6 @@ func PossibleProtectionStatusValues() []ProtectionStatus { return []ProtectionStatus{ProtectionStatusInvalid, ProtectionStatusNotProtected, ProtectionStatusProtected, ProtectionStatusProtecting, ProtectionStatusProtectionFailed} } -// RecoveryPointTierStatus enumerates the values for recovery point tier status. -type RecoveryPointTierStatus string - -const ( - // RecoveryPointTierStatusDeleted ... - RecoveryPointTierStatusDeleted RecoveryPointTierStatus = "Deleted" - // RecoveryPointTierStatusDisabled ... - RecoveryPointTierStatusDisabled RecoveryPointTierStatus = "Disabled" - // RecoveryPointTierStatusInvalid ... - RecoveryPointTierStatusInvalid RecoveryPointTierStatus = "Invalid" - // RecoveryPointTierStatusValid ... - RecoveryPointTierStatusValid RecoveryPointTierStatus = "Valid" -) - -// PossibleRecoveryPointTierStatusValues returns an array of possible values for the RecoveryPointTierStatus const type. -func PossibleRecoveryPointTierStatusValues() []RecoveryPointTierStatus { - return []RecoveryPointTierStatus{RecoveryPointTierStatusDeleted, RecoveryPointTierStatusDisabled, RecoveryPointTierStatusInvalid, RecoveryPointTierStatusValid} -} - -// RecoveryPointTierType enumerates the values for recovery point tier type. -type RecoveryPointTierType string - -const ( - // RecoveryPointTierTypeHardenedRP ... - RecoveryPointTierTypeHardenedRP RecoveryPointTierType = "HardenedRP" - // RecoveryPointTierTypeInstantRP ... - RecoveryPointTierTypeInstantRP RecoveryPointTierType = "InstantRP" - // RecoveryPointTierTypeInvalid ... - RecoveryPointTierTypeInvalid RecoveryPointTierType = "Invalid" -) - -// PossibleRecoveryPointTierTypeValues returns an array of possible values for the RecoveryPointTierType const type. -func PossibleRecoveryPointTierTypeValues() []RecoveryPointTierType { - return []RecoveryPointTierType{RecoveryPointTierTypeHardenedRP, RecoveryPointTierTypeInstantRP, RecoveryPointTierTypeInvalid} -} - -// RecoveryType enumerates the values for recovery type. -type RecoveryType string - -const ( - // RecoveryTypeAlternateLocation ... - RecoveryTypeAlternateLocation RecoveryType = "AlternateLocation" - // RecoveryTypeInvalid ... - RecoveryTypeInvalid RecoveryType = "Invalid" - // RecoveryTypeOriginalLocation ... - RecoveryTypeOriginalLocation RecoveryType = "OriginalLocation" - // RecoveryTypeRestoreDisks ... - RecoveryTypeRestoreDisks RecoveryType = "RestoreDisks" -) - -// PossibleRecoveryTypeValues returns an array of possible values for the RecoveryType const type. -func PossibleRecoveryTypeValues() []RecoveryType { - return []RecoveryType{RecoveryTypeAlternateLocation, RecoveryTypeInvalid, RecoveryTypeOriginalLocation, RecoveryTypeRestoreDisks} -} - -// RestorePointQueryType enumerates the values for restore point query type. -type RestorePointQueryType string - -const ( - // RestorePointQueryTypeAll ... - RestorePointQueryTypeAll RestorePointQueryType = "All" - // RestorePointQueryTypeDifferential ... - RestorePointQueryTypeDifferential RestorePointQueryType = "Differential" - // RestorePointQueryTypeFull ... - RestorePointQueryTypeFull RestorePointQueryType = "Full" - // RestorePointQueryTypeFullAndDifferential ... - RestorePointQueryTypeFullAndDifferential RestorePointQueryType = "FullAndDifferential" - // RestorePointQueryTypeInvalid ... - RestorePointQueryTypeInvalid RestorePointQueryType = "Invalid" - // RestorePointQueryTypeLog ... - RestorePointQueryTypeLog RestorePointQueryType = "Log" -) - -// PossibleRestorePointQueryTypeValues returns an array of possible values for the RestorePointQueryType const type. -func PossibleRestorePointQueryTypeValues() []RestorePointQueryType { - return []RestorePointQueryType{RestorePointQueryTypeAll, RestorePointQueryTypeDifferential, RestorePointQueryTypeFull, RestorePointQueryTypeFullAndDifferential, RestorePointQueryTypeInvalid, RestorePointQueryTypeLog} -} - -// RestorePointType enumerates the values for restore point type. -type RestorePointType string - -const ( - // RestorePointTypeDifferential ... - RestorePointTypeDifferential RestorePointType = "Differential" - // RestorePointTypeFull ... - RestorePointTypeFull RestorePointType = "Full" - // RestorePointTypeInvalid ... - RestorePointTypeInvalid RestorePointType = "Invalid" - // RestorePointTypeLog ... - RestorePointTypeLog RestorePointType = "Log" -) - -// PossibleRestorePointTypeValues returns an array of possible values for the RestorePointType const type. -func PossibleRestorePointTypeValues() []RestorePointType { - return []RestorePointType{RestorePointTypeDifferential, RestorePointTypeFull, RestorePointTypeInvalid, RestorePointTypeLog} -} - -// RestoreRequestType enumerates the values for restore request type. -type RestoreRequestType string - -const ( - // RestoreRequestTypeFullShareRestore ... - RestoreRequestTypeFullShareRestore RestoreRequestType = "FullShareRestore" - // RestoreRequestTypeInvalid ... - RestoreRequestTypeInvalid RestoreRequestType = "Invalid" - // RestoreRequestTypeItemLevelRestore ... - RestoreRequestTypeItemLevelRestore RestoreRequestType = "ItemLevelRestore" -) - -// PossibleRestoreRequestTypeValues returns an array of possible values for the RestoreRequestType const type. -func PossibleRestoreRequestTypeValues() []RestoreRequestType { - return []RestoreRequestType{RestoreRequestTypeFullShareRestore, RestoreRequestTypeInvalid, RestoreRequestTypeItemLevelRestore} -} - -// RetentionDurationType enumerates the values for retention duration type. -type RetentionDurationType string - -const ( - // RetentionDurationTypeDays ... - RetentionDurationTypeDays RetentionDurationType = "Days" - // RetentionDurationTypeInvalid ... - RetentionDurationTypeInvalid RetentionDurationType = "Invalid" - // RetentionDurationTypeMonths ... - RetentionDurationTypeMonths RetentionDurationType = "Months" - // RetentionDurationTypeWeeks ... - RetentionDurationTypeWeeks RetentionDurationType = "Weeks" - // RetentionDurationTypeYears ... - RetentionDurationTypeYears RetentionDurationType = "Years" -) - -// PossibleRetentionDurationTypeValues returns an array of possible values for the RetentionDurationType const type. -func PossibleRetentionDurationTypeValues() []RetentionDurationType { - return []RetentionDurationType{RetentionDurationTypeDays, RetentionDurationTypeInvalid, RetentionDurationTypeMonths, RetentionDurationTypeWeeks, RetentionDurationTypeYears} -} - -// RetentionPolicyType enumerates the values for retention policy type. -type RetentionPolicyType string - -const ( - // RetentionPolicyTypeLongTermRetentionPolicy ... - RetentionPolicyTypeLongTermRetentionPolicy RetentionPolicyType = "LongTermRetentionPolicy" - // RetentionPolicyTypeRetentionPolicy ... - RetentionPolicyTypeRetentionPolicy RetentionPolicyType = "RetentionPolicy" - // RetentionPolicyTypeSimpleRetentionPolicy ... - RetentionPolicyTypeSimpleRetentionPolicy RetentionPolicyType = "SimpleRetentionPolicy" -) - -// PossibleRetentionPolicyTypeValues returns an array of possible values for the RetentionPolicyType const type. -func PossibleRetentionPolicyTypeValues() []RetentionPolicyType { - return []RetentionPolicyType{RetentionPolicyTypeLongTermRetentionPolicy, RetentionPolicyTypeRetentionPolicy, RetentionPolicyTypeSimpleRetentionPolicy} -} - -// RetentionScheduleFormat enumerates the values for retention schedule format. -type RetentionScheduleFormat string - -const ( - // RetentionScheduleFormatDaily ... - RetentionScheduleFormatDaily RetentionScheduleFormat = "Daily" - // RetentionScheduleFormatInvalid ... - RetentionScheduleFormatInvalid RetentionScheduleFormat = "Invalid" - // RetentionScheduleFormatWeekly ... - RetentionScheduleFormatWeekly RetentionScheduleFormat = "Weekly" -) - -// PossibleRetentionScheduleFormatValues returns an array of possible values for the RetentionScheduleFormat const type. -func PossibleRetentionScheduleFormatValues() []RetentionScheduleFormat { - return []RetentionScheduleFormat{RetentionScheduleFormatDaily, RetentionScheduleFormatInvalid, RetentionScheduleFormatWeekly} -} - -// SchedulePolicyType enumerates the values for schedule policy type. -type SchedulePolicyType string - -const ( - // SchedulePolicyTypeLogSchedulePolicy ... - SchedulePolicyTypeLogSchedulePolicy SchedulePolicyType = "LogSchedulePolicy" - // SchedulePolicyTypeLongTermSchedulePolicy ... - SchedulePolicyTypeLongTermSchedulePolicy SchedulePolicyType = "LongTermSchedulePolicy" - // SchedulePolicyTypeSchedulePolicy ... - SchedulePolicyTypeSchedulePolicy SchedulePolicyType = "SchedulePolicy" - // SchedulePolicyTypeSimpleSchedulePolicy ... - SchedulePolicyTypeSimpleSchedulePolicy SchedulePolicyType = "SimpleSchedulePolicy" -) - -// PossibleSchedulePolicyTypeValues returns an array of possible values for the SchedulePolicyType const type. -func PossibleSchedulePolicyTypeValues() []SchedulePolicyType { - return []SchedulePolicyType{SchedulePolicyTypeLogSchedulePolicy, SchedulePolicyTypeLongTermSchedulePolicy, SchedulePolicyTypeSchedulePolicy, SchedulePolicyTypeSimpleSchedulePolicy} -} - -// ScheduleRunType enumerates the values for schedule run type. -type ScheduleRunType string - -const ( - // ScheduleRunTypeDaily ... - ScheduleRunTypeDaily ScheduleRunType = "Daily" - // ScheduleRunTypeInvalid ... - ScheduleRunTypeInvalid ScheduleRunType = "Invalid" - // ScheduleRunTypeWeekly ... - ScheduleRunTypeWeekly ScheduleRunType = "Weekly" -) - -// PossibleScheduleRunTypeValues returns an array of possible values for the ScheduleRunType const type. -func PossibleScheduleRunTypeValues() []ScheduleRunType { - return []ScheduleRunType{ScheduleRunTypeDaily, ScheduleRunTypeInvalid, ScheduleRunTypeWeekly} -} - // SQLDataDirectoryType enumerates the values for sql data directory type. type SQLDataDirectoryType string @@ -1096,29 +481,6 @@ func PossibleTypeValues() []Type { return []Type{TypeCopyOnlyFull, TypeDifferential, TypeFull, TypeInvalid, TypeLog} } -// WeekOfMonth enumerates the values for week of month. -type WeekOfMonth string - -const ( - // WeekOfMonthFirst ... - WeekOfMonthFirst WeekOfMonth = "First" - // WeekOfMonthFourth ... - WeekOfMonthFourth WeekOfMonth = "Fourth" - // WeekOfMonthInvalid ... - WeekOfMonthInvalid WeekOfMonth = "Invalid" - // WeekOfMonthLast ... - WeekOfMonthLast WeekOfMonth = "Last" - // WeekOfMonthSecond ... - WeekOfMonthSecond WeekOfMonth = "Second" - // WeekOfMonthThird ... - WeekOfMonthThird WeekOfMonth = "Third" -) - -// PossibleWeekOfMonthValues returns an array of possible values for the WeekOfMonth const type. -func PossibleWeekOfMonthValues() []WeekOfMonth { - return []WeekOfMonth{WeekOfMonthFirst, WeekOfMonthFourth, WeekOfMonthInvalid, WeekOfMonthLast, WeekOfMonthSecond, WeekOfMonthThird} -} - // WorkloadItemType enumerates the values for workload item type. type WorkloadItemType string @@ -1397,7 +759,7 @@ type AzureBackupServerEngine struct { IsAzureBackupAgentUpgradeAvailable *bool `json:"isAzureBackupAgentUpgradeAvailable,omitempty"` // IsDpmUpgradeAvailable - To check if backup engine upgrade available IsDpmUpgradeAvailable *bool `json:"isDpmUpgradeAvailable,omitempty"` - // ExtendedInfo - Extended info of the backup engine + // ExtendedInfo - Extended info of the backupengine ExtendedInfo *EngineExtendedInfo `json:"extendedInfo,omitempty"` // BackupEngineType - Possible values include: 'BackupEngineTypeBackupEngineBase', 'BackupEngineTypeAzureBackupServerEngine', 'BackupEngineTypeDpmBackupEngine' BackupEngineType EngineType `json:"backupEngineType,omitempty"` @@ -1531,7 +893,7 @@ type AzureFileShareProtectableItem struct { FriendlyName *string `json:"friendlyName,omitempty"` // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseDatabase', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` } @@ -1591,11 +953,6 @@ func (afspi AzureFileShareProtectableItem) AsBasicAzureVMWorkloadProtectableItem return nil, false } -// AsAzureVMWorkloadSAPAseDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadSAPAseDatabaseProtectableItem() (*AzureVMWorkloadSAPAseDatabaseProtectableItem, bool) { - return nil, false -} - // AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { return nil, false @@ -1646,1048 +1003,838 @@ func (afspi AzureFileShareProtectableItem) AsBasicWorkloadProtectableItem() (Bas return &afspi, true } -// AzureFileshareProtectedItem azure File Share workload-specific backup item. -type AzureFileshareProtectedItem struct { - // FriendlyName - Friendly name of the fileshare represented by this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionStatus - Backup status of this backup item. - ProtectionStatus *string `json:"protectionStatus,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' - ProtectionState ProtectionState `json:"protectionState,omitempty"` - // HealthStatus - backups running status for this backup item. Possible values include: 'HealthStatusPassed', 'HealthStatusActionRequired', 'HealthStatusActionSuggested', 'HealthStatusInvalid' - HealthStatus HealthStatus `json:"healthStatus,omitempty"` - // LastBackupStatus - Last backup operation status. Possible values: Healthy, Unhealthy. - LastBackupStatus *string `json:"lastBackupStatus,omitempty"` - // LastBackupTime - Timestamp of the last backup operation on this backup item. - LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` - // ExtendedInfo - Additional information with this backup item. - ExtendedInfo *AzureFileshareProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - WorkloadType DataSourceType `json:"workloadType,omitempty"` - // ContainerName - Unique name of container - ContainerName *string `json:"containerName,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. +// AzureFileShareProvisionILRRequest update snapshot Uri with the correct friendly Name of the source Azure +// file share. +type AzureFileShareProvisionILRRequest struct { + // RecoveryPointID - Recovery point ID. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` + // SourceResourceID - Source Storage account ARM Id SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. - LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` - // BackupSetName - Name of the backup set the backup item belongs to - BackupSetName *string `json:"backupSetName,omitempty"` - // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' - CreateMode CreateMode `json:"createMode,omitempty"` - // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC - DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` - // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state - IsRehydrate *bool `json:"isRehydrate,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' - ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureFileshareProtectedItem. -func (afpi AzureFileshareProtectedItem) MarshalJSON() ([]byte, error) { - afpi.ProtectedItemType = ProtectedItemTypeAzureFileShareProtectedItem + // ObjectType - Possible values include: 'ObjectTypeILRRequest', 'ObjectTypeAzureFileShareProvisionILRRequest', 'ObjectTypeIaasVMILRRegistrationRequest' + ObjectType ObjectTypeBasicILRRequest `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFileShareProvisionILRRequest. +func (afspir AzureFileShareProvisionILRRequest) MarshalJSON() ([]byte, error) { + afspir.ObjectType = ObjectTypeAzureFileShareProvisionILRRequest objectMap := make(map[string]interface{}) - if afpi.FriendlyName != nil { - objectMap["friendlyName"] = afpi.FriendlyName - } - if afpi.ProtectionStatus != nil { - objectMap["protectionStatus"] = afpi.ProtectionStatus - } - if afpi.ProtectionState != "" { - objectMap["protectionState"] = afpi.ProtectionState - } - if afpi.HealthStatus != "" { - objectMap["healthStatus"] = afpi.HealthStatus - } - if afpi.LastBackupStatus != nil { - objectMap["lastBackupStatus"] = afpi.LastBackupStatus - } - if afpi.LastBackupTime != nil { - objectMap["lastBackupTime"] = afpi.LastBackupTime - } - if afpi.ExtendedInfo != nil { - objectMap["extendedInfo"] = afpi.ExtendedInfo - } - if afpi.BackupManagementType != "" { - objectMap["backupManagementType"] = afpi.BackupManagementType - } - if afpi.WorkloadType != "" { - objectMap["workloadType"] = afpi.WorkloadType - } - if afpi.ContainerName != nil { - objectMap["containerName"] = afpi.ContainerName - } - if afpi.SourceResourceID != nil { - objectMap["sourceResourceId"] = afpi.SourceResourceID - } - if afpi.PolicyID != nil { - objectMap["policyId"] = afpi.PolicyID - } - if afpi.LastRecoveryPoint != nil { - objectMap["lastRecoveryPoint"] = afpi.LastRecoveryPoint + if afspir.RecoveryPointID != nil { + objectMap["recoveryPointId"] = afspir.RecoveryPointID } - if afpi.BackupSetName != nil { - objectMap["backupSetName"] = afpi.BackupSetName + if afspir.SourceResourceID != nil { + objectMap["sourceResourceId"] = afspir.SourceResourceID } - if afpi.CreateMode != "" { - objectMap["createMode"] = afpi.CreateMode - } - if afpi.DeferredDeleteTimeInUTC != nil { - objectMap["deferredDeleteTimeInUTC"] = afpi.DeferredDeleteTimeInUTC - } - if afpi.IsScheduledForDeferredDelete != nil { - objectMap["isScheduledForDeferredDelete"] = afpi.IsScheduledForDeferredDelete - } - if afpi.DeferredDeleteTimeRemaining != nil { - objectMap["deferredDeleteTimeRemaining"] = afpi.DeferredDeleteTimeRemaining - } - if afpi.IsDeferredDeleteScheduleUpcoming != nil { - objectMap["isDeferredDeleteScheduleUpcoming"] = afpi.IsDeferredDeleteScheduleUpcoming - } - if afpi.IsRehydrate != nil { - objectMap["isRehydrate"] = afpi.IsRehydrate - } - if afpi.ProtectedItemType != "" { - objectMap["protectedItemType"] = afpi.ProtectedItemType + if afspir.ObjectType != "" { + objectMap["objectType"] = afspir.ObjectType } return json.Marshal(objectMap) } -// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. -func (afpi AzureFileshareProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { - return &afpi, true +// AsAzureFileShareProvisionILRRequest is the BasicILRRequest implementation for AzureFileShareProvisionILRRequest. +func (afspir AzureFileShareProvisionILRRequest) AsAzureFileShareProvisionILRRequest() (*AzureFileShareProvisionILRRequest, bool) { + return &afspir, true } -// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. -func (afpi AzureFileshareProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { +// AsIaasVMILRRegistrationRequest is the BasicILRRequest implementation for AzureFileShareProvisionILRRequest. +func (afspir AzureFileShareProvisionILRRequest) AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) { return nil, false } -// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. -func (afpi AzureFileshareProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { +// AsILRRequest is the BasicILRRequest implementation for AzureFileShareProvisionILRRequest. +func (afspir AzureFileShareProvisionILRRequest) AsILRRequest() (*ILRRequest, bool) { return nil, false } -// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. -func (afpi AzureFileshareProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { - return nil, false +// AsBasicILRRequest is the BasicILRRequest implementation for AzureFileShareProvisionILRRequest. +func (afspir AzureFileShareProvisionILRRequest) AsBasicILRRequest() (BasicILRRequest, bool) { + return &afspir, true } -// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. -func (afpi AzureFileshareProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { - return nil, false +// AzureIaaSClassicComputeVMContainer iaaS VM workload-specific backup item representing a classic virtual +// machine. +type AzureIaaSClassicComputeVMContainer struct { + // VirtualMachineID - Fully qualified ARM url of the virtual machine represented by this Azure IaaS VM container. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // VirtualMachineVersion - Specifies whether the container represents a Classic or an Azure Resource Manager VM. + VirtualMachineVersion *string `json:"virtualMachineVersion,omitempty"` + // ResourceGroup - Resource group name of Recovery Services Vault. + ResourceGroup *string `json:"resourceGroup,omitempty"` + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` } -// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. -func (afpi AzureFileshareProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { - return nil, false +// MarshalJSON is the custom marshaler for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) MarshalJSON() ([]byte, error) { + aisccvc.ContainerType = ContainerTypeMicrosoftClassicComputevirtualMachines + objectMap := make(map[string]interface{}) + if aisccvc.VirtualMachineID != nil { + objectMap["virtualMachineId"] = aisccvc.VirtualMachineID + } + if aisccvc.VirtualMachineVersion != nil { + objectMap["virtualMachineVersion"] = aisccvc.VirtualMachineVersion + } + if aisccvc.ResourceGroup != nil { + objectMap["resourceGroup"] = aisccvc.ResourceGroup + } + if aisccvc.FriendlyName != nil { + objectMap["friendlyName"] = aisccvc.FriendlyName + } + if aisccvc.BackupManagementType != "" { + objectMap["backupManagementType"] = aisccvc.BackupManagementType + } + if aisccvc.RegistrationStatus != nil { + objectMap["registrationStatus"] = aisccvc.RegistrationStatus + } + if aisccvc.HealthStatus != nil { + objectMap["healthStatus"] = aisccvc.HealthStatus + } + if aisccvc.ContainerType != "" { + objectMap["containerType"] = aisccvc.ContainerType + } + return json.Marshal(objectMap) } -// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. -func (afpi AzureFileshareProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { return nil, false } -// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. -func (afpi AzureFileshareProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { - return nil, false +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { + return &aisccvc, true } -// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. -func (afpi AzureFileshareProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. -func (afpi AzureFileshareProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { return nil, false } -// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. -func (afpi AzureFileshareProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { return nil, false } -// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. -func (afpi AzureFileshareProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { +// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { return nil, false } -// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. -func (afpi AzureFileshareProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { +// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { return nil, false } -// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. -func (afpi AzureFileshareProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { return nil, false } -// AsProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. -func (afpi AzureFileshareProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { return nil, false } -// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. -func (afpi AzureFileshareProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { - return &afpi, true -} - -// AzureFileshareProtectedItemExtendedInfo additional information about Azure File Share backup item. -type AzureFileshareProtectedItemExtendedInfo struct { - // OldestRecoveryPoint - The oldest backup copy available for this item in the service. - OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"` - // RecoveryPointCount - Number of available backup copies associated with this backup item. - RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"` - // PolicyState - Indicates consistency of policy object and policy applied to this backup item. - PolicyState *string `json:"policyState,omitempty"` -} - -// AzureFileShareProtectionPolicy azureStorage backup policy. -type AzureFileShareProtectionPolicy struct { - // WorkLoadType - Type of workload for the backup management. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' - WorkLoadType WorkloadType `json:"workLoadType,omitempty"` - // SchedulePolicy - Backup schedule specified as part of backup policy. - SchedulePolicy BasicSchedulePolicy `json:"schedulePolicy,omitempty"` - // RetentionPolicy - Retention policy with the details on backup copy retention ranges. - RetentionPolicy BasicRetentionPolicy `json:"retentionPolicy,omitempty"` - // TimeZone - TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". - TimeZone *string `json:"timeZone,omitempty"` - // ProtectedItemsCount - Number of items associated with this policy. - ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` - // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' - BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureFileShareProtectionPolicy. -func (afspp AzureFileShareProtectionPolicy) MarshalJSON() ([]byte, error) { - afspp.BackupManagementType = BackupManagementTypeAzureStorage - objectMap := make(map[string]interface{}) - if afspp.WorkLoadType != "" { - objectMap["workLoadType"] = afspp.WorkLoadType - } - objectMap["schedulePolicy"] = afspp.SchedulePolicy - objectMap["retentionPolicy"] = afspp.RetentionPolicy - if afspp.TimeZone != nil { - objectMap["timeZone"] = afspp.TimeZone - } - if afspp.ProtectedItemsCount != nil { - objectMap["protectedItemsCount"] = afspp.ProtectedItemsCount - } - if afspp.BackupManagementType != "" { - objectMap["backupManagementType"] = afspp.BackupManagementType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for AzureFileShareProtectionPolicy. -func (afspp AzureFileShareProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { - return &afspp, true +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return nil, false } -// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for AzureFileShareProtectionPolicy. -func (afspp AzureFileShareProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { +// AsDpmContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsDpmContainer() (*DpmContainer, bool) { return nil, false } -// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for AzureFileShareProtectionPolicy. -func (afspp AzureFileShareProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { +// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { return nil, false } -// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for AzureFileShareProtectionPolicy. -func (afspp AzureFileShareProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { +// AsGenericContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsGenericContainer() (*GenericContainer, bool) { return nil, false } -// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for AzureFileShareProtectionPolicy. -func (afspp AzureFileShareProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { +// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { return nil, false } -// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for AzureFileShareProtectionPolicy. -func (afspp AzureFileShareProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { - return nil, false +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return &aisccvc, true } -// AsProtectionPolicy is the BasicProtectionPolicy implementation for AzureFileShareProtectionPolicy. -func (afspp AzureFileShareProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { +// AsMabContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsMabContainer() (*MabContainer, bool) { return nil, false } -// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for AzureFileShareProtectionPolicy. -func (afspp AzureFileShareProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { - return &afspp, true +// AsProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return nil, false } -// UnmarshalJSON is the custom unmarshaler for AzureFileShareProtectionPolicy struct. -func (afspp *AzureFileShareProtectionPolicy) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "workLoadType": - if v != nil { - var workLoadType WorkloadType - err = json.Unmarshal(*v, &workLoadType) - if err != nil { - return err - } - afspp.WorkLoadType = workLoadType - } - case "schedulePolicy": - if v != nil { - schedulePolicy, err := unmarshalBasicSchedulePolicy(*v) - if err != nil { - return err - } - afspp.SchedulePolicy = schedulePolicy - } - case "retentionPolicy": - if v != nil { - retentionPolicy, err := unmarshalBasicRetentionPolicy(*v) - if err != nil { - return err - } - afspp.RetentionPolicy = retentionPolicy - } - case "timeZone": - if v != nil { - var timeZone string - err = json.Unmarshal(*v, &timeZone) - if err != nil { - return err - } - afspp.TimeZone = &timeZone - } - case "protectedItemsCount": - if v != nil { - var protectedItemsCount int32 - err = json.Unmarshal(*v, &protectedItemsCount) - if err != nil { - return err - } - afspp.ProtectedItemsCount = &protectedItemsCount - } - case "backupManagementType": - if v != nil { - var backupManagementType ManagementTypeBasicProtectionPolicy - err = json.Unmarshal(*v, &backupManagementType) - if err != nil { - return err - } - afspp.BackupManagementType = backupManagementType - } - } - } - - return nil +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &aisccvc, true } -// AzureFileShareRecoveryPoint azure File Share workload specific backup copy. -type AzureFileShareRecoveryPoint struct { - // RecoveryPointType - Type of the backup copy. Specifies whether it is a crash consistent backup or app consistent. - RecoveryPointType *string `json:"recoveryPointType,omitempty"` - // RecoveryPointTime - Time at which this backup copy was created. - RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` - // FileShareSnapshotURI - Contains Url to the snapshot of fileshare, if applicable - FileShareSnapshotURI *string `json:"fileShareSnapshotUri,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' - ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +// AzureIaaSClassicComputeVMProtectableItem iaaS VM workload-specific backup item representing the Classic +// Compute VM. +type AzureIaaSClassicComputeVMProtectableItem struct { + // VirtualMachineID - Fully qualified ARM ID of the virtual machine. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` } -// MarshalJSON is the custom marshaler for AzureFileShareRecoveryPoint. -func (afsrp AzureFileShareRecoveryPoint) MarshalJSON() ([]byte, error) { - afsrp.ObjectType = ObjectTypeAzureFileShareRecoveryPoint +// MarshalJSON is the custom marshaler for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) MarshalJSON() ([]byte, error) { + aisccvpi.ProtectableItemType = ProtectableItemTypeMicrosoftClassicComputevirtualMachines objectMap := make(map[string]interface{}) - if afsrp.RecoveryPointType != nil { - objectMap["recoveryPointType"] = afsrp.RecoveryPointType + if aisccvpi.VirtualMachineID != nil { + objectMap["virtualMachineId"] = aisccvpi.VirtualMachineID + } + if aisccvpi.BackupManagementType != nil { + objectMap["backupManagementType"] = aisccvpi.BackupManagementType } - if afsrp.RecoveryPointTime != nil { - objectMap["recoveryPointTime"] = afsrp.RecoveryPointTime + if aisccvpi.WorkloadType != nil { + objectMap["workloadType"] = aisccvpi.WorkloadType + } + if aisccvpi.FriendlyName != nil { + objectMap["friendlyName"] = aisccvpi.FriendlyName } - if afsrp.FileShareSnapshotURI != nil { - objectMap["fileShareSnapshotUri"] = afsrp.FileShareSnapshotURI + if aisccvpi.ProtectionState != "" { + objectMap["protectionState"] = aisccvpi.ProtectionState } - if afsrp.ObjectType != "" { - objectMap["objectType"] = afsrp.ObjectType + if aisccvpi.ProtectableItemType != "" { + objectMap["protectableItemType"] = aisccvpi.ProtectableItemType } return json.Marshal(objectMap) } -// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. -func (afsrp AzureFileShareRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { - return &afsrp, true +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { + return &aisccvpi, true } -// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. -func (afsrp AzureFileShareRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { return nil, false } -// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. -func (afsrp AzureFileShareRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { return nil, false } -// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. -func (afsrp AzureFileShareRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { return nil, false } -// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. -func (afsrp AzureFileShareRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { +// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { return nil, false } -// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. -func (afsrp AzureFileShareRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { return nil, false } -// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. -func (afsrp AzureFileShareRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { return nil, false } -// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. -func (afsrp AzureFileShareRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { return nil, false } -// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. -func (afsrp AzureFileShareRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { return nil, false } -// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. -func (afsrp AzureFileShareRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { return nil, false } -// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. -func (afsrp AzureFileShareRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { return nil, false } -// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. -func (afsrp AzureFileShareRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { - return nil, false +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { + return &aisccvpi, true } -// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. -func (afsrp AzureFileShareRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { return nil, false } -// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. -func (afsrp AzureFileShareRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { - return &afsrp, true +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &aisccvpi, true +} + +// AzureIaaSComputeVMContainer iaaS VM workload-specific backup item representing an Azure Resource Manager +// virtual machine. +type AzureIaaSComputeVMContainer struct { + // VirtualMachineID - Fully qualified ARM url of the virtual machine represented by this Azure IaaS VM container. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // VirtualMachineVersion - Specifies whether the container represents a Classic or an Azure Resource Manager VM. + VirtualMachineVersion *string `json:"virtualMachineVersion,omitempty"` + // ResourceGroup - Resource group name of Recovery Services Vault. + ResourceGroup *string `json:"resourceGroup,omitempty"` + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` } -// AzureFileShareRestoreRequest azureFileShare Restore Request -type AzureFileShareRestoreRequest struct { - // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks' - RecoveryType RecoveryType `json:"recoveryType,omitempty"` - // SourceResourceID - Source storage account ARM Id - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // CopyOptions - Options to resolve copy conflicts. Possible values include: 'CopyOptionsInvalid', 'CopyOptionsCreateCopy', 'CopyOptionsSkip', 'CopyOptionsOverwrite', 'CopyOptionsFailOnConflict' - CopyOptions CopyOptions `json:"copyOptions,omitempty"` - // RestoreRequestType - Restore Type (FullShareRestore or ItemLevelRestore). Possible values include: 'RestoreRequestTypeInvalid', 'RestoreRequestTypeFullShareRestore', 'RestoreRequestTypeItemLevelRestore' - RestoreRequestType RestoreRequestType `json:"restoreRequestType,omitempty"` - // RestoreFileSpecs - List of Source Files/Folders(which need to recover) and TargetFolderPath details - RestoreFileSpecs *[]RestoreFileSpecs `json:"restoreFileSpecs,omitempty"` - // TargetDetails - Target File Share Details - TargetDetails *TargetAFSRestoreInfo `json:"targetDetails,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' - ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureFileShareRestoreRequest. -func (afsrr AzureFileShareRestoreRequest) MarshalJSON() ([]byte, error) { - afsrr.ObjectType = ObjectTypeAzureFileShareRestoreRequest +// MarshalJSON is the custom marshaler for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) MarshalJSON() ([]byte, error) { + aiscvc.ContainerType = ContainerTypeMicrosoftComputevirtualMachines objectMap := make(map[string]interface{}) - if afsrr.RecoveryType != "" { - objectMap["recoveryType"] = afsrr.RecoveryType + if aiscvc.VirtualMachineID != nil { + objectMap["virtualMachineId"] = aiscvc.VirtualMachineID + } + if aiscvc.VirtualMachineVersion != nil { + objectMap["virtualMachineVersion"] = aiscvc.VirtualMachineVersion } - if afsrr.SourceResourceID != nil { - objectMap["sourceResourceId"] = afsrr.SourceResourceID + if aiscvc.ResourceGroup != nil { + objectMap["resourceGroup"] = aiscvc.ResourceGroup } - if afsrr.CopyOptions != "" { - objectMap["copyOptions"] = afsrr.CopyOptions + if aiscvc.FriendlyName != nil { + objectMap["friendlyName"] = aiscvc.FriendlyName } - if afsrr.RestoreRequestType != "" { - objectMap["restoreRequestType"] = afsrr.RestoreRequestType + if aiscvc.BackupManagementType != "" { + objectMap["backupManagementType"] = aiscvc.BackupManagementType } - if afsrr.RestoreFileSpecs != nil { - objectMap["restoreFileSpecs"] = afsrr.RestoreFileSpecs + if aiscvc.RegistrationStatus != nil { + objectMap["registrationStatus"] = aiscvc.RegistrationStatus } - if afsrr.TargetDetails != nil { - objectMap["targetDetails"] = afsrr.TargetDetails + if aiscvc.HealthStatus != nil { + objectMap["healthStatus"] = aiscvc.HealthStatus } - if afsrr.ObjectType != "" { - objectMap["objectType"] = afsrr.ObjectType + if aiscvc.ContainerType != "" { + objectMap["containerType"] = aiscvc.ContainerType } return json.Marshal(objectMap) } -// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. -func (afsrr AzureFileShareRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { - return &afsrr, true +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { + return nil, false } -// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. -func (afsrr AzureFileShareRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { return nil, false } -// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. -func (afsrr AzureFileShareRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { - return nil, false +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { + return &aiscvc, true } -// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. -func (afsrr AzureFileShareRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { return nil, false } -// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. -func (afsrr AzureFileShareRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { +// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { return nil, false } -// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. -func (afsrr AzureFileShareRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { +// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { return nil, false } -// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. -func (afsrr AzureFileShareRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { return nil, false } -// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. -func (afsrr AzureFileShareRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { return nil, false } -// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. -func (afsrr AzureFileShareRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { return nil, false } -// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. -func (afsrr AzureFileShareRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { +// AsDpmContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsDpmContainer() (*DpmContainer, bool) { return nil, false } -// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. -func (afsrr AzureFileShareRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { +// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { return nil, false } -// AsRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. -func (afsrr AzureFileShareRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { +// AsGenericContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsGenericContainer() (*GenericContainer, bool) { return nil, false } -// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. -func (afsrr AzureFileShareRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { - return &afsrr, true +// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { + return nil, false } -// AzureIaaSClassicComputeVMContainer iaaS VM workload-specific backup item representing a classic virtual -// machine. -type AzureIaaSClassicComputeVMContainer struct { - // VirtualMachineID - Fully qualified ARM url of the virtual machine represented by this Azure IaaS VM container. - VirtualMachineID *string `json:"virtualMachineId,omitempty"` - // VirtualMachineVersion - Specifies whether the container represents a Classic or an Azure Resource Manager VM. - VirtualMachineVersion *string `json:"virtualMachineVersion,omitempty"` - // ResourceGroup - Resource group name of Recovery Services Vault. - ResourceGroup *string `json:"resourceGroup,omitempty"` - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return &aiscvc, true } -// MarshalJSON is the custom marshaler for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) MarshalJSON() ([]byte, error) { - aisccvc.ContainerType = ContainerTypeMicrosoftClassicComputevirtualMachines +// AsMabContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsMabContainer() (*MabContainer, bool) { + return nil, false +} + +// AsProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return nil, false +} + +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &aiscvc, true +} + +// AzureIaaSComputeVMProtectableItem iaaS VM workload-specific backup item representing the Azure Resource +// Manager VM. +type AzureIaaSComputeVMProtectableItem struct { + // VirtualMachineID - Fully qualified ARM ID of the virtual machine. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) MarshalJSON() ([]byte, error) { + aiscvpi.ProtectableItemType = ProtectableItemTypeMicrosoftComputevirtualMachines objectMap := make(map[string]interface{}) - if aisccvc.VirtualMachineID != nil { - objectMap["virtualMachineId"] = aisccvc.VirtualMachineID - } - if aisccvc.VirtualMachineVersion != nil { - objectMap["virtualMachineVersion"] = aisccvc.VirtualMachineVersion - } - if aisccvc.ResourceGroup != nil { - objectMap["resourceGroup"] = aisccvc.ResourceGroup + if aiscvpi.VirtualMachineID != nil { + objectMap["virtualMachineId"] = aiscvpi.VirtualMachineID } - if aisccvc.FriendlyName != nil { - objectMap["friendlyName"] = aisccvc.FriendlyName + if aiscvpi.BackupManagementType != nil { + objectMap["backupManagementType"] = aiscvpi.BackupManagementType } - if aisccvc.BackupManagementType != "" { - objectMap["backupManagementType"] = aisccvc.BackupManagementType + if aiscvpi.WorkloadType != nil { + objectMap["workloadType"] = aiscvpi.WorkloadType } - if aisccvc.RegistrationStatus != nil { - objectMap["registrationStatus"] = aisccvc.RegistrationStatus + if aiscvpi.FriendlyName != nil { + objectMap["friendlyName"] = aiscvpi.FriendlyName } - if aisccvc.HealthStatus != nil { - objectMap["healthStatus"] = aisccvc.HealthStatus + if aiscvpi.ProtectionState != "" { + objectMap["protectionState"] = aiscvpi.ProtectionState } - if aisccvc.ContainerType != "" { - objectMap["containerType"] = aisccvc.ContainerType + if aiscvpi.ProtectableItemType != "" { + objectMap["protectableItemType"] = aiscvpi.ProtectableItemType } return json.Marshal(objectMap) } -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { return nil, false } -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { - return &aisccvc, true -} - -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { return nil, false } -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { - return nil, false +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { + return &aiscvpi, true } -// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { return nil, false } -// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { return nil, false } -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { +// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { return nil, false } -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { return nil, false } -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { return nil, false } -// AsDpmContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsDpmContainer() (*DpmContainer, bool) { +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { return nil, false } -// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { return nil, false } -// AsGenericContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsGenericContainer() (*GenericContainer, bool) { +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { return nil, false } -// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { return nil, false } -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { - return &aisccvc, true -} - -// AsMabContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsMabContainer() (*MabContainer, bool) { - return nil, false +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { + return &aiscvpi, true } -// AsProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsProtectionContainer() (*ProtectionContainer, bool) { +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { return nil, false } -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &aisccvc, true +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &aiscvpi, true } -// AzureIaaSClassicComputeVMProtectableItem iaaS VM workload-specific backup item representing the Classic -// Compute VM. -type AzureIaaSClassicComputeVMProtectableItem struct { - // VirtualMachineID - Fully qualified ARM ID of the virtual machine. - VirtualMachineID *string `json:"virtualMachineId,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. +// AzureSQLAGWorkloadContainerProtectionContainer container for SQL workloads under SQL Availability Group. +type AzureSQLAGWorkloadContainerProtectionContainer struct { + // SourceResourceID - ARM ID of the virtual machine represented by this Azure Workload Container + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // LastUpdatedTime - Time stamp when this container was updated. + LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"` + // ExtendedInfo - Additional details of a workload container. + ExtendedInfo *AzureWorkloadContainerExtendedInfo `json:"extendedInfo,omitempty"` + // WorkloadType - Workload type for which registration was sent. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' + WorkloadType WorkloadType `json:"workloadType,omitempty"` + // OperationType - Re-Do Operation. Possible values include: 'OperationTypeInvalid', 'OperationTypeRegister', 'OperationTypeReregister' + OperationType OperationType `json:"operationType,omitempty"` + // FriendlyName - Friendly name of the container. FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseDatabase', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` } -// MarshalJSON is the custom marshaler for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) MarshalJSON() ([]byte, error) { - aisccvpi.ProtectableItemType = ProtectableItemTypeMicrosoftClassicComputevirtualMachines +// MarshalJSON is the custom marshaler for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) MarshalJSON() ([]byte, error) { + aswcpc.ContainerType = ContainerTypeSQLAGWorkLoadContainer1 objectMap := make(map[string]interface{}) - if aisccvpi.VirtualMachineID != nil { - objectMap["virtualMachineId"] = aisccvpi.VirtualMachineID + if aswcpc.SourceResourceID != nil { + objectMap["sourceResourceId"] = aswcpc.SourceResourceID } - if aisccvpi.BackupManagementType != nil { - objectMap["backupManagementType"] = aisccvpi.BackupManagementType + if aswcpc.LastUpdatedTime != nil { + objectMap["lastUpdatedTime"] = aswcpc.LastUpdatedTime } - if aisccvpi.WorkloadType != nil { - objectMap["workloadType"] = aisccvpi.WorkloadType + if aswcpc.ExtendedInfo != nil { + objectMap["extendedInfo"] = aswcpc.ExtendedInfo } - if aisccvpi.FriendlyName != nil { - objectMap["friendlyName"] = aisccvpi.FriendlyName + if aswcpc.WorkloadType != "" { + objectMap["workloadType"] = aswcpc.WorkloadType } - if aisccvpi.ProtectionState != "" { - objectMap["protectionState"] = aisccvpi.ProtectionState + if aswcpc.OperationType != "" { + objectMap["operationType"] = aswcpc.OperationType } - if aisccvpi.ProtectableItemType != "" { - objectMap["protectableItemType"] = aisccvpi.ProtectableItemType + if aswcpc.FriendlyName != nil { + objectMap["friendlyName"] = aswcpc.FriendlyName + } + if aswcpc.BackupManagementType != "" { + objectMap["backupManagementType"] = aswcpc.BackupManagementType + } + if aswcpc.RegistrationStatus != nil { + objectMap["registrationStatus"] = aswcpc.RegistrationStatus + } + if aswcpc.HealthStatus != nil { + objectMap["healthStatus"] = aswcpc.HealthStatus + } + if aswcpc.ContainerType != "" { + objectMap["containerType"] = aswcpc.ContainerType } return json.Marshal(objectMap) } -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { return nil, false } -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { - return &aisccvpi, true -} - -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { return nil, false } -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { return nil, false } -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return nil, false +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { + return &aswcpc, true } -// AsAzureVMWorkloadSAPAseDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSAPAseDatabaseProtectableItem() (*AzureVMWorkloadSAPAseDatabaseProtectableItem, bool) { +// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { return nil, false } -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { +// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { return nil, false } -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return &aswcpc, true +} + +// AsDpmContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsDpmContainer() (*DpmContainer, bool) { return nil, false } -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { +// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { return nil, false } -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { +// AsGenericContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsGenericContainer() (*GenericContainer, bool) { return nil, false } -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { +// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { return nil, false } -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { - return &aisccvpi, true +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return nil, false } -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { +// AsMabContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsMabContainer() (*MabContainer, bool) { return nil, false } -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &aisccvpi, true +// AsProtectionContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return nil, false } -// AzureIaaSClassicComputeVMProtectedItem iaaS VM workload-specific backup item representing the Classic -// Compute VM. -type AzureIaaSClassicComputeVMProtectedItem struct { - // FriendlyName - Friendly name of the VM represented by this backup item. +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &aswcpc, true +} + +// AzureSQLContainer azure Sql workload-specific container. +type AzureSQLContainer struct { + // FriendlyName - Friendly name of the container. FriendlyName *string `json:"friendlyName,omitempty"` - // VirtualMachineID - Fully qualified ARM ID of the virtual machine represented by this item. - VirtualMachineID *string `json:"virtualMachineId,omitempty"` - // ProtectionStatus - Backup status of this backup item. - ProtectionStatus *string `json:"protectionStatus,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' - ProtectionState ProtectionState `json:"protectionState,omitempty"` - // HealthStatus - Health status of protected item. Possible values include: 'HealthStatusPassed', 'HealthStatusActionRequired', 'HealthStatusActionSuggested', 'HealthStatusInvalid' - HealthStatus HealthStatus `json:"healthStatus,omitempty"` - // HealthDetails - Health details on this backup item. - HealthDetails *[]AzureIaaSVMHealthDetails `json:"healthDetails,omitempty"` - // LastBackupStatus - Last backup operation status. - LastBackupStatus *string `json:"lastBackupStatus,omitempty"` - // LastBackupTime - Timestamp of the last backup operation on this backup item. - LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` - // ProtectedItemDataID - Data ID of the protected item. - ProtectedItemDataID *string `json:"protectedItemDataId,omitempty"` - // ExtendedInfo - Additional information for this backup item. - ExtendedInfo *AzureIaaSVMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - WorkloadType DataSourceType `json:"workloadType,omitempty"` - // ContainerName - Unique name of container - ContainerName *string `json:"containerName,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. - LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` - // BackupSetName - Name of the backup set the backup item belongs to - BackupSetName *string `json:"backupSetName,omitempty"` - // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' - CreateMode CreateMode `json:"createMode,omitempty"` - // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC - DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` - // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state - IsRehydrate *bool `json:"isRehydrate,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' - ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureIaaSClassicComputeVMProtectedItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) MarshalJSON() ([]byte, error) { - aisccvpi.ProtectedItemType = ProtectedItemTypeMicrosoftClassicComputevirtualMachines + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureSQLContainer. +func (asc AzureSQLContainer) MarshalJSON() ([]byte, error) { + asc.ContainerType = ContainerTypeAzureSQLContainer1 objectMap := make(map[string]interface{}) - if aisccvpi.FriendlyName != nil { - objectMap["friendlyName"] = aisccvpi.FriendlyName - } - if aisccvpi.VirtualMachineID != nil { - objectMap["virtualMachineId"] = aisccvpi.VirtualMachineID - } - if aisccvpi.ProtectionStatus != nil { - objectMap["protectionStatus"] = aisccvpi.ProtectionStatus - } - if aisccvpi.ProtectionState != "" { - objectMap["protectionState"] = aisccvpi.ProtectionState - } - if aisccvpi.HealthStatus != "" { - objectMap["healthStatus"] = aisccvpi.HealthStatus - } - if aisccvpi.HealthDetails != nil { - objectMap["healthDetails"] = aisccvpi.HealthDetails - } - if aisccvpi.LastBackupStatus != nil { - objectMap["lastBackupStatus"] = aisccvpi.LastBackupStatus - } - if aisccvpi.LastBackupTime != nil { - objectMap["lastBackupTime"] = aisccvpi.LastBackupTime - } - if aisccvpi.ProtectedItemDataID != nil { - objectMap["protectedItemDataId"] = aisccvpi.ProtectedItemDataID - } - if aisccvpi.ExtendedInfo != nil { - objectMap["extendedInfo"] = aisccvpi.ExtendedInfo - } - if aisccvpi.BackupManagementType != "" { - objectMap["backupManagementType"] = aisccvpi.BackupManagementType - } - if aisccvpi.WorkloadType != "" { - objectMap["workloadType"] = aisccvpi.WorkloadType - } - if aisccvpi.ContainerName != nil { - objectMap["containerName"] = aisccvpi.ContainerName - } - if aisccvpi.SourceResourceID != nil { - objectMap["sourceResourceId"] = aisccvpi.SourceResourceID - } - if aisccvpi.PolicyID != nil { - objectMap["policyId"] = aisccvpi.PolicyID - } - if aisccvpi.LastRecoveryPoint != nil { - objectMap["lastRecoveryPoint"] = aisccvpi.LastRecoveryPoint - } - if aisccvpi.BackupSetName != nil { - objectMap["backupSetName"] = aisccvpi.BackupSetName - } - if aisccvpi.CreateMode != "" { - objectMap["createMode"] = aisccvpi.CreateMode - } - if aisccvpi.DeferredDeleteTimeInUTC != nil { - objectMap["deferredDeleteTimeInUTC"] = aisccvpi.DeferredDeleteTimeInUTC - } - if aisccvpi.IsScheduledForDeferredDelete != nil { - objectMap["isScheduledForDeferredDelete"] = aisccvpi.IsScheduledForDeferredDelete + if asc.FriendlyName != nil { + objectMap["friendlyName"] = asc.FriendlyName } - if aisccvpi.DeferredDeleteTimeRemaining != nil { - objectMap["deferredDeleteTimeRemaining"] = aisccvpi.DeferredDeleteTimeRemaining + if asc.BackupManagementType != "" { + objectMap["backupManagementType"] = asc.BackupManagementType } - if aisccvpi.IsDeferredDeleteScheduleUpcoming != nil { - objectMap["isDeferredDeleteScheduleUpcoming"] = aisccvpi.IsDeferredDeleteScheduleUpcoming + if asc.RegistrationStatus != nil { + objectMap["registrationStatus"] = asc.RegistrationStatus } - if aisccvpi.IsRehydrate != nil { - objectMap["isRehydrate"] = aisccvpi.IsRehydrate + if asc.HealthStatus != nil { + objectMap["healthStatus"] = asc.HealthStatus } - if aisccvpi.ProtectedItemType != "" { - objectMap["protectedItemType"] = aisccvpi.ProtectedItemType + if asc.ContainerType != "" { + objectMap["containerType"] = asc.ContainerType } return json.Marshal(objectMap) } -// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { return nil, false } -// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { - return &aisccvpi, true +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { + return nil, false } -// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { return nil, false } -// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { return nil, false } -// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { - return &aisccvpi, true +// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return &asc, true +} + +// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return nil, false } -// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { return nil, false } -// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { return nil, false } -// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { return nil, false } -// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { +// AsDpmContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsDpmContainer() (*DpmContainer, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { +// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { return nil, false } -// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { +// AsGenericContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsGenericContainer() (*GenericContainer, bool) { return nil, false } -// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { +// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { return nil, false } -// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { return nil, false } -// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { +// AsMabContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsMabContainer() (*MabContainer, bool) { return nil, false } -// AsProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { +// AsProtectionContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsProtectionContainer() (*ProtectionContainer, bool) { return nil, false } -// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { - return &aisccvpi, true +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &asc, true } -// AzureIaaSComputeVMContainer iaaS VM workload-specific backup item representing an Azure Resource Manager -// virtual machine. -type AzureIaaSComputeVMContainer struct { - // VirtualMachineID - Fully qualified ARM url of the virtual machine represented by this Azure IaaS VM container. - VirtualMachineID *string `json:"virtualMachineId,omitempty"` - // VirtualMachineVersion - Specifies whether the container represents a Classic or an Azure Resource Manager VM. - VirtualMachineVersion *string `json:"virtualMachineVersion,omitempty"` +// AzureStorageContainer azure Storage Account workload-specific container. +type AzureStorageContainer struct { + // SourceResourceID - Fully qualified ARM url. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // StorageAccountVersion - Storage account version. + StorageAccountVersion *string `json:"storageAccountVersion,omitempty"` // ResourceGroup - Resource group name of Recovery Services Vault. ResourceGroup *string `json:"resourceGroup,omitempty"` + // ProtectedItemCount - Number of items backed up in this container. + ProtectedItemCount *int64 `json:"protectedItemCount,omitempty"` // FriendlyName - Friendly name of the container. FriendlyName *string `json:"friendlyName,omitempty"` // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' @@ -2700,1860 +1847,1589 @@ type AzureIaaSComputeVMContainer struct { ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` } -// MarshalJSON is the custom marshaler for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) MarshalJSON() ([]byte, error) { - aiscvc.ContainerType = ContainerTypeMicrosoftComputevirtualMachines +// MarshalJSON is the custom marshaler for AzureStorageContainer. +func (asc AzureStorageContainer) MarshalJSON() ([]byte, error) { + asc.ContainerType = ContainerTypeStorageContainer1 objectMap := make(map[string]interface{}) - if aiscvc.VirtualMachineID != nil { - objectMap["virtualMachineId"] = aiscvc.VirtualMachineID + if asc.SourceResourceID != nil { + objectMap["sourceResourceId"] = asc.SourceResourceID } - if aiscvc.VirtualMachineVersion != nil { - objectMap["virtualMachineVersion"] = aiscvc.VirtualMachineVersion + if asc.StorageAccountVersion != nil { + objectMap["storageAccountVersion"] = asc.StorageAccountVersion } - if aiscvc.ResourceGroup != nil { - objectMap["resourceGroup"] = aiscvc.ResourceGroup + if asc.ResourceGroup != nil { + objectMap["resourceGroup"] = asc.ResourceGroup } - if aiscvc.FriendlyName != nil { - objectMap["friendlyName"] = aiscvc.FriendlyName + if asc.ProtectedItemCount != nil { + objectMap["protectedItemCount"] = asc.ProtectedItemCount } - if aiscvc.BackupManagementType != "" { - objectMap["backupManagementType"] = aiscvc.BackupManagementType + if asc.FriendlyName != nil { + objectMap["friendlyName"] = asc.FriendlyName } - if aiscvc.RegistrationStatus != nil { - objectMap["registrationStatus"] = aiscvc.RegistrationStatus + if asc.BackupManagementType != "" { + objectMap["backupManagementType"] = asc.BackupManagementType } - if aiscvc.HealthStatus != nil { - objectMap["healthStatus"] = aiscvc.HealthStatus + if asc.RegistrationStatus != nil { + objectMap["registrationStatus"] = asc.RegistrationStatus } - if aiscvc.ContainerType != "" { - objectMap["containerType"] = aiscvc.ContainerType + if asc.HealthStatus != nil { + objectMap["healthStatus"] = asc.HealthStatus + } + if asc.ContainerType != "" { + objectMap["containerType"] = asc.ContainerType } return json.Marshal(objectMap) } -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { return nil, false } -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { return nil, false } -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { - return &aiscvc, true +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { + return nil, false } -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { return nil, false } -// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { +// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { return nil, false } -// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return nil, false +// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return &asc, true } -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { return nil, false } -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { return nil, false } -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { return nil, false } -// AsDpmContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsDpmContainer() (*DpmContainer, bool) { +// AsDpmContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsDpmContainer() (*DpmContainer, bool) { return nil, false } -// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { +// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { return nil, false } -// AsGenericContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsGenericContainer() (*GenericContainer, bool) { +// AsGenericContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsGenericContainer() (*GenericContainer, bool) { return nil, false } -// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { +// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { return nil, false } -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { - return &aiscvc, true +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return nil, false } -// AsMabContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsMabContainer() (*MabContainer, bool) { +// AsMabContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsMabContainer() (*MabContainer, bool) { return nil, false } -// AsProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsProtectionContainer() (*ProtectionContainer, bool) { +// AsProtectionContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsProtectionContainer() (*ProtectionContainer, bool) { return nil, false } -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &aiscvc, true +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &asc, true } -// AzureIaaSComputeVMProtectableItem iaaS VM workload-specific backup item representing the Azure Resource -// Manager VM. -type AzureIaaSComputeVMProtectableItem struct { - // VirtualMachineID - Fully qualified ARM ID of the virtual machine. - VirtualMachineID *string `json:"virtualMachineId,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. +// AzureStorageProtectableContainer azure Storage-specific protectable containers +type AzureStorageProtectableContainer struct { + // FriendlyName - Friendly name of the container. FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseDatabase', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerID - Fabric Id of the container such as ARM Id. + ContainerID *string `json:"containerId,omitempty"` + // ProtectableContainerType - Possible values include: 'ProtectableContainerTypeProtectableContainer', 'ProtectableContainerTypeStorageContainer', 'ProtectableContainerTypeVMAppContainer' + ProtectableContainerType ProtectableContainerType `json:"protectableContainerType,omitempty"` } -// MarshalJSON is the custom marshaler for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) MarshalJSON() ([]byte, error) { - aiscvpi.ProtectableItemType = ProtectableItemTypeMicrosoftComputevirtualMachines +// MarshalJSON is the custom marshaler for AzureStorageProtectableContainer. +func (aspc AzureStorageProtectableContainer) MarshalJSON() ([]byte, error) { + aspc.ProtectableContainerType = ProtectableContainerTypeStorageContainer objectMap := make(map[string]interface{}) - if aiscvpi.VirtualMachineID != nil { - objectMap["virtualMachineId"] = aiscvpi.VirtualMachineID - } - if aiscvpi.BackupManagementType != nil { - objectMap["backupManagementType"] = aiscvpi.BackupManagementType + if aspc.FriendlyName != nil { + objectMap["friendlyName"] = aspc.FriendlyName } - if aiscvpi.WorkloadType != nil { - objectMap["workloadType"] = aiscvpi.WorkloadType + if aspc.BackupManagementType != "" { + objectMap["backupManagementType"] = aspc.BackupManagementType } - if aiscvpi.FriendlyName != nil { - objectMap["friendlyName"] = aiscvpi.FriendlyName + if aspc.HealthStatus != nil { + objectMap["healthStatus"] = aspc.HealthStatus } - if aiscvpi.ProtectionState != "" { - objectMap["protectionState"] = aiscvpi.ProtectionState + if aspc.ContainerID != nil { + objectMap["containerId"] = aspc.ContainerID } - if aiscvpi.ProtectableItemType != "" { - objectMap["protectableItemType"] = aiscvpi.ProtectableItemType + if aspc.ProtectableContainerType != "" { + objectMap["protectableContainerType"] = aspc.ProtectableContainerType } return json.Marshal(objectMap) } -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { - return &aiscvpi, true -} - -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSAPAseDatabaseProtectableItem() (*AzureVMWorkloadSAPAseDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { - return nil, false +// AsAzureStorageProtectableContainer is the BasicProtectableContainer implementation for AzureStorageProtectableContainer. +func (aspc AzureStorageProtectableContainer) AsAzureStorageProtectableContainer() (*AzureStorageProtectableContainer, bool) { + return &aspc, true } -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { +// AsAzureVMAppContainerProtectableContainer is the BasicProtectableContainer implementation for AzureStorageProtectableContainer. +func (aspc AzureStorageProtectableContainer) AsAzureVMAppContainerProtectableContainer() (*AzureVMAppContainerProtectableContainer, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { +// AsProtectableContainer is the BasicProtectableContainer implementation for AzureStorageProtectableContainer. +func (aspc AzureStorageProtectableContainer) AsProtectableContainer() (*ProtectableContainer, bool) { return nil, false } -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { - return nil, false +// AsBasicProtectableContainer is the BasicProtectableContainer implementation for AzureStorageProtectableContainer. +func (aspc AzureStorageProtectableContainer) AsBasicProtectableContainer() (BasicProtectableContainer, bool) { + return &aspc, true } -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { - return nil, false +// AzureVMAppContainerProtectableContainer azure workload-specific container +type AzureVMAppContainerProtectableContainer struct { + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerID - Fabric Id of the container such as ARM Id. + ContainerID *string `json:"containerId,omitempty"` + // ProtectableContainerType - Possible values include: 'ProtectableContainerTypeProtectableContainer', 'ProtectableContainerTypeStorageContainer', 'ProtectableContainerTypeVMAppContainer' + ProtectableContainerType ProtectableContainerType `json:"protectableContainerType,omitempty"` } -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { - return nil, false +// MarshalJSON is the custom marshaler for AzureVMAppContainerProtectableContainer. +func (avacpc AzureVMAppContainerProtectableContainer) MarshalJSON() ([]byte, error) { + avacpc.ProtectableContainerType = ProtectableContainerTypeVMAppContainer + objectMap := make(map[string]interface{}) + if avacpc.FriendlyName != nil { + objectMap["friendlyName"] = avacpc.FriendlyName + } + if avacpc.BackupManagementType != "" { + objectMap["backupManagementType"] = avacpc.BackupManagementType + } + if avacpc.HealthStatus != nil { + objectMap["healthStatus"] = avacpc.HealthStatus + } + if avacpc.ContainerID != nil { + objectMap["containerId"] = avacpc.ContainerID + } + if avacpc.ProtectableContainerType != "" { + objectMap["protectableContainerType"] = avacpc.ProtectableContainerType + } + return json.Marshal(objectMap) } -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { +// AsAzureStorageProtectableContainer is the BasicProtectableContainer implementation for AzureVMAppContainerProtectableContainer. +func (avacpc AzureVMAppContainerProtectableContainer) AsAzureStorageProtectableContainer() (*AzureStorageProtectableContainer, bool) { return nil, false } -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { - return &aiscvpi, true +// AsAzureVMAppContainerProtectableContainer is the BasicProtectableContainer implementation for AzureVMAppContainerProtectableContainer. +func (avacpc AzureVMAppContainerProtectableContainer) AsAzureVMAppContainerProtectableContainer() (*AzureVMAppContainerProtectableContainer, bool) { + return &avacpc, true } -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { +// AsProtectableContainer is the BasicProtectableContainer implementation for AzureVMAppContainerProtectableContainer. +func (avacpc AzureVMAppContainerProtectableContainer) AsProtectableContainer() (*ProtectableContainer, bool) { return nil, false } -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &aiscvpi, true +// AsBasicProtectableContainer is the BasicProtectableContainer implementation for AzureVMAppContainerProtectableContainer. +func (avacpc AzureVMAppContainerProtectableContainer) AsBasicProtectableContainer() (BasicProtectableContainer, bool) { + return &avacpc, true } -// AzureIaaSComputeVMProtectedItem iaaS VM workload-specific backup item representing the Azure Resource -// Manager VM. -type AzureIaaSComputeVMProtectedItem struct { - // FriendlyName - Friendly name of the VM represented by this backup item. +// AzureVMAppContainerProtectionContainer container for SQL workloads under Azure Virtual Machines. +type AzureVMAppContainerProtectionContainer struct { + // SourceResourceID - ARM ID of the virtual machine represented by this Azure Workload Container + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // LastUpdatedTime - Time stamp when this container was updated. + LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"` + // ExtendedInfo - Additional details of a workload container. + ExtendedInfo *AzureWorkloadContainerExtendedInfo `json:"extendedInfo,omitempty"` + // WorkloadType - Workload type for which registration was sent. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' + WorkloadType WorkloadType `json:"workloadType,omitempty"` + // OperationType - Re-Do Operation. Possible values include: 'OperationTypeInvalid', 'OperationTypeRegister', 'OperationTypeReregister' + OperationType OperationType `json:"operationType,omitempty"` + // FriendlyName - Friendly name of the container. FriendlyName *string `json:"friendlyName,omitempty"` - // VirtualMachineID - Fully qualified ARM ID of the virtual machine represented by this item. - VirtualMachineID *string `json:"virtualMachineId,omitempty"` - // ProtectionStatus - Backup status of this backup item. - ProtectionStatus *string `json:"protectionStatus,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' - ProtectionState ProtectionState `json:"protectionState,omitempty"` - // HealthStatus - Health status of protected item. Possible values include: 'HealthStatusPassed', 'HealthStatusActionRequired', 'HealthStatusActionSuggested', 'HealthStatusInvalid' - HealthStatus HealthStatus `json:"healthStatus,omitempty"` - // HealthDetails - Health details on this backup item. - HealthDetails *[]AzureIaaSVMHealthDetails `json:"healthDetails,omitempty"` - // LastBackupStatus - Last backup operation status. - LastBackupStatus *string `json:"lastBackupStatus,omitempty"` - // LastBackupTime - Timestamp of the last backup operation on this backup item. - LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` - // ProtectedItemDataID - Data ID of the protected item. - ProtectedItemDataID *string `json:"protectedItemDataId,omitempty"` - // ExtendedInfo - Additional information for this backup item. - ExtendedInfo *AzureIaaSVMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - WorkloadType DataSourceType `json:"workloadType,omitempty"` - // ContainerName - Unique name of container - ContainerName *string `json:"containerName,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. - LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` - // BackupSetName - Name of the backup set the backup item belongs to - BackupSetName *string `json:"backupSetName,omitempty"` - // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' - CreateMode CreateMode `json:"createMode,omitempty"` - // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC - DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` - // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state - IsRehydrate *bool `json:"isRehydrate,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' - ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureIaaSComputeVMProtectedItem. -func (aiscvpi AzureIaaSComputeVMProtectedItem) MarshalJSON() ([]byte, error) { - aiscvpi.ProtectedItemType = ProtectedItemTypeMicrosoftComputevirtualMachines + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) MarshalJSON() ([]byte, error) { + avacpc.ContainerType = ContainerTypeVMAppContainer1 objectMap := make(map[string]interface{}) - if aiscvpi.FriendlyName != nil { - objectMap["friendlyName"] = aiscvpi.FriendlyName - } - if aiscvpi.VirtualMachineID != nil { - objectMap["virtualMachineId"] = aiscvpi.VirtualMachineID - } - if aiscvpi.ProtectionStatus != nil { - objectMap["protectionStatus"] = aiscvpi.ProtectionStatus - } - if aiscvpi.ProtectionState != "" { - objectMap["protectionState"] = aiscvpi.ProtectionState - } - if aiscvpi.HealthStatus != "" { - objectMap["healthStatus"] = aiscvpi.HealthStatus - } - if aiscvpi.HealthDetails != nil { - objectMap["healthDetails"] = aiscvpi.HealthDetails - } - if aiscvpi.LastBackupStatus != nil { - objectMap["lastBackupStatus"] = aiscvpi.LastBackupStatus - } - if aiscvpi.LastBackupTime != nil { - objectMap["lastBackupTime"] = aiscvpi.LastBackupTime - } - if aiscvpi.ProtectedItemDataID != nil { - objectMap["protectedItemDataId"] = aiscvpi.ProtectedItemDataID - } - if aiscvpi.ExtendedInfo != nil { - objectMap["extendedInfo"] = aiscvpi.ExtendedInfo - } - if aiscvpi.BackupManagementType != "" { - objectMap["backupManagementType"] = aiscvpi.BackupManagementType - } - if aiscvpi.WorkloadType != "" { - objectMap["workloadType"] = aiscvpi.WorkloadType - } - if aiscvpi.ContainerName != nil { - objectMap["containerName"] = aiscvpi.ContainerName - } - if aiscvpi.SourceResourceID != nil { - objectMap["sourceResourceId"] = aiscvpi.SourceResourceID - } - if aiscvpi.PolicyID != nil { - objectMap["policyId"] = aiscvpi.PolicyID + if avacpc.SourceResourceID != nil { + objectMap["sourceResourceId"] = avacpc.SourceResourceID } - if aiscvpi.LastRecoveryPoint != nil { - objectMap["lastRecoveryPoint"] = aiscvpi.LastRecoveryPoint + if avacpc.LastUpdatedTime != nil { + objectMap["lastUpdatedTime"] = avacpc.LastUpdatedTime } - if aiscvpi.BackupSetName != nil { - objectMap["backupSetName"] = aiscvpi.BackupSetName + if avacpc.ExtendedInfo != nil { + objectMap["extendedInfo"] = avacpc.ExtendedInfo } - if aiscvpi.CreateMode != "" { - objectMap["createMode"] = aiscvpi.CreateMode + if avacpc.WorkloadType != "" { + objectMap["workloadType"] = avacpc.WorkloadType } - if aiscvpi.DeferredDeleteTimeInUTC != nil { - objectMap["deferredDeleteTimeInUTC"] = aiscvpi.DeferredDeleteTimeInUTC + if avacpc.OperationType != "" { + objectMap["operationType"] = avacpc.OperationType } - if aiscvpi.IsScheduledForDeferredDelete != nil { - objectMap["isScheduledForDeferredDelete"] = aiscvpi.IsScheduledForDeferredDelete + if avacpc.FriendlyName != nil { + objectMap["friendlyName"] = avacpc.FriendlyName } - if aiscvpi.DeferredDeleteTimeRemaining != nil { - objectMap["deferredDeleteTimeRemaining"] = aiscvpi.DeferredDeleteTimeRemaining + if avacpc.BackupManagementType != "" { + objectMap["backupManagementType"] = avacpc.BackupManagementType } - if aiscvpi.IsDeferredDeleteScheduleUpcoming != nil { - objectMap["isDeferredDeleteScheduleUpcoming"] = aiscvpi.IsDeferredDeleteScheduleUpcoming + if avacpc.RegistrationStatus != nil { + objectMap["registrationStatus"] = avacpc.RegistrationStatus } - if aiscvpi.IsRehydrate != nil { - objectMap["isRehydrate"] = aiscvpi.IsRehydrate + if avacpc.HealthStatus != nil { + objectMap["healthStatus"] = avacpc.HealthStatus } - if aiscvpi.ProtectedItemType != "" { - objectMap["protectedItemType"] = aiscvpi.ProtectedItemType + if avacpc.ContainerType != "" { + objectMap["containerType"] = avacpc.ContainerType } return json.Marshal(objectMap) } -// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. -func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { return nil, false } -// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. -func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { return nil, false } -// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. -func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { - return &aiscvpi, true +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { + return nil, false } -// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. -func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { return nil, false } -// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. -func (aiscvpi AzureIaaSComputeVMProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { - return &aiscvpi, true +// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return nil, false } -// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. -func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { +// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { return nil, false } -// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. -func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { - return nil, false +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { + return &avacpc, true } -// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. -func (aiscvpi AzureIaaSComputeVMProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { return nil, false } -// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. -func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { - return nil, false +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return &avacpc, true } -// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. -func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { +// AsDpmContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsDpmContainer() (*DpmContainer, bool) { return nil, false } -// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. -func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { +// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { return nil, false } -// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. -func (aiscvpi AzureIaaSComputeVMProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { +// AsGenericContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsGenericContainer() (*GenericContainer, bool) { return nil, false } -// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. -func (aiscvpi AzureIaaSComputeVMProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { +// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { return nil, false } -// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. -func (aiscvpi AzureIaaSComputeVMProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { return nil, false } -// AsProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. -func (aiscvpi AzureIaaSComputeVMProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { +// AsMabContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsMabContainer() (*MabContainer, bool) { return nil, false } -// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. -func (aiscvpi AzureIaaSComputeVMProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { - return &aiscvpi, true +// AsProtectionContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return nil, false } -// AzureIaaSVMHealthDetails azure IaaS VM workload-specific Health Details. -type AzureIaaSVMHealthDetails struct { - // Code - Health Code - Code *int32 `json:"code,omitempty"` - // Title - Health Title - Title *string `json:"title,omitempty"` - // Message - Health Message - Message *string `json:"message,omitempty"` - // Recommendations - Health Recommended Actions - Recommendations *[]string `json:"recommendations,omitempty"` +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &avacpc, true } -// BasicAzureIaaSVMProtectedItem iaaS VM workload-specific backup item. -type BasicAzureIaaSVMProtectedItem interface { - AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) - AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) - AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) +// BasicAzureVMWorkloadItem azure VM workload-specific workload item. +type BasicAzureVMWorkloadItem interface { + AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) + AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) + AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) + AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) + AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) + AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) + AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) } -// AzureIaaSVMProtectedItem iaaS VM workload-specific backup item. -type AzureIaaSVMProtectedItem struct { - // FriendlyName - Friendly name of the VM represented by this backup item. +// AzureVMWorkloadItem azure VM workload-specific workload item. +type AzureVMWorkloadItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // IsAutoProtectable - Indicates if workload item is auto-protectable + IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // Subinquireditemcount - For instance or AG, indicates number of DB's present + Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` + // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected + SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. FriendlyName *string `json:"friendlyName,omitempty"` - // VirtualMachineID - Fully qualified ARM ID of the virtual machine represented by this item. - VirtualMachineID *string `json:"virtualMachineId,omitempty"` - // ProtectionStatus - Backup status of this backup item. - ProtectionStatus *string `json:"protectionStatus,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' - ProtectionState ProtectionState `json:"protectionState,omitempty"` - // HealthStatus - Health status of protected item. Possible values include: 'HealthStatusPassed', 'HealthStatusActionRequired', 'HealthStatusActionSuggested', 'HealthStatusInvalid' - HealthStatus HealthStatus `json:"healthStatus,omitempty"` - // HealthDetails - Health details on this backup item. - HealthDetails *[]AzureIaaSVMHealthDetails `json:"healthDetails,omitempty"` - // LastBackupStatus - Last backup operation status. - LastBackupStatus *string `json:"lastBackupStatus,omitempty"` - // LastBackupTime - Timestamp of the last backup operation on this backup item. - LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` - // ProtectedItemDataID - Data ID of the protected item. - ProtectedItemDataID *string `json:"protectedItemDataId,omitempty"` - // ExtendedInfo - Additional information for this backup item. - ExtendedInfo *AzureIaaSVMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - WorkloadType DataSourceType `json:"workloadType,omitempty"` - // ContainerName - Unique name of container - ContainerName *string `json:"containerName,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. - LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` - // BackupSetName - Name of the backup set the backup item belongs to - BackupSetName *string `json:"backupSetName,omitempty"` - // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' - CreateMode CreateMode `json:"createMode,omitempty"` - // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC - DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` - // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state - IsRehydrate *bool `json:"isRehydrate,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' - ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` -} - -func unmarshalBasicAzureIaaSVMProtectedItem(body []byte) (BasicAzureIaaSVMProtectedItem, error) { + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' + WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` +} + +func unmarshalBasicAzureVMWorkloadItem(body []byte) (BasicAzureVMWorkloadItem, error) { var m map[string]interface{} err := json.Unmarshal(body, &m) if err != nil { return nil, err } - switch m["protectedItemType"] { - case string(ProtectedItemTypeMicrosoftClassicComputevirtualMachines): - var aisccvpi AzureIaaSClassicComputeVMProtectedItem - err := json.Unmarshal(body, &aisccvpi) - return aisccvpi, err - case string(ProtectedItemTypeMicrosoftComputevirtualMachines): - var aiscvpi AzureIaaSComputeVMProtectedItem - err := json.Unmarshal(body, &aiscvpi) - return aiscvpi, err + switch m["workloadItemType"] { + case string(WorkloadItemTypeSAPAseDatabase1): + var avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem + err := json.Unmarshal(body, &avwsadwi) + return avwsadwi, err + case string(WorkloadItemTypeSAPAseSystem1): + var avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem + err := json.Unmarshal(body, &avwsaswi) + return avwsaswi, err + case string(WorkloadItemTypeSAPHanaDatabase1): + var avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem + err := json.Unmarshal(body, &avwshdwi) + return avwshdwi, err + case string(WorkloadItemTypeSAPHanaSystem1): + var avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem + err := json.Unmarshal(body, &avwshswi) + return avwshswi, err + case string(WorkloadItemTypeSQLDataBase1): + var avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem + err := json.Unmarshal(body, &avwsdwi) + return avwsdwi, err + case string(WorkloadItemTypeSQLInstance1): + var avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem + err := json.Unmarshal(body, &avwsiwi) + return avwsiwi, err default: - var aispi AzureIaaSVMProtectedItem - err := json.Unmarshal(body, &aispi) - return aispi, err + var avwi AzureVMWorkloadItem + err := json.Unmarshal(body, &avwi) + return avwi, err } } -func unmarshalBasicAzureIaaSVMProtectedItemArray(body []byte) ([]BasicAzureIaaSVMProtectedItem, error) { +func unmarshalBasicAzureVMWorkloadItemArray(body []byte) ([]BasicAzureVMWorkloadItem, error) { var rawMessages []*json.RawMessage err := json.Unmarshal(body, &rawMessages) if err != nil { return nil, err } - aispiArray := make([]BasicAzureIaaSVMProtectedItem, len(rawMessages)) + avwiArray := make([]BasicAzureVMWorkloadItem, len(rawMessages)) for index, rawMessage := range rawMessages { - aispi, err := unmarshalBasicAzureIaaSVMProtectedItem(*rawMessage) + avwi, err := unmarshalBasicAzureVMWorkloadItem(*rawMessage) if err != nil { return nil, err } - aispiArray[index] = aispi + avwiArray[index] = avwi } - return aispiArray, nil + return avwiArray, nil } -// MarshalJSON is the custom marshaler for AzureIaaSVMProtectedItem. -func (aispi AzureIaaSVMProtectedItem) MarshalJSON() ([]byte, error) { - aispi.ProtectedItemType = ProtectedItemTypeAzureIaaSVMProtectedItem +// MarshalJSON is the custom marshaler for AzureVMWorkloadItem. +func (avwi AzureVMWorkloadItem) MarshalJSON() ([]byte, error) { + avwi.WorkloadItemType = WorkloadItemTypeAzureVMWorkloadItem objectMap := make(map[string]interface{}) - if aispi.FriendlyName != nil { - objectMap["friendlyName"] = aispi.FriendlyName - } - if aispi.VirtualMachineID != nil { - objectMap["virtualMachineId"] = aispi.VirtualMachineID - } - if aispi.ProtectionStatus != nil { - objectMap["protectionStatus"] = aispi.ProtectionStatus - } - if aispi.ProtectionState != "" { - objectMap["protectionState"] = aispi.ProtectionState - } - if aispi.HealthStatus != "" { - objectMap["healthStatus"] = aispi.HealthStatus - } - if aispi.HealthDetails != nil { - objectMap["healthDetails"] = aispi.HealthDetails - } - if aispi.LastBackupStatus != nil { - objectMap["lastBackupStatus"] = aispi.LastBackupStatus - } - if aispi.LastBackupTime != nil { - objectMap["lastBackupTime"] = aispi.LastBackupTime - } - if aispi.ProtectedItemDataID != nil { - objectMap["protectedItemDataId"] = aispi.ProtectedItemDataID - } - if aispi.ExtendedInfo != nil { - objectMap["extendedInfo"] = aispi.ExtendedInfo - } - if aispi.BackupManagementType != "" { - objectMap["backupManagementType"] = aispi.BackupManagementType - } - if aispi.WorkloadType != "" { - objectMap["workloadType"] = aispi.WorkloadType - } - if aispi.ContainerName != nil { - objectMap["containerName"] = aispi.ContainerName - } - if aispi.SourceResourceID != nil { - objectMap["sourceResourceId"] = aispi.SourceResourceID - } - if aispi.PolicyID != nil { - objectMap["policyId"] = aispi.PolicyID + if avwi.ParentName != nil { + objectMap["parentName"] = avwi.ParentName } - if aispi.LastRecoveryPoint != nil { - objectMap["lastRecoveryPoint"] = aispi.LastRecoveryPoint + if avwi.ServerName != nil { + objectMap["serverName"] = avwi.ServerName } - if aispi.BackupSetName != nil { - objectMap["backupSetName"] = aispi.BackupSetName + if avwi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwi.IsAutoProtectable } - if aispi.CreateMode != "" { - objectMap["createMode"] = aispi.CreateMode + if avwi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwi.Subinquireditemcount } - if aispi.DeferredDeleteTimeInUTC != nil { - objectMap["deferredDeleteTimeInUTC"] = aispi.DeferredDeleteTimeInUTC + if avwi.SubWorkloadItemCount != nil { + objectMap["subWorkloadItemCount"] = avwi.SubWorkloadItemCount } - if aispi.IsScheduledForDeferredDelete != nil { - objectMap["isScheduledForDeferredDelete"] = aispi.IsScheduledForDeferredDelete + if avwi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwi.BackupManagementType } - if aispi.DeferredDeleteTimeRemaining != nil { - objectMap["deferredDeleteTimeRemaining"] = aispi.DeferredDeleteTimeRemaining + if avwi.WorkloadType != nil { + objectMap["workloadType"] = avwi.WorkloadType } - if aispi.IsDeferredDeleteScheduleUpcoming != nil { - objectMap["isDeferredDeleteScheduleUpcoming"] = aispi.IsDeferredDeleteScheduleUpcoming + if avwi.FriendlyName != nil { + objectMap["friendlyName"] = avwi.FriendlyName } - if aispi.IsRehydrate != nil { - objectMap["isRehydrate"] = aispi.IsRehydrate + if avwi.ProtectionState != "" { + objectMap["protectionState"] = avwi.ProtectionState } - if aispi.ProtectedItemType != "" { - objectMap["protectedItemType"] = aispi.ProtectedItemType + if avwi.WorkloadItemType != "" { + objectMap["workloadItemType"] = avwi.WorkloadItemType } return json.Marshal(objectMap) } -// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. -func (aispi AzureIaaSVMProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. -func (aispi AzureIaaSVMProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. -func (aispi AzureIaaSVMProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. -func (aispi AzureIaaSVMProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { - return &aispi, true -} - -// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. -func (aispi AzureIaaSVMProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { - return &aispi, true -} - -// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. -func (aispi AzureIaaSVMProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. -func (aispi AzureIaaSVMProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { - return nil, false +// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. +func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { + return &avwi, true } -// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. -func (aispi AzureIaaSVMProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { - return nil, false +// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. +func (avwi AzureVMWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { + return &avwi, true } -// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. -func (aispi AzureIaaSVMProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { +// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. +func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. -func (aispi AzureIaaSVMProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { +// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. +func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { return nil, false } -// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. -func (aispi AzureIaaSVMProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { +// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. +func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { return nil, false } -// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. -func (aispi AzureIaaSVMProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { +// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. +func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { return nil, false } -// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. -func (aispi AzureIaaSVMProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { +// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. +func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { return nil, false } -// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. -func (aispi AzureIaaSVMProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { +// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. +func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { return nil, false } -// AsProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. -func (aispi AzureIaaSVMProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { +// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. +func (avwi AzureVMWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { return nil, false } -// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. -func (aispi AzureIaaSVMProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { - return &aispi, true +// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. +func (avwi AzureVMWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { + return &avwi, true } -// AzureIaaSVMProtectedItemExtendedInfo additional information on Azure IaaS VM specific backup item. -type AzureIaaSVMProtectedItemExtendedInfo struct { - // OldestRecoveryPoint - The oldest backup copy available for this backup item. - OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"` - // RecoveryPointCount - Number of backup copies available for this backup item. - RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"` - // PolicyInconsistent - Specifies if backup policy associated with the backup item is inconsistent. - PolicyInconsistent *bool `json:"policyInconsistent,omitempty"` +// BasicAzureVMWorkloadProtectableItem azure VM workload-specific protectable item. +type BasicAzureVMWorkloadProtectableItem interface { + AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) + AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) + AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) + AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) + AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) + AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) + AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) } -// AzureIaaSVMProtectionPolicy iaaS VM workload-specific backup policy. -type AzureIaaSVMProtectionPolicy struct { - // SchedulePolicy - Backup schedule specified as part of backup policy. - SchedulePolicy BasicSchedulePolicy `json:"schedulePolicy,omitempty"` - // RetentionPolicy - Retention policy with the details on backup copy retention ranges. - RetentionPolicy BasicRetentionPolicy `json:"retentionPolicy,omitempty"` - // InstantRpRetentionRangeInDays - Instant RP retention policy range in days - InstantRpRetentionRangeInDays *int32 `json:"instantRpRetentionRangeInDays,omitempty"` - // TimeZone - TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". - TimeZone *string `json:"timeZone,omitempty"` - // ProtectedItemsCount - Number of items associated with this policy. - ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` - // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' - BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` +// AzureVMWorkloadProtectableItem azure VM workload-specific protectable item. +type AzureVMWorkloadProtectableItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent + // Only Applicable for data bases where the parent would be either Instance or a SQL AG. + ParentUniqueName *string `json:"parentUniqueName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // IsAutoProtectable - Indicates if protectable item is auto-protectable + IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // IsAutoProtected - Indicates if protectable item is auto-protected + IsAutoProtected *bool `json:"isAutoProtected,omitempty"` + // Subinquireditemcount - For instance or AG, indicates number of DB's present + Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` + // Subprotectableitemcount - For instance or AG, indicates number of DB's to be protected + Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` + // Prebackupvalidation - Pre-backup validation for protectable objects + Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` } -// MarshalJSON is the custom marshaler for AzureIaaSVMProtectionPolicy. -func (aispp AzureIaaSVMProtectionPolicy) MarshalJSON() ([]byte, error) { - aispp.BackupManagementType = BackupManagementTypeAzureIaasVM - objectMap := make(map[string]interface{}) - objectMap["schedulePolicy"] = aispp.SchedulePolicy - objectMap["retentionPolicy"] = aispp.RetentionPolicy - if aispp.InstantRpRetentionRangeInDays != nil { - objectMap["instantRpRetentionRangeInDays"] = aispp.InstantRpRetentionRangeInDays - } - if aispp.TimeZone != nil { - objectMap["timeZone"] = aispp.TimeZone - } - if aispp.ProtectedItemsCount != nil { - objectMap["protectedItemsCount"] = aispp.ProtectedItemsCount - } - if aispp.BackupManagementType != "" { - objectMap["backupManagementType"] = aispp.BackupManagementType +func unmarshalBasicAzureVMWorkloadProtectableItem(body []byte) (BasicAzureVMWorkloadProtectableItem, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err } - return json.Marshal(objectMap) -} - -// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy. -func (aispp AzureIaaSVMProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { - return nil, false -} - -// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy. -func (aispp AzureIaaSVMProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { - return &aispp, true -} -// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy. -func (aispp AzureIaaSVMProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy. -func (aispp AzureIaaSVMProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { - return nil, false -} - -// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy. -func (aispp AzureIaaSVMProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { - return nil, false -} - -// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy. -func (aispp AzureIaaSVMProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { - return nil, false -} - -// AsProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy. -func (aispp AzureIaaSVMProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { - return nil, false -} - -// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy. -func (aispp AzureIaaSVMProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { - return &aispp, true + switch m["protectableItemType"] { + case string(ProtectableItemTypeSAPAseSystem): + var avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem + err := json.Unmarshal(body, &avwsaspi) + return avwsaspi, err + case string(ProtectableItemTypeSAPHanaDatabase): + var avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem + err := json.Unmarshal(body, &avwshdpi) + return avwshdpi, err + case string(ProtectableItemTypeSAPHanaSystem): + var avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem + err := json.Unmarshal(body, &avwshspi) + return avwshspi, err + case string(ProtectableItemTypeSQLAvailabilityGroupContainer): + var avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem + err := json.Unmarshal(body, &avwsagpi) + return avwsagpi, err + case string(ProtectableItemTypeSQLDataBase): + var avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem + err := json.Unmarshal(body, &avwsdpi) + return avwsdpi, err + case string(ProtectableItemTypeSQLInstance): + var avwsipi AzureVMWorkloadSQLInstanceProtectableItem + err := json.Unmarshal(body, &avwsipi) + return avwsipi, err + default: + var avwpi AzureVMWorkloadProtectableItem + err := json.Unmarshal(body, &avwpi) + return avwpi, err + } } - -// UnmarshalJSON is the custom unmarshaler for AzureIaaSVMProtectionPolicy struct. -func (aispp *AzureIaaSVMProtectionPolicy) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) +func unmarshalBasicAzureVMWorkloadProtectableItemArray(body []byte) ([]BasicAzureVMWorkloadProtectableItem, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) if err != nil { - return err - } - for k, v := range m { - switch k { - case "schedulePolicy": - if v != nil { - schedulePolicy, err := unmarshalBasicSchedulePolicy(*v) - if err != nil { - return err - } - aispp.SchedulePolicy = schedulePolicy - } - case "retentionPolicy": - if v != nil { - retentionPolicy, err := unmarshalBasicRetentionPolicy(*v) - if err != nil { - return err - } - aispp.RetentionPolicy = retentionPolicy - } - case "instantRpRetentionRangeInDays": - if v != nil { - var instantRpRetentionRangeInDays int32 - err = json.Unmarshal(*v, &instantRpRetentionRangeInDays) - if err != nil { - return err - } - aispp.InstantRpRetentionRangeInDays = &instantRpRetentionRangeInDays - } - case "timeZone": - if v != nil { - var timeZone string - err = json.Unmarshal(*v, &timeZone) - if err != nil { - return err - } - aispp.TimeZone = &timeZone - } - case "protectedItemsCount": - if v != nil { - var protectedItemsCount int32 - err = json.Unmarshal(*v, &protectedItemsCount) - if err != nil { - return err - } - aispp.ProtectedItemsCount = &protectedItemsCount - } - case "backupManagementType": - if v != nil { - var backupManagementType ManagementTypeBasicProtectionPolicy - err = json.Unmarshal(*v, &backupManagementType) - if err != nil { - return err - } - aispp.BackupManagementType = backupManagementType - } - } + return nil, err } - return nil -} + avwpiArray := make([]BasicAzureVMWorkloadProtectableItem, len(rawMessages)) -// AzureSQLAGWorkloadContainerProtectionContainer container for SQL workloads under SQL Availability Group. -type AzureSQLAGWorkloadContainerProtectionContainer struct { - // SourceResourceID - ARM ID of the virtual machine represented by this Azure Workload Container - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // LastUpdatedTime - Time stamp when this container was updated. - LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"` - // ExtendedInfo - Additional details of a workload container. - ExtendedInfo *AzureWorkloadContainerExtendedInfo `json:"extendedInfo,omitempty"` - // WorkloadType - Workload type for which registration was sent. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' - WorkloadType WorkloadType `json:"workloadType,omitempty"` - // OperationType - Re-Do Operation. Possible values include: 'OperationTypeInvalid', 'OperationTypeRegister', 'OperationTypeReregister' - OperationType OperationType `json:"operationType,omitempty"` - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` + for index, rawMessage := range rawMessages { + avwpi, err := unmarshalBasicAzureVMWorkloadProtectableItem(*rawMessage) + if err != nil { + return nil, err + } + avwpiArray[index] = avwpi + } + return avwpiArray, nil } -// MarshalJSON is the custom marshaler for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) MarshalJSON() ([]byte, error) { - aswcpc.ContainerType = ContainerTypeSQLAGWorkLoadContainer1 +// MarshalJSON is the custom marshaler for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) MarshalJSON() ([]byte, error) { + avwpi.ProtectableItemType = ProtectableItemTypeAzureVMWorkloadProtectableItem objectMap := make(map[string]interface{}) - if aswcpc.SourceResourceID != nil { - objectMap["sourceResourceId"] = aswcpc.SourceResourceID + if avwpi.ParentName != nil { + objectMap["parentName"] = avwpi.ParentName } - if aswcpc.LastUpdatedTime != nil { - objectMap["lastUpdatedTime"] = aswcpc.LastUpdatedTime + if avwpi.ParentUniqueName != nil { + objectMap["parentUniqueName"] = avwpi.ParentUniqueName } - if aswcpc.ExtendedInfo != nil { - objectMap["extendedInfo"] = aswcpc.ExtendedInfo + if avwpi.ServerName != nil { + objectMap["serverName"] = avwpi.ServerName } - if aswcpc.WorkloadType != "" { - objectMap["workloadType"] = aswcpc.WorkloadType + if avwpi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwpi.IsAutoProtectable } - if aswcpc.OperationType != "" { - objectMap["operationType"] = aswcpc.OperationType + if avwpi.IsAutoProtected != nil { + objectMap["isAutoProtected"] = avwpi.IsAutoProtected } - if aswcpc.FriendlyName != nil { - objectMap["friendlyName"] = aswcpc.FriendlyName + if avwpi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwpi.Subinquireditemcount } - if aswcpc.BackupManagementType != "" { - objectMap["backupManagementType"] = aswcpc.BackupManagementType + if avwpi.Subprotectableitemcount != nil { + objectMap["subprotectableitemcount"] = avwpi.Subprotectableitemcount } - if aswcpc.RegistrationStatus != nil { - objectMap["registrationStatus"] = aswcpc.RegistrationStatus + if avwpi.Prebackupvalidation != nil { + objectMap["prebackupvalidation"] = avwpi.Prebackupvalidation } - if aswcpc.HealthStatus != nil { - objectMap["healthStatus"] = aswcpc.HealthStatus + if avwpi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwpi.BackupManagementType } - if aswcpc.ContainerType != "" { - objectMap["containerType"] = aswcpc.ContainerType + if avwpi.WorkloadType != nil { + objectMap["workloadType"] = avwpi.WorkloadType + } + if avwpi.FriendlyName != nil { + objectMap["friendlyName"] = avwpi.FriendlyName + } + if avwpi.ProtectionState != "" { + objectMap["protectionState"] = avwpi.ProtectionState + } + if avwpi.ProtectableItemType != "" { + objectMap["protectableItemType"] = avwpi.ProtectableItemType } return json.Marshal(objectMap) } -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { return nil, false } -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { return nil, false } -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { return nil, false } -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { - return &aswcpc, true -} - -// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return nil, false +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { + return &avwpi, true } -// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return nil, false +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { + return &avwpi, true } -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { +// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { return nil, false } -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { return nil, false } -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return &aswcpc, true -} - -// AsDpmContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsDpmContainer() (*DpmContainer, bool) { +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { return nil, false } -// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { return nil, false } -// AsGenericContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsGenericContainer() (*GenericContainer, bool) { +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { return nil, false } -// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { return nil, false } -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { return nil, false } -// AsMabContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsMabContainer() (*MabContainer, bool) { +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { return nil, false } -// AsProtectionContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsProtectionContainer() (*ProtectionContainer, bool) { +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { return nil, false } -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &aswcpc, true +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &avwpi, true } -// AzureSQLContainer azure Sql workload-specific container. -type AzureSQLContainer struct { - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +// AzureVMWorkloadSAPAseDatabaseWorkloadItem azure VM workload-specific workload item representing SAP ASE +// Database. +type AzureVMWorkloadSAPAseDatabaseWorkloadItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // IsAutoProtectable - Indicates if workload item is auto-protectable + IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // Subinquireditemcount - For instance or AG, indicates number of DB's present + Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` + // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected + SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' + WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` } -// MarshalJSON is the custom marshaler for AzureSQLContainer. -func (asc AzureSQLContainer) MarshalJSON() ([]byte, error) { - asc.ContainerType = ContainerTypeAzureSQLContainer1 +// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPAseDatabaseWorkloadItem. +func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) MarshalJSON() ([]byte, error) { + avwsadwi.WorkloadItemType = WorkloadItemTypeSAPAseDatabase1 objectMap := make(map[string]interface{}) - if asc.FriendlyName != nil { - objectMap["friendlyName"] = asc.FriendlyName + if avwsadwi.ParentName != nil { + objectMap["parentName"] = avwsadwi.ParentName } - if asc.BackupManagementType != "" { - objectMap["backupManagementType"] = asc.BackupManagementType + if avwsadwi.ServerName != nil { + objectMap["serverName"] = avwsadwi.ServerName } - if asc.RegistrationStatus != nil { - objectMap["registrationStatus"] = asc.RegistrationStatus + if avwsadwi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwsadwi.IsAutoProtectable } - if asc.HealthStatus != nil { - objectMap["healthStatus"] = asc.HealthStatus + if avwsadwi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwsadwi.Subinquireditemcount } - if asc.ContainerType != "" { - objectMap["containerType"] = asc.ContainerType + if avwsadwi.SubWorkloadItemCount != nil { + objectMap["subWorkloadItemCount"] = avwsadwi.SubWorkloadItemCount + } + if avwsadwi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwsadwi.BackupManagementType + } + if avwsadwi.WorkloadType != nil { + objectMap["workloadType"] = avwsadwi.WorkloadType + } + if avwsadwi.FriendlyName != nil { + objectMap["friendlyName"] = avwsadwi.FriendlyName + } + if avwsadwi.ProtectionState != "" { + objectMap["protectionState"] = avwsadwi.ProtectionState + } + if avwsadwi.WorkloadItemType != "" { + objectMap["workloadItemType"] = avwsadwi.WorkloadItemType } return json.Marshal(objectMap) } -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { - return nil, false -} - -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return &asc, true -} - -// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return nil, false -} - -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { +// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. +func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { return nil, false } -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { - return nil, false +// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. +func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { + return &avwsadwi, true } -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return nil, false +// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. +func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { + return &avwsadwi, true } -// AsDpmContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsDpmContainer() (*DpmContainer, bool) { +// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. +func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { return nil, false } -// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { +// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. +func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { return nil, false } -// AsGenericContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsGenericContainer() (*GenericContainer, bool) { +// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. +func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { return nil, false } -// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { +// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. +func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { return nil, false } -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { +// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. +func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { return nil, false } -// AsMabContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsMabContainer() (*MabContainer, bool) { +// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. +func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { return nil, false } -// AsProtectionContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsProtectionContainer() (*ProtectionContainer, bool) { - return nil, false +// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. +func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { + return &avwsadwi, true } -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &asc, true +// AzureVMWorkloadSAPAseSystemProtectableItem azure VM workload-specific protectable item representing SAP +// ASE System. +type AzureVMWorkloadSAPAseSystemProtectableItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent + // Only Applicable for data bases where the parent would be either Instance or a SQL AG. + ParentUniqueName *string `json:"parentUniqueName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // IsAutoProtectable - Indicates if protectable item is auto-protectable + IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // IsAutoProtected - Indicates if protectable item is auto-protected + IsAutoProtected *bool `json:"isAutoProtected,omitempty"` + // Subinquireditemcount - For instance or AG, indicates number of DB's present + Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` + // Subprotectableitemcount - For instance or AG, indicates number of DB's to be protected + Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` + // Prebackupvalidation - Pre-backup validation for protectable objects + Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` } -// AzureSQLProtectedItem azure SQL workload-specific backup item. -type AzureSQLProtectedItem struct { - // ProtectedItemDataID - Internal ID of a backup item. Used by Azure SQL Backup engine to contact Recovery Services. - ProtectedItemDataID *string `json:"protectedItemDataId,omitempty"` - // ProtectionState - Backup state of the backed up item. Possible values include: 'ProtectedItemStateInvalid', 'ProtectedItemStateIRPending', 'ProtectedItemStateProtected', 'ProtectedItemStateProtectionError', 'ProtectedItemStateProtectionStopped', 'ProtectedItemStateProtectionPaused' - ProtectionState ProtectedItemState `json:"protectionState,omitempty"` - // ExtendedInfo - Additional information for this backup item. - ExtendedInfo *AzureSQLProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - WorkloadType DataSourceType `json:"workloadType,omitempty"` - // ContainerName - Unique name of container - ContainerName *string `json:"containerName,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. - LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` - // BackupSetName - Name of the backup set the backup item belongs to - BackupSetName *string `json:"backupSetName,omitempty"` - // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' - CreateMode CreateMode `json:"createMode,omitempty"` - // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC - DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` - // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state - IsRehydrate *bool `json:"isRehydrate,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' - ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) MarshalJSON() ([]byte, error) { - aspi.ProtectedItemType = ProtectedItemTypeMicrosoftSqlserversdatabases +// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) MarshalJSON() ([]byte, error) { + avwsaspi.ProtectableItemType = ProtectableItemTypeSAPAseSystem objectMap := make(map[string]interface{}) - if aspi.ProtectedItemDataID != nil { - objectMap["protectedItemDataId"] = aspi.ProtectedItemDataID - } - if aspi.ProtectionState != "" { - objectMap["protectionState"] = aspi.ProtectionState - } - if aspi.ExtendedInfo != nil { - objectMap["extendedInfo"] = aspi.ExtendedInfo - } - if aspi.BackupManagementType != "" { - objectMap["backupManagementType"] = aspi.BackupManagementType - } - if aspi.WorkloadType != "" { - objectMap["workloadType"] = aspi.WorkloadType + if avwsaspi.ParentName != nil { + objectMap["parentName"] = avwsaspi.ParentName } - if aspi.ContainerName != nil { - objectMap["containerName"] = aspi.ContainerName + if avwsaspi.ParentUniqueName != nil { + objectMap["parentUniqueName"] = avwsaspi.ParentUniqueName } - if aspi.SourceResourceID != nil { - objectMap["sourceResourceId"] = aspi.SourceResourceID + if avwsaspi.ServerName != nil { + objectMap["serverName"] = avwsaspi.ServerName } - if aspi.PolicyID != nil { - objectMap["policyId"] = aspi.PolicyID + if avwsaspi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwsaspi.IsAutoProtectable } - if aspi.LastRecoveryPoint != nil { - objectMap["lastRecoveryPoint"] = aspi.LastRecoveryPoint + if avwsaspi.IsAutoProtected != nil { + objectMap["isAutoProtected"] = avwsaspi.IsAutoProtected } - if aspi.BackupSetName != nil { - objectMap["backupSetName"] = aspi.BackupSetName + if avwsaspi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwsaspi.Subinquireditemcount } - if aspi.CreateMode != "" { - objectMap["createMode"] = aspi.CreateMode + if avwsaspi.Subprotectableitemcount != nil { + objectMap["subprotectableitemcount"] = avwsaspi.Subprotectableitemcount } - if aspi.DeferredDeleteTimeInUTC != nil { - objectMap["deferredDeleteTimeInUTC"] = aspi.DeferredDeleteTimeInUTC + if avwsaspi.Prebackupvalidation != nil { + objectMap["prebackupvalidation"] = avwsaspi.Prebackupvalidation } - if aspi.IsScheduledForDeferredDelete != nil { - objectMap["isScheduledForDeferredDelete"] = aspi.IsScheduledForDeferredDelete + if avwsaspi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwsaspi.BackupManagementType } - if aspi.DeferredDeleteTimeRemaining != nil { - objectMap["deferredDeleteTimeRemaining"] = aspi.DeferredDeleteTimeRemaining + if avwsaspi.WorkloadType != nil { + objectMap["workloadType"] = avwsaspi.WorkloadType } - if aspi.IsDeferredDeleteScheduleUpcoming != nil { - objectMap["isDeferredDeleteScheduleUpcoming"] = aspi.IsDeferredDeleteScheduleUpcoming + if avwsaspi.FriendlyName != nil { + objectMap["friendlyName"] = avwsaspi.FriendlyName } - if aspi.IsRehydrate != nil { - objectMap["isRehydrate"] = aspi.IsRehydrate + if avwsaspi.ProtectionState != "" { + objectMap["protectionState"] = avwsaspi.ProtectionState } - if aspi.ProtectedItemType != "" { - objectMap["protectedItemType"] = aspi.ProtectedItemType + if avwsaspi.ProtectableItemType != "" { + objectMap["protectableItemType"] = avwsaspi.ProtectableItemType } return json.Marshal(objectMap) } -// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { return nil, false } -// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { return nil, false } -// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { return nil, false } -// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { return nil, false } -// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { - return &aspi, true +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { + return &avwsaspi, true } -// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { - return nil, false +// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { + return &avwsaspi, true } -// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { return nil, false } -// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { return nil, false } -// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { return nil, false } -// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { return nil, false } -// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { return nil, false } -// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { return nil, false } -// AsProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { return nil, false } -// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { - return &aspi, true -} - -// AzureSQLProtectedItemExtendedInfo additional information on Azure Sql specific protected item. -type AzureSQLProtectedItemExtendedInfo struct { - // OldestRecoveryPoint - The oldest backup copy available for this item in the service. - OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"` - // RecoveryPointCount - Number of available backup copies associated with this backup item. - RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"` - // PolicyState - State of the backup policy associated with this backup item. - PolicyState *string `json:"policyState,omitempty"` -} - -// AzureSQLProtectionPolicy azure SQL workload-specific backup policy. -type AzureSQLProtectionPolicy struct { - // RetentionPolicy - Retention policy details. - RetentionPolicy BasicRetentionPolicy `json:"retentionPolicy,omitempty"` - // ProtectedItemsCount - Number of items associated with this policy. - ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` - // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' - BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureSQLProtectionPolicy. -func (aspp AzureSQLProtectionPolicy) MarshalJSON() ([]byte, error) { - aspp.BackupManagementType = BackupManagementTypeAzureSQL - objectMap := make(map[string]interface{}) - objectMap["retentionPolicy"] = aspp.RetentionPolicy - if aspp.ProtectedItemsCount != nil { - objectMap["protectedItemsCount"] = aspp.ProtectedItemsCount - } - if aspp.BackupManagementType != "" { - objectMap["backupManagementType"] = aspp.BackupManagementType - } - return json.Marshal(objectMap) +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &avwsaspi, true } -// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. -func (aspp AzureSQLProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { - return nil, false +// AzureVMWorkloadSAPAseSystemWorkloadItem azure VM workload-specific workload item representing SAP ASE +// System. +type AzureVMWorkloadSAPAseSystemWorkloadItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // IsAutoProtectable - Indicates if workload item is auto-protectable + IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // Subinquireditemcount - For instance or AG, indicates number of DB's present + Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` + // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected + SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' + WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPAseSystemWorkloadItem. +func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) MarshalJSON() ([]byte, error) { + avwsaswi.WorkloadItemType = WorkloadItemTypeSAPAseSystem1 + objectMap := make(map[string]interface{}) + if avwsaswi.ParentName != nil { + objectMap["parentName"] = avwsaswi.ParentName + } + if avwsaswi.ServerName != nil { + objectMap["serverName"] = avwsaswi.ServerName + } + if avwsaswi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwsaswi.IsAutoProtectable + } + if avwsaswi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwsaswi.Subinquireditemcount + } + if avwsaswi.SubWorkloadItemCount != nil { + objectMap["subWorkloadItemCount"] = avwsaswi.SubWorkloadItemCount + } + if avwsaswi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwsaswi.BackupManagementType + } + if avwsaswi.WorkloadType != nil { + objectMap["workloadType"] = avwsaswi.WorkloadType + } + if avwsaswi.FriendlyName != nil { + objectMap["friendlyName"] = avwsaswi.FriendlyName + } + if avwsaswi.ProtectionState != "" { + objectMap["protectionState"] = avwsaswi.ProtectionState + } + if avwsaswi.WorkloadItemType != "" { + objectMap["workloadItemType"] = avwsaswi.WorkloadItemType + } + return json.Marshal(objectMap) } -// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. -func (aspp AzureSQLProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { +// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. +func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { return nil, false } -// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. -func (aspp AzureSQLProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { - return &aspp, true +// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. +func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { + return &avwsaswi, true } -// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. -func (aspp AzureSQLProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { +// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. +func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { return nil, false } -// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. -func (aspp AzureSQLProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { +// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. +func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { + return &avwsaswi, true +} + +// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. +func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { return nil, false } -// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. -func (aspp AzureSQLProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { +// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. +func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { return nil, false } -// AsProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. -func (aspp AzureSQLProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { +// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. +func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { return nil, false } -// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. -func (aspp AzureSQLProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { - return &aspp, true +// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. +func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { + return nil, false } -// UnmarshalJSON is the custom unmarshaler for AzureSQLProtectionPolicy struct. -func (aspp *AzureSQLProtectionPolicy) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "retentionPolicy": - if v != nil { - retentionPolicy, err := unmarshalBasicRetentionPolicy(*v) - if err != nil { - return err - } - aspp.RetentionPolicy = retentionPolicy - } - case "protectedItemsCount": - if v != nil { - var protectedItemsCount int32 - err = json.Unmarshal(*v, &protectedItemsCount) - if err != nil { - return err - } - aspp.ProtectedItemsCount = &protectedItemsCount - } - case "backupManagementType": - if v != nil { - var backupManagementType ManagementTypeBasicProtectionPolicy - err = json.Unmarshal(*v, &backupManagementType) - if err != nil { - return err - } - aspp.BackupManagementType = backupManagementType - } - } - } +// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. +func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { + return nil, false +} - return nil +// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. +func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { + return &avwsaswi, true } -// AzureStorageContainer azure Storage Account workload-specific container. -type AzureStorageContainer struct { - // SourceResourceID - Fully qualified ARM url. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // StorageAccountVersion - Storage account version. - StorageAccountVersion *string `json:"storageAccountVersion,omitempty"` - // ResourceGroup - Resource group name of Recovery Services Vault. - ResourceGroup *string `json:"resourceGroup,omitempty"` - // ProtectedItemCount - Number of items backed up in this container. - ProtectedItemCount *int64 `json:"protectedItemCount,omitempty"` - // FriendlyName - Friendly name of the container. +// AzureVMWorkloadSAPHanaDatabaseProtectableItem azure VM workload-specific protectable item representing +// SAP HANA Database. +type AzureVMWorkloadSAPHanaDatabaseProtectableItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent + // Only Applicable for data bases where the parent would be either Instance or a SQL AG. + ParentUniqueName *string `json:"parentUniqueName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // IsAutoProtectable - Indicates if protectable item is auto-protectable + IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // IsAutoProtected - Indicates if protectable item is auto-protected + IsAutoProtected *bool `json:"isAutoProtected,omitempty"` + // Subinquireditemcount - For instance or AG, indicates number of DB's present + Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` + // Subprotectableitemcount - For instance or AG, indicates number of DB's to be protected + Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` + // Prebackupvalidation - Pre-backup validation for protectable objects + Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` } -// MarshalJSON is the custom marshaler for AzureStorageContainer. -func (asc AzureStorageContainer) MarshalJSON() ([]byte, error) { - asc.ContainerType = ContainerTypeStorageContainer1 +// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) MarshalJSON() ([]byte, error) { + avwshdpi.ProtectableItemType = ProtectableItemTypeSAPHanaDatabase objectMap := make(map[string]interface{}) - if asc.SourceResourceID != nil { - objectMap["sourceResourceId"] = asc.SourceResourceID + if avwshdpi.ParentName != nil { + objectMap["parentName"] = avwshdpi.ParentName } - if asc.StorageAccountVersion != nil { - objectMap["storageAccountVersion"] = asc.StorageAccountVersion + if avwshdpi.ParentUniqueName != nil { + objectMap["parentUniqueName"] = avwshdpi.ParentUniqueName } - if asc.ResourceGroup != nil { - objectMap["resourceGroup"] = asc.ResourceGroup + if avwshdpi.ServerName != nil { + objectMap["serverName"] = avwshdpi.ServerName } - if asc.ProtectedItemCount != nil { - objectMap["protectedItemCount"] = asc.ProtectedItemCount + if avwshdpi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwshdpi.IsAutoProtectable } - if asc.FriendlyName != nil { - objectMap["friendlyName"] = asc.FriendlyName + if avwshdpi.IsAutoProtected != nil { + objectMap["isAutoProtected"] = avwshdpi.IsAutoProtected } - if asc.BackupManagementType != "" { - objectMap["backupManagementType"] = asc.BackupManagementType + if avwshdpi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwshdpi.Subinquireditemcount } - if asc.RegistrationStatus != nil { - objectMap["registrationStatus"] = asc.RegistrationStatus + if avwshdpi.Subprotectableitemcount != nil { + objectMap["subprotectableitemcount"] = avwshdpi.Subprotectableitemcount } - if asc.HealthStatus != nil { - objectMap["healthStatus"] = asc.HealthStatus + if avwshdpi.Prebackupvalidation != nil { + objectMap["prebackupvalidation"] = avwshdpi.Prebackupvalidation } - if asc.ContainerType != "" { - objectMap["containerType"] = asc.ContainerType + if avwshdpi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwshdpi.BackupManagementType + } + if avwshdpi.WorkloadType != nil { + objectMap["workloadType"] = avwshdpi.WorkloadType + } + if avwshdpi.FriendlyName != nil { + objectMap["friendlyName"] = avwshdpi.FriendlyName + } + if avwshdpi.ProtectionState != "" { + objectMap["protectionState"] = avwshdpi.ProtectionState + } + if avwshdpi.ProtectableItemType != "" { + objectMap["protectableItemType"] = avwshdpi.ProtectableItemType } return json.Marshal(objectMap) } -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { return nil, false } -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { return nil, false } -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { return nil, false } -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { return nil, false } -// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return nil, false +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { + return &avwshdpi, true } -// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return &asc, true +// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { + return nil, false } -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { - return nil, false +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return &avwshdpi, true } -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { return nil, false } -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { return nil, false } -// AsDpmContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsDpmContainer() (*DpmContainer, bool) { +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { return nil, false } -// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { - return nil, false -} - -// AsGenericContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsGenericContainer() (*GenericContainer, bool) { - return nil, false -} - -// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { return nil, false } -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { return nil, false } -// AsMabContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsMabContainer() (*MabContainer, bool) { +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { return nil, false } -// AsProtectionContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsProtectionContainer() (*ProtectionContainer, bool) { +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { return nil, false } -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &asc, true +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &avwshdpi, true } -// AzureStorageProtectableContainer azure Storage-specific protectable containers -type AzureStorageProtectableContainer struct { - // FriendlyName - Friendly name of the container. +// AzureVMWorkloadSAPHanaDatabaseWorkloadItem azure VM workload-specific workload item representing SAP +// HANA Database. +type AzureVMWorkloadSAPHanaDatabaseWorkloadItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // IsAutoProtectable - Indicates if workload item is auto-protectable + IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // Subinquireditemcount - For instance or AG, indicates number of DB's present + Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` + // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected + SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerID - Fabric Id of the container such as ARM Id. - ContainerID *string `json:"containerId,omitempty"` - // ProtectableContainerType - Possible values include: 'ProtectableContainerTypeProtectableContainer', 'ProtectableContainerTypeStorageContainer', 'ProtectableContainerTypeVMAppContainer' - ProtectableContainerType ProtectableContainerType `json:"protectableContainerType,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' + WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` } -// MarshalJSON is the custom marshaler for AzureStorageProtectableContainer. -func (aspc AzureStorageProtectableContainer) MarshalJSON() ([]byte, error) { - aspc.ProtectableContainerType = ProtectableContainerTypeStorageContainer +// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) MarshalJSON() ([]byte, error) { + avwshdwi.WorkloadItemType = WorkloadItemTypeSAPHanaDatabase1 objectMap := make(map[string]interface{}) - if aspc.FriendlyName != nil { - objectMap["friendlyName"] = aspc.FriendlyName + if avwshdwi.ParentName != nil { + objectMap["parentName"] = avwshdwi.ParentName } - if aspc.BackupManagementType != "" { - objectMap["backupManagementType"] = aspc.BackupManagementType + if avwshdwi.ServerName != nil { + objectMap["serverName"] = avwshdwi.ServerName } - if aspc.HealthStatus != nil { - objectMap["healthStatus"] = aspc.HealthStatus + if avwshdwi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwshdwi.IsAutoProtectable } - if aspc.ContainerID != nil { - objectMap["containerId"] = aspc.ContainerID + if avwshdwi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwshdwi.Subinquireditemcount } - if aspc.ProtectableContainerType != "" { - objectMap["protectableContainerType"] = aspc.ProtectableContainerType + if avwshdwi.SubWorkloadItemCount != nil { + objectMap["subWorkloadItemCount"] = avwshdwi.SubWorkloadItemCount } - return json.Marshal(objectMap) -} - -// AsAzureStorageProtectableContainer is the BasicProtectableContainer implementation for AzureStorageProtectableContainer. -func (aspc AzureStorageProtectableContainer) AsAzureStorageProtectableContainer() (*AzureStorageProtectableContainer, bool) { - return &aspc, true -} - -// AsAzureVMAppContainerProtectableContainer is the BasicProtectableContainer implementation for AzureStorageProtectableContainer. -func (aspc AzureStorageProtectableContainer) AsAzureVMAppContainerProtectableContainer() (*AzureVMAppContainerProtectableContainer, bool) { - return nil, false -} - -// AsProtectableContainer is the BasicProtectableContainer implementation for AzureStorageProtectableContainer. -func (aspc AzureStorageProtectableContainer) AsProtectableContainer() (*ProtectableContainer, bool) { - return nil, false -} - -// AsBasicProtectableContainer is the BasicProtectableContainer implementation for AzureStorageProtectableContainer. -func (aspc AzureStorageProtectableContainer) AsBasicProtectableContainer() (BasicProtectableContainer, bool) { - return &aspc, true -} - -// AzureVMAppContainerProtectableContainer azure workload-specific container -type AzureVMAppContainerProtectableContainer struct { - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerID - Fabric Id of the container such as ARM Id. - ContainerID *string `json:"containerId,omitempty"` - // ProtectableContainerType - Possible values include: 'ProtectableContainerTypeProtectableContainer', 'ProtectableContainerTypeStorageContainer', 'ProtectableContainerTypeVMAppContainer' - ProtectableContainerType ProtectableContainerType `json:"protectableContainerType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMAppContainerProtectableContainer. -func (avacpc AzureVMAppContainerProtectableContainer) MarshalJSON() ([]byte, error) { - avacpc.ProtectableContainerType = ProtectableContainerTypeVMAppContainer - objectMap := make(map[string]interface{}) - if avacpc.FriendlyName != nil { - objectMap["friendlyName"] = avacpc.FriendlyName + if avwshdwi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwshdwi.BackupManagementType } - if avacpc.BackupManagementType != "" { - objectMap["backupManagementType"] = avacpc.BackupManagementType + if avwshdwi.WorkloadType != nil { + objectMap["workloadType"] = avwshdwi.WorkloadType } - if avacpc.HealthStatus != nil { - objectMap["healthStatus"] = avacpc.HealthStatus + if avwshdwi.FriendlyName != nil { + objectMap["friendlyName"] = avwshdwi.FriendlyName } - if avacpc.ContainerID != nil { - objectMap["containerId"] = avacpc.ContainerID + if avwshdwi.ProtectionState != "" { + objectMap["protectionState"] = avwshdwi.ProtectionState } - if avacpc.ProtectableContainerType != "" { - objectMap["protectableContainerType"] = avacpc.ProtectableContainerType + if avwshdwi.WorkloadItemType != "" { + objectMap["workloadItemType"] = avwshdwi.WorkloadItemType } return json.Marshal(objectMap) } -// AsAzureStorageProtectableContainer is the BasicProtectableContainer implementation for AzureVMAppContainerProtectableContainer. -func (avacpc AzureVMAppContainerProtectableContainer) AsAzureStorageProtectableContainer() (*AzureStorageProtectableContainer, bool) { +// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { return nil, false } -// AsAzureVMAppContainerProtectableContainer is the BasicProtectableContainer implementation for AzureVMAppContainerProtectableContainer. -func (avacpc AzureVMAppContainerProtectableContainer) AsAzureVMAppContainerProtectableContainer() (*AzureVMAppContainerProtectableContainer, bool) { - return &avacpc, true +// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { + return &avwshdwi, true } -// AsProtectableContainer is the BasicProtectableContainer implementation for AzureVMAppContainerProtectableContainer. -func (avacpc AzureVMAppContainerProtectableContainer) AsProtectableContainer() (*ProtectableContainer, bool) { +// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { return nil, false } -// AsBasicProtectableContainer is the BasicProtectableContainer implementation for AzureVMAppContainerProtectableContainer. -func (avacpc AzureVMAppContainerProtectableContainer) AsBasicProtectableContainer() (BasicProtectableContainer, bool) { - return &avacpc, true -} - -// AzureVMAppContainerProtectionContainer container for SQL workloads under Azure Virtual Machines. -type AzureVMAppContainerProtectionContainer struct { - // SourceResourceID - ARM ID of the virtual machine represented by this Azure Workload Container - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // LastUpdatedTime - Time stamp when this container was updated. - LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"` - // ExtendedInfo - Additional details of a workload container. - ExtendedInfo *AzureWorkloadContainerExtendedInfo `json:"extendedInfo,omitempty"` - // WorkloadType - Workload type for which registration was sent. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' - WorkloadType WorkloadType `json:"workloadType,omitempty"` - // OperationType - Re-Do Operation. Possible values include: 'OperationTypeInvalid', 'OperationTypeRegister', 'OperationTypeReregister' - OperationType OperationType `json:"operationType,omitempty"` - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) MarshalJSON() ([]byte, error) { - avacpc.ContainerType = ContainerTypeVMAppContainer1 - objectMap := make(map[string]interface{}) - if avacpc.SourceResourceID != nil { - objectMap["sourceResourceId"] = avacpc.SourceResourceID - } - if avacpc.LastUpdatedTime != nil { - objectMap["lastUpdatedTime"] = avacpc.LastUpdatedTime - } - if avacpc.ExtendedInfo != nil { - objectMap["extendedInfo"] = avacpc.ExtendedInfo - } - if avacpc.WorkloadType != "" { - objectMap["workloadType"] = avacpc.WorkloadType - } - if avacpc.OperationType != "" { - objectMap["operationType"] = avacpc.OperationType - } - if avacpc.FriendlyName != nil { - objectMap["friendlyName"] = avacpc.FriendlyName - } - if avacpc.BackupManagementType != "" { - objectMap["backupManagementType"] = avacpc.BackupManagementType - } - if avacpc.RegistrationStatus != nil { - objectMap["registrationStatus"] = avacpc.RegistrationStatus - } - if avacpc.HealthStatus != nil { - objectMap["healthStatus"] = avacpc.HealthStatus - } - if avacpc.ContainerType != "" { - objectMap["containerType"] = avacpc.ContainerType - } - return json.Marshal(objectMap) +// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { + return &avwshdwi, true } -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { +// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { return nil, false } -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { +// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { return nil, false } -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { +// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { return nil, false } -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { +// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { return nil, false } -// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return nil, false +// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { + return &avwshdwi, true } -// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { +// AzureVMWorkloadSAPHanaSystemProtectableItem azure VM workload-specific protectable item representing SAP +// HANA System. +type AzureVMWorkloadSAPHanaSystemProtectableItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent + // Only Applicable for data bases where the parent would be either Instance or a SQL AG. + ParentUniqueName *string `json:"parentUniqueName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // IsAutoProtectable - Indicates if protectable item is auto-protectable + IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // IsAutoProtected - Indicates if protectable item is auto-protected + IsAutoProtected *bool `json:"isAutoProtected,omitempty"` + // Subinquireditemcount - For instance or AG, indicates number of DB's present + Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` + // Subprotectableitemcount - For instance or AG, indicates number of DB's to be protected + Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` + // Prebackupvalidation - Pre-backup validation for protectable objects + Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) MarshalJSON() ([]byte, error) { + avwshspi.ProtectableItemType = ProtectableItemTypeSAPHanaSystem + objectMap := make(map[string]interface{}) + if avwshspi.ParentName != nil { + objectMap["parentName"] = avwshspi.ParentName + } + if avwshspi.ParentUniqueName != nil { + objectMap["parentUniqueName"] = avwshspi.ParentUniqueName + } + if avwshspi.ServerName != nil { + objectMap["serverName"] = avwshspi.ServerName + } + if avwshspi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwshspi.IsAutoProtectable + } + if avwshspi.IsAutoProtected != nil { + objectMap["isAutoProtected"] = avwshspi.IsAutoProtected + } + if avwshspi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwshspi.Subinquireditemcount + } + if avwshspi.Subprotectableitemcount != nil { + objectMap["subprotectableitemcount"] = avwshspi.Subprotectableitemcount + } + if avwshspi.Prebackupvalidation != nil { + objectMap["prebackupvalidation"] = avwshspi.Prebackupvalidation + } + if avwshspi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwshspi.BackupManagementType + } + if avwshspi.WorkloadType != nil { + objectMap["workloadType"] = avwshspi.WorkloadType + } + if avwshspi.FriendlyName != nil { + objectMap["friendlyName"] = avwshspi.FriendlyName + } + if avwshspi.ProtectionState != "" { + objectMap["protectionState"] = avwshspi.ProtectionState + } + if avwshspi.ProtectableItemType != "" { + objectMap["protectableItemType"] = avwshspi.ProtectableItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { return nil, false } -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { - return &avacpc, true +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { + return nil, false } -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { return nil, false } -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return &avacpc, true +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { + return nil, false } -// AsDpmContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsDpmContainer() (*DpmContainer, bool) { +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { + return &avwshspi, true +} + +// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { return nil, false } -// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { return nil, false } -// AsGenericContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsGenericContainer() (*GenericContainer, bool) { +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return &avwshspi, true +} + +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { return nil, false } -// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { return nil, false } -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { return nil, false } -// AsMabContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsMabContainer() (*MabContainer, bool) { +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { return nil, false } -// AsProtectionContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsProtectionContainer() (*ProtectionContainer, bool) { +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { return nil, false } -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &avacpc, true +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { + return nil, false } -// BasicAzureVMWorkloadItem azure VM workload-specific workload item. -type BasicAzureVMWorkloadItem interface { - AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) - AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) - AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) - AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) - AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) - AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) - AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &avwshspi, true } -// AzureVMWorkloadItem azure VM workload-specific workload item. -type AzureVMWorkloadItem struct { +// AzureVMWorkloadSAPHanaSystemWorkloadItem azure VM workload-specific workload item representing SAP HANA +// System. +type AzureVMWorkloadSAPHanaSystemWorkloadItem struct { // ParentName - Name for instance or AG ParentName *string `json:"parentName,omitempty"` // ServerName - Host/Cluster Name for instance or AG ServerName *string `json:"serverName,omitempty"` // IsAutoProtectable - Indicates if workload item is auto-protectable IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DBs present + // Subinquireditemcount - For instance or AG, indicates number of DB's present Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // SubWorkloadItemCount - For instance or AG, indicates number of DBs to be protected + // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` // BackupManagementType - Type of backup management to backup an item. BackupManagementType *string `json:"backupManagementType,omitempty"` @@ -4567,164 +3443,96 @@ type AzureVMWorkloadItem struct { WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` } -func unmarshalBasicAzureVMWorkloadItem(body []byte) (BasicAzureVMWorkloadItem, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["workloadItemType"] { - case string(WorkloadItemTypeSAPAseDatabase1): - var avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem - err := json.Unmarshal(body, &avwsadwi) - return avwsadwi, err - case string(WorkloadItemTypeSAPAseSystem1): - var avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem - err := json.Unmarshal(body, &avwsaswi) - return avwsaswi, err - case string(WorkloadItemTypeSAPHanaDatabase1): - var avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem - err := json.Unmarshal(body, &avwshdwi) - return avwshdwi, err - case string(WorkloadItemTypeSAPHanaSystem1): - var avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem - err := json.Unmarshal(body, &avwshswi) - return avwshswi, err - case string(WorkloadItemTypeSQLDataBase1): - var avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem - err := json.Unmarshal(body, &avwsdwi) - return avwsdwi, err - case string(WorkloadItemTypeSQLInstance1): - var avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem - err := json.Unmarshal(body, &avwsiwi) - return avwsiwi, err - default: - var avwi AzureVMWorkloadItem - err := json.Unmarshal(body, &avwi) - return avwi, err - } -} -func unmarshalBasicAzureVMWorkloadItemArray(body []byte) ([]BasicAzureVMWorkloadItem, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - avwiArray := make([]BasicAzureVMWorkloadItem, len(rawMessages)) - - for index, rawMessage := range rawMessages { - avwi, err := unmarshalBasicAzureVMWorkloadItem(*rawMessage) - if err != nil { - return nil, err - } - avwiArray[index] = avwi - } - return avwiArray, nil -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadItem. -func (avwi AzureVMWorkloadItem) MarshalJSON() ([]byte, error) { - avwi.WorkloadItemType = WorkloadItemTypeAzureVMWorkloadItem +// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) MarshalJSON() ([]byte, error) { + avwshswi.WorkloadItemType = WorkloadItemTypeSAPHanaSystem1 objectMap := make(map[string]interface{}) - if avwi.ParentName != nil { - objectMap["parentName"] = avwi.ParentName - } - if avwi.ServerName != nil { - objectMap["serverName"] = avwi.ServerName + if avwshswi.ParentName != nil { + objectMap["parentName"] = avwshswi.ParentName } - if avwi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwi.IsAutoProtectable + if avwshswi.ServerName != nil { + objectMap["serverName"] = avwshswi.ServerName } - if avwi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwi.Subinquireditemcount + if avwshswi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwshswi.IsAutoProtectable } - if avwi.SubWorkloadItemCount != nil { - objectMap["subWorkloadItemCount"] = avwi.SubWorkloadItemCount + if avwshswi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwshswi.Subinquireditemcount } - if avwi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwi.BackupManagementType + if avwshswi.SubWorkloadItemCount != nil { + objectMap["subWorkloadItemCount"] = avwshswi.SubWorkloadItemCount } - if avwi.WorkloadType != nil { - objectMap["workloadType"] = avwi.WorkloadType + if avwshswi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwshswi.BackupManagementType } - if avwi.FriendlyName != nil { - objectMap["friendlyName"] = avwi.FriendlyName + if avwshswi.WorkloadType != nil { + objectMap["workloadType"] = avwshswi.WorkloadType } - if avwi.ProtectionState != "" { - objectMap["protectionState"] = avwi.ProtectionState + if avwshswi.FriendlyName != nil { + objectMap["friendlyName"] = avwshswi.FriendlyName } - if avwi.WorkloadItemType != "" { - objectMap["workloadItemType"] = avwi.WorkloadItemType + if avwshswi.ProtectionState != "" { + objectMap["protectionState"] = avwshswi.ProtectionState + } + if avwshswi.WorkloadItemType != "" { + objectMap["workloadItemType"] = avwshswi.WorkloadItemType } return json.Marshal(objectMap) } -// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. -func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { - return &avwi, true +// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { + return nil, false } -// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. -func (avwi AzureVMWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { - return &avwi, true +// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { + return &avwshswi, true } -// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. -func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { +// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { return nil, false } -// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. -func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { +// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. -func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { +// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. -func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { - return nil, false +// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { + return &avwshswi, true } -// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. -func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { +// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { return nil, false } -// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. -func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { +// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { return nil, false } -// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. -func (avwi AzureVMWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { +// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { return nil, false } -// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. -func (avwi AzureVMWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { - return &avwi, true -} - -// BasicAzureVMWorkloadProtectableItem azure VM workload-specific protectable item. -type BasicAzureVMWorkloadProtectableItem interface { - AsAzureVMWorkloadSAPAseDatabaseProtectableItem() (*AzureVMWorkloadSAPAseDatabaseProtectableItem, bool) - AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) - AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) - AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) - AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) - AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) - AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) - AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) +// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { + return &avwshswi, true } -// AzureVMWorkloadProtectableItem azure VM workload-specific protectable item. -type AzureVMWorkloadProtectableItem struct { +// AzureVMWorkloadSQLAvailabilityGroupProtectableItem azure VM workload-specific protectable item +// representing SQL Availability Group. +type AzureVMWorkloadSQLAvailabilityGroupProtectableItem struct { // ParentName - Name for instance or AG ParentName *string `json:"parentName,omitempty"` // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent @@ -4736,9 +3544,9 @@ type AzureVMWorkloadProtectableItem struct { IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` // IsAutoProtected - Indicates if protectable item is auto-protected IsAutoProtected *bool `json:"isAutoProtected,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DBs present + // Subinquireditemcount - For instance or AG, indicates number of DB's present Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // Subprotectableitemcount - For instance or AG, indicates number of DBs to be protected + // Subprotectableitemcount - For instance or AG, indicates number of DB's to be protected Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` // Prebackupvalidation - Pre-backup validation for protectable objects Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` @@ -4750,561 +3558,399 @@ type AzureVMWorkloadProtectableItem struct { FriendlyName *string `json:"friendlyName,omitempty"` // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseDatabase', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` } -func unmarshalBasicAzureVMWorkloadProtectableItem(body []byte) (BasicAzureVMWorkloadProtectableItem, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["protectableItemType"] { - case string(ProtectableItemTypeSAPAseDatabase): - var avwsadpi AzureVMWorkloadSAPAseDatabaseProtectableItem - err := json.Unmarshal(body, &avwsadpi) - return avwsadpi, err - case string(ProtectableItemTypeSAPAseSystem): - var avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem - err := json.Unmarshal(body, &avwsaspi) - return avwsaspi, err - case string(ProtectableItemTypeSAPHanaDatabase): - var avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem - err := json.Unmarshal(body, &avwshdpi) - return avwshdpi, err - case string(ProtectableItemTypeSAPHanaSystem): - var avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem - err := json.Unmarshal(body, &avwshspi) - return avwshspi, err - case string(ProtectableItemTypeSQLAvailabilityGroupContainer): - var avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem - err := json.Unmarshal(body, &avwsagpi) - return avwsagpi, err - case string(ProtectableItemTypeSQLDataBase): - var avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem - err := json.Unmarshal(body, &avwsdpi) - return avwsdpi, err - case string(ProtectableItemTypeSQLInstance): - var avwsipi AzureVMWorkloadSQLInstanceProtectableItem - err := json.Unmarshal(body, &avwsipi) - return avwsipi, err - default: - var avwpi AzureVMWorkloadProtectableItem - err := json.Unmarshal(body, &avwpi) - return avwpi, err - } -} -func unmarshalBasicAzureVMWorkloadProtectableItemArray(body []byte) ([]BasicAzureVMWorkloadProtectableItem, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - avwpiArray := make([]BasicAzureVMWorkloadProtectableItem, len(rawMessages)) - - for index, rawMessage := range rawMessages { - avwpi, err := unmarshalBasicAzureVMWorkloadProtectableItem(*rawMessage) - if err != nil { - return nil, err - } - avwpiArray[index] = avwpi - } - return avwpiArray, nil -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) MarshalJSON() ([]byte, error) { - avwpi.ProtectableItemType = ProtectableItemTypeAzureVMWorkloadProtectableItem +// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) MarshalJSON() ([]byte, error) { + avwsagpi.ProtectableItemType = ProtectableItemTypeSQLAvailabilityGroupContainer objectMap := make(map[string]interface{}) - if avwpi.ParentName != nil { - objectMap["parentName"] = avwpi.ParentName + if avwsagpi.ParentName != nil { + objectMap["parentName"] = avwsagpi.ParentName } - if avwpi.ParentUniqueName != nil { - objectMap["parentUniqueName"] = avwpi.ParentUniqueName + if avwsagpi.ParentUniqueName != nil { + objectMap["parentUniqueName"] = avwsagpi.ParentUniqueName } - if avwpi.ServerName != nil { - objectMap["serverName"] = avwpi.ServerName + if avwsagpi.ServerName != nil { + objectMap["serverName"] = avwsagpi.ServerName } - if avwpi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwpi.IsAutoProtectable + if avwsagpi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwsagpi.IsAutoProtectable } - if avwpi.IsAutoProtected != nil { - objectMap["isAutoProtected"] = avwpi.IsAutoProtected + if avwsagpi.IsAutoProtected != nil { + objectMap["isAutoProtected"] = avwsagpi.IsAutoProtected } - if avwpi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwpi.Subinquireditemcount + if avwsagpi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwsagpi.Subinquireditemcount } - if avwpi.Subprotectableitemcount != nil { - objectMap["subprotectableitemcount"] = avwpi.Subprotectableitemcount + if avwsagpi.Subprotectableitemcount != nil { + objectMap["subprotectableitemcount"] = avwsagpi.Subprotectableitemcount } - if avwpi.Prebackupvalidation != nil { - objectMap["prebackupvalidation"] = avwpi.Prebackupvalidation + if avwsagpi.Prebackupvalidation != nil { + objectMap["prebackupvalidation"] = avwsagpi.Prebackupvalidation } - if avwpi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwpi.BackupManagementType + if avwsagpi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwsagpi.BackupManagementType } - if avwpi.WorkloadType != nil { - objectMap["workloadType"] = avwpi.WorkloadType + if avwsagpi.WorkloadType != nil { + objectMap["workloadType"] = avwsagpi.WorkloadType } - if avwpi.FriendlyName != nil { - objectMap["friendlyName"] = avwpi.FriendlyName + if avwsagpi.FriendlyName != nil { + objectMap["friendlyName"] = avwsagpi.FriendlyName } - if avwpi.ProtectionState != "" { - objectMap["protectionState"] = avwpi.ProtectionState + if avwsagpi.ProtectionState != "" { + objectMap["protectionState"] = avwsagpi.ProtectionState } - if avwpi.ProtectableItemType != "" { - objectMap["protectableItemType"] = avwpi.ProtectableItemType + if avwsagpi.ProtectableItemType != "" { + objectMap["protectableItemType"] = avwsagpi.ProtectableItemType } return json.Marshal(objectMap) } -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { return nil, false } -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { return nil, false } -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { return nil, false } -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { - return &avwpi, true -} - -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return &avwpi, true -} - -// AsAzureVMWorkloadSAPAseDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSAPAseDatabaseProtectableItem() (*AzureVMWorkloadSAPAseDatabaseProtectableItem, bool) { +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { return nil, false } -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { - return nil, false +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { + return &avwsagpi, true } -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { +// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { return nil, false } -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { return nil, false } -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { - return nil, false +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { + return &avwsagpi, true } -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { return nil, false } -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { return nil, false } -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { return nil, false } -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { return nil, false } -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &avwpi, true +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { + return nil, false } -// BasicAzureVMWorkloadProtectedItem azure VM workload-specific protected item. -type BasicAzureVMWorkloadProtectedItem interface { - AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) - AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) - AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) - AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &avwsagpi, true } -// AzureVMWorkloadProtectedItem azure VM workload-specific protected item. -type AzureVMWorkloadProtectedItem struct { - // FriendlyName - Friendly name of the DB represented by this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` +// AzureVMWorkloadSQLDatabaseProtectableItem azure VM workload-specific protectable item representing SQL +// Database. +type AzureVMWorkloadSQLDatabaseProtectableItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent + // Only Applicable for data bases where the parent would be either Instance or a SQL AG. + ParentUniqueName *string `json:"parentUniqueName,omitempty"` // ServerName - Host/Cluster Name for instance or AG ServerName *string `json:"serverName,omitempty"` - // ParentName - Parent name of the DB such as Instance or Availability Group. - ParentName *string `json:"parentName,omitempty"` - // ParentType - Parent type of protected item, example: for a DB, standalone server or distributed - ParentType *string `json:"parentType,omitempty"` - // ProtectionStatus - Backup status of this backup item. - ProtectionStatus *string `json:"protectionStatus,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' - ProtectionState ProtectionState `json:"protectionState,omitempty"` - // LastBackupStatus - Last backup operation status. Possible values: Healthy, Unhealthy. Possible values include: 'LastBackupStatusInvalid', 'LastBackupStatusHealthy', 'LastBackupStatusUnhealthy', 'LastBackupStatusIRPending' - LastBackupStatus LastBackupStatus `json:"lastBackupStatus,omitempty"` - // LastBackupTime - Timestamp of the last backup operation on this backup item. - LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` - // LastBackupErrorDetail - Error details in last backup - LastBackupErrorDetail *ErrorDetail `json:"lastBackupErrorDetail,omitempty"` - // ProtectedItemDataSourceID - Data ID of the protected item. - ProtectedItemDataSourceID *string `json:"protectedItemDataSourceId,omitempty"` - // ProtectedItemHealthStatus - Health status of the backup item, evaluated based on last heartbeat received. Possible values include: 'ProtectedItemHealthStatusInvalid', 'ProtectedItemHealthStatusHealthy', 'ProtectedItemHealthStatusUnhealthy', 'ProtectedItemHealthStatusNotReachable', 'ProtectedItemHealthStatusIRPending' - ProtectedItemHealthStatus ProtectedItemHealthStatus `json:"protectedItemHealthStatus,omitempty"` - // ExtendedInfo - Additional information for this backup item. - ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - WorkloadType DataSourceType `json:"workloadType,omitempty"` - // ContainerName - Unique name of container - ContainerName *string `json:"containerName,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. - LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` - // BackupSetName - Name of the backup set the backup item belongs to - BackupSetName *string `json:"backupSetName,omitempty"` - // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' - CreateMode CreateMode `json:"createMode,omitempty"` - // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC - DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` - // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state - IsRehydrate *bool `json:"isRehydrate,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' - ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` -} - -func unmarshalBasicAzureVMWorkloadProtectedItem(body []byte) (BasicAzureVMWorkloadProtectedItem, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["protectedItemType"] { - case string(ProtectedItemTypeAzureVMWorkloadSAPAseDatabase): - var avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem - err := json.Unmarshal(body, &avwsadpi) - return avwsadpi, err - case string(ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase): - var avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem - err := json.Unmarshal(body, &avwshdpi) - return avwshdpi, err - case string(ProtectedItemTypeAzureVMWorkloadSQLDatabase): - var avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem - err := json.Unmarshal(body, &avwsdpi) - return avwsdpi, err - default: - var avwpi AzureVMWorkloadProtectedItem - err := json.Unmarshal(body, &avwpi) - return avwpi, err - } -} -func unmarshalBasicAzureVMWorkloadProtectedItemArray(body []byte) ([]BasicAzureVMWorkloadProtectedItem, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - avwpiArray := make([]BasicAzureVMWorkloadProtectedItem, len(rawMessages)) - - for index, rawMessage := range rawMessages { - avwpi, err := unmarshalBasicAzureVMWorkloadProtectedItem(*rawMessage) - if err != nil { - return nil, err - } - avwpiArray[index] = avwpi - } - return avwpiArray, nil + // IsAutoProtectable - Indicates if protectable item is auto-protectable + IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // IsAutoProtected - Indicates if protectable item is auto-protected + IsAutoProtected *bool `json:"isAutoProtected,omitempty"` + // Subinquireditemcount - For instance or AG, indicates number of DB's present + Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` + // Subprotectableitemcount - For instance or AG, indicates number of DB's to be protected + Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` + // Prebackupvalidation - Pre-backup validation for protectable objects + Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` } -// MarshalJSON is the custom marshaler for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) MarshalJSON() ([]byte, error) { - avwpi.ProtectedItemType = ProtectedItemTypeAzureVMWorkloadProtectedItem +// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) MarshalJSON() ([]byte, error) { + avwsdpi.ProtectableItemType = ProtectableItemTypeSQLDataBase objectMap := make(map[string]interface{}) - if avwpi.FriendlyName != nil { - objectMap["friendlyName"] = avwpi.FriendlyName - } - if avwpi.ServerName != nil { - objectMap["serverName"] = avwpi.ServerName - } - if avwpi.ParentName != nil { - objectMap["parentName"] = avwpi.ParentName - } - if avwpi.ParentType != nil { - objectMap["parentType"] = avwpi.ParentType - } - if avwpi.ProtectionStatus != nil { - objectMap["protectionStatus"] = avwpi.ProtectionStatus - } - if avwpi.ProtectionState != "" { - objectMap["protectionState"] = avwpi.ProtectionState - } - if avwpi.LastBackupStatus != "" { - objectMap["lastBackupStatus"] = avwpi.LastBackupStatus - } - if avwpi.LastBackupTime != nil { - objectMap["lastBackupTime"] = avwpi.LastBackupTime - } - if avwpi.LastBackupErrorDetail != nil { - objectMap["lastBackupErrorDetail"] = avwpi.LastBackupErrorDetail - } - if avwpi.ProtectedItemDataSourceID != nil { - objectMap["protectedItemDataSourceId"] = avwpi.ProtectedItemDataSourceID - } - if avwpi.ProtectedItemHealthStatus != "" { - objectMap["protectedItemHealthStatus"] = avwpi.ProtectedItemHealthStatus - } - if avwpi.ExtendedInfo != nil { - objectMap["extendedInfo"] = avwpi.ExtendedInfo - } - if avwpi.BackupManagementType != "" { - objectMap["backupManagementType"] = avwpi.BackupManagementType - } - if avwpi.WorkloadType != "" { - objectMap["workloadType"] = avwpi.WorkloadType + if avwsdpi.ParentName != nil { + objectMap["parentName"] = avwsdpi.ParentName } - if avwpi.ContainerName != nil { - objectMap["containerName"] = avwpi.ContainerName + if avwsdpi.ParentUniqueName != nil { + objectMap["parentUniqueName"] = avwsdpi.ParentUniqueName } - if avwpi.SourceResourceID != nil { - objectMap["sourceResourceId"] = avwpi.SourceResourceID + if avwsdpi.ServerName != nil { + objectMap["serverName"] = avwsdpi.ServerName } - if avwpi.PolicyID != nil { - objectMap["policyId"] = avwpi.PolicyID + if avwsdpi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwsdpi.IsAutoProtectable } - if avwpi.LastRecoveryPoint != nil { - objectMap["lastRecoveryPoint"] = avwpi.LastRecoveryPoint + if avwsdpi.IsAutoProtected != nil { + objectMap["isAutoProtected"] = avwsdpi.IsAutoProtected } - if avwpi.BackupSetName != nil { - objectMap["backupSetName"] = avwpi.BackupSetName + if avwsdpi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwsdpi.Subinquireditemcount } - if avwpi.CreateMode != "" { - objectMap["createMode"] = avwpi.CreateMode + if avwsdpi.Subprotectableitemcount != nil { + objectMap["subprotectableitemcount"] = avwsdpi.Subprotectableitemcount } - if avwpi.DeferredDeleteTimeInUTC != nil { - objectMap["deferredDeleteTimeInUTC"] = avwpi.DeferredDeleteTimeInUTC + if avwsdpi.Prebackupvalidation != nil { + objectMap["prebackupvalidation"] = avwsdpi.Prebackupvalidation } - if avwpi.IsScheduledForDeferredDelete != nil { - objectMap["isScheduledForDeferredDelete"] = avwpi.IsScheduledForDeferredDelete + if avwsdpi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwsdpi.BackupManagementType } - if avwpi.DeferredDeleteTimeRemaining != nil { - objectMap["deferredDeleteTimeRemaining"] = avwpi.DeferredDeleteTimeRemaining + if avwsdpi.WorkloadType != nil { + objectMap["workloadType"] = avwsdpi.WorkloadType } - if avwpi.IsDeferredDeleteScheduleUpcoming != nil { - objectMap["isDeferredDeleteScheduleUpcoming"] = avwpi.IsDeferredDeleteScheduleUpcoming + if avwsdpi.FriendlyName != nil { + objectMap["friendlyName"] = avwsdpi.FriendlyName } - if avwpi.IsRehydrate != nil { - objectMap["isRehydrate"] = avwpi.IsRehydrate + if avwsdpi.ProtectionState != "" { + objectMap["protectionState"] = avwsdpi.ProtectionState } - if avwpi.ProtectedItemType != "" { - objectMap["protectedItemType"] = avwpi.ProtectedItemType + if avwsdpi.ProtectableItemType != "" { + objectMap["protectableItemType"] = avwsdpi.ProtectableItemType } return json.Marshal(objectMap) } -// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { return nil, false } -// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { return nil, false } -// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { return nil, false } -// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { return nil, false } -// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { - return nil, false +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { + return &avwsdpi, true } -// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { +// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { return nil, false } -// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { - return &avwpi, true -} - -// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { - return &avwpi, true +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return nil, false } -// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { return nil, false } -// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { - return nil, false +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { + return &avwsdpi, true } -// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { return nil, false } -// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { return nil, false } -// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { return nil, false } -// AsProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { return nil, false } -// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { - return &avwpi, true +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &avwsdpi, true } -// AzureVMWorkloadProtectedItemExtendedInfo additional information on Azure Workload for SQL specific -// backup item. -type AzureVMWorkloadProtectedItemExtendedInfo struct { - // OldestRecoveryPoint - The oldest backup copy available for this backup item. - OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"` - // RecoveryPointCount - Number of backup copies available for this backup item. - RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"` - // PolicyState - Indicates consistency of policy object and policy applied to this backup item. - PolicyState *string `json:"policyState,omitempty"` -} - -// AzureVMWorkloadProtectionPolicy azure VM (Mercury) workload-specific backup policy. -type AzureVMWorkloadProtectionPolicy struct { - // WorkLoadType - Type of workload for the backup management. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' - WorkLoadType WorkloadType `json:"workLoadType,omitempty"` - // Settings - Common settings for the backup management - Settings *Settings `json:"settings,omitempty"` - // SubProtectionPolicy - List of sub-protection policies which includes schedule and retention - SubProtectionPolicy *[]SubProtectionPolicy `json:"subProtectionPolicy,omitempty"` - // ProtectedItemsCount - Number of items associated with this policy. - ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` - // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' - BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` +// AzureVMWorkloadSQLDatabaseWorkloadItem azure VM workload-specific workload item representing SQL +// Database. +type AzureVMWorkloadSQLDatabaseWorkloadItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // IsAutoProtectable - Indicates if workload item is auto-protectable + IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // Subinquireditemcount - For instance or AG, indicates number of DB's present + Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` + // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected + SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' + WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` } -// MarshalJSON is the custom marshaler for AzureVMWorkloadProtectionPolicy. -func (avwpp AzureVMWorkloadProtectionPolicy) MarshalJSON() ([]byte, error) { - avwpp.BackupManagementType = BackupManagementTypeAzureWorkload +// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLDatabaseWorkloadItem. +func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) MarshalJSON() ([]byte, error) { + avwsdwi.WorkloadItemType = WorkloadItemTypeSQLDataBase1 objectMap := make(map[string]interface{}) - if avwpp.WorkLoadType != "" { - objectMap["workLoadType"] = avwpp.WorkLoadType + if avwsdwi.ParentName != nil { + objectMap["parentName"] = avwsdwi.ParentName + } + if avwsdwi.ServerName != nil { + objectMap["serverName"] = avwsdwi.ServerName + } + if avwsdwi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwsdwi.IsAutoProtectable + } + if avwsdwi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwsdwi.Subinquireditemcount + } + if avwsdwi.SubWorkloadItemCount != nil { + objectMap["subWorkloadItemCount"] = avwsdwi.SubWorkloadItemCount + } + if avwsdwi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwsdwi.BackupManagementType } - if avwpp.Settings != nil { - objectMap["settings"] = avwpp.Settings + if avwsdwi.WorkloadType != nil { + objectMap["workloadType"] = avwsdwi.WorkloadType } - if avwpp.SubProtectionPolicy != nil { - objectMap["subProtectionPolicy"] = avwpp.SubProtectionPolicy + if avwsdwi.FriendlyName != nil { + objectMap["friendlyName"] = avwsdwi.FriendlyName } - if avwpp.ProtectedItemsCount != nil { - objectMap["protectedItemsCount"] = avwpp.ProtectedItemsCount + if avwsdwi.ProtectionState != "" { + objectMap["protectionState"] = avwsdwi.ProtectionState } - if avwpp.BackupManagementType != "" { - objectMap["backupManagementType"] = avwpp.BackupManagementType + if avwsdwi.WorkloadItemType != "" { + objectMap["workloadItemType"] = avwsdwi.WorkloadItemType } return json.Marshal(objectMap) } -// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. -func (avwpp AzureVMWorkloadProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { +// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. +func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { return nil, false } -// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. -func (avwpp AzureVMWorkloadProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { +// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. +func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { + return &avwsdwi, true +} + +// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. +func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { return nil, false } -// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. -func (avwpp AzureVMWorkloadProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { +// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. +func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { return nil, false } -// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. -func (avwpp AzureVMWorkloadProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { - return &avwpp, true +// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. +func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { + return nil, false } -// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. -func (avwpp AzureVMWorkloadProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { +// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. +func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { return nil, false } -// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. -func (avwpp AzureVMWorkloadProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { +// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. +func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { + return &avwsdwi, true +} + +// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. +func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { return nil, false } -// AsProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. -func (avwpp AzureVMWorkloadProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { +// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. +func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { return nil, false } -// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. -func (avwpp AzureVMWorkloadProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { - return &avwpp, true +// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. +func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { + return &avwsdwi, true } -// AzureVMWorkloadSAPAseDatabaseProtectableItem azure VM workload-specific protectable item representing -// SAP ASE Database. -type AzureVMWorkloadSAPAseDatabaseProtectableItem struct { +// AzureVMWorkloadSQLInstanceProtectableItem azure VM workload-specific protectable item representing SQL +// Instance. +type AzureVMWorkloadSQLInstanceProtectableItem struct { // ParentName - Name for instance or AG ParentName *string `json:"parentName,omitempty"` // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent @@ -5316,9 +3962,9 @@ type AzureVMWorkloadSAPAseDatabaseProtectableItem struct { IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` // IsAutoProtected - Indicates if protectable item is auto-protected IsAutoProtected *bool `json:"isAutoProtected,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DBs present + // Subinquireditemcount - For instance or AG, indicates number of DB's present Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // Subprotectableitemcount - For instance or AG, indicates number of DBs to be protected + // Subprotectableitemcount - For instance or AG, indicates number of DB's to be protected Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` // Prebackupvalidation - Pre-backup validation for protectable objects Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` @@ -5330,7631 +3976,1106 @@ type AzureVMWorkloadSAPAseDatabaseProtectableItem struct { FriendlyName *string `json:"friendlyName,omitempty"` // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseDatabase', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` } -// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPAseDatabaseProtectableItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectableItem) MarshalJSON() ([]byte, error) { - avwsadpi.ProtectableItemType = ProtectableItemTypeSAPAseDatabase +// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) MarshalJSON() ([]byte, error) { + avwsipi.ProtectableItemType = ProtectableItemTypeSQLInstance objectMap := make(map[string]interface{}) - if avwsadpi.ParentName != nil { - objectMap["parentName"] = avwsadpi.ParentName + if avwsipi.ParentName != nil { + objectMap["parentName"] = avwsipi.ParentName } - if avwsadpi.ParentUniqueName != nil { - objectMap["parentUniqueName"] = avwsadpi.ParentUniqueName + if avwsipi.ParentUniqueName != nil { + objectMap["parentUniqueName"] = avwsipi.ParentUniqueName } - if avwsadpi.ServerName != nil { - objectMap["serverName"] = avwsadpi.ServerName + if avwsipi.ServerName != nil { + objectMap["serverName"] = avwsipi.ServerName } - if avwsadpi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwsadpi.IsAutoProtectable + if avwsipi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwsipi.IsAutoProtectable } - if avwsadpi.IsAutoProtected != nil { - objectMap["isAutoProtected"] = avwsadpi.IsAutoProtected + if avwsipi.IsAutoProtected != nil { + objectMap["isAutoProtected"] = avwsipi.IsAutoProtected } - if avwsadpi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwsadpi.Subinquireditemcount + if avwsipi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwsipi.Subinquireditemcount } - if avwsadpi.Subprotectableitemcount != nil { - objectMap["subprotectableitemcount"] = avwsadpi.Subprotectableitemcount + if avwsipi.Subprotectableitemcount != nil { + objectMap["subprotectableitemcount"] = avwsipi.Subprotectableitemcount } - if avwsadpi.Prebackupvalidation != nil { - objectMap["prebackupvalidation"] = avwsadpi.Prebackupvalidation + if avwsipi.Prebackupvalidation != nil { + objectMap["prebackupvalidation"] = avwsipi.Prebackupvalidation } - if avwsadpi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwsadpi.BackupManagementType + if avwsipi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwsipi.BackupManagementType } - if avwsadpi.WorkloadType != nil { - objectMap["workloadType"] = avwsadpi.WorkloadType + if avwsipi.WorkloadType != nil { + objectMap["workloadType"] = avwsipi.WorkloadType } - if avwsadpi.FriendlyName != nil { - objectMap["friendlyName"] = avwsadpi.FriendlyName + if avwsipi.FriendlyName != nil { + objectMap["friendlyName"] = avwsipi.FriendlyName } - if avwsadpi.ProtectionState != "" { - objectMap["protectionState"] = avwsadpi.ProtectionState + if avwsipi.ProtectionState != "" { + objectMap["protectionState"] = avwsipi.ProtectionState } - if avwsadpi.ProtectableItemType != "" { - objectMap["protectableItemType"] = avwsadpi.ProtectableItemType + if avwsipi.ProtectableItemType != "" { + objectMap["protectableItemType"] = avwsipi.ProtectableItemType } return json.Marshal(objectMap) } -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseDatabaseProtectableItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { return nil, false } -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseDatabaseProtectableItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { return nil, false } -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseDatabaseProtectableItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { return nil, false } -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseDatabaseProtectableItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { return nil, false } -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseDatabaseProtectableItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return &avwsadpi, true -} - -// AsAzureVMWorkloadSAPAseDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseDatabaseProtectableItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectableItem) AsAzureVMWorkloadSAPAseDatabaseProtectableItem() (*AzureVMWorkloadSAPAseDatabaseProtectableItem, bool) { - return &avwsadpi, true +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { + return &avwsipi, true } -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseDatabaseProtectableItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { +// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseDatabaseProtectableItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseDatabaseProtectableItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { return nil, false } -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseDatabaseProtectableItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { return nil, false } -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseDatabaseProtectableItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { return nil, false } -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseDatabaseProtectableItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { - return nil, false +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { + return &avwsipi, true } -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseDatabaseProtectableItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { return nil, false } -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseDatabaseProtectableItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { return nil, false } -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseDatabaseProtectableItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { return nil, false } -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseDatabaseProtectableItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &avwsadpi, true +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &avwsipi, true } -// AzureVMWorkloadSAPAseDatabaseProtectedItem azure VM workload-specific protected item representing SAP -// ASE Database. -type AzureVMWorkloadSAPAseDatabaseProtectedItem struct { - // FriendlyName - Friendly name of the DB represented by this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` +// AzureVMWorkloadSQLInstanceWorkloadItem azure VM workload-specific workload item representing SQL +// Instance. +type AzureVMWorkloadSQLInstanceWorkloadItem struct { + // DataDirectoryPaths - Data Directory Paths for default directories + DataDirectoryPaths *[]SQLDataDirectory `json:"dataDirectoryPaths,omitempty"` + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` // ServerName - Host/Cluster Name for instance or AG ServerName *string `json:"serverName,omitempty"` - // ParentName - Parent name of the DB such as Instance or Availability Group. - ParentName *string `json:"parentName,omitempty"` - // ParentType - Parent type of protected item, example: for a DB, standalone server or distributed - ParentType *string `json:"parentType,omitempty"` - // ProtectionStatus - Backup status of this backup item. - ProtectionStatus *string `json:"protectionStatus,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' - ProtectionState ProtectionState `json:"protectionState,omitempty"` - // LastBackupStatus - Last backup operation status. Possible values: Healthy, Unhealthy. Possible values include: 'LastBackupStatusInvalid', 'LastBackupStatusHealthy', 'LastBackupStatusUnhealthy', 'LastBackupStatusIRPending' - LastBackupStatus LastBackupStatus `json:"lastBackupStatus,omitempty"` - // LastBackupTime - Timestamp of the last backup operation on this backup item. - LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` - // LastBackupErrorDetail - Error details in last backup - LastBackupErrorDetail *ErrorDetail `json:"lastBackupErrorDetail,omitempty"` - // ProtectedItemDataSourceID - Data ID of the protected item. - ProtectedItemDataSourceID *string `json:"protectedItemDataSourceId,omitempty"` - // ProtectedItemHealthStatus - Health status of the backup item, evaluated based on last heartbeat received. Possible values include: 'ProtectedItemHealthStatusInvalid', 'ProtectedItemHealthStatusHealthy', 'ProtectedItemHealthStatusUnhealthy', 'ProtectedItemHealthStatusNotReachable', 'ProtectedItemHealthStatusIRPending' - ProtectedItemHealthStatus ProtectedItemHealthStatus `json:"protectedItemHealthStatus,omitempty"` - // ExtendedInfo - Additional information for this backup item. - ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - WorkloadType DataSourceType `json:"workloadType,omitempty"` - // ContainerName - Unique name of container - ContainerName *string `json:"containerName,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. - LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` - // BackupSetName - Name of the backup set the backup item belongs to - BackupSetName *string `json:"backupSetName,omitempty"` - // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' - CreateMode CreateMode `json:"createMode,omitempty"` - // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC - DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` - // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state - IsRehydrate *bool `json:"isRehydrate,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' - ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) MarshalJSON() ([]byte, error) { - avwsadpi.ProtectedItemType = ProtectedItemTypeAzureVMWorkloadSAPAseDatabase + // IsAutoProtectable - Indicates if workload item is auto-protectable + IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // Subinquireditemcount - For instance or AG, indicates number of DB's present + Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` + // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected + SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' + WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLInstanceWorkloadItem. +func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) MarshalJSON() ([]byte, error) { + avwsiwi.WorkloadItemType = WorkloadItemTypeSQLInstance1 objectMap := make(map[string]interface{}) - if avwsadpi.FriendlyName != nil { - objectMap["friendlyName"] = avwsadpi.FriendlyName - } - if avwsadpi.ServerName != nil { - objectMap["serverName"] = avwsadpi.ServerName - } - if avwsadpi.ParentName != nil { - objectMap["parentName"] = avwsadpi.ParentName - } - if avwsadpi.ParentType != nil { - objectMap["parentType"] = avwsadpi.ParentType - } - if avwsadpi.ProtectionStatus != nil { - objectMap["protectionStatus"] = avwsadpi.ProtectionStatus - } - if avwsadpi.ProtectionState != "" { - objectMap["protectionState"] = avwsadpi.ProtectionState - } - if avwsadpi.LastBackupStatus != "" { - objectMap["lastBackupStatus"] = avwsadpi.LastBackupStatus - } - if avwsadpi.LastBackupTime != nil { - objectMap["lastBackupTime"] = avwsadpi.LastBackupTime - } - if avwsadpi.LastBackupErrorDetail != nil { - objectMap["lastBackupErrorDetail"] = avwsadpi.LastBackupErrorDetail - } - if avwsadpi.ProtectedItemDataSourceID != nil { - objectMap["protectedItemDataSourceId"] = avwsadpi.ProtectedItemDataSourceID - } - if avwsadpi.ProtectedItemHealthStatus != "" { - objectMap["protectedItemHealthStatus"] = avwsadpi.ProtectedItemHealthStatus - } - if avwsadpi.ExtendedInfo != nil { - objectMap["extendedInfo"] = avwsadpi.ExtendedInfo - } - if avwsadpi.BackupManagementType != "" { - objectMap["backupManagementType"] = avwsadpi.BackupManagementType - } - if avwsadpi.WorkloadType != "" { - objectMap["workloadType"] = avwsadpi.WorkloadType - } - if avwsadpi.ContainerName != nil { - objectMap["containerName"] = avwsadpi.ContainerName - } - if avwsadpi.SourceResourceID != nil { - objectMap["sourceResourceId"] = avwsadpi.SourceResourceID + if avwsiwi.DataDirectoryPaths != nil { + objectMap["dataDirectoryPaths"] = avwsiwi.DataDirectoryPaths } - if avwsadpi.PolicyID != nil { - objectMap["policyId"] = avwsadpi.PolicyID + if avwsiwi.ParentName != nil { + objectMap["parentName"] = avwsiwi.ParentName } - if avwsadpi.LastRecoveryPoint != nil { - objectMap["lastRecoveryPoint"] = avwsadpi.LastRecoveryPoint + if avwsiwi.ServerName != nil { + objectMap["serverName"] = avwsiwi.ServerName } - if avwsadpi.BackupSetName != nil { - objectMap["backupSetName"] = avwsadpi.BackupSetName + if avwsiwi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwsiwi.IsAutoProtectable } - if avwsadpi.CreateMode != "" { - objectMap["createMode"] = avwsadpi.CreateMode + if avwsiwi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwsiwi.Subinquireditemcount } - if avwsadpi.DeferredDeleteTimeInUTC != nil { - objectMap["deferredDeleteTimeInUTC"] = avwsadpi.DeferredDeleteTimeInUTC + if avwsiwi.SubWorkloadItemCount != nil { + objectMap["subWorkloadItemCount"] = avwsiwi.SubWorkloadItemCount } - if avwsadpi.IsScheduledForDeferredDelete != nil { - objectMap["isScheduledForDeferredDelete"] = avwsadpi.IsScheduledForDeferredDelete + if avwsiwi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwsiwi.BackupManagementType } - if avwsadpi.DeferredDeleteTimeRemaining != nil { - objectMap["deferredDeleteTimeRemaining"] = avwsadpi.DeferredDeleteTimeRemaining + if avwsiwi.WorkloadType != nil { + objectMap["workloadType"] = avwsiwi.WorkloadType } - if avwsadpi.IsDeferredDeleteScheduleUpcoming != nil { - objectMap["isDeferredDeleteScheduleUpcoming"] = avwsadpi.IsDeferredDeleteScheduleUpcoming + if avwsiwi.FriendlyName != nil { + objectMap["friendlyName"] = avwsiwi.FriendlyName } - if avwsadpi.IsRehydrate != nil { - objectMap["isRehydrate"] = avwsadpi.IsRehydrate + if avwsiwi.ProtectionState != "" { + objectMap["protectionState"] = avwsiwi.ProtectionState } - if avwsadpi.ProtectedItemType != "" { - objectMap["protectedItemType"] = avwsadpi.ProtectedItemType + if avwsiwi.WorkloadItemType != "" { + objectMap["workloadItemType"] = avwsiwi.WorkloadItemType } return json.Marshal(objectMap) } -// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { +// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. +func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { return nil, false } -// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { - return nil, false +// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. +func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { + return &avwsiwi, true } -// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { +// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. +func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { return nil, false } -// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { - return &avwsadpi, true -} - -// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { - return &avwsadpi, true -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { +// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. +func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { return nil, false } -// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { +// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. +func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { return nil, false } -// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { +// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. +func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { return nil, false } -// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { +// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. +func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { return nil, false } -// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { - return nil, false +// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. +func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { + return &avwsiwi, true } -// AsProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { +// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. +func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { return nil, false } -// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { - return &avwsadpi, true +// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. +func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { + return &avwsiwi, true } -// AzureVMWorkloadSAPAseDatabaseWorkloadItem azure VM workload-specific workload item representing SAP ASE -// Database. -type AzureVMWorkloadSAPAseDatabaseWorkloadItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // IsAutoProtectable - Indicates if workload item is auto-protectable - IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DBs present - Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // SubWorkloadItemCount - For instance or AG, indicates number of DBs to be protected - SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' - WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` +// AzureWorkloadBackupRequest azureWorkload workload-specific backup request. +type AzureWorkloadBackupRequest struct { + // BackupType - Type of backup, viz. Full, Differential, Log or CopyOnlyFull. Possible values include: 'TypeInvalid', 'TypeFull', 'TypeDifferential', 'TypeLog', 'TypeCopyOnlyFull' + BackupType Type `json:"backupType,omitempty"` + // EnableCompression - Bool for Compression setting + EnableCompression *bool `json:"enableCompression,omitempty"` + // RecoveryPointExpiryTimeInUTC - Backup copy will expire after the time specified (UTC). + RecoveryPointExpiryTimeInUTC *date.Time `json:"recoveryPointExpiryTimeInUTC,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeBackupRequest', 'ObjectTypeAzureFileShareBackupRequest', 'ObjectTypeAzureWorkloadBackupRequest', 'ObjectTypeIaasVMBackupRequest' + ObjectType ObjectType `json:"objectType,omitempty"` } -// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPAseDatabaseWorkloadItem. -func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) MarshalJSON() ([]byte, error) { - avwsadwi.WorkloadItemType = WorkloadItemTypeSAPAseDatabase1 +// MarshalJSON is the custom marshaler for AzureWorkloadBackupRequest. +func (awbr AzureWorkloadBackupRequest) MarshalJSON() ([]byte, error) { + awbr.ObjectType = ObjectTypeAzureWorkloadBackupRequest objectMap := make(map[string]interface{}) - if avwsadwi.ParentName != nil { - objectMap["parentName"] = avwsadwi.ParentName - } - if avwsadwi.ServerName != nil { - objectMap["serverName"] = avwsadwi.ServerName - } - if avwsadwi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwsadwi.IsAutoProtectable - } - if avwsadwi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwsadwi.Subinquireditemcount - } - if avwsadwi.SubWorkloadItemCount != nil { - objectMap["subWorkloadItemCount"] = avwsadwi.SubWorkloadItemCount - } - if avwsadwi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwsadwi.BackupManagementType - } - if avwsadwi.WorkloadType != nil { - objectMap["workloadType"] = avwsadwi.WorkloadType + if awbr.BackupType != "" { + objectMap["backupType"] = awbr.BackupType } - if avwsadwi.FriendlyName != nil { - objectMap["friendlyName"] = avwsadwi.FriendlyName + if awbr.EnableCompression != nil { + objectMap["enableCompression"] = awbr.EnableCompression } - if avwsadwi.ProtectionState != "" { - objectMap["protectionState"] = avwsadwi.ProtectionState + if awbr.RecoveryPointExpiryTimeInUTC != nil { + objectMap["recoveryPointExpiryTimeInUTC"] = awbr.RecoveryPointExpiryTimeInUTC } - if avwsadwi.WorkloadItemType != "" { - objectMap["workloadItemType"] = avwsadwi.WorkloadItemType + if awbr.ObjectType != "" { + objectMap["objectType"] = awbr.ObjectType } return json.Marshal(objectMap) } -// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. -func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { +// AsAzureFileShareBackupRequest is the BasicRequest implementation for AzureWorkloadBackupRequest. +func (awbr AzureWorkloadBackupRequest) AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) { return nil, false } -// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. -func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { - return &avwsadwi, true -} - -// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. -func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { - return &avwsadwi, true +// AsAzureWorkloadBackupRequest is the BasicRequest implementation for AzureWorkloadBackupRequest. +func (awbr AzureWorkloadBackupRequest) AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) { + return &awbr, true } -// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. -func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { +// AsIaasVMBackupRequest is the BasicRequest implementation for AzureWorkloadBackupRequest. +func (awbr AzureWorkloadBackupRequest) AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. -func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { +// AsRequest is the BasicRequest implementation for AzureWorkloadBackupRequest. +func (awbr AzureWorkloadBackupRequest) AsRequest() (*Request, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. -func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { - return nil, false +// AsBasicRequest is the BasicRequest implementation for AzureWorkloadBackupRequest. +func (awbr AzureWorkloadBackupRequest) AsBasicRequest() (BasicRequest, bool) { + return &awbr, true } -// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. -func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. -func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { - return nil, false +// BasicAzureWorkloadContainer container for the workloads running inside Azure Compute or Classic Compute. +type BasicAzureWorkloadContainer interface { + AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) + AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) + AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) } -// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. -func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { - return nil, false +// AzureWorkloadContainer container for the workloads running inside Azure Compute or Classic Compute. +type AzureWorkloadContainer struct { + // SourceResourceID - ARM ID of the virtual machine represented by this Azure Workload Container + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // LastUpdatedTime - Time stamp when this container was updated. + LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"` + // ExtendedInfo - Additional details of a workload container. + ExtendedInfo *AzureWorkloadContainerExtendedInfo `json:"extendedInfo,omitempty"` + // WorkloadType - Workload type for which registration was sent. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' + WorkloadType WorkloadType `json:"workloadType,omitempty"` + // OperationType - Re-Do Operation. Possible values include: 'OperationTypeInvalid', 'OperationTypeRegister', 'OperationTypeReregister' + OperationType OperationType `json:"operationType,omitempty"` + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` } -// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. -func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { - return &avwsadwi, true +func unmarshalBasicAzureWorkloadContainer(body []byte) (BasicAzureWorkloadContainer, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["containerType"] { + case string(ContainerTypeSQLAGWorkLoadContainer1): + var aswcpc AzureSQLAGWorkloadContainerProtectionContainer + err := json.Unmarshal(body, &aswcpc) + return aswcpc, err + case string(ContainerTypeVMAppContainer1): + var avacpc AzureVMAppContainerProtectionContainer + err := json.Unmarshal(body, &avacpc) + return avacpc, err + default: + var awc AzureWorkloadContainer + err := json.Unmarshal(body, &awc) + return awc, err + } } +func unmarshalBasicAzureWorkloadContainerArray(body []byte) ([]BasicAzureWorkloadContainer, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } -// AzureVMWorkloadSAPAseSystemProtectableItem azure VM workload-specific protectable item representing SAP -// ASE System. -type AzureVMWorkloadSAPAseSystemProtectableItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent - // Only Applicable for data bases where the parent would be either Instance or a SQL AG. - ParentUniqueName *string `json:"parentUniqueName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // IsAutoProtectable - Indicates if protectable item is auto-protectable - IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` - // IsAutoProtected - Indicates if protectable item is auto-protected - IsAutoProtected *bool `json:"isAutoProtected,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DBs present - Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // Subprotectableitemcount - For instance or AG, indicates number of DBs to be protected - Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` - // Prebackupvalidation - Pre-backup validation for protectable objects - Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseDatabase', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` + awcArray := make([]BasicAzureWorkloadContainer, len(rawMessages)) + + for index, rawMessage := range rawMessages { + awc, err := unmarshalBasicAzureWorkloadContainer(*rawMessage) + if err != nil { + return nil, err + } + awcArray[index] = awc + } + return awcArray, nil } -// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) MarshalJSON() ([]byte, error) { - avwsaspi.ProtectableItemType = ProtectableItemTypeSAPAseSystem +// MarshalJSON is the custom marshaler for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) MarshalJSON() ([]byte, error) { + awc.ContainerType = ContainerTypeAzureWorkloadContainer objectMap := make(map[string]interface{}) - if avwsaspi.ParentName != nil { - objectMap["parentName"] = avwsaspi.ParentName - } - if avwsaspi.ParentUniqueName != nil { - objectMap["parentUniqueName"] = avwsaspi.ParentUniqueName - } - if avwsaspi.ServerName != nil { - objectMap["serverName"] = avwsaspi.ServerName - } - if avwsaspi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwsaspi.IsAutoProtectable + if awc.SourceResourceID != nil { + objectMap["sourceResourceId"] = awc.SourceResourceID } - if avwsaspi.IsAutoProtected != nil { - objectMap["isAutoProtected"] = avwsaspi.IsAutoProtected + if awc.LastUpdatedTime != nil { + objectMap["lastUpdatedTime"] = awc.LastUpdatedTime } - if avwsaspi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwsaspi.Subinquireditemcount + if awc.ExtendedInfo != nil { + objectMap["extendedInfo"] = awc.ExtendedInfo } - if avwsaspi.Subprotectableitemcount != nil { - objectMap["subprotectableitemcount"] = avwsaspi.Subprotectableitemcount + if awc.WorkloadType != "" { + objectMap["workloadType"] = awc.WorkloadType } - if avwsaspi.Prebackupvalidation != nil { - objectMap["prebackupvalidation"] = avwsaspi.Prebackupvalidation + if awc.OperationType != "" { + objectMap["operationType"] = awc.OperationType } - if avwsaspi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwsaspi.BackupManagementType + if awc.FriendlyName != nil { + objectMap["friendlyName"] = awc.FriendlyName } - if avwsaspi.WorkloadType != nil { - objectMap["workloadType"] = avwsaspi.WorkloadType + if awc.BackupManagementType != "" { + objectMap["backupManagementType"] = awc.BackupManagementType } - if avwsaspi.FriendlyName != nil { - objectMap["friendlyName"] = avwsaspi.FriendlyName + if awc.RegistrationStatus != nil { + objectMap["registrationStatus"] = awc.RegistrationStatus } - if avwsaspi.ProtectionState != "" { - objectMap["protectionState"] = avwsaspi.ProtectionState + if awc.HealthStatus != nil { + objectMap["healthStatus"] = awc.HealthStatus } - if avwsaspi.ProtectableItemType != "" { - objectMap["protectableItemType"] = avwsaspi.ProtectableItemType + if awc.ContainerType != "" { + objectMap["containerType"] = awc.ContainerType } return json.Marshal(objectMap) } -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { return nil, false } -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { return nil, false } -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { return nil, false } -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { return nil, false } -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return &avwsaspi, true +// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return nil, false } -// AsAzureVMWorkloadSAPAseDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSAPAseDatabaseProtectableItem() (*AzureVMWorkloadSAPAseDatabaseProtectableItem, bool) { +// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { return nil, false } -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { - return &avwsaspi, true +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { + return nil, false } -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { - return nil, false +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { + return &awc, true } -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { - return nil, false +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return &awc, true } -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { +// AsDpmContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsDpmContainer() (*DpmContainer, bool) { return nil, false } -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { +// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { return nil, false } -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { +// AsGenericContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsGenericContainer() (*GenericContainer, bool) { return nil, false } -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { +// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { return nil, false } -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { return nil, false } -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { +// AsMabContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsMabContainer() (*MabContainer, bool) { return nil, false } -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &avwsaspi, true +// AsProtectionContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return nil, false } -// AzureVMWorkloadSAPAseSystemWorkloadItem azure VM workload-specific workload item representing SAP ASE -// System. -type AzureVMWorkloadSAPAseSystemWorkloadItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // IsAutoProtectable - Indicates if workload item is auto-protectable - IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DBs present - Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // SubWorkloadItemCount - For instance or AG, indicates number of DBs to be protected - SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' - WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &awc, true } -// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPAseSystemWorkloadItem. -func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) MarshalJSON() ([]byte, error) { - avwsaswi.WorkloadItemType = WorkloadItemTypeSAPAseSystem1 - objectMap := make(map[string]interface{}) - if avwsaswi.ParentName != nil { - objectMap["parentName"] = avwsaswi.ParentName - } - if avwsaswi.ServerName != nil { - objectMap["serverName"] = avwsaswi.ServerName - } - if avwsaswi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwsaswi.IsAutoProtectable - } - if avwsaswi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwsaswi.Subinquireditemcount - } - if avwsaswi.SubWorkloadItemCount != nil { - objectMap["subWorkloadItemCount"] = avwsaswi.SubWorkloadItemCount - } - if avwsaswi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwsaswi.BackupManagementType - } - if avwsaswi.WorkloadType != nil { - objectMap["workloadType"] = avwsaswi.WorkloadType - } - if avwsaswi.FriendlyName != nil { - objectMap["friendlyName"] = avwsaswi.FriendlyName - } - if avwsaswi.ProtectionState != "" { - objectMap["protectionState"] = avwsaswi.ProtectionState - } - if avwsaswi.WorkloadItemType != "" { - objectMap["workloadItemType"] = avwsaswi.WorkloadItemType - } - return json.Marshal(objectMap) -} - -// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. -func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. -func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { - return &avwsaswi, true -} - -// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. -func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. -func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { - return &avwsaswi, true -} - -// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. -func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. -func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. -func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. -func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { - return nil, false -} - -// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. -func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { - return nil, false -} - -// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. -func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { - return &avwsaswi, true -} - -// AzureVMWorkloadSAPHanaDatabaseProtectableItem azure VM workload-specific protectable item representing -// SAP HANA Database. -type AzureVMWorkloadSAPHanaDatabaseProtectableItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent - // Only Applicable for data bases where the parent would be either Instance or a SQL AG. - ParentUniqueName *string `json:"parentUniqueName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // IsAutoProtectable - Indicates if protectable item is auto-protectable - IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` - // IsAutoProtected - Indicates if protectable item is auto-protected - IsAutoProtected *bool `json:"isAutoProtected,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DBs present - Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // Subprotectableitemcount - For instance or AG, indicates number of DBs to be protected - Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` - // Prebackupvalidation - Pre-backup validation for protectable objects - Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseDatabase', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) MarshalJSON() ([]byte, error) { - avwshdpi.ProtectableItemType = ProtectableItemTypeSAPHanaDatabase - objectMap := make(map[string]interface{}) - if avwshdpi.ParentName != nil { - objectMap["parentName"] = avwshdpi.ParentName - } - if avwshdpi.ParentUniqueName != nil { - objectMap["parentUniqueName"] = avwshdpi.ParentUniqueName - } - if avwshdpi.ServerName != nil { - objectMap["serverName"] = avwshdpi.ServerName - } - if avwshdpi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwshdpi.IsAutoProtectable - } - if avwshdpi.IsAutoProtected != nil { - objectMap["isAutoProtected"] = avwshdpi.IsAutoProtected - } - if avwshdpi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwshdpi.Subinquireditemcount - } - if avwshdpi.Subprotectableitemcount != nil { - objectMap["subprotectableitemcount"] = avwshdpi.Subprotectableitemcount - } - if avwshdpi.Prebackupvalidation != nil { - objectMap["prebackupvalidation"] = avwshdpi.Prebackupvalidation - } - if avwshdpi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwshdpi.BackupManagementType - } - if avwshdpi.WorkloadType != nil { - objectMap["workloadType"] = avwshdpi.WorkloadType - } - if avwshdpi.FriendlyName != nil { - objectMap["friendlyName"] = avwshdpi.FriendlyName - } - if avwshdpi.ProtectionState != "" { - objectMap["protectionState"] = avwshdpi.ProtectionState - } - if avwshdpi.ProtectableItemType != "" { - objectMap["protectableItemType"] = avwshdpi.ProtectableItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return &avwshdpi, true -} - -// AsAzureVMWorkloadSAPAseDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSAPAseDatabaseProtectableItem() (*AzureVMWorkloadSAPAseDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { - return &avwshdpi, true -} - -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { - return nil, false -} - -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { - return nil, false -} - -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { - return nil, false -} - -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &avwshdpi, true -} - -// AzureVMWorkloadSAPHanaDatabaseProtectedItem azure VM workload-specific protected item representing SAP -// HANA Database. -type AzureVMWorkloadSAPHanaDatabaseProtectedItem struct { - // FriendlyName - Friendly name of the DB represented by this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // ParentName - Parent name of the DB such as Instance or Availability Group. - ParentName *string `json:"parentName,omitempty"` - // ParentType - Parent type of protected item, example: for a DB, standalone server or distributed - ParentType *string `json:"parentType,omitempty"` - // ProtectionStatus - Backup status of this backup item. - ProtectionStatus *string `json:"protectionStatus,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' - ProtectionState ProtectionState `json:"protectionState,omitempty"` - // LastBackupStatus - Last backup operation status. Possible values: Healthy, Unhealthy. Possible values include: 'LastBackupStatusInvalid', 'LastBackupStatusHealthy', 'LastBackupStatusUnhealthy', 'LastBackupStatusIRPending' - LastBackupStatus LastBackupStatus `json:"lastBackupStatus,omitempty"` - // LastBackupTime - Timestamp of the last backup operation on this backup item. - LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` - // LastBackupErrorDetail - Error details in last backup - LastBackupErrorDetail *ErrorDetail `json:"lastBackupErrorDetail,omitempty"` - // ProtectedItemDataSourceID - Data ID of the protected item. - ProtectedItemDataSourceID *string `json:"protectedItemDataSourceId,omitempty"` - // ProtectedItemHealthStatus - Health status of the backup item, evaluated based on last heartbeat received. Possible values include: 'ProtectedItemHealthStatusInvalid', 'ProtectedItemHealthStatusHealthy', 'ProtectedItemHealthStatusUnhealthy', 'ProtectedItemHealthStatusNotReachable', 'ProtectedItemHealthStatusIRPending' - ProtectedItemHealthStatus ProtectedItemHealthStatus `json:"protectedItemHealthStatus,omitempty"` - // ExtendedInfo - Additional information for this backup item. - ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - WorkloadType DataSourceType `json:"workloadType,omitempty"` - // ContainerName - Unique name of container - ContainerName *string `json:"containerName,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. - LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` - // BackupSetName - Name of the backup set the backup item belongs to - BackupSetName *string `json:"backupSetName,omitempty"` - // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' - CreateMode CreateMode `json:"createMode,omitempty"` - // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC - DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` - // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state - IsRehydrate *bool `json:"isRehydrate,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' - ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) MarshalJSON() ([]byte, error) { - avwshdpi.ProtectedItemType = ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase - objectMap := make(map[string]interface{}) - if avwshdpi.FriendlyName != nil { - objectMap["friendlyName"] = avwshdpi.FriendlyName - } - if avwshdpi.ServerName != nil { - objectMap["serverName"] = avwshdpi.ServerName - } - if avwshdpi.ParentName != nil { - objectMap["parentName"] = avwshdpi.ParentName - } - if avwshdpi.ParentType != nil { - objectMap["parentType"] = avwshdpi.ParentType - } - if avwshdpi.ProtectionStatus != nil { - objectMap["protectionStatus"] = avwshdpi.ProtectionStatus - } - if avwshdpi.ProtectionState != "" { - objectMap["protectionState"] = avwshdpi.ProtectionState - } - if avwshdpi.LastBackupStatus != "" { - objectMap["lastBackupStatus"] = avwshdpi.LastBackupStatus - } - if avwshdpi.LastBackupTime != nil { - objectMap["lastBackupTime"] = avwshdpi.LastBackupTime - } - if avwshdpi.LastBackupErrorDetail != nil { - objectMap["lastBackupErrorDetail"] = avwshdpi.LastBackupErrorDetail - } - if avwshdpi.ProtectedItemDataSourceID != nil { - objectMap["protectedItemDataSourceId"] = avwshdpi.ProtectedItemDataSourceID - } - if avwshdpi.ProtectedItemHealthStatus != "" { - objectMap["protectedItemHealthStatus"] = avwshdpi.ProtectedItemHealthStatus - } - if avwshdpi.ExtendedInfo != nil { - objectMap["extendedInfo"] = avwshdpi.ExtendedInfo - } - if avwshdpi.BackupManagementType != "" { - objectMap["backupManagementType"] = avwshdpi.BackupManagementType - } - if avwshdpi.WorkloadType != "" { - objectMap["workloadType"] = avwshdpi.WorkloadType - } - if avwshdpi.ContainerName != nil { - objectMap["containerName"] = avwshdpi.ContainerName - } - if avwshdpi.SourceResourceID != nil { - objectMap["sourceResourceId"] = avwshdpi.SourceResourceID - } - if avwshdpi.PolicyID != nil { - objectMap["policyId"] = avwshdpi.PolicyID - } - if avwshdpi.LastRecoveryPoint != nil { - objectMap["lastRecoveryPoint"] = avwshdpi.LastRecoveryPoint - } - if avwshdpi.BackupSetName != nil { - objectMap["backupSetName"] = avwshdpi.BackupSetName - } - if avwshdpi.CreateMode != "" { - objectMap["createMode"] = avwshdpi.CreateMode - } - if avwshdpi.DeferredDeleteTimeInUTC != nil { - objectMap["deferredDeleteTimeInUTC"] = avwshdpi.DeferredDeleteTimeInUTC - } - if avwshdpi.IsScheduledForDeferredDelete != nil { - objectMap["isScheduledForDeferredDelete"] = avwshdpi.IsScheduledForDeferredDelete - } - if avwshdpi.DeferredDeleteTimeRemaining != nil { - objectMap["deferredDeleteTimeRemaining"] = avwshdpi.DeferredDeleteTimeRemaining - } - if avwshdpi.IsDeferredDeleteScheduleUpcoming != nil { - objectMap["isDeferredDeleteScheduleUpcoming"] = avwshdpi.IsDeferredDeleteScheduleUpcoming - } - if avwshdpi.IsRehydrate != nil { - objectMap["isRehydrate"] = avwshdpi.IsRehydrate - } - if avwshdpi.ProtectedItemType != "" { - objectMap["protectedItemType"] = avwshdpi.ProtectedItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { - return &avwshdpi, true -} - -// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { - return &avwshdpi, true -} - -// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { - return nil, false -} - -// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { - return nil, false -} - -// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { - return nil, false -} - -// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { - return nil, false -} - -// AsProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { - return nil, false -} - -// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { - return &avwshdpi, true -} - -// AzureVMWorkloadSAPHanaDatabaseWorkloadItem azure VM workload-specific workload item representing SAP -// HANA Database. -type AzureVMWorkloadSAPHanaDatabaseWorkloadItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // IsAutoProtectable - Indicates if workload item is auto-protectable - IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DBs present - Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // SubWorkloadItemCount - For instance or AG, indicates number of DBs to be protected - SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' - WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) MarshalJSON() ([]byte, error) { - avwshdwi.WorkloadItemType = WorkloadItemTypeSAPHanaDatabase1 - objectMap := make(map[string]interface{}) - if avwshdwi.ParentName != nil { - objectMap["parentName"] = avwshdwi.ParentName - } - if avwshdwi.ServerName != nil { - objectMap["serverName"] = avwshdwi.ServerName - } - if avwshdwi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwshdwi.IsAutoProtectable - } - if avwshdwi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwshdwi.Subinquireditemcount - } - if avwshdwi.SubWorkloadItemCount != nil { - objectMap["subWorkloadItemCount"] = avwshdwi.SubWorkloadItemCount - } - if avwshdwi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwshdwi.BackupManagementType - } - if avwshdwi.WorkloadType != nil { - objectMap["workloadType"] = avwshdwi.WorkloadType - } - if avwshdwi.FriendlyName != nil { - objectMap["friendlyName"] = avwshdwi.FriendlyName - } - if avwshdwi.ProtectionState != "" { - objectMap["protectionState"] = avwshdwi.ProtectionState - } - if avwshdwi.WorkloadItemType != "" { - objectMap["workloadItemType"] = avwshdwi.WorkloadItemType - } - return json.Marshal(objectMap) -} - -// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { - return &avwshdwi, true -} - -// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { - return &avwshdwi, true -} - -// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { - return nil, false -} - -// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { - return nil, false -} - -// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { - return &avwshdwi, true -} - -// AzureVMWorkloadSAPHanaSystemProtectableItem azure VM workload-specific protectable item representing SAP -// HANA System. -type AzureVMWorkloadSAPHanaSystemProtectableItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent - // Only Applicable for data bases where the parent would be either Instance or a SQL AG. - ParentUniqueName *string `json:"parentUniqueName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // IsAutoProtectable - Indicates if protectable item is auto-protectable - IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` - // IsAutoProtected - Indicates if protectable item is auto-protected - IsAutoProtected *bool `json:"isAutoProtected,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DBs present - Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // Subprotectableitemcount - For instance or AG, indicates number of DBs to be protected - Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` - // Prebackupvalidation - Pre-backup validation for protectable objects - Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseDatabase', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) MarshalJSON() ([]byte, error) { - avwshspi.ProtectableItemType = ProtectableItemTypeSAPHanaSystem - objectMap := make(map[string]interface{}) - if avwshspi.ParentName != nil { - objectMap["parentName"] = avwshspi.ParentName - } - if avwshspi.ParentUniqueName != nil { - objectMap["parentUniqueName"] = avwshspi.ParentUniqueName - } - if avwshspi.ServerName != nil { - objectMap["serverName"] = avwshspi.ServerName - } - if avwshspi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwshspi.IsAutoProtectable - } - if avwshspi.IsAutoProtected != nil { - objectMap["isAutoProtected"] = avwshspi.IsAutoProtected - } - if avwshspi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwshspi.Subinquireditemcount - } - if avwshspi.Subprotectableitemcount != nil { - objectMap["subprotectableitemcount"] = avwshspi.Subprotectableitemcount - } - if avwshspi.Prebackupvalidation != nil { - objectMap["prebackupvalidation"] = avwshspi.Prebackupvalidation - } - if avwshspi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwshspi.BackupManagementType - } - if avwshspi.WorkloadType != nil { - objectMap["workloadType"] = avwshspi.WorkloadType - } - if avwshspi.FriendlyName != nil { - objectMap["friendlyName"] = avwshspi.FriendlyName - } - if avwshspi.ProtectionState != "" { - objectMap["protectionState"] = avwshspi.ProtectionState - } - if avwshspi.ProtectableItemType != "" { - objectMap["protectableItemType"] = avwshspi.ProtectableItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return &avwshspi, true -} - -// AsAzureVMWorkloadSAPAseDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSAPAseDatabaseProtectableItem() (*AzureVMWorkloadSAPAseDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { - return &avwshspi, true -} - -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { - return nil, false -} - -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { - return nil, false -} - -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { - return nil, false -} - -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &avwshspi, true -} - -// AzureVMWorkloadSAPHanaSystemWorkloadItem azure VM workload-specific workload item representing SAP HANA -// System. -type AzureVMWorkloadSAPHanaSystemWorkloadItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // IsAutoProtectable - Indicates if workload item is auto-protectable - IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DBs present - Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // SubWorkloadItemCount - For instance or AG, indicates number of DBs to be protected - SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' - WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) MarshalJSON() ([]byte, error) { - avwshswi.WorkloadItemType = WorkloadItemTypeSAPHanaSystem1 - objectMap := make(map[string]interface{}) - if avwshswi.ParentName != nil { - objectMap["parentName"] = avwshswi.ParentName - } - if avwshswi.ServerName != nil { - objectMap["serverName"] = avwshswi.ServerName - } - if avwshswi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwshswi.IsAutoProtectable - } - if avwshswi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwshswi.Subinquireditemcount - } - if avwshswi.SubWorkloadItemCount != nil { - objectMap["subWorkloadItemCount"] = avwshswi.SubWorkloadItemCount - } - if avwshswi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwshswi.BackupManagementType - } - if avwshswi.WorkloadType != nil { - objectMap["workloadType"] = avwshswi.WorkloadType - } - if avwshswi.FriendlyName != nil { - objectMap["friendlyName"] = avwshswi.FriendlyName - } - if avwshswi.ProtectionState != "" { - objectMap["protectionState"] = avwshswi.ProtectionState - } - if avwshswi.WorkloadItemType != "" { - objectMap["workloadItemType"] = avwshswi.WorkloadItemType - } - return json.Marshal(objectMap) -} - -// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { - return &avwshswi, true -} - -// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { - return &avwshswi, true -} - -// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { - return nil, false -} - -// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { - return nil, false -} - -// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { - return &avwshswi, true -} - -// AzureVMWorkloadSQLAvailabilityGroupProtectableItem azure VM workload-specific protectable item -// representing SQL Availability Group. -type AzureVMWorkloadSQLAvailabilityGroupProtectableItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent - // Only Applicable for data bases where the parent would be either Instance or a SQL AG. - ParentUniqueName *string `json:"parentUniqueName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // IsAutoProtectable - Indicates if protectable item is auto-protectable - IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` - // IsAutoProtected - Indicates if protectable item is auto-protected - IsAutoProtected *bool `json:"isAutoProtected,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DBs present - Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // Subprotectableitemcount - For instance or AG, indicates number of DBs to be protected - Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` - // Prebackupvalidation - Pre-backup validation for protectable objects - Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseDatabase', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) MarshalJSON() ([]byte, error) { - avwsagpi.ProtectableItemType = ProtectableItemTypeSQLAvailabilityGroupContainer - objectMap := make(map[string]interface{}) - if avwsagpi.ParentName != nil { - objectMap["parentName"] = avwsagpi.ParentName - } - if avwsagpi.ParentUniqueName != nil { - objectMap["parentUniqueName"] = avwsagpi.ParentUniqueName - } - if avwsagpi.ServerName != nil { - objectMap["serverName"] = avwsagpi.ServerName - } - if avwsagpi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwsagpi.IsAutoProtectable - } - if avwsagpi.IsAutoProtected != nil { - objectMap["isAutoProtected"] = avwsagpi.IsAutoProtected - } - if avwsagpi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwsagpi.Subinquireditemcount - } - if avwsagpi.Subprotectableitemcount != nil { - objectMap["subprotectableitemcount"] = avwsagpi.Subprotectableitemcount - } - if avwsagpi.Prebackupvalidation != nil { - objectMap["prebackupvalidation"] = avwsagpi.Prebackupvalidation - } - if avwsagpi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwsagpi.BackupManagementType - } - if avwsagpi.WorkloadType != nil { - objectMap["workloadType"] = avwsagpi.WorkloadType - } - if avwsagpi.FriendlyName != nil { - objectMap["friendlyName"] = avwsagpi.FriendlyName - } - if avwsagpi.ProtectionState != "" { - objectMap["protectionState"] = avwsagpi.ProtectionState - } - if avwsagpi.ProtectableItemType != "" { - objectMap["protectableItemType"] = avwsagpi.ProtectableItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return &avwsagpi, true -} - -// AsAzureVMWorkloadSAPAseDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSAPAseDatabaseProtectableItem() (*AzureVMWorkloadSAPAseDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { - return &avwsagpi, true -} - -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { - return nil, false -} - -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { - return nil, false -} - -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { - return nil, false -} - -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &avwsagpi, true -} - -// AzureVMWorkloadSQLDatabaseProtectableItem azure VM workload-specific protectable item representing SQL -// Database. -type AzureVMWorkloadSQLDatabaseProtectableItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent - // Only Applicable for data bases where the parent would be either Instance or a SQL AG. - ParentUniqueName *string `json:"parentUniqueName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // IsAutoProtectable - Indicates if protectable item is auto-protectable - IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` - // IsAutoProtected - Indicates if protectable item is auto-protected - IsAutoProtected *bool `json:"isAutoProtected,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DBs present - Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // Subprotectableitemcount - For instance or AG, indicates number of DBs to be protected - Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` - // Prebackupvalidation - Pre-backup validation for protectable objects - Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseDatabase', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) MarshalJSON() ([]byte, error) { - avwsdpi.ProtectableItemType = ProtectableItemTypeSQLDataBase - objectMap := make(map[string]interface{}) - if avwsdpi.ParentName != nil { - objectMap["parentName"] = avwsdpi.ParentName - } - if avwsdpi.ParentUniqueName != nil { - objectMap["parentUniqueName"] = avwsdpi.ParentUniqueName - } - if avwsdpi.ServerName != nil { - objectMap["serverName"] = avwsdpi.ServerName - } - if avwsdpi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwsdpi.IsAutoProtectable - } - if avwsdpi.IsAutoProtected != nil { - objectMap["isAutoProtected"] = avwsdpi.IsAutoProtected - } - if avwsdpi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwsdpi.Subinquireditemcount - } - if avwsdpi.Subprotectableitemcount != nil { - objectMap["subprotectableitemcount"] = avwsdpi.Subprotectableitemcount - } - if avwsdpi.Prebackupvalidation != nil { - objectMap["prebackupvalidation"] = avwsdpi.Prebackupvalidation - } - if avwsdpi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwsdpi.BackupManagementType - } - if avwsdpi.WorkloadType != nil { - objectMap["workloadType"] = avwsdpi.WorkloadType - } - if avwsdpi.FriendlyName != nil { - objectMap["friendlyName"] = avwsdpi.FriendlyName - } - if avwsdpi.ProtectionState != "" { - objectMap["protectionState"] = avwsdpi.ProtectionState - } - if avwsdpi.ProtectableItemType != "" { - objectMap["protectableItemType"] = avwsdpi.ProtectableItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return &avwsdpi, true -} - -// AsAzureVMWorkloadSAPAseDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSAPAseDatabaseProtectableItem() (*AzureVMWorkloadSAPAseDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { - return &avwsdpi, true -} - -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { - return nil, false -} - -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { - return nil, false -} - -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { - return nil, false -} - -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &avwsdpi, true -} - -// AzureVMWorkloadSQLDatabaseProtectedItem azure VM workload-specific protected item representing SQL -// Database. -type AzureVMWorkloadSQLDatabaseProtectedItem struct { - // FriendlyName - Friendly name of the DB represented by this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // ParentName - Parent name of the DB such as Instance or Availability Group. - ParentName *string `json:"parentName,omitempty"` - // ParentType - Parent type of protected item, example: for a DB, standalone server or distributed - ParentType *string `json:"parentType,omitempty"` - // ProtectionStatus - Backup status of this backup item. - ProtectionStatus *string `json:"protectionStatus,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' - ProtectionState ProtectionState `json:"protectionState,omitempty"` - // LastBackupStatus - Last backup operation status. Possible values: Healthy, Unhealthy. Possible values include: 'LastBackupStatusInvalid', 'LastBackupStatusHealthy', 'LastBackupStatusUnhealthy', 'LastBackupStatusIRPending' - LastBackupStatus LastBackupStatus `json:"lastBackupStatus,omitempty"` - // LastBackupTime - Timestamp of the last backup operation on this backup item. - LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` - // LastBackupErrorDetail - Error details in last backup - LastBackupErrorDetail *ErrorDetail `json:"lastBackupErrorDetail,omitempty"` - // ProtectedItemDataSourceID - Data ID of the protected item. - ProtectedItemDataSourceID *string `json:"protectedItemDataSourceId,omitempty"` - // ProtectedItemHealthStatus - Health status of the backup item, evaluated based on last heartbeat received. Possible values include: 'ProtectedItemHealthStatusInvalid', 'ProtectedItemHealthStatusHealthy', 'ProtectedItemHealthStatusUnhealthy', 'ProtectedItemHealthStatusNotReachable', 'ProtectedItemHealthStatusIRPending' - ProtectedItemHealthStatus ProtectedItemHealthStatus `json:"protectedItemHealthStatus,omitempty"` - // ExtendedInfo - Additional information for this backup item. - ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - WorkloadType DataSourceType `json:"workloadType,omitempty"` - // ContainerName - Unique name of container - ContainerName *string `json:"containerName,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. - LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` - // BackupSetName - Name of the backup set the backup item belongs to - BackupSetName *string `json:"backupSetName,omitempty"` - // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' - CreateMode CreateMode `json:"createMode,omitempty"` - // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC - DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` - // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state - IsRehydrate *bool `json:"isRehydrate,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' - ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) MarshalJSON() ([]byte, error) { - avwsdpi.ProtectedItemType = ProtectedItemTypeAzureVMWorkloadSQLDatabase - objectMap := make(map[string]interface{}) - if avwsdpi.FriendlyName != nil { - objectMap["friendlyName"] = avwsdpi.FriendlyName - } - if avwsdpi.ServerName != nil { - objectMap["serverName"] = avwsdpi.ServerName - } - if avwsdpi.ParentName != nil { - objectMap["parentName"] = avwsdpi.ParentName - } - if avwsdpi.ParentType != nil { - objectMap["parentType"] = avwsdpi.ParentType - } - if avwsdpi.ProtectionStatus != nil { - objectMap["protectionStatus"] = avwsdpi.ProtectionStatus - } - if avwsdpi.ProtectionState != "" { - objectMap["protectionState"] = avwsdpi.ProtectionState - } - if avwsdpi.LastBackupStatus != "" { - objectMap["lastBackupStatus"] = avwsdpi.LastBackupStatus - } - if avwsdpi.LastBackupTime != nil { - objectMap["lastBackupTime"] = avwsdpi.LastBackupTime - } - if avwsdpi.LastBackupErrorDetail != nil { - objectMap["lastBackupErrorDetail"] = avwsdpi.LastBackupErrorDetail - } - if avwsdpi.ProtectedItemDataSourceID != nil { - objectMap["protectedItemDataSourceId"] = avwsdpi.ProtectedItemDataSourceID - } - if avwsdpi.ProtectedItemHealthStatus != "" { - objectMap["protectedItemHealthStatus"] = avwsdpi.ProtectedItemHealthStatus - } - if avwsdpi.ExtendedInfo != nil { - objectMap["extendedInfo"] = avwsdpi.ExtendedInfo - } - if avwsdpi.BackupManagementType != "" { - objectMap["backupManagementType"] = avwsdpi.BackupManagementType - } - if avwsdpi.WorkloadType != "" { - objectMap["workloadType"] = avwsdpi.WorkloadType - } - if avwsdpi.ContainerName != nil { - objectMap["containerName"] = avwsdpi.ContainerName - } - if avwsdpi.SourceResourceID != nil { - objectMap["sourceResourceId"] = avwsdpi.SourceResourceID - } - if avwsdpi.PolicyID != nil { - objectMap["policyId"] = avwsdpi.PolicyID - } - if avwsdpi.LastRecoveryPoint != nil { - objectMap["lastRecoveryPoint"] = avwsdpi.LastRecoveryPoint - } - if avwsdpi.BackupSetName != nil { - objectMap["backupSetName"] = avwsdpi.BackupSetName - } - if avwsdpi.CreateMode != "" { - objectMap["createMode"] = avwsdpi.CreateMode - } - if avwsdpi.DeferredDeleteTimeInUTC != nil { - objectMap["deferredDeleteTimeInUTC"] = avwsdpi.DeferredDeleteTimeInUTC - } - if avwsdpi.IsScheduledForDeferredDelete != nil { - objectMap["isScheduledForDeferredDelete"] = avwsdpi.IsScheduledForDeferredDelete - } - if avwsdpi.DeferredDeleteTimeRemaining != nil { - objectMap["deferredDeleteTimeRemaining"] = avwsdpi.DeferredDeleteTimeRemaining - } - if avwsdpi.IsDeferredDeleteScheduleUpcoming != nil { - objectMap["isDeferredDeleteScheduleUpcoming"] = avwsdpi.IsDeferredDeleteScheduleUpcoming - } - if avwsdpi.IsRehydrate != nil { - objectMap["isRehydrate"] = avwsdpi.IsRehydrate - } - if avwsdpi.ProtectedItemType != "" { - objectMap["protectedItemType"] = avwsdpi.ProtectedItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { - return &avwsdpi, true -} - -// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { - return &avwsdpi, true -} - -// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { - return nil, false -} - -// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { - return nil, false -} - -// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { - return nil, false -} - -// AsProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { - return nil, false -} - -// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { - return &avwsdpi, true -} - -// AzureVMWorkloadSQLDatabaseWorkloadItem azure VM workload-specific workload item representing SQL -// Database. -type AzureVMWorkloadSQLDatabaseWorkloadItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // IsAutoProtectable - Indicates if workload item is auto-protectable - IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DBs present - Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // SubWorkloadItemCount - For instance or AG, indicates number of DBs to be protected - SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' - WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLDatabaseWorkloadItem. -func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) MarshalJSON() ([]byte, error) { - avwsdwi.WorkloadItemType = WorkloadItemTypeSQLDataBase1 - objectMap := make(map[string]interface{}) - if avwsdwi.ParentName != nil { - objectMap["parentName"] = avwsdwi.ParentName - } - if avwsdwi.ServerName != nil { - objectMap["serverName"] = avwsdwi.ServerName - } - if avwsdwi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwsdwi.IsAutoProtectable - } - if avwsdwi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwsdwi.Subinquireditemcount - } - if avwsdwi.SubWorkloadItemCount != nil { - objectMap["subWorkloadItemCount"] = avwsdwi.SubWorkloadItemCount - } - if avwsdwi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwsdwi.BackupManagementType - } - if avwsdwi.WorkloadType != nil { - objectMap["workloadType"] = avwsdwi.WorkloadType - } - if avwsdwi.FriendlyName != nil { - objectMap["friendlyName"] = avwsdwi.FriendlyName - } - if avwsdwi.ProtectionState != "" { - objectMap["protectionState"] = avwsdwi.ProtectionState - } - if avwsdwi.WorkloadItemType != "" { - objectMap["workloadItemType"] = avwsdwi.WorkloadItemType - } - return json.Marshal(objectMap) -} - -// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. -func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. -func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { - return &avwsdwi, true -} - -// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. -func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. -func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. -func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. -func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. -func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { - return &avwsdwi, true -} - -// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. -func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { - return nil, false -} - -// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. -func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { - return nil, false -} - -// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. -func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { - return &avwsdwi, true -} - -// AzureVMWorkloadSQLInstanceProtectableItem azure VM workload-specific protectable item representing SQL -// Instance. -type AzureVMWorkloadSQLInstanceProtectableItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent - // Only Applicable for data bases where the parent would be either Instance or a SQL AG. - ParentUniqueName *string `json:"parentUniqueName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // IsAutoProtectable - Indicates if protectable item is auto-protectable - IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` - // IsAutoProtected - Indicates if protectable item is auto-protected - IsAutoProtected *bool `json:"isAutoProtected,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DBs present - Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // Subprotectableitemcount - For instance or AG, indicates number of DBs to be protected - Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` - // Prebackupvalidation - Pre-backup validation for protectable objects - Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseDatabase', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) MarshalJSON() ([]byte, error) { - avwsipi.ProtectableItemType = ProtectableItemTypeSQLInstance - objectMap := make(map[string]interface{}) - if avwsipi.ParentName != nil { - objectMap["parentName"] = avwsipi.ParentName - } - if avwsipi.ParentUniqueName != nil { - objectMap["parentUniqueName"] = avwsipi.ParentUniqueName - } - if avwsipi.ServerName != nil { - objectMap["serverName"] = avwsipi.ServerName - } - if avwsipi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwsipi.IsAutoProtectable - } - if avwsipi.IsAutoProtected != nil { - objectMap["isAutoProtected"] = avwsipi.IsAutoProtected - } - if avwsipi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwsipi.Subinquireditemcount - } - if avwsipi.Subprotectableitemcount != nil { - objectMap["subprotectableitemcount"] = avwsipi.Subprotectableitemcount - } - if avwsipi.Prebackupvalidation != nil { - objectMap["prebackupvalidation"] = avwsipi.Prebackupvalidation - } - if avwsipi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwsipi.BackupManagementType - } - if avwsipi.WorkloadType != nil { - objectMap["workloadType"] = avwsipi.WorkloadType - } - if avwsipi.FriendlyName != nil { - objectMap["friendlyName"] = avwsipi.FriendlyName - } - if avwsipi.ProtectionState != "" { - objectMap["protectionState"] = avwsipi.ProtectionState - } - if avwsipi.ProtectableItemType != "" { - objectMap["protectableItemType"] = avwsipi.ProtectableItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return &avwsipi, true -} - -// AsAzureVMWorkloadSAPAseDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSAPAseDatabaseProtectableItem() (*AzureVMWorkloadSAPAseDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { - return &avwsipi, true -} - -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { - return nil, false -} - -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { - return nil, false -} - -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &avwsipi, true -} - -// AzureVMWorkloadSQLInstanceWorkloadItem azure VM workload-specific workload item representing SQL -// Instance. -type AzureVMWorkloadSQLInstanceWorkloadItem struct { - // DataDirectoryPaths - Data Directory Paths for default directories - DataDirectoryPaths *[]SQLDataDirectory `json:"dataDirectoryPaths,omitempty"` - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // IsAutoProtectable - Indicates if workload item is auto-protectable - IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DBs present - Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // SubWorkloadItemCount - For instance or AG, indicates number of DBs to be protected - SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' - WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLInstanceWorkloadItem. -func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) MarshalJSON() ([]byte, error) { - avwsiwi.WorkloadItemType = WorkloadItemTypeSQLInstance1 - objectMap := make(map[string]interface{}) - if avwsiwi.DataDirectoryPaths != nil { - objectMap["dataDirectoryPaths"] = avwsiwi.DataDirectoryPaths - } - if avwsiwi.ParentName != nil { - objectMap["parentName"] = avwsiwi.ParentName - } - if avwsiwi.ServerName != nil { - objectMap["serverName"] = avwsiwi.ServerName - } - if avwsiwi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwsiwi.IsAutoProtectable - } - if avwsiwi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwsiwi.Subinquireditemcount - } - if avwsiwi.SubWorkloadItemCount != nil { - objectMap["subWorkloadItemCount"] = avwsiwi.SubWorkloadItemCount - } - if avwsiwi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwsiwi.BackupManagementType - } - if avwsiwi.WorkloadType != nil { - objectMap["workloadType"] = avwsiwi.WorkloadType - } - if avwsiwi.FriendlyName != nil { - objectMap["friendlyName"] = avwsiwi.FriendlyName - } - if avwsiwi.ProtectionState != "" { - objectMap["protectionState"] = avwsiwi.ProtectionState - } - if avwsiwi.WorkloadItemType != "" { - objectMap["workloadItemType"] = avwsiwi.WorkloadItemType - } - return json.Marshal(objectMap) -} - -// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. -func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. -func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { - return &avwsiwi, true -} - -// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. -func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. -func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. -func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. -func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. -func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. -func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { - return &avwsiwi, true -} - -// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. -func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { - return nil, false -} - -// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. -func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { - return &avwsiwi, true -} - -// AzureWorkloadBackupRequest azureWorkload workload-specific backup request. -type AzureWorkloadBackupRequest struct { - // BackupType - Type of backup, viz. Full, Differential, Log or CopyOnlyFull. Possible values include: 'TypeInvalid', 'TypeFull', 'TypeDifferential', 'TypeLog', 'TypeCopyOnlyFull' - BackupType Type `json:"backupType,omitempty"` - // EnableCompression - Bool for Compression setting - EnableCompression *bool `json:"enableCompression,omitempty"` - // RecoveryPointExpiryTimeInUTC - Backup copy will expire after the time specified (UTC). - RecoveryPointExpiryTimeInUTC *date.Time `json:"recoveryPointExpiryTimeInUTC,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeBackupRequest', 'ObjectTypeAzureFileShareBackupRequest', 'ObjectTypeAzureWorkloadBackupRequest', 'ObjectTypeIaasVMBackupRequest' - ObjectType ObjectType `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureWorkloadBackupRequest. -func (awbr AzureWorkloadBackupRequest) MarshalJSON() ([]byte, error) { - awbr.ObjectType = ObjectTypeAzureWorkloadBackupRequest - objectMap := make(map[string]interface{}) - if awbr.BackupType != "" { - objectMap["backupType"] = awbr.BackupType - } - if awbr.EnableCompression != nil { - objectMap["enableCompression"] = awbr.EnableCompression - } - if awbr.RecoveryPointExpiryTimeInUTC != nil { - objectMap["recoveryPointExpiryTimeInUTC"] = awbr.RecoveryPointExpiryTimeInUTC - } - if awbr.ObjectType != "" { - objectMap["objectType"] = awbr.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareBackupRequest is the BasicRequest implementation for AzureWorkloadBackupRequest. -func (awbr AzureWorkloadBackupRequest) AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) { - return nil, false -} - -// AsAzureWorkloadBackupRequest is the BasicRequest implementation for AzureWorkloadBackupRequest. -func (awbr AzureWorkloadBackupRequest) AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) { - return &awbr, true -} - -// AsIaasVMBackupRequest is the BasicRequest implementation for AzureWorkloadBackupRequest. -func (awbr AzureWorkloadBackupRequest) AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) { - return nil, false -} - -// AsRequest is the BasicRequest implementation for AzureWorkloadBackupRequest. -func (awbr AzureWorkloadBackupRequest) AsRequest() (*Request, bool) { - return nil, false -} - -// AsBasicRequest is the BasicRequest implementation for AzureWorkloadBackupRequest. -func (awbr AzureWorkloadBackupRequest) AsBasicRequest() (BasicRequest, bool) { - return &awbr, true -} - -// BasicAzureWorkloadContainer container for the workloads running inside Azure Compute or Classic Compute. -type BasicAzureWorkloadContainer interface { - AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) - AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) - AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) -} - -// AzureWorkloadContainer container for the workloads running inside Azure Compute or Classic Compute. -type AzureWorkloadContainer struct { - // SourceResourceID - ARM ID of the virtual machine represented by this Azure Workload Container - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // LastUpdatedTime - Time stamp when this container was updated. - LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"` - // ExtendedInfo - Additional details of a workload container. - ExtendedInfo *AzureWorkloadContainerExtendedInfo `json:"extendedInfo,omitempty"` - // WorkloadType - Workload type for which registration was sent. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' - WorkloadType WorkloadType `json:"workloadType,omitempty"` - // OperationType - Re-Do Operation. Possible values include: 'OperationTypeInvalid', 'OperationTypeRegister', 'OperationTypeReregister' - OperationType OperationType `json:"operationType,omitempty"` - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` -} - -func unmarshalBasicAzureWorkloadContainer(body []byte) (BasicAzureWorkloadContainer, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["containerType"] { - case string(ContainerTypeSQLAGWorkLoadContainer1): - var aswcpc AzureSQLAGWorkloadContainerProtectionContainer - err := json.Unmarshal(body, &aswcpc) - return aswcpc, err - case string(ContainerTypeVMAppContainer1): - var avacpc AzureVMAppContainerProtectionContainer - err := json.Unmarshal(body, &avacpc) - return avacpc, err - default: - var awc AzureWorkloadContainer - err := json.Unmarshal(body, &awc) - return awc, err - } -} -func unmarshalBasicAzureWorkloadContainerArray(body []byte) ([]BasicAzureWorkloadContainer, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - awcArray := make([]BasicAzureWorkloadContainer, len(rawMessages)) - - for index, rawMessage := range rawMessages { - awc, err := unmarshalBasicAzureWorkloadContainer(*rawMessage) - if err != nil { - return nil, err - } - awcArray[index] = awc - } - return awcArray, nil -} - -// MarshalJSON is the custom marshaler for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) MarshalJSON() ([]byte, error) { - awc.ContainerType = ContainerTypeAzureWorkloadContainer - objectMap := make(map[string]interface{}) - if awc.SourceResourceID != nil { - objectMap["sourceResourceId"] = awc.SourceResourceID - } - if awc.LastUpdatedTime != nil { - objectMap["lastUpdatedTime"] = awc.LastUpdatedTime - } - if awc.ExtendedInfo != nil { - objectMap["extendedInfo"] = awc.ExtendedInfo - } - if awc.WorkloadType != "" { - objectMap["workloadType"] = awc.WorkloadType - } - if awc.OperationType != "" { - objectMap["operationType"] = awc.OperationType - } - if awc.FriendlyName != nil { - objectMap["friendlyName"] = awc.FriendlyName - } - if awc.BackupManagementType != "" { - objectMap["backupManagementType"] = awc.BackupManagementType - } - if awc.RegistrationStatus != nil { - objectMap["registrationStatus"] = awc.RegistrationStatus - } - if awc.HealthStatus != nil { - objectMap["healthStatus"] = awc.HealthStatus - } - if awc.ContainerType != "" { - objectMap["containerType"] = awc.ContainerType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { - return nil, false -} - -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return nil, false -} - -// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return nil, false -} - -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { - return &awc, true -} - -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return &awc, true -} - -// AsDpmContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsDpmContainer() (*DpmContainer, bool) { - return nil, false -} - -// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { - return nil, false -} - -// AsGenericContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsGenericContainer() (*GenericContainer, bool) { - return nil, false -} - -// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { - return nil, false -} - -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { - return nil, false -} - -// AsMabContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsMabContainer() (*MabContainer, bool) { - return nil, false -} - -// AsProtectionContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsProtectionContainer() (*ProtectionContainer, bool) { - return nil, false -} - -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &awc, true -} - -// AzureWorkloadContainerExtendedInfo extended information of the container. -type AzureWorkloadContainerExtendedInfo struct { - // HostServerName - Host Os Name in case of Stand Alone and Cluster Name in case of distributed container. - HostServerName *string `json:"hostServerName,omitempty"` - // InquiryInfo - Inquiry Status for the container. - InquiryInfo *InquiryInfo `json:"inquiryInfo,omitempty"` - // NodesList - List of the nodes in case of distributed container. - NodesList *[]DistributedNodesInfo `json:"nodesList,omitempty"` -} - -// BasicAzureWorkloadPointInTimeRecoveryPoint recovery point specific to PointInTime -type BasicAzureWorkloadPointInTimeRecoveryPoint interface { - AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) - AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) -} - -// AzureWorkloadPointInTimeRecoveryPoint recovery point specific to PointInTime -type AzureWorkloadPointInTimeRecoveryPoint struct { - // TimeRanges - List of log ranges - TimeRanges *[]PointInTimeRange `json:"timeRanges,omitempty"` - // RecoveryPointTimeInUTC - UTC time at which recovery point was created - RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` - // Type - Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' - Type RestorePointType `json:"type,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' - ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` -} - -func unmarshalBasicAzureWorkloadPointInTimeRecoveryPoint(body []byte) (BasicAzureWorkloadPointInTimeRecoveryPoint, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["objectType"] { - case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint): - var awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint - err := json.Unmarshal(body, &awshpitrp) - return awshpitrp, err - default: - var awpitrp AzureWorkloadPointInTimeRecoveryPoint - err := json.Unmarshal(body, &awpitrp) - return awpitrp, err - } -} -func unmarshalBasicAzureWorkloadPointInTimeRecoveryPointArray(body []byte) ([]BasicAzureWorkloadPointInTimeRecoveryPoint, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - awpitrpArray := make([]BasicAzureWorkloadPointInTimeRecoveryPoint, len(rawMessages)) - - for index, rawMessage := range rawMessages { - awpitrp, err := unmarshalBasicAzureWorkloadPointInTimeRecoveryPoint(*rawMessage) - if err != nil { - return nil, err - } - awpitrpArray[index] = awpitrp - } - return awpitrpArray, nil -} - -// MarshalJSON is the custom marshaler for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) MarshalJSON() ([]byte, error) { - awpitrp.ObjectType = ObjectTypeAzureWorkloadPointInTimeRecoveryPoint - objectMap := make(map[string]interface{}) - if awpitrp.TimeRanges != nil { - objectMap["timeRanges"] = awpitrp.TimeRanges - } - if awpitrp.RecoveryPointTimeInUTC != nil { - objectMap["recoveryPointTimeInUTC"] = awpitrp.RecoveryPointTimeInUTC - } - if awpitrp.Type != "" { - objectMap["type"] = awpitrp.Type - } - if awpitrp.ObjectType != "" { - objectMap["objectType"] = awpitrp.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { - return &awpitrp, true -} - -// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { - return &awpitrp, true -} - -// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { - return &awpitrp, true -} - -// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { - return nil, false -} - -// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { - return nil, false -} - -// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { - return nil, false -} - -// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { - return nil, false -} - -// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { - return &awpitrp, true -} - -// AzureWorkloadPointInTimeRestoreRequest azureWorkload SAP Hana -specific restore. Specifically for -// PointInTime/Log restore -type AzureWorkloadPointInTimeRestoreRequest struct { - // PointInTime - PointInTime value - PointInTime *date.Time `json:"pointInTime,omitempty"` - // RecoveryType - OLR/ALR, RestoreDisks is invalid option. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks' - RecoveryType RecoveryType `json:"recoveryType,omitempty"` - // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PropertyBag - Workload specific property bag. - PropertyBag map[string]*string `json:"propertyBag"` - // TargetInfo - Details of target database - TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' - ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) MarshalJSON() ([]byte, error) { - awpitrr.ObjectType = ObjectTypeAzureWorkloadPointInTimeRestoreRequest - objectMap := make(map[string]interface{}) - if awpitrr.PointInTime != nil { - objectMap["pointInTime"] = awpitrr.PointInTime - } - if awpitrr.RecoveryType != "" { - objectMap["recoveryType"] = awpitrr.RecoveryType - } - if awpitrr.SourceResourceID != nil { - objectMap["sourceResourceId"] = awpitrr.SourceResourceID - } - if awpitrr.PropertyBag != nil { - objectMap["propertyBag"] = awpitrr.PropertyBag - } - if awpitrr.TargetInfo != nil { - objectMap["targetInfo"] = awpitrr.TargetInfo - } - if awpitrr.ObjectType != "" { - objectMap["objectType"] = awpitrr.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { - return &awpitrr, true -} - -// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { - return &awpitrr, true -} - -// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { - return nil, false -} - -// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { - return nil, false -} - -// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { - return nil, false -} - -// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { - return &awpitrr, true -} - -// BasicAzureWorkloadRecoveryPoint workload specific recovery point, specifically encapsulates full/diff recovery point -type BasicAzureWorkloadRecoveryPoint interface { - AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) - AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) - AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) - AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) - AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) - AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) - AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) - AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) -} - -// AzureWorkloadRecoveryPoint workload specific recovery point, specifically encapsulates full/diff recovery -// point -type AzureWorkloadRecoveryPoint struct { - // RecoveryPointTimeInUTC - UTC time at which recovery point was created - RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` - // Type - Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' - Type RestorePointType `json:"type,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' - ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` -} - -func unmarshalBasicAzureWorkloadRecoveryPoint(body []byte) (BasicAzureWorkloadRecoveryPoint, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["objectType"] { - case string(ObjectTypeAzureWorkloadPointInTimeRecoveryPoint): - var awpitrp AzureWorkloadPointInTimeRecoveryPoint - err := json.Unmarshal(body, &awpitrp) - return awpitrp, err - case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint): - var awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint - err := json.Unmarshal(body, &awshpitrp) - return awshpitrp, err - case string(ObjectTypeAzureWorkloadSAPHanaRecoveryPoint): - var awshrp AzureWorkloadSAPHanaRecoveryPoint - err := json.Unmarshal(body, &awshrp) - return awshrp, err - case string(ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint): - var awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint - err := json.Unmarshal(body, &awspitrp) - return awspitrp, err - case string(ObjectTypeAzureWorkloadSQLRecoveryPoint): - var awsrp AzureWorkloadSQLRecoveryPoint - err := json.Unmarshal(body, &awsrp) - return awsrp, err - default: - var awrp AzureWorkloadRecoveryPoint - err := json.Unmarshal(body, &awrp) - return awrp, err - } -} -func unmarshalBasicAzureWorkloadRecoveryPointArray(body []byte) ([]BasicAzureWorkloadRecoveryPoint, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - awrpArray := make([]BasicAzureWorkloadRecoveryPoint, len(rawMessages)) - - for index, rawMessage := range rawMessages { - awrp, err := unmarshalBasicAzureWorkloadRecoveryPoint(*rawMessage) - if err != nil { - return nil, err - } - awrpArray[index] = awrp - } - return awrpArray, nil -} - -// MarshalJSON is the custom marshaler for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) MarshalJSON() ([]byte, error) { - awrp.ObjectType = ObjectTypeAzureWorkloadRecoveryPoint - objectMap := make(map[string]interface{}) - if awrp.RecoveryPointTimeInUTC != nil { - objectMap["recoveryPointTimeInUTC"] = awrp.RecoveryPointTimeInUTC - } - if awrp.Type != "" { - objectMap["type"] = awrp.Type - } - if awrp.ObjectType != "" { - objectMap["objectType"] = awrp.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { - return &awrp, true -} - -// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { - return &awrp, true -} - -// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { - return nil, false -} - -// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { - return nil, false -} - -// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { - return nil, false -} - -// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { - return nil, false -} - -// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { - return &awrp, true -} - -// BasicAzureWorkloadRestoreRequest azureWorkload-specific restore. -type BasicAzureWorkloadRestoreRequest interface { - AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) - AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) - AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) - AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) - AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) - AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) - AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) - AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) -} - -// AzureWorkloadRestoreRequest azureWorkload-specific restore. -type AzureWorkloadRestoreRequest struct { - // RecoveryType - OLR/ALR, RestoreDisks is invalid option. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks' - RecoveryType RecoveryType `json:"recoveryType,omitempty"` - // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PropertyBag - Workload specific property bag. - PropertyBag map[string]*string `json:"propertyBag"` - // TargetInfo - Details of target database - TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' - ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` -} - -func unmarshalBasicAzureWorkloadRestoreRequest(body []byte) (BasicAzureWorkloadRestoreRequest, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["objectType"] { - case string(ObjectTypeAzureWorkloadPointInTimeRestoreRequest): - var awpitrr AzureWorkloadPointInTimeRestoreRequest - err := json.Unmarshal(body, &awpitrr) - return awpitrr, err - case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest): - var awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest - err := json.Unmarshal(body, &awshpitrr) - return awshpitrr, err - case string(ObjectTypeAzureWorkloadSAPHanaRestoreRequest): - var awshrr AzureWorkloadSAPHanaRestoreRequest - err := json.Unmarshal(body, &awshrr) - return awshrr, err - case string(ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest): - var awspitrr AzureWorkloadSQLPointInTimeRestoreRequest - err := json.Unmarshal(body, &awspitrr) - return awspitrr, err - case string(ObjectTypeAzureWorkloadSQLRestoreRequest): - var awsrr AzureWorkloadSQLRestoreRequest - err := json.Unmarshal(body, &awsrr) - return awsrr, err - default: - var awrr AzureWorkloadRestoreRequest - err := json.Unmarshal(body, &awrr) - return awrr, err - } -} -func unmarshalBasicAzureWorkloadRestoreRequestArray(body []byte) ([]BasicAzureWorkloadRestoreRequest, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - awrrArray := make([]BasicAzureWorkloadRestoreRequest, len(rawMessages)) - - for index, rawMessage := range rawMessages { - awrr, err := unmarshalBasicAzureWorkloadRestoreRequest(*rawMessage) - if err != nil { - return nil, err - } - awrrArray[index] = awrr - } - return awrrArray, nil -} - -// MarshalJSON is the custom marshaler for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) MarshalJSON() ([]byte, error) { - awrr.ObjectType = ObjectTypeAzureWorkloadRestoreRequest - objectMap := make(map[string]interface{}) - if awrr.RecoveryType != "" { - objectMap["recoveryType"] = awrr.RecoveryType - } - if awrr.SourceResourceID != nil { - objectMap["sourceResourceId"] = awrr.SourceResourceID - } - if awrr.PropertyBag != nil { - objectMap["propertyBag"] = awrr.PropertyBag - } - if awrr.TargetInfo != nil { - objectMap["targetInfo"] = awrr.TargetInfo - } - if awrr.ObjectType != "" { - objectMap["objectType"] = awrr.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { - return &awrr, true -} - -// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { - return &awrr, true -} - -// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { - return nil, false -} - -// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { - return nil, false -} - -// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { - return nil, false -} - -// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { - return &awrr, true -} - -// AzureWorkloadSAPHanaPointInTimeRecoveryPoint recovery point specific to PointInTime in SAPHana -type AzureWorkloadSAPHanaPointInTimeRecoveryPoint struct { - // TimeRanges - List of log ranges - TimeRanges *[]PointInTimeRange `json:"timeRanges,omitempty"` - // RecoveryPointTimeInUTC - UTC time at which recovery point was created - RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` - // Type - Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' - Type RestorePointType `json:"type,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' - ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) MarshalJSON() ([]byte, error) { - awshpitrp.ObjectType = ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint - objectMap := make(map[string]interface{}) - if awshpitrp.TimeRanges != nil { - objectMap["timeRanges"] = awshpitrp.TimeRanges - } - if awshpitrp.RecoveryPointTimeInUTC != nil { - objectMap["recoveryPointTimeInUTC"] = awshpitrp.RecoveryPointTimeInUTC - } - if awshpitrp.Type != "" { - objectMap["type"] = awshpitrp.Type - } - if awshpitrp.ObjectType != "" { - objectMap["objectType"] = awshpitrp.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { - return &awshpitrp, true -} - -// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { - return &awshpitrp, true -} - -// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { - return &awshpitrp, true -} - -// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { - return nil, false -} - -// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { - return nil, false -} - -// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { - return nil, false -} - -// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { - return nil, false -} - -// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { - return &awshpitrp, true -} - -// AzureWorkloadSAPHanaPointInTimeRestoreRequest azureWorkload SAP Hana -specific restore. Specifically for -// PointInTime/Log restore -type AzureWorkloadSAPHanaPointInTimeRestoreRequest struct { - // PointInTime - PointInTime value - PointInTime *date.Time `json:"pointInTime,omitempty"` - // RecoveryType - OLR/ALR, RestoreDisks is invalid option. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks' - RecoveryType RecoveryType `json:"recoveryType,omitempty"` - // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PropertyBag - Workload specific property bag. - PropertyBag map[string]*string `json:"propertyBag"` - // TargetInfo - Details of target database - TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' - ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) MarshalJSON() ([]byte, error) { - awshpitrr.ObjectType = ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest - objectMap := make(map[string]interface{}) - if awshpitrr.PointInTime != nil { - objectMap["pointInTime"] = awshpitrr.PointInTime - } - if awshpitrr.RecoveryType != "" { - objectMap["recoveryType"] = awshpitrr.RecoveryType - } - if awshpitrr.SourceResourceID != nil { - objectMap["sourceResourceId"] = awshpitrr.SourceResourceID - } - if awshpitrr.PropertyBag != nil { - objectMap["propertyBag"] = awshpitrr.PropertyBag - } - if awshpitrr.TargetInfo != nil { - objectMap["targetInfo"] = awshpitrr.TargetInfo - } - if awshpitrr.ObjectType != "" { - objectMap["objectType"] = awshpitrr.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { - return &awshpitrr, true -} - -// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { - return &awshpitrr, true -} - -// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { - return &awshpitrr, true -} - -// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { - return nil, false -} - -// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { - return nil, false -} - -// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { - return nil, false -} - -// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { - return &awshpitrr, true -} - -// AzureWorkloadSAPHanaRecoveryPoint sAPHana specific recovery point, specifically encapsulates full/diff -// recovery points -type AzureWorkloadSAPHanaRecoveryPoint struct { - // RecoveryPointTimeInUTC - UTC time at which recovery point was created - RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` - // Type - Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' - Type RestorePointType `json:"type,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' - ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) MarshalJSON() ([]byte, error) { - awshrp.ObjectType = ObjectTypeAzureWorkloadSAPHanaRecoveryPoint - objectMap := make(map[string]interface{}) - if awshrp.RecoveryPointTimeInUTC != nil { - objectMap["recoveryPointTimeInUTC"] = awshrp.RecoveryPointTimeInUTC - } - if awshrp.Type != "" { - objectMap["type"] = awshrp.Type - } - if awshrp.ObjectType != "" { - objectMap["objectType"] = awshrp.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { - return &awshrp, true -} - -// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { - return &awshrp, true -} - -// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { - return nil, false -} - -// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { - return nil, false -} - -// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { - return nil, false -} - -// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { - return nil, false -} - -// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { - return &awshrp, true -} - -// BasicAzureWorkloadSAPHanaRestoreRequest azureWorkload SAP Hana-specific restore. -type BasicAzureWorkloadSAPHanaRestoreRequest interface { - AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) - AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) -} - -// AzureWorkloadSAPHanaRestoreRequest azureWorkload SAP Hana-specific restore. -type AzureWorkloadSAPHanaRestoreRequest struct { - // RecoveryType - OLR/ALR, RestoreDisks is invalid option. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks' - RecoveryType RecoveryType `json:"recoveryType,omitempty"` - // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PropertyBag - Workload specific property bag. - PropertyBag map[string]*string `json:"propertyBag"` - // TargetInfo - Details of target database - TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' - ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` -} - -func unmarshalBasicAzureWorkloadSAPHanaRestoreRequest(body []byte) (BasicAzureWorkloadSAPHanaRestoreRequest, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["objectType"] { - case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest): - var awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest - err := json.Unmarshal(body, &awshpitrr) - return awshpitrr, err - default: - var awshrr AzureWorkloadSAPHanaRestoreRequest - err := json.Unmarshal(body, &awshrr) - return awshrr, err - } -} -func unmarshalBasicAzureWorkloadSAPHanaRestoreRequestArray(body []byte) ([]BasicAzureWorkloadSAPHanaRestoreRequest, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - awshrrArray := make([]BasicAzureWorkloadSAPHanaRestoreRequest, len(rawMessages)) - - for index, rawMessage := range rawMessages { - awshrr, err := unmarshalBasicAzureWorkloadSAPHanaRestoreRequest(*rawMessage) - if err != nil { - return nil, err - } - awshrrArray[index] = awshrr - } - return awshrrArray, nil -} - -// MarshalJSON is the custom marshaler for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) MarshalJSON() ([]byte, error) { - awshrr.ObjectType = ObjectTypeAzureWorkloadSAPHanaRestoreRequest - objectMap := make(map[string]interface{}) - if awshrr.RecoveryType != "" { - objectMap["recoveryType"] = awshrr.RecoveryType - } - if awshrr.SourceResourceID != nil { - objectMap["sourceResourceId"] = awshrr.SourceResourceID - } - if awshrr.PropertyBag != nil { - objectMap["propertyBag"] = awshrr.PropertyBag - } - if awshrr.TargetInfo != nil { - objectMap["targetInfo"] = awshrr.TargetInfo - } - if awshrr.ObjectType != "" { - objectMap["objectType"] = awshrr.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { - return &awshrr, true -} - -// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { - return &awshrr, true -} - -// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { - return &awshrr, true -} - -// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { - return nil, false -} - -// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { - return nil, false -} - -// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { - return nil, false -} - -// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { - return &awshrr, true -} - -// AzureWorkloadSQLPointInTimeRecoveryPoint recovery point specific to PointInTime -type AzureWorkloadSQLPointInTimeRecoveryPoint struct { - // TimeRanges - List of log ranges - TimeRanges *[]PointInTimeRange `json:"timeRanges,omitempty"` - // ExtendedInfo - Extended Info that provides data directory details. Will be populated in two cases: - // When a specific recovery point is accessed using GetRecoveryPoint - // Or when ListRecoveryPoints is called for Log RP only with ExtendedInfo query filter - ExtendedInfo *AzureWorkloadSQLRecoveryPointExtendedInfo `json:"extendedInfo,omitempty"` - // RecoveryPointTimeInUTC - UTC time at which recovery point was created - RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` - // Type - Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' - Type RestorePointType `json:"type,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' - ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) MarshalJSON() ([]byte, error) { - awspitrp.ObjectType = ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint - objectMap := make(map[string]interface{}) - if awspitrp.TimeRanges != nil { - objectMap["timeRanges"] = awspitrp.TimeRanges - } - if awspitrp.ExtendedInfo != nil { - objectMap["extendedInfo"] = awspitrp.ExtendedInfo - } - if awspitrp.RecoveryPointTimeInUTC != nil { - objectMap["recoveryPointTimeInUTC"] = awspitrp.RecoveryPointTimeInUTC - } - if awspitrp.Type != "" { - objectMap["type"] = awspitrp.Type - } - if awspitrp.ObjectType != "" { - objectMap["objectType"] = awspitrp.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { - return &awspitrp, true -} - -// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { - return &awspitrp, true -} - -// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { - return &awspitrp, true -} - -// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { - return nil, false -} - -// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { - return nil, false -} - -// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { - return nil, false -} - -// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { - return &awspitrp, true -} - -// AzureWorkloadSQLPointInTimeRestoreRequest azureWorkload SQL -specific restore. Specifically for -// PointInTime/Log restore -type AzureWorkloadSQLPointInTimeRestoreRequest struct { - // PointInTime - PointInTime value - PointInTime *date.Time `json:"pointInTime,omitempty"` - // ShouldUseAlternateTargetLocation - Default option set to true. If this is set to false, alternate data directory must be provided - ShouldUseAlternateTargetLocation *bool `json:"shouldUseAlternateTargetLocation,omitempty"` - // IsNonRecoverable - SQL specific property where user can chose to set no-recovery when restore operation is tried - IsNonRecoverable *bool `json:"isNonRecoverable,omitempty"` - // AlternateDirectoryPaths - Data directory details - AlternateDirectoryPaths *[]SQLDataDirectoryMapping `json:"alternateDirectoryPaths,omitempty"` - // RecoveryType - OLR/ALR, RestoreDisks is invalid option. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks' - RecoveryType RecoveryType `json:"recoveryType,omitempty"` - // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PropertyBag - Workload specific property bag. - PropertyBag map[string]*string `json:"propertyBag"` - // TargetInfo - Details of target database - TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' - ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) MarshalJSON() ([]byte, error) { - awspitrr.ObjectType = ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest - objectMap := make(map[string]interface{}) - if awspitrr.PointInTime != nil { - objectMap["pointInTime"] = awspitrr.PointInTime - } - if awspitrr.ShouldUseAlternateTargetLocation != nil { - objectMap["shouldUseAlternateTargetLocation"] = awspitrr.ShouldUseAlternateTargetLocation - } - if awspitrr.IsNonRecoverable != nil { - objectMap["isNonRecoverable"] = awspitrr.IsNonRecoverable - } - if awspitrr.AlternateDirectoryPaths != nil { - objectMap["alternateDirectoryPaths"] = awspitrr.AlternateDirectoryPaths - } - if awspitrr.RecoveryType != "" { - objectMap["recoveryType"] = awspitrr.RecoveryType - } - if awspitrr.SourceResourceID != nil { - objectMap["sourceResourceId"] = awspitrr.SourceResourceID - } - if awspitrr.PropertyBag != nil { - objectMap["propertyBag"] = awspitrr.PropertyBag - } - if awspitrr.TargetInfo != nil { - objectMap["targetInfo"] = awspitrr.TargetInfo - } - if awspitrr.ObjectType != "" { - objectMap["objectType"] = awspitrr.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { - return &awspitrr, true -} - -// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { - return &awspitrr, true -} - -// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { - return &awspitrr, true -} - -// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { - return nil, false -} - -// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { - return nil, false -} - -// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { - return &awspitrr, true -} - -// BasicAzureWorkloadSQLRecoveryPoint SQL specific recovery point, specifically encapsulates full/diff recovery point -// along with extended info -type BasicAzureWorkloadSQLRecoveryPoint interface { - AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) - AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) -} - -// AzureWorkloadSQLRecoveryPoint SQL specific recovery point, specifically encapsulates full/diff recovery -// point along with extended info -type AzureWorkloadSQLRecoveryPoint struct { - // ExtendedInfo - Extended Info that provides data directory details. Will be populated in two cases: - // When a specific recovery point is accessed using GetRecoveryPoint - // Or when ListRecoveryPoints is called for Log RP only with ExtendedInfo query filter - ExtendedInfo *AzureWorkloadSQLRecoveryPointExtendedInfo `json:"extendedInfo,omitempty"` - // RecoveryPointTimeInUTC - UTC time at which recovery point was created - RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` - // Type - Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' - Type RestorePointType `json:"type,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' - ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` -} - -func unmarshalBasicAzureWorkloadSQLRecoveryPoint(body []byte) (BasicAzureWorkloadSQLRecoveryPoint, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["objectType"] { - case string(ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint): - var awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint - err := json.Unmarshal(body, &awspitrp) - return awspitrp, err - default: - var awsrp AzureWorkloadSQLRecoveryPoint - err := json.Unmarshal(body, &awsrp) - return awsrp, err - } -} -func unmarshalBasicAzureWorkloadSQLRecoveryPointArray(body []byte) ([]BasicAzureWorkloadSQLRecoveryPoint, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - awsrpArray := make([]BasicAzureWorkloadSQLRecoveryPoint, len(rawMessages)) - - for index, rawMessage := range rawMessages { - awsrp, err := unmarshalBasicAzureWorkloadSQLRecoveryPoint(*rawMessage) - if err != nil { - return nil, err - } - awsrpArray[index] = awsrp - } - return awsrpArray, nil -} - -// MarshalJSON is the custom marshaler for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) MarshalJSON() ([]byte, error) { - awsrp.ObjectType = ObjectTypeAzureWorkloadSQLRecoveryPoint - objectMap := make(map[string]interface{}) - if awsrp.ExtendedInfo != nil { - objectMap["extendedInfo"] = awsrp.ExtendedInfo - } - if awsrp.RecoveryPointTimeInUTC != nil { - objectMap["recoveryPointTimeInUTC"] = awsrp.RecoveryPointTimeInUTC - } - if awsrp.Type != "" { - objectMap["type"] = awsrp.Type - } - if awsrp.ObjectType != "" { - objectMap["objectType"] = awsrp.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { - return &awsrp, true -} - -// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { - return &awsrp, true -} - -// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { - return &awsrp, true -} - -// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { - return nil, false -} - -// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { - return nil, false -} - -// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { - return nil, false -} - -// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { - return &awsrp, true -} - -// AzureWorkloadSQLRecoveryPointExtendedInfo extended info class details -type AzureWorkloadSQLRecoveryPointExtendedInfo struct { - // DataDirectoryTimeInUTC - UTC time at which data directory info was captured - DataDirectoryTimeInUTC *date.Time `json:"dataDirectoryTimeInUTC,omitempty"` - // DataDirectoryPaths - List of data directory paths during restore operation. - DataDirectoryPaths *[]SQLDataDirectory `json:"dataDirectoryPaths,omitempty"` -} - -// BasicAzureWorkloadSQLRestoreRequest azureWorkload SQL -specific restore. Specifically for full/diff restore -type BasicAzureWorkloadSQLRestoreRequest interface { - AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) - AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) -} - -// AzureWorkloadSQLRestoreRequest azureWorkload SQL -specific restore. Specifically for full/diff restore -type AzureWorkloadSQLRestoreRequest struct { - // ShouldUseAlternateTargetLocation - Default option set to true. If this is set to false, alternate data directory must be provided - ShouldUseAlternateTargetLocation *bool `json:"shouldUseAlternateTargetLocation,omitempty"` - // IsNonRecoverable - SQL specific property where user can chose to set no-recovery when restore operation is tried - IsNonRecoverable *bool `json:"isNonRecoverable,omitempty"` - // AlternateDirectoryPaths - Data directory details - AlternateDirectoryPaths *[]SQLDataDirectoryMapping `json:"alternateDirectoryPaths,omitempty"` - // RecoveryType - OLR/ALR, RestoreDisks is invalid option. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks' - RecoveryType RecoveryType `json:"recoveryType,omitempty"` - // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PropertyBag - Workload specific property bag. - PropertyBag map[string]*string `json:"propertyBag"` - // TargetInfo - Details of target database - TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' - ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` -} - -func unmarshalBasicAzureWorkloadSQLRestoreRequest(body []byte) (BasicAzureWorkloadSQLRestoreRequest, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["objectType"] { - case string(ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest): - var awspitrr AzureWorkloadSQLPointInTimeRestoreRequest - err := json.Unmarshal(body, &awspitrr) - return awspitrr, err - default: - var awsrr AzureWorkloadSQLRestoreRequest - err := json.Unmarshal(body, &awsrr) - return awsrr, err - } -} -func unmarshalBasicAzureWorkloadSQLRestoreRequestArray(body []byte) ([]BasicAzureWorkloadSQLRestoreRequest, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - awsrrArray := make([]BasicAzureWorkloadSQLRestoreRequest, len(rawMessages)) - - for index, rawMessage := range rawMessages { - awsrr, err := unmarshalBasicAzureWorkloadSQLRestoreRequest(*rawMessage) - if err != nil { - return nil, err - } - awsrrArray[index] = awsrr - } - return awsrrArray, nil -} - -// MarshalJSON is the custom marshaler for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) MarshalJSON() ([]byte, error) { - awsrr.ObjectType = ObjectTypeAzureWorkloadSQLRestoreRequest - objectMap := make(map[string]interface{}) - if awsrr.ShouldUseAlternateTargetLocation != nil { - objectMap["shouldUseAlternateTargetLocation"] = awsrr.ShouldUseAlternateTargetLocation - } - if awsrr.IsNonRecoverable != nil { - objectMap["isNonRecoverable"] = awsrr.IsNonRecoverable - } - if awsrr.AlternateDirectoryPaths != nil { - objectMap["alternateDirectoryPaths"] = awsrr.AlternateDirectoryPaths - } - if awsrr.RecoveryType != "" { - objectMap["recoveryType"] = awsrr.RecoveryType - } - if awsrr.SourceResourceID != nil { - objectMap["sourceResourceId"] = awsrr.SourceResourceID - } - if awsrr.PropertyBag != nil { - objectMap["propertyBag"] = awsrr.PropertyBag - } - if awsrr.TargetInfo != nil { - objectMap["targetInfo"] = awsrr.TargetInfo - } - if awsrr.ObjectType != "" { - objectMap["objectType"] = awsrr.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { - return &awsrr, true -} - -// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { - return &awsrr, true -} - -// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { - return &awsrr, true -} - -// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { - return nil, false -} - -// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { - return nil, false -} - -// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { - return &awsrr, true -} - -// BEKDetails BEK is bitlocker encryption key. -type BEKDetails struct { - // SecretURL - Secret is BEK. - SecretURL *string `json:"secretUrl,omitempty"` - // SecretVaultID - ID of the Key Vault where this Secret is stored. - SecretVaultID *string `json:"secretVaultId,omitempty"` - // SecretData - BEK data. - SecretData *string `json:"secretData,omitempty"` -} - -// BMSBackupEngineQueryObject query parameters to fetch list of backup engines. -type BMSBackupEngineQueryObject struct { - // Expand - attribute to add extended info - Expand *string `json:"expand,omitempty"` -} - -// BMSBackupEnginesQueryObject query parameters to fetch list of backup engines. -type BMSBackupEnginesQueryObject struct { - // BackupManagementType - Backup management type for the backup engine. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // FriendlyName - Friendly name of the backup engine. - FriendlyName *string `json:"friendlyName,omitempty"` - // Expand - Attribute to add extended info. - Expand *string `json:"expand,omitempty"` -} - -// BMSContainerQueryObject the query filters that can be used with the list containers API. -type BMSContainerQueryObject struct { - // BackupManagementType - Backup management type for this container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // ContainerType - Type of container for filter. Possible values include: 'ContainerTypeInvalid', 'ContainerTypeUnknown', 'ContainerTypeIaasVMContainer', 'ContainerTypeIaasVMServiceContainer', 'ContainerTypeDPMContainer', 'ContainerTypeAzureBackupServerContainer', 'ContainerTypeMABContainer', 'ContainerTypeCluster', 'ContainerTypeAzureSQLContainer', 'ContainerTypeWindows', 'ContainerTypeVCenter', 'ContainerTypeVMAppContainer', 'ContainerTypeSQLAGWorkLoadContainer', 'ContainerTypeStorageContainer', 'ContainerTypeGenericContainer' - ContainerType ContainerType `json:"containerType,omitempty"` - // BackupEngineName - Backup engine name - BackupEngineName *string `json:"backupEngineName,omitempty"` - // FabricName - Fabric name for filter - FabricName *string `json:"fabricName,omitempty"` - // Status - Status of registration of this container with the Recovery Services Vault. - Status *string `json:"status,omitempty"` - // FriendlyName - Friendly name of this container. - FriendlyName *string `json:"friendlyName,omitempty"` -} - -// BMSContainersInquiryQueryObject the query filters that can be used with the inquire container API. -type BMSContainersInquiryQueryObject struct { - // BackupManagementType - Backup management type for this container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Workload type for this container. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' - WorkloadType WorkloadType `json:"workloadType,omitempty"` -} - -// BMSPOQueryObject filters to list items that can be backed up. -type BMSPOQueryObject struct { - // BackupManagementType - Backup management type. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Workload type. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' - WorkloadType WorkloadType `json:"workloadType,omitempty"` - // ContainerName - Full name of the container whose Protectable Objects should be returned. - ContainerName *string `json:"containerName,omitempty"` - // Status - Backup status query parameter. - Status *string `json:"status,omitempty"` - // FriendlyName - Friendly name. - FriendlyName *string `json:"friendlyName,omitempty"` -} - -// BMSRefreshContainersQueryObject the query filters that can be used with the refresh container API. -type BMSRefreshContainersQueryObject struct { - // BackupManagementType - Backup management type for this container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` -} - -// BMSRPQueryObject filters to list backup copies. -type BMSRPQueryObject struct { - // StartDate - Backup copies created after this time. - StartDate *date.Time `json:"startDate,omitempty"` - // EndDate - Backup copies created before this time. - EndDate *date.Time `json:"endDate,omitempty"` - // RestorePointQueryType - RestorePoint type. Possible values include: 'RestorePointQueryTypeInvalid', 'RestorePointQueryTypeFull', 'RestorePointQueryTypeLog', 'RestorePointQueryTypeDifferential', 'RestorePointQueryTypeFullAndDifferential', 'RestorePointQueryTypeAll' - RestorePointQueryType RestorePointQueryType `json:"restorePointQueryType,omitempty"` - // ExtendedInfo - In Get Recovery Point, it tells whether extended information about recovery point is asked. - ExtendedInfo *bool `json:"extendedInfo,omitempty"` -} - -// BMSWorkloadItemQueryObject filters to list items that can be backed up. -type BMSWorkloadItemQueryObject struct { - // BackupManagementType - Backup management type. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadItemType - Workload Item type. Possible values include: 'WorkloadItemTypeInvalid', 'WorkloadItemTypeSQLInstance', 'WorkloadItemTypeSQLDataBase', 'WorkloadItemTypeSAPHanaSystem', 'WorkloadItemTypeSAPHanaDatabase', 'WorkloadItemTypeSAPAseSystem', 'WorkloadItemTypeSAPAseDatabase' - WorkloadItemType WorkloadItemType `json:"workloadItemType,omitempty"` - // WorkloadType - Workload type. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' - WorkloadType WorkloadType `json:"workloadType,omitempty"` - // ProtectionStatus - Backup status query parameter. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionStatus ProtectionStatus `json:"protectionStatus,omitempty"` -} - -// ClientScriptForConnect client script details for file / folder restore. -type ClientScriptForConnect struct { - // ScriptContent - File content of the client script for file / folder restore. - ScriptContent *string `json:"scriptContent,omitempty"` - // ScriptExtension - File extension of the client script for file / folder restore - .ps1 , .sh , etc. - ScriptExtension *string `json:"scriptExtension,omitempty"` - // OsType - OS type - Windows, Linux etc. for which this file / folder restore client script works. - OsType *string `json:"osType,omitempty"` - // URL - URL of Executable from where to source the content. If this is not null then ScriptContent should not be used - URL *string `json:"url,omitempty"` - // ScriptNameSuffix - Mandatory suffix that should be added to the name of script that is given for download to user. - // If its null or empty then , ignore it. - ScriptNameSuffix *string `json:"scriptNameSuffix,omitempty"` -} - -// ContainerIdentityInfo container identity information -type ContainerIdentityInfo struct { - // UniqueName - Unique name of the container - UniqueName *string `json:"uniqueName,omitempty"` - // AadTenantID - Protection container identity - AAD Tenant - AadTenantID *string `json:"aadTenantId,omitempty"` - // ServicePrincipalClientID - Protection container identity - AAD Service Principal - ServicePrincipalClientID *string `json:"servicePrincipalClientId,omitempty"` - // Audience - Protection container identity - Audience - Audience *string `json:"audience,omitempty"` -} - -// DailyRetentionFormat daily retention format. -type DailyRetentionFormat struct { - // DaysOfTheMonth - List of days of the month. - DaysOfTheMonth *[]Day `json:"daysOfTheMonth,omitempty"` -} - -// DailyRetentionSchedule daily retention schedule. -type DailyRetentionSchedule struct { - // RetentionTimes - Retention times of retention policy. - RetentionTimes *[]date.Time `json:"retentionTimes,omitempty"` - // RetentionDuration - Retention duration of retention Policy. - RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` -} - -// Day day of the week. -type Day struct { - // Date - Date of the month - Date *int32 `json:"date,omitempty"` - // IsLast - Whether Date is last date of month - IsLast *bool `json:"isLast,omitempty"` -} - -// DistributedNodesInfo this is used to represent the various nodes of the distributed container. -type DistributedNodesInfo struct { - // NodeName - Name of the node under a distributed container. - NodeName *string `json:"nodeName,omitempty"` - // Status - Status of this Node. - // Failed | Succeeded - Status *string `json:"status,omitempty"` - // ErrorDetail - Error Details if the Status is non-success. - ErrorDetail *ErrorDetail `json:"errorDetail,omitempty"` -} - -// DpmBackupEngine data Protection Manager (DPM) specific backup engine. -type DpmBackupEngine struct { - // FriendlyName - Friendly name of the backup engine. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the backup engine. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Registration status of the backup engine with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // BackupEngineState - Status of the backup engine with the Recovery Services Vault. = {Active/Deleting/DeleteFailed} - BackupEngineState *string `json:"backupEngineState,omitempty"` - // HealthStatus - Backup status of the backup engine. - HealthStatus *string `json:"healthStatus,omitempty"` - // CanReRegister - Flag indicating if the backup engine be registered, once already registered. - CanReRegister *bool `json:"canReRegister,omitempty"` - // BackupEngineID - ID of the backup engine. - BackupEngineID *string `json:"backupEngineId,omitempty"` - // DpmVersion - Backup engine version - DpmVersion *string `json:"dpmVersion,omitempty"` - // AzureBackupAgentVersion - Backup agent version - AzureBackupAgentVersion *string `json:"azureBackupAgentVersion,omitempty"` - // IsAzureBackupAgentUpgradeAvailable - To check if backup agent upgrade available - IsAzureBackupAgentUpgradeAvailable *bool `json:"isAzureBackupAgentUpgradeAvailable,omitempty"` - // IsDpmUpgradeAvailable - To check if backup engine upgrade available - IsDpmUpgradeAvailable *bool `json:"isDpmUpgradeAvailable,omitempty"` - // ExtendedInfo - Extended info of the backup engine - ExtendedInfo *EngineExtendedInfo `json:"extendedInfo,omitempty"` - // BackupEngineType - Possible values include: 'BackupEngineTypeBackupEngineBase', 'BackupEngineTypeAzureBackupServerEngine', 'BackupEngineTypeDpmBackupEngine' - BackupEngineType EngineType `json:"backupEngineType,omitempty"` -} - -// MarshalJSON is the custom marshaler for DpmBackupEngine. -func (dbe DpmBackupEngine) MarshalJSON() ([]byte, error) { - dbe.BackupEngineType = BackupEngineTypeDpmBackupEngine - objectMap := make(map[string]interface{}) - if dbe.FriendlyName != nil { - objectMap["friendlyName"] = dbe.FriendlyName - } - if dbe.BackupManagementType != "" { - objectMap["backupManagementType"] = dbe.BackupManagementType - } - if dbe.RegistrationStatus != nil { - objectMap["registrationStatus"] = dbe.RegistrationStatus - } - if dbe.BackupEngineState != nil { - objectMap["backupEngineState"] = dbe.BackupEngineState - } - if dbe.HealthStatus != nil { - objectMap["healthStatus"] = dbe.HealthStatus - } - if dbe.CanReRegister != nil { - objectMap["canReRegister"] = dbe.CanReRegister - } - if dbe.BackupEngineID != nil { - objectMap["backupEngineId"] = dbe.BackupEngineID - } - if dbe.DpmVersion != nil { - objectMap["dpmVersion"] = dbe.DpmVersion - } - if dbe.AzureBackupAgentVersion != nil { - objectMap["azureBackupAgentVersion"] = dbe.AzureBackupAgentVersion - } - if dbe.IsAzureBackupAgentUpgradeAvailable != nil { - objectMap["isAzureBackupAgentUpgradeAvailable"] = dbe.IsAzureBackupAgentUpgradeAvailable - } - if dbe.IsDpmUpgradeAvailable != nil { - objectMap["isDpmUpgradeAvailable"] = dbe.IsDpmUpgradeAvailable - } - if dbe.ExtendedInfo != nil { - objectMap["extendedInfo"] = dbe.ExtendedInfo - } - if dbe.BackupEngineType != "" { - objectMap["backupEngineType"] = dbe.BackupEngineType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerEngine is the BasicEngineBase implementation for DpmBackupEngine. -func (dbe DpmBackupEngine) AsAzureBackupServerEngine() (*AzureBackupServerEngine, bool) { - return nil, false -} - -// AsDpmBackupEngine is the BasicEngineBase implementation for DpmBackupEngine. -func (dbe DpmBackupEngine) AsDpmBackupEngine() (*DpmBackupEngine, bool) { - return &dbe, true -} - -// AsEngineBase is the BasicEngineBase implementation for DpmBackupEngine. -func (dbe DpmBackupEngine) AsEngineBase() (*EngineBase, bool) { - return nil, false -} - -// AsBasicEngineBase is the BasicEngineBase implementation for DpmBackupEngine. -func (dbe DpmBackupEngine) AsBasicEngineBase() (BasicEngineBase, bool) { - return &dbe, true -} - -// BasicDpmContainer DPM workload-specific protection container. -type BasicDpmContainer interface { - AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) - AsDpmContainer() (*DpmContainer, bool) -} - -// DpmContainer DPM workload-specific protection container. -type DpmContainer struct { - // CanReRegister - Specifies whether the container is re-registrable. - CanReRegister *bool `json:"canReRegister,omitempty"` - // ContainerID - ID of container. - ContainerID *string `json:"containerId,omitempty"` - // ProtectedItemCount - Number of protected items in the BackupEngine - ProtectedItemCount *int64 `json:"protectedItemCount,omitempty"` - // DpmAgentVersion - Backup engine Agent version - DpmAgentVersion *string `json:"dpmAgentVersion,omitempty"` - // DpmServers - List of BackupEngines protecting the container - DpmServers *[]string `json:"dpmServers,omitempty"` - // UpgradeAvailable - To check if upgrade available - UpgradeAvailable *bool `json:"upgradeAvailable,omitempty"` - // ProtectionStatus - Protection status of the container. - ProtectionStatus *string `json:"protectionStatus,omitempty"` - // ExtendedInfo - Extended Info of the container. - ExtendedInfo *DPMContainerExtendedInfo `json:"extendedInfo,omitempty"` - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` -} - -func unmarshalBasicDpmContainer(body []byte) (BasicDpmContainer, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["containerType"] { - case string(ContainerTypeAzureBackupServerContainer1): - var absc AzureBackupServerContainer - err := json.Unmarshal(body, &absc) - return absc, err - default: - var dc DpmContainer - err := json.Unmarshal(body, &dc) - return dc, err - } -} -func unmarshalBasicDpmContainerArray(body []byte) ([]BasicDpmContainer, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - dcArray := make([]BasicDpmContainer, len(rawMessages)) - - for index, rawMessage := range rawMessages { - dc, err := unmarshalBasicDpmContainer(*rawMessage) - if err != nil { - return nil, err - } - dcArray[index] = dc - } - return dcArray, nil -} - -// MarshalJSON is the custom marshaler for DpmContainer. -func (dc DpmContainer) MarshalJSON() ([]byte, error) { - dc.ContainerType = ContainerTypeDPMContainer1 - objectMap := make(map[string]interface{}) - if dc.CanReRegister != nil { - objectMap["canReRegister"] = dc.CanReRegister - } - if dc.ContainerID != nil { - objectMap["containerId"] = dc.ContainerID - } - if dc.ProtectedItemCount != nil { - objectMap["protectedItemCount"] = dc.ProtectedItemCount - } - if dc.DpmAgentVersion != nil { - objectMap["dpmAgentVersion"] = dc.DpmAgentVersion - } - if dc.DpmServers != nil { - objectMap["dpmServers"] = dc.DpmServers - } - if dc.UpgradeAvailable != nil { - objectMap["upgradeAvailable"] = dc.UpgradeAvailable - } - if dc.ProtectionStatus != nil { - objectMap["protectionStatus"] = dc.ProtectionStatus - } - if dc.ExtendedInfo != nil { - objectMap["extendedInfo"] = dc.ExtendedInfo - } - if dc.FriendlyName != nil { - objectMap["friendlyName"] = dc.FriendlyName - } - if dc.BackupManagementType != "" { - objectMap["backupManagementType"] = dc.BackupManagementType - } - if dc.RegistrationStatus != nil { - objectMap["registrationStatus"] = dc.RegistrationStatus - } - if dc.HealthStatus != nil { - objectMap["healthStatus"] = dc.HealthStatus - } - if dc.ContainerType != "" { - objectMap["containerType"] = dc.ContainerType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { - return nil, false -} - -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureSQLContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return nil, false -} - -// AsAzureStorageContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return nil, false -} - -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { - return nil, false -} - -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return nil, false -} - -// AsDpmContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsDpmContainer() (*DpmContainer, bool) { - return &dc, true -} - -// AsBasicDpmContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { - return &dc, true -} - -// AsGenericContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsGenericContainer() (*GenericContainer, bool) { - return nil, false -} - -// AsIaaSVMContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { - return nil, false -} - -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { - return nil, false -} - -// AsMabContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsMabContainer() (*MabContainer, bool) { - return nil, false -} - -// AsProtectionContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsProtectionContainer() (*ProtectionContainer, bool) { - return nil, false -} - -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &dc, true -} - -// DPMContainerExtendedInfo additional information of the DPMContainer. -type DPMContainerExtendedInfo struct { - // LastRefreshedAt - Last refresh time of the DPMContainer. - LastRefreshedAt *date.Time `json:"lastRefreshedAt,omitempty"` -} - -// DPMProtectedItem additional information on Backup engine specific backup item. -type DPMProtectedItem struct { - // FriendlyName - Friendly name of the managed item - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupEngineName - Backup Management server protecting this backup item - BackupEngineName *string `json:"backupEngineName,omitempty"` - // ProtectionState - Protection state of the backup engine. Possible values include: 'ProtectedItemStateInvalid', 'ProtectedItemStateIRPending', 'ProtectedItemStateProtected', 'ProtectedItemStateProtectionError', 'ProtectedItemStateProtectionStopped', 'ProtectedItemStateProtectionPaused' - ProtectionState ProtectedItemState `json:"protectionState,omitempty"` - // ExtendedInfo - Extended info of the backup item. - ExtendedInfo *DPMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - WorkloadType DataSourceType `json:"workloadType,omitempty"` - // ContainerName - Unique name of container - ContainerName *string `json:"containerName,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. - LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` - // BackupSetName - Name of the backup set the backup item belongs to - BackupSetName *string `json:"backupSetName,omitempty"` - // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' - CreateMode CreateMode `json:"createMode,omitempty"` - // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC - DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` - // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state - IsRehydrate *bool `json:"isRehydrate,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' - ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for DPMProtectedItem. -func (dpi DPMProtectedItem) MarshalJSON() ([]byte, error) { - dpi.ProtectedItemType = ProtectedItemTypeDPMProtectedItem - objectMap := make(map[string]interface{}) - if dpi.FriendlyName != nil { - objectMap["friendlyName"] = dpi.FriendlyName - } - if dpi.BackupEngineName != nil { - objectMap["backupEngineName"] = dpi.BackupEngineName - } - if dpi.ProtectionState != "" { - objectMap["protectionState"] = dpi.ProtectionState - } - if dpi.ExtendedInfo != nil { - objectMap["extendedInfo"] = dpi.ExtendedInfo - } - if dpi.BackupManagementType != "" { - objectMap["backupManagementType"] = dpi.BackupManagementType - } - if dpi.WorkloadType != "" { - objectMap["workloadType"] = dpi.WorkloadType - } - if dpi.ContainerName != nil { - objectMap["containerName"] = dpi.ContainerName - } - if dpi.SourceResourceID != nil { - objectMap["sourceResourceId"] = dpi.SourceResourceID - } - if dpi.PolicyID != nil { - objectMap["policyId"] = dpi.PolicyID - } - if dpi.LastRecoveryPoint != nil { - objectMap["lastRecoveryPoint"] = dpi.LastRecoveryPoint - } - if dpi.BackupSetName != nil { - objectMap["backupSetName"] = dpi.BackupSetName - } - if dpi.CreateMode != "" { - objectMap["createMode"] = dpi.CreateMode - } - if dpi.DeferredDeleteTimeInUTC != nil { - objectMap["deferredDeleteTimeInUTC"] = dpi.DeferredDeleteTimeInUTC - } - if dpi.IsScheduledForDeferredDelete != nil { - objectMap["isScheduledForDeferredDelete"] = dpi.IsScheduledForDeferredDelete - } - if dpi.DeferredDeleteTimeRemaining != nil { - objectMap["deferredDeleteTimeRemaining"] = dpi.DeferredDeleteTimeRemaining - } - if dpi.IsDeferredDeleteScheduleUpcoming != nil { - objectMap["isDeferredDeleteScheduleUpcoming"] = dpi.IsDeferredDeleteScheduleUpcoming - } - if dpi.IsRehydrate != nil { - objectMap["isRehydrate"] = dpi.IsRehydrate - } - if dpi.ProtectedItemType != "" { - objectMap["protectedItemType"] = dpi.ProtectedItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { - return nil, false -} - -// AsDPMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { - return &dpi, true -} - -// AsGenericProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { - return nil, false -} - -// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { - return nil, false -} - -// AsProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { - return nil, false -} - -// AsBasicProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { - return &dpi, true -} - -// DPMProtectedItemExtendedInfo additional information of DPM Protected item. -type DPMProtectedItemExtendedInfo struct { - // ProtectableObjectLoadPath - Attribute to provide information on various DBs. - ProtectableObjectLoadPath map[string]*string `json:"protectableObjectLoadPath"` - // Protected - To check if backup item is disk protected. - Protected *bool `json:"protected,omitempty"` - // IsPresentOnCloud - To check if backup item is cloud protected. - IsPresentOnCloud *bool `json:"isPresentOnCloud,omitempty"` - // LastBackupStatus - Last backup status information on backup item. - LastBackupStatus *string `json:"lastBackupStatus,omitempty"` - // LastRefreshedAt - Last refresh time on backup item. - LastRefreshedAt *date.Time `json:"lastRefreshedAt,omitempty"` - // OldestRecoveryPoint - Oldest cloud recovery point time. - OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"` - // RecoveryPointCount - cloud recovery point count. - RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"` - // OnPremiseOldestRecoveryPoint - Oldest disk recovery point time. - OnPremiseOldestRecoveryPoint *date.Time `json:"onPremiseOldestRecoveryPoint,omitempty"` - // OnPremiseLatestRecoveryPoint - latest disk recovery point time. - OnPremiseLatestRecoveryPoint *date.Time `json:"onPremiseLatestRecoveryPoint,omitempty"` - // OnPremiseRecoveryPointCount - disk recovery point count. - OnPremiseRecoveryPointCount *int32 `json:"onPremiseRecoveryPointCount,omitempty"` - // IsCollocated - To check if backup item is collocated. - IsCollocated *bool `json:"isCollocated,omitempty"` - // ProtectionGroupName - Protection group name of the backup item. - ProtectionGroupName *string `json:"protectionGroupName,omitempty"` - // DiskStorageUsedInBytes - Used Disk storage in bytes. - DiskStorageUsedInBytes *string `json:"diskStorageUsedInBytes,omitempty"` - // TotalDiskStorageSizeInBytes - total Disk storage in bytes. - TotalDiskStorageSizeInBytes *string `json:"totalDiskStorageSizeInBytes,omitempty"` -} - -// MarshalJSON is the custom marshaler for DPMProtectedItemExtendedInfo. -func (dpiei DPMProtectedItemExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dpiei.ProtectableObjectLoadPath != nil { - objectMap["protectableObjectLoadPath"] = dpiei.ProtectableObjectLoadPath - } - if dpiei.Protected != nil { - objectMap["protected"] = dpiei.Protected - } - if dpiei.IsPresentOnCloud != nil { - objectMap["isPresentOnCloud"] = dpiei.IsPresentOnCloud - } - if dpiei.LastBackupStatus != nil { - objectMap["lastBackupStatus"] = dpiei.LastBackupStatus - } - if dpiei.LastRefreshedAt != nil { - objectMap["lastRefreshedAt"] = dpiei.LastRefreshedAt - } - if dpiei.OldestRecoveryPoint != nil { - objectMap["oldestRecoveryPoint"] = dpiei.OldestRecoveryPoint - } - if dpiei.RecoveryPointCount != nil { - objectMap["recoveryPointCount"] = dpiei.RecoveryPointCount - } - if dpiei.OnPremiseOldestRecoveryPoint != nil { - objectMap["onPremiseOldestRecoveryPoint"] = dpiei.OnPremiseOldestRecoveryPoint - } - if dpiei.OnPremiseLatestRecoveryPoint != nil { - objectMap["onPremiseLatestRecoveryPoint"] = dpiei.OnPremiseLatestRecoveryPoint - } - if dpiei.OnPremiseRecoveryPointCount != nil { - objectMap["onPremiseRecoveryPointCount"] = dpiei.OnPremiseRecoveryPointCount - } - if dpiei.IsCollocated != nil { - objectMap["isCollocated"] = dpiei.IsCollocated - } - if dpiei.ProtectionGroupName != nil { - objectMap["protectionGroupName"] = dpiei.ProtectionGroupName - } - if dpiei.DiskStorageUsedInBytes != nil { - objectMap["diskStorageUsedInBytes"] = dpiei.DiskStorageUsedInBytes - } - if dpiei.TotalDiskStorageSizeInBytes != nil { - objectMap["totalDiskStorageSizeInBytes"] = dpiei.TotalDiskStorageSizeInBytes - } - return json.Marshal(objectMap) -} - -// EncryptionDetails details needed if the VM was encrypted at the time of backup. -type EncryptionDetails struct { - // EncryptionEnabled - Identifies whether this backup copy represents an encrypted VM at the time of backup. - EncryptionEnabled *bool `json:"encryptionEnabled,omitempty"` - // KekURL - Key Url. - KekURL *string `json:"kekUrl,omitempty"` - // SecretKeyURL - Secret Url. - SecretKeyURL *string `json:"secretKeyUrl,omitempty"` - // KekVaultID - ID of Key Vault where KEK is stored. - KekVaultID *string `json:"kekVaultId,omitempty"` - // SecretKeyVaultID - ID of Key Vault where Secret is stored. - SecretKeyVaultID *string `json:"secretKeyVaultId,omitempty"` -} - -// BasicEngineBase the base backup engine class. All workload specific backup engines derive from this class. -type BasicEngineBase interface { - AsAzureBackupServerEngine() (*AzureBackupServerEngine, bool) - AsDpmBackupEngine() (*DpmBackupEngine, bool) - AsEngineBase() (*EngineBase, bool) -} - -// EngineBase the base backup engine class. All workload specific backup engines derive from this class. -type EngineBase struct { - // FriendlyName - Friendly name of the backup engine. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the backup engine. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Registration status of the backup engine with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // BackupEngineState - Status of the backup engine with the Recovery Services Vault. = {Active/Deleting/DeleteFailed} - BackupEngineState *string `json:"backupEngineState,omitempty"` - // HealthStatus - Backup status of the backup engine. - HealthStatus *string `json:"healthStatus,omitempty"` - // CanReRegister - Flag indicating if the backup engine be registered, once already registered. - CanReRegister *bool `json:"canReRegister,omitempty"` - // BackupEngineID - ID of the backup engine. - BackupEngineID *string `json:"backupEngineId,omitempty"` - // DpmVersion - Backup engine version - DpmVersion *string `json:"dpmVersion,omitempty"` - // AzureBackupAgentVersion - Backup agent version - AzureBackupAgentVersion *string `json:"azureBackupAgentVersion,omitempty"` - // IsAzureBackupAgentUpgradeAvailable - To check if backup agent upgrade available - IsAzureBackupAgentUpgradeAvailable *bool `json:"isAzureBackupAgentUpgradeAvailable,omitempty"` - // IsDpmUpgradeAvailable - To check if backup engine upgrade available - IsDpmUpgradeAvailable *bool `json:"isDpmUpgradeAvailable,omitempty"` - // ExtendedInfo - Extended info of the backup engine - ExtendedInfo *EngineExtendedInfo `json:"extendedInfo,omitempty"` - // BackupEngineType - Possible values include: 'BackupEngineTypeBackupEngineBase', 'BackupEngineTypeAzureBackupServerEngine', 'BackupEngineTypeDpmBackupEngine' - BackupEngineType EngineType `json:"backupEngineType,omitempty"` -} - -func unmarshalBasicEngineBase(body []byte) (BasicEngineBase, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["backupEngineType"] { - case string(BackupEngineTypeAzureBackupServerEngine): - var abse AzureBackupServerEngine - err := json.Unmarshal(body, &abse) - return abse, err - case string(BackupEngineTypeDpmBackupEngine): - var dbe DpmBackupEngine - err := json.Unmarshal(body, &dbe) - return dbe, err - default: - var eb EngineBase - err := json.Unmarshal(body, &eb) - return eb, err - } -} -func unmarshalBasicEngineBaseArray(body []byte) ([]BasicEngineBase, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - ebArray := make([]BasicEngineBase, len(rawMessages)) - - for index, rawMessage := range rawMessages { - eb, err := unmarshalBasicEngineBase(*rawMessage) - if err != nil { - return nil, err - } - ebArray[index] = eb - } - return ebArray, nil -} - -// MarshalJSON is the custom marshaler for EngineBase. -func (eb EngineBase) MarshalJSON() ([]byte, error) { - eb.BackupEngineType = BackupEngineTypeBackupEngineBase - objectMap := make(map[string]interface{}) - if eb.FriendlyName != nil { - objectMap["friendlyName"] = eb.FriendlyName - } - if eb.BackupManagementType != "" { - objectMap["backupManagementType"] = eb.BackupManagementType - } - if eb.RegistrationStatus != nil { - objectMap["registrationStatus"] = eb.RegistrationStatus - } - if eb.BackupEngineState != nil { - objectMap["backupEngineState"] = eb.BackupEngineState - } - if eb.HealthStatus != nil { - objectMap["healthStatus"] = eb.HealthStatus - } - if eb.CanReRegister != nil { - objectMap["canReRegister"] = eb.CanReRegister - } - if eb.BackupEngineID != nil { - objectMap["backupEngineId"] = eb.BackupEngineID - } - if eb.DpmVersion != nil { - objectMap["dpmVersion"] = eb.DpmVersion - } - if eb.AzureBackupAgentVersion != nil { - objectMap["azureBackupAgentVersion"] = eb.AzureBackupAgentVersion - } - if eb.IsAzureBackupAgentUpgradeAvailable != nil { - objectMap["isAzureBackupAgentUpgradeAvailable"] = eb.IsAzureBackupAgentUpgradeAvailable - } - if eb.IsDpmUpgradeAvailable != nil { - objectMap["isDpmUpgradeAvailable"] = eb.IsDpmUpgradeAvailable - } - if eb.ExtendedInfo != nil { - objectMap["extendedInfo"] = eb.ExtendedInfo - } - if eb.BackupEngineType != "" { - objectMap["backupEngineType"] = eb.BackupEngineType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerEngine is the BasicEngineBase implementation for EngineBase. -func (eb EngineBase) AsAzureBackupServerEngine() (*AzureBackupServerEngine, bool) { - return nil, false -} - -// AsDpmBackupEngine is the BasicEngineBase implementation for EngineBase. -func (eb EngineBase) AsDpmBackupEngine() (*DpmBackupEngine, bool) { - return nil, false -} - -// AsEngineBase is the BasicEngineBase implementation for EngineBase. -func (eb EngineBase) AsEngineBase() (*EngineBase, bool) { - return &eb, true -} - -// AsBasicEngineBase is the BasicEngineBase implementation for EngineBase. -func (eb EngineBase) AsBasicEngineBase() (BasicEngineBase, bool) { - return &eb, true -} - -// EngineBaseResource the base backup engine class. All workload specific backup engines derive from this -// class. -type EngineBaseResource struct { - autorest.Response `json:"-"` - // Properties - BackupEngineBaseResource properties - Properties BasicEngineBase `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for EngineBaseResource. -func (ebr EngineBaseResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = ebr.Properties - if ebr.Location != nil { - objectMap["location"] = ebr.Location - } - if ebr.Tags != nil { - objectMap["tags"] = ebr.Tags - } - if ebr.ETag != nil { - objectMap["eTag"] = ebr.ETag - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for EngineBaseResource struct. -func (ebr *EngineBaseResource) UnmarshalJSON(body []byte) error { - var m map[string]*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 := unmarshalBasicEngineBase(*v) - if err != nil { - return err - } - ebr.Properties = properties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ebr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ebr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ebr.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - ebr.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - ebr.Tags = tags - } - case "eTag": - if v != nil { - var eTag string - err = json.Unmarshal(*v, &eTag) - if err != nil { - return err - } - ebr.ETag = &eTag - } - } - } - - return nil -} - -// EngineBaseResourceList list of BackupEngineBase resources -type EngineBaseResourceList struct { - autorest.Response `json:"-"` - // Value - List of resources. - Value *[]EngineBaseResource `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. - NextLink *string `json:"nextLink,omitempty"` -} - -// EngineBaseResourceListIterator provides access to a complete listing of EngineBaseResource values. -type EngineBaseResourceListIterator struct { - i int - page EngineBaseResourceListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *EngineBaseResourceListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/EngineBaseResourceListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *EngineBaseResourceListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter EngineBaseResourceListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter EngineBaseResourceListIterator) Response() EngineBaseResourceList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter EngineBaseResourceListIterator) Value() EngineBaseResource { - if !iter.page.NotDone() { - return EngineBaseResource{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the EngineBaseResourceListIterator type. -func NewEngineBaseResourceListIterator(page EngineBaseResourceListPage) EngineBaseResourceListIterator { - return EngineBaseResourceListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (ebrl EngineBaseResourceList) IsEmpty() bool { - return ebrl.Value == nil || len(*ebrl.Value) == 0 -} - -// engineBaseResourceListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ebrl EngineBaseResourceList) engineBaseResourceListPreparer(ctx context.Context) (*http.Request, error) { - if ebrl.NextLink == nil || len(to.String(ebrl.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ebrl.NextLink))) -} - -// EngineBaseResourceListPage contains a page of EngineBaseResource values. -type EngineBaseResourceListPage struct { - fn func(context.Context, EngineBaseResourceList) (EngineBaseResourceList, error) - ebrl EngineBaseResourceList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *EngineBaseResourceListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/EngineBaseResourceListPage.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.ebrl) - if err != nil { - return err - } - page.ebrl = 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 *EngineBaseResourceListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page EngineBaseResourceListPage) NotDone() bool { - return !page.ebrl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page EngineBaseResourceListPage) Response() EngineBaseResourceList { - return page.ebrl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page EngineBaseResourceListPage) Values() []EngineBaseResource { - if page.ebrl.IsEmpty() { - return nil - } - return *page.ebrl.Value -} - -// Creates a new instance of the EngineBaseResourceListPage type. -func NewEngineBaseResourceListPage(getNextPage func(context.Context, EngineBaseResourceList) (EngineBaseResourceList, error)) EngineBaseResourceListPage { - return EngineBaseResourceListPage{fn: getNextPage} -} - -// EngineExtendedInfo additional information on backup engine. -type EngineExtendedInfo struct { - // DatabaseName - Database name of backup engine. - DatabaseName *string `json:"databaseName,omitempty"` - // ProtectedItemsCount - Number of protected items in the backup engine. - ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` - // ProtectedServersCount - Number of protected servers in the backup engine. - ProtectedServersCount *int32 `json:"protectedServersCount,omitempty"` - // DiskCount - Number of disks in the backup engine. - DiskCount *int32 `json:"diskCount,omitempty"` - // UsedDiskSpace - Disk space used in the backup engine. - UsedDiskSpace *float64 `json:"usedDiskSpace,omitempty"` - // AvailableDiskSpace - Disk space currently available in the backup engine. - AvailableDiskSpace *float64 `json:"availableDiskSpace,omitempty"` - // RefreshedAt - Last refresh time in the backup engine. - RefreshedAt *date.Time `json:"refreshedAt,omitempty"` - // AzureProtectedInstances - Protected instances in the backup engine. - AzureProtectedInstances *int32 `json:"azureProtectedInstances,omitempty"` -} - -// ErrorDetail error Detail class which encapsulates Code, Message and Recommendations. -type ErrorDetail struct { - // Code - Error code. - Code *string `json:"code,omitempty"` - // Message - Error Message related to the Code. - Message *string `json:"message,omitempty"` - // Recommendations - List of recommendation strings. - Recommendations *[]string `json:"recommendations,omitempty"` -} - -// GenericContainer base class for generic container of backup items -type GenericContainer struct { - // FabricName - Name of the container's fabric - FabricName *string `json:"fabricName,omitempty"` - // ExtendedInformation - Extended information (not returned in List container API calls) - ExtendedInformation *GenericContainerExtendedInfo `json:"extendedInformation,omitempty"` - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` -} - -// MarshalJSON is the custom marshaler for GenericContainer. -func (gc GenericContainer) MarshalJSON() ([]byte, error) { - gc.ContainerType = ContainerTypeGenericContainer1 - objectMap := make(map[string]interface{}) - if gc.FabricName != nil { - objectMap["fabricName"] = gc.FabricName - } - if gc.ExtendedInformation != nil { - objectMap["extendedInformation"] = gc.ExtendedInformation - } - if gc.FriendlyName != nil { - objectMap["friendlyName"] = gc.FriendlyName - } - if gc.BackupManagementType != "" { - objectMap["backupManagementType"] = gc.BackupManagementType - } - if gc.RegistrationStatus != nil { - objectMap["registrationStatus"] = gc.RegistrationStatus - } - if gc.HealthStatus != nil { - objectMap["healthStatus"] = gc.HealthStatus - } - if gc.ContainerType != "" { - objectMap["containerType"] = gc.ContainerType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { - return nil, false -} - -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureSQLContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return nil, false -} - -// AsAzureStorageContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return nil, false -} - -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { - return nil, false -} - -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return nil, false -} - -// AsDpmContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsDpmContainer() (*DpmContainer, bool) { - return nil, false -} - -// AsBasicDpmContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { - return nil, false -} - -// AsGenericContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsGenericContainer() (*GenericContainer, bool) { - return &gc, true -} - -// AsIaaSVMContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { - return nil, false -} - -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { - return nil, false -} - -// AsMabContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsMabContainer() (*MabContainer, bool) { - return nil, false -} - -// AsProtectionContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsProtectionContainer() (*ProtectionContainer, bool) { - return nil, false -} - -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &gc, true -} - -// GenericContainerExtendedInfo container extended information -type GenericContainerExtendedInfo struct { - // RawCertData - Public key of container cert - RawCertData *string `json:"rawCertData,omitempty"` - // ContainerIdentityInfo - Container identity information - ContainerIdentityInfo *ContainerIdentityInfo `json:"containerIdentityInfo,omitempty"` - // ServiceEndpoints - Azure Backup Service Endpoints for the container - ServiceEndpoints map[string]*string `json:"serviceEndpoints"` -} - -// MarshalJSON is the custom marshaler for GenericContainerExtendedInfo. -func (gcei GenericContainerExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gcei.RawCertData != nil { - objectMap["rawCertData"] = gcei.RawCertData - } - if gcei.ContainerIdentityInfo != nil { - objectMap["containerIdentityInfo"] = gcei.ContainerIdentityInfo - } - if gcei.ServiceEndpoints != nil { - objectMap["serviceEndpoints"] = gcei.ServiceEndpoints - } - return json.Marshal(objectMap) -} - -// GenericProtectedItem base class for backup items. -type GenericProtectedItem struct { - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // PolicyState - Indicates consistency of policy object and policy applied to this backup item. - PolicyState *string `json:"policyState,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' - ProtectionState ProtectionState `json:"protectionState,omitempty"` - // ProtectedItemID - Data Plane Service ID of the protected item. - ProtectedItemID *int64 `json:"protectedItemId,omitempty"` - // SourceAssociations - Loosely coupled (type, value) associations (example - parent of a protected item) - SourceAssociations map[string]*string `json:"sourceAssociations"` - // FabricName - Name of this backup item's fabric. - FabricName *string `json:"fabricName,omitempty"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - WorkloadType DataSourceType `json:"workloadType,omitempty"` - // ContainerName - Unique name of container - ContainerName *string `json:"containerName,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. - LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` - // BackupSetName - Name of the backup set the backup item belongs to - BackupSetName *string `json:"backupSetName,omitempty"` - // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' - CreateMode CreateMode `json:"createMode,omitempty"` - // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC - DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` - // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state - IsRehydrate *bool `json:"isRehydrate,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' - ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for GenericProtectedItem. -func (gpi GenericProtectedItem) MarshalJSON() ([]byte, error) { - gpi.ProtectedItemType = ProtectedItemTypeGenericProtectedItem - objectMap := make(map[string]interface{}) - if gpi.FriendlyName != nil { - objectMap["friendlyName"] = gpi.FriendlyName - } - if gpi.PolicyState != nil { - objectMap["policyState"] = gpi.PolicyState - } - if gpi.ProtectionState != "" { - objectMap["protectionState"] = gpi.ProtectionState - } - if gpi.ProtectedItemID != nil { - objectMap["protectedItemId"] = gpi.ProtectedItemID - } - if gpi.SourceAssociations != nil { - objectMap["sourceAssociations"] = gpi.SourceAssociations - } - if gpi.FabricName != nil { - objectMap["fabricName"] = gpi.FabricName - } - if gpi.BackupManagementType != "" { - objectMap["backupManagementType"] = gpi.BackupManagementType - } - if gpi.WorkloadType != "" { - objectMap["workloadType"] = gpi.WorkloadType - } - if gpi.ContainerName != nil { - objectMap["containerName"] = gpi.ContainerName - } - if gpi.SourceResourceID != nil { - objectMap["sourceResourceId"] = gpi.SourceResourceID - } - if gpi.PolicyID != nil { - objectMap["policyId"] = gpi.PolicyID - } - if gpi.LastRecoveryPoint != nil { - objectMap["lastRecoveryPoint"] = gpi.LastRecoveryPoint - } - if gpi.BackupSetName != nil { - objectMap["backupSetName"] = gpi.BackupSetName - } - if gpi.CreateMode != "" { - objectMap["createMode"] = gpi.CreateMode - } - if gpi.DeferredDeleteTimeInUTC != nil { - objectMap["deferredDeleteTimeInUTC"] = gpi.DeferredDeleteTimeInUTC - } - if gpi.IsScheduledForDeferredDelete != nil { - objectMap["isScheduledForDeferredDelete"] = gpi.IsScheduledForDeferredDelete - } - if gpi.DeferredDeleteTimeRemaining != nil { - objectMap["deferredDeleteTimeRemaining"] = gpi.DeferredDeleteTimeRemaining - } - if gpi.IsDeferredDeleteScheduleUpcoming != nil { - objectMap["isDeferredDeleteScheduleUpcoming"] = gpi.IsDeferredDeleteScheduleUpcoming - } - if gpi.IsRehydrate != nil { - objectMap["isRehydrate"] = gpi.IsRehydrate - } - if gpi.ProtectedItemType != "" { - objectMap["protectedItemType"] = gpi.ProtectedItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { - return nil, false -} - -// AsDPMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { - return nil, false -} - -// AsGenericProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { - return &gpi, true -} - -// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { - return nil, false -} - -// AsProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { - return nil, false -} - -// AsBasicProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { - return &gpi, true -} - -// GenericProtectionPolicy azure VM (Mercury) workload-specific backup policy. -type GenericProtectionPolicy struct { - // SubProtectionPolicy - List of sub-protection policies which includes schedule and retention - SubProtectionPolicy *[]SubProtectionPolicy `json:"subProtectionPolicy,omitempty"` - // TimeZone - TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". - TimeZone *string `json:"timeZone,omitempty"` - // FabricName - Name of this policy's fabric. - FabricName *string `json:"fabricName,omitempty"` - // ProtectedItemsCount - Number of items associated with this policy. - ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` - // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' - BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` -} - -// MarshalJSON is the custom marshaler for GenericProtectionPolicy. -func (gpp GenericProtectionPolicy) MarshalJSON() ([]byte, error) { - gpp.BackupManagementType = BackupManagementTypeGenericProtectionPolicy - objectMap := make(map[string]interface{}) - if gpp.SubProtectionPolicy != nil { - objectMap["subProtectionPolicy"] = gpp.SubProtectionPolicy - } - if gpp.TimeZone != nil { - objectMap["timeZone"] = gpp.TimeZone - } - if gpp.FabricName != nil { - objectMap["fabricName"] = gpp.FabricName - } - if gpp.ProtectedItemsCount != nil { - objectMap["protectedItemsCount"] = gpp.ProtectedItemsCount - } - if gpp.BackupManagementType != "" { - objectMap["backupManagementType"] = gpp.BackupManagementType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. -func (gpp GenericProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { - return nil, false -} - -// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. -func (gpp GenericProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { - return nil, false -} - -// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. -func (gpp GenericProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. -func (gpp GenericProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { - return nil, false -} - -// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. -func (gpp GenericProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { - return &gpp, true -} - -// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. -func (gpp GenericProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { - return nil, false -} - -// AsProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. -func (gpp GenericProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { - return nil, false -} - -// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. -func (gpp GenericProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { - return &gpp, true -} - -// GenericRecoveryPoint generic backup copy. -type GenericRecoveryPoint struct { - // FriendlyName - Friendly name of the backup copy. - FriendlyName *string `json:"friendlyName,omitempty"` - // RecoveryPointType - Type of the backup copy. - RecoveryPointType *string `json:"recoveryPointType,omitempty"` - // RecoveryPointTime - Time at which this backup copy was created. - RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` - // RecoveryPointAdditionalInfo - Additional information associated with this backup copy. - RecoveryPointAdditionalInfo *string `json:"recoveryPointAdditionalInfo,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' - ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) MarshalJSON() ([]byte, error) { - grp.ObjectType = ObjectTypeGenericRecoveryPoint - objectMap := make(map[string]interface{}) - if grp.FriendlyName != nil { - objectMap["friendlyName"] = grp.FriendlyName - } - if grp.RecoveryPointType != nil { - objectMap["recoveryPointType"] = grp.RecoveryPointType - } - if grp.RecoveryPointTime != nil { - objectMap["recoveryPointTime"] = grp.RecoveryPointTime - } - if grp.RecoveryPointAdditionalInfo != nil { - objectMap["recoveryPointAdditionalInfo"] = grp.RecoveryPointAdditionalInfo - } - if grp.ObjectType != "" { - objectMap["objectType"] = grp.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { - return nil, false -} - -// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { - return &grp, true -} - -// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { - return nil, false -} - -// AsRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { - return nil, false -} - -// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { - return &grp, true -} - -// GetProtectedItemQueryObject filters to list backup items. -type GetProtectedItemQueryObject struct { - // Expand - Specifies if the additional information should be provided for this item. - Expand *string `json:"expand,omitempty"` -} - -// IaasVMBackupRequest iaaS VM workload-specific backup request. -type IaasVMBackupRequest struct { - // RecoveryPointExpiryTimeInUTC - Backup copy will expire after the time specified (UTC). - RecoveryPointExpiryTimeInUTC *date.Time `json:"recoveryPointExpiryTimeInUTC,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeBackupRequest', 'ObjectTypeAzureFileShareBackupRequest', 'ObjectTypeAzureWorkloadBackupRequest', 'ObjectTypeIaasVMBackupRequest' - ObjectType ObjectType `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for IaasVMBackupRequest. -func (ivbr IaasVMBackupRequest) MarshalJSON() ([]byte, error) { - ivbr.ObjectType = ObjectTypeIaasVMBackupRequest - objectMap := make(map[string]interface{}) - if ivbr.RecoveryPointExpiryTimeInUTC != nil { - objectMap["recoveryPointExpiryTimeInUTC"] = ivbr.RecoveryPointExpiryTimeInUTC - } - if ivbr.ObjectType != "" { - objectMap["objectType"] = ivbr.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareBackupRequest is the BasicRequest implementation for IaasVMBackupRequest. -func (ivbr IaasVMBackupRequest) AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) { - return nil, false -} - -// AsAzureWorkloadBackupRequest is the BasicRequest implementation for IaasVMBackupRequest. -func (ivbr IaasVMBackupRequest) AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) { - return nil, false -} - -// AsIaasVMBackupRequest is the BasicRequest implementation for IaasVMBackupRequest. -func (ivbr IaasVMBackupRequest) AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) { - return &ivbr, true -} - -// AsRequest is the BasicRequest implementation for IaasVMBackupRequest. -func (ivbr IaasVMBackupRequest) AsRequest() (*Request, bool) { - return nil, false -} - -// AsBasicRequest is the BasicRequest implementation for IaasVMBackupRequest. -func (ivbr IaasVMBackupRequest) AsBasicRequest() (BasicRequest, bool) { - return &ivbr, true -} - -// BasicIaaSVMContainer iaaS VM workload-specific container. -type BasicIaaSVMContainer interface { - AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) - AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) - AsIaaSVMContainer() (*IaaSVMContainer, bool) -} - -// IaaSVMContainer iaaS VM workload-specific container. -type IaaSVMContainer struct { - // VirtualMachineID - Fully qualified ARM url of the virtual machine represented by this Azure IaaS VM container. - VirtualMachineID *string `json:"virtualMachineId,omitempty"` - // VirtualMachineVersion - Specifies whether the container represents a Classic or an Azure Resource Manager VM. - VirtualMachineVersion *string `json:"virtualMachineVersion,omitempty"` - // ResourceGroup - Resource group name of Recovery Services Vault. - ResourceGroup *string `json:"resourceGroup,omitempty"` - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` -} - -func unmarshalBasicIaaSVMContainer(body []byte) (BasicIaaSVMContainer, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["containerType"] { - case string(ContainerTypeMicrosoftClassicComputevirtualMachines): - var aisccvc AzureIaaSClassicComputeVMContainer - err := json.Unmarshal(body, &aisccvc) - return aisccvc, err - case string(ContainerTypeMicrosoftComputevirtualMachines): - var aiscvc AzureIaaSComputeVMContainer - err := json.Unmarshal(body, &aiscvc) - return aiscvc, err - default: - var isc IaaSVMContainer - err := json.Unmarshal(body, &isc) - return isc, err - } -} -func unmarshalBasicIaaSVMContainerArray(body []byte) ([]BasicIaaSVMContainer, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - iscArray := make([]BasicIaaSVMContainer, len(rawMessages)) - - for index, rawMessage := range rawMessages { - isc, err := unmarshalBasicIaaSVMContainer(*rawMessage) - if err != nil { - return nil, err - } - iscArray[index] = isc - } - return iscArray, nil -} - -// MarshalJSON is the custom marshaler for IaaSVMContainer. -func (isc IaaSVMContainer) MarshalJSON() ([]byte, error) { - isc.ContainerType = ContainerTypeIaaSVMContainer - objectMap := make(map[string]interface{}) - if isc.VirtualMachineID != nil { - objectMap["virtualMachineId"] = isc.VirtualMachineID - } - if isc.VirtualMachineVersion != nil { - objectMap["virtualMachineVersion"] = isc.VirtualMachineVersion - } - if isc.ResourceGroup != nil { - objectMap["resourceGroup"] = isc.ResourceGroup - } - if isc.FriendlyName != nil { - objectMap["friendlyName"] = isc.FriendlyName - } - if isc.BackupManagementType != "" { - objectMap["backupManagementType"] = isc.BackupManagementType - } - if isc.RegistrationStatus != nil { - objectMap["registrationStatus"] = isc.RegistrationStatus - } - if isc.HealthStatus != nil { - objectMap["healthStatus"] = isc.HealthStatus - } - if isc.ContainerType != "" { - objectMap["containerType"] = isc.ContainerType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { - return nil, false -} - -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureSQLContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return nil, false -} - -// AsAzureStorageContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return nil, false -} - -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { - return nil, false -} - -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return nil, false -} - -// AsDpmContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsDpmContainer() (*DpmContainer, bool) { - return nil, false -} - -// AsBasicDpmContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { - return nil, false -} - -// AsGenericContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsGenericContainer() (*GenericContainer, bool) { - return nil, false -} - -// AsIaaSVMContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { - return &isc, true -} - -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { - return &isc, true -} - -// AsMabContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsMabContainer() (*MabContainer, bool) { - return nil, false -} - -// AsProtectionContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsProtectionContainer() (*ProtectionContainer, bool) { - return nil, false -} - -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &isc, true -} - -// IaasVMILRRegistrationRequest restore files/folders from a backup copy of IaaS VM. -type IaasVMILRRegistrationRequest struct { - // RecoveryPointID - ID of the IaaS VM backup copy from where the files/folders have to be restored. - RecoveryPointID *string `json:"recoveryPointId,omitempty"` - // VirtualMachineID - Fully qualified ARM ID of the virtual machine whose the files / folders have to be restored. - VirtualMachineID *string `json:"virtualMachineId,omitempty"` - // InitiatorName - iSCSI initiator name. - InitiatorName *string `json:"initiatorName,omitempty"` - // RenewExistingRegistration - Whether to renew existing registration with the iSCSI server. - RenewExistingRegistration *bool `json:"renewExistingRegistration,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeILRRequest', 'ObjectTypeIaasVMILRRegistrationRequest' - ObjectType ObjectTypeBasicILRRequest `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for IaasVMILRRegistrationRequest. -func (ivrr IaasVMILRRegistrationRequest) MarshalJSON() ([]byte, error) { - ivrr.ObjectType = ObjectTypeIaasVMILRRegistrationRequest - objectMap := make(map[string]interface{}) - if ivrr.RecoveryPointID != nil { - objectMap["recoveryPointId"] = ivrr.RecoveryPointID - } - if ivrr.VirtualMachineID != nil { - objectMap["virtualMachineId"] = ivrr.VirtualMachineID - } - if ivrr.InitiatorName != nil { - objectMap["initiatorName"] = ivrr.InitiatorName - } - if ivrr.RenewExistingRegistration != nil { - objectMap["renewExistingRegistration"] = ivrr.RenewExistingRegistration - } - if ivrr.ObjectType != "" { - objectMap["objectType"] = ivrr.ObjectType - } - return json.Marshal(objectMap) -} - -// AsIaasVMILRRegistrationRequest is the BasicILRRequest implementation for IaasVMILRRegistrationRequest. -func (ivrr IaasVMILRRegistrationRequest) AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) { - return &ivrr, true -} - -// AsILRRequest is the BasicILRRequest implementation for IaasVMILRRegistrationRequest. -func (ivrr IaasVMILRRegistrationRequest) AsILRRequest() (*ILRRequest, bool) { - return nil, false -} - -// AsBasicILRRequest is the BasicILRRequest implementation for IaasVMILRRegistrationRequest. -func (ivrr IaasVMILRRegistrationRequest) AsBasicILRRequest() (BasicILRRequest, bool) { - return &ivrr, true -} - -// BasicIaaSVMProtectableItem iaaS VM workload-specific backup item. -type BasicIaaSVMProtectableItem interface { - AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) - AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) - AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) -} - -// IaaSVMProtectableItem iaaS VM workload-specific backup item. -type IaaSVMProtectableItem struct { - // VirtualMachineID - Fully qualified ARM ID of the virtual machine. - VirtualMachineID *string `json:"virtualMachineId,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseDatabase', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` -} - -func unmarshalBasicIaaSVMProtectableItem(body []byte) (BasicIaaSVMProtectableItem, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["protectableItemType"] { - case string(ProtectableItemTypeMicrosoftClassicComputevirtualMachines): - var aisccvpi AzureIaaSClassicComputeVMProtectableItem - err := json.Unmarshal(body, &aisccvpi) - return aisccvpi, err - case string(ProtectableItemTypeMicrosoftComputevirtualMachines): - var aiscvpi AzureIaaSComputeVMProtectableItem - err := json.Unmarshal(body, &aiscvpi) - return aiscvpi, err - default: - var ispi IaaSVMProtectableItem - err := json.Unmarshal(body, &ispi) - return ispi, err - } -} -func unmarshalBasicIaaSVMProtectableItemArray(body []byte) ([]BasicIaaSVMProtectableItem, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - ispiArray := make([]BasicIaaSVMProtectableItem, len(rawMessages)) - - for index, rawMessage := range rawMessages { - ispi, err := unmarshalBasicIaaSVMProtectableItem(*rawMessage) - if err != nil { - return nil, err - } - ispiArray[index] = ispi - } - return ispiArray, nil -} - -// MarshalJSON is the custom marshaler for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) MarshalJSON() ([]byte, error) { - ispi.ProtectableItemType = ProtectableItemTypeIaaSVMProtectableItem - objectMap := make(map[string]interface{}) - if ispi.VirtualMachineID != nil { - objectMap["virtualMachineId"] = ispi.VirtualMachineID - } - if ispi.BackupManagementType != nil { - objectMap["backupManagementType"] = ispi.BackupManagementType - } - if ispi.WorkloadType != nil { - objectMap["workloadType"] = ispi.WorkloadType - } - if ispi.FriendlyName != nil { - objectMap["friendlyName"] = ispi.FriendlyName - } - if ispi.ProtectionState != "" { - objectMap["protectionState"] = ispi.ProtectionState - } - if ispi.ProtectableItemType != "" { - objectMap["protectableItemType"] = ispi.ProtectableItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSAPAseDatabaseProtectableItem() (*AzureVMWorkloadSAPAseDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { - return nil, false -} - -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { - return &ispi, true -} - -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { - return &ispi, true -} - -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &ispi, true -} - -// IaasVMRecoveryPoint iaaS VM workload specific backup copy. -type IaasVMRecoveryPoint struct { - // RecoveryPointType - Type of the backup copy. - RecoveryPointType *string `json:"recoveryPointType,omitempty"` - // RecoveryPointTime - Time at which this backup copy was created. - RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` - // RecoveryPointAdditionalInfo - Additional information associated with this backup copy. - RecoveryPointAdditionalInfo *string `json:"recoveryPointAdditionalInfo,omitempty"` - // SourceVMStorageType - Storage type of the VM whose backup copy is created. - SourceVMStorageType *string `json:"sourceVMStorageType,omitempty"` - // IsSourceVMEncrypted - Identifies whether the VM was encrypted when the backup copy is created. - IsSourceVMEncrypted *bool `json:"isSourceVMEncrypted,omitempty"` - // KeyAndSecret - Required details for recovering an encrypted VM. Applicable only when IsSourceVMEncrypted is true. - KeyAndSecret *KeyAndSecretDetails `json:"keyAndSecret,omitempty"` - // IsInstantIlrSessionActive - Is the session to recover items from this backup copy still active. - IsInstantIlrSessionActive *bool `json:"isInstantIlrSessionActive,omitempty"` - // RecoveryPointTierDetails - Recovery point tier information. - RecoveryPointTierDetails *[]RecoveryPointTierInformation `json:"recoveryPointTierDetails,omitempty"` - // IsManagedVirtualMachine - Whether VM is with Managed Disks - IsManagedVirtualMachine *bool `json:"isManagedVirtualMachine,omitempty"` - // VirtualMachineSize - Virtual Machine Size - VirtualMachineSize *string `json:"virtualMachineSize,omitempty"` - // OriginalStorageAccountOption - Original Storage Account Option - OriginalStorageAccountOption *bool `json:"originalStorageAccountOption,omitempty"` - // OsType - OS type - OsType *string `json:"osType,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' - ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) MarshalJSON() ([]byte, error) { - ivrp.ObjectType = ObjectTypeIaasVMRecoveryPoint - objectMap := make(map[string]interface{}) - if ivrp.RecoveryPointType != nil { - objectMap["recoveryPointType"] = ivrp.RecoveryPointType - } - if ivrp.RecoveryPointTime != nil { - objectMap["recoveryPointTime"] = ivrp.RecoveryPointTime - } - if ivrp.RecoveryPointAdditionalInfo != nil { - objectMap["recoveryPointAdditionalInfo"] = ivrp.RecoveryPointAdditionalInfo - } - if ivrp.SourceVMStorageType != nil { - objectMap["sourceVMStorageType"] = ivrp.SourceVMStorageType - } - if ivrp.IsSourceVMEncrypted != nil { - objectMap["isSourceVMEncrypted"] = ivrp.IsSourceVMEncrypted - } - if ivrp.KeyAndSecret != nil { - objectMap["keyAndSecret"] = ivrp.KeyAndSecret - } - if ivrp.IsInstantIlrSessionActive != nil { - objectMap["isInstantIlrSessionActive"] = ivrp.IsInstantIlrSessionActive - } - if ivrp.RecoveryPointTierDetails != nil { - objectMap["recoveryPointTierDetails"] = ivrp.RecoveryPointTierDetails - } - if ivrp.IsManagedVirtualMachine != nil { - objectMap["isManagedVirtualMachine"] = ivrp.IsManagedVirtualMachine - } - if ivrp.VirtualMachineSize != nil { - objectMap["virtualMachineSize"] = ivrp.VirtualMachineSize - } - if ivrp.OriginalStorageAccountOption != nil { - objectMap["originalStorageAccountOption"] = ivrp.OriginalStorageAccountOption - } - if ivrp.OsType != nil { - objectMap["osType"] = ivrp.OsType - } - if ivrp.ObjectType != "" { - objectMap["objectType"] = ivrp.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { - return nil, false -} - -// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { - return nil, false -} - -// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { - return &ivrp, true -} - -// AsRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { - return nil, false -} - -// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { - return &ivrp, true -} - -// IaasVMRestoreRequest iaaS VM workload-specific restore. -type IaasVMRestoreRequest struct { - // RecoveryPointID - ID of the backup copy to be recovered. - RecoveryPointID *string `json:"recoveryPointId,omitempty"` - // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks' - RecoveryType RecoveryType `json:"recoveryType,omitempty"` - // SourceResourceID - Fully qualified ARM ID of the VM which is being recovered. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // TargetVirtualMachineID - This is the complete ARM Id of the VM that will be created. - // For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} - TargetVirtualMachineID *string `json:"targetVirtualMachineId,omitempty"` - // TargetResourceGroupID - This is the ARM Id of the resource group that you want to create for this Virtual machine and other artifacts. - // For e.g. /subscriptions/{subId}/resourcegroups/{rg} - TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` - // StorageAccountID - Fully qualified ARM ID of the storage account to which the VM has to be restored. - StorageAccountID *string `json:"storageAccountId,omitempty"` - // VirtualNetworkID - This is the virtual network Id of the vnet that will be attached to the virtual machine. - // User will be validated for join action permissions in the linked access. - VirtualNetworkID *string `json:"virtualNetworkId,omitempty"` - // SubnetID - Subnet ID, is the subnet ID associated with the to be restored VM. For Classic VMs it would be - // {VnetID}/Subnet/{SubnetName} and, for the Azure Resource Manager VMs it would be ARM resource ID used to represent - // the subnet. - SubnetID *string `json:"subnetId,omitempty"` - // TargetDomainNameID - Fully qualified ARM ID of the domain name to be associated to the VM being restored. This applies only to Classic - // Virtual Machines. - TargetDomainNameID *string `json:"targetDomainNameId,omitempty"` - // Region - Region in which the virtual machine is restored. - Region *string `json:"region,omitempty"` - // AffinityGroup - Affinity group associated to VM to be restored. Used only for Classic Compute Virtual Machines. - AffinityGroup *string `json:"affinityGroup,omitempty"` - // CreateNewCloudService - Should a new cloud service be created while restoring the VM. If this is false, VM will be restored to the same - // cloud service as it was at the time of backup. - CreateNewCloudService *bool `json:"createNewCloudService,omitempty"` - // OriginalStorageAccountOption - Original Storage Account Option - OriginalStorageAccountOption *bool `json:"originalStorageAccountOption,omitempty"` - // EncryptionDetails - Details needed if the VM was encrypted at the time of backup. - EncryptionDetails *EncryptionDetails `json:"encryptionDetails,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' - ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) MarshalJSON() ([]byte, error) { - ivrr.ObjectType = ObjectTypeIaasVMRestoreRequest - objectMap := make(map[string]interface{}) - if ivrr.RecoveryPointID != nil { - objectMap["recoveryPointId"] = ivrr.RecoveryPointID - } - if ivrr.RecoveryType != "" { - objectMap["recoveryType"] = ivrr.RecoveryType - } - if ivrr.SourceResourceID != nil { - objectMap["sourceResourceId"] = ivrr.SourceResourceID - } - if ivrr.TargetVirtualMachineID != nil { - objectMap["targetVirtualMachineId"] = ivrr.TargetVirtualMachineID - } - if ivrr.TargetResourceGroupID != nil { - objectMap["targetResourceGroupId"] = ivrr.TargetResourceGroupID - } - if ivrr.StorageAccountID != nil { - objectMap["storageAccountId"] = ivrr.StorageAccountID - } - if ivrr.VirtualNetworkID != nil { - objectMap["virtualNetworkId"] = ivrr.VirtualNetworkID - } - if ivrr.SubnetID != nil { - objectMap["subnetId"] = ivrr.SubnetID - } - if ivrr.TargetDomainNameID != nil { - objectMap["targetDomainNameId"] = ivrr.TargetDomainNameID - } - if ivrr.Region != nil { - objectMap["region"] = ivrr.Region - } - if ivrr.AffinityGroup != nil { - objectMap["affinityGroup"] = ivrr.AffinityGroup - } - if ivrr.CreateNewCloudService != nil { - objectMap["createNewCloudService"] = ivrr.CreateNewCloudService - } - if ivrr.OriginalStorageAccountOption != nil { - objectMap["originalStorageAccountOption"] = ivrr.OriginalStorageAccountOption - } - if ivrr.EncryptionDetails != nil { - objectMap["encryptionDetails"] = ivrr.EncryptionDetails - } - if ivrr.ObjectType != "" { - objectMap["objectType"] = ivrr.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { - return nil, false -} - -// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { - return &ivrr, true -} - -// AsRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { - return nil, false -} - -// AsBasicRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { - return &ivrr, true -} - -// BasicILRRequest parameters to restore file/folders API. -type BasicILRRequest interface { - AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) - AsILRRequest() (*ILRRequest, bool) -} - -// ILRRequest parameters to restore file/folders API. -type ILRRequest struct { - // ObjectType - Possible values include: 'ObjectTypeILRRequest', 'ObjectTypeIaasVMILRRegistrationRequest' - ObjectType ObjectTypeBasicILRRequest `json:"objectType,omitempty"` -} - -func unmarshalBasicILRRequest(body []byte) (BasicILRRequest, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["objectType"] { - case string(ObjectTypeIaasVMILRRegistrationRequest): - var ivrr IaasVMILRRegistrationRequest - err := json.Unmarshal(body, &ivrr) - return ivrr, err - default: - var ir ILRRequest - err := json.Unmarshal(body, &ir) - return ir, err - } -} -func unmarshalBasicILRRequestArray(body []byte) ([]BasicILRRequest, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - irArray := make([]BasicILRRequest, len(rawMessages)) - - for index, rawMessage := range rawMessages { - ir, err := unmarshalBasicILRRequest(*rawMessage) - if err != nil { - return nil, err - } - irArray[index] = ir - } - return irArray, nil -} - -// MarshalJSON is the custom marshaler for ILRRequest. -func (ir ILRRequest) MarshalJSON() ([]byte, error) { - ir.ObjectType = ObjectTypeILRRequest - objectMap := make(map[string]interface{}) - if ir.ObjectType != "" { - objectMap["objectType"] = ir.ObjectType - } - return json.Marshal(objectMap) -} - -// AsIaasVMILRRegistrationRequest is the BasicILRRequest implementation for ILRRequest. -func (ir ILRRequest) AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) { - return nil, false -} - -// AsILRRequest is the BasicILRRequest implementation for ILRRequest. -func (ir ILRRequest) AsILRRequest() (*ILRRequest, bool) { - return &ir, true -} - -// AsBasicILRRequest is the BasicILRRequest implementation for ILRRequest. -func (ir ILRRequest) AsBasicILRRequest() (BasicILRRequest, bool) { - return &ir, true -} - -// ILRRequestResource parameters to restore file/folders API. -type ILRRequestResource struct { - // Properties - ILRRequestResource properties - Properties BasicILRRequest `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for ILRRequestResource. -func (irr ILRRequestResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = irr.Properties - if irr.Location != nil { - objectMap["location"] = irr.Location - } - if irr.Tags != nil { - objectMap["tags"] = irr.Tags - } - if irr.ETag != nil { - objectMap["eTag"] = irr.ETag - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ILRRequestResource struct. -func (irr *ILRRequestResource) UnmarshalJSON(body []byte) error { - var m map[string]*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 := unmarshalBasicILRRequest(*v) - if err != nil { - return err - } - irr.Properties = properties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - irr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - irr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - irr.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - irr.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - irr.Tags = tags - } - case "eTag": - if v != nil { - var eTag string - err = json.Unmarshal(*v, &eTag) - if err != nil { - return err - } - irr.ETag = &eTag - } - } - } - - return nil -} - -// InquiryInfo details about inquired protectable items under a given container. -type InquiryInfo struct { - // Status - Inquiry Status for this container such as - // InProgress | Failed | Succeeded - Status *string `json:"status,omitempty"` - // ErrorDetail - Error Details if the Status is non-success. - ErrorDetail *ErrorDetail `json:"errorDetail,omitempty"` - // InquiryDetails - Inquiry Details which will have workload specific details. - // For e.g. - For SQL and oracle this will contain different details. - InquiryDetails *[]WorkloadInquiryDetails `json:"inquiryDetails,omitempty"` -} - -// InquiryValidation validation for inquired protectable items under a given container. -type InquiryValidation struct { - // Status - Status for the Inquiry Validation. - Status *string `json:"status,omitempty"` - // ErrorDetail - Error Detail in case the status is non-success. - ErrorDetail *ErrorDetail `json:"errorDetail,omitempty"` -} - -// InstantItemRecoveryTarget target details for file / folder restore. -type InstantItemRecoveryTarget struct { - // ClientScripts - List of client scripts. - ClientScripts *[]ClientScriptForConnect `json:"clientScripts,omitempty"` -} - -// KEKDetails KEK is encryption key for BEK. -type KEKDetails struct { - // KeyURL - Key is KEK. - KeyURL *string `json:"keyUrl,omitempty"` - // KeyVaultID - Key Vault ID where this Key is stored. - KeyVaultID *string `json:"keyVaultId,omitempty"` - // KeyBackupData - KEK data. - KeyBackupData *string `json:"keyBackupData,omitempty"` -} - -// KeyAndSecretDetails BEK is bitlocker key. -// KEK is encryption key for BEK -// If the VM was encrypted then we will store following details : -// 1. Secret(BEK) - Url + Backup Data + vaultId. -// 2. Key(KEK) - Url + Backup Data + vaultId. -// 3. EncryptionMechanism -// BEK and KEK can potentially have different vault ids. -type KeyAndSecretDetails struct { - // KekDetails - KEK is encryption key for BEK. - KekDetails *KEKDetails `json:"kekDetails,omitempty"` - // BekDetails - BEK is bitlocker encryption key. - BekDetails *BEKDetails `json:"bekDetails,omitempty"` - // EncryptionMechanism - Encryption mechanism: None/ SinglePass/ DoublePass - EncryptionMechanism *string `json:"encryptionMechanism,omitempty"` -} - -// LogSchedulePolicy log policy schedule. -type LogSchedulePolicy struct { - // ScheduleFrequencyInMins - Frequency of the log schedule operation of this policy in minutes. - ScheduleFrequencyInMins *int32 `json:"scheduleFrequencyInMins,omitempty"` - // SchedulePolicyType - Possible values include: 'SchedulePolicyTypeSchedulePolicy', 'SchedulePolicyTypeLogSchedulePolicy', 'SchedulePolicyTypeLongTermSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicy' - SchedulePolicyType SchedulePolicyType `json:"schedulePolicyType,omitempty"` -} - -// MarshalJSON is the custom marshaler for LogSchedulePolicy. -func (lsp LogSchedulePolicy) MarshalJSON() ([]byte, error) { - lsp.SchedulePolicyType = SchedulePolicyTypeLogSchedulePolicy - objectMap := make(map[string]interface{}) - if lsp.ScheduleFrequencyInMins != nil { - objectMap["scheduleFrequencyInMins"] = lsp.ScheduleFrequencyInMins - } - if lsp.SchedulePolicyType != "" { - objectMap["schedulePolicyType"] = lsp.SchedulePolicyType - } - return json.Marshal(objectMap) -} - -// AsLogSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. -func (lsp LogSchedulePolicy) AsLogSchedulePolicy() (*LogSchedulePolicy, bool) { - return &lsp, true -} - -// AsLongTermSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. -func (lsp LogSchedulePolicy) AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) { - return nil, false -} - -// AsSimpleSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. -func (lsp LogSchedulePolicy) AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) { - return nil, false -} - -// AsSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. -func (lsp LogSchedulePolicy) AsSchedulePolicy() (*SchedulePolicy, bool) { - return nil, false -} - -// AsBasicSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. -func (lsp LogSchedulePolicy) AsBasicSchedulePolicy() (BasicSchedulePolicy, bool) { - return &lsp, true -} - -// LongTermRetentionPolicy long term retention policy. -type LongTermRetentionPolicy struct { - // DailySchedule - Daily retention schedule of the protection policy. - DailySchedule *DailyRetentionSchedule `json:"dailySchedule,omitempty"` - // WeeklySchedule - Weekly retention schedule of the protection policy. - WeeklySchedule *WeeklyRetentionSchedule `json:"weeklySchedule,omitempty"` - // MonthlySchedule - Monthly retention schedule of the protection policy. - MonthlySchedule *MonthlyRetentionSchedule `json:"monthlySchedule,omitempty"` - // YearlySchedule - Yearly retention schedule of the protection policy. - YearlySchedule *YearlyRetentionSchedule `json:"yearlySchedule,omitempty"` - // RetentionPolicyType - Possible values include: 'RetentionPolicyTypeRetentionPolicy', 'RetentionPolicyTypeLongTermRetentionPolicy', 'RetentionPolicyTypeSimpleRetentionPolicy' - RetentionPolicyType RetentionPolicyType `json:"retentionPolicyType,omitempty"` -} - -// MarshalJSON is the custom marshaler for LongTermRetentionPolicy. -func (ltrp LongTermRetentionPolicy) MarshalJSON() ([]byte, error) { - ltrp.RetentionPolicyType = RetentionPolicyTypeLongTermRetentionPolicy - objectMap := make(map[string]interface{}) - if ltrp.DailySchedule != nil { - objectMap["dailySchedule"] = ltrp.DailySchedule - } - if ltrp.WeeklySchedule != nil { - objectMap["weeklySchedule"] = ltrp.WeeklySchedule - } - if ltrp.MonthlySchedule != nil { - objectMap["monthlySchedule"] = ltrp.MonthlySchedule - } - if ltrp.YearlySchedule != nil { - objectMap["yearlySchedule"] = ltrp.YearlySchedule - } - if ltrp.RetentionPolicyType != "" { - objectMap["retentionPolicyType"] = ltrp.RetentionPolicyType - } - return json.Marshal(objectMap) -} - -// AsLongTermRetentionPolicy is the BasicRetentionPolicy implementation for LongTermRetentionPolicy. -func (ltrp LongTermRetentionPolicy) AsLongTermRetentionPolicy() (*LongTermRetentionPolicy, bool) { - return <rp, true +// AzureWorkloadContainerExtendedInfo extended information of the container. +type AzureWorkloadContainerExtendedInfo struct { + // HostServerName - Host Os Name in case of Stand Alone and Cluster Name in case of distributed container. + HostServerName *string `json:"hostServerName,omitempty"` + // InquiryInfo - Inquiry Status for the container. + InquiryInfo *InquiryInfo `json:"inquiryInfo,omitempty"` + // NodesList - List of the nodes in case of distributed container. + NodesList *[]DistributedNodesInfo `json:"nodesList,omitempty"` } -// AsSimpleRetentionPolicy is the BasicRetentionPolicy implementation for LongTermRetentionPolicy. -func (ltrp LongTermRetentionPolicy) AsSimpleRetentionPolicy() (*SimpleRetentionPolicy, bool) { - return nil, false +// BMSBackupEngineQueryObject query parameters to fetch list of backup engines. +type BMSBackupEngineQueryObject struct { + // Expand - attribute to add extended info + Expand *string `json:"expand,omitempty"` } -// AsRetentionPolicy is the BasicRetentionPolicy implementation for LongTermRetentionPolicy. -func (ltrp LongTermRetentionPolicy) AsRetentionPolicy() (*RetentionPolicy, bool) { - return nil, false +// BMSBackupEnginesQueryObject query parameters to fetch list of backup engines. +type BMSBackupEnginesQueryObject struct { + // BackupManagementType - Backup management type for the backup engine. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // FriendlyName - Friendly name of the backup engine. + FriendlyName *string `json:"friendlyName,omitempty"` + // Expand - Attribute to add extended info. + Expand *string `json:"expand,omitempty"` } -// AsBasicRetentionPolicy is the BasicRetentionPolicy implementation for LongTermRetentionPolicy. -func (ltrp LongTermRetentionPolicy) AsBasicRetentionPolicy() (BasicRetentionPolicy, bool) { - return <rp, true +// BMSContainerQueryObject the query filters that can be used with the list containers API. +type BMSContainerQueryObject struct { + // BackupManagementType - Backup management type for this container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // ContainerType - Type of container for filter. Possible values include: 'ContainerTypeInvalid', 'ContainerTypeUnknown', 'ContainerTypeIaasVMContainer', 'ContainerTypeIaasVMServiceContainer', 'ContainerTypeDPMContainer', 'ContainerTypeAzureBackupServerContainer', 'ContainerTypeMABContainer', 'ContainerTypeCluster', 'ContainerTypeAzureSQLContainer', 'ContainerTypeWindows', 'ContainerTypeVCenter', 'ContainerTypeVMAppContainer', 'ContainerTypeSQLAGWorkLoadContainer', 'ContainerTypeStorageContainer', 'ContainerTypeGenericContainer' + ContainerType ContainerType `json:"containerType,omitempty"` + // BackupEngineName - Backup engine name + BackupEngineName *string `json:"backupEngineName,omitempty"` + // FabricName - Fabric name for filter + FabricName *string `json:"fabricName,omitempty"` + // Status - Status of registration of this container with the Recovery Services Vault. + Status *string `json:"status,omitempty"` + // FriendlyName - Friendly name of this container. + FriendlyName *string `json:"friendlyName,omitempty"` } -// LongTermSchedulePolicy long term policy schedule. -type LongTermSchedulePolicy struct { - // SchedulePolicyType - Possible values include: 'SchedulePolicyTypeSchedulePolicy', 'SchedulePolicyTypeLogSchedulePolicy', 'SchedulePolicyTypeLongTermSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicy' - SchedulePolicyType SchedulePolicyType `json:"schedulePolicyType,omitempty"` +// BMSContainersInquiryQueryObject the query filters that can be used with the inquire container API. +type BMSContainersInquiryQueryObject struct { + // BackupManagementType - Backup management type for this container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Workload type for this container. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' + WorkloadType WorkloadType `json:"workloadType,omitempty"` } -// MarshalJSON is the custom marshaler for LongTermSchedulePolicy. -func (ltsp LongTermSchedulePolicy) MarshalJSON() ([]byte, error) { - ltsp.SchedulePolicyType = SchedulePolicyTypeLongTermSchedulePolicy - objectMap := make(map[string]interface{}) - if ltsp.SchedulePolicyType != "" { - objectMap["schedulePolicyType"] = ltsp.SchedulePolicyType - } - return json.Marshal(objectMap) +// BMSPOQueryObject filters to list items that can be backed up. +type BMSPOQueryObject struct { + // BackupManagementType - Backup management type. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Workload type. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' + WorkloadType WorkloadType `json:"workloadType,omitempty"` + // ContainerName - Full name of the container whose Protectable Objects should be returned. + ContainerName *string `json:"containerName,omitempty"` + // Status - Backup status query parameter. + Status *string `json:"status,omitempty"` + // FriendlyName - Friendly name. + FriendlyName *string `json:"friendlyName,omitempty"` } -// AsLogSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. -func (ltsp LongTermSchedulePolicy) AsLogSchedulePolicy() (*LogSchedulePolicy, bool) { - return nil, false +// BMSRefreshContainersQueryObject the query filters that can be used with the refresh container API. +type BMSRefreshContainersQueryObject struct { + // BackupManagementType - Backup management type for this container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` } -// AsLongTermSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. -func (ltsp LongTermSchedulePolicy) AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) { - return <sp, true +// BMSWorkloadItemQueryObject filters to list items that can be backed up. +type BMSWorkloadItemQueryObject struct { + // BackupManagementType - Backup management type. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadItemType - Workload Item type. Possible values include: 'WorkloadItemTypeInvalid', 'WorkloadItemTypeSQLInstance', 'WorkloadItemTypeSQLDataBase', 'WorkloadItemTypeSAPHanaSystem', 'WorkloadItemTypeSAPHanaDatabase', 'WorkloadItemTypeSAPAseSystem', 'WorkloadItemTypeSAPAseDatabase' + WorkloadItemType WorkloadItemType `json:"workloadItemType,omitempty"` + // WorkloadType - Workload type. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' + WorkloadType WorkloadType `json:"workloadType,omitempty"` + // ProtectionStatus - Backup status query parameter. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionStatus ProtectionStatus `json:"protectionStatus,omitempty"` } -// AsSimpleSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. -func (ltsp LongTermSchedulePolicy) AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) { - return nil, false +// ClientScriptForConnect client script details for file / folder restore. +type ClientScriptForConnect struct { + // ScriptContent - File content of the client script for file / folder restore. + ScriptContent *string `json:"scriptContent,omitempty"` + // ScriptExtension - File extension of the client script for file / folder restore - .ps1 , .sh , etc. + ScriptExtension *string `json:"scriptExtension,omitempty"` + // OsType - OS type - Windows, Linux etc. for which this file / folder restore client script works. + OsType *string `json:"osType,omitempty"` + // URL - URL of Executable from where to source the content. If this is not null then ScriptContent should not be used + URL *string `json:"url,omitempty"` + // ScriptNameSuffix - Mandatory suffix that should be added to the name of script that is given for download to user. + // If its null or empty then , ignore it. + ScriptNameSuffix *string `json:"scriptNameSuffix,omitempty"` } -// AsSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. -func (ltsp LongTermSchedulePolicy) AsSchedulePolicy() (*SchedulePolicy, bool) { - return nil, false +// ContainerIdentityInfo container identity information +type ContainerIdentityInfo struct { + // UniqueName - Unique name of the container + UniqueName *string `json:"uniqueName,omitempty"` + // AadTenantID - Protection container identity - AAD Tenant + AadTenantID *string `json:"aadTenantId,omitempty"` + // ServicePrincipalClientID - Protection container identity - AAD Service Principal + ServicePrincipalClientID *string `json:"servicePrincipalClientId,omitempty"` + // Audience - Protection container identity - Audience + Audience *string `json:"audience,omitempty"` } -// AsBasicSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. -func (ltsp LongTermSchedulePolicy) AsBasicSchedulePolicy() (BasicSchedulePolicy, bool) { - return <sp, true +// DistributedNodesInfo this is used to represent the various nodes of the distributed container. +type DistributedNodesInfo struct { + // NodeName - Name of the node under a distributed container. + NodeName *string `json:"nodeName,omitempty"` + // Status - Status of this Node. + // Failed | Succeeded + Status *string `json:"status,omitempty"` + // ErrorDetail - Error Details if the Status is non-success. + ErrorDetail *ErrorDetail `json:"errorDetail,omitempty"` } -// MabContainer container with items backed up using MAB backup engine. -type MabContainer struct { - // CanReRegister - Can the container be registered one more time. - CanReRegister *bool `json:"canReRegister,omitempty"` - // ContainerID - ContainerID represents the container. - ContainerID *int64 `json:"containerId,omitempty"` - // ProtectedItemCount - Number of items backed up in this container. - ProtectedItemCount *int64 `json:"protectedItemCount,omitempty"` - // AgentVersion - Agent version of this container. - AgentVersion *string `json:"agentVersion,omitempty"` - // ExtendedInfo - Additional information for this container - ExtendedInfo *MabContainerExtendedInfo `json:"extendedInfo,omitempty"` - // MabContainerHealthDetails - Health details on this mab container. - MabContainerHealthDetails *[]MABContainerHealthDetails `json:"mabContainerHealthDetails,omitempty"` - // ContainerHealthState - Health state of mab container. - ContainerHealthState *string `json:"containerHealthState,omitempty"` - // FriendlyName - Friendly name of the container. +// DpmBackupEngine data Protection Manager (DPM) specific backup engine. +type DpmBackupEngine struct { + // FriendlyName - Friendly name of the backup engine. FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + // BackupManagementType - Type of backup management for the backup engine. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + // RegistrationStatus - Registration status of the backup engine with the Recovery Services Vault. RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. + // BackupEngineState - Status of the backup engine with the Recovery Services Vault. = {Active/Deleting/DeleteFailed} + BackupEngineState *string `json:"backupEngineState,omitempty"` + // HealthStatus - Backup status of the backup engine. HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` + // CanReRegister - Flag indicating if the backup engine be registered, once already registered. + CanReRegister *bool `json:"canReRegister,omitempty"` + // BackupEngineID - ID of the backup engine. + BackupEngineID *string `json:"backupEngineId,omitempty"` + // DpmVersion - Backup engine version + DpmVersion *string `json:"dpmVersion,omitempty"` + // AzureBackupAgentVersion - Backup agent version + AzureBackupAgentVersion *string `json:"azureBackupAgentVersion,omitempty"` + // IsAzureBackupAgentUpgradeAvailable - To check if backup agent upgrade available + IsAzureBackupAgentUpgradeAvailable *bool `json:"isAzureBackupAgentUpgradeAvailable,omitempty"` + // IsDpmUpgradeAvailable - To check if backup engine upgrade available + IsDpmUpgradeAvailable *bool `json:"isDpmUpgradeAvailable,omitempty"` + // ExtendedInfo - Extended info of the backupengine + ExtendedInfo *EngineExtendedInfo `json:"extendedInfo,omitempty"` + // BackupEngineType - Possible values include: 'BackupEngineTypeBackupEngineBase', 'BackupEngineTypeAzureBackupServerEngine', 'BackupEngineTypeDpmBackupEngine' + BackupEngineType EngineType `json:"backupEngineType,omitempty"` } -// MarshalJSON is the custom marshaler for MabContainer. -func (mc MabContainer) MarshalJSON() ([]byte, error) { - mc.ContainerType = ContainerTypeWindows1 +// MarshalJSON is the custom marshaler for DpmBackupEngine. +func (dbe DpmBackupEngine) MarshalJSON() ([]byte, error) { + dbe.BackupEngineType = BackupEngineTypeDpmBackupEngine objectMap := make(map[string]interface{}) - if mc.CanReRegister != nil { - objectMap["canReRegister"] = mc.CanReRegister + if dbe.FriendlyName != nil { + objectMap["friendlyName"] = dbe.FriendlyName } - if mc.ContainerID != nil { - objectMap["containerId"] = mc.ContainerID + if dbe.BackupManagementType != "" { + objectMap["backupManagementType"] = dbe.BackupManagementType } - if mc.ProtectedItemCount != nil { - objectMap["protectedItemCount"] = mc.ProtectedItemCount + if dbe.RegistrationStatus != nil { + objectMap["registrationStatus"] = dbe.RegistrationStatus } - if mc.AgentVersion != nil { - objectMap["agentVersion"] = mc.AgentVersion + if dbe.BackupEngineState != nil { + objectMap["backupEngineState"] = dbe.BackupEngineState } - if mc.ExtendedInfo != nil { - objectMap["extendedInfo"] = mc.ExtendedInfo + if dbe.HealthStatus != nil { + objectMap["healthStatus"] = dbe.HealthStatus } - if mc.MabContainerHealthDetails != nil { - objectMap["mabContainerHealthDetails"] = mc.MabContainerHealthDetails + if dbe.CanReRegister != nil { + objectMap["canReRegister"] = dbe.CanReRegister } - if mc.ContainerHealthState != nil { - objectMap["containerHealthState"] = mc.ContainerHealthState + if dbe.BackupEngineID != nil { + objectMap["backupEngineId"] = dbe.BackupEngineID } - if mc.FriendlyName != nil { - objectMap["friendlyName"] = mc.FriendlyName + if dbe.DpmVersion != nil { + objectMap["dpmVersion"] = dbe.DpmVersion } - if mc.BackupManagementType != "" { - objectMap["backupManagementType"] = mc.BackupManagementType + if dbe.AzureBackupAgentVersion != nil { + objectMap["azureBackupAgentVersion"] = dbe.AzureBackupAgentVersion } - if mc.RegistrationStatus != nil { - objectMap["registrationStatus"] = mc.RegistrationStatus + if dbe.IsAzureBackupAgentUpgradeAvailable != nil { + objectMap["isAzureBackupAgentUpgradeAvailable"] = dbe.IsAzureBackupAgentUpgradeAvailable } - if mc.HealthStatus != nil { - objectMap["healthStatus"] = mc.HealthStatus + if dbe.IsDpmUpgradeAvailable != nil { + objectMap["isDpmUpgradeAvailable"] = dbe.IsDpmUpgradeAvailable } - if mc.ContainerType != "" { - objectMap["containerType"] = mc.ContainerType + if dbe.ExtendedInfo != nil { + objectMap["extendedInfo"] = dbe.ExtendedInfo + } + if dbe.BackupEngineType != "" { + objectMap["backupEngineType"] = dbe.BackupEngineType } return json.Marshal(objectMap) } -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { - return nil, false -} - -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureSQLContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return nil, false -} - -// AsAzureStorageContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return nil, false -} - -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { - return nil, false -} - -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return nil, false -} - -// AsDpmContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsDpmContainer() (*DpmContainer, bool) { +// AsAzureBackupServerEngine is the BasicEngineBase implementation for DpmBackupEngine. +func (dbe DpmBackupEngine) AsAzureBackupServerEngine() (*AzureBackupServerEngine, bool) { return nil, false } -// AsBasicDpmContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { - return nil, false +// AsDpmBackupEngine is the BasicEngineBase implementation for DpmBackupEngine. +func (dbe DpmBackupEngine) AsDpmBackupEngine() (*DpmBackupEngine, bool) { + return &dbe, true } -// AsGenericContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsGenericContainer() (*GenericContainer, bool) { +// AsEngineBase is the BasicEngineBase implementation for DpmBackupEngine. +func (dbe DpmBackupEngine) AsEngineBase() (*EngineBase, bool) { return nil, false } -// AsIaaSVMContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { - return nil, false +// AsBasicEngineBase is the BasicEngineBase implementation for DpmBackupEngine. +func (dbe DpmBackupEngine) AsBasicEngineBase() (BasicEngineBase, bool) { + return &dbe, true } -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { - return nil, false +// BasicDpmContainer DPM workload-specific protection container. +type BasicDpmContainer interface { + AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) + AsDpmContainer() (*DpmContainer, bool) } -// AsMabContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsMabContainer() (*MabContainer, bool) { - return &mc, true +// DpmContainer DPM workload-specific protection container. +type DpmContainer struct { + // CanReRegister - Specifies whether the container is re-registrable. + CanReRegister *bool `json:"canReRegister,omitempty"` + // ContainerID - ID of container. + ContainerID *string `json:"containerId,omitempty"` + // ProtectedItemCount - Number of protected items in the BackupEngine + ProtectedItemCount *int64 `json:"protectedItemCount,omitempty"` + // DpmAgentVersion - Backup engine Agent version + DpmAgentVersion *string `json:"dpmAgentVersion,omitempty"` + // DpmServers - List of BackupEngines protecting the container + DpmServers *[]string `json:"dpmServers,omitempty"` + // UpgradeAvailable - To check if upgrade available + UpgradeAvailable *bool `json:"upgradeAvailable,omitempty"` + // ProtectionStatus - Protection status of the container. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ExtendedInfo - Extended Info of the container. + ExtendedInfo *DPMContainerExtendedInfo `json:"extendedInfo,omitempty"` + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` } -// AsProtectionContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsProtectionContainer() (*ProtectionContainer, bool) { - return nil, false -} +func unmarshalBasicDpmContainer(body []byte) (BasicDpmContainer, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &mc, true + switch m["containerType"] { + case string(ContainerTypeAzureBackupServerContainer1): + var absc AzureBackupServerContainer + err := json.Unmarshal(body, &absc) + return absc, err + default: + var dc DpmContainer + err := json.Unmarshal(body, &dc) + return dc, err + } } +func unmarshalBasicDpmContainerArray(body []byte) ([]BasicDpmContainer, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } -// MabContainerExtendedInfo additional information of the container. -type MabContainerExtendedInfo struct { - // LastRefreshedAt - Time stamp when this container was refreshed. - LastRefreshedAt *date.Time `json:"lastRefreshedAt,omitempty"` - // BackupItemType - Type of backup items associated with this container. Possible values include: 'ItemTypeInvalid', 'ItemTypeVM', 'ItemTypeFileFolder', 'ItemTypeAzureSQLDb', 'ItemTypeSQLDB', 'ItemTypeExchange', 'ItemTypeSharepoint', 'ItemTypeVMwareVM', 'ItemTypeSystemState', 'ItemTypeClient', 'ItemTypeGenericDataSource', 'ItemTypeSQLDataBase', 'ItemTypeAzureFileShare', 'ItemTypeSAPHanaDatabase', 'ItemTypeSAPAseDatabase' - BackupItemType ItemType `json:"backupItemType,omitempty"` - // BackupItems - List of backup items associated with this container. - BackupItems *[]string `json:"backupItems,omitempty"` - // PolicyName - Backup policy associated with this container. - PolicyName *string `json:"policyName,omitempty"` - // LastBackupStatus - Latest backup status of this container. - LastBackupStatus *string `json:"lastBackupStatus,omitempty"` -} + dcArray := make([]BasicDpmContainer, len(rawMessages)) -// MABContainerHealthDetails MAB workload-specific Health Details. -type MABContainerHealthDetails struct { - // Code - Health Code - Code *int32 `json:"code,omitempty"` - // Title - Health Title - Title *string `json:"title,omitempty"` - // Message - Health Message - Message *string `json:"message,omitempty"` - // Recommendations - Health Recommended Actions - Recommendations *[]string `json:"recommendations,omitempty"` + for index, rawMessage := range rawMessages { + dc, err := unmarshalBasicDpmContainer(*rawMessage) + if err != nil { + return nil, err + } + dcArray[index] = dc + } + return dcArray, nil } -// MabFileFolderProtectedItem MAB workload-specific backup item. -type MabFileFolderProtectedItem struct { - // FriendlyName - Friendly name of this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ComputerName - Name of the computer associated with this backup item. - ComputerName *string `json:"computerName,omitempty"` - // LastBackupStatus - Status of last backup operation. - LastBackupStatus *string `json:"lastBackupStatus,omitempty"` - // ProtectionState - Protected, ProtectionStopped, IRPending or ProtectionError - ProtectionState *string `json:"protectionState,omitempty"` - // DeferredDeleteSyncTimeInUTC - Sync time for deferred deletion. - DeferredDeleteSyncTimeInUTC *int64 `json:"deferredDeleteSyncTimeInUTC,omitempty"` - // ExtendedInfo - Additional information with this backup item. - ExtendedInfo *MabFileFolderProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - WorkloadType DataSourceType `json:"workloadType,omitempty"` - // ContainerName - Unique name of container - ContainerName *string `json:"containerName,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. - LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` - // BackupSetName - Name of the backup set the backup item belongs to - BackupSetName *string `json:"backupSetName,omitempty"` - // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' - CreateMode CreateMode `json:"createMode,omitempty"` - // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC - DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` - // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state - IsRehydrate *bool `json:"isRehydrate,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' - ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) MarshalJSON() ([]byte, error) { - mffpi.ProtectedItemType = ProtectedItemTypeMabFileFolderProtectedItem +// MarshalJSON is the custom marshaler for DpmContainer. +func (dc DpmContainer) MarshalJSON() ([]byte, error) { + dc.ContainerType = ContainerTypeDPMContainer1 objectMap := make(map[string]interface{}) - if mffpi.FriendlyName != nil { - objectMap["friendlyName"] = mffpi.FriendlyName - } - if mffpi.ComputerName != nil { - objectMap["computerName"] = mffpi.ComputerName - } - if mffpi.LastBackupStatus != nil { - objectMap["lastBackupStatus"] = mffpi.LastBackupStatus - } - if mffpi.ProtectionState != nil { - objectMap["protectionState"] = mffpi.ProtectionState - } - if mffpi.DeferredDeleteSyncTimeInUTC != nil { - objectMap["deferredDeleteSyncTimeInUTC"] = mffpi.DeferredDeleteSyncTimeInUTC - } - if mffpi.ExtendedInfo != nil { - objectMap["extendedInfo"] = mffpi.ExtendedInfo - } - if mffpi.BackupManagementType != "" { - objectMap["backupManagementType"] = mffpi.BackupManagementType - } - if mffpi.WorkloadType != "" { - objectMap["workloadType"] = mffpi.WorkloadType + if dc.CanReRegister != nil { + objectMap["canReRegister"] = dc.CanReRegister } - if mffpi.ContainerName != nil { - objectMap["containerName"] = mffpi.ContainerName + if dc.ContainerID != nil { + objectMap["containerId"] = dc.ContainerID } - if mffpi.SourceResourceID != nil { - objectMap["sourceResourceId"] = mffpi.SourceResourceID + if dc.ProtectedItemCount != nil { + objectMap["protectedItemCount"] = dc.ProtectedItemCount } - if mffpi.PolicyID != nil { - objectMap["policyId"] = mffpi.PolicyID + if dc.DpmAgentVersion != nil { + objectMap["dpmAgentVersion"] = dc.DpmAgentVersion } - if mffpi.LastRecoveryPoint != nil { - objectMap["lastRecoveryPoint"] = mffpi.LastRecoveryPoint + if dc.DpmServers != nil { + objectMap["dpmServers"] = dc.DpmServers } - if mffpi.BackupSetName != nil { - objectMap["backupSetName"] = mffpi.BackupSetName + if dc.UpgradeAvailable != nil { + objectMap["upgradeAvailable"] = dc.UpgradeAvailable } - if mffpi.CreateMode != "" { - objectMap["createMode"] = mffpi.CreateMode + if dc.ProtectionStatus != nil { + objectMap["protectionStatus"] = dc.ProtectionStatus } - if mffpi.DeferredDeleteTimeInUTC != nil { - objectMap["deferredDeleteTimeInUTC"] = mffpi.DeferredDeleteTimeInUTC + if dc.ExtendedInfo != nil { + objectMap["extendedInfo"] = dc.ExtendedInfo } - if mffpi.IsScheduledForDeferredDelete != nil { - objectMap["isScheduledForDeferredDelete"] = mffpi.IsScheduledForDeferredDelete + if dc.FriendlyName != nil { + objectMap["friendlyName"] = dc.FriendlyName } - if mffpi.DeferredDeleteTimeRemaining != nil { - objectMap["deferredDeleteTimeRemaining"] = mffpi.DeferredDeleteTimeRemaining + if dc.BackupManagementType != "" { + objectMap["backupManagementType"] = dc.BackupManagementType } - if mffpi.IsDeferredDeleteScheduleUpcoming != nil { - objectMap["isDeferredDeleteScheduleUpcoming"] = mffpi.IsDeferredDeleteScheduleUpcoming + if dc.RegistrationStatus != nil { + objectMap["registrationStatus"] = dc.RegistrationStatus } - if mffpi.IsRehydrate != nil { - objectMap["isRehydrate"] = mffpi.IsRehydrate + if dc.HealthStatus != nil { + objectMap["healthStatus"] = dc.HealthStatus } - if mffpi.ProtectedItemType != "" { - objectMap["protectedItemType"] = mffpi.ProtectedItemType + if dc.ContainerType != "" { + objectMap["containerType"] = dc.ContainerType } return json.Marshal(objectMap) } -// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { return nil, false } -// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { return nil, false } -// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { return nil, false } -// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { return nil, false } -// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { +// AsAzureSQLContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { return nil, false } -// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { +// AsAzureStorageContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { return nil, false } -// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { return nil, false } -// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { return nil, false } -// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { - return nil, false +// AsDpmContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsDpmContainer() (*DpmContainer, bool) { + return &dc, true +} + +// AsBasicDpmContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { + return &dc, true } -// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { +// AsGenericContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsGenericContainer() (*GenericContainer, bool) { return nil, false } -// AsDPMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { +// AsIaaSVMContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { return nil, false } -// AsGenericProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { return nil, false } -// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { - return &mffpi, true +// AsMabContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsMabContainer() (*MabContainer, bool) { + return nil, false } -// AsProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { +// AsProtectionContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsProtectionContainer() (*ProtectionContainer, bool) { return nil, false } -// AsBasicProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { - return &mffpi, true +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &dc, true } -// MabFileFolderProtectedItemExtendedInfo additional information on the backed up item. -type MabFileFolderProtectedItemExtendedInfo struct { - // LastRefreshedAt - Last time when the agent data synced to service. +// DPMContainerExtendedInfo additional information of the DPMContainer. +type DPMContainerExtendedInfo struct { + // LastRefreshedAt - Last refresh time of the DPMContainer. LastRefreshedAt *date.Time `json:"lastRefreshedAt,omitempty"` - // OldestRecoveryPoint - The oldest backup copy available. - OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"` - // RecoveryPointCount - Number of backup copies associated with the backup item. - RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"` -} - -// MabProtectionPolicy mab container-specific backup policy. -type MabProtectionPolicy struct { - // SchedulePolicy - Backup schedule of backup policy. - SchedulePolicy BasicSchedulePolicy `json:"schedulePolicy,omitempty"` - // RetentionPolicy - Retention policy details. - RetentionPolicy BasicRetentionPolicy `json:"retentionPolicy,omitempty"` - // ProtectedItemsCount - Number of items associated with this policy. - ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` - // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' - BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` } -// MarshalJSON is the custom marshaler for MabProtectionPolicy. -func (mpp MabProtectionPolicy) MarshalJSON() ([]byte, error) { - mpp.BackupManagementType = BackupManagementTypeMAB - objectMap := make(map[string]interface{}) - objectMap["schedulePolicy"] = mpp.SchedulePolicy - objectMap["retentionPolicy"] = mpp.RetentionPolicy - if mpp.ProtectedItemsCount != nil { - objectMap["protectedItemsCount"] = mpp.ProtectedItemsCount - } - if mpp.BackupManagementType != "" { - objectMap["backupManagementType"] = mpp.BackupManagementType - } - return json.Marshal(objectMap) +// BasicEngineBase the base backup engine class. All workload specific backup engines derive from this class. +type BasicEngineBase interface { + AsAzureBackupServerEngine() (*AzureBackupServerEngine, bool) + AsDpmBackupEngine() (*DpmBackupEngine, bool) + AsEngineBase() (*EngineBase, bool) } -// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. -func (mpp MabProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { - return nil, false +// EngineBase the base backup engine class. All workload specific backup engines derive from this class. +type EngineBase struct { + // FriendlyName - Friendly name of the backup engine. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the backup engine. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Registration status of the backup engine with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // BackupEngineState - Status of the backup engine with the Recovery Services Vault. = {Active/Deleting/DeleteFailed} + BackupEngineState *string `json:"backupEngineState,omitempty"` + // HealthStatus - Backup status of the backup engine. + HealthStatus *string `json:"healthStatus,omitempty"` + // CanReRegister - Flag indicating if the backup engine be registered, once already registered. + CanReRegister *bool `json:"canReRegister,omitempty"` + // BackupEngineID - ID of the backup engine. + BackupEngineID *string `json:"backupEngineId,omitempty"` + // DpmVersion - Backup engine version + DpmVersion *string `json:"dpmVersion,omitempty"` + // AzureBackupAgentVersion - Backup agent version + AzureBackupAgentVersion *string `json:"azureBackupAgentVersion,omitempty"` + // IsAzureBackupAgentUpgradeAvailable - To check if backup agent upgrade available + IsAzureBackupAgentUpgradeAvailable *bool `json:"isAzureBackupAgentUpgradeAvailable,omitempty"` + // IsDpmUpgradeAvailable - To check if backup engine upgrade available + IsDpmUpgradeAvailable *bool `json:"isDpmUpgradeAvailable,omitempty"` + // ExtendedInfo - Extended info of the backupengine + ExtendedInfo *EngineExtendedInfo `json:"extendedInfo,omitempty"` + // BackupEngineType - Possible values include: 'BackupEngineTypeBackupEngineBase', 'BackupEngineTypeAzureBackupServerEngine', 'BackupEngineTypeDpmBackupEngine' + BackupEngineType EngineType `json:"backupEngineType,omitempty"` } -// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. -func (mpp MabProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { - return nil, false -} +func unmarshalBasicEngineBase(body []byte) (BasicEngineBase, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } -// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. -func (mpp MabProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { - return nil, false + switch m["backupEngineType"] { + case string(BackupEngineTypeAzureBackupServerEngine): + var abse AzureBackupServerEngine + err := json.Unmarshal(body, &abse) + return abse, err + case string(BackupEngineTypeDpmBackupEngine): + var dbe DpmBackupEngine + err := json.Unmarshal(body, &dbe) + return dbe, err + default: + var eb EngineBase + err := json.Unmarshal(body, &eb) + return eb, err + } } +func unmarshalBasicEngineBaseArray(body []byte) ([]BasicEngineBase, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } -// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. -func (mpp MabProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { - return nil, false -} + ebArray := make([]BasicEngineBase, len(rawMessages)) -// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. -func (mpp MabProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { - return nil, false + for index, rawMessage := range rawMessages { + eb, err := unmarshalBasicEngineBase(*rawMessage) + if err != nil { + return nil, err + } + ebArray[index] = eb + } + return ebArray, nil } -// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. -func (mpp MabProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { - return &mpp, true +// MarshalJSON is the custom marshaler for EngineBase. +func (eb EngineBase) MarshalJSON() ([]byte, error) { + eb.BackupEngineType = BackupEngineTypeBackupEngineBase + objectMap := make(map[string]interface{}) + if eb.FriendlyName != nil { + objectMap["friendlyName"] = eb.FriendlyName + } + if eb.BackupManagementType != "" { + objectMap["backupManagementType"] = eb.BackupManagementType + } + if eb.RegistrationStatus != nil { + objectMap["registrationStatus"] = eb.RegistrationStatus + } + if eb.BackupEngineState != nil { + objectMap["backupEngineState"] = eb.BackupEngineState + } + if eb.HealthStatus != nil { + objectMap["healthStatus"] = eb.HealthStatus + } + if eb.CanReRegister != nil { + objectMap["canReRegister"] = eb.CanReRegister + } + if eb.BackupEngineID != nil { + objectMap["backupEngineId"] = eb.BackupEngineID + } + if eb.DpmVersion != nil { + objectMap["dpmVersion"] = eb.DpmVersion + } + if eb.AzureBackupAgentVersion != nil { + objectMap["azureBackupAgentVersion"] = eb.AzureBackupAgentVersion + } + if eb.IsAzureBackupAgentUpgradeAvailable != nil { + objectMap["isAzureBackupAgentUpgradeAvailable"] = eb.IsAzureBackupAgentUpgradeAvailable + } + if eb.IsDpmUpgradeAvailable != nil { + objectMap["isDpmUpgradeAvailable"] = eb.IsDpmUpgradeAvailable + } + if eb.ExtendedInfo != nil { + objectMap["extendedInfo"] = eb.ExtendedInfo + } + if eb.BackupEngineType != "" { + objectMap["backupEngineType"] = eb.BackupEngineType + } + return json.Marshal(objectMap) } -// AsProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. -func (mpp MabProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { +// AsAzureBackupServerEngine is the BasicEngineBase implementation for EngineBase. +func (eb EngineBase) AsAzureBackupServerEngine() (*AzureBackupServerEngine, bool) { return nil, false } -// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. -func (mpp MabProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { - return &mpp, true +// AsDpmBackupEngine is the BasicEngineBase implementation for EngineBase. +func (eb EngineBase) AsDpmBackupEngine() (*DpmBackupEngine, bool) { + return nil, false } -// UnmarshalJSON is the custom unmarshaler for MabProtectionPolicy struct. -func (mpp *MabProtectionPolicy) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "schedulePolicy": - if v != nil { - schedulePolicy, err := unmarshalBasicSchedulePolicy(*v) - if err != nil { - return err - } - mpp.SchedulePolicy = schedulePolicy - } - case "retentionPolicy": - if v != nil { - retentionPolicy, err := unmarshalBasicRetentionPolicy(*v) - if err != nil { - return err - } - mpp.RetentionPolicy = retentionPolicy - } - case "protectedItemsCount": - if v != nil { - var protectedItemsCount int32 - err = json.Unmarshal(*v, &protectedItemsCount) - if err != nil { - return err - } - mpp.ProtectedItemsCount = &protectedItemsCount - } - case "backupManagementType": - if v != nil { - var backupManagementType ManagementTypeBasicProtectionPolicy - err = json.Unmarshal(*v, &backupManagementType) - if err != nil { - return err - } - mpp.BackupManagementType = backupManagementType - } - } - } - - return nil +// AsEngineBase is the BasicEngineBase implementation for EngineBase. +func (eb EngineBase) AsEngineBase() (*EngineBase, bool) { + return &eb, true } -// MonthlyRetentionSchedule monthly retention schedule. -type MonthlyRetentionSchedule struct { - // RetentionScheduleFormatType - Retention schedule format type for monthly retention policy. Possible values include: 'RetentionScheduleFormatInvalid', 'RetentionScheduleFormatDaily', 'RetentionScheduleFormatWeekly' - RetentionScheduleFormatType RetentionScheduleFormat `json:"retentionScheduleFormatType,omitempty"` - // RetentionScheduleDaily - Daily retention format for monthly retention policy. - RetentionScheduleDaily *DailyRetentionFormat `json:"retentionScheduleDaily,omitempty"` - // RetentionScheduleWeekly - Weekly retention format for monthly retention policy. - RetentionScheduleWeekly *WeeklyRetentionFormat `json:"retentionScheduleWeekly,omitempty"` - // RetentionTimes - Retention times of retention policy. - RetentionTimes *[]date.Time `json:"retentionTimes,omitempty"` - // RetentionDuration - Retention duration of retention Policy. - RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` +// AsBasicEngineBase is the BasicEngineBase implementation for EngineBase. +func (eb EngineBase) AsBasicEngineBase() (BasicEngineBase, bool) { + return &eb, true } -// OperationStatus operation status. -type OperationStatus struct { +// EngineBaseResource the base backup engine class. All workload specific backup engines derive from this +// class. +type EngineBaseResource struct { autorest.Response `json:"-"` - // ID - ID of the operation. + // Properties - BackupEngineBaseResource properties + Properties BasicEngineBase `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id represents the complete path to the resource. ID *string `json:"id,omitempty"` - // Name - Name of the operation. + // Name - READ-ONLY; Resource name associated with the resource. Name *string `json:"name,omitempty"` - // Status - Operation status. Possible values include: 'OperationStatusValuesInvalid', 'OperationStatusValuesInProgress', 'OperationStatusValuesSucceeded', 'OperationStatusValuesFailed', 'OperationStatusValuesCanceled' - Status OperationStatusValues `json:"status,omitempty"` - // StartTime - Operation start time. Format: ISO-8601. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - Operation end time. Format: ISO-8601. - EndTime *date.Time `json:"endTime,omitempty"` - // Error - Error information related to this operation. - Error *OperationStatusError `json:"error,omitempty"` - // Properties - Additional information associated with this operation. - Properties BasicOperationStatusExtendedInfo `json:"properties,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` } -// UnmarshalJSON is the custom unmarshaler for OperationStatus struct. -func (osVar *OperationStatus) UnmarshalJSON(body []byte) error { +// MarshalJSON is the custom marshaler for EngineBaseResource. +func (ebr EngineBaseResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = ebr.Properties + if ebr.Location != nil { + objectMap["location"] = ebr.Location + } + if ebr.Tags != nil { + objectMap["tags"] = ebr.Tags + } + if ebr.ETag != nil { + objectMap["eTag"] = ebr.ETag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for EngineBaseResource struct. +func (ebr *EngineBaseResource) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -12962,6 +5083,14 @@ func (osVar *OperationStatus) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicEngineBase(*v) + if err != nil { + return err + } + ebr.Properties = properties + } case "id": if v != nil { var ID string @@ -12969,7 +5098,7 @@ func (osVar *OperationStatus) UnmarshalJSON(body []byte) error { if err != nil { return err } - osVar.ID = &ID + ebr.ID = &ID } case "name": if v != nil { @@ -12978,51 +5107,43 @@ func (osVar *OperationStatus) UnmarshalJSON(body []byte) error { if err != nil { return err } - osVar.Name = &name - } - case "status": - if v != nil { - var status OperationStatusValues - err = json.Unmarshal(*v, &status) - if err != nil { - return err - } - osVar.Status = status + ebr.Name = &name } - case "startTime": + case "type": if v != nil { - var startTime date.Time - err = json.Unmarshal(*v, &startTime) + var typeVar string + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - osVar.StartTime = &startTime + ebr.Type = &typeVar } - case "endTime": + case "location": if v != nil { - var endTime date.Time - err = json.Unmarshal(*v, &endTime) + var location string + err = json.Unmarshal(*v, &location) if err != nil { return err } - osVar.EndTime = &endTime + ebr.Location = &location } - case "error": + case "tags": if v != nil { - var errorVar OperationStatusError - err = json.Unmarshal(*v, &errorVar) + var tags map[string]*string + err = json.Unmarshal(*v, &tags) if err != nil { return err } - osVar.Error = &errorVar + ebr.Tags = tags } - case "properties": + case "eTag": if v != nil { - properties, err := unmarshalBasicOperationStatusExtendedInfo(*v) + var eTag string + err = json.Unmarshal(*v, &eTag) if err != nil { return err } - osVar.Properties = properties + ebr.ETag = &eTag } } } @@ -13030,897 +5151,876 @@ func (osVar *OperationStatus) UnmarshalJSON(body []byte) error { return nil } -// OperationStatusError error information associated with operation status call. -type OperationStatusError struct { - // Code - Error code of the operation failure. - Code *string `json:"code,omitempty"` - // Message - Error message displayed if the operation failure. - Message *string `json:"message,omitempty"` +// EngineBaseResourceList list of BackupEngineBase resources +type EngineBaseResourceList struct { + autorest.Response `json:"-"` + // Value - List of resources. + Value *[]EngineBaseResource `json:"value,omitempty"` + // NextLink - The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. + NextLink *string `json:"nextLink,omitempty"` } -// BasicOperationStatusExtendedInfo base class for additional information of operation status. -type BasicOperationStatusExtendedInfo interface { - AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) - AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) - AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) - AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) +// EngineBaseResourceListIterator provides access to a complete listing of EngineBaseResource values. +type EngineBaseResourceListIterator struct { + i int + page EngineBaseResourceListPage } -// OperationStatusExtendedInfo base class for additional information of operation status. -type OperationStatusExtendedInfo struct { - // ObjectType - Possible values include: 'ObjectTypeOperationStatusExtendedInfo', 'ObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeOperationStatusProvisionILRExtendedInfo' - ObjectType ObjectTypeBasicOperationStatusExtendedInfo `json:"objectType,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 *EngineBaseResourceListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EngineBaseResourceListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil } -func unmarshalBasicOperationStatusExtendedInfo(body []byte) (BasicOperationStatusExtendedInfo, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *EngineBaseResourceListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter EngineBaseResourceListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter EngineBaseResourceListIterator) Response() EngineBaseResourceList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter EngineBaseResourceListIterator) Value() EngineBaseResource { + if !iter.page.NotDone() { + return EngineBaseResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the EngineBaseResourceListIterator type. +func NewEngineBaseResourceListIterator(page EngineBaseResourceListPage) EngineBaseResourceListIterator { + return EngineBaseResourceListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ebrl EngineBaseResourceList) IsEmpty() bool { + return ebrl.Value == nil || len(*ebrl.Value) == 0 +} + +// engineBaseResourceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ebrl EngineBaseResourceList) engineBaseResourceListPreparer(ctx context.Context) (*http.Request, error) { + if ebrl.NextLink == nil || len(to.String(ebrl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ebrl.NextLink))) +} + +// EngineBaseResourceListPage contains a page of EngineBaseResource values. +type EngineBaseResourceListPage struct { + fn func(context.Context, EngineBaseResourceList) (EngineBaseResourceList, error) + ebrl EngineBaseResourceList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *EngineBaseResourceListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EngineBaseResourceListPage.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.ebrl) if err != nil { - return nil, err + return err } + page.ebrl = next + return nil +} - switch m["objectType"] { - case string(ObjectTypeOperationStatusJobExtendedInfo): - var osjei OperationStatusJobExtendedInfo - err := json.Unmarshal(body, &osjei) - return osjei, err - case string(ObjectTypeOperationStatusJobsExtendedInfo): - var osjei OperationStatusJobsExtendedInfo - err := json.Unmarshal(body, &osjei) - return osjei, err - case string(ObjectTypeOperationStatusProvisionILRExtendedInfo): - var ospiei OperationStatusProvisionILRExtendedInfo - err := json.Unmarshal(body, &ospiei) - return ospiei, err - default: - var osei OperationStatusExtendedInfo - err := json.Unmarshal(body, &osei) - return osei, 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 *EngineBaseResourceListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page EngineBaseResourceListPage) NotDone() bool { + return !page.ebrl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page EngineBaseResourceListPage) Response() EngineBaseResourceList { + return page.ebrl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page EngineBaseResourceListPage) Values() []EngineBaseResource { + if page.ebrl.IsEmpty() { + return nil } + return *page.ebrl.Value +} + +// Creates a new instance of the EngineBaseResourceListPage type. +func NewEngineBaseResourceListPage(getNextPage func(context.Context, EngineBaseResourceList) (EngineBaseResourceList, error)) EngineBaseResourceListPage { + return EngineBaseResourceListPage{fn: getNextPage} +} + +// EngineExtendedInfo additional information on backup engine. +type EngineExtendedInfo struct { + // DatabaseName - Database name of backup engine. + DatabaseName *string `json:"databaseName,omitempty"` + // ProtectedItemsCount - Number of protected items in the backup engine. + ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` + // ProtectedServersCount - Number of protected servers in the backup engine. + ProtectedServersCount *int32 `json:"protectedServersCount,omitempty"` + // DiskCount - Number of disks in the backup engine. + DiskCount *int32 `json:"diskCount,omitempty"` + // UsedDiskSpace - Disk space used in the backup engine. + UsedDiskSpace *float64 `json:"usedDiskSpace,omitempty"` + // AvailableDiskSpace - Disk space currently available in the backup engine. + AvailableDiskSpace *float64 `json:"availableDiskSpace,omitempty"` + // RefreshedAt - Last refresh time in the backup engine. + RefreshedAt *date.Time `json:"refreshedAt,omitempty"` + // AzureProtectedInstances - Protected instances in the backup engine. + AzureProtectedInstances *int32 `json:"azureProtectedInstances,omitempty"` } -func unmarshalBasicOperationStatusExtendedInfoArray(body []byte) ([]BasicOperationStatusExtendedInfo, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - oseiArray := make([]BasicOperationStatusExtendedInfo, len(rawMessages)) +// ErrorDetail error Detail class which encapsulates Code, Message and Recommendations. +type ErrorDetail struct { + // Code - READ-ONLY; Error code. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; Error Message related to the Code. + Message *string `json:"message,omitempty"` + // Recommendations - READ-ONLY; List of recommendation strings. + Recommendations *[]string `json:"recommendations,omitempty"` +} - for index, rawMessage := range rawMessages { - osei, err := unmarshalBasicOperationStatusExtendedInfo(*rawMessage) - if err != nil { - return nil, err - } - oseiArray[index] = osei - } - return oseiArray, nil +// GenericContainer base class for generic container of backup items +type GenericContainer struct { + // FabricName - Name of the container's fabric + FabricName *string `json:"fabricName,omitempty"` + // ExtendedInformation - Extended information (not returned in List container API calls) + ExtendedInformation *GenericContainerExtendedInfo `json:"extendedInformation,omitempty"` + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` } -// MarshalJSON is the custom marshaler for OperationStatusExtendedInfo. -func (osei OperationStatusExtendedInfo) MarshalJSON() ([]byte, error) { - osei.ObjectType = ObjectTypeOperationStatusExtendedInfo +// MarshalJSON is the custom marshaler for GenericContainer. +func (gc GenericContainer) MarshalJSON() ([]byte, error) { + gc.ContainerType = ContainerTypeGenericContainer1 objectMap := make(map[string]interface{}) - if osei.ObjectType != "" { - objectMap["objectType"] = osei.ObjectType + if gc.FabricName != nil { + objectMap["fabricName"] = gc.FabricName + } + if gc.ExtendedInformation != nil { + objectMap["extendedInformation"] = gc.ExtendedInformation + } + if gc.FriendlyName != nil { + objectMap["friendlyName"] = gc.FriendlyName + } + if gc.BackupManagementType != "" { + objectMap["backupManagementType"] = gc.BackupManagementType + } + if gc.RegistrationStatus != nil { + objectMap["registrationStatus"] = gc.RegistrationStatus + } + if gc.HealthStatus != nil { + objectMap["healthStatus"] = gc.HealthStatus + } + if gc.ContainerType != "" { + objectMap["containerType"] = gc.ContainerType } return json.Marshal(objectMap) } -// AsOperationStatusJobExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. -func (osei OperationStatusExtendedInfo) AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) { +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { return nil, false } -// AsOperationStatusJobsExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. -func (osei OperationStatusExtendedInfo) AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) { +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { return nil, false } -// AsOperationStatusProvisionILRExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. -func (osei OperationStatusExtendedInfo) AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) { +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { return nil, false } -// AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. -func (osei OperationStatusExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) { - return &osei, true -} - -// AsBasicOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. -func (osei OperationStatusExtendedInfo) AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) { - return &osei, true -} - -// OperationStatusJobExtendedInfo operation status job extended info. -type OperationStatusJobExtendedInfo struct { - // JobID - ID of the job created for this protected item. - JobID *string `json:"jobId,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeOperationStatusExtendedInfo', 'ObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeOperationStatusProvisionILRExtendedInfo' - ObjectType ObjectTypeBasicOperationStatusExtendedInfo `json:"objectType,omitempty"` +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for OperationStatusJobExtendedInfo. -func (osjei OperationStatusJobExtendedInfo) MarshalJSON() ([]byte, error) { - osjei.ObjectType = ObjectTypeOperationStatusJobExtendedInfo - objectMap := make(map[string]interface{}) - if osjei.JobID != nil { - objectMap["jobId"] = osjei.JobID - } - if osjei.ObjectType != "" { - objectMap["objectType"] = osjei.ObjectType - } - return json.Marshal(objectMap) +// AsAzureSQLContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return nil, false } -// AsOperationStatusJobExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. -func (osjei OperationStatusJobExtendedInfo) AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) { - return &osjei, true +// AsAzureStorageContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return nil, false } -// AsOperationStatusJobsExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. -func (osjei OperationStatusJobExtendedInfo) AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) { +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { return nil, false } -// AsOperationStatusProvisionILRExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. -func (osjei OperationStatusJobExtendedInfo) AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) { +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { return nil, false } -// AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. -func (osjei OperationStatusJobExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) { +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { return nil, false } -// AsBasicOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. -func (osjei OperationStatusJobExtendedInfo) AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) { - return &osjei, true +// AsDpmContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsDpmContainer() (*DpmContainer, bool) { + return nil, false } -// OperationStatusJobsExtendedInfo operation status extended info for list of jobs. -type OperationStatusJobsExtendedInfo struct { - // JobIds - IDs of the jobs created for the protected item. - JobIds *[]string `json:"jobIds,omitempty"` - // FailedJobsError - Stores all the failed jobs along with the corresponding error codes. - FailedJobsError map[string]*string `json:"failedJobsError"` - // ObjectType - Possible values include: 'ObjectTypeOperationStatusExtendedInfo', 'ObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeOperationStatusProvisionILRExtendedInfo' - ObjectType ObjectTypeBasicOperationStatusExtendedInfo `json:"objectType,omitempty"` +// AsBasicDpmContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for OperationStatusJobsExtendedInfo. -func (osjei OperationStatusJobsExtendedInfo) MarshalJSON() ([]byte, error) { - osjei.ObjectType = ObjectTypeOperationStatusJobsExtendedInfo - objectMap := make(map[string]interface{}) - if osjei.JobIds != nil { - objectMap["jobIds"] = osjei.JobIds - } - if osjei.FailedJobsError != nil { - objectMap["failedJobsError"] = osjei.FailedJobsError - } - if osjei.ObjectType != "" { - objectMap["objectType"] = osjei.ObjectType - } - return json.Marshal(objectMap) +// AsGenericContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsGenericContainer() (*GenericContainer, bool) { + return &gc, true } -// AsOperationStatusJobExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. -func (osjei OperationStatusJobsExtendedInfo) AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) { +// AsIaaSVMContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { return nil, false } -// AsOperationStatusJobsExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. -func (osjei OperationStatusJobsExtendedInfo) AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) { - return &osjei, true +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return nil, false } -// AsOperationStatusProvisionILRExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. -func (osjei OperationStatusJobsExtendedInfo) AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) { +// AsMabContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsMabContainer() (*MabContainer, bool) { return nil, false } -// AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. -func (osjei OperationStatusJobsExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) { +// AsProtectionContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsProtectionContainer() (*ProtectionContainer, bool) { return nil, false } -// AsBasicOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. -func (osjei OperationStatusJobsExtendedInfo) AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) { - return &osjei, true +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &gc, true } -// OperationStatusProvisionILRExtendedInfo operation status extended info for ILR provision action. -type OperationStatusProvisionILRExtendedInfo struct { - // RecoveryTarget - Target details for file / folder restore. - RecoveryTarget *InstantItemRecoveryTarget `json:"recoveryTarget,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeOperationStatusExtendedInfo', 'ObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeOperationStatusProvisionILRExtendedInfo' - ObjectType ObjectTypeBasicOperationStatusExtendedInfo `json:"objectType,omitempty"` +// GenericContainerExtendedInfo container extended information +type GenericContainerExtendedInfo struct { + // RawCertData - Public key of container cert + RawCertData *string `json:"rawCertData,omitempty"` + // ContainerIdentityInfo - Container identity information + ContainerIdentityInfo *ContainerIdentityInfo `json:"containerIdentityInfo,omitempty"` + // ServiceEndpoints - Azure Backup Service Endpoints for the container + ServiceEndpoints map[string]*string `json:"serviceEndpoints"` } -// MarshalJSON is the custom marshaler for OperationStatusProvisionILRExtendedInfo. -func (ospiei OperationStatusProvisionILRExtendedInfo) MarshalJSON() ([]byte, error) { - ospiei.ObjectType = ObjectTypeOperationStatusProvisionILRExtendedInfo +// MarshalJSON is the custom marshaler for GenericContainerExtendedInfo. +func (gcei GenericContainerExtendedInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if ospiei.RecoveryTarget != nil { - objectMap["recoveryTarget"] = ospiei.RecoveryTarget + if gcei.RawCertData != nil { + objectMap["rawCertData"] = gcei.RawCertData } - if ospiei.ObjectType != "" { - objectMap["objectType"] = ospiei.ObjectType + if gcei.ContainerIdentityInfo != nil { + objectMap["containerIdentityInfo"] = gcei.ContainerIdentityInfo + } + if gcei.ServiceEndpoints != nil { + objectMap["serviceEndpoints"] = gcei.ServiceEndpoints } return json.Marshal(objectMap) } -// AsOperationStatusJobExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. -func (ospiei OperationStatusProvisionILRExtendedInfo) AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) { - return nil, false +// IaasVMBackupRequest iaaS VM workload-specific backup request. +type IaasVMBackupRequest struct { + // RecoveryPointExpiryTimeInUTC - Backup copy will expire after the time specified (UTC). + RecoveryPointExpiryTimeInUTC *date.Time `json:"recoveryPointExpiryTimeInUTC,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeBackupRequest', 'ObjectTypeAzureFileShareBackupRequest', 'ObjectTypeAzureWorkloadBackupRequest', 'ObjectTypeIaasVMBackupRequest' + ObjectType ObjectType `json:"objectType,omitempty"` } -// AsOperationStatusJobsExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. -func (ospiei OperationStatusProvisionILRExtendedInfo) AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) { - return nil, false +// MarshalJSON is the custom marshaler for IaasVMBackupRequest. +func (ivbr IaasVMBackupRequest) MarshalJSON() ([]byte, error) { + ivbr.ObjectType = ObjectTypeIaasVMBackupRequest + objectMap := make(map[string]interface{}) + if ivbr.RecoveryPointExpiryTimeInUTC != nil { + objectMap["recoveryPointExpiryTimeInUTC"] = ivbr.RecoveryPointExpiryTimeInUTC + } + if ivbr.ObjectType != "" { + objectMap["objectType"] = ivbr.ObjectType + } + return json.Marshal(objectMap) } -// AsOperationStatusProvisionILRExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. -func (ospiei OperationStatusProvisionILRExtendedInfo) AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) { - return &ospiei, true +// AsAzureFileShareBackupRequest is the BasicRequest implementation for IaasVMBackupRequest. +func (ivbr IaasVMBackupRequest) AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) { + return nil, false } -// AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. -func (ospiei OperationStatusProvisionILRExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) { +// AsAzureWorkloadBackupRequest is the BasicRequest implementation for IaasVMBackupRequest. +func (ivbr IaasVMBackupRequest) AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) { return nil, false } -// AsBasicOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. -func (ospiei OperationStatusProvisionILRExtendedInfo) AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) { - return &ospiei, true +// AsIaasVMBackupRequest is the BasicRequest implementation for IaasVMBackupRequest. +func (ivbr IaasVMBackupRequest) AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) { + return &ivbr, true } -// PointInTimeRange provides details for log ranges -type PointInTimeRange struct { - // StartTime - Start time of the time range for log recovery. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - End time of the time range for log recovery. - EndTime *date.Time `json:"endTime,omitempty"` +// AsRequest is the BasicRequest implementation for IaasVMBackupRequest. +func (ivbr IaasVMBackupRequest) AsRequest() (*Request, bool) { + return nil, false } -// PreBackupValidation pre-backup validation for Azure VM Workload provider. -type PreBackupValidation struct { - // Status - Status of protectable item, i.e. InProgress,Succeeded,Failed. Possible values include: 'InquiryStatusInvalid', 'InquiryStatusSuccess', 'InquiryStatusFailed' - Status InquiryStatus `json:"status,omitempty"` - // Code - Error code of protectable item - Code *string `json:"code,omitempty"` - // Message - Message corresponding to the error code for the protectable item - Message *string `json:"message,omitempty"` +// AsBasicRequest is the BasicRequest implementation for IaasVMBackupRequest. +func (ivbr IaasVMBackupRequest) AsBasicRequest() (BasicRequest, bool) { + return &ivbr, true } -// BasicProtectableContainer protectable Container Class. -type BasicProtectableContainer interface { - AsAzureStorageProtectableContainer() (*AzureStorageProtectableContainer, bool) - AsAzureVMAppContainerProtectableContainer() (*AzureVMAppContainerProtectableContainer, bool) - AsProtectableContainer() (*ProtectableContainer, bool) +// BasicIaaSVMContainer iaaS VM workload-specific container. +type BasicIaaSVMContainer interface { + AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) + AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) + AsIaaSVMContainer() (*IaaSVMContainer, bool) } -// ProtectableContainer protectable Container Class. -type ProtectableContainer struct { +// IaaSVMContainer iaaS VM workload-specific container. +type IaaSVMContainer struct { + // VirtualMachineID - Fully qualified ARM url of the virtual machine represented by this Azure IaaS VM container. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // VirtualMachineVersion - Specifies whether the container represents a Classic or an Azure Resource Manager VM. + VirtualMachineVersion *string `json:"virtualMachineVersion,omitempty"` + // ResourceGroup - Resource group name of Recovery Services Vault. + ResourceGroup *string `json:"resourceGroup,omitempty"` // FriendlyName - Friendly name of the container. FriendlyName *string `json:"friendlyName,omitempty"` // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` // HealthStatus - Status of health of the container. HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerID - Fabric Id of the container such as ARM Id. - ContainerID *string `json:"containerId,omitempty"` - // ProtectableContainerType - Possible values include: 'ProtectableContainerTypeProtectableContainer', 'ProtectableContainerTypeStorageContainer', 'ProtectableContainerTypeVMAppContainer' - ProtectableContainerType ProtectableContainerType `json:"protectableContainerType,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` } -func unmarshalBasicProtectableContainer(body []byte) (BasicProtectableContainer, error) { +func unmarshalBasicIaaSVMContainer(body []byte) (BasicIaaSVMContainer, error) { var m map[string]interface{} err := json.Unmarshal(body, &m) if err != nil { return nil, err } - switch m["protectableContainerType"] { - case string(ProtectableContainerTypeStorageContainer): - var aspc AzureStorageProtectableContainer - err := json.Unmarshal(body, &aspc) - return aspc, err - case string(ProtectableContainerTypeVMAppContainer): - var avacpc AzureVMAppContainerProtectableContainer - err := json.Unmarshal(body, &avacpc) - return avacpc, err + switch m["containerType"] { + case string(ContainerTypeMicrosoftClassicComputevirtualMachines): + var aisccvc AzureIaaSClassicComputeVMContainer + err := json.Unmarshal(body, &aisccvc) + return aisccvc, err + case string(ContainerTypeMicrosoftComputevirtualMachines): + var aiscvc AzureIaaSComputeVMContainer + err := json.Unmarshal(body, &aiscvc) + return aiscvc, err default: - var pc ProtectableContainer - err := json.Unmarshal(body, &pc) - return pc, err + var isc IaaSVMContainer + err := json.Unmarshal(body, &isc) + return isc, err } } -func unmarshalBasicProtectableContainerArray(body []byte) ([]BasicProtectableContainer, error) { +func unmarshalBasicIaaSVMContainerArray(body []byte) ([]BasicIaaSVMContainer, error) { var rawMessages []*json.RawMessage err := json.Unmarshal(body, &rawMessages) if err != nil { return nil, err } - pcArray := make([]BasicProtectableContainer, len(rawMessages)) + iscArray := make([]BasicIaaSVMContainer, len(rawMessages)) for index, rawMessage := range rawMessages { - pc, err := unmarshalBasicProtectableContainer(*rawMessage) + isc, err := unmarshalBasicIaaSVMContainer(*rawMessage) if err != nil { return nil, err } - pcArray[index] = pc + iscArray[index] = isc } - return pcArray, nil + return iscArray, nil } -// MarshalJSON is the custom marshaler for ProtectableContainer. -func (pc ProtectableContainer) MarshalJSON() ([]byte, error) { - pc.ProtectableContainerType = ProtectableContainerTypeProtectableContainer +// MarshalJSON is the custom marshaler for IaaSVMContainer. +func (isc IaaSVMContainer) MarshalJSON() ([]byte, error) { + isc.ContainerType = ContainerTypeIaaSVMContainer objectMap := make(map[string]interface{}) - if pc.FriendlyName != nil { - objectMap["friendlyName"] = pc.FriendlyName + if isc.VirtualMachineID != nil { + objectMap["virtualMachineId"] = isc.VirtualMachineID } - if pc.BackupManagementType != "" { - objectMap["backupManagementType"] = pc.BackupManagementType + if isc.VirtualMachineVersion != nil { + objectMap["virtualMachineVersion"] = isc.VirtualMachineVersion } - if pc.HealthStatus != nil { - objectMap["healthStatus"] = pc.HealthStatus + if isc.ResourceGroup != nil { + objectMap["resourceGroup"] = isc.ResourceGroup } - if pc.ContainerID != nil { - objectMap["containerId"] = pc.ContainerID + if isc.FriendlyName != nil { + objectMap["friendlyName"] = isc.FriendlyName } - if pc.ProtectableContainerType != "" { - objectMap["protectableContainerType"] = pc.ProtectableContainerType + if isc.BackupManagementType != "" { + objectMap["backupManagementType"] = isc.BackupManagementType + } + if isc.RegistrationStatus != nil { + objectMap["registrationStatus"] = isc.RegistrationStatus + } + if isc.HealthStatus != nil { + objectMap["healthStatus"] = isc.HealthStatus + } + if isc.ContainerType != "" { + objectMap["containerType"] = isc.ContainerType } return json.Marshal(objectMap) } -// AsAzureStorageProtectableContainer is the BasicProtectableContainer implementation for ProtectableContainer. -func (pc ProtectableContainer) AsAzureStorageProtectableContainer() (*AzureStorageProtectableContainer, bool) { +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { return nil, false } -// AsAzureVMAppContainerProtectableContainer is the BasicProtectableContainer implementation for ProtectableContainer. -func (pc ProtectableContainer) AsAzureVMAppContainerProtectableContainer() (*AzureVMAppContainerProtectableContainer, bool) { +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { return nil, false } -// AsProtectableContainer is the BasicProtectableContainer implementation for ProtectableContainer. -func (pc ProtectableContainer) AsProtectableContainer() (*ProtectableContainer, bool) { - return &pc, true -} - -// AsBasicProtectableContainer is the BasicProtectableContainer implementation for ProtectableContainer. -func (pc ProtectableContainer) AsBasicProtectableContainer() (BasicProtectableContainer, bool) { - return &pc, true -} - -// ProtectableContainerResource protectable Container Class. -type ProtectableContainerResource struct { - // Properties - ProtectableContainerResource properties - Properties BasicProtectableContainer `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for ProtectableContainerResource. -func (pcr ProtectableContainerResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = pcr.Properties - if pcr.Location != nil { - objectMap["location"] = pcr.Location - } - if pcr.Tags != nil { - objectMap["tags"] = pcr.Tags - } - if pcr.ETag != nil { - objectMap["eTag"] = pcr.ETag - } - return json.Marshal(objectMap) +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { + return nil, false } -// UnmarshalJSON is the custom unmarshaler for ProtectableContainerResource struct. -func (pcr *ProtectableContainerResource) UnmarshalJSON(body []byte) error { - var m map[string]*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 := unmarshalBasicProtectableContainer(*v) - if err != nil { - return err - } - pcr.Properties = properties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - pcr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - pcr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - pcr.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - pcr.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - pcr.Tags = tags - } - case "eTag": - if v != nil { - var eTag string - err = json.Unmarshal(*v, &eTag) - if err != nil { - return err - } - pcr.ETag = &eTag - } - } - } +// AsAzureSQLContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return nil, false +} - return nil +// AsAzureStorageContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return nil, false } -// ProtectableContainerResourceList list of ProtectableContainer resources -type ProtectableContainerResourceList struct { - autorest.Response `json:"-"` - // Value - List of resources. - Value *[]ProtectableContainerResource `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. - NextLink *string `json:"nextLink,omitempty"` +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { + return nil, false } -// ProtectableContainerResourceListIterator provides access to a complete listing of -// ProtectableContainerResource values. -type ProtectableContainerResourceListIterator struct { - i int - page ProtectableContainerResourceListPage +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { + return nil, false } -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ProtectableContainerResourceListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectableContainerResourceListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return nil, false } -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ProtectableContainerResourceListIterator) Next() error { - return iter.NextWithContext(context.Background()) +// AsDpmContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsDpmContainer() (*DpmContainer, bool) { + return nil, false } -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ProtectableContainerResourceListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) +// AsBasicDpmContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { + return nil, false } -// Response returns the raw server response from the last page request. -func (iter ProtectableContainerResourceListIterator) Response() ProtectableContainerResourceList { - return iter.page.Response() +// AsGenericContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsGenericContainer() (*GenericContainer, 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 ProtectableContainerResourceListIterator) Value() ProtectableContainerResource { - if !iter.page.NotDone() { - return ProtectableContainerResource{} - } - return iter.page.Values()[iter.i] +// AsIaaSVMContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { + return &isc, true } -// Creates a new instance of the ProtectableContainerResourceListIterator type. -func NewProtectableContainerResourceListIterator(page ProtectableContainerResourceListPage) ProtectableContainerResourceListIterator { - return ProtectableContainerResourceListIterator{page: page} +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return &isc, true } -// IsEmpty returns true if the ListResult contains no values. -func (pcrl ProtectableContainerResourceList) IsEmpty() bool { - return pcrl.Value == nil || len(*pcrl.Value) == 0 +// AsMabContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsMabContainer() (*MabContainer, bool) { + return nil, false } -// protectableContainerResourceListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (pcrl ProtectableContainerResourceList) protectableContainerResourceListPreparer(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))) +// AsProtectionContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return nil, false } -// ProtectableContainerResourceListPage contains a page of ProtectableContainerResource values. -type ProtectableContainerResourceListPage struct { - fn func(context.Context, ProtectableContainerResourceList) (ProtectableContainerResourceList, error) - pcrl ProtectableContainerResourceList +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &isc, true } -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ProtectableContainerResourceListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectableContainerResourceListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() +// IaasVMILRRegistrationRequest restore files/folders from a backup copy of IaaS VM. +type IaasVMILRRegistrationRequest struct { + // RecoveryPointID - ID of the IaaS VM backup copy from where the files/folders have to be restored. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` + // VirtualMachineID - Fully qualified ARM ID of the virtual machine whose the files / folders have to be restored. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // InitiatorName - iSCSI initiator name. + InitiatorName *string `json:"initiatorName,omitempty"` + // RenewExistingRegistration - Whether to renew existing registration with the iSCSI server. + RenewExistingRegistration *bool `json:"renewExistingRegistration,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeILRRequest', 'ObjectTypeAzureFileShareProvisionILRRequest', 'ObjectTypeIaasVMILRRegistrationRequest' + ObjectType ObjectTypeBasicILRRequest `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for IaasVMILRRegistrationRequest. +func (ivrr IaasVMILRRegistrationRequest) MarshalJSON() ([]byte, error) { + ivrr.ObjectType = ObjectTypeIaasVMILRRegistrationRequest + objectMap := make(map[string]interface{}) + if ivrr.RecoveryPointID != nil { + objectMap["recoveryPointId"] = ivrr.RecoveryPointID } - next, err := page.fn(ctx, page.pcrl) - if err != nil { - return err + if ivrr.VirtualMachineID != nil { + objectMap["virtualMachineId"] = ivrr.VirtualMachineID } - page.pcrl = next - return nil + if ivrr.InitiatorName != nil { + objectMap["initiatorName"] = ivrr.InitiatorName + } + if ivrr.RenewExistingRegistration != nil { + objectMap["renewExistingRegistration"] = ivrr.RenewExistingRegistration + } + if ivrr.ObjectType != "" { + objectMap["objectType"] = ivrr.ObjectType + } + return json.Marshal(objectMap) } -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ProtectableContainerResourceListPage) Next() error { - return page.NextWithContext(context.Background()) +// AsAzureFileShareProvisionILRRequest is the BasicILRRequest implementation for IaasVMILRRegistrationRequest. +func (ivrr IaasVMILRRegistrationRequest) AsAzureFileShareProvisionILRRequest() (*AzureFileShareProvisionILRRequest, bool) { + return nil, false } -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ProtectableContainerResourceListPage) NotDone() bool { - return !page.pcrl.IsEmpty() +// AsIaasVMILRRegistrationRequest is the BasicILRRequest implementation for IaasVMILRRegistrationRequest. +func (ivrr IaasVMILRRegistrationRequest) AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) { + return &ivrr, true } -// Response returns the raw server response from the last page request. -func (page ProtectableContainerResourceListPage) Response() ProtectableContainerResourceList { - return page.pcrl +// AsILRRequest is the BasicILRRequest implementation for IaasVMILRRegistrationRequest. +func (ivrr IaasVMILRRegistrationRequest) AsILRRequest() (*ILRRequest, bool) { + return nil, false } -// Values returns the slice of values for the current page or nil if there are no values. -func (page ProtectableContainerResourceListPage) Values() []ProtectableContainerResource { - if page.pcrl.IsEmpty() { - return nil - } - return *page.pcrl.Value +// AsBasicILRRequest is the BasicILRRequest implementation for IaasVMILRRegistrationRequest. +func (ivrr IaasVMILRRegistrationRequest) AsBasicILRRequest() (BasicILRRequest, bool) { + return &ivrr, true } -// Creates a new instance of the ProtectableContainerResourceListPage type. -func NewProtectableContainerResourceListPage(getNextPage func(context.Context, ProtectableContainerResourceList) (ProtectableContainerResourceList, error)) ProtectableContainerResourceListPage { - return ProtectableContainerResourceListPage{fn: getNextPage} +// BasicIaaSVMProtectableItem iaaS VM workload-specific backup item. +type BasicIaaSVMProtectableItem interface { + AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) + AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) + AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) } -// BasicProtectedItem base class for backup items. -type BasicProtectedItem interface { - AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) - AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) - AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) - AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) - AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) - AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) - AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) - AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) - AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) - AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) - AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) - AsDPMProtectedItem() (*DPMProtectedItem, bool) - AsGenericProtectedItem() (*GenericProtectedItem, bool) - AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) - AsProtectedItem() (*ProtectedItem, bool) -} - -// ProtectedItem base class for backup items. -type ProtectedItem struct { - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - WorkloadType DataSourceType `json:"workloadType,omitempty"` - // ContainerName - Unique name of container - ContainerName *string `json:"containerName,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. - LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` - // BackupSetName - Name of the backup set the backup item belongs to - BackupSetName *string `json:"backupSetName,omitempty"` - // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' - CreateMode CreateMode `json:"createMode,omitempty"` - // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC - DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` - // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state - IsRehydrate *bool `json:"isRehydrate,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' - ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` -} - -func unmarshalBasicProtectedItem(body []byte) (BasicProtectedItem, error) { +// IaaSVMProtectableItem iaaS VM workload-specific backup item. +type IaaSVMProtectableItem struct { + // VirtualMachineID - Fully qualified ARM ID of the virtual machine. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +} + +func unmarshalBasicIaaSVMProtectableItem(body []byte) (BasicIaaSVMProtectableItem, error) { var m map[string]interface{} err := json.Unmarshal(body, &m) if err != nil { return nil, err } - switch m["protectedItemType"] { - case string(ProtectedItemTypeAzureFileShareProtectedItem): - var afpi AzureFileshareProtectedItem - err := json.Unmarshal(body, &afpi) - return afpi, err - case string(ProtectedItemTypeMicrosoftClassicComputevirtualMachines): - var aisccvpi AzureIaaSClassicComputeVMProtectedItem + switch m["protectableItemType"] { + case string(ProtectableItemTypeMicrosoftClassicComputevirtualMachines): + var aisccvpi AzureIaaSClassicComputeVMProtectableItem err := json.Unmarshal(body, &aisccvpi) return aisccvpi, err - case string(ProtectedItemTypeMicrosoftComputevirtualMachines): - var aiscvpi AzureIaaSComputeVMProtectedItem + case string(ProtectableItemTypeMicrosoftComputevirtualMachines): + var aiscvpi AzureIaaSComputeVMProtectableItem err := json.Unmarshal(body, &aiscvpi) return aiscvpi, err - case string(ProtectedItemTypeAzureIaaSVMProtectedItem): - var aispi AzureIaaSVMProtectedItem - err := json.Unmarshal(body, &aispi) - return aispi, err - case string(ProtectedItemTypeMicrosoftSqlserversdatabases): - var aspi AzureSQLProtectedItem - err := json.Unmarshal(body, &aspi) - return aspi, err - case string(ProtectedItemTypeAzureVMWorkloadProtectedItem): - var avwpi AzureVMWorkloadProtectedItem - err := json.Unmarshal(body, &avwpi) - return avwpi, err - case string(ProtectedItemTypeAzureVMWorkloadSAPAseDatabase): - var avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem - err := json.Unmarshal(body, &avwsadpi) - return avwsadpi, err - case string(ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase): - var avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem - err := json.Unmarshal(body, &avwshdpi) - return avwshdpi, err - case string(ProtectedItemTypeAzureVMWorkloadSQLDatabase): - var avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem - err := json.Unmarshal(body, &avwsdpi) - return avwsdpi, err - case string(ProtectedItemTypeDPMProtectedItem): - var dpi DPMProtectedItem - err := json.Unmarshal(body, &dpi) - return dpi, err - case string(ProtectedItemTypeGenericProtectedItem): - var gpi GenericProtectedItem - err := json.Unmarshal(body, &gpi) - return gpi, err - case string(ProtectedItemTypeMabFileFolderProtectedItem): - var mffpi MabFileFolderProtectedItem - err := json.Unmarshal(body, &mffpi) - return mffpi, err default: - var pi ProtectedItem - err := json.Unmarshal(body, &pi) - return pi, err + var ispi IaaSVMProtectableItem + err := json.Unmarshal(body, &ispi) + return ispi, err } } -func unmarshalBasicProtectedItemArray(body []byte) ([]BasicProtectedItem, error) { +func unmarshalBasicIaaSVMProtectableItemArray(body []byte) ([]BasicIaaSVMProtectableItem, error) { var rawMessages []*json.RawMessage err := json.Unmarshal(body, &rawMessages) if err != nil { return nil, err } - piArray := make([]BasicProtectedItem, len(rawMessages)) + ispiArray := make([]BasicIaaSVMProtectableItem, len(rawMessages)) for index, rawMessage := range rawMessages { - pi, err := unmarshalBasicProtectedItem(*rawMessage) + ispi, err := unmarshalBasicIaaSVMProtectableItem(*rawMessage) if err != nil { return nil, err } - piArray[index] = pi + ispiArray[index] = ispi } - return piArray, nil + return ispiArray, nil } -// MarshalJSON is the custom marshaler for ProtectedItem. -func (pi ProtectedItem) MarshalJSON() ([]byte, error) { - pi.ProtectedItemType = ProtectedItemTypeProtectedItem +// MarshalJSON is the custom marshaler for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) MarshalJSON() ([]byte, error) { + ispi.ProtectableItemType = ProtectableItemTypeIaaSVMProtectableItem objectMap := make(map[string]interface{}) - if pi.BackupManagementType != "" { - objectMap["backupManagementType"] = pi.BackupManagementType - } - if pi.WorkloadType != "" { - objectMap["workloadType"] = pi.WorkloadType - } - if pi.ContainerName != nil { - objectMap["containerName"] = pi.ContainerName - } - if pi.SourceResourceID != nil { - objectMap["sourceResourceId"] = pi.SourceResourceID - } - if pi.PolicyID != nil { - objectMap["policyId"] = pi.PolicyID - } - if pi.LastRecoveryPoint != nil { - objectMap["lastRecoveryPoint"] = pi.LastRecoveryPoint - } - if pi.BackupSetName != nil { - objectMap["backupSetName"] = pi.BackupSetName - } - if pi.CreateMode != "" { - objectMap["createMode"] = pi.CreateMode - } - if pi.DeferredDeleteTimeInUTC != nil { - objectMap["deferredDeleteTimeInUTC"] = pi.DeferredDeleteTimeInUTC + if ispi.VirtualMachineID != nil { + objectMap["virtualMachineId"] = ispi.VirtualMachineID } - if pi.IsScheduledForDeferredDelete != nil { - objectMap["isScheduledForDeferredDelete"] = pi.IsScheduledForDeferredDelete + if ispi.BackupManagementType != nil { + objectMap["backupManagementType"] = ispi.BackupManagementType } - if pi.DeferredDeleteTimeRemaining != nil { - objectMap["deferredDeleteTimeRemaining"] = pi.DeferredDeleteTimeRemaining + if ispi.WorkloadType != nil { + objectMap["workloadType"] = ispi.WorkloadType } - if pi.IsDeferredDeleteScheduleUpcoming != nil { - objectMap["isDeferredDeleteScheduleUpcoming"] = pi.IsDeferredDeleteScheduleUpcoming + if ispi.FriendlyName != nil { + objectMap["friendlyName"] = ispi.FriendlyName } - if pi.IsRehydrate != nil { - objectMap["isRehydrate"] = pi.IsRehydrate + if ispi.ProtectionState != "" { + objectMap["protectionState"] = ispi.ProtectionState } - if pi.ProtectedItemType != "" { - objectMap["protectedItemType"] = pi.ProtectedItemType + if ispi.ProtectableItemType != "" { + objectMap["protectableItemType"] = ispi.ProtectableItemType } return json.Marshal(objectMap) } -// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { return nil, false } -// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { return nil, false } -// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { return nil, false } -// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { return nil, false } -// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { return nil, false } -// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { +// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { return nil, false } -// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { return nil, false } -// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { return nil, false } -// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { return nil, false } -// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { return nil, false } -// AsDPMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { + return &ispi, true +} + +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { + return &ispi, true +} + +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { return nil, false } -// AsGenericProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &ispi, true +} + +// BasicILRRequest parameters to Provision ILR API. +type BasicILRRequest interface { + AsAzureFileShareProvisionILRRequest() (*AzureFileShareProvisionILRRequest, bool) + AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) + AsILRRequest() (*ILRRequest, bool) +} + +// ILRRequest parameters to Provision ILR API. +type ILRRequest struct { + // ObjectType - Possible values include: 'ObjectTypeILRRequest', 'ObjectTypeAzureFileShareProvisionILRRequest', 'ObjectTypeIaasVMILRRegistrationRequest' + ObjectType ObjectTypeBasicILRRequest `json:"objectType,omitempty"` +} + +func unmarshalBasicILRRequest(body []byte) (BasicILRRequest, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeAzureFileShareProvisionILRRequest): + var afspir AzureFileShareProvisionILRRequest + err := json.Unmarshal(body, &afspir) + return afspir, err + case string(ObjectTypeIaasVMILRRegistrationRequest): + var ivrr IaasVMILRRegistrationRequest + err := json.Unmarshal(body, &ivrr) + return ivrr, err + default: + var ir ILRRequest + err := json.Unmarshal(body, &ir) + return ir, err + } +} +func unmarshalBasicILRRequestArray(body []byte) ([]BasicILRRequest, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + irArray := make([]BasicILRRequest, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ir, err := unmarshalBasicILRRequest(*rawMessage) + if err != nil { + return nil, err + } + irArray[index] = ir + } + return irArray, nil +} + +// MarshalJSON is the custom marshaler for ILRRequest. +func (ir ILRRequest) MarshalJSON() ([]byte, error) { + ir.ObjectType = ObjectTypeILRRequest + objectMap := make(map[string]interface{}) + if ir.ObjectType != "" { + objectMap["objectType"] = ir.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProvisionILRRequest is the BasicILRRequest implementation for ILRRequest. +func (ir ILRRequest) AsAzureFileShareProvisionILRRequest() (*AzureFileShareProvisionILRRequest, bool) { return nil, false } -// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { +// AsIaasVMILRRegistrationRequest is the BasicILRRequest implementation for ILRRequest. +func (ir ILRRequest) AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) { return nil, false } -// AsProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { - return &pi, true +// AsILRRequest is the BasicILRRequest implementation for ILRRequest. +func (ir ILRRequest) AsILRRequest() (*ILRRequest, bool) { + return &ir, true } -// AsBasicProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { - return &pi, true +// AsBasicILRRequest is the BasicILRRequest implementation for ILRRequest. +func (ir ILRRequest) AsBasicILRRequest() (BasicILRRequest, bool) { + return &ir, true } -// ProtectedItemResource base class for backup items. -type ProtectedItemResource struct { - autorest.Response `json:"-"` - // Properties - ProtectedItemResource properties - Properties BasicProtectedItem `json:"properties,omitempty"` +// ILRRequestResource parameters to Provision ILR API. +type ILRRequestResource struct { + // Properties - ILRRequestResource properties + Properties BasicILRRequest `json:"properties,omitempty"` // ID - READ-ONLY; Resource Id represents the complete path to the resource. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name associated with the resource. @@ -13935,24 +6035,24 @@ type ProtectedItemResource struct { ETag *string `json:"eTag,omitempty"` } -// MarshalJSON is the custom marshaler for ProtectedItemResource. -func (pir ProtectedItemResource) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ILRRequestResource. +func (irr ILRRequestResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - objectMap["properties"] = pir.Properties - if pir.Location != nil { - objectMap["location"] = pir.Location + objectMap["properties"] = irr.Properties + if irr.Location != nil { + objectMap["location"] = irr.Location } - if pir.Tags != nil { - objectMap["tags"] = pir.Tags + if irr.Tags != nil { + objectMap["tags"] = irr.Tags } - if pir.ETag != nil { - objectMap["eTag"] = pir.ETag + if irr.ETag != nil { + objectMap["eTag"] = irr.ETag } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ProtectedItemResource struct. -func (pir *ProtectedItemResource) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ILRRequestResource struct. +func (irr *ILRRequestResource) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -13962,11 +6062,11 @@ func (pir *ProtectedItemResource) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - properties, err := unmarshalBasicProtectedItem(*v) + properties, err := unmarshalBasicILRRequest(*v) if err != nil { return err } - pir.Properties = properties + irr.Properties = properties } case "id": if v != nil { @@ -13975,7 +6075,7 @@ func (pir *ProtectedItemResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - pir.ID = &ID + irr.ID = &ID } case "name": if v != nil { @@ -13984,7 +6084,7 @@ func (pir *ProtectedItemResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - pir.Name = &name + irr.Name = &name } case "type": if v != nil { @@ -13993,7 +6093,7 @@ func (pir *ProtectedItemResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - pir.Type = &typeVar + irr.Type = &typeVar } case "location": if v != nil { @@ -14002,7 +6102,7 @@ func (pir *ProtectedItemResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - pir.Location = &location + irr.Location = &location } case "tags": if v != nil { @@ -14011,7 +6111,7 @@ func (pir *ProtectedItemResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - pir.Tags = tags + irr.Tags = tags } case "eTag": if v != nil { @@ -14020,7 +6120,7 @@ func (pir *ProtectedItemResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - pir.ETag = &eTag + irr.ETag = &eTag } } } @@ -14028,268 +6128,237 @@ func (pir *ProtectedItemResource) UnmarshalJSON(body []byte) error { return nil } -// BasicProtectionContainer base class for container with backup items. Containers with specific workloads are derived -// from this class. -type BasicProtectionContainer interface { - AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) - AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) - AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) - AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) - AsAzureSQLContainer() (*AzureSQLContainer, bool) - AsAzureStorageContainer() (*AzureStorageContainer, bool) - AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) - AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) - AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) - AsDpmContainer() (*DpmContainer, bool) - AsBasicDpmContainer() (BasicDpmContainer, bool) - AsGenericContainer() (*GenericContainer, bool) - AsIaaSVMContainer() (*IaaSVMContainer, bool) - AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) - AsMabContainer() (*MabContainer, bool) - AsProtectionContainer() (*ProtectionContainer, bool) -} - -// ProtectionContainer base class for container with backup items. Containers with specific workloads are -// derived from this class. -type ProtectionContainer struct { - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +// InquiryInfo details about inquired protectable items under a given container. +type InquiryInfo struct { + // Status - Inquiry Status for this container such as + // InProgress | Failed | Succeeded + Status *string `json:"status,omitempty"` + // ErrorDetail - Error Details if the Status is non-success. + ErrorDetail *ErrorDetail `json:"errorDetail,omitempty"` + // InquiryDetails - Inquiry Details which will have workload specific details. + // For e.g. - For SQL and oracle this will contain different details. + InquiryDetails *[]WorkloadInquiryDetails `json:"inquiryDetails,omitempty"` } -func unmarshalBasicProtectionContainer(body []byte) (BasicProtectionContainer, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["containerType"] { - case string(ContainerTypeAzureBackupServerContainer1): - var absc AzureBackupServerContainer - err := json.Unmarshal(body, &absc) - return absc, err - case string(ContainerTypeMicrosoftClassicComputevirtualMachines): - var aisccvc AzureIaaSClassicComputeVMContainer - err := json.Unmarshal(body, &aisccvc) - return aisccvc, err - case string(ContainerTypeMicrosoftComputevirtualMachines): - var aiscvc AzureIaaSComputeVMContainer - err := json.Unmarshal(body, &aiscvc) - return aiscvc, err - case string(ContainerTypeSQLAGWorkLoadContainer1): - var aswcpc AzureSQLAGWorkloadContainerProtectionContainer - err := json.Unmarshal(body, &aswcpc) - return aswcpc, err - case string(ContainerTypeAzureSQLContainer1): - var asc AzureSQLContainer - err := json.Unmarshal(body, &asc) - return asc, err - case string(ContainerTypeStorageContainer1): - var asc AzureStorageContainer - err := json.Unmarshal(body, &asc) - return asc, err - case string(ContainerTypeVMAppContainer1): - var avacpc AzureVMAppContainerProtectionContainer - err := json.Unmarshal(body, &avacpc) - return avacpc, err - case string(ContainerTypeAzureWorkloadContainer): - var awc AzureWorkloadContainer - err := json.Unmarshal(body, &awc) - return awc, err - case string(ContainerTypeDPMContainer1): - var dc DpmContainer - err := json.Unmarshal(body, &dc) - return dc, err - case string(ContainerTypeGenericContainer1): - var gc GenericContainer - err := json.Unmarshal(body, &gc) - return gc, err - case string(ContainerTypeIaaSVMContainer): - var isc IaaSVMContainer - err := json.Unmarshal(body, &isc) - return isc, err - case string(ContainerTypeWindows1): - var mc MabContainer - err := json.Unmarshal(body, &mc) - return mc, err - default: - var pc ProtectionContainer - err := json.Unmarshal(body, &pc) - return pc, err - } +// InquiryValidation validation for inquired protectable items under a given container. +type InquiryValidation struct { + // Status - Status for the Inquiry Validation. + Status *string `json:"status,omitempty"` + // ErrorDetail - Error Detail in case the status is non-success. + ErrorDetail *ErrorDetail `json:"errorDetail,omitempty"` + // AdditionalDetail - READ-ONLY; Error Additional Detail in case the status is non-success. + AdditionalDetail *string `json:"additionalDetail,omitempty"` } -func unmarshalBasicProtectionContainerArray(body []byte) ([]BasicProtectionContainer, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - pcArray := make([]BasicProtectionContainer, len(rawMessages)) - - for index, rawMessage := range rawMessages { - pc, err := unmarshalBasicProtectionContainer(*rawMessage) - if err != nil { - return nil, err - } - pcArray[index] = pc - } - return pcArray, nil +// InstantItemRecoveryTarget target details for file / folder restore. +type InstantItemRecoveryTarget struct { + // ClientScripts - List of client scripts. + ClientScripts *[]ClientScriptForConnect `json:"clientScripts,omitempty"` } -// MarshalJSON is the custom marshaler for ProtectionContainer. -func (pc ProtectionContainer) MarshalJSON() ([]byte, error) { - pc.ContainerType = ContainerTypeProtectionContainer +// MabContainer container with items backed up using MAB backup engine. +type MabContainer struct { + // CanReRegister - Can the container be registered one more time. + CanReRegister *bool `json:"canReRegister,omitempty"` + // ContainerID - ContainerID represents the container. + ContainerID *int64 `json:"containerId,omitempty"` + // ProtectedItemCount - Number of items backed up in this container. + ProtectedItemCount *int64 `json:"protectedItemCount,omitempty"` + // AgentVersion - Agent version of this container. + AgentVersion *string `json:"agentVersion,omitempty"` + // ExtendedInfo - Additional information for this container + ExtendedInfo *MabContainerExtendedInfo `json:"extendedInfo,omitempty"` + // MabContainerHealthDetails - Health details on this mab container. + MabContainerHealthDetails *[]MABContainerHealthDetails `json:"mabContainerHealthDetails,omitempty"` + // ContainerHealthState - Health state of mab container. + ContainerHealthState *string `json:"containerHealthState,omitempty"` + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +} + +// MarshalJSON is the custom marshaler for MabContainer. +func (mc MabContainer) MarshalJSON() ([]byte, error) { + mc.ContainerType = ContainerTypeWindows1 objectMap := make(map[string]interface{}) - if pc.FriendlyName != nil { - objectMap["friendlyName"] = pc.FriendlyName + if mc.CanReRegister != nil { + objectMap["canReRegister"] = mc.CanReRegister } - if pc.BackupManagementType != "" { - objectMap["backupManagementType"] = pc.BackupManagementType + if mc.ContainerID != nil { + objectMap["containerId"] = mc.ContainerID } - if pc.RegistrationStatus != nil { - objectMap["registrationStatus"] = pc.RegistrationStatus + if mc.ProtectedItemCount != nil { + objectMap["protectedItemCount"] = mc.ProtectedItemCount } - if pc.HealthStatus != nil { - objectMap["healthStatus"] = pc.HealthStatus + if mc.AgentVersion != nil { + objectMap["agentVersion"] = mc.AgentVersion } - if pc.ContainerType != "" { - objectMap["containerType"] = pc.ContainerType + if mc.ExtendedInfo != nil { + objectMap["extendedInfo"] = mc.ExtendedInfo + } + if mc.MabContainerHealthDetails != nil { + objectMap["mabContainerHealthDetails"] = mc.MabContainerHealthDetails + } + if mc.ContainerHealthState != nil { + objectMap["containerHealthState"] = mc.ContainerHealthState + } + if mc.FriendlyName != nil { + objectMap["friendlyName"] = mc.FriendlyName + } + if mc.BackupManagementType != "" { + objectMap["backupManagementType"] = mc.BackupManagementType + } + if mc.RegistrationStatus != nil { + objectMap["registrationStatus"] = mc.RegistrationStatus + } + if mc.HealthStatus != nil { + objectMap["healthStatus"] = mc.HealthStatus + } + if mc.ContainerType != "" { + objectMap["containerType"] = mc.ContainerType } return json.Marshal(objectMap) } -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { return nil, false } -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { return nil, false } -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { return nil, false } -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { return nil, false } -// AsAzureSQLContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { +// AsAzureSQLContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { return nil, false } -// AsAzureStorageContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { +// AsAzureStorageContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { return nil, false } -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { return nil, false } -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { return nil, false } -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { return nil, false } -// AsDpmContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsDpmContainer() (*DpmContainer, bool) { +// AsDpmContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsDpmContainer() (*DpmContainer, bool) { return nil, false } -// AsBasicDpmContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { +// AsBasicDpmContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { return nil, false } -// AsGenericContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsGenericContainer() (*GenericContainer, bool) { +// AsGenericContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsGenericContainer() (*GenericContainer, bool) { return nil, false } -// AsIaaSVMContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { +// AsIaaSVMContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { return nil, false } -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { return nil, false } -// AsMabContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsMabContainer() (*MabContainer, bool) { +// AsMabContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsMabContainer() (*MabContainer, bool) { + return &mc, true +} + +// AsProtectionContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsProtectionContainer() (*ProtectionContainer, bool) { return nil, false } -// AsProtectionContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsProtectionContainer() (*ProtectionContainer, bool) { - return &pc, true +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &mc, true } -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &pc, true +// MabContainerExtendedInfo additional information of the container. +type MabContainerExtendedInfo struct { + // LastRefreshedAt - Time stamp when this container was refreshed. + LastRefreshedAt *date.Time `json:"lastRefreshedAt,omitempty"` + // BackupItemType - Type of backup items associated with this container. Possible values include: 'ItemTypeInvalid', 'ItemTypeVM', 'ItemTypeFileFolder', 'ItemTypeAzureSQLDb', 'ItemTypeSQLDB', 'ItemTypeExchange', 'ItemTypeSharepoint', 'ItemTypeVMwareVM', 'ItemTypeSystemState', 'ItemTypeClient', 'ItemTypeGenericDataSource', 'ItemTypeSQLDataBase', 'ItemTypeAzureFileShare', 'ItemTypeSAPHanaDatabase', 'ItemTypeSAPAseDatabase' + BackupItemType ItemType `json:"backupItemType,omitempty"` + // BackupItems - List of backup items associated with this container. + BackupItems *[]string `json:"backupItems,omitempty"` + // PolicyName - Backup policy associated with this container. + PolicyName *string `json:"policyName,omitempty"` + // LastBackupStatus - Latest backup status of this container. + LastBackupStatus *string `json:"lastBackupStatus,omitempty"` } -// ProtectionContainerResource base class for container with backup items. Containers with specific -// workloads are derived from this class. -type ProtectionContainerResource struct { +// MABContainerHealthDetails MAB workload-specific Health Details. +type MABContainerHealthDetails struct { + // Code - Health Code + Code *int32 `json:"code,omitempty"` + // Title - Health Title + Title *string `json:"title,omitempty"` + // Message - Health Message + Message *string `json:"message,omitempty"` + // Recommendations - Health Recommended Actions + Recommendations *[]string `json:"recommendations,omitempty"` +} + +// OperationStatus operation status. +type OperationStatus struct { autorest.Response `json:"-"` - // Properties - ProtectionContainerResource properties - Properties BasicProtectionContainer `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. + // ID - ID of the operation. ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. + // Name - Name of the operation. Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for ProtectionContainerResource. -func (pcr ProtectionContainerResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = pcr.Properties - if pcr.Location != nil { - objectMap["location"] = pcr.Location - } - if pcr.Tags != nil { - objectMap["tags"] = pcr.Tags - } - if pcr.ETag != nil { - objectMap["eTag"] = pcr.ETag - } - return json.Marshal(objectMap) + // Status - Operation status. Possible values include: 'OperationStatusValuesInvalid', 'OperationStatusValuesInProgress', 'OperationStatusValuesSucceeded', 'OperationStatusValuesFailed', 'OperationStatusValuesCanceled' + Status OperationStatusValues `json:"status,omitempty"` + // StartTime - Operation start time. Format: ISO-8601. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - Operation end time. Format: ISO-8601. + EndTime *date.Time `json:"endTime,omitempty"` + // Error - Error information related to this operation. + Error *OperationStatusError `json:"error,omitempty"` + // Properties - Additional information associated with this operation. + Properties BasicOperationStatusExtendedInfo `json:"properties,omitempty"` } -// UnmarshalJSON is the custom unmarshaler for ProtectionContainerResource struct. -func (pcr *ProtectionContainerResource) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for OperationStatus struct. +func (osVar *OperationStatus) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -14297,14 +6366,6 @@ func (pcr *ProtectionContainerResource) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "properties": - if v != nil { - properties, err := unmarshalBasicProtectionContainer(*v) - if err != nil { - return err - } - pcr.Properties = properties - } case "id": if v != nil { var ID string @@ -14312,7 +6373,7 @@ func (pcr *ProtectionContainerResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - pcr.ID = &ID + osVar.ID = &ID } case "name": if v != nil { @@ -14321,43 +6382,51 @@ func (pcr *ProtectionContainerResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - pcr.Name = &name + osVar.Name = &name } - case "type": + case "status": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var status OperationStatusValues + err = json.Unmarshal(*v, &status) if err != nil { return err } - pcr.Type = &typeVar + osVar.Status = status } - case "location": + case "startTime": if v != nil { - var location string - err = json.Unmarshal(*v, &location) + var startTime date.Time + err = json.Unmarshal(*v, &startTime) + if err != nil { + return err + } + osVar.StartTime = &startTime + } + case "endTime": + if v != nil { + var endTime date.Time + err = json.Unmarshal(*v, &endTime) if err != nil { return err } - pcr.Location = &location + osVar.EndTime = &endTime } - case "tags": + case "error": if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) + var errorVar OperationStatusError + err = json.Unmarshal(*v, &errorVar) if err != nil { return err } - pcr.Tags = tags + osVar.Error = &errorVar } - case "eTag": + case "properties": if v != nil { - var eTag string - err = json.Unmarshal(*v, &eTag) + properties, err := unmarshalBasicOperationStatusExtendedInfo(*v) if err != nil { return err } - pcr.ETag = &eTag + osVar.Properties = properties } } } @@ -14365,574 +6434,369 @@ func (pcr *ProtectionContainerResource) UnmarshalJSON(body []byte) error { return nil } -// ProtectionContainerResourceList list of ProtectionContainer resources -type ProtectionContainerResourceList struct { - autorest.Response `json:"-"` - // Value - List of resources. - Value *[]ProtectionContainerResource `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. - NextLink *string `json:"nextLink,omitempty"` +// OperationStatusError error information associated with operation status call. +type OperationStatusError struct { + // Code - Error code of the operation failure. + Code *string `json:"code,omitempty"` + // Message - Error message displayed if the operation failure. + Message *string `json:"message,omitempty"` } -// ProtectionContainerResourceListIterator provides access to a complete listing of -// ProtectionContainerResource values. -type ProtectionContainerResourceListIterator struct { - i int - page ProtectionContainerResourceListPage +// BasicOperationStatusExtendedInfo base class for additional information of operation status. +type BasicOperationStatusExtendedInfo interface { + AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) + AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) + AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) + AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) } -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ProtectionContainerResourceListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerResourceListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil +// OperationStatusExtendedInfo base class for additional information of operation status. +type OperationStatusExtendedInfo struct { + // ObjectType - Possible values include: 'ObjectTypeOperationStatusExtendedInfo', 'ObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeOperationStatusProvisionILRExtendedInfo' + ObjectType ObjectTypeBasicOperationStatusExtendedInfo `json:"objectType,omitempty"` } -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ProtectionContainerResourceListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} +func unmarshalBasicOperationStatusExtendedInfo(body []byte) (BasicOperationStatusExtendedInfo, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ProtectionContainerResourceListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) + switch m["objectType"] { + case string(ObjectTypeOperationStatusJobExtendedInfo): + var osjei OperationStatusJobExtendedInfo + err := json.Unmarshal(body, &osjei) + return osjei, err + case string(ObjectTypeOperationStatusJobsExtendedInfo): + var osjei OperationStatusJobsExtendedInfo + err := json.Unmarshal(body, &osjei) + return osjei, err + case string(ObjectTypeOperationStatusProvisionILRExtendedInfo): + var ospiei OperationStatusProvisionILRExtendedInfo + err := json.Unmarshal(body, &ospiei) + return ospiei, err + default: + var osei OperationStatusExtendedInfo + err := json.Unmarshal(body, &osei) + return osei, err + } } +func unmarshalBasicOperationStatusExtendedInfoArray(body []byte) ([]BasicOperationStatusExtendedInfo, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } -// Response returns the raw server response from the last page request. -func (iter ProtectionContainerResourceListIterator) Response() ProtectionContainerResourceList { - return iter.page.Response() -} + oseiArray := make([]BasicOperationStatusExtendedInfo, len(rawMessages)) -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ProtectionContainerResourceListIterator) Value() ProtectionContainerResource { - if !iter.page.NotDone() { - return ProtectionContainerResource{} + for index, rawMessage := range rawMessages { + osei, err := unmarshalBasicOperationStatusExtendedInfo(*rawMessage) + if err != nil { + return nil, err + } + oseiArray[index] = osei } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ProtectionContainerResourceListIterator type. -func NewProtectionContainerResourceListIterator(page ProtectionContainerResourceListPage) ProtectionContainerResourceListIterator { - return ProtectionContainerResourceListIterator{page: page} + return oseiArray, nil } -// IsEmpty returns true if the ListResult contains no values. -func (pcrl ProtectionContainerResourceList) IsEmpty() bool { - return pcrl.Value == nil || len(*pcrl.Value) == 0 +// MarshalJSON is the custom marshaler for OperationStatusExtendedInfo. +func (osei OperationStatusExtendedInfo) MarshalJSON() ([]byte, error) { + osei.ObjectType = ObjectTypeOperationStatusExtendedInfo + objectMap := make(map[string]interface{}) + if osei.ObjectType != "" { + objectMap["objectType"] = osei.ObjectType + } + return json.Marshal(objectMap) } -// protectionContainerResourceListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (pcrl ProtectionContainerResourceList) protectionContainerResourceListPreparer(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))) +// AsOperationStatusJobExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. +func (osei OperationStatusExtendedInfo) AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) { + return nil, false } -// ProtectionContainerResourceListPage contains a page of ProtectionContainerResource values. -type ProtectionContainerResourceListPage struct { - fn func(context.Context, ProtectionContainerResourceList) (ProtectionContainerResourceList, error) - pcrl ProtectionContainerResourceList +// AsOperationStatusJobsExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. +func (osei OperationStatusExtendedInfo) AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) { + return nil, false } -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ProtectionContainerResourceListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerResourceListPage.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 +// AsOperationStatusProvisionILRExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. +func (osei OperationStatusExtendedInfo) AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) { + return nil, false } -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ProtectionContainerResourceListPage) Next() error { - return page.NextWithContext(context.Background()) +// AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. +func (osei OperationStatusExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) { + return &osei, true } -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ProtectionContainerResourceListPage) NotDone() bool { - return !page.pcrl.IsEmpty() +// AsBasicOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. +func (osei OperationStatusExtendedInfo) AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) { + return &osei, true } -// Response returns the raw server response from the last page request. -func (page ProtectionContainerResourceListPage) Response() ProtectionContainerResourceList { - return page.pcrl +// OperationStatusJobExtendedInfo operation status job extended info. +type OperationStatusJobExtendedInfo struct { + // JobID - ID of the job created for this protected item. + JobID *string `json:"jobId,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeOperationStatusExtendedInfo', 'ObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeOperationStatusProvisionILRExtendedInfo' + ObjectType ObjectTypeBasicOperationStatusExtendedInfo `json:"objectType,omitempty"` } -// Values returns the slice of values for the current page or nil if there are no values. -func (page ProtectionContainerResourceListPage) Values() []ProtectionContainerResource { - if page.pcrl.IsEmpty() { - return nil +// MarshalJSON is the custom marshaler for OperationStatusJobExtendedInfo. +func (osjei OperationStatusJobExtendedInfo) MarshalJSON() ([]byte, error) { + osjei.ObjectType = ObjectTypeOperationStatusJobExtendedInfo + objectMap := make(map[string]interface{}) + if osjei.JobID != nil { + objectMap["jobId"] = osjei.JobID } - return *page.pcrl.Value + if osjei.ObjectType != "" { + objectMap["objectType"] = osjei.ObjectType + } + return json.Marshal(objectMap) } -// Creates a new instance of the ProtectionContainerResourceListPage type. -func NewProtectionContainerResourceListPage(getNextPage func(context.Context, ProtectionContainerResourceList) (ProtectionContainerResourceList, error)) ProtectionContainerResourceListPage { - return ProtectionContainerResourceListPage{fn: getNextPage} +// AsOperationStatusJobExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. +func (osjei OperationStatusJobExtendedInfo) AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) { + return &osjei, true } -// BasicProtectionPolicy base class for backup policy. Workload-specific backup policies are derived from this class. -type BasicProtectionPolicy interface { - AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) - AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) - AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) - AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) - AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) - AsMabProtectionPolicy() (*MabProtectionPolicy, bool) - AsProtectionPolicy() (*ProtectionPolicy, bool) +// AsOperationStatusJobsExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. +func (osjei OperationStatusJobExtendedInfo) AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) { + return nil, false } -// ProtectionPolicy base class for backup policy. Workload-specific backup policies are derived from this -// class. -type ProtectionPolicy struct { - // ProtectedItemsCount - Number of items associated with this policy. - ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` - // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' - BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` +// AsOperationStatusProvisionILRExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. +func (osjei OperationStatusJobExtendedInfo) AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) { + return nil, false } -func unmarshalBasicProtectionPolicy(body []byte) (BasicProtectionPolicy, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["backupManagementType"] { - case string(BackupManagementTypeAzureStorage): - var afspp AzureFileShareProtectionPolicy - err := json.Unmarshal(body, &afspp) - return afspp, err - case string(BackupManagementTypeAzureIaasVM): - var aispp AzureIaaSVMProtectionPolicy - err := json.Unmarshal(body, &aispp) - return aispp, err - case string(BackupManagementTypeAzureSQL): - var aspp AzureSQLProtectionPolicy - err := json.Unmarshal(body, &aspp) - return aspp, err - case string(BackupManagementTypeAzureWorkload): - var avwpp AzureVMWorkloadProtectionPolicy - err := json.Unmarshal(body, &avwpp) - return avwpp, err - case string(BackupManagementTypeGenericProtectionPolicy): - var gpp GenericProtectionPolicy - err := json.Unmarshal(body, &gpp) - return gpp, err - case string(BackupManagementTypeMAB): - var mpp MabProtectionPolicy - err := json.Unmarshal(body, &mpp) - return mpp, err - default: - var pp ProtectionPolicy - err := json.Unmarshal(body, &pp) - return pp, err - } -} -func unmarshalBasicProtectionPolicyArray(body []byte) ([]BasicProtectionPolicy, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } +// AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. +func (osjei OperationStatusJobExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) { + return nil, false +} - ppArray := make([]BasicProtectionPolicy, len(rawMessages)) +// AsBasicOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. +func (osjei OperationStatusJobExtendedInfo) AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) { + return &osjei, true +} - for index, rawMessage := range rawMessages { - pp, err := unmarshalBasicProtectionPolicy(*rawMessage) - if err != nil { - return nil, err - } - ppArray[index] = pp - } - return ppArray, nil +// OperationStatusJobsExtendedInfo operation status extended info for list of jobs. +type OperationStatusJobsExtendedInfo struct { + // JobIds - IDs of the jobs created for the protected item. + JobIds *[]string `json:"jobIds,omitempty"` + // FailedJobsError - Stores all the failed jobs along with the corresponding error codes. + FailedJobsError map[string]*string `json:"failedJobsError"` + // ObjectType - Possible values include: 'ObjectTypeOperationStatusExtendedInfo', 'ObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeOperationStatusProvisionILRExtendedInfo' + ObjectType ObjectTypeBasicOperationStatusExtendedInfo `json:"objectType,omitempty"` } -// MarshalJSON is the custom marshaler for ProtectionPolicy. -func (pp ProtectionPolicy) MarshalJSON() ([]byte, error) { - pp.BackupManagementType = BackupManagementTypeProtectionPolicy +// MarshalJSON is the custom marshaler for OperationStatusJobsExtendedInfo. +func (osjei OperationStatusJobsExtendedInfo) MarshalJSON() ([]byte, error) { + osjei.ObjectType = ObjectTypeOperationStatusJobsExtendedInfo objectMap := make(map[string]interface{}) - if pp.ProtectedItemsCount != nil { - objectMap["protectedItemsCount"] = pp.ProtectedItemsCount + if osjei.JobIds != nil { + objectMap["jobIds"] = osjei.JobIds + } + if osjei.FailedJobsError != nil { + objectMap["failedJobsError"] = osjei.FailedJobsError } - if pp.BackupManagementType != "" { - objectMap["backupManagementType"] = pp.BackupManagementType + if osjei.ObjectType != "" { + objectMap["objectType"] = osjei.ObjectType } return json.Marshal(objectMap) } -// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. -func (pp ProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { +// AsOperationStatusJobExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. +func (osjei OperationStatusJobsExtendedInfo) AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) { return nil, false } -// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. -func (pp ProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { - return nil, false +// AsOperationStatusJobsExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. +func (osjei OperationStatusJobsExtendedInfo) AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) { + return &osjei, true } -// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. -func (pp ProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { +// AsOperationStatusProvisionILRExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. +func (osjei OperationStatusJobsExtendedInfo) AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) { return nil, false } -// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. -func (pp ProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { +// AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. +func (osjei OperationStatusJobsExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) { return nil, false } -// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. -func (pp ProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { - return nil, false +// AsBasicOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. +func (osjei OperationStatusJobsExtendedInfo) AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) { + return &osjei, true } -// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. -func (pp ProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { - return nil, false +// OperationStatusProvisionILRExtendedInfo operation status extended info for ILR provision action. +type OperationStatusProvisionILRExtendedInfo struct { + // RecoveryTarget - Target details for file / folder restore. + RecoveryTarget *InstantItemRecoveryTarget `json:"recoveryTarget,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeOperationStatusExtendedInfo', 'ObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeOperationStatusProvisionILRExtendedInfo' + ObjectType ObjectTypeBasicOperationStatusExtendedInfo `json:"objectType,omitempty"` } -// AsProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. -func (pp ProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { - return &pp, true +// MarshalJSON is the custom marshaler for OperationStatusProvisionILRExtendedInfo. +func (ospiei OperationStatusProvisionILRExtendedInfo) MarshalJSON() ([]byte, error) { + ospiei.ObjectType = ObjectTypeOperationStatusProvisionILRExtendedInfo + objectMap := make(map[string]interface{}) + if ospiei.RecoveryTarget != nil { + objectMap["recoveryTarget"] = ospiei.RecoveryTarget + } + if ospiei.ObjectType != "" { + objectMap["objectType"] = ospiei.ObjectType + } + return json.Marshal(objectMap) } -// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. -func (pp ProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { - return &pp, true +// AsOperationStatusJobExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. +func (ospiei OperationStatusProvisionILRExtendedInfo) AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) { + return nil, false } -// ProtectionPolicyResource base class for backup policy. Workload-specific backup policies are derived -// from this class. -type ProtectionPolicyResource struct { - autorest.Response `json:"-"` - // Properties - ProtectionPolicyResource properties - Properties BasicProtectionPolicy `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` +// AsOperationStatusJobsExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. +func (ospiei OperationStatusProvisionILRExtendedInfo) AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for ProtectionPolicyResource. -func (ppr ProtectionPolicyResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = ppr.Properties - if ppr.Location != nil { - objectMap["location"] = ppr.Location - } - if ppr.Tags != nil { - objectMap["tags"] = ppr.Tags - } - if ppr.ETag != nil { - objectMap["eTag"] = ppr.ETag - } - return json.Marshal(objectMap) +// AsOperationStatusProvisionILRExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. +func (ospiei OperationStatusProvisionILRExtendedInfo) AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) { + return &ospiei, true } -// UnmarshalJSON is the custom unmarshaler for ProtectionPolicyResource struct. -func (ppr *ProtectionPolicyResource) UnmarshalJSON(body []byte) error { - var m map[string]*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 := unmarshalBasicProtectionPolicy(*v) - if err != nil { - return err - } - ppr.Properties = properties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ppr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ppr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ppr.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - ppr.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - ppr.Tags = tags - } - case "eTag": - if v != nil { - var eTag string - err = json.Unmarshal(*v, &eTag) - if err != nil { - return err - } - ppr.ETag = &eTag - } - } - } +// AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. +func (ospiei OperationStatusProvisionILRExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) { + return nil, false +} - return nil +// AsBasicOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. +func (ospiei OperationStatusProvisionILRExtendedInfo) AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) { + return &ospiei, true } -// BasicRecoveryPoint base class for backup copies. Workload-specific backup copies are derived from this class. -type BasicRecoveryPoint interface { - AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) - AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) - AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) - AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) - AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) - AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) - AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) - AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) - AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) - AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) - AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) - AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) - AsRecoveryPoint() (*RecoveryPoint, bool) +// PreBackupValidation pre-backup validation for Azure VM Workload provider. +type PreBackupValidation struct { + // Status - Status of protectable item, i.e. InProgress,Succeeded,Failed. Possible values include: 'InquiryStatusInvalid', 'InquiryStatusSuccess', 'InquiryStatusFailed' + Status InquiryStatus `json:"status,omitempty"` + // Code - Error code of protectable item + Code *string `json:"code,omitempty"` + // Message - Message corresponding to the error code for the protectable item + Message *string `json:"message,omitempty"` } -// RecoveryPoint base class for backup copies. Workload-specific backup copies are derived from this class. -type RecoveryPoint struct { - // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' - ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +// BasicProtectableContainer protectable Container Class. +type BasicProtectableContainer interface { + AsAzureStorageProtectableContainer() (*AzureStorageProtectableContainer, bool) + AsAzureVMAppContainerProtectableContainer() (*AzureVMAppContainerProtectableContainer, bool) + AsProtectableContainer() (*ProtectableContainer, bool) } -func unmarshalBasicRecoveryPoint(body []byte) (BasicRecoveryPoint, error) { +// ProtectableContainer protectable Container Class. +type ProtectableContainer struct { + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerID - Fabric Id of the container such as ARM Id. + ContainerID *string `json:"containerId,omitempty"` + // ProtectableContainerType - Possible values include: 'ProtectableContainerTypeProtectableContainer', 'ProtectableContainerTypeStorageContainer', 'ProtectableContainerTypeVMAppContainer' + ProtectableContainerType ProtectableContainerType `json:"protectableContainerType,omitempty"` +} + +func unmarshalBasicProtectableContainer(body []byte) (BasicProtectableContainer, error) { var m map[string]interface{} err := json.Unmarshal(body, &m) if err != nil { return nil, err } - switch m["objectType"] { - case string(ObjectTypeAzureFileShareRecoveryPoint): - var afsrp AzureFileShareRecoveryPoint - err := json.Unmarshal(body, &afsrp) - return afsrp, err - case string(ObjectTypeAzureWorkloadPointInTimeRecoveryPoint): - var awpitrp AzureWorkloadPointInTimeRecoveryPoint - err := json.Unmarshal(body, &awpitrp) - return awpitrp, err - case string(ObjectTypeAzureWorkloadRecoveryPoint): - var awrp AzureWorkloadRecoveryPoint - err := json.Unmarshal(body, &awrp) - return awrp, err - case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint): - var awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint - err := json.Unmarshal(body, &awshpitrp) - return awshpitrp, err - case string(ObjectTypeAzureWorkloadSAPHanaRecoveryPoint): - var awshrp AzureWorkloadSAPHanaRecoveryPoint - err := json.Unmarshal(body, &awshrp) - return awshrp, err - case string(ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint): - var awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint - err := json.Unmarshal(body, &awspitrp) - return awspitrp, err - case string(ObjectTypeAzureWorkloadSQLRecoveryPoint): - var awsrp AzureWorkloadSQLRecoveryPoint - err := json.Unmarshal(body, &awsrp) - return awsrp, err - case string(ObjectTypeGenericRecoveryPoint): - var grp GenericRecoveryPoint - err := json.Unmarshal(body, &grp) - return grp, err - case string(ObjectTypeIaasVMRecoveryPoint): - var ivrp IaasVMRecoveryPoint - err := json.Unmarshal(body, &ivrp) - return ivrp, err + switch m["protectableContainerType"] { + case string(ProtectableContainerTypeStorageContainer): + var aspc AzureStorageProtectableContainer + err := json.Unmarshal(body, &aspc) + return aspc, err + case string(ProtectableContainerTypeVMAppContainer): + var avacpc AzureVMAppContainerProtectableContainer + err := json.Unmarshal(body, &avacpc) + return avacpc, err default: - var rp RecoveryPoint - err := json.Unmarshal(body, &rp) - return rp, err + var pc ProtectableContainer + err := json.Unmarshal(body, &pc) + return pc, err } } -func unmarshalBasicRecoveryPointArray(body []byte) ([]BasicRecoveryPoint, error) { +func unmarshalBasicProtectableContainerArray(body []byte) ([]BasicProtectableContainer, error) { var rawMessages []*json.RawMessage err := json.Unmarshal(body, &rawMessages) if err != nil { return nil, err } - rpArray := make([]BasicRecoveryPoint, len(rawMessages)) + pcArray := make([]BasicProtectableContainer, len(rawMessages)) for index, rawMessage := range rawMessages { - rp, err := unmarshalBasicRecoveryPoint(*rawMessage) + pc, err := unmarshalBasicProtectableContainer(*rawMessage) if err != nil { return nil, err } - rpArray[index] = rp - } - return rpArray, nil -} - -// MarshalJSON is the custom marshaler for RecoveryPoint. -func (rp RecoveryPoint) MarshalJSON() ([]byte, error) { - rp.ObjectType = ObjectTypeRecoveryPoint - objectMap := make(map[string]interface{}) - if rp.ObjectType != "" { - objectMap["objectType"] = rp.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { - return nil, false + pcArray[index] = pc + } + return pcArray, nil } -// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { - return nil, false +// MarshalJSON is the custom marshaler for ProtectableContainer. +func (pc ProtectableContainer) MarshalJSON() ([]byte, error) { + pc.ProtectableContainerType = ProtectableContainerTypeProtectableContainer + objectMap := make(map[string]interface{}) + if pc.FriendlyName != nil { + objectMap["friendlyName"] = pc.FriendlyName + } + if pc.BackupManagementType != "" { + objectMap["backupManagementType"] = pc.BackupManagementType + } + if pc.HealthStatus != nil { + objectMap["healthStatus"] = pc.HealthStatus + } + if pc.ContainerID != nil { + objectMap["containerId"] = pc.ContainerID + } + if pc.ProtectableContainerType != "" { + objectMap["protectableContainerType"] = pc.ProtectableContainerType + } + return json.Marshal(objectMap) } -// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { +// AsAzureStorageProtectableContainer is the BasicProtectableContainer implementation for ProtectableContainer. +func (pc ProtectableContainer) AsAzureStorageProtectableContainer() (*AzureStorageProtectableContainer, bool) { return nil, false } -// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { +// AsAzureVMAppContainerProtectableContainer is the BasicProtectableContainer implementation for ProtectableContainer. +func (pc ProtectableContainer) AsAzureVMAppContainerProtectableContainer() (*AzureVMAppContainerProtectableContainer, bool) { return nil, false } -// AsRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { - return &rp, true +// AsProtectableContainer is the BasicProtectableContainer implementation for ProtectableContainer. +func (pc ProtectableContainer) AsProtectableContainer() (*ProtectableContainer, bool) { + return &pc, true } -// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { - return &rp, true +// AsBasicProtectableContainer is the BasicProtectableContainer implementation for ProtectableContainer. +func (pc ProtectableContainer) AsBasicProtectableContainer() (BasicProtectableContainer, bool) { + return &pc, true } -// RecoveryPointResource base class for backup copies. Workload-specific backup copies are derived from -// this class. -type RecoveryPointResource struct { - autorest.Response `json:"-"` - // Properties - RecoveryPointResource properties - Properties BasicRecoveryPoint `json:"properties,omitempty"` +// ProtectableContainerResource protectable Container Class. +type ProtectableContainerResource struct { + // Properties - ProtectableContainerResource properties + Properties BasicProtectableContainer `json:"properties,omitempty"` // ID - READ-ONLY; Resource Id represents the complete path to the resource. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name associated with the resource. @@ -14947,24 +6811,24 @@ type RecoveryPointResource struct { ETag *string `json:"eTag,omitempty"` } -// MarshalJSON is the custom marshaler for RecoveryPointResource. -func (rpr RecoveryPointResource) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ProtectableContainerResource. +func (pcr ProtectableContainerResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - objectMap["properties"] = rpr.Properties - if rpr.Location != nil { - objectMap["location"] = rpr.Location + objectMap["properties"] = pcr.Properties + if pcr.Location != nil { + objectMap["location"] = pcr.Location } - if rpr.Tags != nil { - objectMap["tags"] = rpr.Tags + if pcr.Tags != nil { + objectMap["tags"] = pcr.Tags } - if rpr.ETag != nil { - objectMap["eTag"] = rpr.ETag + if pcr.ETag != nil { + objectMap["eTag"] = pcr.ETag } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for RecoveryPointResource struct. -func (rpr *RecoveryPointResource) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ProtectableContainerResource struct. +func (pcr *ProtectableContainerResource) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -14974,11 +6838,11 @@ func (rpr *RecoveryPointResource) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - properties, err := unmarshalBasicRecoveryPoint(*v) + properties, err := unmarshalBasicProtectableContainer(*v) if err != nil { return err } - rpr.Properties = properties + pcr.Properties = properties } case "id": if v != nil { @@ -14987,7 +6851,7 @@ func (rpr *RecoveryPointResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rpr.ID = &ID + pcr.ID = &ID } case "name": if v != nil { @@ -14996,7 +6860,7 @@ func (rpr *RecoveryPointResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rpr.Name = &name + pcr.Name = &name } case "type": if v != nil { @@ -15005,7 +6869,7 @@ func (rpr *RecoveryPointResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rpr.Type = &typeVar + pcr.Type = &typeVar } case "location": if v != nil { @@ -15014,7 +6878,7 @@ func (rpr *RecoveryPointResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rpr.Location = &location + pcr.Location = &location } case "tags": if v != nil { @@ -15023,7 +6887,7 @@ func (rpr *RecoveryPointResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rpr.Tags = tags + pcr.Tags = tags } case "eTag": if v != nil { @@ -15032,7 +6896,7 @@ func (rpr *RecoveryPointResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rpr.ETag = &eTag + pcr.ETag = &eTag } } } @@ -15040,26 +6904,27 @@ func (rpr *RecoveryPointResource) UnmarshalJSON(body []byte) error { return nil } -// RecoveryPointResourceList list of RecoveryPoint resources -type RecoveryPointResourceList struct { +// ProtectableContainerResourceList list of ProtectableContainer resources +type ProtectableContainerResourceList struct { autorest.Response `json:"-"` // Value - List of resources. - Value *[]RecoveryPointResource `json:"value,omitempty"` + Value *[]ProtectableContainerResource `json:"value,omitempty"` // NextLink - The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. NextLink *string `json:"nextLink,omitempty"` } -// RecoveryPointResourceListIterator provides access to a complete listing of RecoveryPointResource values. -type RecoveryPointResourceListIterator struct { +// ProtectableContainerResourceListIterator provides access to a complete listing of +// ProtectableContainerResource values. +type ProtectableContainerResourceListIterator struct { i int - page RecoveryPointResourceListPage + page ProtectableContainerResourceListPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *RecoveryPointResourceListIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *ProtectableContainerResourceListIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointResourceListIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectableContainerResourceListIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -15084,62 +6949,62 @@ func (iter *RecoveryPointResourceListIterator) NextWithContext(ctx context.Conte // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (iter *RecoveryPointResourceListIterator) Next() error { +func (iter *ProtectableContainerResourceListIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter RecoveryPointResourceListIterator) NotDone() bool { +func (iter ProtectableContainerResourceListIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. -func (iter RecoveryPointResourceListIterator) Response() RecoveryPointResourceList { +func (iter ProtectableContainerResourceListIterator) Response() ProtectableContainerResourceList { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. -func (iter RecoveryPointResourceListIterator) Value() RecoveryPointResource { +func (iter ProtectableContainerResourceListIterator) Value() ProtectableContainerResource { if !iter.page.NotDone() { - return RecoveryPointResource{} + return ProtectableContainerResource{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the RecoveryPointResourceListIterator type. -func NewRecoveryPointResourceListIterator(page RecoveryPointResourceListPage) RecoveryPointResourceListIterator { - return RecoveryPointResourceListIterator{page: page} +// Creates a new instance of the ProtectableContainerResourceListIterator type. +func NewProtectableContainerResourceListIterator(page ProtectableContainerResourceListPage) ProtectableContainerResourceListIterator { + return ProtectableContainerResourceListIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (rprl RecoveryPointResourceList) IsEmpty() bool { - return rprl.Value == nil || len(*rprl.Value) == 0 +func (pcrl ProtectableContainerResourceList) IsEmpty() bool { + return pcrl.Value == nil || len(*pcrl.Value) == 0 } -// recoveryPointResourceListPreparer prepares a request to retrieve the next set of results. +// protectableContainerResourceListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (rprl RecoveryPointResourceList) recoveryPointResourceListPreparer(ctx context.Context) (*http.Request, error) { - if rprl.NextLink == nil || len(to.String(rprl.NextLink)) < 1 { +func (pcrl ProtectableContainerResourceList) protectableContainerResourceListPreparer(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(rprl.NextLink))) + autorest.WithBaseURL(to.String(pcrl.NextLink))) } -// RecoveryPointResourceListPage contains a page of RecoveryPointResource values. -type RecoveryPointResourceListPage struct { - fn func(context.Context, RecoveryPointResourceList) (RecoveryPointResourceList, error) - rprl RecoveryPointResourceList +// ProtectableContainerResourceListPage contains a page of ProtectableContainerResource values. +type ProtectableContainerResourceListPage struct { + fn func(context.Context, ProtectableContainerResourceList) (ProtectableContainerResourceList, error) + pcrl ProtectableContainerResourceList } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *RecoveryPointResourceListPage) NextWithContext(ctx context.Context) (err error) { +func (page *ProtectableContainerResourceListPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointResourceListPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectableContainerResourceListPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -15148,151 +7013,274 @@ func (page *RecoveryPointResourceListPage) NextWithContext(ctx context.Context) tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.rprl) - if err != nil { - return 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 *ProtectableContainerResourceListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProtectableContainerResourceListPage) NotDone() bool { + return !page.pcrl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProtectableContainerResourceListPage) Response() ProtectableContainerResourceList { + return page.pcrl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProtectableContainerResourceListPage) Values() []ProtectableContainerResource { + if page.pcrl.IsEmpty() { + return nil + } + return *page.pcrl.Value +} + +// Creates a new instance of the ProtectableContainerResourceListPage type. +func NewProtectableContainerResourceListPage(getNextPage func(context.Context, ProtectableContainerResourceList) (ProtectableContainerResourceList, error)) ProtectableContainerResourceListPage { + return ProtectableContainerResourceListPage{fn: getNextPage} +} + +// BasicProtectionContainer base class for container with backup items. Containers with specific workloads are derived +// from this class. +type BasicProtectionContainer interface { + AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) + AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) + AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) + AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) + AsAzureSQLContainer() (*AzureSQLContainer, bool) + AsAzureStorageContainer() (*AzureStorageContainer, bool) + AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) + AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) + AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) + AsDpmContainer() (*DpmContainer, bool) + AsBasicDpmContainer() (BasicDpmContainer, bool) + AsGenericContainer() (*GenericContainer, bool) + AsIaaSVMContainer() (*IaaSVMContainer, bool) + AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) + AsMabContainer() (*MabContainer, bool) + AsProtectionContainer() (*ProtectionContainer, bool) +} + +// ProtectionContainer base class for container with backup items. Containers with specific workloads are +// derived from this class. +type ProtectionContainer struct { + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +} + +func unmarshalBasicProtectionContainer(body []byte) (BasicProtectionContainer, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["containerType"] { + case string(ContainerTypeAzureBackupServerContainer1): + var absc AzureBackupServerContainer + err := json.Unmarshal(body, &absc) + return absc, err + case string(ContainerTypeMicrosoftClassicComputevirtualMachines): + var aisccvc AzureIaaSClassicComputeVMContainer + err := json.Unmarshal(body, &aisccvc) + return aisccvc, err + case string(ContainerTypeMicrosoftComputevirtualMachines): + var aiscvc AzureIaaSComputeVMContainer + err := json.Unmarshal(body, &aiscvc) + return aiscvc, err + case string(ContainerTypeSQLAGWorkLoadContainer1): + var aswcpc AzureSQLAGWorkloadContainerProtectionContainer + err := json.Unmarshal(body, &aswcpc) + return aswcpc, err + case string(ContainerTypeAzureSQLContainer1): + var asc AzureSQLContainer + err := json.Unmarshal(body, &asc) + return asc, err + case string(ContainerTypeStorageContainer1): + var asc AzureStorageContainer + err := json.Unmarshal(body, &asc) + return asc, err + case string(ContainerTypeVMAppContainer1): + var avacpc AzureVMAppContainerProtectionContainer + err := json.Unmarshal(body, &avacpc) + return avacpc, err + case string(ContainerTypeAzureWorkloadContainer): + var awc AzureWorkloadContainer + err := json.Unmarshal(body, &awc) + return awc, err + case string(ContainerTypeDPMContainer1): + var dc DpmContainer + err := json.Unmarshal(body, &dc) + return dc, err + case string(ContainerTypeGenericContainer1): + var gc GenericContainer + err := json.Unmarshal(body, &gc) + return gc, err + case string(ContainerTypeIaaSVMContainer): + var isc IaaSVMContainer + err := json.Unmarshal(body, &isc) + return isc, err + case string(ContainerTypeWindows1): + var mc MabContainer + err := json.Unmarshal(body, &mc) + return mc, err + default: + var pc ProtectionContainer + err := json.Unmarshal(body, &pc) + return pc, err + } +} +func unmarshalBasicProtectionContainerArray(body []byte) ([]BasicProtectionContainer, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + pcArray := make([]BasicProtectionContainer, len(rawMessages)) + + for index, rawMessage := range rawMessages { + pc, err := unmarshalBasicProtectionContainer(*rawMessage) + if err != nil { + return nil, err + } + pcArray[index] = pc + } + return pcArray, nil +} + +// MarshalJSON is the custom marshaler for ProtectionContainer. +func (pc ProtectionContainer) MarshalJSON() ([]byte, error) { + pc.ContainerType = ContainerTypeProtectionContainer + objectMap := make(map[string]interface{}) + if pc.FriendlyName != nil { + objectMap["friendlyName"] = pc.FriendlyName + } + if pc.BackupManagementType != "" { + objectMap["backupManagementType"] = pc.BackupManagementType + } + if pc.RegistrationStatus != nil { + objectMap["registrationStatus"] = pc.RegistrationStatus } - page.rprl = next - return nil + if pc.HealthStatus != nil { + objectMap["healthStatus"] = pc.HealthStatus + } + if pc.ContainerType != "" { + objectMap["containerType"] = pc.ContainerType + } + return json.Marshal(objectMap) } -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *RecoveryPointResourceListPage) Next() error { - return page.NextWithContext(context.Background()) +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { + return nil, false } -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page RecoveryPointResourceListPage) NotDone() bool { - return !page.rprl.IsEmpty() +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { + return nil, false } -// Response returns the raw server response from the last page request. -func (page RecoveryPointResourceListPage) Response() RecoveryPointResourceList { - return page.rprl +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { + return nil, false } -// Values returns the slice of values for the current page or nil if there are no values. -func (page RecoveryPointResourceListPage) Values() []RecoveryPointResource { - if page.rprl.IsEmpty() { - return nil - } - return *page.rprl.Value +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { + return nil, false } -// Creates a new instance of the RecoveryPointResourceListPage type. -func NewRecoveryPointResourceListPage(getNextPage func(context.Context, RecoveryPointResourceList) (RecoveryPointResourceList, error)) RecoveryPointResourceListPage { - return RecoveryPointResourceListPage{fn: getNextPage} +// AsAzureSQLContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return nil, false } -// RecoveryPointTierInformation recovery point tier information. -type RecoveryPointTierInformation struct { - // Type - Recovery point tier type. Possible values include: 'RecoveryPointTierTypeInvalid', 'RecoveryPointTierTypeInstantRP', 'RecoveryPointTierTypeHardenedRP' - Type RecoveryPointTierType `json:"type,omitempty"` - // Status - Recovery point tier status. Possible values include: 'RecoveryPointTierStatusInvalid', 'RecoveryPointTierStatusValid', 'RecoveryPointTierStatusDisabled', 'RecoveryPointTierStatusDeleted' - Status RecoveryPointTierStatus `json:"status,omitempty"` +// AsAzureStorageContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return nil, false } -// BasicRequest base class for backup request. Workload-specific backup requests are derived from this class. -type BasicRequest interface { - AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) - AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) - AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) - AsRequest() (*Request, bool) +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { + return nil, false } -// Request base class for backup request. Workload-specific backup requests are derived from this class. -type Request struct { - // ObjectType - Possible values include: 'ObjectTypeBackupRequest', 'ObjectTypeAzureFileShareBackupRequest', 'ObjectTypeAzureWorkloadBackupRequest', 'ObjectTypeIaasVMBackupRequest' - ObjectType ObjectType `json:"objectType,omitempty"` +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { + return nil, false } -func unmarshalBasicRequest(body []byte) (BasicRequest, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["objectType"] { - case string(ObjectTypeAzureFileShareBackupRequest): - var afsbr AzureFileShareBackupRequest - err := json.Unmarshal(body, &afsbr) - return afsbr, err - case string(ObjectTypeAzureWorkloadBackupRequest): - var awbr AzureWorkloadBackupRequest - err := json.Unmarshal(body, &awbr) - return awbr, err - case string(ObjectTypeIaasVMBackupRequest): - var ivbr IaasVMBackupRequest - err := json.Unmarshal(body, &ivbr) - return ivbr, err - default: - var r Request - err := json.Unmarshal(body, &r) - return r, err - } +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return nil, false } -func unmarshalBasicRequestArray(body []byte) ([]BasicRequest, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - rArray := make([]BasicRequest, len(rawMessages)) +// AsDpmContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsDpmContainer() (*DpmContainer, bool) { + return nil, false +} - for index, rawMessage := range rawMessages { - r, err := unmarshalBasicRequest(*rawMessage) - if err != nil { - return nil, err - } - rArray[index] = r - } - return rArray, nil +// AsBasicDpmContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for Request. -func (r Request) MarshalJSON() ([]byte, error) { - r.ObjectType = ObjectTypeBackupRequest - objectMap := make(map[string]interface{}) - if r.ObjectType != "" { - objectMap["objectType"] = r.ObjectType - } - return json.Marshal(objectMap) +// AsGenericContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsGenericContainer() (*GenericContainer, bool) { + return nil, false } -// AsAzureFileShareBackupRequest is the BasicRequest implementation for Request. -func (r Request) AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) { +// AsIaaSVMContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { return nil, false } -// AsAzureWorkloadBackupRequest is the BasicRequest implementation for Request. -func (r Request) AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) { +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { return nil, false } -// AsIaasVMBackupRequest is the BasicRequest implementation for Request. -func (r Request) AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) { +// AsMabContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsMabContainer() (*MabContainer, bool) { return nil, false } -// AsRequest is the BasicRequest implementation for Request. -func (r Request) AsRequest() (*Request, bool) { - return &r, true +// AsProtectionContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return &pc, true } -// AsBasicRequest is the BasicRequest implementation for Request. -func (r Request) AsBasicRequest() (BasicRequest, bool) { - return &r, true +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &pc, true } -// RequestResource base class for backup request. Workload-specific backup requests are derived from this -// class. -type RequestResource struct { - // Properties - BackupRequestResource properties - Properties BasicRequest `json:"properties,omitempty"` +// ProtectionContainerResource base class for container with backup items. Containers with specific +// workloads are derived from this class. +type ProtectionContainerResource struct { + autorest.Response `json:"-"` + // Properties - ProtectionContainerResource properties + Properties BasicProtectionContainer `json:"properties,omitempty"` // ID - READ-ONLY; Resource Id represents the complete path to the resource. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name associated with the resource. @@ -15307,24 +7295,24 @@ type RequestResource struct { ETag *string `json:"eTag,omitempty"` } -// MarshalJSON is the custom marshaler for RequestResource. -func (rr RequestResource) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ProtectionContainerResource. +func (pcr ProtectionContainerResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - objectMap["properties"] = rr.Properties - if rr.Location != nil { - objectMap["location"] = rr.Location + objectMap["properties"] = pcr.Properties + if pcr.Location != nil { + objectMap["location"] = pcr.Location } - if rr.Tags != nil { - objectMap["tags"] = rr.Tags + if pcr.Tags != nil { + objectMap["tags"] = pcr.Tags } - if rr.ETag != nil { - objectMap["eTag"] = rr.ETag + if pcr.ETag != nil { + objectMap["eTag"] = pcr.ETag } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for RequestResource struct. -func (rr *RequestResource) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ProtectionContainerResource struct. +func (pcr *ProtectionContainerResource) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -15334,11 +7322,11 @@ func (rr *RequestResource) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - properties, err := unmarshalBasicRequest(*v) + properties, err := unmarshalBasicProtectionContainer(*v) if err != nil { return err } - rr.Properties = properties + pcr.Properties = properties } case "id": if v != nil { @@ -15347,7 +7335,7 @@ func (rr *RequestResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rr.ID = &ID + pcr.ID = &ID } case "name": if v != nil { @@ -15356,7 +7344,7 @@ func (rr *RequestResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rr.Name = &name + pcr.Name = &name } case "type": if v != nil { @@ -15365,7 +7353,7 @@ func (rr *RequestResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rr.Type = &typeVar + pcr.Type = &typeVar } case "location": if v != nil { @@ -15374,7 +7362,7 @@ func (rr *RequestResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rr.Location = &location + pcr.Location = &location } case "tags": if v != nil { @@ -15383,7 +7371,7 @@ func (rr *RequestResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rr.Tags = tags + pcr.Tags = tags } case "eTag": if v != nil { @@ -15392,7 +7380,7 @@ func (rr *RequestResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rr.ETag = &eTag + pcr.ETag = &eTag } } } @@ -15400,173 +7388,165 @@ func (rr *RequestResource) UnmarshalJSON(body []byte) error { return nil } -// Resource ARM Resource. -type Resource struct { - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` +// ProtectionContainerResourceList list of ProtectionContainer resources +type ProtectionContainerResourceList struct { + autorest.Response `json:"-"` + // Value - List of resources. + Value *[]ProtectionContainerResource `json:"value,omitempty"` + // NextLink - The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// ProtectionContainerResourceListIterator provides access to a complete listing of +// ProtectionContainerResource values. +type ProtectionContainerResourceListIterator struct { + i int + page ProtectionContainerResourceListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ProtectionContainerResourceListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerResourceListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ProtectionContainerResourceListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProtectionContainerResourceListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) } -// 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.ETag != nil { - objectMap["eTag"] = r.ETag +// Response returns the raw server response from the last page request. +func (iter ProtectionContainerResourceListIterator) Response() ProtectionContainerResourceList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ProtectionContainerResourceListIterator) Value() ProtectionContainerResource { + if !iter.page.NotDone() { + return ProtectionContainerResource{} } - return json.Marshal(objectMap) + return iter.page.Values()[iter.i] } -// ResourceConfig the resource storage details. -type ResourceConfig struct { - // StorageModelType - Storage type. Possible values include: 'StorageTypeInvalid', 'StorageTypeGeoRedundant', 'StorageTypeLocallyRedundant' - StorageModelType StorageType `json:"storageModelType,omitempty"` - // StorageType - Storage type. Possible values include: 'StorageTypeInvalid', 'StorageTypeGeoRedundant', 'StorageTypeLocallyRedundant' - StorageType StorageType `json:"storageType,omitempty"` - // StorageTypeState - Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked. Possible values include: 'StorageTypeStateInvalid', 'StorageTypeStateLocked', 'StorageTypeStateUnlocked' - StorageTypeState StorageTypeState `json:"storageTypeState,omitempty"` +// Creates a new instance of the ProtectionContainerResourceListIterator type. +func NewProtectionContainerResourceListIterator(page ProtectionContainerResourceListPage) ProtectionContainerResourceListIterator { + return ProtectionContainerResourceListIterator{page: page} } -// ResourceConfigResource the resource storage details. -type ResourceConfigResource struct { - autorest.Response `json:"-"` - // Properties - BackupResourceConfigResource properties - Properties *ResourceConfig `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` +// IsEmpty returns true if the ListResult contains no values. +func (pcrl ProtectionContainerResourceList) IsEmpty() bool { + return pcrl.Value == nil || len(*pcrl.Value) == 0 } -// MarshalJSON is the custom marshaler for ResourceConfigResource. -func (rcr ResourceConfigResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rcr.Properties != nil { - objectMap["properties"] = rcr.Properties - } - if rcr.Location != nil { - objectMap["location"] = rcr.Location +// protectionContainerResourceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pcrl ProtectionContainerResourceList) protectionContainerResourceListPreparer(ctx context.Context) (*http.Request, error) { + if pcrl.NextLink == nil || len(to.String(pcrl.NextLink)) < 1 { + return nil, nil } - if rcr.Tags != nil { - objectMap["tags"] = rcr.Tags + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pcrl.NextLink))) +} + +// ProtectionContainerResourceListPage contains a page of ProtectionContainerResource values. +type ProtectionContainerResourceListPage struct { + fn func(context.Context, ProtectionContainerResourceList) (ProtectionContainerResourceList, error) + pcrl ProtectionContainerResourceList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ProtectionContainerResourceListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerResourceListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() } - if rcr.ETag != nil { - objectMap["eTag"] = rcr.ETag + next, err := page.fn(ctx, page.pcrl) + if err != nil { + return err } - return json.Marshal(objectMap) + page.pcrl = next + return nil } -// ResourceList base for all lists of resources. -type ResourceList struct { - // NextLink - The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. - NextLink *string `json:"nextLink,omitempty"` +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ProtectionContainerResourceListPage) Next() error { + return page.NextWithContext(context.Background()) } -// ResourceVaultConfig backup resource vault config details. -type ResourceVaultConfig struct { - // StorageModelType - Storage type. Possible values include: 'StorageTypeInvalid', 'StorageTypeGeoRedundant', 'StorageTypeLocallyRedundant' - StorageModelType StorageType `json:"storageModelType,omitempty"` - // StorageType - Storage type. Possible values include: 'StorageTypeInvalid', 'StorageTypeGeoRedundant', 'StorageTypeLocallyRedundant' - StorageType StorageType `json:"storageType,omitempty"` - // StorageTypeState - Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked. Possible values include: 'StorageTypeStateInvalid', 'StorageTypeStateLocked', 'StorageTypeStateUnlocked' - StorageTypeState StorageTypeState `json:"storageTypeState,omitempty"` - // EnhancedSecurityState - Enabled or Disabled. Possible values include: 'EnhancedSecurityStateInvalid', 'EnhancedSecurityStateEnabled', 'EnhancedSecurityStateDisabled' - EnhancedSecurityState EnhancedSecurityState `json:"enhancedSecurityState,omitempty"` +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProtectionContainerResourceListPage) NotDone() bool { + return !page.pcrl.IsEmpty() } -// ResourceVaultConfigResource backup resource vault config details. -type ResourceVaultConfigResource struct { - autorest.Response `json:"-"` - // Properties - BackupResourceVaultConfigResource properties - Properties *ResourceVaultConfig `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` +// Response returns the raw server response from the last page request. +func (page ProtectionContainerResourceListPage) Response() ProtectionContainerResourceList { + return page.pcrl } -// MarshalJSON is the custom marshaler for ResourceVaultConfigResource. -func (rvcr ResourceVaultConfigResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rvcr.Properties != nil { - objectMap["properties"] = rvcr.Properties - } - if rvcr.Location != nil { - objectMap["location"] = rvcr.Location - } - if rvcr.Tags != nil { - objectMap["tags"] = rvcr.Tags - } - if rvcr.ETag != nil { - objectMap["eTag"] = rvcr.ETag +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProtectionContainerResourceListPage) Values() []ProtectionContainerResource { + if page.pcrl.IsEmpty() { + return nil } - return json.Marshal(objectMap) + return *page.pcrl.Value } -// RestoreFileSpecs restore file specs like file path, type and target folder path info. -type RestoreFileSpecs struct { - // Path - Source File/Folder path - Path *string `json:"path,omitempty"` - // FileSpecType - Indicates what the Path variable stands for - FileSpecType *string `json:"fileSpecType,omitempty"` - // TargetFolderPath - Destination folder path in target FileShare - TargetFolderPath *string `json:"targetFolderPath,omitempty"` -} - -// BasicRestoreRequest base class for restore request. Workload-specific restore requests are derived from this class. -type BasicRestoreRequest interface { - AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) - AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) - AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) - AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) - AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) - AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) - AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) - AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) - AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) - AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) - AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) - AsRestoreRequest() (*RestoreRequest, bool) -} - -// RestoreRequest base class for restore request. Workload-specific restore requests are derived from this -// class. -type RestoreRequest struct { - // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' - ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +// Creates a new instance of the ProtectionContainerResourceListPage type. +func NewProtectionContainerResourceListPage(getNextPage func(context.Context, ProtectionContainerResourceList) (ProtectionContainerResourceList, error)) ProtectionContainerResourceListPage { + return ProtectionContainerResourceListPage{fn: getNextPage} +} + +// BasicRecoveryPoint base class for backup copies. Workload-specific backup copies are derived from this class. +type BasicRecoveryPoint interface { + AsRecoveryPoint() (*RecoveryPoint, bool) +} + +// RecoveryPoint base class for backup copies. Workload-specific backup copies are derived from this class. +type RecoveryPoint struct { + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` } -func unmarshalBasicRestoreRequest(body []byte) (BasicRestoreRequest, error) { +func unmarshalBasicRecoveryPoint(body []byte) (BasicRecoveryPoint, error) { var m map[string]interface{} err := json.Unmarshal(body, &m) if err != nil { @@ -15574,143 +7554,150 @@ func unmarshalBasicRestoreRequest(body []byte) (BasicRestoreRequest, error) { } switch m["objectType"] { - case string(ObjectTypeAzureFileShareRestoreRequest): - var afsrr AzureFileShareRestoreRequest - err := json.Unmarshal(body, &afsrr) - return afsrr, err - case string(ObjectTypeAzureWorkloadPointInTimeRestoreRequest): - var awpitrr AzureWorkloadPointInTimeRestoreRequest - err := json.Unmarshal(body, &awpitrr) - return awpitrr, err - case string(ObjectTypeAzureWorkloadRestoreRequest): - var awrr AzureWorkloadRestoreRequest - err := json.Unmarshal(body, &awrr) - return awrr, err - case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest): - var awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest - err := json.Unmarshal(body, &awshpitrr) - return awshpitrr, err - case string(ObjectTypeAzureWorkloadSAPHanaRestoreRequest): - var awshrr AzureWorkloadSAPHanaRestoreRequest - err := json.Unmarshal(body, &awshrr) - return awshrr, err - case string(ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest): - var awspitrr AzureWorkloadSQLPointInTimeRestoreRequest - err := json.Unmarshal(body, &awspitrr) - return awspitrr, err - case string(ObjectTypeAzureWorkloadSQLRestoreRequest): - var awsrr AzureWorkloadSQLRestoreRequest - err := json.Unmarshal(body, &awsrr) - return awsrr, err - case string(ObjectTypeIaasVMRestoreRequest): - var ivrr IaasVMRestoreRequest - err := json.Unmarshal(body, &ivrr) - return ivrr, err default: - var rr RestoreRequest - err := json.Unmarshal(body, &rr) - return rr, err + var rp RecoveryPoint + err := json.Unmarshal(body, &rp) + return rp, err } } -func unmarshalBasicRestoreRequestArray(body []byte) ([]BasicRestoreRequest, error) { +func unmarshalBasicRecoveryPointArray(body []byte) ([]BasicRecoveryPoint, error) { var rawMessages []*json.RawMessage err := json.Unmarshal(body, &rawMessages) if err != nil { return nil, err } - rrArray := make([]BasicRestoreRequest, len(rawMessages)) + rpArray := make([]BasicRecoveryPoint, len(rawMessages)) for index, rawMessage := range rawMessages { - rr, err := unmarshalBasicRestoreRequest(*rawMessage) + rp, err := unmarshalBasicRecoveryPoint(*rawMessage) if err != nil { return nil, err } - rrArray[index] = rr + rpArray[index] = rp } - return rrArray, nil + return rpArray, nil } -// MarshalJSON is the custom marshaler for RestoreRequest. -func (rr RestoreRequest) MarshalJSON() ([]byte, error) { - rr.ObjectType = ObjectTypeRestoreRequest +// MarshalJSON is the custom marshaler for RecoveryPoint. +func (rp RecoveryPoint) MarshalJSON() ([]byte, error) { + rp.ObjectType = ObjectTypeRecoveryPoint objectMap := make(map[string]interface{}) - if rr.ObjectType != "" { - objectMap["objectType"] = rr.ObjectType + if rp.ObjectType != "" { + objectMap["objectType"] = rp.ObjectType } return json.Marshal(objectMap) } -// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { - return nil, false +// AsRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { + return &rp, true } -// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { - return nil, false +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &rp, true } -// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { - return nil, false +// BasicRequest base class for backup request. Workload-specific backup requests are derived from this class. +type BasicRequest interface { + AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) + AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) + AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) + AsRequest() (*Request, bool) } -// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { - return nil, false +// Request base class for backup request. Workload-specific backup requests are derived from this class. +type Request struct { + // ObjectType - Possible values include: 'ObjectTypeBackupRequest', 'ObjectTypeAzureFileShareBackupRequest', 'ObjectTypeAzureWorkloadBackupRequest', 'ObjectTypeIaasVMBackupRequest' + ObjectType ObjectType `json:"objectType,omitempty"` } -// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { - return nil, false -} +func unmarshalBasicRequest(body []byte) (BasicRequest, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } -// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false + switch m["objectType"] { + case string(ObjectTypeAzureFileShareBackupRequest): + var afsbr AzureFileShareBackupRequest + err := json.Unmarshal(body, &afsbr) + return afsbr, err + case string(ObjectTypeAzureWorkloadBackupRequest): + var awbr AzureWorkloadBackupRequest + err := json.Unmarshal(body, &awbr) + return awbr, err + case string(ObjectTypeIaasVMBackupRequest): + var ivbr IaasVMBackupRequest + err := json.Unmarshal(body, &ivbr) + return ivbr, err + default: + var r Request + err := json.Unmarshal(body, &r) + return r, err + } } +func unmarshalBasicRequestArray(body []byte) ([]BasicRequest, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } -// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false + rArray := make([]BasicRequest, len(rawMessages)) + + for index, rawMessage := range rawMessages { + r, err := unmarshalBasicRequest(*rawMessage) + if err != nil { + return nil, err + } + rArray[index] = r + } + return rArray, nil } -// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { - return nil, false +// MarshalJSON is the custom marshaler for Request. +func (r Request) MarshalJSON() ([]byte, error) { + r.ObjectType = ObjectTypeBackupRequest + objectMap := make(map[string]interface{}) + if r.ObjectType != "" { + objectMap["objectType"] = r.ObjectType + } + return json.Marshal(objectMap) } -// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { +// AsAzureFileShareBackupRequest is the BasicRequest implementation for Request. +func (r Request) AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) { return nil, false } -// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { +// AsAzureWorkloadBackupRequest is the BasicRequest implementation for Request. +func (r Request) AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) { return nil, false } -// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { +// AsIaasVMBackupRequest is the BasicRequest implementation for Request. +func (r Request) AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) { return nil, false } -// AsRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { - return &rr, true +// AsRequest is the BasicRequest implementation for Request. +func (r Request) AsRequest() (*Request, bool) { + return &r, true } -// AsBasicRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { - return &rr, true +// AsBasicRequest is the BasicRequest implementation for Request. +func (r Request) AsBasicRequest() (BasicRequest, bool) { + return &r, true } -// RestoreRequestResource base class for restore request. Workload-specific restore requests are derived -// from this class. -type RestoreRequestResource struct { - // Properties - RestoreRequestResource properties - Properties BasicRestoreRequest `json:"properties,omitempty"` +// RequestResource base class for backup request. Workload-specific backup requests are derived from this +// class. +type RequestResource struct { + // Properties - BackupRequestResource properties + Properties BasicRequest `json:"properties,omitempty"` // ID - READ-ONLY; Resource Id represents the complete path to the resource. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name associated with the resource. @@ -15725,24 +7712,24 @@ type RestoreRequestResource struct { ETag *string `json:"eTag,omitempty"` } -// MarshalJSON is the custom marshaler for RestoreRequestResource. -func (rrr RestoreRequestResource) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for RequestResource. +func (rr RequestResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - objectMap["properties"] = rrr.Properties - if rrr.Location != nil { - objectMap["location"] = rrr.Location + objectMap["properties"] = rr.Properties + if rr.Location != nil { + objectMap["location"] = rr.Location } - if rrr.Tags != nil { - objectMap["tags"] = rrr.Tags + if rr.Tags != nil { + objectMap["tags"] = rr.Tags } - if rrr.ETag != nil { - objectMap["eTag"] = rrr.ETag + if rr.ETag != nil { + objectMap["eTag"] = rr.ETag } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for RestoreRequestResource struct. -func (rrr *RestoreRequestResource) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for RequestResource struct. +func (rr *RequestResource) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -15752,11 +7739,11 @@ func (rrr *RestoreRequestResource) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - properties, err := unmarshalBasicRestoreRequest(*v) + properties, err := unmarshalBasicRequest(*v) if err != nil { return err } - rrr.Properties = properties + rr.Properties = properties } case "id": if v != nil { @@ -15765,7 +7752,7 @@ func (rrr *RestoreRequestResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rrr.ID = &ID + rr.ID = &ID } case "name": if v != nil { @@ -15774,7 +7761,7 @@ func (rrr *RestoreRequestResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rrr.Name = &name + rr.Name = &name } case "type": if v != nil { @@ -15783,7 +7770,7 @@ func (rrr *RestoreRequestResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rrr.Type = &typeVar + rr.Type = &typeVar } case "location": if v != nil { @@ -15792,7 +7779,7 @@ func (rrr *RestoreRequestResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rrr.Location = &location + rr.Location = &location } case "tags": if v != nil { @@ -15801,7 +7788,7 @@ func (rrr *RestoreRequestResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rrr.Tags = tags + rr.Tags = tags } case "eTag": if v != nil { @@ -15810,7 +7797,7 @@ func (rrr *RestoreRequestResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rrr.ETag = &eTag + rr.ETag = &eTag } } } @@ -15818,304 +7805,88 @@ func (rrr *RestoreRequestResource) UnmarshalJSON(body []byte) error { return nil } -// RetentionDuration retention duration. -type RetentionDuration struct { - // Count - Count of duration types. Retention duration is obtained by the counting the duration type Count times. - // For example, when Count = 3 and DurationType = Weeks, retention duration will be three weeks. - Count *int32 `json:"count,omitempty"` - // DurationType - Retention duration type of retention policy. Possible values include: 'RetentionDurationTypeInvalid', 'RetentionDurationTypeDays', 'RetentionDurationTypeWeeks', 'RetentionDurationTypeMonths', 'RetentionDurationTypeYears' - DurationType RetentionDurationType `json:"durationType,omitempty"` -} - -// BasicRetentionPolicy base class for retention policy. -type BasicRetentionPolicy interface { - AsLongTermRetentionPolicy() (*LongTermRetentionPolicy, bool) - AsSimpleRetentionPolicy() (*SimpleRetentionPolicy, bool) - AsRetentionPolicy() (*RetentionPolicy, bool) -} - -// RetentionPolicy base class for retention policy. -type RetentionPolicy struct { - // RetentionPolicyType - Possible values include: 'RetentionPolicyTypeRetentionPolicy', 'RetentionPolicyTypeLongTermRetentionPolicy', 'RetentionPolicyTypeSimpleRetentionPolicy' - RetentionPolicyType RetentionPolicyType `json:"retentionPolicyType,omitempty"` -} - -func unmarshalBasicRetentionPolicy(body []byte) (BasicRetentionPolicy, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["retentionPolicyType"] { - case string(RetentionPolicyTypeLongTermRetentionPolicy): - var ltrp LongTermRetentionPolicy - err := json.Unmarshal(body, <rp) - return ltrp, err - case string(RetentionPolicyTypeSimpleRetentionPolicy): - var srp SimpleRetentionPolicy - err := json.Unmarshal(body, &srp) - return srp, err - default: - var rp RetentionPolicy - err := json.Unmarshal(body, &rp) - return rp, err - } -} -func unmarshalBasicRetentionPolicyArray(body []byte) ([]BasicRetentionPolicy, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - rpArray := make([]BasicRetentionPolicy, len(rawMessages)) - - for index, rawMessage := range rawMessages { - rp, err := unmarshalBasicRetentionPolicy(*rawMessage) - if err != nil { - return nil, err - } - rpArray[index] = rp - } - return rpArray, nil -} - -// MarshalJSON is the custom marshaler for RetentionPolicy. -func (rp RetentionPolicy) MarshalJSON() ([]byte, error) { - rp.RetentionPolicyType = RetentionPolicyTypeRetentionPolicy - objectMap := make(map[string]interface{}) - if rp.RetentionPolicyType != "" { - objectMap["retentionPolicyType"] = rp.RetentionPolicyType - } - return json.Marshal(objectMap) -} - -// AsLongTermRetentionPolicy is the BasicRetentionPolicy implementation for RetentionPolicy. -func (rp RetentionPolicy) AsLongTermRetentionPolicy() (*LongTermRetentionPolicy, bool) { - return nil, false -} - -// AsSimpleRetentionPolicy is the BasicRetentionPolicy implementation for RetentionPolicy. -func (rp RetentionPolicy) AsSimpleRetentionPolicy() (*SimpleRetentionPolicy, bool) { - return nil, false -} - -// AsRetentionPolicy is the BasicRetentionPolicy implementation for RetentionPolicy. -func (rp RetentionPolicy) AsRetentionPolicy() (*RetentionPolicy, bool) { - return &rp, true -} - -// AsBasicRetentionPolicy is the BasicRetentionPolicy implementation for RetentionPolicy. -func (rp RetentionPolicy) AsBasicRetentionPolicy() (BasicRetentionPolicy, bool) { - return &rp, true -} - -// BasicSchedulePolicy base class for backup schedule. -type BasicSchedulePolicy interface { - AsLogSchedulePolicy() (*LogSchedulePolicy, bool) - AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) - AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) - AsSchedulePolicy() (*SchedulePolicy, bool) -} - -// SchedulePolicy base class for backup schedule. -type SchedulePolicy struct { - // SchedulePolicyType - Possible values include: 'SchedulePolicyTypeSchedulePolicy', 'SchedulePolicyTypeLogSchedulePolicy', 'SchedulePolicyTypeLongTermSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicy' - SchedulePolicyType SchedulePolicyType `json:"schedulePolicyType,omitempty"` -} - -func unmarshalBasicSchedulePolicy(body []byte) (BasicSchedulePolicy, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["schedulePolicyType"] { - case string(SchedulePolicyTypeLogSchedulePolicy): - var lsp LogSchedulePolicy - err := json.Unmarshal(body, &lsp) - return lsp, err - case string(SchedulePolicyTypeLongTermSchedulePolicy): - var ltsp LongTermSchedulePolicy - err := json.Unmarshal(body, <sp) - return ltsp, err - case string(SchedulePolicyTypeSimpleSchedulePolicy): - var ssp SimpleSchedulePolicy - err := json.Unmarshal(body, &ssp) - return ssp, err - default: - var sp SchedulePolicy - err := json.Unmarshal(body, &sp) - return sp, err - } -} -func unmarshalBasicSchedulePolicyArray(body []byte) ([]BasicSchedulePolicy, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - spArray := make([]BasicSchedulePolicy, len(rawMessages)) - - for index, rawMessage := range rawMessages { - sp, err := unmarshalBasicSchedulePolicy(*rawMessage) - if err != nil { - return nil, err - } - spArray[index] = sp - } - return spArray, nil +// Resource ARM Resource. +type Resource struct { + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` } -// MarshalJSON is the custom marshaler for SchedulePolicy. -func (sp SchedulePolicy) MarshalJSON() ([]byte, error) { - sp.SchedulePolicyType = SchedulePolicyTypeSchedulePolicy +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if sp.SchedulePolicyType != "" { - objectMap["schedulePolicyType"] = sp.SchedulePolicyType + if r.Location != nil { + objectMap["location"] = r.Location } - return json.Marshal(objectMap) -} - -// AsLogSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. -func (sp SchedulePolicy) AsLogSchedulePolicy() (*LogSchedulePolicy, bool) { - return nil, false -} - -// AsLongTermSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. -func (sp SchedulePolicy) AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) { - return nil, false -} - -// AsSimpleSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. -func (sp SchedulePolicy) AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) { - return nil, false -} - -// AsSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. -func (sp SchedulePolicy) AsSchedulePolicy() (*SchedulePolicy, bool) { - return &sp, true -} - -// AsBasicSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. -func (sp SchedulePolicy) AsBasicSchedulePolicy() (BasicSchedulePolicy, bool) { - return &sp, true -} - -// Settings common settings field for backup management -type Settings struct { - // TimeZone - TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". - TimeZone *string `json:"timeZone,omitempty"` - // Issqlcompression - SQL compression flag - Issqlcompression *bool `json:"issqlcompression,omitempty"` - // IsCompression - Workload compression flag. This has been added so that 'isSqlCompression' - // will be deprecated once clients upgrade to consider this flag. - IsCompression *bool `json:"isCompression,omitempty"` -} - -// SimpleRetentionPolicy simple policy retention. -type SimpleRetentionPolicy struct { - // RetentionDuration - Retention duration of the protection policy. - RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` - // RetentionPolicyType - Possible values include: 'RetentionPolicyTypeRetentionPolicy', 'RetentionPolicyTypeLongTermRetentionPolicy', 'RetentionPolicyTypeSimpleRetentionPolicy' - RetentionPolicyType RetentionPolicyType `json:"retentionPolicyType,omitempty"` -} - -// MarshalJSON is the custom marshaler for SimpleRetentionPolicy. -func (srp SimpleRetentionPolicy) MarshalJSON() ([]byte, error) { - srp.RetentionPolicyType = RetentionPolicyTypeSimpleRetentionPolicy - objectMap := make(map[string]interface{}) - if srp.RetentionDuration != nil { - objectMap["retentionDuration"] = srp.RetentionDuration + if r.Tags != nil { + objectMap["tags"] = r.Tags } - if srp.RetentionPolicyType != "" { - objectMap["retentionPolicyType"] = srp.RetentionPolicyType + if r.ETag != nil { + objectMap["eTag"] = r.ETag } return json.Marshal(objectMap) } -// AsLongTermRetentionPolicy is the BasicRetentionPolicy implementation for SimpleRetentionPolicy. -func (srp SimpleRetentionPolicy) AsLongTermRetentionPolicy() (*LongTermRetentionPolicy, bool) { - return nil, false -} - -// AsSimpleRetentionPolicy is the BasicRetentionPolicy implementation for SimpleRetentionPolicy. -func (srp SimpleRetentionPolicy) AsSimpleRetentionPolicy() (*SimpleRetentionPolicy, bool) { - return &srp, true -} - -// AsRetentionPolicy is the BasicRetentionPolicy implementation for SimpleRetentionPolicy. -func (srp SimpleRetentionPolicy) AsRetentionPolicy() (*RetentionPolicy, bool) { - return nil, false -} - -// AsBasicRetentionPolicy is the BasicRetentionPolicy implementation for SimpleRetentionPolicy. -func (srp SimpleRetentionPolicy) AsBasicRetentionPolicy() (BasicRetentionPolicy, bool) { - return &srp, true +// ResourceConfig the resource storage details. +type ResourceConfig struct { + // StorageModelType - Storage type. Possible values include: 'StorageTypeInvalid', 'StorageTypeGeoRedundant', 'StorageTypeLocallyRedundant' + StorageModelType StorageType `json:"storageModelType,omitempty"` + // StorageType - Storage type. Possible values include: 'StorageTypeInvalid', 'StorageTypeGeoRedundant', 'StorageTypeLocallyRedundant' + StorageType StorageType `json:"storageType,omitempty"` + // StorageTypeState - Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked. Possible values include: 'StorageTypeStateInvalid', 'StorageTypeStateLocked', 'StorageTypeStateUnlocked' + StorageTypeState StorageTypeState `json:"storageTypeState,omitempty"` } -// SimpleSchedulePolicy simple policy schedule. -type SimpleSchedulePolicy struct { - // ScheduleRunFrequency - Frequency of the schedule operation of this policy. Possible values include: 'ScheduleRunTypeInvalid', 'ScheduleRunTypeDaily', 'ScheduleRunTypeWeekly' - ScheduleRunFrequency ScheduleRunType `json:"scheduleRunFrequency,omitempty"` - // ScheduleRunDays - List of days of week this schedule has to be run. - ScheduleRunDays *[]DayOfWeek `json:"scheduleRunDays,omitempty"` - // ScheduleRunTimes - List of times of day this schedule has to be run. - ScheduleRunTimes *[]date.Time `json:"scheduleRunTimes,omitempty"` - // ScheduleWeeklyFrequency - At every number weeks this schedule has to be run. - ScheduleWeeklyFrequency *int32 `json:"scheduleWeeklyFrequency,omitempty"` - // SchedulePolicyType - Possible values include: 'SchedulePolicyTypeSchedulePolicy', 'SchedulePolicyTypeLogSchedulePolicy', 'SchedulePolicyTypeLongTermSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicy' - SchedulePolicyType SchedulePolicyType `json:"schedulePolicyType,omitempty"` +// ResourceConfigResource the resource storage details. +type ResourceConfigResource struct { + autorest.Response `json:"-"` + // Properties - BackupResourceConfigResource properties + Properties *ResourceConfig `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` } -// MarshalJSON is the custom marshaler for SimpleSchedulePolicy. -func (ssp SimpleSchedulePolicy) MarshalJSON() ([]byte, error) { - ssp.SchedulePolicyType = SchedulePolicyTypeSimpleSchedulePolicy +// MarshalJSON is the custom marshaler for ResourceConfigResource. +func (rcr ResourceConfigResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if ssp.ScheduleRunFrequency != "" { - objectMap["scheduleRunFrequency"] = ssp.ScheduleRunFrequency - } - if ssp.ScheduleRunDays != nil { - objectMap["scheduleRunDays"] = ssp.ScheduleRunDays + if rcr.Properties != nil { + objectMap["properties"] = rcr.Properties } - if ssp.ScheduleRunTimes != nil { - objectMap["scheduleRunTimes"] = ssp.ScheduleRunTimes + if rcr.Location != nil { + objectMap["location"] = rcr.Location } - if ssp.ScheduleWeeklyFrequency != nil { - objectMap["scheduleWeeklyFrequency"] = ssp.ScheduleWeeklyFrequency + if rcr.Tags != nil { + objectMap["tags"] = rcr.Tags } - if ssp.SchedulePolicyType != "" { - objectMap["schedulePolicyType"] = ssp.SchedulePolicyType + if rcr.ETag != nil { + objectMap["eTag"] = rcr.ETag } return json.Marshal(objectMap) } -// AsLogSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. -func (ssp SimpleSchedulePolicy) AsLogSchedulePolicy() (*LogSchedulePolicy, bool) { - return nil, false -} - -// AsLongTermSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. -func (ssp SimpleSchedulePolicy) AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) { - return nil, false -} - -// AsSimpleSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. -func (ssp SimpleSchedulePolicy) AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) { - return &ssp, true -} - -// AsSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. -func (ssp SimpleSchedulePolicy) AsSchedulePolicy() (*SchedulePolicy, bool) { - return nil, false -} - -// AsBasicSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. -func (ssp SimpleSchedulePolicy) AsBasicSchedulePolicy() (BasicSchedulePolicy, bool) { - return &ssp, true +// ResourceList base for all lists of resources. +type ResourceList struct { + // NextLink - The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. + NextLink *string `json:"nextLink,omitempty"` } // SQLDataDirectory sQLDataDirectory info @@ -16128,86 +7899,6 @@ type SQLDataDirectory struct { LogicalName *string `json:"logicalName,omitempty"` } -// SQLDataDirectoryMapping encapsulates information regarding data directory -type SQLDataDirectoryMapping struct { - // MappingType - Type of data directory mapping. Possible values include: 'SQLDataDirectoryTypeInvalid', 'SQLDataDirectoryTypeData', 'SQLDataDirectoryTypeLog' - MappingType SQLDataDirectoryType `json:"mappingType,omitempty"` - // SourceLogicalName - Restore source logical name path - SourceLogicalName *string `json:"sourceLogicalName,omitempty"` - // SourcePath - Restore source path - SourcePath *string `json:"sourcePath,omitempty"` - // TargetPath - Target path - TargetPath *string `json:"targetPath,omitempty"` -} - -// SubProtectionPolicy sub-protection policy which includes schedule and retention -type SubProtectionPolicy struct { - // PolicyType - Type of backup policy type. Possible values include: 'PolicyTypeInvalid', 'PolicyTypeFull', 'PolicyTypeDifferential', 'PolicyTypeLog', 'PolicyTypeCopyOnlyFull' - PolicyType PolicyType `json:"policyType,omitempty"` - // SchedulePolicy - Backup schedule specified as part of backup policy. - SchedulePolicy BasicSchedulePolicy `json:"schedulePolicy,omitempty"` - // RetentionPolicy - Retention policy with the details on backup copy retention ranges. - RetentionPolicy BasicRetentionPolicy `json:"retentionPolicy,omitempty"` -} - -// UnmarshalJSON is the custom unmarshaler for SubProtectionPolicy struct. -func (spp *SubProtectionPolicy) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "policyType": - if v != nil { - var policyType PolicyType - err = json.Unmarshal(*v, &policyType) - if err != nil { - return err - } - spp.PolicyType = policyType - } - case "schedulePolicy": - if v != nil { - schedulePolicy, err := unmarshalBasicSchedulePolicy(*v) - if err != nil { - return err - } - spp.SchedulePolicy = schedulePolicy - } - case "retentionPolicy": - if v != nil { - retentionPolicy, err := unmarshalBasicRetentionPolicy(*v) - if err != nil { - return err - } - spp.RetentionPolicy = retentionPolicy - } - } - } - - return nil -} - -// TargetAFSRestoreInfo target Azure File Share Info. -type TargetAFSRestoreInfo struct { - // Name - File share name - Name *string `json:"name,omitempty"` - // TargetResourceID - Target file share resource ARM ID - TargetResourceID *string `json:"targetResourceId,omitempty"` -} - -// TargetRestoreInfo details about target workload during restore operation. -type TargetRestoreInfo struct { - // OverwriteOption - Can Overwrite if Target DataBase already exists. Possible values include: 'OverwriteOptionsInvalid', 'OverwriteOptionsFailOnConflict', 'OverwriteOptionsOverwrite' - OverwriteOption OverwriteOptions `json:"overwriteOption,omitempty"` - // ContainerID - Resource Id name of the container in which Target DataBase resides - ContainerID *string `json:"containerId,omitempty"` - // DatabaseName - Database name InstanceName/DataBaseName for SQL or System/DbName for SAP Hana - DatabaseName *string `json:"databaseName,omitempty"` -} - // TokenInformation the token information details. type TokenInformation struct { autorest.Response `json:"-"` @@ -16219,24 +7910,6 @@ type TokenInformation struct { SecurityPIN *string `json:"securityPIN,omitempty"` } -// WeeklyRetentionFormat weekly retention format. -type WeeklyRetentionFormat struct { - // DaysOfTheWeek - List of days of the week. - DaysOfTheWeek *[]DayOfWeek `json:"daysOfTheWeek,omitempty"` - // WeeksOfTheMonth - List of weeks of month. - WeeksOfTheMonth *[]WeekOfMonth `json:"weeksOfTheMonth,omitempty"` -} - -// WeeklyRetentionSchedule weekly retention schedule. -type WeeklyRetentionSchedule struct { - // DaysOfTheWeek - List of days of week for weekly retention policy. - DaysOfTheWeek *[]DayOfWeek `json:"daysOfTheWeek,omitempty"` - // RetentionTimes - Retention times of retention policy. - RetentionTimes *[]date.Time `json:"retentionTimes,omitempty"` - // RetentionDuration - Retention duration of retention Policy. - RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` -} - // WorkloadInquiryDetails details of an inquired protectable item. type WorkloadInquiryDetails struct { // Type - Type of the Workload such as SQL, Oracle etc. @@ -16672,7 +8345,6 @@ type BasicWorkloadProtectableItem interface { AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) - AsAzureVMWorkloadSAPAseDatabaseProtectableItem() (*AzureVMWorkloadSAPAseDatabaseProtectableItem, bool) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) @@ -16695,7 +8367,7 @@ type WorkloadProtectableItem struct { FriendlyName *string `json:"friendlyName,omitempty"` // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseDatabase', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` } @@ -16723,10 +8395,6 @@ func unmarshalBasicWorkloadProtectableItem(body []byte) (BasicWorkloadProtectabl var avwpi AzureVMWorkloadProtectableItem err := json.Unmarshal(body, &avwpi) return avwpi, err - case string(ProtectableItemTypeSAPAseDatabase): - var avwsadpi AzureVMWorkloadSAPAseDatabaseProtectableItem - err := json.Unmarshal(body, &avwsadpi) - return avwsadpi, err case string(ProtectableItemTypeSAPAseSystem): var avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem err := json.Unmarshal(body, &avwsaspi) @@ -16827,11 +8495,6 @@ func (wpi WorkloadProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (Basi return nil, false } -// AsAzureVMWorkloadSAPAseDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsAzureVMWorkloadSAPAseDatabaseProtectableItem() (*AzureVMWorkloadSAPAseDatabaseProtectableItem, bool) { - return nil, false -} - // AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. func (wpi WorkloadProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { return nil, false @@ -17140,19 +8803,3 @@ func (page WorkloadProtectableItemResourceListPage) Values() []WorkloadProtectab func NewWorkloadProtectableItemResourceListPage(getNextPage func(context.Context, WorkloadProtectableItemResourceList) (WorkloadProtectableItemResourceList, error)) WorkloadProtectableItemResourceListPage { return WorkloadProtectableItemResourceListPage{fn: getNextPage} } - -// YearlyRetentionSchedule yearly retention schedule. -type YearlyRetentionSchedule struct { - // RetentionScheduleFormatType - Retention schedule format for yearly retention policy. Possible values include: 'RetentionScheduleFormatInvalid', 'RetentionScheduleFormatDaily', 'RetentionScheduleFormatWeekly' - RetentionScheduleFormatType RetentionScheduleFormat `json:"retentionScheduleFormatType,omitempty"` - // MonthsOfYear - List of months of year of yearly retention policy. - MonthsOfYear *[]MonthOfYear `json:"monthsOfYear,omitempty"` - // RetentionScheduleDaily - Daily retention format for yearly retention policy. - RetentionScheduleDaily *DailyRetentionFormat `json:"retentionScheduleDaily,omitempty"` - // RetentionScheduleWeekly - Weekly retention format for yearly retention policy. - RetentionScheduleWeekly *WeeklyRetentionFormat `json:"retentionScheduleWeekly,omitempty"` - // RetentionTimes - Retention times of retention policy. - RetentionTimes *[]date.Time `json:"retentionTimes,omitempty"` - // RetentionDuration - Retention duration of retention Policy. - RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` -} diff --git a/services/recoveryservices/mgmt/2016-12-01/backup/protecteditemoperationresults.go b/services/recoveryservices/mgmt/2016-12-01/backup/protecteditemoperationresults.go deleted file mode 100644 index 36e8a5f7a368..000000000000 --- a/services/recoveryservices/mgmt/2016-12-01/backup/protecteditemoperationresults.go +++ /dev/null @@ -1,127 +0,0 @@ -package backup - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// ProtectedItemOperationResultsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type ProtectedItemOperationResultsClient struct { - BaseClient -} - -// NewProtectedItemOperationResultsClient creates an instance of the ProtectedItemOperationResultsClient client. -func NewProtectedItemOperationResultsClient(subscriptionID string) ProtectedItemOperationResultsClient { - return NewProtectedItemOperationResultsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewProtectedItemOperationResultsClientWithBaseURI creates an instance of the ProtectedItemOperationResultsClient -// client. -func NewProtectedItemOperationResultsClientWithBaseURI(baseURI string, subscriptionID string) ProtectedItemOperationResultsClient { - return ProtectedItemOperationResultsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get fetches the result of any operation on the backup item. -// Parameters: -// vaultName - the name of the recovery services vault. -// resourceGroupName - the name of the resource group where the recovery services vault is present. -// fabricName - fabric name associated with the backup item. -// containerName - container name associated with the backup item. -// protectedItemName - backup item name whose details are to be fetched. -// operationID - operationID which represents the operation whose result needs to be fetched. -func (client ProtectedItemOperationResultsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, operationID string) (result ProtectedItemResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectedItemOperationResultsClient.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, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, operationID) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectedItemOperationResultsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "backup.ProtectedItemOperationResultsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectedItemOperationResultsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ProtectedItemOperationResultsClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, operationID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "containerName": autorest.Encode("path", containerName), - "fabricName": autorest.Encode("path", fabricName), - "operationId": autorest.Encode("path", operationID), - "protectedItemName": autorest.Encode("path", protectedItemName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vaultName": autorest.Encode("path", vaultName), - } - - const APIVersion = "2016-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.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/operationResults/{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 ProtectedItemOperationResultsClient) 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 ProtectedItemOperationResultsClient) GetResponder(resp *http.Response) (result ProtectedItemResource, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/services/recoveryservices/mgmt/2016-12-01/backup/protecteditems.go b/services/recoveryservices/mgmt/2016-12-01/backup/protecteditems.go deleted file mode 100644 index 46f14c9d210a..000000000000 --- a/services/recoveryservices/mgmt/2016-12-01/backup/protecteditems.go +++ /dev/null @@ -1,302 +0,0 @@ -package backup - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// ProtectedItemsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type ProtectedItemsClient struct { - BaseClient -} - -// NewProtectedItemsClient creates an instance of the ProtectedItemsClient client. -func NewProtectedItemsClient(subscriptionID string) ProtectedItemsClient { - return NewProtectedItemsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewProtectedItemsClientWithBaseURI creates an instance of the ProtectedItemsClient client. -func NewProtectedItemsClientWithBaseURI(baseURI string, subscriptionID string) ProtectedItemsClient { - return ProtectedItemsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate enables backup of an item or to modifies the backup policy information of an already backed up item. -// This is an -// asynchronous operation. To know the status of the operation, call the GetItemOperationResult API. -// Parameters: -// vaultName - the name of the recovery services vault. -// resourceGroupName - the name of the resource group where the recovery services vault is present. -// fabricName - fabric name associated with the backup item. -// containerName - container name associated with the backup item. -// protectedItemName - item name to be backed up. -// parameters - resource backed up item -func (client ProtectedItemsClient) CreateOrUpdate(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, parameters ProtectedItemResource) (result ProtectedItemResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectedItemsClient.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, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectedItemsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "backup.ProtectedItemsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectedItemsClient", "CreateOrUpdate", resp, "Failure responding to request") - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ProtectedItemsClient) CreateOrUpdatePreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, parameters ProtectedItemResource) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "containerName": autorest.Encode("path", containerName), - "fabricName": autorest.Encode("path", fabricName), - "protectedItemName": autorest.Encode("path", protectedItemName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vaultName": autorest.Encode("path", vaultName), - } - - const APIVersion = "2016-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.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}", 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 ProtectedItemsClient) 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 ProtectedItemsClient) CreateOrUpdateResponder(resp *http.Response) (result ProtectedItemResource, 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 used to disable backup of an item within a container. This is an asynchronous operation. To know the status -// of the -// request, call the GetItemOperationResult API. -// Parameters: -// vaultName - the name of the recovery services vault. -// resourceGroupName - the name of the resource group where the recovery services vault is present. -// fabricName - fabric name associated with the backed up item. -// containerName - container name associated with the backed up item. -// protectedItemName - backed up item to be deleted. -func (client ProtectedItemsClient) Delete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectedItemsClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectedItemsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "backup.ProtectedItemsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectedItemsClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ProtectedItemsClient) DeletePreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "containerName": autorest.Encode("path", containerName), - "fabricName": autorest.Encode("path", fabricName), - "protectedItemName": autorest.Encode("path", protectedItemName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vaultName": autorest.Encode("path", vaultName), - } - - const APIVersion = "2016-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.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}", 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 ProtectedItemsClient) 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 ProtectedItemsClient) 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 provides the details of the backed up item. This is an asynchronous operation. To know the status of the -// operation, -// call the GetItemOperationResult API. -// Parameters: -// vaultName - the name of the recovery services vault. -// resourceGroupName - the name of the resource group where the recovery services vault is present. -// fabricName - fabric name associated with the backed up item. -// containerName - container name associated with the backed up item. -// protectedItemName - backed up item name whose details are to be fetched. -// filter - oData filter options. -func (client ProtectedItemsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (result ProtectedItemResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectedItemsClient.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, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectedItemsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "backup.ProtectedItemsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectedItemsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ProtectedItemsClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "containerName": autorest.Encode("path", containerName), - "fabricName": autorest.Encode("path", fabricName), - "protectedItemName": autorest.Encode("path", protectedItemName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vaultName": autorest.Encode("path", vaultName), - } - - const APIVersion = "2016-12-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.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}", 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 ProtectedItemsClient) 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 ProtectedItemsClient) GetResponder(resp *http.Response) (result ProtectedItemResource, 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/recoveryservices/mgmt/2016-12-01/backup/protectionpolicies.go b/services/recoveryservices/mgmt/2016-12-01/backup/protectionpolicies.go index 7b3f596249a3..91701ff371aa 100644 --- a/services/recoveryservices/mgmt/2016-12-01/backup/protectionpolicies.go +++ b/services/recoveryservices/mgmt/2016-12-01/backup/protectionpolicies.go @@ -40,90 +40,6 @@ func NewProtectionPoliciesClientWithBaseURI(baseURI string, subscriptionID strin return ProtectionPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate creates or modifies a backup policy. This is an asynchronous operation. Status of the operation can -// be fetched -// using GetPolicyOperationResult API. -// Parameters: -// vaultName - the name of the recovery services vault. -// resourceGroupName - the name of the resource group where the recovery services vault is present. -// policyName - backup policy to be created. -// parameters - resource backup policy -func (client ProtectionPoliciesClient) CreateOrUpdate(ctx context.Context, vaultName string, resourceGroupName string, policyName string, parameters ProtectionPolicyResource) (result ProtectionPolicyResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionPoliciesClient.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, vaultName, resourceGroupName, policyName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectionPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "backup.ProtectionPoliciesClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectionPoliciesClient", "CreateOrUpdate", resp, "Failure responding to request") - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ProtectionPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, vaultName string, resourceGroupName string, policyName string, parameters ProtectionPolicyResource) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "policyName": autorest.Encode("path", policyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vaultName": autorest.Encode("path", vaultName), - } - - const APIVersion = "2016-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.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ProtectionPoliciesClient) 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 ProtectionPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result ProtectionPolicyResource, 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 specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status // of the // operation can be fetched using GetPolicyOperationResult API. @@ -203,83 +119,3 @@ func (client ProtectionPoliciesClient) DeleteResponder(resp *http.Response) (res result.Response = resp return } - -// Get provides the details of the backup policies associated to Recovery Services Vault. This is an asynchronous -// operation. Status of the operation can be fetched using GetPolicyOperationResult API. -// Parameters: -// vaultName - the name of the recovery services vault. -// resourceGroupName - the name of the resource group where the recovery services vault is present. -// policyName - backup policy information to be fetched. -func (client ProtectionPoliciesClient) Get(ctx context.Context, vaultName string, resourceGroupName string, policyName string) (result ProtectionPolicyResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionPoliciesClient.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, vaultName, resourceGroupName, policyName) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectionPoliciesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "backup.ProtectionPoliciesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectionPoliciesClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ProtectionPoliciesClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, policyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "policyName": autorest.Encode("path", policyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vaultName": autorest.Encode("path", vaultName), - } - - const APIVersion = "2016-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.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ProtectionPoliciesClient) 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 ProtectionPoliciesClient) GetResponder(resp *http.Response) (result ProtectionPolicyResource, 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/recoveryservices/mgmt/2016-12-01/backup/protectionpolicyoperationresults.go b/services/recoveryservices/mgmt/2016-12-01/backup/protectionpolicyoperationresults.go deleted file mode 100644 index 2f5240a8235d..000000000000 --- a/services/recoveryservices/mgmt/2016-12-01/backup/protectionpolicyoperationresults.go +++ /dev/null @@ -1,123 +0,0 @@ -package backup - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// ProtectionPolicyOperationResultsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type ProtectionPolicyOperationResultsClient struct { - BaseClient -} - -// NewProtectionPolicyOperationResultsClient creates an instance of the ProtectionPolicyOperationResultsClient client. -func NewProtectionPolicyOperationResultsClient(subscriptionID string) ProtectionPolicyOperationResultsClient { - return NewProtectionPolicyOperationResultsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewProtectionPolicyOperationResultsClientWithBaseURI creates an instance of the -// ProtectionPolicyOperationResultsClient client. -func NewProtectionPolicyOperationResultsClientWithBaseURI(baseURI string, subscriptionID string) ProtectionPolicyOperationResultsClient { - return ProtectionPolicyOperationResultsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get provides the result of an operation. -// Parameters: -// vaultName - the name of the recovery services vault. -// resourceGroupName - the name of the resource group where the recovery services vault is present. -// policyName - backup policy name whose operation's result needs to be fetched. -// operationID - operation ID which represents the operation whose result needs to be fetched. -func (client ProtectionPolicyOperationResultsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, policyName string, operationID string) (result ProtectionPolicyResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionPolicyOperationResultsClient.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, vaultName, resourceGroupName, policyName, operationID) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectionPolicyOperationResultsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "backup.ProtectionPolicyOperationResultsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectionPolicyOperationResultsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ProtectionPolicyOperationResultsClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, policyName string, operationID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "operationId": autorest.Encode("path", operationID), - "policyName": autorest.Encode("path", policyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vaultName": autorest.Encode("path", vaultName), - } - - const APIVersion = "2016-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.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}/operationResults/{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 ProtectionPolicyOperationResultsClient) 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 ProtectionPolicyOperationResultsClient) GetResponder(resp *http.Response) (result ProtectionPolicyResource, 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/recoveryservices/mgmt/2016-12-01/backup/recoverypoints.go b/services/recoveryservices/mgmt/2016-12-01/backup/recoverypoints.go deleted file mode 100644 index d0ad1506b4e5..000000000000 --- a/services/recoveryservices/mgmt/2016-12-01/backup/recoverypoints.go +++ /dev/null @@ -1,253 +0,0 @@ -package backup - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// RecoveryPointsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type RecoveryPointsClient struct { - BaseClient -} - -// NewRecoveryPointsClient creates an instance of the RecoveryPointsClient client. -func NewRecoveryPointsClient(subscriptionID string) RecoveryPointsClient { - return NewRecoveryPointsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewRecoveryPointsClientWithBaseURI creates an instance of the RecoveryPointsClient client. -func NewRecoveryPointsClientWithBaseURI(baseURI string, subscriptionID string) RecoveryPointsClient { - return RecoveryPointsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get provides the information of the backed up data identified using RecoveryPointID. This is an asynchronous -// operation. -// To know the status of the operation, call the GetProtectedItemOperationResult API. -// Parameters: -// vaultName - the name of the recovery services vault. -// resourceGroupName - the name of the resource group where the recovery services vault is present. -// fabricName - fabric name associated with backed up item. -// containerName - container name associated with backed up item. -// protectedItemName - backed up item name whose backup data needs to be fetched. -// recoveryPointID - recoveryPointID represents the backed up data to be fetched. -func (client RecoveryPointsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string) (result RecoveryPointResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointsClient.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, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointID) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.RecoveryPointsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "backup.RecoveryPointsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.RecoveryPointsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client RecoveryPointsClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "containerName": autorest.Encode("path", containerName), - "fabricName": autorest.Encode("path", fabricName), - "protectedItemName": autorest.Encode("path", protectedItemName), - "recoveryPointId": autorest.Encode("path", recoveryPointID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vaultName": autorest.Encode("path", vaultName), - } - - const APIVersion = "2016-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.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}", 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 RecoveryPointsClient) 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 RecoveryPointsClient) GetResponder(resp *http.Response) (result RecoveryPointResource, 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 backup copies for the backed up item. -// Parameters: -// vaultName - the name of the recovery services vault. -// resourceGroupName - the name of the resource group where the recovery services vault is present. -// fabricName - fabric name associated with the backed up item. -// containerName - container name associated with the backed up item. -// protectedItemName - backed up item whose backup copies are to be fetched. -// filter - oData filter options. -func (client RecoveryPointsClient) List(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (result RecoveryPointResourceListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointsClient.List") - defer func() { - sc := -1 - if result.rprl.Response.Response != nil { - sc = result.rprl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.RecoveryPointsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.rprl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "backup.RecoveryPointsClient", "List", resp, "Failure sending request") - return - } - - result.rprl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.RecoveryPointsClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client RecoveryPointsClient) ListPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "containerName": autorest.Encode("path", containerName), - "fabricName": autorest.Encode("path", fabricName), - "protectedItemName": autorest.Encode("path", protectedItemName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vaultName": autorest.Encode("path", vaultName), - } - - const APIVersion = "2016-12-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.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints", 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 RecoveryPointsClient) 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 RecoveryPointsClient) ListResponder(resp *http.Response) (result RecoveryPointResourceList, 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 RecoveryPointsClient) listNextResults(ctx context.Context, lastResults RecoveryPointResourceList) (result RecoveryPointResourceList, err error) { - req, err := lastResults.recoveryPointResourceListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "backup.RecoveryPointsClient", "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, "backup.RecoveryPointsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.RecoveryPointsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client RecoveryPointsClient) ListComplete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (result RecoveryPointResourceListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointsClient.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, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter) - return -} diff --git a/services/recoveryservices/mgmt/2016-12-01/backup/resourcevaultconfigs.go b/services/recoveryservices/mgmt/2016-12-01/backup/resourcevaultconfigs.go deleted file mode 100644 index 3cb36b898367..000000000000 --- a/services/recoveryservices/mgmt/2016-12-01/backup/resourcevaultconfigs.go +++ /dev/null @@ -1,198 +0,0 @@ -package backup - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// ResourceVaultConfigsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type ResourceVaultConfigsClient struct { - BaseClient -} - -// NewResourceVaultConfigsClient creates an instance of the ResourceVaultConfigsClient client. -func NewResourceVaultConfigsClient(subscriptionID string) ResourceVaultConfigsClient { - return NewResourceVaultConfigsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewResourceVaultConfigsClientWithBaseURI creates an instance of the ResourceVaultConfigsClient client. -func NewResourceVaultConfigsClientWithBaseURI(baseURI string, subscriptionID string) ResourceVaultConfigsClient { - return ResourceVaultConfigsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get fetches resource vault config. -// Parameters: -// vaultName - the name of the recovery services vault. -// resourceGroupName - the name of the resource group where the recovery services vault is present. -func (client ResourceVaultConfigsClient) Get(ctx context.Context, vaultName string, resourceGroupName string) (result ResourceVaultConfigResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceVaultConfigsClient.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, vaultName, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ResourceVaultConfigsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "backup.ResourceVaultConfigsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ResourceVaultConfigsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ResourceVaultConfigsClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vaultName": autorest.Encode("path", vaultName), - } - - const APIVersion = "2016-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.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig", 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 ResourceVaultConfigsClient) 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 ResourceVaultConfigsClient) GetResponder(resp *http.Response) (result ResourceVaultConfigResource, 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 vault security config. -// Parameters: -// vaultName - the name of the recovery services vault. -// resourceGroupName - the name of the resource group where the recovery services vault is present. -// parameters - resource config request -func (client ResourceVaultConfigsClient) Update(ctx context.Context, vaultName string, resourceGroupName string, parameters ResourceVaultConfigResource) (result ResourceVaultConfigResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceVaultConfigsClient.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, vaultName, resourceGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ResourceVaultConfigsClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "backup.ResourceVaultConfigsClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ResourceVaultConfigsClient", "Update", resp, "Failure responding to request") - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client ResourceVaultConfigsClient) UpdatePreparer(ctx context.Context, vaultName string, resourceGroupName string, parameters ResourceVaultConfigResource) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vaultName": autorest.Encode("path", vaultName), - } - - const APIVersion = "2016-12-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.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig", 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 ResourceVaultConfigsClient) 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 ResourceVaultConfigsClient) UpdateResponder(resp *http.Response) (result ResourceVaultConfigResource, 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/recoveryservices/mgmt/2016-12-01/backup/restores.go b/services/recoveryservices/mgmt/2016-12-01/backup/restores.go deleted file mode 100644 index 211714201e84..000000000000 --- a/services/recoveryservices/mgmt/2016-12-01/backup/restores.go +++ /dev/null @@ -1,130 +0,0 @@ -package backup - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// RestoresClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type RestoresClient struct { - BaseClient -} - -// NewRestoresClient creates an instance of the RestoresClient client. -func NewRestoresClient(subscriptionID string) RestoresClient { - return NewRestoresClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewRestoresClientWithBaseURI creates an instance of the RestoresClient client. -func NewRestoresClientWithBaseURI(baseURI string, subscriptionID string) RestoresClient { - return RestoresClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Trigger restores the specified backed up data. This is an asynchronous operation. To know the status of this API -// call, use -// GetProtectedItemOperationResult API. -// Parameters: -// vaultName - the name of the recovery services vault. -// resourceGroupName - the name of the resource group where the recovery services vault is present. -// fabricName - fabric name associated with the backed up items. -// containerName - container name associated with the backed up items. -// protectedItemName - backed up item to be restored. -// recoveryPointID - recovery point ID which represents the backed up data to be restored. -// parameters - resource restore request -func (client RestoresClient) Trigger(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, parameters RestoreRequestResource) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RestoresClient.Trigger") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.TriggerPreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointID, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.RestoresClient", "Trigger", nil, "Failure preparing request") - return - } - - resp, err := client.TriggerSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "backup.RestoresClient", "Trigger", resp, "Failure sending request") - return - } - - result, err = client.TriggerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.RestoresClient", "Trigger", resp, "Failure responding to request") - } - - return -} - -// TriggerPreparer prepares the Trigger request. -func (client RestoresClient) TriggerPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, parameters RestoreRequestResource) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "containerName": autorest.Encode("path", containerName), - "fabricName": autorest.Encode("path", fabricName), - "protectedItemName": autorest.Encode("path", protectedItemName), - "recoveryPointId": autorest.Encode("path", recoveryPointID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vaultName": autorest.Encode("path", vaultName), - } - - const APIVersion = "2016-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.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/restore", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// TriggerSender sends the Trigger request. The method will close the -// http.Response Body if it receives an error. -func (client RestoresClient) TriggerSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// TriggerResponder handles the response to the Trigger request. The method always -// closes the http.Response Body. -func (client RestoresClient) TriggerResponder(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/recoveryservices/mgmt/2017-07-01/backup/backupapi/interfaces.go b/services/recoveryservices/mgmt/2017-07-01/backup/backupapi/interfaces.go index ce0f9b5f6e0e..8a0c7af940db 100644 --- a/services/recoveryservices/mgmt/2017-07-01/backup/backupapi/interfaces.go +++ b/services/recoveryservices/mgmt/2017-07-01/backup/backupapi/interfaces.go @@ -23,29 +23,67 @@ import ( "github.com/Azure/go-autorest/autorest" ) -// ProtectionIntentClientAPI contains the set of methods on the ProtectionIntentClient type. -type ProtectionIntentClientAPI interface { - CreateOrUpdate(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, intentObjectName string, parameters backup.ProtectionIntentResource) (result backup.ProtectionIntentResource, err error) - Delete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, intentObjectName string) (result autorest.Response, err error) - Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, intentObjectName string) (result backup.ProtectionIntentResource, err error) - Validate(ctx context.Context, azureRegion string, parameters backup.PreValidateEnableBackupRequest) (result backup.PreValidateEnableBackupResponse, err error) +// ResourceVaultConfigsClientAPI contains the set of methods on the ResourceVaultConfigsClient type. +type ResourceVaultConfigsClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string) (result backup.ResourceVaultConfigResource, err error) + Update(ctx context.Context, vaultName string, resourceGroupName string, parameters backup.ResourceVaultConfigResource) (result backup.ResourceVaultConfigResource, err error) } -var _ ProtectionIntentClientAPI = (*backup.ProtectionIntentClient)(nil) +var _ ResourceVaultConfigsClientAPI = (*backup.ResourceVaultConfigsClient)(nil) -// StatusClientAPI contains the set of methods on the StatusClient type. -type StatusClientAPI interface { - Get(ctx context.Context, azureRegion string, parameters backup.StatusRequest) (result backup.StatusResponse, err error) +// ProtectedItemsClientAPI contains the set of methods on the ProtectedItemsClient type. +type ProtectedItemsClientAPI interface { + CreateOrUpdate(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, parameters backup.ProtectedItemResource) (result backup.ProtectedItemResource, err error) + Delete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string) (result autorest.Response, err error) + Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (result backup.ProtectedItemResource, err error) } -var _ StatusClientAPI = (*backup.StatusClient)(nil) +var _ ProtectedItemsClientAPI = (*backup.ProtectedItemsClient)(nil) -// FeatureSupportClientAPI contains the set of methods on the FeatureSupportClient type. -type FeatureSupportClientAPI interface { - Validate(ctx context.Context, azureRegion string, parameters backup.BasicFeatureSupportRequest) (result backup.AzureVMResourceFeatureSupportResponse, err error) +// ProtectedItemOperationResultsClientAPI contains the set of methods on the ProtectedItemOperationResultsClient type. +type ProtectedItemOperationResultsClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, operationID string) (result backup.ProtectedItemResource, err error) } -var _ FeatureSupportClientAPI = (*backup.FeatureSupportClient)(nil) +var _ ProtectedItemOperationResultsClientAPI = (*backup.ProtectedItemOperationResultsClient)(nil) + +// RecoveryPointsClientAPI contains the set of methods on the RecoveryPointsClient type. +type RecoveryPointsClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string) (result backup.RecoveryPointResource, err error) + List(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (result backup.RecoveryPointResourceListPage, err error) +} + +var _ RecoveryPointsClientAPI = (*backup.RecoveryPointsClient)(nil) + +// RestoresClientAPI contains the set of methods on the RestoresClient type. +type RestoresClientAPI interface { + Trigger(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, parameters backup.RestoreRequestResource) (result autorest.Response, err error) +} + +var _ RestoresClientAPI = (*backup.RestoresClient)(nil) + +// PoliciesClientAPI contains the set of methods on the PoliciesClient type. +type PoliciesClientAPI interface { + List(ctx context.Context, vaultName string, resourceGroupName string, filter string) (result backup.ProtectionPolicyResourceListPage, err error) +} + +var _ PoliciesClientAPI = (*backup.PoliciesClient)(nil) + +// ProtectionPoliciesClientAPI contains the set of methods on the ProtectionPoliciesClient type. +type ProtectionPoliciesClientAPI interface { + CreateOrUpdate(ctx context.Context, vaultName string, resourceGroupName string, policyName string, parameters backup.ProtectionPolicyResource) (result backup.ProtectionPolicyResource, err error) + Delete(ctx context.Context, vaultName string, resourceGroupName string, policyName string) (result autorest.Response, err error) + Get(ctx context.Context, vaultName string, resourceGroupName string, policyName string) (result backup.ProtectionPolicyResource, err error) +} + +var _ ProtectionPoliciesClientAPI = (*backup.ProtectionPoliciesClient)(nil) + +// ProtectionPolicyOperationResultsClientAPI contains the set of methods on the ProtectionPolicyOperationResultsClient type. +type ProtectionPolicyOperationResultsClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string, policyName string, operationID string) (result backup.ProtectionPolicyResource, err error) +} + +var _ ProtectionPolicyOperationResultsClientAPI = (*backup.ProtectionPolicyOperationResultsClient)(nil) // JobsClientAPI contains the set of methods on the JobsClient type. type JobsClientAPI interface { @@ -61,6 +99,20 @@ type JobDetailsClientAPI interface { var _ JobDetailsClientAPI = (*backup.JobDetailsClient)(nil) +// JobCancellationsClientAPI contains the set of methods on the JobCancellationsClient type. +type JobCancellationsClientAPI interface { + Trigger(ctx context.Context, vaultName string, resourceGroupName string, jobName string) (result autorest.Response, err error) +} + +var _ JobCancellationsClientAPI = (*backup.JobCancellationsClient)(nil) + +// JobOperationResultsClientAPI contains the set of methods on the JobOperationResultsClient type. +type JobOperationResultsClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string, jobName string, operationID string) (result autorest.Response, err error) +} + +var _ JobOperationResultsClientAPI = (*backup.JobOperationResultsClient)(nil) + // ExportJobsOperationResultsClientAPI contains the set of methods on the ExportJobsOperationResultsClient type. type ExportJobsOperationResultsClientAPI interface { Get(ctx context.Context, vaultName string, resourceGroupName string, operationID string) (result backup.OperationResultInfoBaseResource, err error) @@ -75,19 +127,43 @@ type JobsGroupClientAPI interface { var _ JobsGroupClientAPI = (*backup.JobsGroupClient)(nil) -// PoliciesClientAPI contains the set of methods on the PoliciesClient type. -type PoliciesClientAPI interface { - List(ctx context.Context, vaultName string, resourceGroupName string, filter string) (result backup.ProtectionPolicyResourceListPage, err error) +// ProtectedItemsGroupClientAPI contains the set of methods on the ProtectedItemsGroupClient type. +type ProtectedItemsGroupClientAPI interface { + List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.ProtectedItemResourceListPage, err error) } -var _ PoliciesClientAPI = (*backup.PoliciesClient)(nil) +var _ ProtectedItemsGroupClientAPI = (*backup.ProtectedItemsGroupClient)(nil) -// ProtectedItemsClientAPI contains the set of methods on the ProtectedItemsClient type. -type ProtectedItemsClientAPI interface { - List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.ProtectedItemResourceListPage, err error) +// OperationClientAPI contains the set of methods on the OperationClient type. +type OperationClientAPI interface { + Validate(ctx context.Context, vaultName string, resourceGroupName string, parameters backup.BasicValidateOperationRequest) (result backup.ValidateOperationsResponse, err error) } -var _ ProtectedItemsClientAPI = (*backup.ProtectedItemsClient)(nil) +var _ OperationClientAPI = (*backup.OperationClient)(nil) + +// ProtectionIntentClientAPI contains the set of methods on the ProtectionIntentClient type. +type ProtectionIntentClientAPI interface { + CreateOrUpdate(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, intentObjectName string, parameters backup.ProtectionIntentResource) (result backup.ProtectionIntentResource, err error) + Delete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, intentObjectName string) (result autorest.Response, err error) + Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, intentObjectName string) (result backup.ProtectionIntentResource, err error) + Validate(ctx context.Context, azureRegion string, parameters backup.PreValidateEnableBackupRequest) (result backup.PreValidateEnableBackupResponse, err error) +} + +var _ ProtectionIntentClientAPI = (*backup.ProtectionIntentClient)(nil) + +// StatusClientAPI contains the set of methods on the StatusClient type. +type StatusClientAPI interface { + Get(ctx context.Context, azureRegion string, parameters backup.StatusRequest) (result backup.StatusResponse, err error) +} + +var _ StatusClientAPI = (*backup.StatusClient)(nil) + +// FeatureSupportClientAPI contains the set of methods on the FeatureSupportClient type. +type FeatureSupportClientAPI interface { + Validate(ctx context.Context, azureRegion string, parameters backup.BasicFeatureSupportRequest) (result backup.AzureVMResourceFeatureSupportResponse, err error) +} + +var _ FeatureSupportClientAPI = (*backup.FeatureSupportClient)(nil) // ProtectionIntentGroupClientAPI contains the set of methods on the ProtectionIntentGroupClient type. type ProtectionIntentGroupClientAPI interface { @@ -103,21 +179,6 @@ type UsageSummariesClientAPI interface { var _ UsageSummariesClientAPI = (*backup.UsageSummariesClient)(nil) -// OperationClientAPI contains the set of methods on the OperationClient type. -type OperationClientAPI interface { - Validate(ctx context.Context, vaultName string, resourceGroupName string, parameters backup.BasicValidateOperationRequest) (result backup.ValidateOperationsResponse, err error) -} - -var _ OperationClientAPI = (*backup.OperationClient)(nil) - -// ResourceVaultConfigsClientAPI contains the set of methods on the ResourceVaultConfigsClient type. -type ResourceVaultConfigsClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string) (result backup.ResourceVaultConfigResource, err error) - Update(ctx context.Context, vaultName string, resourceGroupName string, parameters backup.ResourceVaultConfigResource) (result backup.ResourceVaultConfigResource, err error) -} - -var _ ResourceVaultConfigsClientAPI = (*backup.ResourceVaultConfigsClient)(nil) - // EnginesClientAPI contains the set of methods on the EnginesClient type. type EnginesClientAPI interface { Get(ctx context.Context, vaultName string, resourceGroupName string, backupEngineName string, filter string, skipToken string) (result backup.EngineBaseResource, err error) @@ -165,15 +226,6 @@ type ProtectionContainerOperationResultsClientAPI interface { var _ ProtectionContainerOperationResultsClientAPI = (*backup.ProtectionContainerOperationResultsClient)(nil) -// ProtectedItemsGroupClientAPI contains the set of methods on the ProtectedItemsGroupClient type. -type ProtectedItemsGroupClientAPI interface { - CreateOrUpdate(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, parameters backup.ProtectedItemResource) (result backup.ProtectedItemResource, err error) - Delete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string) (result autorest.Response, err error) - Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (result backup.ProtectedItemResource, err error) -} - -var _ ProtectedItemsGroupClientAPI = (*backup.ProtectedItemsGroupClient)(nil) - // BackupsClientAPI contains the set of methods on the BackupsClient type. type BackupsClientAPI interface { Trigger(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, parameters backup.RequestResource) (result autorest.Response, err error) @@ -181,13 +233,6 @@ type BackupsClientAPI interface { var _ BackupsClientAPI = (*backup.BackupsClient)(nil) -// ProtectedItemOperationResultsClientAPI contains the set of methods on the ProtectedItemOperationResultsClient type. -type ProtectedItemOperationResultsClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, operationID string) (result backup.ProtectedItemResource, err error) -} - -var _ ProtectedItemOperationResultsClientAPI = (*backup.ProtectedItemOperationResultsClient)(nil) - // ProtectedItemOperationStatusesClientAPI contains the set of methods on the ProtectedItemOperationStatusesClient type. type ProtectedItemOperationStatusesClientAPI interface { Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, operationID string) (result backup.OperationStatus, err error) @@ -195,14 +240,6 @@ type ProtectedItemOperationStatusesClientAPI interface { var _ ProtectedItemOperationStatusesClientAPI = (*backup.ProtectedItemOperationStatusesClient)(nil) -// RecoveryPointsClientAPI contains the set of methods on the RecoveryPointsClient type. -type RecoveryPointsClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string) (result backup.RecoveryPointResource, err error) - List(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (result backup.RecoveryPointResourceListPage, err error) -} - -var _ RecoveryPointsClientAPI = (*backup.RecoveryPointsClient)(nil) - // ItemLevelRecoveryConnectionsClientAPI contains the set of methods on the ItemLevelRecoveryConnectionsClient type. type ItemLevelRecoveryConnectionsClientAPI interface { Provision(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, parameters backup.ILRRequestResource) (result autorest.Response, err error) @@ -211,27 +248,6 @@ type ItemLevelRecoveryConnectionsClientAPI interface { var _ ItemLevelRecoveryConnectionsClientAPI = (*backup.ItemLevelRecoveryConnectionsClient)(nil) -// RestoresClientAPI contains the set of methods on the RestoresClient type. -type RestoresClientAPI interface { - Trigger(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, parameters backup.RestoreRequestResource) (result autorest.Response, err error) -} - -var _ RestoresClientAPI = (*backup.RestoresClient)(nil) - -// JobCancellationsClientAPI contains the set of methods on the JobCancellationsClient type. -type JobCancellationsClientAPI interface { - Trigger(ctx context.Context, vaultName string, resourceGroupName string, jobName string) (result autorest.Response, err error) -} - -var _ JobCancellationsClientAPI = (*backup.JobCancellationsClient)(nil) - -// JobOperationResultsClientAPI contains the set of methods on the JobOperationResultsClient type. -type JobOperationResultsClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string, jobName string, operationID string) (result autorest.Response, err error) -} - -var _ JobOperationResultsClientAPI = (*backup.JobOperationResultsClient)(nil) - // OperationResultsClientAPI contains the set of methods on the OperationResultsClient type. type OperationResultsClientAPI interface { Get(ctx context.Context, vaultName string, resourceGroupName string, operationID string) (result autorest.Response, err error) @@ -246,22 +262,6 @@ type OperationStatusesClientAPI interface { var _ OperationStatusesClientAPI = (*backup.OperationStatusesClient)(nil) -// ProtectionPoliciesClientAPI contains the set of methods on the ProtectionPoliciesClient type. -type ProtectionPoliciesClientAPI interface { - CreateOrUpdate(ctx context.Context, vaultName string, resourceGroupName string, policyName string, parameters backup.ProtectionPolicyResource) (result backup.ProtectionPolicyResource, err error) - Delete(ctx context.Context, vaultName string, resourceGroupName string, policyName string) (result autorest.Response, err error) - Get(ctx context.Context, vaultName string, resourceGroupName string, policyName string) (result backup.ProtectionPolicyResource, err error) -} - -var _ ProtectionPoliciesClientAPI = (*backup.ProtectionPoliciesClient)(nil) - -// ProtectionPolicyOperationResultsClientAPI contains the set of methods on the ProtectionPolicyOperationResultsClient type. -type ProtectionPolicyOperationResultsClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string, policyName string, operationID string) (result backup.ProtectionPolicyResource, err error) -} - -var _ ProtectionPolicyOperationResultsClientAPI = (*backup.ProtectionPolicyOperationResultsClient)(nil) - // ProtectionPolicyOperationStatusesClientAPI contains the set of methods on the ProtectionPolicyOperationStatusesClient type. type ProtectionPolicyOperationStatusesClientAPI interface { Get(ctx context.Context, vaultName string, resourceGroupName string, policyName string, operationID string) (result backup.OperationStatus, err error) diff --git a/services/recoveryservices/mgmt/2017-07-01/backup/exportjobsoperationresults.go b/services/recoveryservices/mgmt/2017-07-01/backup/exportjobsoperationresults.go index a972227cefbb..18c3bc00319a 100644 --- a/services/recoveryservices/mgmt/2017-07-01/backup/exportjobsoperationresults.go +++ b/services/recoveryservices/mgmt/2017-07-01/backup/exportjobsoperationresults.go @@ -88,7 +88,7 @@ func (client ExportJobsOperationResultsClient) GetPreparer(ctx context.Context, "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2017-07-01" + const APIVersion = "2019-05-13" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2017-07-01/backup/jobcancellations.go b/services/recoveryservices/mgmt/2017-07-01/backup/jobcancellations.go index 9e6511d770f8..406e01345970 100644 --- a/services/recoveryservices/mgmt/2017-07-01/backup/jobcancellations.go +++ b/services/recoveryservices/mgmt/2017-07-01/backup/jobcancellations.go @@ -87,7 +87,7 @@ func (client JobCancellationsClient) TriggerPreparer(ctx context.Context, vaultN "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2019-05-13" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2017-07-01/backup/jobdetails.go b/services/recoveryservices/mgmt/2017-07-01/backup/jobdetails.go index d6a47f8ae05d..3a1c4bb385f1 100644 --- a/services/recoveryservices/mgmt/2017-07-01/backup/jobdetails.go +++ b/services/recoveryservices/mgmt/2017-07-01/backup/jobdetails.go @@ -86,7 +86,7 @@ func (client JobDetailsClient) GetPreparer(ctx context.Context, vaultName string "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2017-07-01" + const APIVersion = "2019-05-13" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2017-07-01/backup/joboperationresults.go b/services/recoveryservices/mgmt/2017-07-01/backup/joboperationresults.go index 2140da9fcca5..89b5865ac595 100644 --- a/services/recoveryservices/mgmt/2017-07-01/backup/joboperationresults.go +++ b/services/recoveryservices/mgmt/2017-07-01/backup/joboperationresults.go @@ -41,7 +41,6 @@ func NewJobOperationResultsClientWithBaseURI(baseURI string, subscriptionID stri } // Get fetches the result of any operation. -// the operation. // Parameters: // vaultName - the name of the recovery services vault. // resourceGroupName - the name of the resource group where the recovery services vault is present. @@ -89,7 +88,7 @@ func (client JobOperationResultsClient) GetPreparer(ctx context.Context, vaultNa "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2019-05-13" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2017-07-01/backup/jobs.go b/services/recoveryservices/mgmt/2017-07-01/backup/jobs.go index e2abb35c0938..e371ecfb1e01 100644 --- a/services/recoveryservices/mgmt/2017-07-01/backup/jobs.go +++ b/services/recoveryservices/mgmt/2017-07-01/backup/jobs.go @@ -87,7 +87,7 @@ func (client JobsClient) ListPreparer(ctx context.Context, vaultName string, res "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2017-07-01" + const APIVersion = "2019-05-13" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2017-07-01/backup/jobsgroup.go b/services/recoveryservices/mgmt/2017-07-01/backup/jobsgroup.go index 36452519997b..338edb73f8e9 100644 --- a/services/recoveryservices/mgmt/2017-07-01/backup/jobsgroup.go +++ b/services/recoveryservices/mgmt/2017-07-01/backup/jobsgroup.go @@ -85,7 +85,7 @@ func (client JobsGroupClient) ExportPreparer(ctx context.Context, vaultName stri "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2017-07-01" + const APIVersion = "2019-05-13" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2017-07-01/backup/models.go b/services/recoveryservices/mgmt/2017-07-01/backup/models.go index 90427aeb46f5..5f12336f208d 100644 --- a/services/recoveryservices/mgmt/2017-07-01/backup/models.go +++ b/services/recoveryservices/mgmt/2017-07-01/backup/models.go @@ -521,6 +521,8 @@ const ( JobOperationTypeBackup JobOperationType = "Backup" // JobOperationTypeConfigureBackup ... JobOperationTypeConfigureBackup JobOperationType = "ConfigureBackup" + // JobOperationTypeCrossRegionRestore ... + JobOperationTypeCrossRegionRestore JobOperationType = "CrossRegionRestore" // JobOperationTypeDeleteBackupData ... JobOperationTypeDeleteBackupData JobOperationType = "DeleteBackupData" // JobOperationTypeDisableBackup ... @@ -531,13 +533,15 @@ const ( JobOperationTypeRegister JobOperationType = "Register" // JobOperationTypeRestore ... JobOperationTypeRestore JobOperationType = "Restore" + // JobOperationTypeUndelete ... + JobOperationTypeUndelete JobOperationType = "Undelete" // JobOperationTypeUnRegister ... JobOperationTypeUnRegister JobOperationType = "UnRegister" ) // PossibleJobOperationTypeValues returns an array of possible values for the JobOperationType const type. func PossibleJobOperationTypeValues() []JobOperationType { - return []JobOperationType{JobOperationTypeBackup, JobOperationTypeConfigureBackup, JobOperationTypeDeleteBackupData, JobOperationTypeDisableBackup, JobOperationTypeInvalid, JobOperationTypeRegister, JobOperationTypeRestore, JobOperationTypeUnRegister} + return []JobOperationType{JobOperationTypeBackup, JobOperationTypeConfigureBackup, JobOperationTypeCrossRegionRestore, JobOperationTypeDeleteBackupData, JobOperationTypeDisableBackup, JobOperationTypeInvalid, JobOperationTypeRegister, JobOperationTypeRestore, JobOperationTypeUndelete, JobOperationTypeUnRegister} } // JobStatus enumerates the values for job status. @@ -777,6 +781,8 @@ func PossibleObjectTypeValues() []ObjectType { type ObjectTypeBasicILRRequest string const ( + // ObjectTypeAzureFileShareProvisionILRRequest ... + ObjectTypeAzureFileShareProvisionILRRequest ObjectTypeBasicILRRequest = "AzureFileShareProvisionILRRequest" // ObjectTypeIaasVMILRRegistrationRequest ... ObjectTypeIaasVMILRRegistrationRequest ObjectTypeBasicILRRequest = "IaasVMILRRegistrationRequest" // ObjectTypeILRRequest ... @@ -785,7 +791,7 @@ const ( // PossibleObjectTypeBasicILRRequestValues returns an array of possible values for the ObjectTypeBasicILRRequest const type. func PossibleObjectTypeBasicILRRequestValues() []ObjectTypeBasicILRRequest { - return []ObjectTypeBasicILRRequest{ObjectTypeIaasVMILRRegistrationRequest, ObjectTypeILRRequest} + return []ObjectTypeBasicILRRequest{ObjectTypeAzureFileShareProvisionILRRequest, ObjectTypeIaasVMILRRegistrationRequest, ObjectTypeILRRequest} } // ObjectTypeBasicOperationStatusExtendedInfo enumerates the values for object type basic operation status @@ -1012,8 +1018,6 @@ const ( ProtectableItemTypeMicrosoftClassicComputevirtualMachines ProtectableItemType = "Microsoft.ClassicCompute/virtualMachines" // ProtectableItemTypeMicrosoftComputevirtualMachines ... ProtectableItemTypeMicrosoftComputevirtualMachines ProtectableItemType = "Microsoft.Compute/virtualMachines" - // ProtectableItemTypeSAPAseDatabase ... - ProtectableItemTypeSAPAseDatabase ProtectableItemType = "SAPAseDatabase" // ProtectableItemTypeSAPAseSystem ... ProtectableItemTypeSAPAseSystem ProtectableItemType = "SAPAseSystem" // ProtectableItemTypeSAPHanaDatabase ... @@ -1032,7 +1036,7 @@ const ( // PossibleProtectableItemTypeValues returns an array of possible values for the ProtectableItemType const type. func PossibleProtectableItemTypeValues() []ProtectableItemType { - return []ProtectableItemType{ProtectableItemTypeAzureFileShare, ProtectableItemTypeAzureVMWorkloadProtectableItem, ProtectableItemTypeIaaSVMProtectableItem, ProtectableItemTypeMicrosoftClassicComputevirtualMachines, ProtectableItemTypeMicrosoftComputevirtualMachines, ProtectableItemTypeSAPAseDatabase, ProtectableItemTypeSAPAseSystem, ProtectableItemTypeSAPHanaDatabase, ProtectableItemTypeSAPHanaSystem, ProtectableItemTypeSQLAvailabilityGroupContainer, ProtectableItemTypeSQLDataBase, ProtectableItemTypeSQLInstance, ProtectableItemTypeWorkloadProtectableItem} + return []ProtectableItemType{ProtectableItemTypeAzureFileShare, ProtectableItemTypeAzureVMWorkloadProtectableItem, ProtectableItemTypeIaaSVMProtectableItem, ProtectableItemTypeMicrosoftClassicComputevirtualMachines, ProtectableItemTypeMicrosoftComputevirtualMachines, ProtectableItemTypeSAPAseSystem, ProtectableItemTypeSAPHanaDatabase, ProtectableItemTypeSAPHanaSystem, ProtectableItemTypeSQLAvailabilityGroupContainer, ProtectableItemTypeSQLDataBase, ProtectableItemTypeSQLInstance, ProtectableItemTypeWorkloadProtectableItem} } // ProtectedItemHealthStatus enumerates the values for protected item health status. @@ -1181,6 +1185,23 @@ func PossibleProtectionStatusValues() []ProtectionStatus { return []ProtectionStatus{ProtectionStatusInvalid, ProtectionStatusNotProtected, ProtectionStatusProtected, ProtectionStatusProtecting, ProtectionStatusProtectionFailed} } +// RecoveryMode enumerates the values for recovery mode. +type RecoveryMode string + +const ( + // RecoveryModeFileRecovery ... + RecoveryModeFileRecovery RecoveryMode = "FileRecovery" + // RecoveryModeInvalid ... + RecoveryModeInvalid RecoveryMode = "Invalid" + // RecoveryModeWorkloadRecovery ... + RecoveryModeWorkloadRecovery RecoveryMode = "WorkloadRecovery" +) + +// PossibleRecoveryModeValues returns an array of possible values for the RecoveryMode const type. +func PossibleRecoveryModeValues() []RecoveryMode { + return []RecoveryMode{RecoveryModeFileRecovery, RecoveryModeInvalid, RecoveryModeWorkloadRecovery} +} + // RecoveryPointTierStatus enumerates the values for recovery point tier status. type RecoveryPointTierStatus string @@ -1225,6 +1246,8 @@ const ( RecoveryTypeAlternateLocation RecoveryType = "AlternateLocation" // RecoveryTypeInvalid ... RecoveryTypeInvalid RecoveryType = "Invalid" + // RecoveryTypeOffline ... + RecoveryTypeOffline RecoveryType = "Offline" // RecoveryTypeOriginalLocation ... RecoveryTypeOriginalLocation RecoveryType = "OriginalLocation" // RecoveryTypeRestoreDisks ... @@ -1233,7 +1256,7 @@ const ( // PossibleRecoveryTypeValues returns an array of possible values for the RecoveryType const type. func PossibleRecoveryTypeValues() []RecoveryType { - return []RecoveryType{RecoveryTypeAlternateLocation, RecoveryTypeInvalid, RecoveryTypeOriginalLocation, RecoveryTypeRestoreDisks} + return []RecoveryType{RecoveryTypeAlternateLocation, RecoveryTypeInvalid, RecoveryTypeOffline, RecoveryTypeOriginalLocation, RecoveryTypeRestoreDisks} } // RestorePointQueryType enumerates the values for restore point query type. @@ -1386,6 +1409,23 @@ func PossibleScheduleRunTypeValues() []ScheduleRunType { return []ScheduleRunType{ScheduleRunTypeDaily, ScheduleRunTypeInvalid, ScheduleRunTypeWeekly} } +// SoftDeleteFeatureState enumerates the values for soft delete feature state. +type SoftDeleteFeatureState string + +const ( + // SoftDeleteFeatureStateDisabled ... + SoftDeleteFeatureStateDisabled SoftDeleteFeatureState = "Disabled" + // SoftDeleteFeatureStateEnabled ... + SoftDeleteFeatureStateEnabled SoftDeleteFeatureState = "Enabled" + // SoftDeleteFeatureStateInvalid ... + SoftDeleteFeatureStateInvalid SoftDeleteFeatureState = "Invalid" +) + +// PossibleSoftDeleteFeatureStateValues returns an array of possible values for the SoftDeleteFeatureState const type. +func PossibleSoftDeleteFeatureStateValues() []SoftDeleteFeatureState { + return []SoftDeleteFeatureState{SoftDeleteFeatureStateDisabled, SoftDeleteFeatureStateEnabled, SoftDeleteFeatureStateInvalid} +} + // SQLDataDirectoryType enumerates the values for sql data directory type. type SQLDataDirectoryType string @@ -1873,7 +1913,7 @@ type AzureBackupServerEngine struct { IsAzureBackupAgentUpgradeAvailable *bool `json:"isAzureBackupAgentUpgradeAvailable,omitempty"` // IsDpmUpgradeAvailable - To check if backup engine upgrade available IsDpmUpgradeAvailable *bool `json:"isDpmUpgradeAvailable,omitempty"` - // ExtendedInfo - Extended info of the backup engine + // ExtendedInfo - Extended info of the backupengine ExtendedInfo *EngineExtendedInfo `json:"extendedInfo,omitempty"` // BackupEngineType - Possible values include: 'BackupEngineTypeBackupEngineBase', 'BackupEngineTypeAzureBackupServerEngine', 'BackupEngineTypeDpmBackupEngine' BackupEngineType EngineType `json:"backupEngineType,omitempty"` @@ -2007,7 +2047,7 @@ type AzureFileShareProtectableItem struct { FriendlyName *string `json:"friendlyName,omitempty"` // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseDatabase', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` } @@ -2067,11 +2107,6 @@ func (afspi AzureFileShareProtectableItem) AsBasicAzureVMWorkloadProtectableItem return nil, false } -// AsAzureVMWorkloadSAPAseDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadSAPAseDatabaseProtectableItem() (*AzureVMWorkloadSAPAseDatabaseProtectableItem, bool) { - return nil, false -} - // AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { return nil, false @@ -2326,6 +2361,10 @@ type AzureFileshareProtectedItemExtendedInfo struct { RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"` // PolicyState - Indicates consistency of policy object and policy applied to this backup item. PolicyState *string `json:"policyState,omitempty"` + // ResourceState - READ-ONLY; Indicates the state of this resource. Possible values are from enum ResourceState {Invalid, Active, SoftDeleted, Deleted} + ResourceState *string `json:"resourceState,omitempty"` + // ResourceStateSyncTime - READ-ONLY; The resource state sync time for this backup item. + ResourceStateSyncTime *date.Time `json:"resourceStateSyncTime,omitempty"` } // AzureFileShareProtectionPolicy azureStorage backup policy. @@ -2340,7 +2379,7 @@ type AzureFileShareProtectionPolicy struct { TimeZone *string `json:"timeZone,omitempty"` // ProtectedItemsCount - Number of items associated with this policy. ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` - // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' + // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` } @@ -2365,6 +2404,11 @@ func (afspp AzureFileShareProtectionPolicy) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for AzureFileShareProtectionPolicy. +func (afspp AzureFileShareProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { + return nil, false +} + // AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for AzureFileShareProtectionPolicy. func (afspp AzureFileShareProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { return &afspp, true @@ -2380,11 +2424,6 @@ func (afspp AzureFileShareProtectionPolicy) AsAzureSQLProtectionPolicy() (*Azure return nil, false } -// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for AzureFileShareProtectionPolicy. -func (afspp AzureFileShareProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { - return nil, false -} - // AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for AzureFileShareProtectionPolicy. func (afspp AzureFileShareProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { return nil, false @@ -2472,14 +2511,63 @@ func (afspp *AzureFileShareProtectionPolicy) UnmarshalJSON(body []byte) error { return nil } +// AzureFileShareProvisionILRRequest update snapshot Uri with the correct friendly Name of the source Azure +// file share. +type AzureFileShareProvisionILRRequest struct { + // RecoveryPointID - Recovery point ID. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` + // SourceResourceID - Source Storage account ARM Id + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeILRRequest', 'ObjectTypeAzureFileShareProvisionILRRequest', 'ObjectTypeIaasVMILRRegistrationRequest' + ObjectType ObjectTypeBasicILRRequest `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFileShareProvisionILRRequest. +func (afspir AzureFileShareProvisionILRRequest) MarshalJSON() ([]byte, error) { + afspir.ObjectType = ObjectTypeAzureFileShareProvisionILRRequest + objectMap := make(map[string]interface{}) + if afspir.RecoveryPointID != nil { + objectMap["recoveryPointId"] = afspir.RecoveryPointID + } + if afspir.SourceResourceID != nil { + objectMap["sourceResourceId"] = afspir.SourceResourceID + } + if afspir.ObjectType != "" { + objectMap["objectType"] = afspir.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProvisionILRRequest is the BasicILRRequest implementation for AzureFileShareProvisionILRRequest. +func (afspir AzureFileShareProvisionILRRequest) AsAzureFileShareProvisionILRRequest() (*AzureFileShareProvisionILRRequest, bool) { + return &afspir, true +} + +// AsIaasVMILRRegistrationRequest is the BasicILRRequest implementation for AzureFileShareProvisionILRRequest. +func (afspir AzureFileShareProvisionILRRequest) AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) { + return nil, false +} + +// AsILRRequest is the BasicILRRequest implementation for AzureFileShareProvisionILRRequest. +func (afspir AzureFileShareProvisionILRRequest) AsILRRequest() (*ILRRequest, bool) { + return nil, false +} + +// AsBasicILRRequest is the BasicILRRequest implementation for AzureFileShareProvisionILRRequest. +func (afspir AzureFileShareProvisionILRRequest) AsBasicILRRequest() (BasicILRRequest, bool) { + return &afspir, true +} + // AzureFileShareRecoveryPoint azure File Share workload specific backup copy. type AzureFileShareRecoveryPoint struct { - // RecoveryPointType - Type of the backup copy. Specifies whether it is a crash consistent backup or app consistent. + // RecoveryPointType - READ-ONLY; Type of the backup copy. Specifies whether it is a crash consistent backup or app consistent. RecoveryPointType *string `json:"recoveryPointType,omitempty"` - // RecoveryPointTime - Time at which this backup copy was created. + // RecoveryPointTime - READ-ONLY; Time at which this backup copy was created. RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` - // FileShareSnapshotURI - Contains Url to the snapshot of fileshare, if applicable + // FileShareSnapshotURI - READ-ONLY; Contains Url to the snapshot of fileshare, if applicable FileShareSnapshotURI *string `json:"fileShareSnapshotUri,omitempty"` + // RecoveryPointSizeInGB - READ-ONLY; Contains recovery point size + RecoveryPointSizeInGB *int32 `json:"recoveryPointSizeInGB,omitempty"` // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` } @@ -2488,15 +2576,6 @@ type AzureFileShareRecoveryPoint struct { func (afsrp AzureFileShareRecoveryPoint) MarshalJSON() ([]byte, error) { afsrp.ObjectType = ObjectTypeAzureFileShareRecoveryPoint objectMap := make(map[string]interface{}) - if afsrp.RecoveryPointType != nil { - objectMap["recoveryPointType"] = afsrp.RecoveryPointType - } - if afsrp.RecoveryPointTime != nil { - objectMap["recoveryPointTime"] = afsrp.RecoveryPointTime - } - if afsrp.FileShareSnapshotURI != nil { - objectMap["fileShareSnapshotUri"] = afsrp.FileShareSnapshotURI - } if afsrp.ObjectType != "" { objectMap["objectType"] = afsrp.ObjectType } @@ -2575,7 +2654,7 @@ func (afsrp AzureFileShareRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPo // AzureFileShareRestoreRequest azureFileShare Restore Request type AzureFileShareRestoreRequest struct { - // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks' + // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' RecoveryType RecoveryType `json:"recoveryType,omitempty"` // SourceResourceID - Source storage account ARM Id SourceResourceID *string `json:"sourceResourceId,omitempty"` @@ -2834,7 +2913,7 @@ type AzureIaaSClassicComputeVMProtectableItem struct { FriendlyName *string `json:"friendlyName,omitempty"` // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseDatabase', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` } @@ -2888,11 +2967,6 @@ func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsBasicAzureVMWorkloadP return nil, false } -// AsAzureVMWorkloadSAPAseDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSAPAseDatabaseProtectableItem() (*AzureVMWorkloadSAPAseDatabaseProtectableItem, bool) { - return nil, false -} - // AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { return nil, false @@ -2965,7 +3039,8 @@ type AzureIaaSClassicComputeVMProtectedItem struct { // ProtectedItemDataID - Data ID of the protected item. ProtectedItemDataID *string `json:"protectedItemDataId,omitempty"` // ExtendedInfo - Additional information for this backup item. - ExtendedInfo *AzureIaaSVMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + ExtendedInfo *AzureIaaSVMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + ExtendedProperties *ExtendedProperties `json:"extendedProperties,omitempty"` // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' BackupManagementType ManagementType `json:"backupManagementType,omitempty"` // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' @@ -3030,6 +3105,9 @@ func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) MarshalJSON() ([]byte, er if aisccvpi.ExtendedInfo != nil { objectMap["extendedInfo"] = aisccvpi.ExtendedInfo } + if aisccvpi.ExtendedProperties != nil { + objectMap["extendedProperties"] = aisccvpi.ExtendedProperties + } if aisccvpi.BackupManagementType != "" { objectMap["backupManagementType"] = aisccvpi.BackupManagementType } @@ -3305,7 +3383,7 @@ type AzureIaaSComputeVMProtectableItem struct { FriendlyName *string `json:"friendlyName,omitempty"` // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseDatabase', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` } @@ -3359,11 +3437,6 @@ func (aiscvpi AzureIaaSComputeVMProtectableItem) AsBasicAzureVMWorkloadProtectab return nil, false } -// AsAzureVMWorkloadSAPAseDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSAPAseDatabaseProtectableItem() (*AzureVMWorkloadSAPAseDatabaseProtectableItem, bool) { - return nil, false -} - // AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { return nil, false @@ -3436,7 +3509,8 @@ type AzureIaaSComputeVMProtectedItem struct { // ProtectedItemDataID - Data ID of the protected item. ProtectedItemDataID *string `json:"protectedItemDataId,omitempty"` // ExtendedInfo - Additional information for this backup item. - ExtendedInfo *AzureIaaSVMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + ExtendedInfo *AzureIaaSVMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + ExtendedProperties *ExtendedProperties `json:"extendedProperties,omitempty"` // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' BackupManagementType ManagementType `json:"backupManagementType,omitempty"` // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' @@ -3501,6 +3575,9 @@ func (aiscvpi AzureIaaSComputeVMProtectedItem) MarshalJSON() ([]byte, error) { if aiscvpi.ExtendedInfo != nil { objectMap["extendedInfo"] = aiscvpi.ExtendedInfo } + if aiscvpi.ExtendedProperties != nil { + objectMap["extendedProperties"] = aiscvpi.ExtendedProperties + } if aiscvpi.BackupManagementType != "" { objectMap["backupManagementType"] = aiscvpi.BackupManagementType } @@ -3628,25 +3705,25 @@ func (aiscvpi AzureIaaSComputeVMProtectedItem) AsBasicProtectedItem() (BasicProt // AzureIaaSVMErrorInfo azure IaaS VM workload-specific error information. type AzureIaaSVMErrorInfo struct { - // ErrorCode - Error code. + // ErrorCode - READ-ONLY; Error code. ErrorCode *int32 `json:"errorCode,omitempty"` - // ErrorTitle - Title: Typically, the entity that the error pertains to. + // ErrorTitle - READ-ONLY; Title: Typically, the entity that the error pertains to. ErrorTitle *string `json:"errorTitle,omitempty"` - // ErrorString - Localized error string. + // ErrorString - READ-ONLY; Localized error string. ErrorString *string `json:"errorString,omitempty"` - // Recommendations - List of localized recommendations for above error code. + // Recommendations - READ-ONLY; List of localized recommendations for above error code. Recommendations *[]string `json:"recommendations,omitempty"` } // AzureIaaSVMHealthDetails azure IaaS VM workload-specific Health Details. type AzureIaaSVMHealthDetails struct { - // Code - Health Code + // Code - READ-ONLY; Health Code Code *int32 `json:"code,omitempty"` - // Title - Health Title + // Title - READ-ONLY; Health Title Title *string `json:"title,omitempty"` - // Message - Health Message + // Message - READ-ONLY; Health Message Message *string `json:"message,omitempty"` - // Recommendations - Health Recommended Actions + // Recommendations - READ-ONLY; Health Recommended Actions Recommendations *[]string `json:"recommendations,omitempty"` } @@ -3850,7 +3927,8 @@ type AzureIaaSVMProtectedItem struct { // ProtectedItemDataID - Data ID of the protected item. ProtectedItemDataID *string `json:"protectedItemDataId,omitempty"` // ExtendedInfo - Additional information for this backup item. - ExtendedInfo *AzureIaaSVMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + ExtendedInfo *AzureIaaSVMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + ExtendedProperties *ExtendedProperties `json:"extendedProperties,omitempty"` // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' BackupManagementType ManagementType `json:"backupManagementType,omitempty"` // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' @@ -3956,6 +4034,9 @@ func (aispi AzureIaaSVMProtectedItem) MarshalJSON() ([]byte, error) { if aispi.ExtendedInfo != nil { objectMap["extendedInfo"] = aispi.ExtendedInfo } + if aispi.ExtendedProperties != nil { + objectMap["extendedProperties"] = aispi.ExtendedProperties + } if aispi.BackupManagementType != "" { objectMap["backupManagementType"] = aispi.BackupManagementType } @@ -4103,7 +4184,7 @@ type AzureIaaSVMProtectionPolicy struct { TimeZone *string `json:"timeZone,omitempty"` // ProtectedItemsCount - Number of items associated with this policy. ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` - // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' + // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` } @@ -4128,6 +4209,11 @@ func (aispp AzureIaaSVMProtectionPolicy) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy. +func (aispp AzureIaaSVMProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { + return nil, false +} + // AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy. func (aispp AzureIaaSVMProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { return nil, false @@ -4143,11 +4229,6 @@ func (aispp AzureIaaSVMProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQL return nil, false } -// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy. -func (aispp AzureIaaSVMProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { - return nil, false -} - // AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy. func (aispp AzureIaaSVMProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { return nil, false @@ -4910,7 +4991,7 @@ type AzureSQLProtectionPolicy struct { RetentionPolicy BasicRetentionPolicy `json:"retentionPolicy,omitempty"` // ProtectedItemsCount - Number of items associated with this policy. ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` - // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' + // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` } @@ -4928,6 +5009,11 @@ func (aspp AzureSQLProtectionPolicy) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. +func (aspp AzureSQLProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { + return nil, false +} + // AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. func (aspp AzureSQLProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { return nil, false @@ -4943,11 +5029,6 @@ func (aspp AzureSQLProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProt return &aspp, true } -// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. -func (aspp AzureSQLProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { - return nil, false -} - // AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. func (aspp AzureSQLProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { return nil, false @@ -5639,9 +5720,9 @@ type AzureVMWorkloadItem struct { ServerName *string `json:"serverName,omitempty"` // IsAutoProtectable - Indicates if workload item is auto-protectable IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DBs present + // Subinquireditemcount - For instance or AG, indicates number of DB's present Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // SubWorkloadItemCount - For instance or AG, indicates number of DBs to be protected + // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` // BackupManagementType - Type of backup management to backup an item. BackupManagementType *string `json:"backupManagementType,omitempty"` @@ -5801,7 +5882,6 @@ func (avwi AzureVMWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) // BasicAzureVMWorkloadProtectableItem azure VM workload-specific protectable item. type BasicAzureVMWorkloadProtectableItem interface { - AsAzureVMWorkloadSAPAseDatabaseProtectableItem() (*AzureVMWorkloadSAPAseDatabaseProtectableItem, bool) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) @@ -5824,9 +5904,9 @@ type AzureVMWorkloadProtectableItem struct { IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` // IsAutoProtected - Indicates if protectable item is auto-protected IsAutoProtected *bool `json:"isAutoProtected,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DBs present + // Subinquireditemcount - For instance or AG, indicates number of DB's present Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // Subprotectableitemcount - For instance or AG, indicates number of DBs to be protected + // Subprotectableitemcount - For instance or AG, indicates number of DB's to be protected Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` // Prebackupvalidation - Pre-backup validation for protectable objects Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` @@ -5838,7 +5918,7 @@ type AzureVMWorkloadProtectableItem struct { FriendlyName *string `json:"friendlyName,omitempty"` // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseDatabase', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` } @@ -5850,10 +5930,6 @@ func unmarshalBasicAzureVMWorkloadProtectableItem(body []byte) (BasicAzureVMWork } switch m["protectableItemType"] { - case string(ProtectableItemTypeSAPAseDatabase): - var avwsadpi AzureVMWorkloadSAPAseDatabaseProtectableItem - err := json.Unmarshal(body, &avwsadpi) - return avwsadpi, err case string(ProtectableItemTypeSAPAseSystem): var avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem err := json.Unmarshal(body, &avwsaspi) @@ -5974,11 +6050,6 @@ func (avwpi AzureVMWorkloadProtectableItem) AsBasicAzureVMWorkloadProtectableIte return &avwpi, true } -// AsAzureVMWorkloadSAPAseDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSAPAseDatabaseProtectableItem() (*AzureVMWorkloadSAPAseDatabaseProtectableItem, bool) { - return nil, false -} - // AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { return nil, false @@ -6322,9 +6393,11 @@ type AzureVMWorkloadProtectionPolicy struct { Settings *Settings `json:"settings,omitempty"` // SubProtectionPolicy - List of sub-protection policies which includes schedule and retention SubProtectionPolicy *[]SubProtectionPolicy `json:"subProtectionPolicy,omitempty"` + // MakePolicyConsistent - Fix the policy inconsistency + MakePolicyConsistent *bool `json:"makePolicyConsistent,omitempty"` // ProtectedItemsCount - Number of items associated with this policy. ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` - // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' + // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` } @@ -6341,6 +6414,9 @@ func (avwpp AzureVMWorkloadProtectionPolicy) MarshalJSON() ([]byte, error) { if avwpp.SubProtectionPolicy != nil { objectMap["subProtectionPolicy"] = avwpp.SubProtectionPolicy } + if avwpp.MakePolicyConsistent != nil { + objectMap["makePolicyConsistent"] = avwpp.MakePolicyConsistent + } if avwpp.ProtectedItemsCount != nil { objectMap["protectedItemsCount"] = avwpp.ProtectedItemsCount } @@ -6350,6 +6426,11 @@ func (avwpp AzureVMWorkloadProtectionPolicy) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { + return &avwpp, true +} + // AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. func (avwpp AzureVMWorkloadProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { return nil, false @@ -6365,11 +6446,6 @@ func (avwpp AzureVMWorkloadProtectionPolicy) AsAzureSQLProtectionPolicy() (*Azur return nil, false } -// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. -func (avwpp AzureVMWorkloadProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { - return &avwpp, true -} - // AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. func (avwpp AzureVMWorkloadProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { return nil, false @@ -6390,164 +6466,6 @@ func (avwpp AzureVMWorkloadProtectionPolicy) AsBasicProtectionPolicy() (BasicPro return &avwpp, true } -// AzureVMWorkloadSAPAseDatabaseProtectableItem azure VM workload-specific protectable item representing -// SAP ASE Database. -type AzureVMWorkloadSAPAseDatabaseProtectableItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent - // Only Applicable for data bases where the parent would be either Instance or a SQL AG. - ParentUniqueName *string `json:"parentUniqueName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // IsAutoProtectable - Indicates if protectable item is auto-protectable - IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` - // IsAutoProtected - Indicates if protectable item is auto-protected - IsAutoProtected *bool `json:"isAutoProtected,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DBs present - Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // Subprotectableitemcount - For instance or AG, indicates number of DBs to be protected - Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` - // Prebackupvalidation - Pre-backup validation for protectable objects - Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseDatabase', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPAseDatabaseProtectableItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectableItem) MarshalJSON() ([]byte, error) { - avwsadpi.ProtectableItemType = ProtectableItemTypeSAPAseDatabase - objectMap := make(map[string]interface{}) - if avwsadpi.ParentName != nil { - objectMap["parentName"] = avwsadpi.ParentName - } - if avwsadpi.ParentUniqueName != nil { - objectMap["parentUniqueName"] = avwsadpi.ParentUniqueName - } - if avwsadpi.ServerName != nil { - objectMap["serverName"] = avwsadpi.ServerName - } - if avwsadpi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwsadpi.IsAutoProtectable - } - if avwsadpi.IsAutoProtected != nil { - objectMap["isAutoProtected"] = avwsadpi.IsAutoProtected - } - if avwsadpi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwsadpi.Subinquireditemcount - } - if avwsadpi.Subprotectableitemcount != nil { - objectMap["subprotectableitemcount"] = avwsadpi.Subprotectableitemcount - } - if avwsadpi.Prebackupvalidation != nil { - objectMap["prebackupvalidation"] = avwsadpi.Prebackupvalidation - } - if avwsadpi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwsadpi.BackupManagementType - } - if avwsadpi.WorkloadType != nil { - objectMap["workloadType"] = avwsadpi.WorkloadType - } - if avwsadpi.FriendlyName != nil { - objectMap["friendlyName"] = avwsadpi.FriendlyName - } - if avwsadpi.ProtectionState != "" { - objectMap["protectionState"] = avwsadpi.ProtectionState - } - if avwsadpi.ProtectableItemType != "" { - objectMap["protectableItemType"] = avwsadpi.ProtectableItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseDatabaseProtectableItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseDatabaseProtectableItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseDatabaseProtectableItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseDatabaseProtectableItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseDatabaseProtectableItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return &avwsadpi, true -} - -// AsAzureVMWorkloadSAPAseDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseDatabaseProtectableItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectableItem) AsAzureVMWorkloadSAPAseDatabaseProtectableItem() (*AzureVMWorkloadSAPAseDatabaseProtectableItem, bool) { - return &avwsadpi, true -} - -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseDatabaseProtectableItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseDatabaseProtectableItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseDatabaseProtectableItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseDatabaseProtectableItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseDatabaseProtectableItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseDatabaseProtectableItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { - return nil, false -} - -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseDatabaseProtectableItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { - return nil, false -} - -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseDatabaseProtectableItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { - return nil, false -} - -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseDatabaseProtectableItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseDatabaseProtectableItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &avwsadpi, true -} - // AzureVMWorkloadSAPAseDatabaseProtectedItem azure VM workload-specific protected item representing SAP // ASE Database. type AzureVMWorkloadSAPAseDatabaseProtectedItem struct { @@ -6779,9 +6697,9 @@ type AzureVMWorkloadSAPAseDatabaseWorkloadItem struct { ServerName *string `json:"serverName,omitempty"` // IsAutoProtectable - Indicates if workload item is auto-protectable IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DBs present + // Subinquireditemcount - For instance or AG, indicates number of DB's present Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // SubWorkloadItemCount - For instance or AG, indicates number of DBs to be protected + // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` // BackupManagementType - Type of backup management to backup an item. BackupManagementType *string `json:"backupManagementType,omitempty"` @@ -6896,9 +6814,9 @@ type AzureVMWorkloadSAPAseSystemProtectableItem struct { IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` // IsAutoProtected - Indicates if protectable item is auto-protected IsAutoProtected *bool `json:"isAutoProtected,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DBs present + // Subinquireditemcount - For instance or AG, indicates number of DB's present Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // Subprotectableitemcount - For instance or AG, indicates number of DBs to be protected + // Subprotectableitemcount - For instance or AG, indicates number of DB's to be protected Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` // Prebackupvalidation - Pre-backup validation for protectable objects Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` @@ -6910,7 +6828,7 @@ type AzureVMWorkloadSAPAseSystemProtectableItem struct { FriendlyName *string `json:"friendlyName,omitempty"` // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseDatabase', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` } @@ -6985,11 +6903,6 @@ func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsBasicAzureVMWorkloa return &avwsaspi, true } -// AsAzureVMWorkloadSAPAseDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSAPAseDatabaseProtectableItem() (*AzureVMWorkloadSAPAseDatabaseProtectableItem, bool) { - return nil, false -} - // AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { return &avwsaspi, true @@ -7049,9 +6962,9 @@ type AzureVMWorkloadSAPAseSystemWorkloadItem struct { ServerName *string `json:"serverName,omitempty"` // IsAutoProtectable - Indicates if workload item is auto-protectable IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DBs present + // Subinquireditemcount - For instance or AG, indicates number of DB's present Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // SubWorkloadItemCount - For instance or AG, indicates number of DBs to be protected + // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` // BackupManagementType - Type of backup management to backup an item. BackupManagementType *string `json:"backupManagementType,omitempty"` @@ -7166,9 +7079,9 @@ type AzureVMWorkloadSAPHanaDatabaseProtectableItem struct { IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` // IsAutoProtected - Indicates if protectable item is auto-protected IsAutoProtected *bool `json:"isAutoProtected,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DBs present + // Subinquireditemcount - For instance or AG, indicates number of DB's present Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // Subprotectableitemcount - For instance or AG, indicates number of DBs to be protected + // Subprotectableitemcount - For instance or AG, indicates number of DB's to be protected Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` // Prebackupvalidation - Pre-backup validation for protectable objects Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` @@ -7180,7 +7093,7 @@ type AzureVMWorkloadSAPHanaDatabaseProtectableItem struct { FriendlyName *string `json:"friendlyName,omitempty"` // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseDatabase', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` } @@ -7255,11 +7168,6 @@ func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsBasicAzureVMWork return &avwshdpi, true } -// AsAzureVMWorkloadSAPAseDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSAPAseDatabaseProtectableItem() (*AzureVMWorkloadSAPAseDatabaseProtectableItem, bool) { - return nil, false -} - // AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { return nil, false @@ -7541,9 +7449,9 @@ type AzureVMWorkloadSAPHanaDatabaseWorkloadItem struct { ServerName *string `json:"serverName,omitempty"` // IsAutoProtectable - Indicates if workload item is auto-protectable IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DBs present + // Subinquireditemcount - For instance or AG, indicates number of DB's present Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // SubWorkloadItemCount - For instance or AG, indicates number of DBs to be protected + // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` // BackupManagementType - Type of backup management to backup an item. BackupManagementType *string `json:"backupManagementType,omitempty"` @@ -7658,9 +7566,9 @@ type AzureVMWorkloadSAPHanaSystemProtectableItem struct { IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` // IsAutoProtected - Indicates if protectable item is auto-protected IsAutoProtected *bool `json:"isAutoProtected,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DBs present + // Subinquireditemcount - For instance or AG, indicates number of DB's present Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // Subprotectableitemcount - For instance or AG, indicates number of DBs to be protected + // Subprotectableitemcount - For instance or AG, indicates number of DB's to be protected Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` // Prebackupvalidation - Pre-backup validation for protectable objects Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` @@ -7672,7 +7580,7 @@ type AzureVMWorkloadSAPHanaSystemProtectableItem struct { FriendlyName *string `json:"friendlyName,omitempty"` // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseDatabase', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` } @@ -7747,11 +7655,6 @@ func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsBasicAzureVMWorklo return &avwshspi, true } -// AsAzureVMWorkloadSAPAseDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSAPAseDatabaseProtectableItem() (*AzureVMWorkloadSAPAseDatabaseProtectableItem, bool) { - return nil, false -} - // AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { return nil, false @@ -7811,9 +7714,9 @@ type AzureVMWorkloadSAPHanaSystemWorkloadItem struct { ServerName *string `json:"serverName,omitempty"` // IsAutoProtectable - Indicates if workload item is auto-protectable IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DBs present + // Subinquireditemcount - For instance or AG, indicates number of DB's present Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // SubWorkloadItemCount - For instance or AG, indicates number of DBs to be protected + // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` // BackupManagementType - Type of backup management to backup an item. BackupManagementType *string `json:"backupManagementType,omitempty"` @@ -7928,9 +7831,9 @@ type AzureVMWorkloadSQLAvailabilityGroupProtectableItem struct { IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` // IsAutoProtected - Indicates if protectable item is auto-protected IsAutoProtected *bool `json:"isAutoProtected,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DBs present + // Subinquireditemcount - For instance or AG, indicates number of DB's present Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // Subprotectableitemcount - For instance or AG, indicates number of DBs to be protected + // Subprotectableitemcount - For instance or AG, indicates number of DB's to be protected Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` // Prebackupvalidation - Pre-backup validation for protectable objects Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` @@ -7942,7 +7845,7 @@ type AzureVMWorkloadSQLAvailabilityGroupProtectableItem struct { FriendlyName *string `json:"friendlyName,omitempty"` // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseDatabase', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` } @@ -8017,11 +7920,6 @@ func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsBasicAzureV return &avwsagpi, true } -// AsAzureVMWorkloadSAPAseDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSAPAseDatabaseProtectableItem() (*AzureVMWorkloadSAPAseDatabaseProtectableItem, bool) { - return nil, false -} - // AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { return nil, false @@ -8086,9 +7984,9 @@ type AzureVMWorkloadSQLDatabaseProtectableItem struct { IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` // IsAutoProtected - Indicates if protectable item is auto-protected IsAutoProtected *bool `json:"isAutoProtected,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DBs present + // Subinquireditemcount - For instance or AG, indicates number of DB's present Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // Subprotectableitemcount - For instance or AG, indicates number of DBs to be protected + // Subprotectableitemcount - For instance or AG, indicates number of DB's to be protected Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` // Prebackupvalidation - Pre-backup validation for protectable objects Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` @@ -8100,7 +7998,7 @@ type AzureVMWorkloadSQLDatabaseProtectableItem struct { FriendlyName *string `json:"friendlyName,omitempty"` // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseDatabase', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` } @@ -8175,11 +8073,6 @@ func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsBasicAzureVMWorkloadP return &avwsdpi, true } -// AsAzureVMWorkloadSAPAseDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSAPAseDatabaseProtectableItem() (*AzureVMWorkloadSAPAseDatabaseProtectableItem, bool) { - return nil, false -} - // AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { return nil, false @@ -8461,9 +8354,9 @@ type AzureVMWorkloadSQLDatabaseWorkloadItem struct { ServerName *string `json:"serverName,omitempty"` // IsAutoProtectable - Indicates if workload item is auto-protectable IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DBs present + // Subinquireditemcount - For instance or AG, indicates number of DB's present Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // SubWorkloadItemCount - For instance or AG, indicates number of DBs to be protected + // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` // BackupManagementType - Type of backup management to backup an item. BackupManagementType *string `json:"backupManagementType,omitempty"` @@ -8578,9 +8471,9 @@ type AzureVMWorkloadSQLInstanceProtectableItem struct { IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` // IsAutoProtected - Indicates if protectable item is auto-protected IsAutoProtected *bool `json:"isAutoProtected,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DBs present + // Subinquireditemcount - For instance or AG, indicates number of DB's present Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // Subprotectableitemcount - For instance or AG, indicates number of DBs to be protected + // Subprotectableitemcount - For instance or AG, indicates number of DB's to be protected Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` // Prebackupvalidation - Pre-backup validation for protectable objects Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` @@ -8592,7 +8485,7 @@ type AzureVMWorkloadSQLInstanceProtectableItem struct { FriendlyName *string `json:"friendlyName,omitempty"` // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseDatabase', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` } @@ -8667,11 +8560,6 @@ func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsBasicAzureVMWorkloadP return &avwsipi, true } -// AsAzureVMWorkloadSAPAseDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSAPAseDatabaseProtectableItem() (*AzureVMWorkloadSAPAseDatabaseProtectableItem, bool) { - return nil, false -} - // AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { return nil, false @@ -8733,9 +8621,9 @@ type AzureVMWorkloadSQLInstanceWorkloadItem struct { ServerName *string `json:"serverName,omitempty"` // IsAutoProtectable - Indicates if workload item is auto-protectable IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DBs present + // Subinquireditemcount - For instance or AG, indicates number of DB's present Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // SubWorkloadItemCount - For instance or AG, indicates number of DBs to be protected + // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` // BackupManagementType - Type of backup management to backup an item. BackupManagementType *string `json:"backupManagementType,omitempty"` @@ -9391,9 +9279,9 @@ type BasicAzureWorkloadPointInTimeRecoveryPoint interface { type AzureWorkloadPointInTimeRecoveryPoint struct { // TimeRanges - List of log ranges TimeRanges *[]PointInTimeRange `json:"timeRanges,omitempty"` - // RecoveryPointTimeInUTC - UTC time at which recovery point was created + // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` - // Type - Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' + // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' Type RestorePointType `json:"type,omitempty"` // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` @@ -9443,12 +9331,6 @@ func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) MarshalJSON() ([]byte, erro if awpitrp.TimeRanges != nil { objectMap["timeRanges"] = awpitrp.TimeRanges } - if awpitrp.RecoveryPointTimeInUTC != nil { - objectMap["recoveryPointTimeInUTC"] = awpitrp.RecoveryPointTimeInUTC - } - if awpitrp.Type != "" { - objectMap["type"] = awpitrp.Type - } if awpitrp.ObjectType != "" { objectMap["objectType"] = awpitrp.ObjectType } @@ -9530,7 +9412,7 @@ func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsBasicRecoveryPoint() (Bas type AzureWorkloadPointInTimeRestoreRequest struct { // PointInTime - PointInTime value PointInTime *date.Time `json:"pointInTime,omitempty"` - // RecoveryType - OLR/ALR, RestoreDisks is invalid option. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks' + // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' RecoveryType RecoveryType `json:"recoveryType,omitempty"` // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. SourceResourceID *string `json:"sourceResourceId,omitempty"` @@ -9538,6 +9420,8 @@ type AzureWorkloadPointInTimeRestoreRequest struct { PropertyBag map[string]*string `json:"propertyBag"` // TargetInfo - Details of target database TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` + // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' + RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` } @@ -9561,6 +9445,9 @@ func (awpitrr AzureWorkloadPointInTimeRestoreRequest) MarshalJSON() ([]byte, err if awpitrr.TargetInfo != nil { objectMap["targetInfo"] = awpitrr.TargetInfo } + if awpitrr.RecoveryMode != "" { + objectMap["recoveryMode"] = awpitrr.RecoveryMode + } if awpitrr.ObjectType != "" { objectMap["objectType"] = awpitrr.ObjectType } @@ -9647,9 +9534,9 @@ type BasicAzureWorkloadRecoveryPoint interface { // AzureWorkloadRecoveryPoint workload specific recovery point, specifically encapsulates full/diff recovery // point type AzureWorkloadRecoveryPoint struct { - // RecoveryPointTimeInUTC - UTC time at which recovery point was created + // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` - // Type - Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' + // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' Type RestorePointType `json:"type,omitempty"` // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` @@ -9712,12 +9599,6 @@ func unmarshalBasicAzureWorkloadRecoveryPointArray(body []byte) ([]BasicAzureWor func (awrp AzureWorkloadRecoveryPoint) MarshalJSON() ([]byte, error) { awrp.ObjectType = ObjectTypeAzureWorkloadRecoveryPoint objectMap := make(map[string]interface{}) - if awrp.RecoveryPointTimeInUTC != nil { - objectMap["recoveryPointTimeInUTC"] = awrp.RecoveryPointTimeInUTC - } - if awrp.Type != "" { - objectMap["type"] = awrp.Type - } if awrp.ObjectType != "" { objectMap["objectType"] = awrp.ObjectType } @@ -9808,7 +9689,7 @@ type BasicAzureWorkloadRestoreRequest interface { // AzureWorkloadRestoreRequest azureWorkload-specific restore. type AzureWorkloadRestoreRequest struct { - // RecoveryType - OLR/ALR, RestoreDisks is invalid option. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks' + // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' RecoveryType RecoveryType `json:"recoveryType,omitempty"` // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. SourceResourceID *string `json:"sourceResourceId,omitempty"` @@ -9816,6 +9697,8 @@ type AzureWorkloadRestoreRequest struct { PropertyBag map[string]*string `json:"propertyBag"` // TargetInfo - Details of target database TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` + // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' + RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` } @@ -9889,6 +9772,9 @@ func (awrr AzureWorkloadRestoreRequest) MarshalJSON() ([]byte, error) { if awrr.TargetInfo != nil { objectMap["targetInfo"] = awrr.TargetInfo } + if awrr.RecoveryMode != "" { + objectMap["recoveryMode"] = awrr.RecoveryMode + } if awrr.ObjectType != "" { objectMap["objectType"] = awrr.ObjectType } @@ -9964,9 +9850,9 @@ func (awrr AzureWorkloadRestoreRequest) AsBasicRestoreRequest() (BasicRestoreReq type AzureWorkloadSAPHanaPointInTimeRecoveryPoint struct { // TimeRanges - List of log ranges TimeRanges *[]PointInTimeRange `json:"timeRanges,omitempty"` - // RecoveryPointTimeInUTC - UTC time at which recovery point was created + // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` - // Type - Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' + // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' Type RestorePointType `json:"type,omitempty"` // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` @@ -9979,12 +9865,6 @@ func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) MarshalJSON() ([]b if awshpitrp.TimeRanges != nil { objectMap["timeRanges"] = awshpitrp.TimeRanges } - if awshpitrp.RecoveryPointTimeInUTC != nil { - objectMap["recoveryPointTimeInUTC"] = awshpitrp.RecoveryPointTimeInUTC - } - if awshpitrp.Type != "" { - objectMap["type"] = awshpitrp.Type - } if awshpitrp.ObjectType != "" { objectMap["objectType"] = awshpitrp.ObjectType } @@ -10066,7 +9946,7 @@ func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsBasicRecoveryPoi type AzureWorkloadSAPHanaPointInTimeRestoreRequest struct { // PointInTime - PointInTime value PointInTime *date.Time `json:"pointInTime,omitempty"` - // RecoveryType - OLR/ALR, RestoreDisks is invalid option. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks' + // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' RecoveryType RecoveryType `json:"recoveryType,omitempty"` // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. SourceResourceID *string `json:"sourceResourceId,omitempty"` @@ -10074,6 +9954,8 @@ type AzureWorkloadSAPHanaPointInTimeRestoreRequest struct { PropertyBag map[string]*string `json:"propertyBag"` // TargetInfo - Details of target database TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` + // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' + RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` } @@ -10097,6 +9979,9 @@ func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) MarshalJSON() ([] if awshpitrr.TargetInfo != nil { objectMap["targetInfo"] = awshpitrr.TargetInfo } + if awshpitrr.RecoveryMode != "" { + objectMap["recoveryMode"] = awshpitrr.RecoveryMode + } if awshpitrr.ObjectType != "" { objectMap["objectType"] = awshpitrr.ObjectType } @@ -10168,12 +10053,12 @@ func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsBasicRestoreReq return &awshpitrr, true } -// AzureWorkloadSAPHanaRecoveryPoint sAPHana specific recovery point, specifically encapsulates full/diff -// recovery points +// AzureWorkloadSAPHanaRecoveryPoint sAPHana specific recoverypoint, specifically encapsulates full/diff +// recoverypoints type AzureWorkloadSAPHanaRecoveryPoint struct { - // RecoveryPointTimeInUTC - UTC time at which recovery point was created + // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` - // Type - Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' + // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' Type RestorePointType `json:"type,omitempty"` // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` @@ -10183,12 +10068,6 @@ type AzureWorkloadSAPHanaRecoveryPoint struct { func (awshrp AzureWorkloadSAPHanaRecoveryPoint) MarshalJSON() ([]byte, error) { awshrp.ObjectType = ObjectTypeAzureWorkloadSAPHanaRecoveryPoint objectMap := make(map[string]interface{}) - if awshrp.RecoveryPointTimeInUTC != nil { - objectMap["recoveryPointTimeInUTC"] = awshrp.RecoveryPointTimeInUTC - } - if awshrp.Type != "" { - objectMap["type"] = awshrp.Type - } if awshrp.ObjectType != "" { objectMap["objectType"] = awshrp.ObjectType } @@ -10273,7 +10152,7 @@ type BasicAzureWorkloadSAPHanaRestoreRequest interface { // AzureWorkloadSAPHanaRestoreRequest azureWorkload SAP Hana-specific restore. type AzureWorkloadSAPHanaRestoreRequest struct { - // RecoveryType - OLR/ALR, RestoreDisks is invalid option. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks' + // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' RecoveryType RecoveryType `json:"recoveryType,omitempty"` // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. SourceResourceID *string `json:"sourceResourceId,omitempty"` @@ -10281,6 +10160,8 @@ type AzureWorkloadSAPHanaRestoreRequest struct { PropertyBag map[string]*string `json:"propertyBag"` // TargetInfo - Details of target database TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` + // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' + RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` } @@ -10338,6 +10219,9 @@ func (awshrr AzureWorkloadSAPHanaRestoreRequest) MarshalJSON() ([]byte, error) { if awshrr.TargetInfo != nil { objectMap["targetInfo"] = awshrr.TargetInfo } + if awshrr.RecoveryMode != "" { + objectMap["recoveryMode"] = awshrr.RecoveryMode + } if awshrr.ObjectType != "" { objectMap["objectType"] = awshrr.ObjectType } @@ -10503,9 +10387,9 @@ type AzureWorkloadSQLPointInTimeRecoveryPoint struct { // When a specific recovery point is accessed using GetRecoveryPoint // Or when ListRecoveryPoints is called for Log RP only with ExtendedInfo query filter ExtendedInfo *AzureWorkloadSQLRecoveryPointExtendedInfo `json:"extendedInfo,omitempty"` - // RecoveryPointTimeInUTC - UTC time at which recovery point was created + // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` - // Type - Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' + // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' Type RestorePointType `json:"type,omitempty"` // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` @@ -10521,12 +10405,6 @@ func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) MarshalJSON() ([]byte, if awspitrp.ExtendedInfo != nil { objectMap["extendedInfo"] = awspitrp.ExtendedInfo } - if awspitrp.RecoveryPointTimeInUTC != nil { - objectMap["recoveryPointTimeInUTC"] = awspitrp.RecoveryPointTimeInUTC - } - if awspitrp.Type != "" { - objectMap["type"] = awspitrp.Type - } if awspitrp.ObjectType != "" { objectMap["objectType"] = awspitrp.ObjectType } @@ -10614,7 +10492,7 @@ type AzureWorkloadSQLPointInTimeRestoreRequest struct { IsNonRecoverable *bool `json:"isNonRecoverable,omitempty"` // AlternateDirectoryPaths - Data directory details AlternateDirectoryPaths *[]SQLDataDirectoryMapping `json:"alternateDirectoryPaths,omitempty"` - // RecoveryType - OLR/ALR, RestoreDisks is invalid option. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks' + // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' RecoveryType RecoveryType `json:"recoveryType,omitempty"` // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. SourceResourceID *string `json:"sourceResourceId,omitempty"` @@ -10622,6 +10500,8 @@ type AzureWorkloadSQLPointInTimeRestoreRequest struct { PropertyBag map[string]*string `json:"propertyBag"` // TargetInfo - Details of target database TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` + // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' + RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` } @@ -10654,6 +10534,9 @@ func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) MarshalJSON() ([]byte, if awspitrr.TargetInfo != nil { objectMap["targetInfo"] = awspitrr.TargetInfo } + if awspitrr.RecoveryMode != "" { + objectMap["recoveryMode"] = awspitrr.RecoveryMode + } if awspitrr.ObjectType != "" { objectMap["objectType"] = awspitrr.ObjectType } @@ -10725,23 +10608,23 @@ func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsBasicRestoreRequest( return &awspitrr, true } -// BasicAzureWorkloadSQLRecoveryPoint SQL specific recovery point, specifically encapsulates full/diff recovery point +// BasicAzureWorkloadSQLRecoveryPoint SQL specific recoverypoint, specifically encapsulates full/diff recoverypoint // along with extended info type BasicAzureWorkloadSQLRecoveryPoint interface { AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) } -// AzureWorkloadSQLRecoveryPoint SQL specific recovery point, specifically encapsulates full/diff recovery -// point along with extended info +// AzureWorkloadSQLRecoveryPoint SQL specific recoverypoint, specifically encapsulates full/diff recoverypoint +// along with extended info type AzureWorkloadSQLRecoveryPoint struct { // ExtendedInfo - Extended Info that provides data directory details. Will be populated in two cases: // When a specific recovery point is accessed using GetRecoveryPoint // Or when ListRecoveryPoints is called for Log RP only with ExtendedInfo query filter ExtendedInfo *AzureWorkloadSQLRecoveryPointExtendedInfo `json:"extendedInfo,omitempty"` - // RecoveryPointTimeInUTC - UTC time at which recovery point was created + // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` - // Type - Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' + // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' Type RestorePointType `json:"type,omitempty"` // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` @@ -10791,12 +10674,6 @@ func (awsrp AzureWorkloadSQLRecoveryPoint) MarshalJSON() ([]byte, error) { if awsrp.ExtendedInfo != nil { objectMap["extendedInfo"] = awsrp.ExtendedInfo } - if awsrp.RecoveryPointTimeInUTC != nil { - objectMap["recoveryPointTimeInUTC"] = awsrp.RecoveryPointTimeInUTC - } - if awsrp.Type != "" { - objectMap["type"] = awsrp.Type - } if awsrp.ObjectType != "" { objectMap["objectType"] = awsrp.ObjectType } @@ -10875,9 +10752,9 @@ func (awsrp AzureWorkloadSQLRecoveryPoint) AsBasicRecoveryPoint() (BasicRecovery // AzureWorkloadSQLRecoveryPointExtendedInfo extended info class details type AzureWorkloadSQLRecoveryPointExtendedInfo struct { - // DataDirectoryTimeInUTC - UTC time at which data directory info was captured + // DataDirectoryTimeInUTC - READ-ONLY; UTC time at which data directory info was captured DataDirectoryTimeInUTC *date.Time `json:"dataDirectoryTimeInUTC,omitempty"` - // DataDirectoryPaths - List of data directory paths during restore operation. + // DataDirectoryPaths - READ-ONLY; List of data directory paths during restore operation. DataDirectoryPaths *[]SQLDataDirectory `json:"dataDirectoryPaths,omitempty"` } @@ -10895,7 +10772,7 @@ type AzureWorkloadSQLRestoreRequest struct { IsNonRecoverable *bool `json:"isNonRecoverable,omitempty"` // AlternateDirectoryPaths - Data directory details AlternateDirectoryPaths *[]SQLDataDirectoryMapping `json:"alternateDirectoryPaths,omitempty"` - // RecoveryType - OLR/ALR, RestoreDisks is invalid option. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks' + // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' RecoveryType RecoveryType `json:"recoveryType,omitempty"` // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. SourceResourceID *string `json:"sourceResourceId,omitempty"` @@ -10903,6 +10780,8 @@ type AzureWorkloadSQLRestoreRequest struct { PropertyBag map[string]*string `json:"propertyBag"` // TargetInfo - Details of target database TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` + // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' + RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` } @@ -10969,6 +10848,9 @@ func (awsrr AzureWorkloadSQLRestoreRequest) MarshalJSON() ([]byte, error) { if awsrr.TargetInfo != nil { objectMap["targetInfo"] = awsrr.TargetInfo } + if awsrr.RecoveryMode != "" { + objectMap["recoveryMode"] = awsrr.RecoveryMode + } if awsrr.ObjectType != "" { objectMap["objectType"] = awsrr.ObjectType } @@ -11384,6 +11266,20 @@ type Day struct { IsLast *bool `json:"isLast,omitempty"` } +// DiskExclusionProperties ... +type DiskExclusionProperties struct { + // DiskLunList - List of Disks' Logical Unit Numbers (LUN) to be used for VM Protection. + DiskLunList *[]int32 `json:"diskLunList,omitempty"` + // IsInclusionList - Flag to indicate whether DiskLunList is to be included/ excluded from backup. + IsInclusionList *bool `json:"isInclusionList,omitempty"` +} + +// DiskInformation disk information +type DiskInformation struct { + Lun *int32 `json:"lun,omitempty"` + Name *string `json:"name,omitempty"` +} + // DistributedNodesInfo this is used to represent the various nodes of the distributed container. type DistributedNodesInfo struct { // NodeName - Name of the node under a distributed container. @@ -11419,7 +11315,7 @@ type DpmBackupEngine struct { IsAzureBackupAgentUpgradeAvailable *bool `json:"isAzureBackupAgentUpgradeAvailable,omitempty"` // IsDpmUpgradeAvailable - To check if backup engine upgrade available IsDpmUpgradeAvailable *bool `json:"isDpmUpgradeAvailable,omitempty"` - // ExtendedInfo - Extended info of the backup engine + // ExtendedInfo - Extended info of the backupengine ExtendedInfo *EngineExtendedInfo `json:"extendedInfo,omitempty"` // BackupEngineType - Possible values include: 'BackupEngineTypeBackupEngineBase', 'BackupEngineTypeAzureBackupServerEngine', 'BackupEngineTypeDpmBackupEngine' BackupEngineType EngineType `json:"backupEngineType,omitempty"` @@ -12180,7 +12076,7 @@ type EngineBase struct { IsAzureBackupAgentUpgradeAvailable *bool `json:"isAzureBackupAgentUpgradeAvailable,omitempty"` // IsDpmUpgradeAvailable - To check if backup engine upgrade available IsDpmUpgradeAvailable *bool `json:"isDpmUpgradeAvailable,omitempty"` - // ExtendedInfo - Extended info of the backup engine + // ExtendedInfo - Extended info of the backupengine ExtendedInfo *EngineExtendedInfo `json:"extendedInfo,omitempty"` // BackupEngineType - Possible values include: 'BackupEngineTypeBackupEngineBase', 'BackupEngineTypeAzureBackupServerEngine', 'BackupEngineTypeDpmBackupEngine' BackupEngineType EngineType `json:"backupEngineType,omitempty"` @@ -12574,11 +12470,11 @@ type EngineExtendedInfo struct { // ErrorDetail error Detail class which encapsulates Code, Message and Recommendations. type ErrorDetail struct { - // Code - Error code. + // Code - READ-ONLY; Error code. Code *string `json:"code,omitempty"` - // Message - Error Message related to the Code. + // Message - READ-ONLY; Error Message related to the Code. Message *string `json:"message,omitempty"` - // Recommendations - List of recommendation strings. + // Recommendations - READ-ONLY; List of recommendation strings. Recommendations *[]string `json:"recommendations,omitempty"` } @@ -12588,6 +12484,10 @@ type ExportJobsOperationResultInfo struct { BlobURL *string `json:"blobUrl,omitempty"` // BlobSasKey - SAS key to access the blob. It expires in 15 mins. BlobSasKey *string `json:"blobSasKey,omitempty"` + // ExcelFileBlobURL - URL of the blob into which the ExcelFile is uploaded. + ExcelFileBlobURL *string `json:"excelFileBlobUrl,omitempty"` + // ExcelFileBlobSasKey - SAS key to access the blob. It expires in 15 mins. + ExcelFileBlobSasKey *string `json:"excelFileBlobSasKey,omitempty"` // ObjectType - Possible values include: 'ObjectTypeOperationResultInfoBase', 'ObjectTypeExportJobsOperationResultInfo', 'ObjectTypeOperationResultInfo' ObjectType ObjectType `json:"objectType,omitempty"` } @@ -12602,6 +12502,12 @@ func (ejori ExportJobsOperationResultInfo) MarshalJSON() ([]byte, error) { if ejori.BlobSasKey != nil { objectMap["blobSasKey"] = ejori.BlobSasKey } + if ejori.ExcelFileBlobURL != nil { + objectMap["excelFileBlobUrl"] = ejori.ExcelFileBlobURL + } + if ejori.ExcelFileBlobSasKey != nil { + objectMap["excelFileBlobSasKey"] = ejori.ExcelFileBlobSasKey + } if ejori.ObjectType != "" { objectMap["objectType"] = ejori.ObjectType } @@ -12628,6 +12534,12 @@ func (ejori ExportJobsOperationResultInfo) AsBasicOperationResultInfoBase() (Bas return &ejori, true } +// ExtendedProperties extended Properties for Azure IaasVM Backup. +type ExtendedProperties struct { + // DiskExclusionProperties - Extended Properties for Disk Exclusion. + DiskExclusionProperties *DiskExclusionProperties `json:"diskExclusionProperties,omitempty"` +} + // BasicFeatureSupportRequest base class for feature request type BasicFeatureSupportRequest interface { AsAzureBackupGoalFeatureSupportRequest() (*AzureBackupGoalFeatureSupportRequest, bool) @@ -13069,7 +12981,7 @@ type GenericProtectionPolicy struct { FabricName *string `json:"fabricName,omitempty"` // ProtectedItemsCount - Number of items associated with this policy. ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` - // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' + // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` } @@ -13095,6 +13007,11 @@ func (gpp GenericProtectionPolicy) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { + return nil, false +} + // AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. func (gpp GenericProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { return nil, false @@ -13110,11 +13027,6 @@ func (gpp GenericProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtec return nil, false } -// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. -func (gpp GenericProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { - return nil, false -} - // AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. func (gpp GenericProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { return &gpp, true @@ -13487,7 +13399,7 @@ type IaasVMILRRegistrationRequest struct { InitiatorName *string `json:"initiatorName,omitempty"` // RenewExistingRegistration - Whether to renew existing registration with the iSCSI server. RenewExistingRegistration *bool `json:"renewExistingRegistration,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeILRRequest', 'ObjectTypeIaasVMILRRegistrationRequest' + // ObjectType - Possible values include: 'ObjectTypeILRRequest', 'ObjectTypeAzureFileShareProvisionILRRequest', 'ObjectTypeIaasVMILRRegistrationRequest' ObjectType ObjectTypeBasicILRRequest `json:"objectType,omitempty"` } @@ -13513,6 +13425,11 @@ func (ivrr IaasVMILRRegistrationRequest) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsAzureFileShareProvisionILRRequest is the BasicILRRequest implementation for IaasVMILRRegistrationRequest. +func (ivrr IaasVMILRRegistrationRequest) AsAzureFileShareProvisionILRRequest() (*AzureFileShareProvisionILRRequest, bool) { + return nil, false +} + // AsIaasVMILRRegistrationRequest is the BasicILRRequest implementation for IaasVMILRRegistrationRequest. func (ivrr IaasVMILRRegistrationRequest) AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) { return &ivrr, true @@ -13547,7 +13464,7 @@ type IaaSVMProtectableItem struct { FriendlyName *string `json:"friendlyName,omitempty"` // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseDatabase', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` } @@ -13642,11 +13559,6 @@ func (ispi IaaSVMProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (Basic return nil, false } -// AsAzureVMWorkloadSAPAseDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSAPAseDatabaseProtectableItem() (*AzureVMWorkloadSAPAseDatabaseProtectableItem, bool) { - return nil, false -} - // AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { return nil, false @@ -13699,15 +13611,15 @@ func (ispi IaaSVMProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloa // IaasVMRecoveryPoint iaaS VM workload specific backup copy. type IaasVMRecoveryPoint struct { - // RecoveryPointType - Type of the backup copy. + // RecoveryPointType - READ-ONLY; Type of the backup copy. RecoveryPointType *string `json:"recoveryPointType,omitempty"` - // RecoveryPointTime - Time at which this backup copy was created. + // RecoveryPointTime - READ-ONLY; Time at which this backup copy was created. RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` - // RecoveryPointAdditionalInfo - Additional information associated with this backup copy. + // RecoveryPointAdditionalInfo - READ-ONLY; Additional information associated with this backup copy. RecoveryPointAdditionalInfo *string `json:"recoveryPointAdditionalInfo,omitempty"` - // SourceVMStorageType - Storage type of the VM whose backup copy is created. + // SourceVMStorageType - READ-ONLY; Storage type of the VM whose backup copy is created. SourceVMStorageType *string `json:"sourceVMStorageType,omitempty"` - // IsSourceVMEncrypted - Identifies whether the VM was encrypted when the backup copy is created. + // IsSourceVMEncrypted - READ-ONLY; Identifies whether the VM was encrypted when the backup copy is created. IsSourceVMEncrypted *bool `json:"isSourceVMEncrypted,omitempty"` // KeyAndSecret - Required details for recovering an encrypted VM. Applicable only when IsSourceVMEncrypted is true. KeyAndSecret *KeyAndSecretDetails `json:"keyAndSecret,omitempty"` @@ -13723,6 +13635,8 @@ type IaasVMRecoveryPoint struct { OriginalStorageAccountOption *bool `json:"originalStorageAccountOption,omitempty"` // OsType - OS type OsType *string `json:"osType,omitempty"` + // RecoveryPointDiskConfiguration - Disk configuration + RecoveryPointDiskConfiguration *RecoveryPointDiskConfiguration `json:"recoveryPointDiskConfiguration,omitempty"` // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` } @@ -13731,21 +13645,6 @@ type IaasVMRecoveryPoint struct { func (ivrp IaasVMRecoveryPoint) MarshalJSON() ([]byte, error) { ivrp.ObjectType = ObjectTypeIaasVMRecoveryPoint objectMap := make(map[string]interface{}) - if ivrp.RecoveryPointType != nil { - objectMap["recoveryPointType"] = ivrp.RecoveryPointType - } - if ivrp.RecoveryPointTime != nil { - objectMap["recoveryPointTime"] = ivrp.RecoveryPointTime - } - if ivrp.RecoveryPointAdditionalInfo != nil { - objectMap["recoveryPointAdditionalInfo"] = ivrp.RecoveryPointAdditionalInfo - } - if ivrp.SourceVMStorageType != nil { - objectMap["sourceVMStorageType"] = ivrp.SourceVMStorageType - } - if ivrp.IsSourceVMEncrypted != nil { - objectMap["isSourceVMEncrypted"] = ivrp.IsSourceVMEncrypted - } if ivrp.KeyAndSecret != nil { objectMap["keyAndSecret"] = ivrp.KeyAndSecret } @@ -13767,6 +13666,9 @@ func (ivrp IaasVMRecoveryPoint) MarshalJSON() ([]byte, error) { if ivrp.OsType != nil { objectMap["osType"] = ivrp.OsType } + if ivrp.RecoveryPointDiskConfiguration != nil { + objectMap["recoveryPointDiskConfiguration"] = ivrp.RecoveryPointDiskConfiguration + } if ivrp.ObjectType != "" { objectMap["objectType"] = ivrp.ObjectType } @@ -13847,7 +13749,7 @@ func (ivrp IaasVMRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool type IaasVMRestoreRequest struct { // RecoveryPointID - ID of the backup copy to be recovered. RecoveryPointID *string `json:"recoveryPointId,omitempty"` - // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks' + // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' RecoveryType RecoveryType `json:"recoveryType,omitempty"` // SourceResourceID - Fully qualified ARM ID of the VM which is being recovered. SourceResourceID *string `json:"sourceResourceId,omitempty"` @@ -13880,6 +13782,8 @@ type IaasVMRestoreRequest struct { OriginalStorageAccountOption *bool `json:"originalStorageAccountOption,omitempty"` // EncryptionDetails - Details needed if the VM was encrypted at the time of backup. EncryptionDetails *EncryptionDetails `json:"encryptionDetails,omitempty"` + // RestoreDiskLunList - List of Disk LUNs for partial restore + RestoreDiskLunList *[]int32 `json:"restoreDiskLunList,omitempty"` // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` } @@ -13930,6 +13834,9 @@ func (ivrr IaasVMRestoreRequest) MarshalJSON() ([]byte, error) { if ivrr.EncryptionDetails != nil { objectMap["encryptionDetails"] = ivrr.EncryptionDetails } + if ivrr.RestoreDiskLunList != nil { + objectMap["restoreDiskLunList"] = ivrr.RestoreDiskLunList + } if ivrr.ObjectType != "" { objectMap["objectType"] = ivrr.ObjectType } @@ -14001,15 +13908,16 @@ func (ivrr IaasVMRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, b return &ivrr, true } -// BasicILRRequest parameters to restore file/folders API. +// BasicILRRequest parameters to Provision ILR API. type BasicILRRequest interface { + AsAzureFileShareProvisionILRRequest() (*AzureFileShareProvisionILRRequest, bool) AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) AsILRRequest() (*ILRRequest, bool) } -// ILRRequest parameters to restore file/folders API. +// ILRRequest parameters to Provision ILR API. type ILRRequest struct { - // ObjectType - Possible values include: 'ObjectTypeILRRequest', 'ObjectTypeIaasVMILRRegistrationRequest' + // ObjectType - Possible values include: 'ObjectTypeILRRequest', 'ObjectTypeAzureFileShareProvisionILRRequest', 'ObjectTypeIaasVMILRRegistrationRequest' ObjectType ObjectTypeBasicILRRequest `json:"objectType,omitempty"` } @@ -14021,6 +13929,10 @@ func unmarshalBasicILRRequest(body []byte) (BasicILRRequest, error) { } switch m["objectType"] { + case string(ObjectTypeAzureFileShareProvisionILRRequest): + var afspir AzureFileShareProvisionILRRequest + err := json.Unmarshal(body, &afspir) + return afspir, err case string(ObjectTypeIaasVMILRRegistrationRequest): var ivrr IaasVMILRRegistrationRequest err := json.Unmarshal(body, &ivrr) @@ -14060,6 +13972,11 @@ func (ir ILRRequest) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsAzureFileShareProvisionILRRequest is the BasicILRRequest implementation for ILRRequest. +func (ir ILRRequest) AsAzureFileShareProvisionILRRequest() (*AzureFileShareProvisionILRRequest, bool) { + return nil, false +} + // AsIaasVMILRRegistrationRequest is the BasicILRRequest implementation for ILRRequest. func (ir ILRRequest) AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) { return nil, false @@ -14075,7 +13992,7 @@ func (ir ILRRequest) AsBasicILRRequest() (BasicILRRequest, bool) { return &ir, true } -// ILRRequestResource parameters to restore file/folders API. +// ILRRequestResource parameters to Provision ILR API. type ILRRequestResource struct { // Properties - ILRRequestResource properties Properties BasicILRRequest `json:"properties,omitempty"` @@ -14204,6 +14121,8 @@ type InquiryValidation struct { Status *string `json:"status,omitempty"` // ErrorDetail - Error Detail in case the status is non-success. ErrorDetail *ErrorDetail `json:"errorDetail,omitempty"` + // AdditionalDetail - READ-ONLY; Error Additional Detail in case the status is non-success. + AdditionalDetail *string `json:"additionalDetail,omitempty"` } // InstantItemRecoveryTarget target details for file / folder restore. @@ -14212,6 +14131,12 @@ type InstantItemRecoveryTarget struct { ClientScripts *[]ClientScriptForConnect `json:"clientScripts,omitempty"` } +// InstantRPAdditionalDetails ... +type InstantRPAdditionalDetails struct { + AzureBackupRGNamePrefix *string `json:"azureBackupRGNamePrefix,omitempty"` + AzureBackupRGNameSuffix *string `json:"azureBackupRGNameSuffix,omitempty"` +} + // BasicJob defines workload agnostic properties for a job. type BasicJob interface { AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) @@ -14367,7 +14292,7 @@ type JobQueryObject struct { Status JobStatus `json:"status,omitempty"` // BackupManagementType - Type of backup management for the job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // Operation - Type of operation. Possible values include: 'JobOperationTypeInvalid', 'JobOperationTypeRegister', 'JobOperationTypeUnRegister', 'JobOperationTypeConfigureBackup', 'JobOperationTypeBackup', 'JobOperationTypeRestore', 'JobOperationTypeDisableBackup', 'JobOperationTypeDeleteBackupData' + // Operation - Type of operation. Possible values include: 'JobOperationTypeInvalid', 'JobOperationTypeRegister', 'JobOperationTypeUnRegister', 'JobOperationTypeConfigureBackup', 'JobOperationTypeBackup', 'JobOperationTypeRestore', 'JobOperationTypeDisableBackup', 'JobOperationTypeDeleteBackupData', 'JobOperationTypeCrossRegionRestore', 'JobOperationTypeUndelete' Operation JobOperationType `json:"operation,omitempty"` // JobID - JobID represents the job uniquely. JobID *string `json:"jobId,omitempty"` @@ -14988,9 +14913,9 @@ type MABContainerHealthDetails struct { // MabErrorInfo MAB workload-specific error information. type MabErrorInfo struct { - // ErrorString - Localized error string. + // ErrorString - READ-ONLY; Localized error string. ErrorString *string `json:"errorString,omitempty"` - // Recommendations - List of localized recommendations. + // Recommendations - READ-ONLY; List of localized recommendations. Recommendations *[]string `json:"recommendations,omitempty"` } @@ -15002,9 +14927,11 @@ type MabFileFolderProtectedItem struct { ComputerName *string `json:"computerName,omitempty"` // LastBackupStatus - Status of last backup operation. LastBackupStatus *string `json:"lastBackupStatus,omitempty"` + // LastBackupTime - Timestamp of the last backup operation on this backup item. + LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` // ProtectionState - Protected, ProtectionStopped, IRPending or ProtectionError ProtectionState *string `json:"protectionState,omitempty"` - // DeferredDeleteSyncTimeInUTC - Sync time for deferred deletion. + // DeferredDeleteSyncTimeInUTC - Sync time for deferred deletion in UTC DeferredDeleteSyncTimeInUTC *int64 `json:"deferredDeleteSyncTimeInUTC,omitempty"` // ExtendedInfo - Additional information with this backup item. ExtendedInfo *MabFileFolderProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` @@ -15051,6 +14978,9 @@ func (mffpi MabFileFolderProtectedItem) MarshalJSON() ([]byte, error) { if mffpi.LastBackupStatus != nil { objectMap["lastBackupStatus"] = mffpi.LastBackupStatus } + if mffpi.LastBackupTime != nil { + objectMap["lastBackupTime"] = mffpi.LastBackupTime + } if mffpi.ProtectionState != nil { objectMap["protectionState"] = mffpi.ProtectionState } @@ -15363,7 +15293,7 @@ type MabProtectionPolicy struct { RetentionPolicy BasicRetentionPolicy `json:"retentionPolicy,omitempty"` // ProtectedItemsCount - Number of items associated with this policy. ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` - // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' + // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` } @@ -15382,6 +15312,11 @@ func (mpp MabProtectionPolicy) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. +func (mpp MabProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { + return nil, false +} + // AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. func (mpp MabProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { return nil, false @@ -15397,11 +15332,6 @@ func (mpp MabProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtection return nil, false } -// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. -func (mpp MabProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { - return nil, false -} - // AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. func (mpp MabProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { return nil, false @@ -16096,7 +16026,7 @@ type PreValidateEnableBackupRequest struct { ResourceType DataSourceType `json:"resourceType,omitempty"` // ResourceID - ARM Virtual Machine Id ResourceID *string `json:"resourceId,omitempty"` - // VaultID - Specifies the arm resource id of the vault + // VaultID - ARM id of the Recovery Services Vault VaultID *string `json:"vaultId,omitempty"` // Properties - Configuration of VM if any needs to be validated like OS type etc Properties *string `json:"properties,omitempty"` @@ -17921,10 +17851,10 @@ func NewProtectionIntentResourceListPage(getNextPage func(context.Context, Prote // BasicProtectionPolicy base class for backup policy. Workload-specific backup policies are derived from this class. type BasicProtectionPolicy interface { + AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) - AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) AsProtectionPolicy() (*ProtectionPolicy, bool) @@ -17935,7 +17865,7 @@ type BasicProtectionPolicy interface { type ProtectionPolicy struct { // ProtectedItemsCount - Number of items associated with this policy. ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` - // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' + // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` } @@ -17947,6 +17877,10 @@ func unmarshalBasicProtectionPolicy(body []byte) (BasicProtectionPolicy, error) } switch m["backupManagementType"] { + case string(BackupManagementTypeAzureWorkload): + var avwpp AzureVMWorkloadProtectionPolicy + err := json.Unmarshal(body, &avwpp) + return avwpp, err case string(BackupManagementTypeAzureStorage): var afspp AzureFileShareProtectionPolicy err := json.Unmarshal(body, &afspp) @@ -17959,10 +17893,6 @@ func unmarshalBasicProtectionPolicy(body []byte) (BasicProtectionPolicy, error) var aspp AzureSQLProtectionPolicy err := json.Unmarshal(body, &aspp) return aspp, err - case string(BackupManagementTypeAzureWorkload): - var avwpp AzureVMWorkloadProtectionPolicy - err := json.Unmarshal(body, &avwpp) - return avwpp, err case string(BackupManagementTypeGenericProtectionPolicy): var gpp GenericProtectionPolicy err := json.Unmarshal(body, &gpp) @@ -18009,6 +17939,11 @@ func (pp ProtectionPolicy) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. +func (pp ProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { + return nil, false +} + // AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. func (pp ProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { return nil, false @@ -18024,11 +17959,6 @@ func (pp ProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPoli return nil, false } -// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. -func (pp ProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { - return nil, false -} - // AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. func (pp ProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { return nil, false @@ -18491,6 +18421,18 @@ func (rp RecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { return &rp, true } +// RecoveryPointDiskConfiguration disk configuration +type RecoveryPointDiskConfiguration struct { + // NumberOfDisksIncludedInBackup - Number of disks included in backup + NumberOfDisksIncludedInBackup *int32 `json:"numberOfDisksIncludedInBackup,omitempty"` + // NumberOfDisksAttachedToVM - Number of disks attached to the VM + NumberOfDisksAttachedToVM *int32 `json:"numberOfDisksAttachedToVm,omitempty"` + // IncludedDiskList - Information of disks included in backup + IncludedDiskList *[]DiskInformation `json:"includedDiskList,omitempty"` + // ExcludedDiskList - Information of disks excluded from backup + ExcludedDiskList *[]DiskInformation `json:"excludedDiskList,omitempty"` +} + // RecoveryPointResource base class for backup copies. Workload-specific backup copies are derived from // this class. type RecoveryPointResource struct { @@ -19058,6 +19000,8 @@ type ResourceVaultConfig struct { StorageTypeState StorageTypeState `json:"storageTypeState,omitempty"` // EnhancedSecurityState - Enabled or Disabled. Possible values include: 'EnhancedSecurityStateInvalid', 'EnhancedSecurityStateEnabled', 'EnhancedSecurityStateDisabled' EnhancedSecurityState EnhancedSecurityState `json:"enhancedSecurityState,omitempty"` + // SoftDeleteFeatureState - Soft Delete feature state. Possible values include: 'SoftDeleteFeatureStateInvalid', 'SoftDeleteFeatureStateEnabled', 'SoftDeleteFeatureStateDisabled' + SoftDeleteFeatureState SoftDeleteFeatureState `json:"softDeleteFeatureState,omitempty"` } // ResourceVaultConfigResource backup resource vault config details. @@ -20566,7 +20510,6 @@ type BasicWorkloadProtectableItem interface { AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) - AsAzureVMWorkloadSAPAseDatabaseProtectableItem() (*AzureVMWorkloadSAPAseDatabaseProtectableItem, bool) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) @@ -20589,7 +20532,7 @@ type WorkloadProtectableItem struct { FriendlyName *string `json:"friendlyName,omitempty"` // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseDatabase', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` } @@ -20617,10 +20560,6 @@ func unmarshalBasicWorkloadProtectableItem(body []byte) (BasicWorkloadProtectabl var avwpi AzureVMWorkloadProtectableItem err := json.Unmarshal(body, &avwpi) return avwpi, err - case string(ProtectableItemTypeSAPAseDatabase): - var avwsadpi AzureVMWorkloadSAPAseDatabaseProtectableItem - err := json.Unmarshal(body, &avwsadpi) - return avwsadpi, err case string(ProtectableItemTypeSAPAseSystem): var avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem err := json.Unmarshal(body, &avwsaspi) @@ -20721,11 +20660,6 @@ func (wpi WorkloadProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (Basi return nil, false } -// AsAzureVMWorkloadSAPAseDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsAzureVMWorkloadSAPAseDatabaseProtectableItem() (*AzureVMWorkloadSAPAseDatabaseProtectableItem, bool) { - return nil, false -} - // AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. func (wpi WorkloadProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { return nil, false diff --git a/services/recoveryservices/mgmt/2017-07-01/backup/operation.go b/services/recoveryservices/mgmt/2017-07-01/backup/operation.go index e1de4e1c8923..dc66321c1f6c 100644 --- a/services/recoveryservices/mgmt/2017-07-01/backup/operation.go +++ b/services/recoveryservices/mgmt/2017-07-01/backup/operation.go @@ -85,7 +85,7 @@ func (client OperationClient) ValidatePreparer(ctx context.Context, vaultName st "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2017-07-01" + const APIVersion = "2019-05-13" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2017-07-01/backup/policies.go b/services/recoveryservices/mgmt/2017-07-01/backup/policies.go index 126c37efcf12..ac93925c96c9 100644 --- a/services/recoveryservices/mgmt/2017-07-01/backup/policies.go +++ b/services/recoveryservices/mgmt/2017-07-01/backup/policies.go @@ -87,7 +87,7 @@ func (client PoliciesClient) ListPreparer(ctx context.Context, vaultName string, "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2017-07-01" + const APIVersion = "2019-05-13" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2017-07-01/backup/protecteditemoperationresults.go b/services/recoveryservices/mgmt/2017-07-01/backup/protecteditemoperationresults.go index 36e8a5f7a368..956a7ccb55e4 100644 --- a/services/recoveryservices/mgmt/2017-07-01/backup/protecteditemoperationresults.go +++ b/services/recoveryservices/mgmt/2017-07-01/backup/protecteditemoperationresults.go @@ -93,7 +93,7 @@ func (client ProtectedItemOperationResultsClient) GetPreparer(ctx context.Contex "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2019-05-13" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2017-07-01/backup/protecteditems.go b/services/recoveryservices/mgmt/2017-07-01/backup/protecteditems.go index 7cb9eb51598c..9c50fa811d38 100644 --- a/services/recoveryservices/mgmt/2017-07-01/backup/protecteditems.go +++ b/services/recoveryservices/mgmt/2017-07-01/backup/protecteditems.go @@ -40,125 +40,263 @@ func NewProtectedItemsClientWithBaseURI(baseURI string, subscriptionID string) P return ProtectedItemsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// List provides a pageable list of all items that are backed up within a vault. +// CreateOrUpdate enables backup of an item or to modifies the backup policy information of an already backed up item. +// This is an +// asynchronous operation. To know the status of the operation, call the GetItemOperationResult API. // Parameters: // vaultName - the name of the recovery services vault. // resourceGroupName - the name of the resource group where the recovery services vault is present. -// filter - oData filter options. -// skipToken - skipToken Filter. -func (client ProtectedItemsClient) List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result ProtectedItemResourceListPage, err error) { +// fabricName - fabric name associated with the backup item. +// containerName - container name associated with the backup item. +// protectedItemName - item name to be backed up. +// parameters - resource backed up item +func (client ProtectedItemsClient) CreateOrUpdate(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, parameters ProtectedItemResource) (result ProtectedItemResource, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectedItemsClient.List") + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectedItemsClient.CreateOrUpdate") defer func() { sc := -1 - if result.pirl.Response.Response != nil { - sc = result.pirl.Response.Response.StatusCode + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, vaultName, resourceGroupName, filter, skipToken) + req, err := client.CreateOrUpdatePreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters) if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectedItemsClient", "List", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "backup.ProtectedItemsClient", "CreateOrUpdate", nil, "Failure preparing request") return } - resp, err := client.ListSender(req) + resp, err := client.CreateOrUpdateSender(req) if err != nil { - result.pirl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "backup.ProtectedItemsClient", "List", resp, "Failure sending request") + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "backup.ProtectedItemsClient", "CreateOrUpdate", resp, "Failure sending request") return } - result.pirl, err = client.ListResponder(resp) + result, err = client.CreateOrUpdateResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectedItemsClient", "List", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "backup.ProtectedItemsClient", "CreateOrUpdate", resp, "Failure responding to request") } return } -// ListPreparer prepares the List request. -func (client ProtectedItemsClient) ListPreparer(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (*http.Request, error) { +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ProtectedItemsClient) CreateOrUpdatePreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, parameters ProtectedItemResource) (*http.Request, error) { pathParameters := map[string]interface{}{ + "containerName": autorest.Encode("path", containerName), + "fabricName": autorest.Encode("path", fabricName), + "protectedItemName": autorest.Encode("path", protectedItemName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2017-07-01" + const APIVersion = "2019-05-13" queryParameters := map[string]interface{}{ "api-version": APIVersion, } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(skipToken) > 0 { - queryParameters["$skipToken"] = autorest.Encode("query", skipToken) - } preparer := autorest.CreatePreparer( - autorest.AsGet(), + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectedItems", pathParameters), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}", pathParameters), + autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListSender sends the List 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 ProtectedItemsClient) ListSender(req *http.Request) (*http.Response, error) { +func (client ProtectedItemsClient) CreateOrUpdateSender(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 +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always // closes the http.Response Body. -func (client ProtectedItemsClient) ListResponder(resp *http.Response) (result ProtectedItemResourceList, err error) { +func (client ProtectedItemsClient) CreateOrUpdateResponder(resp *http.Response) (result ProtectedItemResource, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// listNextResults retrieves the next set of results, if any. -func (client ProtectedItemsClient) listNextResults(ctx context.Context, lastResults ProtectedItemResourceList) (result ProtectedItemResourceList, err error) { - req, err := lastResults.protectedItemResourceListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "backup.ProtectedItemsClient", "listNextResults", nil, "Failure preparing next results request") +// Delete used to disable backup of an item within a container. This is an asynchronous operation. To know the status +// of the +// request, call the GetItemOperationResult API. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// fabricName - fabric name associated with the backed up item. +// containerName - container name associated with the backed up item. +// protectedItemName - backed up item to be deleted. +func (client ProtectedItemsClient) Delete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectedItemsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() } - if req == nil { + req, err := client.DeletePreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectedItemsClient", "Delete", nil, "Failure preparing request") return } - resp, err := client.ListSender(req) + + resp, err := client.DeleteSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "backup.ProtectedItemsClient", "listNextResults", resp, "Failure sending next results request") + result.Response = resp + err = autorest.NewErrorWithError(err, "backup.ProtectedItemsClient", "Delete", resp, "Failure sending request") + return } - result, err = client.ListResponder(resp) + + result, err = client.DeleteResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectedItemsClient", "listNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "backup.ProtectedItemsClient", "Delete", resp, "Failure responding to request") } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ProtectedItemsClient) DeletePreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerName": autorest.Encode("path", containerName), + "fabricName": autorest.Encode("path", fabricName), + "protectedItemName": autorest.Encode("path", protectedItemName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2019-05-13" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}", 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 ProtectedItemsClient) 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 ProtectedItemsClient) 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 } -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ProtectedItemsClient) ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result ProtectedItemResourceListIterator, err error) { +// Get provides the details of the backed up item. This is an asynchronous operation. To know the status of the +// operation, +// call the GetItemOperationResult API. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// fabricName - fabric name associated with the backed up item. +// containerName - container name associated with the backed up item. +// protectedItemName - backed up item name whose details are to be fetched. +// filter - oData filter options. +func (client ProtectedItemsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (result ProtectedItemResource, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectedItemsClient.List") + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectedItemsClient.Get") defer func() { sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.List(ctx, vaultName, resourceGroupName, filter, skipToken) + req, err := client.GetPreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectedItemsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "backup.ProtectedItemsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectedItemsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ProtectedItemsClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerName": autorest.Encode("path", containerName), + "fabricName": autorest.Encode("path", fabricName), + "protectedItemName": autorest.Encode("path", protectedItemName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2019-05-13" + 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.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}", 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 ProtectedItemsClient) 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 ProtectedItemsClient) GetResponder(resp *http.Response) (result ProtectedItemResource, 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/recoveryservices/mgmt/2017-07-01/backup/protecteditemsgroup.go b/services/recoveryservices/mgmt/2017-07-01/backup/protecteditemsgroup.go index 155c709de2ba..0003d05eb5ed 100644 --- a/services/recoveryservices/mgmt/2017-07-01/backup/protecteditemsgroup.go +++ b/services/recoveryservices/mgmt/2017-07-01/backup/protecteditemsgroup.go @@ -40,263 +40,125 @@ func NewProtectedItemsGroupClientWithBaseURI(baseURI string, subscriptionID stri return ProtectedItemsGroupClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate enables backup of an item or to modifies the backup policy information of an already backed up item. -// This is an -// asynchronous operation. To know the status of the operation, call the GetItemOperationResult API. +// List provides a pageable list of all items that are backed up within a vault. // Parameters: // vaultName - the name of the recovery services vault. // resourceGroupName - the name of the resource group where the recovery services vault is present. -// fabricName - fabric name associated with the backup item. -// containerName - container name associated with the backup item. -// protectedItemName - item name to be backed up. -// parameters - resource backed up item -func (client ProtectedItemsGroupClient) CreateOrUpdate(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, parameters ProtectedItemResource) (result ProtectedItemResource, err error) { +// filter - oData filter options. +// skipToken - skipToken Filter. +func (client ProtectedItemsGroupClient) List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result ProtectedItemResourceListPage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectedItemsGroupClient.CreateOrUpdate") + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectedItemsGroupClient.List") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.pirl.Response.Response != nil { + sc = result.pirl.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } - req, err := client.CreateOrUpdatePreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters) + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, vaultName, resourceGroupName, filter, skipToken) if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectedItemsGroupClient", "CreateOrUpdate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "backup.ProtectedItemsGroupClient", "List", nil, "Failure preparing request") return } - resp, err := client.CreateOrUpdateSender(req) + resp, err := client.ListSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "backup.ProtectedItemsGroupClient", "CreateOrUpdate", resp, "Failure sending request") + result.pirl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "backup.ProtectedItemsGroupClient", "List", resp, "Failure sending request") return } - result, err = client.CreateOrUpdateResponder(resp) + result.pirl, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectedItemsGroupClient", "CreateOrUpdate", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "backup.ProtectedItemsGroupClient", "List", resp, "Failure responding to request") } return } -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ProtectedItemsGroupClient) CreateOrUpdatePreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, parameters ProtectedItemResource) (*http.Request, error) { +// ListPreparer prepares the List request. +func (client ProtectedItemsGroupClient) ListPreparer(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "containerName": autorest.Encode("path", containerName), - "fabricName": autorest.Encode("path", fabricName), - "protectedItemName": autorest.Encode("path", protectedItemName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2019-05-13" queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), + autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}", pathParameters), - autorest.WithJSON(parameters), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectedItems", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// ListSender sends the List request. The method will close the // http.Response Body if it receives an error. -func (client ProtectedItemsGroupClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { +func (client ProtectedItemsGroupClient) ListSender(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 +// ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client ProtectedItemsGroupClient) CreateOrUpdateResponder(resp *http.Response) (result ProtectedItemResource, err error) { +func (client ProtectedItemsGroupClient) ListResponder(resp *http.Response) (result ProtectedItemResourceList, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// Delete used to disable backup of an item within a container. This is an asynchronous operation. To know the status -// of the -// request, call the GetItemOperationResult API. -// Parameters: -// vaultName - the name of the recovery services vault. -// resourceGroupName - the name of the resource group where the recovery services vault is present. -// fabricName - fabric name associated with the backed up item. -// containerName - container name associated with the backed up item. -// protectedItemName - backed up item to be deleted. -func (client ProtectedItemsGroupClient) Delete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectedItemsGroupClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName) +// listNextResults retrieves the next set of results, if any. +func (client ProtectedItemsGroupClient) listNextResults(ctx context.Context, lastResults ProtectedItemResourceList) (result ProtectedItemResourceList, err error) { + req, err := lastResults.protectedItemResourceListPreparer(ctx) if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectedItemsGroupClient", "Delete", nil, "Failure preparing request") - return + return result, autorest.NewErrorWithError(err, "backup.ProtectedItemsGroupClient", "listNextResults", nil, "Failure preparing next results request") } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "backup.ProtectedItemsGroupClient", "Delete", resp, "Failure sending request") + if req == nil { return } - - result, err = client.DeleteResponder(resp) + resp, err := client.ListSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectedItemsGroupClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ProtectedItemsGroupClient) DeletePreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "containerName": autorest.Encode("path", containerName), - "fabricName": autorest.Encode("path", fabricName), - "protectedItemName": autorest.Encode("path", protectedItemName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vaultName": autorest.Encode("path", vaultName), + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "backup.ProtectedItemsGroupClient", "listNextResults", resp, "Failure sending next results request") } - - const APIVersion = "2016-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectedItemsGroupClient", "listNextResults", resp, "Failure responding to next results request") } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}", 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 ProtectedItemsGroupClient) 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 ProtectedItemsGroupClient) 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 provides the details of the backed up item. This is an asynchronous operation. To know the status of the -// operation, -// call the GetItemOperationResult API. -// Parameters: -// vaultName - the name of the recovery services vault. -// resourceGroupName - the name of the resource group where the recovery services vault is present. -// fabricName - fabric name associated with the backed up item. -// containerName - container name associated with the backed up item. -// protectedItemName - backed up item name whose details are to be fetched. -// filter - oData filter options. -func (client ProtectedItemsGroupClient) Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (result ProtectedItemResource, err error) { +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ProtectedItemsGroupClient) ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result ProtectedItemResourceListIterator, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectedItemsGroupClient.Get") + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectedItemsGroupClient.List") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } - req, err := client.GetPreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectedItemsGroupClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "backup.ProtectedItemsGroupClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectedItemsGroupClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ProtectedItemsGroupClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "containerName": autorest.Encode("path", containerName), - "fabricName": autorest.Encode("path", fabricName), - "protectedItemName": autorest.Encode("path", protectedItemName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vaultName": autorest.Encode("path", vaultName), - } - - const APIVersion = "2016-12-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.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}", 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 ProtectedItemsGroupClient) 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 ProtectedItemsGroupClient) GetResponder(resp *http.Response) (result ProtectedItemResource, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} + result.page, err = client.List(ctx, vaultName, resourceGroupName, filter, skipToken) return } diff --git a/services/recoveryservices/mgmt/2017-07-01/backup/protectionpolicies.go b/services/recoveryservices/mgmt/2017-07-01/backup/protectionpolicies.go index 7b3f596249a3..83f2afa24f43 100644 --- a/services/recoveryservices/mgmt/2017-07-01/backup/protectionpolicies.go +++ b/services/recoveryservices/mgmt/2017-07-01/backup/protectionpolicies.go @@ -89,7 +89,7 @@ func (client ProtectionPoliciesClient) CreateOrUpdatePreparer(ctx context.Contex "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2019-05-13" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -251,7 +251,7 @@ func (client ProtectionPoliciesClient) GetPreparer(ctx context.Context, vaultNam "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2019-05-13" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2017-07-01/backup/protectionpolicyoperationresults.go b/services/recoveryservices/mgmt/2017-07-01/backup/protectionpolicyoperationresults.go index 2f5240a8235d..4f004b44d86f 100644 --- a/services/recoveryservices/mgmt/2017-07-01/backup/protectionpolicyoperationresults.go +++ b/services/recoveryservices/mgmt/2017-07-01/backup/protectionpolicyoperationresults.go @@ -89,7 +89,7 @@ func (client ProtectionPolicyOperationResultsClient) GetPreparer(ctx context.Con "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2019-05-13" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2017-07-01/backup/recoverypoints.go b/services/recoveryservices/mgmt/2017-07-01/backup/recoverypoints.go index d0ad1506b4e5..52e2f8698015 100644 --- a/services/recoveryservices/mgmt/2017-07-01/backup/recoverypoints.go +++ b/services/recoveryservices/mgmt/2017-07-01/backup/recoverypoints.go @@ -94,7 +94,7 @@ func (client RecoveryPointsClient) GetPreparer(ctx context.Context, vaultName st "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2019-05-13" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -179,7 +179,7 @@ func (client RecoveryPointsClient) ListPreparer(ctx context.Context, vaultName s "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2019-05-13" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2017-07-01/backup/resourcevaultconfigs.go b/services/recoveryservices/mgmt/2017-07-01/backup/resourcevaultconfigs.go index 3cb36b898367..be1d140227b9 100644 --- a/services/recoveryservices/mgmt/2017-07-01/backup/resourcevaultconfigs.go +++ b/services/recoveryservices/mgmt/2017-07-01/backup/resourcevaultconfigs.go @@ -84,7 +84,7 @@ func (client ResourceVaultConfigsClient) GetPreparer(ctx context.Context, vaultN "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2019-05-13" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -162,7 +162,7 @@ func (client ResourceVaultConfigsClient) UpdatePreparer(ctx context.Context, vau "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2019-05-13" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2017-07-01/backup/restores.go b/services/recoveryservices/mgmt/2017-07-01/backup/restores.go index 211714201e84..ae81caf616b1 100644 --- a/services/recoveryservices/mgmt/2017-07-01/backup/restores.go +++ b/services/recoveryservices/mgmt/2017-07-01/backup/restores.go @@ -95,7 +95,7 @@ func (client RestoresClient) TriggerPreparer(ctx context.Context, vaultName stri "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2019-05-13" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/scheduler/mgmt/2016-01-01/scheduler/client.go b/services/scheduler/mgmt/2016-01-01/scheduler/client.go index 9d67b564e8ab..a9c15b2d63fe 100644 --- a/services/scheduler/mgmt/2016-01-01/scheduler/client.go +++ b/services/scheduler/mgmt/2016-01-01/scheduler/client.go @@ -29,7 +29,6 @@ const ( DefaultBaseURI = "https://management.azure.com" ) -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // BaseClient is the base client for Scheduler. type BaseClient struct { autorest.Client @@ -37,13 +36,11 @@ type BaseClient struct { SubscriptionID string } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // New creates an instance of the BaseClient client. func New(subscriptionID string) BaseClient { return NewWithBaseURI(DefaultBaseURI, subscriptionID) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // NewWithBaseURI creates an instance of the BaseClient client. func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { return BaseClient{ diff --git a/services/scheduler/mgmt/2016-01-01/scheduler/jobcollections.go b/services/scheduler/mgmt/2016-01-01/scheduler/jobcollections.go index b8b3c3f792ed..ee9bab302834 100644 --- a/services/scheduler/mgmt/2016-01-01/scheduler/jobcollections.go +++ b/services/scheduler/mgmt/2016-01-01/scheduler/jobcollections.go @@ -25,25 +25,21 @@ import ( "net/http" ) -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobCollectionsClient is the client for the JobCollections methods of the Scheduler service. type JobCollectionsClient struct { BaseClient } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // NewJobCollectionsClient creates an instance of the JobCollectionsClient client. func NewJobCollectionsClient(subscriptionID string) JobCollectionsClient { return NewJobCollectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // NewJobCollectionsClientWithBaseURI creates an instance of the JobCollectionsClient client. func NewJobCollectionsClientWithBaseURI(baseURI string, subscriptionID string) JobCollectionsClient { return JobCollectionsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // CreateOrUpdate provisions a new job collection or updates an existing job collection. // Parameters: // resourceGroupName - the resource group name. @@ -81,7 +77,6 @@ func (client JobCollectionsClient) CreateOrUpdate(ctx context.Context, resourceG return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // CreateOrUpdatePreparer prepares the CreateOrUpdate request. func (client JobCollectionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, jobCollectionName string, jobCollection JobCollectionDefinition) (*http.Request, error) { pathParameters := map[string]interface{}{ @@ -107,7 +102,6 @@ func (client JobCollectionsClient) CreateOrUpdatePreparer(ctx context.Context, r return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client JobCollectionsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { @@ -115,7 +109,6 @@ func (client JobCollectionsClient) CreateOrUpdateSender(req *http.Request) (*htt return autorest.SendWithSender(client, req, sd...) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always // closes the http.Response Body. func (client JobCollectionsClient) CreateOrUpdateResponder(resp *http.Response) (result JobCollectionDefinition, err error) { @@ -129,7 +122,6 @@ func (client JobCollectionsClient) CreateOrUpdateResponder(resp *http.Response) return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Delete deletes a job collection. // Parameters: // resourceGroupName - the resource group name. @@ -166,7 +158,6 @@ func (client JobCollectionsClient) Delete(ctx context.Context, resourceGroupName return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // DeletePreparer prepares the Delete request. func (client JobCollectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, jobCollectionName string) (*http.Request, error) { pathParameters := map[string]interface{}{ @@ -188,7 +179,6 @@ func (client JobCollectionsClient) DeletePreparer(ctx context.Context, resourceG return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client JobCollectionsClient) DeleteSender(req *http.Request) (*http.Response, error) { @@ -196,7 +186,6 @@ func (client JobCollectionsClient) DeleteSender(req *http.Request) (*http.Respon return autorest.SendWithSender(client, req, sd...) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // DeleteResponder handles the response to the Delete request. The method always // closes the http.Response Body. func (client JobCollectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { @@ -209,7 +198,6 @@ func (client JobCollectionsClient) DeleteResponder(resp *http.Response) (result return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Disable disables all of the jobs in the job collection. // Parameters: // resourceGroupName - the resource group name. @@ -246,7 +234,6 @@ func (client JobCollectionsClient) Disable(ctx context.Context, resourceGroupNam return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // DisablePreparer prepares the Disable request. func (client JobCollectionsClient) DisablePreparer(ctx context.Context, resourceGroupName string, jobCollectionName string) (*http.Request, error) { pathParameters := map[string]interface{}{ @@ -268,7 +255,6 @@ func (client JobCollectionsClient) DisablePreparer(ctx context.Context, resource return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // DisableSender sends the Disable request. The method will close the // http.Response Body if it receives an error. func (client JobCollectionsClient) DisableSender(req *http.Request) (*http.Response, error) { @@ -276,7 +262,6 @@ func (client JobCollectionsClient) DisableSender(req *http.Request) (*http.Respo return autorest.SendWithSender(client, req, sd...) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // DisableResponder handles the response to the Disable request. The method always // closes the http.Response Body. func (client JobCollectionsClient) DisableResponder(resp *http.Response) (result autorest.Response, err error) { @@ -289,7 +274,6 @@ func (client JobCollectionsClient) DisableResponder(resp *http.Response) (result return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Enable enables all of the jobs in the job collection. // Parameters: // resourceGroupName - the resource group name. @@ -326,7 +310,6 @@ func (client JobCollectionsClient) Enable(ctx context.Context, resourceGroupName return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // EnablePreparer prepares the Enable request. func (client JobCollectionsClient) EnablePreparer(ctx context.Context, resourceGroupName string, jobCollectionName string) (*http.Request, error) { pathParameters := map[string]interface{}{ @@ -348,7 +331,6 @@ func (client JobCollectionsClient) EnablePreparer(ctx context.Context, resourceG return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // EnableSender sends the Enable request. The method will close the // http.Response Body if it receives an error. func (client JobCollectionsClient) EnableSender(req *http.Request) (*http.Response, error) { @@ -356,7 +338,6 @@ func (client JobCollectionsClient) EnableSender(req *http.Request) (*http.Respon return autorest.SendWithSender(client, req, sd...) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // EnableResponder handles the response to the Enable request. The method always // closes the http.Response Body. func (client JobCollectionsClient) EnableResponder(resp *http.Response) (result autorest.Response, err error) { @@ -369,7 +350,6 @@ func (client JobCollectionsClient) EnableResponder(resp *http.Response) (result return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Get gets a job collection. // Parameters: // resourceGroupName - the resource group name. @@ -406,7 +386,6 @@ func (client JobCollectionsClient) Get(ctx context.Context, resourceGroupName st return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // GetPreparer prepares the Get request. func (client JobCollectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, jobCollectionName string) (*http.Request, error) { pathParameters := map[string]interface{}{ @@ -428,7 +407,6 @@ func (client JobCollectionsClient) GetPreparer(ctx context.Context, resourceGrou return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client JobCollectionsClient) GetSender(req *http.Request) (*http.Response, error) { @@ -436,7 +414,6 @@ func (client JobCollectionsClient) GetSender(req *http.Request) (*http.Response, return autorest.SendWithSender(client, req, sd...) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. func (client JobCollectionsClient) GetResponder(resp *http.Response) (result JobCollectionDefinition, err error) { @@ -450,7 +427,6 @@ func (client JobCollectionsClient) GetResponder(resp *http.Response) (result Job return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ListByResourceGroup gets all job collections under specified resource group. // Parameters: // resourceGroupName - the resource group name. @@ -487,7 +463,6 @@ func (client JobCollectionsClient) ListByResourceGroup(ctx context.Context, reso return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ListByResourceGroupPreparer prepares the ListByResourceGroup request. func (client JobCollectionsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { pathParameters := map[string]interface{}{ @@ -508,7 +483,6 @@ func (client JobCollectionsClient) ListByResourceGroupPreparer(ctx context.Conte return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the // http.Response Body if it receives an error. func (client JobCollectionsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { @@ -516,7 +490,6 @@ func (client JobCollectionsClient) ListByResourceGroupSender(req *http.Request) return autorest.SendWithSender(client, req, sd...) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always // closes the http.Response Body. func (client JobCollectionsClient) ListByResourceGroupResponder(resp *http.Response) (result JobCollectionListResult, err error) { @@ -551,7 +524,6 @@ func (client JobCollectionsClient) listByResourceGroupNextResults(ctx context.Co return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. func (client JobCollectionsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result JobCollectionListResultIterator, err error) { if tracing.IsEnabled() { @@ -568,7 +540,6 @@ func (client JobCollectionsClient) ListByResourceGroupComplete(ctx context.Conte return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ListBySubscription gets all job collections under specified subscription. func (client JobCollectionsClient) ListBySubscription(ctx context.Context) (result JobCollectionListResultPage, err error) { if tracing.IsEnabled() { @@ -603,7 +574,6 @@ func (client JobCollectionsClient) ListBySubscription(ctx context.Context) (resu return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ListBySubscriptionPreparer prepares the ListBySubscription request. func (client JobCollectionsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { pathParameters := map[string]interface{}{ @@ -623,7 +593,6 @@ func (client JobCollectionsClient) ListBySubscriptionPreparer(ctx context.Contex return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ListBySubscriptionSender sends the ListBySubscription request. The method will close the // http.Response Body if it receives an error. func (client JobCollectionsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { @@ -631,7 +600,6 @@ func (client JobCollectionsClient) ListBySubscriptionSender(req *http.Request) ( return autorest.SendWithSender(client, req, sd...) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always // closes the http.Response Body. func (client JobCollectionsClient) ListBySubscriptionResponder(resp *http.Response) (result JobCollectionListResult, err error) { @@ -666,7 +634,6 @@ func (client JobCollectionsClient) listBySubscriptionNextResults(ctx context.Con return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. func (client JobCollectionsClient) ListBySubscriptionComplete(ctx context.Context) (result JobCollectionListResultIterator, err error) { if tracing.IsEnabled() { @@ -683,7 +650,6 @@ func (client JobCollectionsClient) ListBySubscriptionComplete(ctx context.Contex return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Patch patches an existing job collection. // Parameters: // resourceGroupName - the resource group name. @@ -721,7 +687,6 @@ func (client JobCollectionsClient) Patch(ctx context.Context, resourceGroupName return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // PatchPreparer prepares the Patch request. func (client JobCollectionsClient) PatchPreparer(ctx context.Context, resourceGroupName string, jobCollectionName string, jobCollection JobCollectionDefinition) (*http.Request, error) { pathParameters := map[string]interface{}{ @@ -747,7 +712,6 @@ func (client JobCollectionsClient) PatchPreparer(ctx context.Context, resourceGr return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // PatchSender sends the Patch request. The method will close the // http.Response Body if it receives an error. func (client JobCollectionsClient) PatchSender(req *http.Request) (*http.Response, error) { @@ -755,7 +719,6 @@ func (client JobCollectionsClient) PatchSender(req *http.Request) (*http.Respons return autorest.SendWithSender(client, req, sd...) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // PatchResponder handles the response to the Patch request. The method always // closes the http.Response Body. func (client JobCollectionsClient) PatchResponder(resp *http.Response) (result JobCollectionDefinition, err error) { diff --git a/services/scheduler/mgmt/2016-01-01/scheduler/jobs.go b/services/scheduler/mgmt/2016-01-01/scheduler/jobs.go index 74402bf78a2f..357327abdd88 100644 --- a/services/scheduler/mgmt/2016-01-01/scheduler/jobs.go +++ b/services/scheduler/mgmt/2016-01-01/scheduler/jobs.go @@ -25,25 +25,21 @@ import ( "net/http" ) -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobsClient is the client for the Jobs methods of the Scheduler service. type JobsClient struct { BaseClient } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // NewJobsClient creates an instance of the JobsClient client. func NewJobsClient(subscriptionID string) JobsClient { return NewJobsClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // NewJobsClientWithBaseURI creates an instance of the JobsClient client. func NewJobsClientWithBaseURI(baseURI string, subscriptionID string) JobsClient { return JobsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // CreateOrUpdate provisions a new job or updates an existing job. // Parameters: // resourceGroupName - the resource group name. @@ -82,7 +78,6 @@ func (client JobsClient) CreateOrUpdate(ctx context.Context, resourceGroupName s return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // CreateOrUpdatePreparer prepares the CreateOrUpdate request. func (client JobsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, jobCollectionName string, jobName string, job JobDefinition) (*http.Request, error) { pathParameters := map[string]interface{}{ @@ -110,7 +105,6 @@ func (client JobsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGro return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client JobsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { @@ -118,7 +112,6 @@ func (client JobsClient) CreateOrUpdateSender(req *http.Request) (*http.Response return autorest.SendWithSender(client, req, sd...) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always // closes the http.Response Body. func (client JobsClient) CreateOrUpdateResponder(resp *http.Response) (result JobDefinition, err error) { @@ -132,7 +125,6 @@ func (client JobsClient) CreateOrUpdateResponder(resp *http.Response) (result Jo return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Delete deletes a job. // Parameters: // resourceGroupName - the resource group name. @@ -170,7 +162,6 @@ func (client JobsClient) Delete(ctx context.Context, resourceGroupName string, j return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // DeletePreparer prepares the Delete request. func (client JobsClient) DeletePreparer(ctx context.Context, resourceGroupName string, jobCollectionName string, jobName string) (*http.Request, error) { pathParameters := map[string]interface{}{ @@ -193,7 +184,6 @@ func (client JobsClient) DeletePreparer(ctx context.Context, resourceGroupName s return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // 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) (*http.Response, error) { @@ -201,7 +191,6 @@ func (client JobsClient) DeleteSender(req *http.Request) (*http.Response, error) return autorest.SendWithSender(client, req, sd...) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // 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) { @@ -214,7 +203,6 @@ func (client JobsClient) DeleteResponder(resp *http.Response) (result autorest.R return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Get gets a job. // Parameters: // resourceGroupName - the resource group name. @@ -252,7 +240,6 @@ func (client JobsClient) Get(ctx context.Context, resourceGroupName string, jobC return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // GetPreparer prepares the Get request. func (client JobsClient) GetPreparer(ctx context.Context, resourceGroupName string, jobCollectionName string, jobName string) (*http.Request, error) { pathParameters := map[string]interface{}{ @@ -275,7 +262,6 @@ func (client JobsClient) GetPreparer(ctx context.Context, resourceGroupName stri return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // 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) { @@ -283,7 +269,6 @@ func (client JobsClient) GetSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, sd...) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. func (client JobsClient) GetResponder(resp *http.Response) (result JobDefinition, err error) { @@ -297,7 +282,6 @@ func (client JobsClient) GetResponder(resp *http.Response) (result JobDefinition return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // List lists all jobs under the specified job collection. // Parameters: // resourceGroupName - the resource group name. @@ -338,7 +322,6 @@ func (client JobsClient) List(ctx context.Context, resourceGroupName string, job return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ListPreparer prepares the List request. func (client JobsClient) ListPreparer(ctx context.Context, resourceGroupName string, jobCollectionName string, top *int32, skip *int32, filter string) (*http.Request, error) { pathParameters := map[string]interface{}{ @@ -369,7 +352,6 @@ func (client JobsClient) ListPreparer(ctx context.Context, resourceGroupName str return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // 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) { @@ -377,7 +359,6 @@ func (client JobsClient) ListSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, sd...) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ListResponder handles the response to the List request. The method always // closes the http.Response Body. func (client JobsClient) ListResponder(resp *http.Response) (result JobListResult, err error) { @@ -412,7 +393,6 @@ func (client JobsClient) listNextResults(ctx context.Context, lastResults JobLis return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ListComplete enumerates all values, automatically crossing page boundaries as required. func (client JobsClient) ListComplete(ctx context.Context, resourceGroupName string, jobCollectionName string, top *int32, skip *int32, filter string) (result JobListResultIterator, err error) { if tracing.IsEnabled() { @@ -429,7 +409,6 @@ func (client JobsClient) ListComplete(ctx context.Context, resourceGroupName str return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ListJobHistory lists job history. // Parameters: // resourceGroupName - the resource group name. @@ -471,7 +450,6 @@ func (client JobsClient) ListJobHistory(ctx context.Context, resourceGroupName s return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ListJobHistoryPreparer prepares the ListJobHistory request. func (client JobsClient) ListJobHistoryPreparer(ctx context.Context, resourceGroupName string, jobCollectionName string, jobName string, top *int32, skip *int32, filter string) (*http.Request, error) { pathParameters := map[string]interface{}{ @@ -503,7 +481,6 @@ func (client JobsClient) ListJobHistoryPreparer(ctx context.Context, resourceGro return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ListJobHistorySender sends the ListJobHistory request. The method will close the // http.Response Body if it receives an error. func (client JobsClient) ListJobHistorySender(req *http.Request) (*http.Response, error) { @@ -511,7 +488,6 @@ func (client JobsClient) ListJobHistorySender(req *http.Request) (*http.Response return autorest.SendWithSender(client, req, sd...) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ListJobHistoryResponder handles the response to the ListJobHistory request. The method always // closes the http.Response Body. func (client JobsClient) ListJobHistoryResponder(resp *http.Response) (result JobHistoryListResult, err error) { @@ -546,7 +522,6 @@ func (client JobsClient) listJobHistoryNextResults(ctx context.Context, lastResu return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ListJobHistoryComplete enumerates all values, automatically crossing page boundaries as required. func (client JobsClient) ListJobHistoryComplete(ctx context.Context, resourceGroupName string, jobCollectionName string, jobName string, top *int32, skip *int32, filter string) (result JobHistoryListResultIterator, err error) { if tracing.IsEnabled() { @@ -563,7 +538,6 @@ func (client JobsClient) ListJobHistoryComplete(ctx context.Context, resourceGro return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Patch patches an existing job. // Parameters: // resourceGroupName - the resource group name. @@ -602,7 +576,6 @@ func (client JobsClient) Patch(ctx context.Context, resourceGroupName string, jo return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // PatchPreparer prepares the Patch request. func (client JobsClient) PatchPreparer(ctx context.Context, resourceGroupName string, jobCollectionName string, jobName string, job JobDefinition) (*http.Request, error) { pathParameters := map[string]interface{}{ @@ -630,7 +603,6 @@ func (client JobsClient) PatchPreparer(ctx context.Context, resourceGroupName st return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // PatchSender sends the Patch request. The method will close the // http.Response Body if it receives an error. func (client JobsClient) PatchSender(req *http.Request) (*http.Response, error) { @@ -638,7 +610,6 @@ func (client JobsClient) PatchSender(req *http.Request) (*http.Response, error) return autorest.SendWithSender(client, req, sd...) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // PatchResponder handles the response to the Patch request. The method always // closes the http.Response Body. func (client JobsClient) PatchResponder(resp *http.Response) (result JobDefinition, err error) { @@ -652,7 +623,6 @@ func (client JobsClient) PatchResponder(resp *http.Response) (result JobDefiniti return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Run runs a job. // Parameters: // resourceGroupName - the resource group name. @@ -690,7 +660,6 @@ func (client JobsClient) Run(ctx context.Context, resourceGroupName string, jobC return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // RunPreparer prepares the Run request. func (client JobsClient) RunPreparer(ctx context.Context, resourceGroupName string, jobCollectionName string, jobName string) (*http.Request, error) { pathParameters := map[string]interface{}{ @@ -713,7 +682,6 @@ func (client JobsClient) RunPreparer(ctx context.Context, resourceGroupName stri return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // RunSender sends the Run request. The method will close the // http.Response Body if it receives an error. func (client JobsClient) RunSender(req *http.Request) (*http.Response, error) { @@ -721,7 +689,6 @@ func (client JobsClient) RunSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, sd...) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // RunResponder handles the response to the Run request. The method always // closes the http.Response Body. func (client JobsClient) RunResponder(resp *http.Response) (result autorest.Response, err error) { diff --git a/services/scheduler/mgmt/2016-01-01/scheduler/models.go b/services/scheduler/mgmt/2016-01-01/scheduler/models.go index 44efd9ac6a83..94986d4298ef 100644 --- a/services/scheduler/mgmt/2016-01-01/scheduler/models.go +++ b/services/scheduler/mgmt/2016-01-01/scheduler/models.go @@ -50,13 +50,11 @@ const ( Wednesday DayOfWeek = "Wednesday" ) -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // PossibleDayOfWeekValues returns an array of possible values for the DayOfWeek const type. func PossibleDayOfWeekValues() []DayOfWeek { return []DayOfWeek{Friday, Monday, Saturday, Sunday, Thursday, Tuesday, Wednesday} } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // HTTPAuthenticationType enumerates the values for http authentication type. type HTTPAuthenticationType string @@ -71,13 +69,11 @@ const ( NotSpecified HTTPAuthenticationType = "NotSpecified" ) -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // PossibleHTTPAuthenticationTypeValues returns an array of possible values for the HTTPAuthenticationType const type. func PossibleHTTPAuthenticationTypeValues() []HTTPAuthenticationType { return []HTTPAuthenticationType{ActiveDirectoryOAuth, Basic, ClientCertificate, NotSpecified} } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobActionType enumerates the values for job action type. type JobActionType string @@ -94,13 +90,11 @@ const ( StorageQueue JobActionType = "StorageQueue" ) -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // PossibleJobActionTypeValues returns an array of possible values for the JobActionType const type. func PossibleJobActionTypeValues() []JobActionType { return []JobActionType{HTTP, HTTPS, ServiceBusQueue, ServiceBusTopic, StorageQueue} } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobCollectionState enumerates the values for job collection state. type JobCollectionState string @@ -115,13 +109,11 @@ const ( Suspended JobCollectionState = "Suspended" ) -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // PossibleJobCollectionStateValues returns an array of possible values for the JobCollectionState const type. func PossibleJobCollectionStateValues() []JobCollectionState { return []JobCollectionState{Deleted, Disabled, Enabled, Suspended} } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobExecutionStatus enumerates the values for job execution status. type JobExecutionStatus string @@ -134,13 +126,11 @@ const ( Postponed JobExecutionStatus = "Postponed" ) -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // PossibleJobExecutionStatusValues returns an array of possible values for the JobExecutionStatus const type. func PossibleJobExecutionStatusValues() []JobExecutionStatus { return []JobExecutionStatus{Completed, Failed, Postponed} } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobHistoryActionName enumerates the values for job history action name. type JobHistoryActionName string @@ -151,13 +141,11 @@ const ( MainAction JobHistoryActionName = "MainAction" ) -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // PossibleJobHistoryActionNameValues returns an array of possible values for the JobHistoryActionName const type. func PossibleJobHistoryActionNameValues() []JobHistoryActionName { return []JobHistoryActionName{ErrorAction, MainAction} } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobScheduleDay enumerates the values for job schedule day. type JobScheduleDay string @@ -178,13 +166,11 @@ const ( JobScheduleDayWednesday JobScheduleDay = "Wednesday" ) -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // PossibleJobScheduleDayValues returns an array of possible values for the JobScheduleDay const type. func PossibleJobScheduleDayValues() []JobScheduleDay { return []JobScheduleDay{JobScheduleDayFriday, JobScheduleDayMonday, JobScheduleDaySaturday, JobScheduleDaySunday, JobScheduleDayThursday, JobScheduleDayTuesday, JobScheduleDayWednesday} } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobState enumerates the values for job state. type JobState string @@ -199,13 +185,11 @@ const ( JobStateFaulted JobState = "Faulted" ) -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // PossibleJobStateValues returns an array of possible values for the JobState const type. func PossibleJobStateValues() []JobState { return []JobState{JobStateCompleted, JobStateDisabled, JobStateEnabled, JobStateFaulted} } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // RecurrenceFrequency enumerates the values for recurrence frequency. type RecurrenceFrequency string @@ -222,13 +206,11 @@ const ( Week RecurrenceFrequency = "Week" ) -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // PossibleRecurrenceFrequencyValues returns an array of possible values for the RecurrenceFrequency const type. func PossibleRecurrenceFrequencyValues() []RecurrenceFrequency { return []RecurrenceFrequency{Day, Hour, Minute, Month, Week} } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // RetryType enumerates the values for retry type. type RetryType string @@ -239,13 +221,11 @@ const ( None RetryType = "None" ) -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // PossibleRetryTypeValues returns an array of possible values for the RetryType const type. func PossibleRetryTypeValues() []RetryType { return []RetryType{Fixed, None} } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ServiceBusAuthenticationType enumerates the values for service bus authentication type. type ServiceBusAuthenticationType string @@ -256,13 +236,11 @@ const ( ServiceBusAuthenticationTypeSharedAccessKey ServiceBusAuthenticationType = "SharedAccessKey" ) -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // PossibleServiceBusAuthenticationTypeValues returns an array of possible values for the ServiceBusAuthenticationType const type. func PossibleServiceBusAuthenticationTypeValues() []ServiceBusAuthenticationType { return []ServiceBusAuthenticationType{ServiceBusAuthenticationTypeNotSpecified, ServiceBusAuthenticationTypeSharedAccessKey} } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ServiceBusTransportType enumerates the values for service bus transport type. type ServiceBusTransportType string @@ -275,13 +253,11 @@ const ( ServiceBusTransportTypeNotSpecified ServiceBusTransportType = "NotSpecified" ) -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // PossibleServiceBusTransportTypeValues returns an array of possible values for the ServiceBusTransportType const type. func PossibleServiceBusTransportTypeValues() []ServiceBusTransportType { return []ServiceBusTransportType{ServiceBusTransportTypeAMQP, ServiceBusTransportTypeNetMessaging, ServiceBusTransportTypeNotSpecified} } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // SkuDefinition enumerates the values for sku definition. type SkuDefinition string @@ -294,13 +270,11 @@ const ( Standard SkuDefinition = "Standard" ) -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // PossibleSkuDefinitionValues returns an array of possible values for the SkuDefinition const type. func PossibleSkuDefinitionValues() []SkuDefinition { return []SkuDefinition{Free, Premium, Standard} } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // BasicAuthentication ... type BasicAuthentication struct { // Username - Gets or sets the username. @@ -311,7 +285,6 @@ type BasicAuthentication struct { Type HTTPAuthenticationType `json:"type,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ClientCertAuthentication ... type ClientCertAuthentication struct { // Password - Gets or sets the password. @@ -328,14 +301,12 @@ type ClientCertAuthentication struct { Type HTTPAuthenticationType `json:"type,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // HTTPAuthentication ... type HTTPAuthentication struct { // Type - Gets or sets the http authentication type. Possible values include: 'NotSpecified', 'ClientCertificate', 'ActiveDirectoryOAuth', 'Basic' Type HTTPAuthenticationType `json:"type,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // HTTPRequest ... type HTTPRequest struct { // Authentication - Gets or sets the http authentication. @@ -350,7 +321,6 @@ type HTTPRequest struct { Headers map[string]*string `json:"headers"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // MarshalJSON is the custom marshaler for HTTPRequest. func (hr HTTPRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -372,7 +342,6 @@ func (hr HTTPRequest) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobAction ... type JobAction struct { // Type - Gets or sets the job action type. Possible values include: 'HTTP', 'HTTPS', 'StorageQueue', 'ServiceBusQueue', 'ServiceBusTopic' @@ -391,7 +360,6 @@ type JobAction struct { ErrorAction *JobErrorAction `json:"errorAction,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobCollectionDefinition ... type JobCollectionDefinition struct { autorest.Response `json:"-"` @@ -409,7 +377,6 @@ type JobCollectionDefinition struct { Properties *JobCollectionProperties `json:"properties,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // MarshalJSON is the custom marshaler for JobCollectionDefinition. func (jcd JobCollectionDefinition) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -428,7 +395,6 @@ func (jcd JobCollectionDefinition) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobCollectionListResult ... type JobCollectionListResult struct { autorest.Response `json:"-"` @@ -438,7 +404,6 @@ type JobCollectionListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobCollectionListResultIterator provides access to a complete listing of JobCollectionDefinition values. type JobCollectionListResultIterator struct { i int @@ -483,13 +448,11 @@ func (iter JobCollectionListResultIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Response returns the raw server response from the last page request. func (iter JobCollectionListResultIterator) Response() JobCollectionListResult { return iter.page.Response() } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. func (iter JobCollectionListResultIterator) Value() JobCollectionDefinition { @@ -499,13 +462,11 @@ func (iter JobCollectionListResultIterator) Value() JobCollectionDefinition { return iter.page.Values()[iter.i] } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Creates a new instance of the JobCollectionListResultIterator type. func NewJobCollectionListResultIterator(page JobCollectionListResultPage) JobCollectionListResultIterator { return JobCollectionListResultIterator{page: page} } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // IsEmpty returns true if the ListResult contains no values. func (jclr JobCollectionListResult) IsEmpty() bool { return jclr.Value == nil || len(*jclr.Value) == 0 @@ -523,7 +484,6 @@ func (jclr JobCollectionListResult) jobCollectionListResultPreparer(ctx context. autorest.WithBaseURL(to.String(jclr.NextLink))) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobCollectionListResultPage contains a page of JobCollectionDefinition values. type JobCollectionListResultPage struct { fn func(context.Context, JobCollectionListResult) (JobCollectionListResult, error) @@ -563,13 +523,11 @@ func (page JobCollectionListResultPage) NotDone() bool { return !page.jclr.IsEmpty() } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Response returns the raw server response from the last page request. func (page JobCollectionListResultPage) Response() JobCollectionListResult { return page.jclr } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Values returns the slice of values for the current page or nil if there are no values. func (page JobCollectionListResultPage) Values() []JobCollectionDefinition { if page.jclr.IsEmpty() { @@ -578,13 +536,11 @@ func (page JobCollectionListResultPage) Values() []JobCollectionDefinition { return *page.jclr.Value } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Creates a new instance of the JobCollectionListResultPage type. func NewJobCollectionListResultPage(getNextPage func(context.Context, JobCollectionListResult) (JobCollectionListResult, error)) JobCollectionListResultPage { return JobCollectionListResultPage{fn: getNextPage} } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobCollectionProperties ... type JobCollectionProperties struct { // Sku - Gets or sets the SKU. @@ -595,7 +551,6 @@ type JobCollectionProperties struct { Quota *JobCollectionQuota `json:"quota,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobCollectionQuota ... type JobCollectionQuota struct { // MaxJobCount - Gets or set the maximum job count. @@ -606,7 +561,6 @@ type JobCollectionQuota struct { MaxRecurrence *JobMaxRecurrence `json:"maxRecurrence,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobDefinition ... type JobDefinition struct { autorest.Response `json:"-"` @@ -620,7 +574,6 @@ type JobDefinition struct { Properties *JobProperties `json:"properties,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobErrorAction ... type JobErrorAction struct { // Type - Gets or sets the job error action type. Possible values include: 'HTTP', 'HTTPS', 'StorageQueue', 'ServiceBusQueue', 'ServiceBusTopic' @@ -637,7 +590,6 @@ type JobErrorAction struct { RetryPolicy *RetryPolicy `json:"retryPolicy,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobHistoryDefinition ... type JobHistoryDefinition struct { // ID - READ-ONLY; Gets the job history identifier. @@ -650,7 +602,6 @@ type JobHistoryDefinition struct { Properties *JobHistoryDefinitionProperties `json:"properties,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobHistoryDefinitionProperties ... type JobHistoryDefinitionProperties struct { // StartTime - READ-ONLY; Gets the start time for this job. @@ -671,14 +622,12 @@ type JobHistoryDefinitionProperties struct { RepeatCount *int32 `json:"repeatCount,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobHistoryFilter ... type JobHistoryFilter struct { // Status - Gets or sets the job execution status. Possible values include: 'Completed', 'Failed', 'Postponed' Status JobExecutionStatus `json:"status,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobHistoryListResult ... type JobHistoryListResult struct { autorest.Response `json:"-"` @@ -688,7 +637,6 @@ type JobHistoryListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobHistoryListResultIterator provides access to a complete listing of JobHistoryDefinition values. type JobHistoryListResultIterator struct { i int @@ -733,13 +681,11 @@ func (iter JobHistoryListResultIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Response returns the raw server response from the last page request. func (iter JobHistoryListResultIterator) Response() JobHistoryListResult { return iter.page.Response() } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. func (iter JobHistoryListResultIterator) Value() JobHistoryDefinition { @@ -749,13 +695,11 @@ func (iter JobHistoryListResultIterator) Value() JobHistoryDefinition { return iter.page.Values()[iter.i] } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Creates a new instance of the JobHistoryListResultIterator type. func NewJobHistoryListResultIterator(page JobHistoryListResultPage) JobHistoryListResultIterator { return JobHistoryListResultIterator{page: page} } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // IsEmpty returns true if the ListResult contains no values. func (jhlr JobHistoryListResult) IsEmpty() bool { return jhlr.Value == nil || len(*jhlr.Value) == 0 @@ -773,7 +717,6 @@ func (jhlr JobHistoryListResult) jobHistoryListResultPreparer(ctx context.Contex autorest.WithBaseURL(to.String(jhlr.NextLink))) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobHistoryListResultPage contains a page of JobHistoryDefinition values. type JobHistoryListResultPage struct { fn func(context.Context, JobHistoryListResult) (JobHistoryListResult, error) @@ -813,13 +756,11 @@ func (page JobHistoryListResultPage) NotDone() bool { return !page.jhlr.IsEmpty() } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Response returns the raw server response from the last page request. func (page JobHistoryListResultPage) Response() JobHistoryListResult { return page.jhlr } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Values returns the slice of values for the current page or nil if there are no values. func (page JobHistoryListResultPage) Values() []JobHistoryDefinition { if page.jhlr.IsEmpty() { @@ -828,13 +769,11 @@ func (page JobHistoryListResultPage) Values() []JobHistoryDefinition { return *page.jhlr.Value } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Creates a new instance of the JobHistoryListResultPage type. func NewJobHistoryListResultPage(getNextPage func(context.Context, JobHistoryListResult) (JobHistoryListResult, error)) JobHistoryListResultPage { return JobHistoryListResultPage{fn: getNextPage} } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobListResult ... type JobListResult struct { autorest.Response `json:"-"` @@ -844,7 +783,6 @@ type JobListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobListResultIterator provides access to a complete listing of JobDefinition values. type JobListResultIterator struct { i int @@ -889,13 +827,11 @@ func (iter JobListResultIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Response returns the raw server response from the last page request. func (iter JobListResultIterator) Response() JobListResult { return iter.page.Response() } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. func (iter JobListResultIterator) Value() JobDefinition { @@ -905,13 +841,11 @@ func (iter JobListResultIterator) Value() JobDefinition { return iter.page.Values()[iter.i] } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Creates a new instance of the JobListResultIterator type. func NewJobListResultIterator(page JobListResultPage) JobListResultIterator { return JobListResultIterator{page: page} } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // IsEmpty returns true if the ListResult contains no values. func (jlr JobListResult) IsEmpty() bool { return jlr.Value == nil || len(*jlr.Value) == 0 @@ -929,7 +863,6 @@ func (jlr JobListResult) jobListResultPreparer(ctx context.Context) (*http.Reque autorest.WithBaseURL(to.String(jlr.NextLink))) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobListResultPage contains a page of JobDefinition values. type JobListResultPage struct { fn func(context.Context, JobListResult) (JobListResult, error) @@ -969,13 +902,11 @@ func (page JobListResultPage) NotDone() bool { return !page.jlr.IsEmpty() } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Response returns the raw server response from the last page request. func (page JobListResultPage) Response() JobListResult { return page.jlr } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Values returns the slice of values for the current page or nil if there are no values. func (page JobListResultPage) Values() []JobDefinition { if page.jlr.IsEmpty() { @@ -984,13 +915,11 @@ func (page JobListResultPage) Values() []JobDefinition { return *page.jlr.Value } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Creates a new instance of the JobListResultPage type. func NewJobListResultPage(getNextPage func(context.Context, JobListResult) (JobListResult, error)) JobListResultPage { return JobListResultPage{fn: getNextPage} } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobMaxRecurrence ... type JobMaxRecurrence struct { // Frequency - Gets or sets the frequency of recurrence (second, minute, hour, day, week, month). Possible values include: 'Minute', 'Hour', 'Day', 'Week', 'Month' @@ -999,7 +928,6 @@ type JobMaxRecurrence struct { Interval *int32 `json:"interval,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobProperties ... type JobProperties struct { // StartTime - Gets or sets the job start time. @@ -1014,7 +942,6 @@ type JobProperties struct { Status *JobStatus `json:"status,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobRecurrence ... type JobRecurrence struct { // Frequency - Gets or sets the frequency of recurrence (second, minute, hour, day, week, month). Possible values include: 'Minute', 'Hour', 'Day', 'Week', 'Month' @@ -1028,7 +955,6 @@ type JobRecurrence struct { Schedule *JobRecurrenceSchedule `json:"schedule,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobRecurrenceSchedule ... type JobRecurrenceSchedule struct { // WeekDays - Gets or sets the days of the week that the job should execute on. @@ -1043,7 +969,6 @@ type JobRecurrenceSchedule struct { MonthlyOccurrences *[]JobRecurrenceScheduleMonthlyOccurrence `json:"monthlyOccurrences,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobRecurrenceScheduleMonthlyOccurrence ... type JobRecurrenceScheduleMonthlyOccurrence struct { // Day - Gets or sets the day. Must be one of monday, tuesday, wednesday, thursday, friday, saturday, sunday. Possible values include: 'JobScheduleDayMonday', 'JobScheduleDayTuesday', 'JobScheduleDayWednesday', 'JobScheduleDayThursday', 'JobScheduleDayFriday', 'JobScheduleDaySaturday', 'JobScheduleDaySunday' @@ -1052,14 +977,12 @@ type JobRecurrenceScheduleMonthlyOccurrence struct { Occurrence *int32 `json:"Occurrence,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobStateFilter ... type JobStateFilter struct { // State - Gets or sets the job state. Possible values include: 'JobStateEnabled', 'JobStateDisabled', 'JobStateFaulted', 'JobStateCompleted' State JobState `json:"state,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobStatus ... type JobStatus struct { // ExecutionCount - READ-ONLY; Gets the number of times this job has executed. @@ -1074,7 +997,6 @@ type JobStatus struct { NextExecutionTime *date.Time `json:"nextExecutionTime,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // OAuthAuthentication ... type OAuthAuthentication struct { // Secret - Gets or sets the secret. @@ -1089,7 +1011,6 @@ type OAuthAuthentication struct { Type HTTPAuthenticationType `json:"type,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // RetryPolicy ... type RetryPolicy struct { // RetryType - Gets or sets the retry strategy to be used. Possible values include: 'None', 'Fixed' @@ -1100,7 +1021,6 @@ type RetryPolicy struct { RetryCount *int32 `json:"retryCount,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ServiceBusAuthentication ... type ServiceBusAuthentication struct { // SasKey - Gets or sets the SAS key. @@ -1111,7 +1031,6 @@ type ServiceBusAuthentication struct { Type ServiceBusAuthenticationType `json:"type,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ServiceBusBrokeredMessageProperties ... type ServiceBusBrokeredMessageProperties struct { // ContentType - Gets or sets the content type. @@ -1142,7 +1061,6 @@ type ServiceBusBrokeredMessageProperties struct { ViaPartitionKey *string `json:"viaPartitionKey,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ServiceBusMessage ... type ServiceBusMessage struct { // Authentication - Gets or sets the authentication. @@ -1159,7 +1077,6 @@ type ServiceBusMessage struct { TransportType ServiceBusTransportType `json:"transportType,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // MarshalJSON is the custom marshaler for ServiceBusMessage. func (sbm ServiceBusMessage) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -1184,7 +1101,6 @@ func (sbm ServiceBusMessage) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ServiceBusQueueMessage ... type ServiceBusQueueMessage struct { // QueueName - Gets or sets the queue name. @@ -1203,7 +1119,6 @@ type ServiceBusQueueMessage struct { TransportType ServiceBusTransportType `json:"transportType,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // MarshalJSON is the custom marshaler for ServiceBusQueueMessage. func (sbqm ServiceBusQueueMessage) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -1231,7 +1146,6 @@ func (sbqm ServiceBusQueueMessage) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ServiceBusTopicMessage ... type ServiceBusTopicMessage struct { // TopicPath - Gets or sets the topic path. @@ -1250,7 +1164,6 @@ type ServiceBusTopicMessage struct { TransportType ServiceBusTransportType `json:"transportType,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // MarshalJSON is the custom marshaler for ServiceBusTopicMessage. func (sbtm ServiceBusTopicMessage) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -1278,14 +1191,12 @@ func (sbtm ServiceBusTopicMessage) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Sku ... type Sku struct { // Name - Gets or set the SKU. Possible values include: 'Standard', 'Free', 'Premium' Name SkuDefinition `json:"name,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // StorageQueueMessage ... type StorageQueueMessage struct { // StorageAccount - Gets or sets the storage account name. diff --git a/services/scheduler/mgmt/2016-01-01/scheduler/version.go b/services/scheduler/mgmt/2016-01-01/scheduler/version.go index 3eaaf21b17dd..e0a2e0101bce 100644 --- a/services/scheduler/mgmt/2016-01-01/scheduler/version.go +++ b/services/scheduler/mgmt/2016-01-01/scheduler/version.go @@ -18,13 +18,12 @@ import "github.com/Azure/azure-sdk-for-go/version" // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. + // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { return "Azure-SDK-For-Go/" + version.Number + " scheduler/2016-01-01" } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Version returns the semantic version (see http://semver.org) of the client. func Version() string { return version.Number diff --git a/services/scheduler/mgmt/2016-03-01/scheduler/client.go b/services/scheduler/mgmt/2016-03-01/scheduler/client.go index 8b5883bddb99..014a36f64ae9 100644 --- a/services/scheduler/mgmt/2016-03-01/scheduler/client.go +++ b/services/scheduler/mgmt/2016-03-01/scheduler/client.go @@ -29,7 +29,6 @@ const ( DefaultBaseURI = "https://management.azure.com" ) -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // BaseClient is the base client for Scheduler. type BaseClient struct { autorest.Client @@ -37,13 +36,11 @@ type BaseClient struct { SubscriptionID string } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // New creates an instance of the BaseClient client. func New(subscriptionID string) BaseClient { return NewWithBaseURI(DefaultBaseURI, subscriptionID) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // NewWithBaseURI creates an instance of the BaseClient client. func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { return BaseClient{ diff --git a/services/scheduler/mgmt/2016-03-01/scheduler/jobcollections.go b/services/scheduler/mgmt/2016-03-01/scheduler/jobcollections.go index 23564fe7a4a9..9f72059704c9 100644 --- a/services/scheduler/mgmt/2016-03-01/scheduler/jobcollections.go +++ b/services/scheduler/mgmt/2016-03-01/scheduler/jobcollections.go @@ -25,25 +25,21 @@ import ( "net/http" ) -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobCollectionsClient is the client for the JobCollections methods of the Scheduler service. type JobCollectionsClient struct { BaseClient } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // NewJobCollectionsClient creates an instance of the JobCollectionsClient client. func NewJobCollectionsClient(subscriptionID string) JobCollectionsClient { return NewJobCollectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // NewJobCollectionsClientWithBaseURI creates an instance of the JobCollectionsClient client. func NewJobCollectionsClientWithBaseURI(baseURI string, subscriptionID string) JobCollectionsClient { return JobCollectionsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // CreateOrUpdate provisions a new job collection or updates an existing job collection. // Parameters: // resourceGroupName - the resource group name. @@ -81,7 +77,6 @@ func (client JobCollectionsClient) CreateOrUpdate(ctx context.Context, resourceG return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // CreateOrUpdatePreparer prepares the CreateOrUpdate request. func (client JobCollectionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, jobCollectionName string, jobCollection JobCollectionDefinition) (*http.Request, error) { pathParameters := map[string]interface{}{ @@ -107,7 +102,6 @@ func (client JobCollectionsClient) CreateOrUpdatePreparer(ctx context.Context, r return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client JobCollectionsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { @@ -115,7 +109,6 @@ func (client JobCollectionsClient) CreateOrUpdateSender(req *http.Request) (*htt return autorest.SendWithSender(client, req, sd...) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always // closes the http.Response Body. func (client JobCollectionsClient) CreateOrUpdateResponder(resp *http.Response) (result JobCollectionDefinition, err error) { @@ -129,7 +122,6 @@ func (client JobCollectionsClient) CreateOrUpdateResponder(resp *http.Response) return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Delete deletes a job collection. // Parameters: // resourceGroupName - the resource group name. @@ -160,7 +152,6 @@ func (client JobCollectionsClient) Delete(ctx context.Context, resourceGroupName return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // DeletePreparer prepares the Delete request. func (client JobCollectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, jobCollectionName string) (*http.Request, error) { pathParameters := map[string]interface{}{ @@ -182,7 +173,6 @@ func (client JobCollectionsClient) DeletePreparer(ctx context.Context, resourceG return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client JobCollectionsClient) DeleteSender(req *http.Request) (future JobCollectionsDeleteFuture, err error) { @@ -196,7 +186,6 @@ func (client JobCollectionsClient) DeleteSender(req *http.Request) (future JobCo return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // DeleteResponder handles the response to the Delete request. The method always // closes the http.Response Body. func (client JobCollectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { @@ -209,7 +198,6 @@ func (client JobCollectionsClient) DeleteResponder(resp *http.Response) (result return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Disable disables all of the jobs in the job collection. // Parameters: // resourceGroupName - the resource group name. @@ -240,7 +228,6 @@ func (client JobCollectionsClient) Disable(ctx context.Context, resourceGroupNam return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // DisablePreparer prepares the Disable request. func (client JobCollectionsClient) DisablePreparer(ctx context.Context, resourceGroupName string, jobCollectionName string) (*http.Request, error) { pathParameters := map[string]interface{}{ @@ -262,7 +249,6 @@ func (client JobCollectionsClient) DisablePreparer(ctx context.Context, resource return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // DisableSender sends the Disable request. The method will close the // http.Response Body if it receives an error. func (client JobCollectionsClient) DisableSender(req *http.Request) (future JobCollectionsDisableFuture, err error) { @@ -276,7 +262,6 @@ func (client JobCollectionsClient) DisableSender(req *http.Request) (future JobC return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // DisableResponder handles the response to the Disable request. The method always // closes the http.Response Body. func (client JobCollectionsClient) DisableResponder(resp *http.Response) (result autorest.Response, err error) { @@ -289,7 +274,6 @@ func (client JobCollectionsClient) DisableResponder(resp *http.Response) (result return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Enable enables all of the jobs in the job collection. // Parameters: // resourceGroupName - the resource group name. @@ -320,7 +304,6 @@ func (client JobCollectionsClient) Enable(ctx context.Context, resourceGroupName return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // EnablePreparer prepares the Enable request. func (client JobCollectionsClient) EnablePreparer(ctx context.Context, resourceGroupName string, jobCollectionName string) (*http.Request, error) { pathParameters := map[string]interface{}{ @@ -342,7 +325,6 @@ func (client JobCollectionsClient) EnablePreparer(ctx context.Context, resourceG return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // EnableSender sends the Enable request. The method will close the // http.Response Body if it receives an error. func (client JobCollectionsClient) EnableSender(req *http.Request) (future JobCollectionsEnableFuture, err error) { @@ -356,7 +338,6 @@ func (client JobCollectionsClient) EnableSender(req *http.Request) (future JobCo return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // EnableResponder handles the response to the Enable request. The method always // closes the http.Response Body. func (client JobCollectionsClient) EnableResponder(resp *http.Response) (result autorest.Response, err error) { @@ -369,7 +350,6 @@ func (client JobCollectionsClient) EnableResponder(resp *http.Response) (result return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Get gets a job collection. // Parameters: // resourceGroupName - the resource group name. @@ -406,7 +386,6 @@ func (client JobCollectionsClient) Get(ctx context.Context, resourceGroupName st return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // GetPreparer prepares the Get request. func (client JobCollectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, jobCollectionName string) (*http.Request, error) { pathParameters := map[string]interface{}{ @@ -428,7 +407,6 @@ func (client JobCollectionsClient) GetPreparer(ctx context.Context, resourceGrou return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client JobCollectionsClient) GetSender(req *http.Request) (*http.Response, error) { @@ -436,7 +414,6 @@ func (client JobCollectionsClient) GetSender(req *http.Request) (*http.Response, return autorest.SendWithSender(client, req, sd...) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. func (client JobCollectionsClient) GetResponder(resp *http.Response) (result JobCollectionDefinition, err error) { @@ -450,7 +427,6 @@ func (client JobCollectionsClient) GetResponder(resp *http.Response) (result Job return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ListByResourceGroup gets all job collections under specified resource group. // Parameters: // resourceGroupName - the resource group name. @@ -487,7 +463,6 @@ func (client JobCollectionsClient) ListByResourceGroup(ctx context.Context, reso return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ListByResourceGroupPreparer prepares the ListByResourceGroup request. func (client JobCollectionsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { pathParameters := map[string]interface{}{ @@ -508,7 +483,6 @@ func (client JobCollectionsClient) ListByResourceGroupPreparer(ctx context.Conte return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the // http.Response Body if it receives an error. func (client JobCollectionsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { @@ -516,7 +490,6 @@ func (client JobCollectionsClient) ListByResourceGroupSender(req *http.Request) return autorest.SendWithSender(client, req, sd...) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always // closes the http.Response Body. func (client JobCollectionsClient) ListByResourceGroupResponder(resp *http.Response) (result JobCollectionListResult, err error) { @@ -551,7 +524,6 @@ func (client JobCollectionsClient) listByResourceGroupNextResults(ctx context.Co return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. func (client JobCollectionsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result JobCollectionListResultIterator, err error) { if tracing.IsEnabled() { @@ -568,7 +540,6 @@ func (client JobCollectionsClient) ListByResourceGroupComplete(ctx context.Conte return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ListBySubscription gets all job collections under specified subscription. func (client JobCollectionsClient) ListBySubscription(ctx context.Context) (result JobCollectionListResultPage, err error) { if tracing.IsEnabled() { @@ -603,7 +574,6 @@ func (client JobCollectionsClient) ListBySubscription(ctx context.Context) (resu return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ListBySubscriptionPreparer prepares the ListBySubscription request. func (client JobCollectionsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { pathParameters := map[string]interface{}{ @@ -623,7 +593,6 @@ func (client JobCollectionsClient) ListBySubscriptionPreparer(ctx context.Contex return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ListBySubscriptionSender sends the ListBySubscription request. The method will close the // http.Response Body if it receives an error. func (client JobCollectionsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { @@ -631,7 +600,6 @@ func (client JobCollectionsClient) ListBySubscriptionSender(req *http.Request) ( return autorest.SendWithSender(client, req, sd...) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always // closes the http.Response Body. func (client JobCollectionsClient) ListBySubscriptionResponder(resp *http.Response) (result JobCollectionListResult, err error) { @@ -666,7 +634,6 @@ func (client JobCollectionsClient) listBySubscriptionNextResults(ctx context.Con return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. func (client JobCollectionsClient) ListBySubscriptionComplete(ctx context.Context) (result JobCollectionListResultIterator, err error) { if tracing.IsEnabled() { @@ -683,7 +650,6 @@ func (client JobCollectionsClient) ListBySubscriptionComplete(ctx context.Contex return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Patch patches an existing job collection. // Parameters: // resourceGroupName - the resource group name. @@ -721,7 +687,6 @@ func (client JobCollectionsClient) Patch(ctx context.Context, resourceGroupName return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // PatchPreparer prepares the Patch request. func (client JobCollectionsClient) PatchPreparer(ctx context.Context, resourceGroupName string, jobCollectionName string, jobCollection JobCollectionDefinition) (*http.Request, error) { pathParameters := map[string]interface{}{ @@ -747,7 +712,6 @@ func (client JobCollectionsClient) PatchPreparer(ctx context.Context, resourceGr return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // PatchSender sends the Patch request. The method will close the // http.Response Body if it receives an error. func (client JobCollectionsClient) PatchSender(req *http.Request) (*http.Response, error) { @@ -755,7 +719,6 @@ func (client JobCollectionsClient) PatchSender(req *http.Request) (*http.Respons return autorest.SendWithSender(client, req, sd...) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // PatchResponder handles the response to the Patch request. The method always // closes the http.Response Body. func (client JobCollectionsClient) PatchResponder(resp *http.Response) (result JobCollectionDefinition, err error) { diff --git a/services/scheduler/mgmt/2016-03-01/scheduler/jobs.go b/services/scheduler/mgmt/2016-03-01/scheduler/jobs.go index 8066cef82b47..1942cd84b0de 100644 --- a/services/scheduler/mgmt/2016-03-01/scheduler/jobs.go +++ b/services/scheduler/mgmt/2016-03-01/scheduler/jobs.go @@ -26,25 +26,21 @@ import ( "net/http" ) -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobsClient is the client for the Jobs methods of the Scheduler service. type JobsClient struct { BaseClient } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // NewJobsClient creates an instance of the JobsClient client. func NewJobsClient(subscriptionID string) JobsClient { return NewJobsClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // NewJobsClientWithBaseURI creates an instance of the JobsClient client. func NewJobsClientWithBaseURI(baseURI string, subscriptionID string) JobsClient { return JobsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // CreateOrUpdate provisions a new job or updates an existing job. // Parameters: // resourceGroupName - the resource group name. @@ -83,7 +79,6 @@ func (client JobsClient) CreateOrUpdate(ctx context.Context, resourceGroupName s return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // CreateOrUpdatePreparer prepares the CreateOrUpdate request. func (client JobsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, jobCollectionName string, jobName string, job JobDefinition) (*http.Request, error) { pathParameters := map[string]interface{}{ @@ -111,7 +106,6 @@ func (client JobsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGro return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client JobsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { @@ -119,7 +113,6 @@ func (client JobsClient) CreateOrUpdateSender(req *http.Request) (*http.Response return autorest.SendWithSender(client, req, sd...) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always // closes the http.Response Body. func (client JobsClient) CreateOrUpdateResponder(resp *http.Response) (result JobDefinition, err error) { @@ -133,7 +126,6 @@ func (client JobsClient) CreateOrUpdateResponder(resp *http.Response) (result Jo return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Delete deletes a job. // Parameters: // resourceGroupName - the resource group name. @@ -171,7 +163,6 @@ func (client JobsClient) Delete(ctx context.Context, resourceGroupName string, j return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // DeletePreparer prepares the Delete request. func (client JobsClient) DeletePreparer(ctx context.Context, resourceGroupName string, jobCollectionName string, jobName string) (*http.Request, error) { pathParameters := map[string]interface{}{ @@ -194,7 +185,6 @@ func (client JobsClient) DeletePreparer(ctx context.Context, resourceGroupName s return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // 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) (*http.Response, error) { @@ -202,7 +192,6 @@ func (client JobsClient) DeleteSender(req *http.Request) (*http.Response, error) return autorest.SendWithSender(client, req, sd...) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // 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) { @@ -215,7 +204,6 @@ func (client JobsClient) DeleteResponder(resp *http.Response) (result autorest.R return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Get gets a job. // Parameters: // resourceGroupName - the resource group name. @@ -253,7 +241,6 @@ func (client JobsClient) Get(ctx context.Context, resourceGroupName string, jobC return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // GetPreparer prepares the Get request. func (client JobsClient) GetPreparer(ctx context.Context, resourceGroupName string, jobCollectionName string, jobName string) (*http.Request, error) { pathParameters := map[string]interface{}{ @@ -276,7 +263,6 @@ func (client JobsClient) GetPreparer(ctx context.Context, resourceGroupName stri return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // 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) { @@ -284,7 +270,6 @@ func (client JobsClient) GetSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, sd...) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. func (client JobsClient) GetResponder(resp *http.Response) (result JobDefinition, err error) { @@ -298,7 +283,6 @@ func (client JobsClient) GetResponder(resp *http.Response) (result JobDefinition return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // List lists all jobs under the specified job collection. // Parameters: // resourceGroupName - the resource group name. @@ -348,7 +332,6 @@ func (client JobsClient) List(ctx context.Context, resourceGroupName string, job return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ListPreparer prepares the List request. func (client JobsClient) ListPreparer(ctx context.Context, resourceGroupName string, jobCollectionName string, top *int32, skip *int32, filter string) (*http.Request, error) { pathParameters := map[string]interface{}{ @@ -379,7 +362,6 @@ func (client JobsClient) ListPreparer(ctx context.Context, resourceGroupName str return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // 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) { @@ -387,7 +369,6 @@ func (client JobsClient) ListSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, sd...) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ListResponder handles the response to the List request. The method always // closes the http.Response Body. func (client JobsClient) ListResponder(resp *http.Response) (result JobListResult, err error) { @@ -422,7 +403,6 @@ func (client JobsClient) listNextResults(ctx context.Context, lastResults JobLis return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ListComplete enumerates all values, automatically crossing page boundaries as required. func (client JobsClient) ListComplete(ctx context.Context, resourceGroupName string, jobCollectionName string, top *int32, skip *int32, filter string) (result JobListResultIterator, err error) { if tracing.IsEnabled() { @@ -439,7 +419,6 @@ func (client JobsClient) ListComplete(ctx context.Context, resourceGroupName str return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ListJobHistory lists job history. // Parameters: // resourceGroupName - the resource group name. @@ -490,7 +469,6 @@ func (client JobsClient) ListJobHistory(ctx context.Context, resourceGroupName s return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ListJobHistoryPreparer prepares the ListJobHistory request. func (client JobsClient) ListJobHistoryPreparer(ctx context.Context, resourceGroupName string, jobCollectionName string, jobName string, top *int32, skip *int32, filter string) (*http.Request, error) { pathParameters := map[string]interface{}{ @@ -522,7 +500,6 @@ func (client JobsClient) ListJobHistoryPreparer(ctx context.Context, resourceGro return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ListJobHistorySender sends the ListJobHistory request. The method will close the // http.Response Body if it receives an error. func (client JobsClient) ListJobHistorySender(req *http.Request) (*http.Response, error) { @@ -530,7 +507,6 @@ func (client JobsClient) ListJobHistorySender(req *http.Request) (*http.Response return autorest.SendWithSender(client, req, sd...) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ListJobHistoryResponder handles the response to the ListJobHistory request. The method always // closes the http.Response Body. func (client JobsClient) ListJobHistoryResponder(resp *http.Response) (result JobHistoryListResult, err error) { @@ -565,7 +541,6 @@ func (client JobsClient) listJobHistoryNextResults(ctx context.Context, lastResu return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ListJobHistoryComplete enumerates all values, automatically crossing page boundaries as required. func (client JobsClient) ListJobHistoryComplete(ctx context.Context, resourceGroupName string, jobCollectionName string, jobName string, top *int32, skip *int32, filter string) (result JobHistoryListResultIterator, err error) { if tracing.IsEnabled() { @@ -582,7 +557,6 @@ func (client JobsClient) ListJobHistoryComplete(ctx context.Context, resourceGro return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Patch patches an existing job. // Parameters: // resourceGroupName - the resource group name. @@ -621,7 +595,6 @@ func (client JobsClient) Patch(ctx context.Context, resourceGroupName string, jo return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // PatchPreparer prepares the Patch request. func (client JobsClient) PatchPreparer(ctx context.Context, resourceGroupName string, jobCollectionName string, jobName string, job JobDefinition) (*http.Request, error) { pathParameters := map[string]interface{}{ @@ -649,7 +622,6 @@ func (client JobsClient) PatchPreparer(ctx context.Context, resourceGroupName st return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // PatchSender sends the Patch request. The method will close the // http.Response Body if it receives an error. func (client JobsClient) PatchSender(req *http.Request) (*http.Response, error) { @@ -657,7 +629,6 @@ func (client JobsClient) PatchSender(req *http.Request) (*http.Response, error) return autorest.SendWithSender(client, req, sd...) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // PatchResponder handles the response to the Patch request. The method always // closes the http.Response Body. func (client JobsClient) PatchResponder(resp *http.Response) (result JobDefinition, err error) { @@ -671,7 +642,6 @@ func (client JobsClient) PatchResponder(resp *http.Response) (result JobDefiniti return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Run runs a job. // Parameters: // resourceGroupName - the resource group name. @@ -709,7 +679,6 @@ func (client JobsClient) Run(ctx context.Context, resourceGroupName string, jobC return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // RunPreparer prepares the Run request. func (client JobsClient) RunPreparer(ctx context.Context, resourceGroupName string, jobCollectionName string, jobName string) (*http.Request, error) { pathParameters := map[string]interface{}{ @@ -732,7 +701,6 @@ func (client JobsClient) RunPreparer(ctx context.Context, resourceGroupName stri return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // RunSender sends the Run request. The method will close the // http.Response Body if it receives an error. func (client JobsClient) RunSender(req *http.Request) (*http.Response, error) { @@ -740,7 +708,6 @@ func (client JobsClient) RunSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, sd...) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // RunResponder handles the response to the Run request. The method always // closes the http.Response Body. func (client JobsClient) RunResponder(resp *http.Response) (result autorest.Response, err error) { diff --git a/services/scheduler/mgmt/2016-03-01/scheduler/models.go b/services/scheduler/mgmt/2016-03-01/scheduler/models.go index 7f79963bba05..00aba5f9bc56 100644 --- a/services/scheduler/mgmt/2016-03-01/scheduler/models.go +++ b/services/scheduler/mgmt/2016-03-01/scheduler/models.go @@ -51,13 +51,11 @@ const ( Wednesday DayOfWeek = "Wednesday" ) -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // PossibleDayOfWeekValues returns an array of possible values for the DayOfWeek const type. func PossibleDayOfWeekValues() []DayOfWeek { return []DayOfWeek{Friday, Monday, Saturday, Sunday, Thursday, Tuesday, Wednesday} } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobActionType enumerates the values for job action type. type JobActionType string @@ -74,13 +72,11 @@ const ( StorageQueue JobActionType = "StorageQueue" ) -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // PossibleJobActionTypeValues returns an array of possible values for the JobActionType const type. func PossibleJobActionTypeValues() []JobActionType { return []JobActionType{HTTP, HTTPS, ServiceBusQueue, ServiceBusTopic, StorageQueue} } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobCollectionState enumerates the values for job collection state. type JobCollectionState string @@ -95,13 +91,11 @@ const ( Suspended JobCollectionState = "Suspended" ) -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // PossibleJobCollectionStateValues returns an array of possible values for the JobCollectionState const type. func PossibleJobCollectionStateValues() []JobCollectionState { return []JobCollectionState{Deleted, Disabled, Enabled, Suspended} } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobExecutionStatus enumerates the values for job execution status. type JobExecutionStatus string @@ -114,13 +108,11 @@ const ( Postponed JobExecutionStatus = "Postponed" ) -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // PossibleJobExecutionStatusValues returns an array of possible values for the JobExecutionStatus const type. func PossibleJobExecutionStatusValues() []JobExecutionStatus { return []JobExecutionStatus{Completed, Failed, Postponed} } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobHistoryActionName enumerates the values for job history action name. type JobHistoryActionName string @@ -131,13 +123,11 @@ const ( MainAction JobHistoryActionName = "MainAction" ) -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // PossibleJobHistoryActionNameValues returns an array of possible values for the JobHistoryActionName const type. func PossibleJobHistoryActionNameValues() []JobHistoryActionName { return []JobHistoryActionName{ErrorAction, MainAction} } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobScheduleDay enumerates the values for job schedule day. type JobScheduleDay string @@ -158,13 +148,11 @@ const ( JobScheduleDayWednesday JobScheduleDay = "Wednesday" ) -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // PossibleJobScheduleDayValues returns an array of possible values for the JobScheduleDay const type. func PossibleJobScheduleDayValues() []JobScheduleDay { return []JobScheduleDay{JobScheduleDayFriday, JobScheduleDayMonday, JobScheduleDaySaturday, JobScheduleDaySunday, JobScheduleDayThursday, JobScheduleDayTuesday, JobScheduleDayWednesday} } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobState enumerates the values for job state. type JobState string @@ -179,13 +167,11 @@ const ( JobStateFaulted JobState = "Faulted" ) -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // PossibleJobStateValues returns an array of possible values for the JobState const type. func PossibleJobStateValues() []JobState { return []JobState{JobStateCompleted, JobStateDisabled, JobStateEnabled, JobStateFaulted} } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // RecurrenceFrequency enumerates the values for recurrence frequency. type RecurrenceFrequency string @@ -202,13 +188,11 @@ const ( Week RecurrenceFrequency = "Week" ) -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // PossibleRecurrenceFrequencyValues returns an array of possible values for the RecurrenceFrequency const type. func PossibleRecurrenceFrequencyValues() []RecurrenceFrequency { return []RecurrenceFrequency{Day, Hour, Minute, Month, Week} } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // RetryType enumerates the values for retry type. type RetryType string @@ -219,13 +203,11 @@ const ( None RetryType = "None" ) -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // PossibleRetryTypeValues returns an array of possible values for the RetryType const type. func PossibleRetryTypeValues() []RetryType { return []RetryType{Fixed, None} } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ServiceBusAuthenticationType enumerates the values for service bus authentication type. type ServiceBusAuthenticationType string @@ -236,13 +218,11 @@ const ( SharedAccessKey ServiceBusAuthenticationType = "SharedAccessKey" ) -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // PossibleServiceBusAuthenticationTypeValues returns an array of possible values for the ServiceBusAuthenticationType const type. func PossibleServiceBusAuthenticationTypeValues() []ServiceBusAuthenticationType { return []ServiceBusAuthenticationType{NotSpecified, SharedAccessKey} } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ServiceBusTransportType enumerates the values for service bus transport type. type ServiceBusTransportType string @@ -255,13 +235,11 @@ const ( ServiceBusTransportTypeNotSpecified ServiceBusTransportType = "NotSpecified" ) -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // PossibleServiceBusTransportTypeValues returns an array of possible values for the ServiceBusTransportType const type. func PossibleServiceBusTransportTypeValues() []ServiceBusTransportType { return []ServiceBusTransportType{ServiceBusTransportTypeAMQP, ServiceBusTransportTypeNetMessaging, ServiceBusTransportTypeNotSpecified} } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // SkuDefinition enumerates the values for sku definition. type SkuDefinition string @@ -276,13 +254,11 @@ const ( Standard SkuDefinition = "Standard" ) -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // PossibleSkuDefinitionValues returns an array of possible values for the SkuDefinition const type. func PossibleSkuDefinitionValues() []SkuDefinition { return []SkuDefinition{Free, P10Premium, P20Premium, Standard} } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Type enumerates the values for type. type Type string @@ -297,13 +273,11 @@ const ( TypeHTTPAuthentication Type = "HttpAuthentication" ) -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // PossibleTypeValues returns an array of possible values for the Type const type. func PossibleTypeValues() []Type { return []Type{TypeActiveDirectoryOAuth, TypeBasic, TypeClientCertificate, TypeHTTPAuthentication} } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // BasicAuthentication ... type BasicAuthentication struct { // Username - Gets or sets the username. @@ -314,7 +288,6 @@ type BasicAuthentication struct { Type Type `json:"type,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // MarshalJSON is the custom marshaler for BasicAuthentication. func (ba BasicAuthentication) MarshalJSON() ([]byte, error) { ba.Type = TypeBasic @@ -331,37 +304,31 @@ func (ba BasicAuthentication) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // AsClientCertAuthentication is the BasicHTTPAuthentication implementation for BasicAuthentication. func (ba BasicAuthentication) AsClientCertAuthentication() (*ClientCertAuthentication, bool) { return nil, false } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // AsBasicAuthentication is the BasicHTTPAuthentication implementation for BasicAuthentication. func (ba BasicAuthentication) AsBasicAuthentication() (*BasicAuthentication, bool) { return &ba, true } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // AsOAuthAuthentication is the BasicHTTPAuthentication implementation for BasicAuthentication. func (ba BasicAuthentication) AsOAuthAuthentication() (*OAuthAuthentication, bool) { return nil, false } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // AsHTTPAuthentication is the BasicHTTPAuthentication implementation for BasicAuthentication. func (ba BasicAuthentication) AsHTTPAuthentication() (*HTTPAuthentication, bool) { return nil, false } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // AsBasicHTTPAuthentication is the BasicHTTPAuthentication implementation for BasicAuthentication. func (ba BasicAuthentication) AsBasicHTTPAuthentication() (BasicHTTPAuthentication, bool) { return &ba, true } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ClientCertAuthentication ... type ClientCertAuthentication struct { // Password - Gets or sets the certificate password, return value will always be empty. @@ -378,7 +345,6 @@ type ClientCertAuthentication struct { Type Type `json:"type,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // MarshalJSON is the custom marshaler for ClientCertAuthentication. func (cca ClientCertAuthentication) MarshalJSON() ([]byte, error) { cca.Type = TypeClientCertificate @@ -404,37 +370,31 @@ func (cca ClientCertAuthentication) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // AsClientCertAuthentication is the BasicHTTPAuthentication implementation for ClientCertAuthentication. func (cca ClientCertAuthentication) AsClientCertAuthentication() (*ClientCertAuthentication, bool) { return &cca, true } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // AsBasicAuthentication is the BasicHTTPAuthentication implementation for ClientCertAuthentication. func (cca ClientCertAuthentication) AsBasicAuthentication() (*BasicAuthentication, bool) { return nil, false } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // AsOAuthAuthentication is the BasicHTTPAuthentication implementation for ClientCertAuthentication. func (cca ClientCertAuthentication) AsOAuthAuthentication() (*OAuthAuthentication, bool) { return nil, false } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // AsHTTPAuthentication is the BasicHTTPAuthentication implementation for ClientCertAuthentication. func (cca ClientCertAuthentication) AsHTTPAuthentication() (*HTTPAuthentication, bool) { return nil, false } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // AsBasicHTTPAuthentication is the BasicHTTPAuthentication implementation for ClientCertAuthentication. func (cca ClientCertAuthentication) AsBasicHTTPAuthentication() (BasicHTTPAuthentication, bool) { return &cca, true } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // BasicHTTPAuthentication ... type BasicHTTPAuthentication interface { AsClientCertAuthentication() (*ClientCertAuthentication, bool) @@ -443,7 +403,6 @@ type BasicHTTPAuthentication interface { AsHTTPAuthentication() (*HTTPAuthentication, bool) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // HTTPAuthentication ... type HTTPAuthentication struct { // Type - Possible values include: 'TypeHTTPAuthentication', 'TypeClientCertificate', 'TypeBasic', 'TypeActiveDirectoryOAuth' @@ -495,7 +454,6 @@ func unmarshalBasicHTTPAuthenticationArray(body []byte) ([]BasicHTTPAuthenticati return haArray, nil } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // MarshalJSON is the custom marshaler for HTTPAuthentication. func (ha HTTPAuthentication) MarshalJSON() ([]byte, error) { ha.Type = TypeHTTPAuthentication @@ -506,37 +464,31 @@ func (ha HTTPAuthentication) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // AsClientCertAuthentication is the BasicHTTPAuthentication implementation for HTTPAuthentication. func (ha HTTPAuthentication) AsClientCertAuthentication() (*ClientCertAuthentication, bool) { return nil, false } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // AsBasicAuthentication is the BasicHTTPAuthentication implementation for HTTPAuthentication. func (ha HTTPAuthentication) AsBasicAuthentication() (*BasicAuthentication, bool) { return nil, false } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // AsOAuthAuthentication is the BasicHTTPAuthentication implementation for HTTPAuthentication. func (ha HTTPAuthentication) AsOAuthAuthentication() (*OAuthAuthentication, bool) { return nil, false } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // AsHTTPAuthentication is the BasicHTTPAuthentication implementation for HTTPAuthentication. func (ha HTTPAuthentication) AsHTTPAuthentication() (*HTTPAuthentication, bool) { return &ha, true } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // AsBasicHTTPAuthentication is the BasicHTTPAuthentication implementation for HTTPAuthentication. func (ha HTTPAuthentication) AsBasicHTTPAuthentication() (BasicHTTPAuthentication, bool) { return &ha, true } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // HTTPRequest ... type HTTPRequest struct { // Authentication - Gets or sets the authentication method of the request. @@ -551,7 +503,6 @@ type HTTPRequest struct { Headers map[string]*string `json:"headers"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // MarshalJSON is the custom marshaler for HTTPRequest. func (hr HTTPRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -571,7 +522,6 @@ func (hr HTTPRequest) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // UnmarshalJSON is the custom unmarshaler for HTTPRequest struct. func (hr *HTTPRequest) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -631,7 +581,6 @@ func (hr *HTTPRequest) UnmarshalJSON(body []byte) error { return nil } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobAction ... type JobAction struct { // Type - Gets or sets the job action type. Possible values include: 'HTTP', 'HTTPS', 'StorageQueue', 'ServiceBusQueue', 'ServiceBusTopic' @@ -650,7 +599,6 @@ type JobAction struct { ErrorAction *JobErrorAction `json:"errorAction,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobCollectionDefinition ... type JobCollectionDefinition struct { autorest.Response `json:"-"` @@ -668,7 +616,6 @@ type JobCollectionDefinition struct { Properties *JobCollectionProperties `json:"properties,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // MarshalJSON is the custom marshaler for JobCollectionDefinition. func (jcd JobCollectionDefinition) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -687,7 +634,6 @@ func (jcd JobCollectionDefinition) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobCollectionListResult ... type JobCollectionListResult struct { autorest.Response `json:"-"` @@ -697,7 +643,6 @@ type JobCollectionListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobCollectionListResultIterator provides access to a complete listing of JobCollectionDefinition values. type JobCollectionListResultIterator struct { i int @@ -742,13 +687,11 @@ func (iter JobCollectionListResultIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Response returns the raw server response from the last page request. func (iter JobCollectionListResultIterator) Response() JobCollectionListResult { return iter.page.Response() } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. func (iter JobCollectionListResultIterator) Value() JobCollectionDefinition { @@ -758,13 +701,11 @@ func (iter JobCollectionListResultIterator) Value() JobCollectionDefinition { return iter.page.Values()[iter.i] } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Creates a new instance of the JobCollectionListResultIterator type. func NewJobCollectionListResultIterator(page JobCollectionListResultPage) JobCollectionListResultIterator { return JobCollectionListResultIterator{page: page} } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // IsEmpty returns true if the ListResult contains no values. func (jclr JobCollectionListResult) IsEmpty() bool { return jclr.Value == nil || len(*jclr.Value) == 0 @@ -782,7 +723,6 @@ func (jclr JobCollectionListResult) jobCollectionListResultPreparer(ctx context. autorest.WithBaseURL(to.String(jclr.NextLink))) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobCollectionListResultPage contains a page of JobCollectionDefinition values. type JobCollectionListResultPage struct { fn func(context.Context, JobCollectionListResult) (JobCollectionListResult, error) @@ -822,13 +762,11 @@ func (page JobCollectionListResultPage) NotDone() bool { return !page.jclr.IsEmpty() } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Response returns the raw server response from the last page request. func (page JobCollectionListResultPage) Response() JobCollectionListResult { return page.jclr } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Values returns the slice of values for the current page or nil if there are no values. func (page JobCollectionListResultPage) Values() []JobCollectionDefinition { if page.jclr.IsEmpty() { @@ -837,13 +775,11 @@ func (page JobCollectionListResultPage) Values() []JobCollectionDefinition { return *page.jclr.Value } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Creates a new instance of the JobCollectionListResultPage type. func NewJobCollectionListResultPage(getNextPage func(context.Context, JobCollectionListResult) (JobCollectionListResult, error)) JobCollectionListResultPage { return JobCollectionListResultPage{fn: getNextPage} } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobCollectionProperties ... type JobCollectionProperties struct { // Sku - Gets or sets the SKU. @@ -854,7 +790,6 @@ type JobCollectionProperties struct { Quota *JobCollectionQuota `json:"quota,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobCollectionQuota ... type JobCollectionQuota struct { // MaxJobCount - Gets or set the maximum job count. @@ -871,7 +806,6 @@ type JobCollectionsDeleteFuture struct { azure.Future } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. func (future *JobCollectionsDeleteFuture) Result(client JobCollectionsClient) (ar autorest.Response, err error) { @@ -889,14 +823,12 @@ func (future *JobCollectionsDeleteFuture) Result(client JobCollectionsClient) (a return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobCollectionsDisableFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type JobCollectionsDisableFuture struct { azure.Future } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. func (future *JobCollectionsDisableFuture) Result(client JobCollectionsClient) (ar autorest.Response, err error) { @@ -920,7 +852,6 @@ type JobCollectionsEnableFuture struct { azure.Future } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. func (future *JobCollectionsEnableFuture) Result(client JobCollectionsClient) (ar autorest.Response, err error) { @@ -938,7 +869,6 @@ func (future *JobCollectionsEnableFuture) Result(client JobCollectionsClient) (a return } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobDefinition ... type JobDefinition struct { autorest.Response `json:"-"` @@ -952,7 +882,6 @@ type JobDefinition struct { Properties *JobProperties `json:"properties,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobErrorAction ... type JobErrorAction struct { // Type - Gets or sets the job error action type. Possible values include: 'HTTP', 'HTTPS', 'StorageQueue', 'ServiceBusQueue', 'ServiceBusTopic' @@ -969,7 +898,6 @@ type JobErrorAction struct { RetryPolicy *RetryPolicy `json:"retryPolicy,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobHistoryDefinition ... type JobHistoryDefinition struct { // ID - READ-ONLY; Gets the job history identifier. @@ -982,7 +910,6 @@ type JobHistoryDefinition struct { Properties *JobHistoryDefinitionProperties `json:"properties,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobHistoryDefinitionProperties ... type JobHistoryDefinitionProperties struct { // StartTime - READ-ONLY; Gets the start time for this job. @@ -1003,14 +930,12 @@ type JobHistoryDefinitionProperties struct { RepeatCount *int32 `json:"repeatCount,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobHistoryFilter ... type JobHistoryFilter struct { // Status - Gets or sets the job execution status. Possible values include: 'Completed', 'Failed', 'Postponed' Status JobExecutionStatus `json:"status,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobHistoryListResult ... type JobHistoryListResult struct { autorest.Response `json:"-"` @@ -1020,7 +945,6 @@ type JobHistoryListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobHistoryListResultIterator provides access to a complete listing of JobHistoryDefinition values. type JobHistoryListResultIterator struct { i int @@ -1065,13 +989,11 @@ func (iter JobHistoryListResultIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Response returns the raw server response from the last page request. func (iter JobHistoryListResultIterator) Response() JobHistoryListResult { return iter.page.Response() } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. func (iter JobHistoryListResultIterator) Value() JobHistoryDefinition { @@ -1081,13 +1003,11 @@ func (iter JobHistoryListResultIterator) Value() JobHistoryDefinition { return iter.page.Values()[iter.i] } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Creates a new instance of the JobHistoryListResultIterator type. func NewJobHistoryListResultIterator(page JobHistoryListResultPage) JobHistoryListResultIterator { return JobHistoryListResultIterator{page: page} } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // IsEmpty returns true if the ListResult contains no values. func (jhlr JobHistoryListResult) IsEmpty() bool { return jhlr.Value == nil || len(*jhlr.Value) == 0 @@ -1105,7 +1025,6 @@ func (jhlr JobHistoryListResult) jobHistoryListResultPreparer(ctx context.Contex autorest.WithBaseURL(to.String(jhlr.NextLink))) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobHistoryListResultPage contains a page of JobHistoryDefinition values. type JobHistoryListResultPage struct { fn func(context.Context, JobHistoryListResult) (JobHistoryListResult, error) @@ -1145,13 +1064,11 @@ func (page JobHistoryListResultPage) NotDone() bool { return !page.jhlr.IsEmpty() } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Response returns the raw server response from the last page request. func (page JobHistoryListResultPage) Response() JobHistoryListResult { return page.jhlr } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Values returns the slice of values for the current page or nil if there are no values. func (page JobHistoryListResultPage) Values() []JobHistoryDefinition { if page.jhlr.IsEmpty() { @@ -1160,13 +1077,11 @@ func (page JobHistoryListResultPage) Values() []JobHistoryDefinition { return *page.jhlr.Value } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Creates a new instance of the JobHistoryListResultPage type. func NewJobHistoryListResultPage(getNextPage func(context.Context, JobHistoryListResult) (JobHistoryListResult, error)) JobHistoryListResultPage { return JobHistoryListResultPage{fn: getNextPage} } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobListResult ... type JobListResult struct { autorest.Response `json:"-"` @@ -1176,7 +1091,6 @@ type JobListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobListResultIterator provides access to a complete listing of JobDefinition values. type JobListResultIterator struct { i int @@ -1221,13 +1135,11 @@ func (iter JobListResultIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Response returns the raw server response from the last page request. func (iter JobListResultIterator) Response() JobListResult { return iter.page.Response() } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. func (iter JobListResultIterator) Value() JobDefinition { @@ -1237,13 +1149,11 @@ func (iter JobListResultIterator) Value() JobDefinition { return iter.page.Values()[iter.i] } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Creates a new instance of the JobListResultIterator type. func NewJobListResultIterator(page JobListResultPage) JobListResultIterator { return JobListResultIterator{page: page} } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // IsEmpty returns true if the ListResult contains no values. func (jlr JobListResult) IsEmpty() bool { return jlr.Value == nil || len(*jlr.Value) == 0 @@ -1261,7 +1171,6 @@ func (jlr JobListResult) jobListResultPreparer(ctx context.Context) (*http.Reque autorest.WithBaseURL(to.String(jlr.NextLink))) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobListResultPage contains a page of JobDefinition values. type JobListResultPage struct { fn func(context.Context, JobListResult) (JobListResult, error) @@ -1301,13 +1210,11 @@ func (page JobListResultPage) NotDone() bool { return !page.jlr.IsEmpty() } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Response returns the raw server response from the last page request. func (page JobListResultPage) Response() JobListResult { return page.jlr } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Values returns the slice of values for the current page or nil if there are no values. func (page JobListResultPage) Values() []JobDefinition { if page.jlr.IsEmpty() { @@ -1316,13 +1223,11 @@ func (page JobListResultPage) Values() []JobDefinition { return *page.jlr.Value } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Creates a new instance of the JobListResultPage type. func NewJobListResultPage(getNextPage func(context.Context, JobListResult) (JobListResult, error)) JobListResultPage { return JobListResultPage{fn: getNextPage} } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobMaxRecurrence ... type JobMaxRecurrence struct { // Frequency - Gets or sets the frequency of recurrence (second, minute, hour, day, week, month). Possible values include: 'Minute', 'Hour', 'Day', 'Week', 'Month' @@ -1331,7 +1236,6 @@ type JobMaxRecurrence struct { Interval *int32 `json:"interval,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobProperties ... type JobProperties struct { // StartTime - Gets or sets the job start time. @@ -1346,7 +1250,6 @@ type JobProperties struct { Status *JobStatus `json:"status,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobRecurrence ... type JobRecurrence struct { // Frequency - Gets or sets the frequency of recurrence (second, minute, hour, day, week, month). Possible values include: 'Minute', 'Hour', 'Day', 'Week', 'Month' @@ -1360,7 +1263,6 @@ type JobRecurrence struct { Schedule *JobRecurrenceSchedule `json:"schedule,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobRecurrenceSchedule ... type JobRecurrenceSchedule struct { // WeekDays - Gets or sets the days of the week that the job should execute on. @@ -1375,7 +1277,6 @@ type JobRecurrenceSchedule struct { MonthlyOccurrences *[]JobRecurrenceScheduleMonthlyOccurrence `json:"monthlyOccurrences,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobRecurrenceScheduleMonthlyOccurrence ... type JobRecurrenceScheduleMonthlyOccurrence struct { // Day - Gets or sets the day. Must be one of monday, tuesday, wednesday, thursday, friday, saturday, sunday. Possible values include: 'JobScheduleDayMonday', 'JobScheduleDayTuesday', 'JobScheduleDayWednesday', 'JobScheduleDayThursday', 'JobScheduleDayFriday', 'JobScheduleDaySaturday', 'JobScheduleDaySunday' @@ -1384,14 +1285,12 @@ type JobRecurrenceScheduleMonthlyOccurrence struct { Occurrence *int32 `json:"Occurrence,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobStateFilter ... type JobStateFilter struct { // State - Gets or sets the job state. Possible values include: 'JobStateEnabled', 'JobStateDisabled', 'JobStateFaulted', 'JobStateCompleted' State JobState `json:"state,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // JobStatus ... type JobStatus struct { // ExecutionCount - READ-ONLY; Gets the number of times this job has executed. @@ -1406,7 +1305,6 @@ type JobStatus struct { NextExecutionTime *date.Time `json:"nextExecutionTime,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // OAuthAuthentication ... type OAuthAuthentication struct { // Secret - Gets or sets the secret, return value will always be empty. @@ -1421,7 +1319,6 @@ type OAuthAuthentication struct { Type Type `json:"type,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // MarshalJSON is the custom marshaler for OAuthAuthentication. func (oaa OAuthAuthentication) MarshalJSON() ([]byte, error) { oaa.Type = TypeActiveDirectoryOAuth @@ -1444,37 +1341,31 @@ func (oaa OAuthAuthentication) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // AsClientCertAuthentication is the BasicHTTPAuthentication implementation for OAuthAuthentication. func (oaa OAuthAuthentication) AsClientCertAuthentication() (*ClientCertAuthentication, bool) { return nil, false } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // AsBasicAuthentication is the BasicHTTPAuthentication implementation for OAuthAuthentication. func (oaa OAuthAuthentication) AsBasicAuthentication() (*BasicAuthentication, bool) { return nil, false } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // AsOAuthAuthentication is the BasicHTTPAuthentication implementation for OAuthAuthentication. func (oaa OAuthAuthentication) AsOAuthAuthentication() (*OAuthAuthentication, bool) { return &oaa, true } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // AsHTTPAuthentication is the BasicHTTPAuthentication implementation for OAuthAuthentication. func (oaa OAuthAuthentication) AsHTTPAuthentication() (*HTTPAuthentication, bool) { return nil, false } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // AsBasicHTTPAuthentication is the BasicHTTPAuthentication implementation for OAuthAuthentication. func (oaa OAuthAuthentication) AsBasicHTTPAuthentication() (BasicHTTPAuthentication, bool) { return &oaa, true } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // RetryPolicy ... type RetryPolicy struct { // RetryType - Gets or sets the retry strategy to be used. Possible values include: 'None', 'Fixed' @@ -1485,7 +1376,6 @@ type RetryPolicy struct { RetryCount *int32 `json:"retryCount,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ServiceBusAuthentication ... type ServiceBusAuthentication struct { // SasKey - Gets or sets the SAS key. @@ -1496,7 +1386,6 @@ type ServiceBusAuthentication struct { Type ServiceBusAuthenticationType `json:"type,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ServiceBusBrokeredMessageProperties ... type ServiceBusBrokeredMessageProperties struct { // ContentType - Gets or sets the content type. @@ -1527,7 +1416,6 @@ type ServiceBusBrokeredMessageProperties struct { ViaPartitionKey *string `json:"viaPartitionKey,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ServiceBusMessage ... type ServiceBusMessage struct { // Authentication - Gets or sets the Service Bus authentication. @@ -1544,7 +1432,6 @@ type ServiceBusMessage struct { TransportType ServiceBusTransportType `json:"transportType,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // MarshalJSON is the custom marshaler for ServiceBusMessage. func (sbm ServiceBusMessage) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -1569,7 +1456,6 @@ func (sbm ServiceBusMessage) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ServiceBusQueueMessage ... type ServiceBusQueueMessage struct { // QueueName - Gets or sets the queue name. @@ -1588,7 +1474,6 @@ type ServiceBusQueueMessage struct { TransportType ServiceBusTransportType `json:"transportType,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // MarshalJSON is the custom marshaler for ServiceBusQueueMessage. func (sbqm ServiceBusQueueMessage) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -1616,7 +1501,6 @@ func (sbqm ServiceBusQueueMessage) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // ServiceBusTopicMessage ... type ServiceBusTopicMessage struct { // TopicPath - Gets or sets the topic path. @@ -1635,7 +1519,6 @@ type ServiceBusTopicMessage struct { TransportType ServiceBusTransportType `json:"transportType,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // MarshalJSON is the custom marshaler for ServiceBusTopicMessage. func (sbtm ServiceBusTopicMessage) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -1663,14 +1546,12 @@ func (sbtm ServiceBusTopicMessage) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // Sku ... type Sku struct { // Name - Gets or set the SKU. Possible values include: 'Standard', 'Free', 'P10Premium', 'P20Premium' Name SkuDefinition `json:"name,omitempty"` } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // StorageQueueMessage ... type StorageQueueMessage struct { // StorageAccount - Gets or sets the storage account name. diff --git a/services/scheduler/mgmt/2016-03-01/scheduler/version.go b/services/scheduler/mgmt/2016-03-01/scheduler/version.go index 4409ef618edd..6fcf2020c240 100644 --- a/services/scheduler/mgmt/2016-03-01/scheduler/version.go +++ b/services/scheduler/mgmt/2016-03-01/scheduler/version.go @@ -18,13 +18,12 @@ import "github.com/Azure/azure-sdk-for-go/version" // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. + // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { return "Azure-SDK-For-Go/" + version.Number + " scheduler/2016-03-01" } -// Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic instead. // 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 d651f9ac1eb6..f737cf2ea88a 100644 --- a/services/servicebus/mgmt/2017-04-01/servicebus/models.go +++ b/services/servicebus/mgmt/2017-04-01/servicebus/models.go @@ -122,21 +122,6 @@ func PossibleFilterTypeValues() []FilterType { return []FilterType{FilterTypeCorrelationFilter, FilterTypeSQLFilter} } -// IPAction enumerates the values for ip action. -type IPAction string - -const ( - // Accept ... - Accept IPAction = "Accept" - // Reject ... - Reject IPAction = "Reject" -) - -// PossibleIPActionValues returns an array of possible values for the IPAction const type. -func PossibleIPActionValues() []IPAction { - return []IPAction{Accept, Reject} -} - // KeyType enumerates the values for key type. type KeyType string @@ -948,200 +933,6 @@ type EventhubProperties struct { CaptureDescription *CaptureDescription `json:"captureDescription,omitempty"` } -// IPFilterRule single item in a List or Get IpFilterRules operation -type IPFilterRule struct { - autorest.Response `json:"-"` - // IPFilterRuleProperties - Properties supplied to create or update IpFilterRules - *IPFilterRuleProperties `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"` -} - -// MarshalJSON is the custom marshaler for IPFilterRule. -func (ifr IPFilterRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ifr.IPFilterRuleProperties != nil { - objectMap["properties"] = ifr.IPFilterRuleProperties - } - if ifr.ID != nil { - objectMap["id"] = ifr.ID - } - if ifr.Name != nil { - objectMap["name"] = ifr.Name - } - if ifr.Type != nil { - objectMap["type"] = ifr.Type - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for IPFilterRule struct. -func (ifr *IPFilterRule) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var IPFilterRuleProperties IPFilterRuleProperties - err = json.Unmarshal(*v, &IPFilterRuleProperties) - if err != nil { - return err - } - ifr.IPFilterRuleProperties = &IPFilterRuleProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ifr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ifr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ifr.Type = &typeVar - } - } - } - - return nil -} - -// IPFilterRuleListResult the response from the List namespace operation. -type IPFilterRuleListResult struct { - autorest.Response `json:"-"` - // Value - Result of the List IpFilter Rules operation. - Value *[]IPFilterRule `json:"value,omitempty"` - // NextLink - Link to the next set of results. Not empty if Value contains an incomplete list of IpFilter Rules - NextLink *string `json:"nextLink,omitempty"` -} - -// IPFilterRuleListResultIterator provides access to a complete listing of IPFilterRule values. -type IPFilterRuleListResultIterator struct { - i int - page IPFilterRuleListResultPage -} - -// 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 *IPFilterRuleListResultIterator) 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 IPFilterRuleListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter IPFilterRuleListResultIterator) Response() IPFilterRuleListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter IPFilterRuleListResultIterator) Value() IPFilterRule { - if !iter.page.NotDone() { - return IPFilterRule{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (ifrlr IPFilterRuleListResult) IsEmpty() bool { - return ifrlr.Value == nil || len(*ifrlr.Value) == 0 -} - -// iPFilterRuleListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ifrlr IPFilterRuleListResult) iPFilterRuleListResultPreparer() (*http.Request, error) { - if ifrlr.NextLink == nil || len(to.String(ifrlr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ifrlr.NextLink))) -} - -// IPFilterRuleListResultPage contains a page of IPFilterRule values. -type IPFilterRuleListResultPage struct { - fn func(IPFilterRuleListResult) (IPFilterRuleListResult, error) - ifrlr IPFilterRuleListResult -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *IPFilterRuleListResultPage) Next() error { - next, err := page.fn(page.ifrlr) - if err != nil { - return err - } - page.ifrlr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page IPFilterRuleListResultPage) NotDone() bool { - return !page.ifrlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page IPFilterRuleListResultPage) Response() IPFilterRuleListResult { - return page.ifrlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page IPFilterRuleListResultPage) Values() []IPFilterRule { - if page.ifrlr.IsEmpty() { - return nil - } - return *page.ifrlr.Value -} - -// IPFilterRuleProperties properties supplied to create or update IpFilterRules -type IPFilterRuleProperties struct { - // IPMask - IP Mask - IPMask *string `json:"ipMask,omitempty"` - // Action - The IP Filter Action. Possible values include: 'Accept', 'Reject' - Action IPAction `json:"action,omitempty"` - // FilterName - IP Filter name - FilterName *string `json:"filterName,omitempty"` -} - // MessageCountDetails message Count Details. type MessageCountDetails struct { // ActiveMessageCount - READ-ONLY; Number of active messages in the queue, topic, or subscription. @@ -3803,193 +3594,3 @@ func (tr TrackedResource) MarshalJSON() ([]byte, error) { } return json.Marshal(objectMap) } - -// VirtualNetworkRule single item in a List or Get VirtualNetworkRules operation -type VirtualNetworkRule struct { - autorest.Response `json:"-"` - // VirtualNetworkRuleProperties - Properties supplied to create or update VirtualNetworkRules - *VirtualNetworkRuleProperties `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"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkRule. -func (vnr VirtualNetworkRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vnr.VirtualNetworkRuleProperties != nil { - objectMap["properties"] = vnr.VirtualNetworkRuleProperties - } - if vnr.ID != nil { - objectMap["id"] = vnr.ID - } - if vnr.Name != nil { - objectMap["name"] = vnr.Name - } - if vnr.Type != nil { - objectMap["type"] = vnr.Type - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualNetworkRule struct. -func (vnr *VirtualNetworkRule) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualNetworkRuleProperties VirtualNetworkRuleProperties - err = json.Unmarshal(*v, &virtualNetworkRuleProperties) - if err != nil { - return err - } - vnr.VirtualNetworkRuleProperties = &virtualNetworkRuleProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vnr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vnr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vnr.Type = &typeVar - } - } - } - - return nil -} - -// VirtualNetworkRuleListResult the response from the List namespace operation. -type VirtualNetworkRuleListResult struct { - autorest.Response `json:"-"` - // Value - Result of the List VirtualNetwork Rules operation. - Value *[]VirtualNetworkRule `json:"value,omitempty"` - // NextLink - Link to the next set of results. Not empty if Value contains an incomplete list of VirtualNetwork Rules - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualNetworkRuleListResultIterator provides access to a complete listing of VirtualNetworkRule values. -type VirtualNetworkRuleListResultIterator struct { - i int - page VirtualNetworkRuleListResultPage -} - -// 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 *VirtualNetworkRuleListResultIterator) 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 VirtualNetworkRuleListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualNetworkRuleListResultIterator) Response() VirtualNetworkRuleListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualNetworkRuleListResultIterator) Value() VirtualNetworkRule { - if !iter.page.NotDone() { - return VirtualNetworkRule{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (vnrlr VirtualNetworkRuleListResult) IsEmpty() bool { - return vnrlr.Value == nil || len(*vnrlr.Value) == 0 -} - -// virtualNetworkRuleListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vnrlr VirtualNetworkRuleListResult) virtualNetworkRuleListResultPreparer() (*http.Request, error) { - if vnrlr.NextLink == nil || len(to.String(vnrlr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vnrlr.NextLink))) -} - -// VirtualNetworkRuleListResultPage contains a page of VirtualNetworkRule values. -type VirtualNetworkRuleListResultPage struct { - fn func(VirtualNetworkRuleListResult) (VirtualNetworkRuleListResult, error) - vnrlr VirtualNetworkRuleListResult -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualNetworkRuleListResultPage) Next() error { - next, err := page.fn(page.vnrlr) - if err != nil { - return err - } - page.vnrlr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualNetworkRuleListResultPage) NotDone() bool { - return !page.vnrlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualNetworkRuleListResultPage) Response() VirtualNetworkRuleListResult { - return page.vnrlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualNetworkRuleListResultPage) Values() []VirtualNetworkRule { - if page.vnrlr.IsEmpty() { - return nil - } - return *page.vnrlr.Value -} - -// VirtualNetworkRuleProperties properties supplied to create or update VirtualNetworkRules -type VirtualNetworkRuleProperties struct { - // VirtualNetworkSubnetID - Resource ID of Virtual Network Subnet - VirtualNetworkSubnetID *string `json:"virtualNetworkSubnetId,omitempty"` -} diff --git a/services/preview/sql/mgmt/2018-06-15-preview/sql/backuplongtermretentionpolicies.go b/services/sql/mgmt/2014-04-01/sql/backuplongtermretentionpolicies.go similarity index 84% rename from services/preview/sql/mgmt/2018-06-15-preview/sql/backuplongtermretentionpolicies.go rename to services/sql/mgmt/2014-04-01/sql/backuplongtermretentionpolicies.go index d8a96b77ac01..d106b0595037 100644 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/backuplongtermretentionpolicies.go +++ b/services/sql/mgmt/2014-04-01/sql/backuplongtermretentionpolicies.go @@ -21,6 +21,7 @@ import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "github.com/Azure/go-autorest/tracing" "net/http" ) @@ -43,13 +44,13 @@ func NewBackupLongTermRetentionPoliciesClientWithBaseURI(baseURI string, subscri return BackupLongTermRetentionPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate sets a database's long term retention policy. +// CreateOrUpdate creates or updates a database backup long term retention policy // 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. -// parameters - the long term retention policy info. +// databaseName - the name of the database +// parameters - the required parameters to update a backup long term retention policy func (client BackupLongTermRetentionPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters BackupLongTermRetentionPolicy) (result BackupLongTermRetentionPoliciesCreateOrUpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/BackupLongTermRetentionPoliciesClient.CreateOrUpdate") @@ -61,6 +62,13 @@ func (client BackupLongTermRetentionPoliciesClient) CreateOrUpdate(ctx context.C tracing.EndSpan(ctx, sc, err) }() } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.BackupLongTermRetentionPolicyProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.BackupLongTermRetentionPolicyProperties.RecoveryServicesBackupPolicyResourceID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("sql.BackupLongTermRetentionPoliciesClient", "CreateOrUpdate", err.Error()) + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, databaseName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") @@ -79,23 +87,24 @@ func (client BackupLongTermRetentionPoliciesClient) CreateOrUpdate(ctx context.C // CreateOrUpdatePreparer prepares the CreateOrUpdate request. func (client BackupLongTermRetentionPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters BackupLongTermRetentionPolicy) (*http.Request, error) { pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "policyName": autorest.Encode("path", "default"), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "backupLongTermRetentionPolicyName": autorest.Encode("path", "Default"), + "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" + const APIVersion = "2014-04-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } + parameters.Location = 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.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{backupLongTermRetentionPolicyName}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -120,14 +129,14 @@ func (client BackupLongTermRetentionPoliciesClient) CreateOrUpdateResponder(resp err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// Get gets a database's long term retention policy. +// Get returns a database backup long term retention policy // 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. @@ -168,14 +177,14 @@ func (client BackupLongTermRetentionPoliciesClient) Get(ctx context.Context, res // GetPreparer prepares the Get request. func (client BackupLongTermRetentionPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "policyName": autorest.Encode("path", "default"), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "backupLongTermRetentionPolicyName": autorest.Encode("path", "Default"), + "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" + const APIVersion = "2014-04-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -183,7 +192,7 @@ func (client BackupLongTermRetentionPoliciesClient) GetPreparer(ctx context.Cont preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{backupLongTermRetentionPolicyName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -208,13 +217,13 @@ func (client BackupLongTermRetentionPoliciesClient) GetResponder(resp *http.Resp return } -// ListByDatabase gets a database's long term retention policy. +// ListByDatabase returns a database backup long term retention policy // 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 BackupLongTermRetentionPoliciesClient) ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result BackupLongTermRetentionPolicy, err error) { +func (client BackupLongTermRetentionPoliciesClient) ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result BackupLongTermRetentionPolicyListResult, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/BackupLongTermRetentionPoliciesClient.ListByDatabase") defer func() { @@ -255,7 +264,7 @@ func (client BackupLongTermRetentionPoliciesClient) ListByDatabasePreparer(ctx c "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01-preview" + const APIVersion = "2014-04-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -277,7 +286,7 @@ func (client BackupLongTermRetentionPoliciesClient) ListByDatabaseSender(req *ht // ListByDatabaseResponder handles the response to the ListByDatabase request. The method always // closes the http.Response Body. -func (client BackupLongTermRetentionPoliciesClient) ListByDatabaseResponder(resp *http.Response) (result BackupLongTermRetentionPolicy, err error) { +func (client BackupLongTermRetentionPoliciesClient) ListByDatabaseResponder(resp *http.Response) (result BackupLongTermRetentionPolicyListResult, err error) { err = autorest.Respond( resp, client.ByInspecting(), diff --git a/services/sql/mgmt/2014-04-01/sql/backuplongtermretentionvaults.go b/services/sql/mgmt/2014-04-01/sql/backuplongtermretentionvaults.go new file mode 100644 index 000000000000..da3db554f53d --- /dev/null +++ b/services/sql/mgmt/2014-04-01/sql/backuplongtermretentionvaults.go @@ -0,0 +1,292 @@ +package sql + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the 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" +) + +// BackupLongTermRetentionVaultsClient is the the Azure SQL Database management API provides a RESTful set of web +// services that interact with Azure SQL Database services to manage your databases. The API enables you to create, +// retrieve, update, and delete databases. +type BackupLongTermRetentionVaultsClient struct { + BaseClient +} + +// NewBackupLongTermRetentionVaultsClient creates an instance of the BackupLongTermRetentionVaultsClient client. +func NewBackupLongTermRetentionVaultsClient(subscriptionID string) BackupLongTermRetentionVaultsClient { + return NewBackupLongTermRetentionVaultsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewBackupLongTermRetentionVaultsClientWithBaseURI creates an instance of the BackupLongTermRetentionVaultsClient +// client. +func NewBackupLongTermRetentionVaultsClientWithBaseURI(baseURI string, subscriptionID string) BackupLongTermRetentionVaultsClient { + return BackupLongTermRetentionVaultsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate updates a server backup long term retention vault +// 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. +// parameters - the required parameters to update a backup long term retention vault +func (client BackupLongTermRetentionVaultsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters BackupLongTermRetentionVault) (result BackupLongTermRetentionVaultsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BackupLongTermRetentionVaultsClient.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.BackupLongTermRetentionVaultProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.BackupLongTermRetentionVaultProperties.RecoveryServicesVaultResourceID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("sql.BackupLongTermRetentionVaultsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionVaultsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionVaultsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client BackupLongTermRetentionVaultsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, parameters BackupLongTermRetentionVault) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "backupLongTermRetentionVaultName": autorest.Encode("path", "RegisteredVault"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2014-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + parameters.Location = 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.Sql/servers/{serverName}/backupLongTermRetentionVaults/{backupLongTermRetentionVaultName}", 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 BackupLongTermRetentionVaultsClient) CreateOrUpdateSender(req *http.Request) (future BackupLongTermRetentionVaultsCreateOrUpdateFuture, 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 BackupLongTermRetentionVaultsClient) CreateOrUpdateResponder(resp *http.Response) (result BackupLongTermRetentionVault, 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 gets a server backup long term retention vault +// 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 BackupLongTermRetentionVaultsClient) Get(ctx context.Context, resourceGroupName string, serverName string) (result BackupLongTermRetentionVault, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BackupLongTermRetentionVaultsClient.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, serverName) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionVaultsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionVaultsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionVaultsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client BackupLongTermRetentionVaultsClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "backupLongTermRetentionVaultName": autorest.Encode("path", "RegisteredVault"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2014-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.Sql/servers/{serverName}/backupLongTermRetentionVaults/{backupLongTermRetentionVaultName}", 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 BackupLongTermRetentionVaultsClient) 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 BackupLongTermRetentionVaultsClient) GetResponder(resp *http.Response) (result BackupLongTermRetentionVault, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByServer gets server backup long term retention vaults in 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 BackupLongTermRetentionVaultsClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result BackupLongTermRetentionVaultListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BackupLongTermRetentionVaultsClient.ListByServer") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionVaultsClient", "ListByServer", nil, "Failure preparing request") + return + } + + resp, err := client.ListByServerSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionVaultsClient", "ListByServer", resp, "Failure sending request") + return + } + + result, err = client.ListByServerResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionVaultsClient", "ListByServer", resp, "Failure responding to request") + } + + return +} + +// ListByServerPreparer prepares the ListByServer request. +func (client BackupLongTermRetentionVaultsClient) 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 = "2014-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.Sql/servers/{serverName}/backupLongTermRetentionVaults", 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 BackupLongTermRetentionVaultsClient) 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 BackupLongTermRetentionVaultsClient) ListByServerResponder(resp *http.Response) (result BackupLongTermRetentionVaultListResult, 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/sql/mgmt/2018-06-15-preview/sql/capabilities.go b/services/sql/mgmt/2014-04-01/sql/capabilities.go similarity index 84% rename from services/preview/sql/mgmt/2018-06-15-preview/sql/capabilities.go rename to services/sql/mgmt/2014-04-01/sql/capabilities.go index 964106affd24..c5718dd09fbe 100644 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/capabilities.go +++ b/services/sql/mgmt/2014-04-01/sql/capabilities.go @@ -42,11 +42,10 @@ func NewCapabilitiesClientWithBaseURI(baseURI string, subscriptionID string) Cap return CapabilitiesClient{NewWithBaseURI(baseURI, subscriptionID)} } -// ListByLocation gets the subscription capabilities available for the specified location. +// ListByLocation gets the capabilities available for the specified location. // Parameters: -// locationName - the location name whose capabilities are retrieved. -// include - if specified, restricts the response to only include the selected item. -func (client CapabilitiesClient) ListByLocation(ctx context.Context, locationName string, include CapabilityGroup) (result LocationCapabilities, err error) { +// locationID - the location id whose capabilities are retrieved. +func (client CapabilitiesClient) ListByLocation(ctx context.Context, locationID string) (result LocationCapabilities, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/CapabilitiesClient.ListByLocation") defer func() { @@ -57,7 +56,7 @@ func (client CapabilitiesClient) ListByLocation(ctx context.Context, locationNam tracing.EndSpan(ctx, sc, err) }() } - req, err := client.ListByLocationPreparer(ctx, locationName, include) + req, err := client.ListByLocationPreparer(ctx, locationID) if err != nil { err = autorest.NewErrorWithError(err, "sql.CapabilitiesClient", "ListByLocation", nil, "Failure preparing request") return @@ -79,24 +78,21 @@ func (client CapabilitiesClient) ListByLocation(ctx context.Context, locationNam } // ListByLocationPreparer prepares the ListByLocation request. -func (client CapabilitiesClient) ListByLocationPreparer(ctx context.Context, locationName string, include CapabilityGroup) (*http.Request, error) { +func (client CapabilitiesClient) ListByLocationPreparer(ctx context.Context, locationID string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "locationName": autorest.Encode("path", locationName), + "locationId": autorest.Encode("path", locationID), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-10-01-preview" + const APIVersion = "2014-04-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } - if len(string(include)) > 0 { - queryParameters["include"] = autorest.Encode("query", include) - } preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/capabilities", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationId}/capabilities", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/sql/mgmt/2014-04-01/sql/databaseadvisors.go b/services/sql/mgmt/2014-04-01/sql/databaseadvisors.go new file mode 100644 index 000000000000..be13e2ed22e1 --- /dev/null +++ b/services/sql/mgmt/2014-04-01/sql/databaseadvisors.go @@ -0,0 +1,292 @@ +package sql + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if 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" +) + +// DatabaseAdvisorsClient is the the Azure SQL Database management API provides a RESTful set of web services that +// interact with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, +// and delete databases. +type DatabaseAdvisorsClient struct { + BaseClient +} + +// NewDatabaseAdvisorsClient creates an instance of the DatabaseAdvisorsClient client. +func NewDatabaseAdvisorsClient(subscriptionID string) DatabaseAdvisorsClient { + return NewDatabaseAdvisorsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDatabaseAdvisorsClientWithBaseURI creates an instance of the DatabaseAdvisorsClient client. +func NewDatabaseAdvisorsClientWithBaseURI(baseURI string, subscriptionID string) DatabaseAdvisorsClient { + return DatabaseAdvisorsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a database advisor. +// 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. +// advisorName - the name of the Database Advisor. +// parameters - the requested advisor resource state. +func (client DatabaseAdvisorsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, advisorName string, parameters Advisor) (result Advisor, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAdvisorsClient.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, serverName, databaseName, advisorName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabaseAdvisorsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.DatabaseAdvisorsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabaseAdvisorsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client DatabaseAdvisorsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, advisorName string, parameters Advisor) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "advisorName": autorest.Encode("path", advisorName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2014-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + parameters.Kind = nil + parameters.Location = 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.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}", 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 DatabaseAdvisorsClient) 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 DatabaseAdvisorsClient) CreateOrUpdateResponder(resp *http.Response) (result Advisor, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get returns details of a Database Advisor. +// 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. +// advisorName - the name of the Database Advisor. +func (client DatabaseAdvisorsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, advisorName string) (result Advisor, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAdvisorsClient.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, serverName, databaseName, advisorName) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabaseAdvisorsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.DatabaseAdvisorsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabaseAdvisorsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client DatabaseAdvisorsClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, advisorName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "advisorName": autorest.Encode("path", advisorName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2014-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.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}", 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 DatabaseAdvisorsClient) 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 DatabaseAdvisorsClient) GetResponder(resp *http.Response) (result Advisor, 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 a list of database advisors. +// 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 DatabaseAdvisorsClient) ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result AdvisorListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAdvisorsClient.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, serverName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabaseAdvisorsClient", "ListByDatabase", nil, "Failure preparing request") + return + } + + resp, err := client.ListByDatabaseSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.DatabaseAdvisorsClient", "ListByDatabase", resp, "Failure sending request") + return + } + + result, err = client.ListByDatabaseResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabaseAdvisorsClient", "ListByDatabase", resp, "Failure responding to request") + } + + return +} + +// ListByDatabasePreparer prepares the ListByDatabase request. +func (client DatabaseAdvisorsClient) 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 = "2014-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.Sql/servers/{serverName}/databases/{databaseName}/advisors", 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 DatabaseAdvisorsClient) 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 DatabaseAdvisorsClient) ListByDatabaseResponder(resp *http.Response) (result AdvisorListResult, 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/sql/mgmt/2018-06-15-preview/sql/transparentdataencryptions.go b/services/sql/mgmt/2014-04-01/sql/databaseconnectionpolicies.go similarity index 58% rename from services/preview/sql/mgmt/2018-06-15-preview/sql/transparentdataencryptions.go rename to services/sql/mgmt/2014-04-01/sql/databaseconnectionpolicies.go index 7ea3bdf24a6e..7c70c940b266 100644 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/transparentdataencryptions.go +++ b/services/sql/mgmt/2014-04-01/sql/databaseconnectionpolicies.go @@ -25,33 +25,34 @@ import ( "net/http" ) -// TransparentDataEncryptionsClient is the the Azure SQL Database management API provides a RESTful set of web services +// DatabaseConnectionPoliciesClient is the the Azure SQL Database management API provides a RESTful set of web services // that interact with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, // update, and delete databases. -type TransparentDataEncryptionsClient struct { +type DatabaseConnectionPoliciesClient struct { BaseClient } -// NewTransparentDataEncryptionsClient creates an instance of the TransparentDataEncryptionsClient client. -func NewTransparentDataEncryptionsClient(subscriptionID string) TransparentDataEncryptionsClient { - return NewTransparentDataEncryptionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +// NewDatabaseConnectionPoliciesClient creates an instance of the DatabaseConnectionPoliciesClient client. +func NewDatabaseConnectionPoliciesClient(subscriptionID string) DatabaseConnectionPoliciesClient { + return NewDatabaseConnectionPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewTransparentDataEncryptionsClientWithBaseURI creates an instance of the TransparentDataEncryptionsClient client. -func NewTransparentDataEncryptionsClientWithBaseURI(baseURI string, subscriptionID string) TransparentDataEncryptionsClient { - return TransparentDataEncryptionsClient{NewWithBaseURI(baseURI, subscriptionID)} +// NewDatabaseConnectionPoliciesClientWithBaseURI creates an instance of the DatabaseConnectionPoliciesClient client. +func NewDatabaseConnectionPoliciesClientWithBaseURI(baseURI string, subscriptionID string) DatabaseConnectionPoliciesClient { + return DatabaseConnectionPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate creates or updates a database's transparent data encryption configuration. +// CreateOrUpdate creates or updates a database's connection policy, which is used with table auditing. Table auditing +// is deprecated, use blob auditing instead. // 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 for which setting the transparent data encryption applies. -// parameters - the required parameters for creating or updating transparent data encryption. -func (client TransparentDataEncryptionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters TransparentDataEncryption) (result TransparentDataEncryption, err error) { +// databaseName - the name of the database for which the connection policy will be defined. +// parameters - the database connection policy. +func (client DatabaseConnectionPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters DatabaseConnectionPolicy) (result DatabaseConnectionPolicy, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/TransparentDataEncryptionsClient.CreateOrUpdate") + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseConnectionPoliciesClient.CreateOrUpdate") defer func() { sc := -1 if result.Response.Response != nil { @@ -62,33 +63,33 @@ func (client TransparentDataEncryptionsClient) CreateOrUpdate(ctx context.Contex } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, databaseName, parameters) if err != nil { - err = autorest.NewErrorWithError(err, "sql.TransparentDataEncryptionsClient", "CreateOrUpdate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "sql.DatabaseConnectionPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") return } resp, err := client.CreateOrUpdateSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.TransparentDataEncryptionsClient", "CreateOrUpdate", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "sql.DatabaseConnectionPoliciesClient", "CreateOrUpdate", resp, "Failure sending request") return } result, err = client.CreateOrUpdateResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "sql.TransparentDataEncryptionsClient", "CreateOrUpdate", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "sql.DatabaseConnectionPoliciesClient", "CreateOrUpdate", resp, "Failure responding to request") } return } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client TransparentDataEncryptionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters TransparentDataEncryption) (*http.Request, error) { +func (client DatabaseConnectionPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters DatabaseConnectionPolicy) (*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), - "transparentDataEncryptionName": autorest.Encode("path", "current"), + "connectionPolicyName": autorest.Encode("path", "default"), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2014-04-01" @@ -96,12 +97,13 @@ func (client TransparentDataEncryptionsClient) CreateOrUpdatePreparer(ctx contex "api-version": APIVersion, } + parameters.Kind = nil parameters.Location = 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.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{transparentDataEncryptionName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/connectionPolicies/{connectionPolicyName}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -109,14 +111,14 @@ func (client TransparentDataEncryptionsClient) CreateOrUpdatePreparer(ctx contex // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. -func (client TransparentDataEncryptionsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { +func (client DatabaseConnectionPoliciesClient) 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 TransparentDataEncryptionsClient) CreateOrUpdateResponder(resp *http.Response) (result TransparentDataEncryption, err error) { +func (client DatabaseConnectionPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result DatabaseConnectionPolicy, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -127,15 +129,16 @@ func (client TransparentDataEncryptionsClient) CreateOrUpdateResponder(resp *htt return } -// Get gets a database's transparent data encryption configuration. +// Get gets a database's connection policy, which is used with table auditing. Table auditing is deprecated, use blob +// auditing instead. // 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 for which the transparent data encryption applies. -func (client TransparentDataEncryptionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result TransparentDataEncryption, err error) { +// databaseName - the name of the database for which the connection policy is defined. +func (client DatabaseConnectionPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result DatabaseConnectionPolicy, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/TransparentDataEncryptionsClient.Get") + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseConnectionPoliciesClient.Get") defer func() { sc := -1 if result.Response.Response != nil { @@ -146,33 +149,33 @@ func (client TransparentDataEncryptionsClient) Get(ctx context.Context, resource } req, err := client.GetPreparer(ctx, resourceGroupName, serverName, databaseName) if err != nil { - err = autorest.NewErrorWithError(err, "sql.TransparentDataEncryptionsClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "sql.DatabaseConnectionPoliciesClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.TransparentDataEncryptionsClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "sql.DatabaseConnectionPoliciesClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "sql.TransparentDataEncryptionsClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "sql.DatabaseConnectionPoliciesClient", "Get", resp, "Failure responding to request") } return } // GetPreparer prepares the Get request. -func (client TransparentDataEncryptionsClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (*http.Request, error) { +func (client DatabaseConnectionPoliciesClient) GetPreparer(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), - "transparentDataEncryptionName": autorest.Encode("path", "current"), + "connectionPolicyName": autorest.Encode("path", "default"), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2014-04-01" @@ -183,21 +186,21 @@ func (client TransparentDataEncryptionsClient) GetPreparer(ctx context.Context, preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{transparentDataEncryptionName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/connectionPolicies/{connectionPolicyName}", 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 TransparentDataEncryptionsClient) GetSender(req *http.Request) (*http.Response, error) { +func (client DatabaseConnectionPoliciesClient) 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 TransparentDataEncryptionsClient) GetResponder(resp *http.Response) (result TransparentDataEncryption, err error) { +func (client DatabaseConnectionPoliciesClient) GetResponder(resp *http.Response) (result DatabaseConnectionPolicy, err error) { err = autorest.Respond( resp, client.ByInspecting(), diff --git a/services/sql/mgmt/2014-04-01/sql/databases.go b/services/sql/mgmt/2014-04-01/sql/databases.go index dcb44f215b7a..36b2bc57c791 100644 --- a/services/sql/mgmt/2014-04-01/sql/databases.go +++ b/services/sql/mgmt/2014-04-01/sql/databases.go @@ -974,6 +974,168 @@ func (client DatabasesClient) ListByServerResponder(resp *http.Response) (result return } +// ListMetricDefinitions returns database metric definitions. +// 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 DatabasesClient) ListMetricDefinitions(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result MetricDefinitionListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabasesClient.ListMetricDefinitions") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListMetricDefinitionsPreparer(ctx, resourceGroupName, serverName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "ListMetricDefinitions", nil, "Failure preparing request") + return + } + + resp, err := client.ListMetricDefinitionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "ListMetricDefinitions", resp, "Failure sending request") + return + } + + result, err = client.ListMetricDefinitionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "ListMetricDefinitions", resp, "Failure responding to request") + } + + return +} + +// ListMetricDefinitionsPreparer prepares the ListMetricDefinitions request. +func (client DatabasesClient) ListMetricDefinitionsPreparer(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 = "2014-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.Sql/servers/{serverName}/databases/{databaseName}/metricDefinitions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMetricDefinitionsSender sends the ListMetricDefinitions request. The method will close the +// http.Response Body if it receives an error. +func (client DatabasesClient) ListMetricDefinitionsSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListMetricDefinitionsResponder handles the response to the ListMetricDefinitions request. The method always +// closes the http.Response Body. +func (client DatabasesClient) ListMetricDefinitionsResponder(resp *http.Response) (result MetricDefinitionListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListMetrics returns database metrics. +// 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. +// filter - an OData filter expression that describes a subset of metrics to return. +func (client DatabasesClient) ListMetrics(ctx context.Context, resourceGroupName string, serverName string, databaseName string, filter string) (result MetricListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabasesClient.ListMetrics") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListMetricsPreparer(ctx, resourceGroupName, serverName, databaseName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "ListMetrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListMetricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "ListMetrics", resp, "Failure sending request") + return + } + + result, err = client.ListMetricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "ListMetrics", resp, "Failure responding to request") + } + + return +} + +// ListMetricsPreparer prepares the ListMetrics request. +func (client DatabasesClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, filter 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 = "2014-04-01" + queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), + "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}/metrics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMetricsSender sends the ListMetrics request. The method will close the +// http.Response Body if it receives an error. +func (client DatabasesClient) ListMetricsSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListMetricsResponder handles the response to the ListMetrics request. The method always +// closes the http.Response Body. +func (client DatabasesClient) ListMetricsResponder(resp *http.Response) (result MetricListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // Pause pauses a data warehouse. // Parameters: // resourceGroupName - the name of the resource group that contains the resource. You can obtain this value diff --git a/services/sql/mgmt/2014-04-01/sql/databasetableauditingpolicies.go b/services/sql/mgmt/2014-04-01/sql/databasetableauditingpolicies.go new file mode 100644 index 000000000000..731bef2eb94f --- /dev/null +++ b/services/sql/mgmt/2014-04-01/sql/databasetableauditingpolicies.go @@ -0,0 +1,292 @@ +package sql + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if 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" +) + +// DatabaseTableAuditingPoliciesClient is the the Azure SQL Database management API provides a RESTful set of web +// services that interact with Azure SQL Database services to manage your databases. The API enables you to create, +// retrieve, update, and delete databases. +type DatabaseTableAuditingPoliciesClient struct { + BaseClient +} + +// NewDatabaseTableAuditingPoliciesClient creates an instance of the DatabaseTableAuditingPoliciesClient client. +func NewDatabaseTableAuditingPoliciesClient(subscriptionID string) DatabaseTableAuditingPoliciesClient { + return NewDatabaseTableAuditingPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDatabaseTableAuditingPoliciesClientWithBaseURI creates an instance of the DatabaseTableAuditingPoliciesClient +// client. +func NewDatabaseTableAuditingPoliciesClientWithBaseURI(baseURI string, subscriptionID string) DatabaseTableAuditingPoliciesClient { + return DatabaseTableAuditingPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a database's table auditing policy. Table auditing is deprecated, use blob +// auditing instead. +// 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 for which the table auditing policy will be defined. +// parameters - the database table auditing policy. +func (client DatabaseTableAuditingPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters DatabaseTableAuditingPolicy) (result DatabaseTableAuditingPolicy, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseTableAuditingPoliciesClient.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, serverName, databaseName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabaseTableAuditingPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.DatabaseTableAuditingPoliciesClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabaseTableAuditingPoliciesClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client DatabaseTableAuditingPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters DatabaseTableAuditingPolicy) (*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), + "tableAuditingPolicyName": autorest.Encode("path", "default"), + } + + const APIVersion = "2014-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + parameters.Kind = nil + parameters.Location = 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.Sql/servers/{serverName}/databases/{databaseName}/auditingPolicies/{tableAuditingPolicyName}", 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 DatabaseTableAuditingPoliciesClient) 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 DatabaseTableAuditingPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result DatabaseTableAuditingPolicy, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets a database's table auditing policy. Table auditing is deprecated, use blob auditing instead. +// 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 for which the table audit policy is defined. +func (client DatabaseTableAuditingPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result DatabaseTableAuditingPolicy, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseTableAuditingPoliciesClient.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, serverName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabaseTableAuditingPoliciesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.DatabaseTableAuditingPoliciesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabaseTableAuditingPoliciesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client DatabaseTableAuditingPoliciesClient) GetPreparer(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), + "tableAuditingPolicyName": autorest.Encode("path", "default"), + } + + const APIVersion = "2014-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.Sql/servers/{serverName}/databases/{databaseName}/auditingPolicies/{tableAuditingPolicyName}", 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 DatabaseTableAuditingPoliciesClient) 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 DatabaseTableAuditingPoliciesClient) GetResponder(resp *http.Response) (result DatabaseTableAuditingPolicy, 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 lists a database's table auditing policies. Table auditing is deprecated, use blob auditing instead. +// 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 for which the table audit policy is defined. +func (client DatabaseTableAuditingPoliciesClient) ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result DatabaseTableAuditingPolicyListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseTableAuditingPoliciesClient.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, serverName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabaseTableAuditingPoliciesClient", "ListByDatabase", nil, "Failure preparing request") + return + } + + resp, err := client.ListByDatabaseSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.DatabaseTableAuditingPoliciesClient", "ListByDatabase", resp, "Failure sending request") + return + } + + result, err = client.ListByDatabaseResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabaseTableAuditingPoliciesClient", "ListByDatabase", resp, "Failure responding to request") + } + + return +} + +// ListByDatabasePreparer prepares the ListByDatabase request. +func (client DatabaseTableAuditingPoliciesClient) 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 = "2014-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.Sql/servers/{serverName}/databases/{databaseName}/auditingPolicies", 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 DatabaseTableAuditingPoliciesClient) 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 DatabaseTableAuditingPoliciesClient) ListByDatabaseResponder(resp *http.Response) (result DatabaseTableAuditingPolicyListResult, 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/sql/mgmt/2018-06-15-preview/sql/databaseusages.go b/services/sql/mgmt/2014-04-01/sql/databaseusages.go similarity index 100% rename from services/preview/sql/mgmt/2018-06-15-preview/sql/databaseusages.go rename to services/sql/mgmt/2014-04-01/sql/databaseusages.go diff --git a/services/preview/sql/mgmt/2018-06-15-preview/sql/datamaskingpolicies.go b/services/sql/mgmt/2014-04-01/sql/datamaskingpolicies.go similarity index 100% rename from services/preview/sql/mgmt/2018-06-15-preview/sql/datamaskingpolicies.go rename to services/sql/mgmt/2014-04-01/sql/datamaskingpolicies.go diff --git a/services/preview/sql/mgmt/2018-06-15-preview/sql/datamaskingrules.go b/services/sql/mgmt/2014-04-01/sql/datamaskingrules.go similarity index 100% rename from services/preview/sql/mgmt/2018-06-15-preview/sql/datamaskingrules.go rename to services/sql/mgmt/2014-04-01/sql/datamaskingrules.go diff --git a/services/sql/mgmt/2014-04-01/sql/disasterrecoveryconfigurations.go b/services/sql/mgmt/2014-04-01/sql/disasterrecoveryconfigurations.go new file mode 100644 index 000000000000..4ff7c9f53201 --- /dev/null +++ b/services/sql/mgmt/2014-04-01/sql/disasterrecoveryconfigurations.go @@ -0,0 +1,520 @@ +package sql + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if 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" +) + +// DisasterRecoveryConfigurationsClient is the the Azure SQL Database management API provides a RESTful set of web +// services that interact with Azure SQL Database services to manage your databases. The API enables you to create, +// retrieve, update, and delete databases. +type DisasterRecoveryConfigurationsClient struct { + BaseClient +} + +// NewDisasterRecoveryConfigurationsClient creates an instance of the DisasterRecoveryConfigurationsClient client. +func NewDisasterRecoveryConfigurationsClient(subscriptionID string) DisasterRecoveryConfigurationsClient { + return NewDisasterRecoveryConfigurationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDisasterRecoveryConfigurationsClientWithBaseURI creates an instance of the DisasterRecoveryConfigurationsClient +// client. +func NewDisasterRecoveryConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) DisasterRecoveryConfigurationsClient { + return DisasterRecoveryConfigurationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a disaster recovery configuration. +// 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. +// disasterRecoveryConfigurationName - the name of the disaster recovery configuration to be created/updated. +func (client DisasterRecoveryConfigurationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, disasterRecoveryConfigurationName string) (result DisasterRecoveryConfigurationsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DisasterRecoveryConfigurationsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, disasterRecoveryConfigurationName) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DisasterRecoveryConfigurationsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DisasterRecoveryConfigurationsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client DisasterRecoveryConfigurationsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, disasterRecoveryConfigurationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "disasterRecoveryConfigurationName": autorest.Encode("path", disasterRecoveryConfigurationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2014-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/disasterRecoveryConfiguration/{disasterRecoveryConfigurationName}", 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 DisasterRecoveryConfigurationsClient) CreateOrUpdateSender(req *http.Request) (future DisasterRecoveryConfigurationsCreateOrUpdateFuture, 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 DisasterRecoveryConfigurationsClient) CreateOrUpdateResponder(resp *http.Response) (result DisasterRecoveryConfiguration, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a disaster recovery configuration. +// 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. +// disasterRecoveryConfigurationName - the name of the disaster recovery configuration to be deleted. +func (client DisasterRecoveryConfigurationsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, disasterRecoveryConfigurationName string) (result DisasterRecoveryConfigurationsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DisasterRecoveryConfigurationsClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, disasterRecoveryConfigurationName) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DisasterRecoveryConfigurationsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DisasterRecoveryConfigurationsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client DisasterRecoveryConfigurationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, serverName string, disasterRecoveryConfigurationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "disasterRecoveryConfigurationName": autorest.Encode("path", disasterRecoveryConfigurationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2014-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.Sql/servers/{serverName}/disasterRecoveryConfiguration/{disasterRecoveryConfigurationName}", 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 DisasterRecoveryConfigurationsClient) DeleteSender(req *http.Request) (future DisasterRecoveryConfigurationsDeleteFuture, 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 DisasterRecoveryConfigurationsClient) 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 +} + +// Failover fails over from the current primary server to this 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. +// disasterRecoveryConfigurationName - the name of the disaster recovery configuration to failover. +func (client DisasterRecoveryConfigurationsClient) Failover(ctx context.Context, resourceGroupName string, serverName string, disasterRecoveryConfigurationName string) (result DisasterRecoveryConfigurationsFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DisasterRecoveryConfigurationsClient.Failover") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.FailoverPreparer(ctx, resourceGroupName, serverName, disasterRecoveryConfigurationName) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DisasterRecoveryConfigurationsClient", "Failover", nil, "Failure preparing request") + return + } + + result, err = client.FailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DisasterRecoveryConfigurationsClient", "Failover", result.Response(), "Failure sending request") + return + } + + return +} + +// FailoverPreparer prepares the Failover request. +func (client DisasterRecoveryConfigurationsClient) FailoverPreparer(ctx context.Context, resourceGroupName string, serverName string, disasterRecoveryConfigurationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "disasterRecoveryConfigurationName": autorest.Encode("path", disasterRecoveryConfigurationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2014-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/disasterRecoveryConfiguration/{disasterRecoveryConfigurationName}/failover", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// FailoverSender sends the Failover request. The method will close the +// http.Response Body if it receives an error. +func (client DisasterRecoveryConfigurationsClient) FailoverSender(req *http.Request) (future DisasterRecoveryConfigurationsFailoverFuture, 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 +} + +// FailoverResponder handles the response to the Failover request. The method always +// closes the http.Response Body. +func (client DisasterRecoveryConfigurationsClient) FailoverResponder(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 +} + +// FailoverAllowDataLoss fails over from the current primary server to this server. This operation might result in data +// loss. +// 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. +// disasterRecoveryConfigurationName - the name of the disaster recovery configuration to failover forcefully. +func (client DisasterRecoveryConfigurationsClient) FailoverAllowDataLoss(ctx context.Context, resourceGroupName string, serverName string, disasterRecoveryConfigurationName string) (result DisasterRecoveryConfigurationsFailoverAllowDataLossFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DisasterRecoveryConfigurationsClient.FailoverAllowDataLoss") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.FailoverAllowDataLossPreparer(ctx, resourceGroupName, serverName, disasterRecoveryConfigurationName) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DisasterRecoveryConfigurationsClient", "FailoverAllowDataLoss", nil, "Failure preparing request") + return + } + + result, err = client.FailoverAllowDataLossSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DisasterRecoveryConfigurationsClient", "FailoverAllowDataLoss", result.Response(), "Failure sending request") + return + } + + return +} + +// FailoverAllowDataLossPreparer prepares the FailoverAllowDataLoss request. +func (client DisasterRecoveryConfigurationsClient) FailoverAllowDataLossPreparer(ctx context.Context, resourceGroupName string, serverName string, disasterRecoveryConfigurationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "disasterRecoveryConfigurationName": autorest.Encode("path", disasterRecoveryConfigurationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2014-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/disasterRecoveryConfiguration/{disasterRecoveryConfigurationName}/forceFailoverAllowDataLoss", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// FailoverAllowDataLossSender sends the FailoverAllowDataLoss request. The method will close the +// http.Response Body if it receives an error. +func (client DisasterRecoveryConfigurationsClient) FailoverAllowDataLossSender(req *http.Request) (future DisasterRecoveryConfigurationsFailoverAllowDataLossFuture, 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 +} + +// FailoverAllowDataLossResponder handles the response to the FailoverAllowDataLoss request. The method always +// closes the http.Response Body. +func (client DisasterRecoveryConfigurationsClient) FailoverAllowDataLossResponder(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 disaster recovery configuration. +// 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. +// disasterRecoveryConfigurationName - the name of the disaster recovery configuration. +func (client DisasterRecoveryConfigurationsClient) Get(ctx context.Context, resourceGroupName string, serverName string, disasterRecoveryConfigurationName string) (result DisasterRecoveryConfiguration, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DisasterRecoveryConfigurationsClient.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, serverName, disasterRecoveryConfigurationName) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DisasterRecoveryConfigurationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.DisasterRecoveryConfigurationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DisasterRecoveryConfigurationsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client DisasterRecoveryConfigurationsClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, disasterRecoveryConfigurationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "disasterRecoveryConfigurationName": autorest.Encode("path", disasterRecoveryConfigurationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2014-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.Sql/servers/{serverName}/disasterRecoveryConfiguration/{disasterRecoveryConfigurationName}", 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 DisasterRecoveryConfigurationsClient) 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 DisasterRecoveryConfigurationsClient) GetResponder(resp *http.Response) (result DisasterRecoveryConfiguration, 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 a server's disaster recovery configuration. +// 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 DisasterRecoveryConfigurationsClient) List(ctx context.Context, resourceGroupName string, serverName string) (result DisasterRecoveryConfigurationListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DisasterRecoveryConfigurationsClient.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, serverName) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DisasterRecoveryConfigurationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.DisasterRecoveryConfigurationsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DisasterRecoveryConfigurationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client DisasterRecoveryConfigurationsClient) ListPreparer(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 = "2014-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.Sql/servers/{serverName}/disasterRecoveryConfiguration", 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 DisasterRecoveryConfigurationsClient) 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 DisasterRecoveryConfigurationsClient) ListResponder(resp *http.Response) (result DisasterRecoveryConfigurationListResult, 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/sql/mgmt/2014-04-01/sql/elasticpools.go b/services/sql/mgmt/2014-04-01/sql/elasticpools.go index ed5ee5d537eb..8b2ff84aad84 100644 --- a/services/sql/mgmt/2014-04-01/sql/elasticpools.go +++ b/services/sql/mgmt/2014-04-01/sql/elasticpools.go @@ -363,6 +363,168 @@ func (client ElasticPoolsClient) ListByServerResponder(resp *http.Response) (res return } +// ListMetricDefinitions returns elastic pool metric definitions. +// 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. +// elasticPoolName - the name of the elastic pool. +func (client ElasticPoolsClient) ListMetricDefinitions(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (result MetricDefinitionListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ElasticPoolsClient.ListMetricDefinitions") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListMetricDefinitionsPreparer(ctx, resourceGroupName, serverName, elasticPoolName) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ElasticPoolsClient", "ListMetricDefinitions", nil, "Failure preparing request") + return + } + + resp, err := client.ListMetricDefinitionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.ElasticPoolsClient", "ListMetricDefinitions", resp, "Failure sending request") + return + } + + result, err = client.ListMetricDefinitionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ElasticPoolsClient", "ListMetricDefinitions", resp, "Failure responding to request") + } + + return +} + +// ListMetricDefinitionsPreparer prepares the ListMetricDefinitions request. +func (client ElasticPoolsClient) ListMetricDefinitionsPreparer(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "elasticPoolName": autorest.Encode("path", elasticPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2014-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.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metricDefinitions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMetricDefinitionsSender sends the ListMetricDefinitions request. The method will close the +// http.Response Body if it receives an error. +func (client ElasticPoolsClient) ListMetricDefinitionsSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListMetricDefinitionsResponder handles the response to the ListMetricDefinitions request. The method always +// closes the http.Response Body. +func (client ElasticPoolsClient) ListMetricDefinitionsResponder(resp *http.Response) (result MetricDefinitionListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListMetrics returns elastic pool metrics. +// 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. +// elasticPoolName - the name of the elastic pool. +// filter - an OData filter expression that describes a subset of metrics to return. +func (client ElasticPoolsClient) ListMetrics(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, filter string) (result MetricListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ElasticPoolsClient.ListMetrics") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListMetricsPreparer(ctx, resourceGroupName, serverName, elasticPoolName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ElasticPoolsClient", "ListMetrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListMetricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.ElasticPoolsClient", "ListMetrics", resp, "Failure sending request") + return + } + + result, err = client.ListMetricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ElasticPoolsClient", "ListMetrics", resp, "Failure responding to request") + } + + return +} + +// ListMetricsPreparer prepares the ListMetrics request. +func (client ElasticPoolsClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "elasticPoolName": autorest.Encode("path", elasticPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2014-04-01" + queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metrics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMetricsSender sends the ListMetrics request. The method will close the +// http.Response Body if it receives an error. +func (client ElasticPoolsClient) ListMetricsSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListMetricsResponder handles the response to the ListMetrics request. The method always +// closes the http.Response Body. +func (client ElasticPoolsClient) ListMetricsResponder(resp *http.Response) (result MetricListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // Update updates an existing elastic pool. // Parameters: // resourceGroupName - the name of the resource group that contains the resource. You can obtain this value diff --git a/services/preview/sql/mgmt/2018-06-15-preview/sql/servicetieradvisors.go b/services/sql/mgmt/2014-04-01/sql/extensions.go similarity index 54% rename from services/preview/sql/mgmt/2018-06-15-preview/sql/servicetieradvisors.go rename to services/sql/mgmt/2014-04-01/sql/extensions.go index 8fc1f2d7ae8a..e240a3ccadf4 100644 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/servicetieradvisors.go +++ b/services/sql/mgmt/2014-04-01/sql/extensions.go @@ -25,70 +25,69 @@ import ( "net/http" ) -// ServiceTierAdvisorsClient is the the Azure SQL Database management API provides a RESTful set of web services that -// interact with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, -// and delete databases. -type ServiceTierAdvisorsClient struct { +// ExtensionsClient is the the Azure SQL Database management API provides a RESTful set of web services that interact +// with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, and +// delete databases. +type ExtensionsClient struct { BaseClient } -// NewServiceTierAdvisorsClient creates an instance of the ServiceTierAdvisorsClient client. -func NewServiceTierAdvisorsClient(subscriptionID string) ServiceTierAdvisorsClient { - return NewServiceTierAdvisorsClientWithBaseURI(DefaultBaseURI, subscriptionID) +// NewExtensionsClient creates an instance of the ExtensionsClient client. +func NewExtensionsClient(subscriptionID string) ExtensionsClient { + return NewExtensionsClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewServiceTierAdvisorsClientWithBaseURI creates an instance of the ServiceTierAdvisorsClient client. -func NewServiceTierAdvisorsClientWithBaseURI(baseURI string, subscriptionID string) ServiceTierAdvisorsClient { - return ServiceTierAdvisorsClient{NewWithBaseURI(baseURI, subscriptionID)} +// NewExtensionsClientWithBaseURI creates an instance of the ExtensionsClient client. +func NewExtensionsClientWithBaseURI(baseURI string, subscriptionID string) ExtensionsClient { + return ExtensionsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// Get gets a service tier advisor. +// Get gets a database extension. This API is deprecated and should not be used. // 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 database. -// serviceTierAdvisorName - the name of service tier advisor. -func (client ServiceTierAdvisorsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, serviceTierAdvisorName string) (result ServiceTierAdvisor, err error) { +// databaseName - the name of the database to import into +func (client ExtensionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceTierAdvisorsClient.Get") + ctx = tracing.StartSpan(ctx, fqdn+"/ExtensionsClient.Get") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.Response != nil { + sc = result.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } - req, err := client.GetPreparer(ctx, resourceGroupName, serverName, databaseName, serviceTierAdvisorName) + req, err := client.GetPreparer(ctx, resourceGroupName, serverName, databaseName) if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServiceTierAdvisorsClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "sql.ExtensionsClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ServiceTierAdvisorsClient", "Get", resp, "Failure sending request") + result.Response = resp + err = autorest.NewErrorWithError(err, "sql.ExtensionsClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServiceTierAdvisorsClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "sql.ExtensionsClient", "Get", resp, "Failure responding to request") } return } // GetPreparer prepares the Get request. -func (client ServiceTierAdvisorsClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, serviceTierAdvisorName string) (*http.Request, error) { +func (client ExtensionsClient) GetPreparer(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), - "serviceTierAdvisorName": autorest.Encode("path", serviceTierAdvisorName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "databaseName": autorest.Encode("path", databaseName), + "extensionName": autorest.Encode("path", "import"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2014-04-01" @@ -99,40 +98,39 @@ func (client ServiceTierAdvisorsClient) GetPreparer(ctx context.Context, resourc preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/serviceTierAdvisors/{serviceTierAdvisorName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}", 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 ServiceTierAdvisorsClient) GetSender(req *http.Request) (*http.Response, error) { +func (client ExtensionsClient) 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 ServiceTierAdvisorsClient) GetResponder(resp *http.Response) (result ServiceTierAdvisor, err error) { +func (client ExtensionsClient) GetResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} + result.Response = resp return } -// ListByDatabase returns service tier advisors for specified database. +// ListByDatabase gets database extensions. This API is deprecated and should not be used. // 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 database. -func (client ServiceTierAdvisorsClient) ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result ServiceTierAdvisorListResult, err error) { +// databaseName - the name of the database to import into +func (client ExtensionsClient) ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result ExtensionListResult, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceTierAdvisorsClient.ListByDatabase") + ctx = tracing.StartSpan(ctx, fqdn+"/ExtensionsClient.ListByDatabase") defer func() { sc := -1 if result.Response.Response != nil { @@ -143,27 +141,27 @@ func (client ServiceTierAdvisorsClient) ListByDatabase(ctx context.Context, reso } req, err := client.ListByDatabasePreparer(ctx, resourceGroupName, serverName, databaseName) if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServiceTierAdvisorsClient", "ListByDatabase", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "sql.ExtensionsClient", "ListByDatabase", nil, "Failure preparing request") return } resp, err := client.ListByDatabaseSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ServiceTierAdvisorsClient", "ListByDatabase", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "sql.ExtensionsClient", "ListByDatabase", resp, "Failure sending request") return } result, err = client.ListByDatabaseResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServiceTierAdvisorsClient", "ListByDatabase", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "sql.ExtensionsClient", "ListByDatabase", resp, "Failure responding to request") } return } // ListByDatabasePreparer prepares the ListByDatabase request. -func (client ServiceTierAdvisorsClient) ListByDatabasePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (*http.Request, error) { +func (client ExtensionsClient) 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), @@ -179,21 +177,21 @@ func (client ServiceTierAdvisorsClient) ListByDatabasePreparer(ctx context.Conte preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/serviceTierAdvisors", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions", 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 ServiceTierAdvisorsClient) ListByDatabaseSender(req *http.Request) (*http.Response, error) { +func (client ExtensionsClient) 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 ServiceTierAdvisorsClient) ListByDatabaseResponder(resp *http.Response) (result ServiceTierAdvisorListResult, err error) { +func (client ExtensionsClient) ListByDatabaseResponder(resp *http.Response) (result ExtensionListResult, err error) { err = autorest.Respond( resp, client.ByInspecting(), diff --git a/services/preview/sql/mgmt/2018-06-15-preview/sql/geobackuppolicies.go b/services/sql/mgmt/2014-04-01/sql/geobackuppolicies.go similarity index 100% rename from services/preview/sql/mgmt/2018-06-15-preview/sql/geobackuppolicies.go rename to services/sql/mgmt/2014-04-01/sql/geobackuppolicies.go diff --git a/services/sql/mgmt/2014-04-01/sql/models.go b/services/sql/mgmt/2014-04-01/sql/models.go index 7a19e59246e4..c98749074733 100644 --- a/services/sql/mgmt/2014-04-01/sql/models.go +++ b/services/sql/mgmt/2014-04-01/sql/models.go @@ -30,6 +30,25 @@ import ( // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2014-04-01/sql" +// AdvisorStatus enumerates the values for advisor status. +type AdvisorStatus string + +const ( + // GA ... + GA AdvisorStatus = "GA" + // LimitedPublicPreview ... + LimitedPublicPreview AdvisorStatus = "LimitedPublicPreview" + // PrivatePreview ... + PrivatePreview AdvisorStatus = "PrivatePreview" + // PublicPreview ... + PublicPreview AdvisorStatus = "PublicPreview" +) + +// PossibleAdvisorStatusValues returns an array of possible values for the AdvisorStatus const type. +func PossibleAdvisorStatusValues() []AdvisorStatus { + return []AdvisorStatus{GA, LimitedPublicPreview, PrivatePreview, PublicPreview} +} + // AuthenticationType enumerates the values for authentication type. type AuthenticationType string @@ -45,6 +64,57 @@ func PossibleAuthenticationTypeValues() []AuthenticationType { return []AuthenticationType{ADPassword, SQL} } +// AutoExecuteStatus enumerates the values for auto execute status. +type AutoExecuteStatus string + +const ( + // Default ... + Default AutoExecuteStatus = "Default" + // Disabled ... + Disabled AutoExecuteStatus = "Disabled" + // Enabled ... + Enabled AutoExecuteStatus = "Enabled" +) + +// PossibleAutoExecuteStatusValues returns an array of possible values for the AutoExecuteStatus const type. +func PossibleAutoExecuteStatusValues() []AutoExecuteStatus { + return []AutoExecuteStatus{Default, Disabled, Enabled} +} + +// BackupLongTermRetentionPolicyState enumerates the values for backup long term retention policy state. +type BackupLongTermRetentionPolicyState string + +const ( + // BackupLongTermRetentionPolicyStateDisabled ... + BackupLongTermRetentionPolicyStateDisabled BackupLongTermRetentionPolicyState = "Disabled" + // BackupLongTermRetentionPolicyStateEnabled ... + BackupLongTermRetentionPolicyStateEnabled BackupLongTermRetentionPolicyState = "Enabled" +) + +// PossibleBackupLongTermRetentionPolicyStateValues returns an array of possible values for the BackupLongTermRetentionPolicyState const type. +func PossibleBackupLongTermRetentionPolicyStateValues() []BackupLongTermRetentionPolicyState { + return []BackupLongTermRetentionPolicyState{BackupLongTermRetentionPolicyStateDisabled, BackupLongTermRetentionPolicyStateEnabled} +} + +// CapabilityStatus enumerates the values for capability status. +type CapabilityStatus string + +const ( + // CapabilityStatusAvailable ... + CapabilityStatusAvailable CapabilityStatus = "Available" + // CapabilityStatusDefault ... + CapabilityStatusDefault CapabilityStatus = "Default" + // CapabilityStatusDisabled ... + CapabilityStatusDisabled CapabilityStatus = "Disabled" + // CapabilityStatusVisible ... + CapabilityStatusVisible CapabilityStatus = "Visible" +) + +// PossibleCapabilityStatusValues returns an array of possible values for the CapabilityStatus const type. +func PossibleCapabilityStatusValues() []CapabilityStatus { + return []CapabilityStatus{CapabilityStatusAvailable, CapabilityStatusDefault, CapabilityStatusDisabled, CapabilityStatusVisible} +} + // CheckNameAvailabilityReason enumerates the values for check name availability reason. type CheckNameAvailabilityReason string @@ -64,27 +134,27 @@ func PossibleCheckNameAvailabilityReasonValues() []CheckNameAvailabilityReason { type CreateMode string const ( - // Copy ... - Copy CreateMode = "Copy" - // Default ... - Default CreateMode = "Default" - // NonReadableSecondary ... - NonReadableSecondary CreateMode = "NonReadableSecondary" - // OnlineSecondary ... - OnlineSecondary CreateMode = "OnlineSecondary" - // PointInTimeRestore ... - PointInTimeRestore CreateMode = "PointInTimeRestore" - // Recovery ... - Recovery CreateMode = "Recovery" - // Restore ... - Restore CreateMode = "Restore" - // RestoreLongTermRetentionBackup ... - RestoreLongTermRetentionBackup CreateMode = "RestoreLongTermRetentionBackup" + // CreateModeCopy ... + CreateModeCopy CreateMode = "Copy" + // CreateModeDefault ... + CreateModeDefault CreateMode = "Default" + // CreateModeNonReadableSecondary ... + CreateModeNonReadableSecondary CreateMode = "NonReadableSecondary" + // CreateModeOnlineSecondary ... + CreateModeOnlineSecondary CreateMode = "OnlineSecondary" + // CreateModePointInTimeRestore ... + CreateModePointInTimeRestore CreateMode = "PointInTimeRestore" + // CreateModeRecovery ... + CreateModeRecovery CreateMode = "Recovery" + // CreateModeRestore ... + CreateModeRestore CreateMode = "Restore" + // CreateModeRestoreLongTermRetentionBackup ... + CreateModeRestoreLongTermRetentionBackup CreateMode = "RestoreLongTermRetentionBackup" ) // PossibleCreateModeValues returns an array of possible values for the CreateMode const type. func PossibleCreateModeValues() []CreateMode { - return []CreateMode{Copy, Default, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, Restore, RestoreLongTermRetentionBackup} + return []CreateMode{CreateModeCopy, CreateModeDefault, CreateModeNonReadableSecondary, CreateModeOnlineSecondary, CreateModePointInTimeRestore, CreateModeRecovery, CreateModeRestore, CreateModeRestoreLongTermRetentionBackup} } // DatabaseEdition enumerates the values for database edition. @@ -126,6 +196,127 @@ func PossibleDatabaseEditionValues() []DatabaseEdition { return []DatabaseEdition{Basic, Business, BusinessCritical, DataWarehouse, Free, GeneralPurpose, Hyperscale, Premium, PremiumRS, Standard, Stretch, System, System2, Web} } +// DataMaskingFunction enumerates the values for data masking function. +type DataMaskingFunction string + +const ( + // DataMaskingFunctionCCN ... + DataMaskingFunctionCCN DataMaskingFunction = "CCN" + // DataMaskingFunctionDefault ... + DataMaskingFunctionDefault DataMaskingFunction = "Default" + // DataMaskingFunctionEmail ... + DataMaskingFunctionEmail DataMaskingFunction = "Email" + // DataMaskingFunctionNumber ... + DataMaskingFunctionNumber DataMaskingFunction = "Number" + // DataMaskingFunctionSSN ... + DataMaskingFunctionSSN DataMaskingFunction = "SSN" + // DataMaskingFunctionText ... + DataMaskingFunctionText DataMaskingFunction = "Text" +) + +// PossibleDataMaskingFunctionValues returns an array of possible values for the DataMaskingFunction const type. +func PossibleDataMaskingFunctionValues() []DataMaskingFunction { + return []DataMaskingFunction{DataMaskingFunctionCCN, DataMaskingFunctionDefault, DataMaskingFunctionEmail, DataMaskingFunctionNumber, DataMaskingFunctionSSN, DataMaskingFunctionText} +} + +// DataMaskingRuleState enumerates the values for data masking rule state. +type DataMaskingRuleState string + +const ( + // DataMaskingRuleStateDisabled ... + DataMaskingRuleStateDisabled DataMaskingRuleState = "Disabled" + // DataMaskingRuleStateEnabled ... + DataMaskingRuleStateEnabled DataMaskingRuleState = "Enabled" +) + +// PossibleDataMaskingRuleStateValues returns an array of possible values for the DataMaskingRuleState const type. +func PossibleDataMaskingRuleStateValues() []DataMaskingRuleState { + return []DataMaskingRuleState{DataMaskingRuleStateDisabled, DataMaskingRuleStateEnabled} +} + +// DataMaskingState enumerates the values for data masking state. +type DataMaskingState string + +const ( + // DataMaskingStateDisabled ... + DataMaskingStateDisabled DataMaskingState = "Disabled" + // DataMaskingStateEnabled ... + DataMaskingStateEnabled DataMaskingState = "Enabled" +) + +// PossibleDataMaskingStateValues returns an array of possible values for the DataMaskingState const type. +func PossibleDataMaskingStateValues() []DataMaskingState { + return []DataMaskingState{DataMaskingStateDisabled, DataMaskingStateEnabled} +} + +// DisasterRecoveryConfigurationAutoFailover enumerates the values for disaster recovery configuration auto +// failover. +type DisasterRecoveryConfigurationAutoFailover string + +const ( + // Off ... + Off DisasterRecoveryConfigurationAutoFailover = "Off" + // On ... + On DisasterRecoveryConfigurationAutoFailover = "On" +) + +// PossibleDisasterRecoveryConfigurationAutoFailoverValues returns an array of possible values for the DisasterRecoveryConfigurationAutoFailover const type. +func PossibleDisasterRecoveryConfigurationAutoFailoverValues() []DisasterRecoveryConfigurationAutoFailover { + return []DisasterRecoveryConfigurationAutoFailover{Off, On} +} + +// DisasterRecoveryConfigurationFailoverPolicy enumerates the values for disaster recovery configuration +// failover policy. +type DisasterRecoveryConfigurationFailoverPolicy string + +const ( + // Automatic ... + Automatic DisasterRecoveryConfigurationFailoverPolicy = "Automatic" + // Manual ... + Manual DisasterRecoveryConfigurationFailoverPolicy = "Manual" +) + +// PossibleDisasterRecoveryConfigurationFailoverPolicyValues returns an array of possible values for the DisasterRecoveryConfigurationFailoverPolicy const type. +func PossibleDisasterRecoveryConfigurationFailoverPolicyValues() []DisasterRecoveryConfigurationFailoverPolicy { + return []DisasterRecoveryConfigurationFailoverPolicy{Automatic, Manual} +} + +// DisasterRecoveryConfigurationRole enumerates the values for disaster recovery configuration role. +type DisasterRecoveryConfigurationRole string + +const ( + // None ... + None DisasterRecoveryConfigurationRole = "None" + // Primary ... + Primary DisasterRecoveryConfigurationRole = "Primary" + // Secondary ... + Secondary DisasterRecoveryConfigurationRole = "Secondary" +) + +// PossibleDisasterRecoveryConfigurationRoleValues returns an array of possible values for the DisasterRecoveryConfigurationRole const type. +func PossibleDisasterRecoveryConfigurationRoleValues() []DisasterRecoveryConfigurationRole { + return []DisasterRecoveryConfigurationRole{None, Primary, Secondary} +} + +// DisasterRecoveryConfigurationStatus enumerates the values for disaster recovery configuration status. +type DisasterRecoveryConfigurationStatus string + +const ( + // Creating ... + Creating DisasterRecoveryConfigurationStatus = "Creating" + // Dropping ... + Dropping DisasterRecoveryConfigurationStatus = "Dropping" + // FailingOver ... + FailingOver DisasterRecoveryConfigurationStatus = "FailingOver" + // Ready ... + Ready DisasterRecoveryConfigurationStatus = "Ready" +) + +// PossibleDisasterRecoveryConfigurationStatusValues returns an array of possible values for the DisasterRecoveryConfigurationStatus const type. +func PossibleDisasterRecoveryConfigurationStatusValues() []DisasterRecoveryConfigurationStatus { + return []DisasterRecoveryConfigurationStatus{Creating, Dropping, FailingOver, Ready} +} + // ElasticPoolEdition enumerates the values for elastic pool edition. type ElasticPoolEdition string @@ -151,17 +342,165 @@ func PossibleElasticPoolEditionValues() []ElasticPoolEdition { type ElasticPoolState string const ( - // Creating ... - Creating ElasticPoolState = "Creating" - // Disabled ... - Disabled ElasticPoolState = "Disabled" - // Ready ... - Ready ElasticPoolState = "Ready" + // ElasticPoolStateCreating ... + ElasticPoolStateCreating ElasticPoolState = "Creating" + // ElasticPoolStateDisabled ... + ElasticPoolStateDisabled ElasticPoolState = "Disabled" + // ElasticPoolStateReady ... + ElasticPoolStateReady ElasticPoolState = "Ready" ) // PossibleElasticPoolStateValues returns an array of possible values for the ElasticPoolState const type. func PossibleElasticPoolStateValues() []ElasticPoolState { - return []ElasticPoolState{Creating, Disabled, Ready} + return []ElasticPoolState{ElasticPoolStateCreating, ElasticPoolStateDisabled, ElasticPoolStateReady} +} + +// GeoBackupPolicyState enumerates the values for geo backup policy state. +type GeoBackupPolicyState string + +const ( + // GeoBackupPolicyStateDisabled ... + GeoBackupPolicyStateDisabled GeoBackupPolicyState = "Disabled" + // GeoBackupPolicyStateEnabled ... + GeoBackupPolicyStateEnabled GeoBackupPolicyState = "Enabled" +) + +// PossibleGeoBackupPolicyStateValues returns an array of possible values for the GeoBackupPolicyState const type. +func PossibleGeoBackupPolicyStateValues() []GeoBackupPolicyState { + return []GeoBackupPolicyState{GeoBackupPolicyStateDisabled, GeoBackupPolicyStateEnabled} +} + +// MaxSizeUnits enumerates the values for max size units. +type MaxSizeUnits string + +const ( + // Gigabytes ... + Gigabytes MaxSizeUnits = "Gigabytes" + // Megabytes ... + Megabytes MaxSizeUnits = "Megabytes" + // Petabytes ... + Petabytes MaxSizeUnits = "Petabytes" + // Terabytes ... + Terabytes MaxSizeUnits = "Terabytes" +) + +// PossibleMaxSizeUnitsValues returns an array of possible values for the MaxSizeUnits const type. +func PossibleMaxSizeUnitsValues() []MaxSizeUnits { + return []MaxSizeUnits{Gigabytes, Megabytes, Petabytes, Terabytes} +} + +// PerformanceLevelUnit enumerates the values for performance level unit. +type PerformanceLevelUnit string + +const ( + // DTU ... + DTU PerformanceLevelUnit = "DTU" +) + +// PossiblePerformanceLevelUnitValues returns an array of possible values for the PerformanceLevelUnit const type. +func PossiblePerformanceLevelUnitValues() []PerformanceLevelUnit { + return []PerformanceLevelUnit{DTU} +} + +// PrimaryAggregationType enumerates the values for primary aggregation type. +type PrimaryAggregationType string + +const ( + // PrimaryAggregationTypeAverage ... + PrimaryAggregationTypeAverage PrimaryAggregationType = "Average" + // PrimaryAggregationTypeCount ... + PrimaryAggregationTypeCount PrimaryAggregationType = "Count" + // PrimaryAggregationTypeMaximum ... + PrimaryAggregationTypeMaximum PrimaryAggregationType = "Maximum" + // PrimaryAggregationTypeMinimum ... + PrimaryAggregationTypeMinimum PrimaryAggregationType = "Minimum" + // PrimaryAggregationTypeNone ... + PrimaryAggregationTypeNone PrimaryAggregationType = "None" + // PrimaryAggregationTypeTotal ... + PrimaryAggregationTypeTotal PrimaryAggregationType = "Total" +) + +// PossiblePrimaryAggregationTypeValues returns an array of possible values for the PrimaryAggregationType const type. +func PossiblePrimaryAggregationTypeValues() []PrimaryAggregationType { + return []PrimaryAggregationType{PrimaryAggregationTypeAverage, PrimaryAggregationTypeCount, PrimaryAggregationTypeMaximum, PrimaryAggregationTypeMinimum, PrimaryAggregationTypeNone, PrimaryAggregationTypeTotal} +} + +// QueryAggregationFunction enumerates the values for query aggregation function. +type QueryAggregationFunction string + +const ( + // Avg ... + Avg QueryAggregationFunction = "avg" + // Max ... + Max QueryAggregationFunction = "max" + // Min ... + Min QueryAggregationFunction = "min" + // Sum ... + Sum QueryAggregationFunction = "sum" +) + +// PossibleQueryAggregationFunctionValues returns an array of possible values for the QueryAggregationFunction const type. +func PossibleQueryAggregationFunctionValues() []QueryAggregationFunction { + return []QueryAggregationFunction{Avg, Max, Min, Sum} +} + +// QueryExecutionType enumerates the values for query execution type. +type QueryExecutionType string + +const ( + // Aborted ... + Aborted QueryExecutionType = "aborted" + // Any ... + Any QueryExecutionType = "any" + // Exception ... + Exception QueryExecutionType = "exception" + // Irregular ... + Irregular QueryExecutionType = "irregular" + // Regular ... + Regular QueryExecutionType = "regular" +) + +// PossibleQueryExecutionTypeValues returns an array of possible values for the QueryExecutionType const type. +func PossibleQueryExecutionTypeValues() []QueryExecutionType { + return []QueryExecutionType{Aborted, Any, Exception, Irregular, Regular} +} + +// QueryMetricUnit enumerates the values for query metric unit. +type QueryMetricUnit string + +const ( + // KB ... + KB QueryMetricUnit = "KB" + // Microseconds ... + Microseconds QueryMetricUnit = "microseconds" + // Percentage ... + Percentage QueryMetricUnit = "percentage" +) + +// PossibleQueryMetricUnitValues returns an array of possible values for the QueryMetricUnit const type. +func PossibleQueryMetricUnitValues() []QueryMetricUnit { + return []QueryMetricUnit{KB, Microseconds, Percentage} +} + +// QueryObservedMetricType enumerates the values for query observed metric type. +type QueryObservedMetricType string + +const ( + // CPU ... + CPU QueryObservedMetricType = "cpu" + // Duration ... + Duration QueryObservedMetricType = "duration" + // ExecutionCount ... + ExecutionCount QueryObservedMetricType = "executionCount" + // Io ... + Io QueryObservedMetricType = "io" + // Logio ... + Logio QueryObservedMetricType = "logio" +) + +// PossibleQueryObservedMetricTypeValues returns an array of possible values for the QueryObservedMetricType const type. +func PossibleQueryObservedMetricTypeValues() []QueryObservedMetricType { + return []QueryObservedMetricType{CPU, Duration, ExecutionCount, Io, Logio} } // ReadScale enumerates the values for read scale. @@ -288,6 +627,21 @@ func PossibleReplicationStateValues() []ReplicationState { return []ReplicationState{CATCHUP, PENDING, SEEDING, SUSPENDED} } +// RestorePointType enumerates the values for restore point type. +type RestorePointType string + +const ( + // CONTINUOUS ... + CONTINUOUS RestorePointType = "CONTINUOUS" + // DISCRETE ... + DISCRETE RestorePointType = "DISCRETE" +) + +// PossibleRestorePointTypeValues returns an array of possible values for the RestorePointType const type. +func PossibleRestorePointTypeValues() []RestorePointType { + return []RestorePointType{CONTINUOUS, DISCRETE} +} + // SampleName enumerates the values for sample name. type SampleName string @@ -348,6 +702,53 @@ func PossibleSecurityAlertPolicyUseServerDefaultValues() []SecurityAlertPolicyUs return []SecurityAlertPolicyUseServerDefault{SecurityAlertPolicyUseServerDefaultDisabled, SecurityAlertPolicyUseServerDefaultEnabled} } +// ServerConnectionType enumerates the values for server connection type. +type ServerConnectionType string + +const ( + // ServerConnectionTypeDefault ... + ServerConnectionTypeDefault ServerConnectionType = "Default" + // ServerConnectionTypeProxy ... + ServerConnectionTypeProxy ServerConnectionType = "Proxy" + // ServerConnectionTypeRedirect ... + ServerConnectionTypeRedirect ServerConnectionType = "Redirect" +) + +// PossibleServerConnectionTypeValues returns an array of possible values for the ServerConnectionType const type. +func PossibleServerConnectionTypeValues() []ServerConnectionType { + return []ServerConnectionType{ServerConnectionTypeDefault, ServerConnectionTypeProxy, ServerConnectionTypeRedirect} +} + +// ServerState enumerates the values for server state. +type ServerState string + +const ( + // ServerStateDisabled ... + ServerStateDisabled ServerState = "Disabled" + // ServerStateReady ... + ServerStateReady ServerState = "Ready" +) + +// PossibleServerStateValues returns an array of possible values for the ServerState const type. +func PossibleServerStateValues() []ServerState { + return []ServerState{ServerStateDisabled, ServerStateReady} +} + +// ServerVersion enumerates the values for server version. +type ServerVersion string + +const ( + // OneTwoFullStopZero ... + OneTwoFullStopZero ServerVersion = "12.0" + // TwoFullStopZero ... + TwoFullStopZero ServerVersion = "2.0" +) + +// PossibleServerVersionValues returns an array of possible values for the ServerVersion const type. +func PossibleServerVersionValues() []ServerVersion { + return []ServerVersion{OneTwoFullStopZero, TwoFullStopZero} +} + // ServiceObjectiveName enumerates the values for service objective name. type ServiceObjectiveName string @@ -535,39 +936,61 @@ func PossibleTransparentDataEncryptionStatusValues() []TransparentDataEncryption return []TransparentDataEncryptionStatus{TransparentDataEncryptionStatusDisabled, TransparentDataEncryptionStatusEnabled} } -// CheckNameAvailabilityRequest a request to check whether the specified name for a resource is available. -type CheckNameAvailabilityRequest struct { - // Name - The name whose availability is to be checked. - Name *string `json:"name,omitempty"` - // Type - The type of resource that is used as the scope of the availability check. - Type *string `json:"type,omitempty"` +// UnitDefinitionType enumerates the values for unit definition type. +type UnitDefinitionType string + +const ( + // Bytes ... + Bytes UnitDefinitionType = "Bytes" + // BytesPerSecond ... + BytesPerSecond UnitDefinitionType = "BytesPerSecond" + // Count ... + Count UnitDefinitionType = "Count" + // CountPerSecond ... + CountPerSecond UnitDefinitionType = "CountPerSecond" + // Percent ... + Percent UnitDefinitionType = "Percent" + // Seconds ... + Seconds UnitDefinitionType = "Seconds" +) + +// PossibleUnitDefinitionTypeValues returns an array of possible values for the UnitDefinitionType const type. +func PossibleUnitDefinitionTypeValues() []UnitDefinitionType { + return []UnitDefinitionType{Bytes, BytesPerSecond, Count, CountPerSecond, Percent, Seconds} } -// CheckNameAvailabilityResponse a response indicating whether the specified name for a resource is -// available. -type CheckNameAvailabilityResponse struct { - autorest.Response `json:"-"` - // Available - READ-ONLY; True if the name is available, otherwise false. - Available *bool `json:"available,omitempty"` - // Message - READ-ONLY; A message explaining why the name is unavailable. Will be null if the name is available. - Message *string `json:"message,omitempty"` - // Name - READ-ONLY; The name whose availability was checked. - Name *string `json:"name,omitempty"` - // Reason - READ-ONLY; The reason code explaining why the name is unavailable. Will be null if the name is available. Possible values include: 'Invalid', 'AlreadyExists' - Reason CheckNameAvailabilityReason `json:"reason,omitempty"` +// UnitType enumerates the values for unit type. +type UnitType string + +const ( + // UnitTypeBytes ... + UnitTypeBytes UnitType = "bytes" + // UnitTypeBytesPerSecond ... + UnitTypeBytesPerSecond UnitType = "bytesPerSecond" + // UnitTypeCount ... + UnitTypeCount UnitType = "count" + // UnitTypeCountPerSecond ... + UnitTypeCountPerSecond UnitType = "countPerSecond" + // UnitTypePercent ... + UnitTypePercent UnitType = "percent" + // UnitTypeSeconds ... + UnitTypeSeconds UnitType = "seconds" +) + +// PossibleUnitTypeValues returns an array of possible values for the UnitType const type. +func PossibleUnitTypeValues() []UnitType { + return []UnitType{UnitTypeBytes, UnitTypeBytesPerSecond, UnitTypeCount, UnitTypeCountPerSecond, UnitTypePercent, UnitTypeSeconds} } -// Database represents a database. -type Database struct { +// Advisor database Advisor. +type Advisor struct { autorest.Response `json:"-"` - // Kind - READ-ONLY; Kind of database. This is metadata used for the Azure portal experience. + // Kind - READ-ONLY; Resource kind. Kind *string `json:"kind,omitempty"` - // DatabaseProperties - The properties representing the resource. - *DatabaseProperties `json:"properties,omitempty"` - // Location - Resource location. + // Location - READ-ONLY; Resource location. Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` + // AdvisorProperties - Resource properties. + *AdvisorProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -576,23 +999,17 @@ type Database struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for Database. -func (d Database) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for Advisor. +func (a Advisor) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if d.DatabaseProperties != nil { - objectMap["properties"] = d.DatabaseProperties - } - if d.Location != nil { - objectMap["location"] = d.Location - } - if d.Tags != nil { - objectMap["tags"] = d.Tags + if a.AdvisorProperties != nil { + objectMap["properties"] = a.AdvisorProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for Database struct. -func (d *Database) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for Advisor struct. +func (a *Advisor) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -607,16 +1024,7 @@ func (d *Database) UnmarshalJSON(body []byte) error { if err != nil { return err } - d.Kind = &kind - } - case "properties": - if v != nil { - var databaseProperties DatabaseProperties - err = json.Unmarshal(*v, &databaseProperties) - if err != nil { - return err - } - d.DatabaseProperties = &databaseProperties + a.Kind = &kind } case "location": if v != nil { @@ -625,16 +1033,16 @@ func (d *Database) UnmarshalJSON(body []byte) error { if err != nil { return err } - d.Location = &location + a.Location = &location } - case "tags": + case "properties": if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) + var advisorProperties AdvisorProperties + err = json.Unmarshal(*v, &advisorProperties) if err != nil { return err } - d.Tags = tags + a.AdvisorProperties = &advisorProperties } case "id": if v != nil { @@ -643,7 +1051,7 @@ func (d *Database) UnmarshalJSON(body []byte) error { if err != nil { return err } - d.ID = &ID + a.ID = &ID } case "name": if v != nil { @@ -652,7 +1060,7 @@ func (d *Database) UnmarshalJSON(body []byte) error { if err != nil { return err } - d.Name = &name + a.Name = &name } case "type": if v != nil { @@ -661,7 +1069,7 @@ func (d *Database) UnmarshalJSON(body []byte) error { if err != nil { return err } - d.Type = &typeVar + a.Type = &typeVar } } } @@ -669,168 +1077,161 @@ func (d *Database) UnmarshalJSON(body []byte) error { return nil } -// DatabaseListResult represents the response to a list database request. -type DatabaseListResult struct { +// AdvisorListResult represents the response to a list advisors request. +type AdvisorListResult struct { autorest.Response `json:"-"` - // Value - The list of databases housed in the server. - Value *[]Database `json:"value,omitempty"` + // Value - The list of advisors. + Value *[]Advisor `json:"value,omitempty"` } -// DatabaseProperties represents the properties of a database. -type DatabaseProperties struct { - // Collation - The collation of the database. If createMode is not Default, this value is ignored. - Collation *string `json:"collation,omitempty"` - // CreationDate - READ-ONLY; The creation date of the database (ISO8601 format). - CreationDate *date.Time `json:"creationDate,omitempty"` - // ContainmentState - READ-ONLY; The containment state of the database. - ContainmentState *int64 `json:"containmentState,omitempty"` - // CurrentServiceObjectiveID - READ-ONLY; The current service level objective ID of the database. This is the ID of the service level objective that is currently active. - CurrentServiceObjectiveID *uuid.UUID `json:"currentServiceObjectiveId,omitempty"` - // DatabaseID - READ-ONLY; The ID of the database. - DatabaseID *uuid.UUID `json:"databaseId,omitempty"` - // EarliestRestoreDate - READ-ONLY; This records the earliest start date and time that restore is available for this database (ISO8601 format). - EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"` - // CreateMode - Specifies the mode of database creation. - // Default: regular database creation. - // Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified as the resource ID of the source database. - // OnlineSecondary/NonReadableSecondary: creates a database as a (readable or nonreadable) secondary replica of an existing database. sourceDatabaseId must be specified as the resource ID of the existing primary database. - // PointInTimeRestore: Creates a database by restoring a point in time backup of an existing database. sourceDatabaseId must be specified as the resource ID of the existing database, and restorePointInTime must be specified. - // Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be specified as the recoverable database resource ID to restore. - // Restore: Creates a database by restoring a backup of a deleted database. sourceDatabaseId must be specified. If sourceDatabaseId is the database's original resource ID, then sourceDatabaseDeletionDate must be specified. Otherwise sourceDatabaseId must be the restorable dropped database resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be specified to restore from an earlier point in time. - // RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention vault. recoveryServicesRecoveryPointResourceId must be specified as the recovery point resource ID. - // Copy, NonReadableSecondary, OnlineSecondary and RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. Possible values include: 'Copy', 'Default', 'NonReadableSecondary', 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', 'RestoreLongTermRetentionBackup' - CreateMode CreateMode `json:"createMode,omitempty"` - // SourceDatabaseID - Conditional. If createMode is Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, or Restore, then this value is required. Specifies the resource ID of the source database. If createMode is NonReadableSecondary or OnlineSecondary, the name of the source database must be the same as the new database being created. - SourceDatabaseID *string `json:"sourceDatabaseId,omitempty"` - // SourceDatabaseDeletionDate - Conditional. If createMode is Restore and sourceDatabaseId is the deleted database's original resource id when it existed (as opposed to its current restorable dropped database id), then this value is required. Specifies the time that the database was deleted. - SourceDatabaseDeletionDate *date.Time `json:"sourceDatabaseDeletionDate,omitempty"` - // RestorePointInTime - Conditional. If createMode is PointInTimeRestore, this value is required. If createMode is Restore, this value is optional. Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. Must be greater than or equal to the source database's earliestRestoreDate value. - RestorePointInTime *date.Time `json:"restorePointInTime,omitempty"` - // RecoveryServicesRecoveryPointResourceID - Conditional. If createMode is RestoreLongTermRetentionBackup, then this value is required. Specifies the resource ID of the recovery point to restore from. - RecoveryServicesRecoveryPointResourceID *string `json:"recoveryServicesRecoveryPointResourceId,omitempty"` - // Edition - The edition of the database. The DatabaseEditions enumeration contains all the valid editions. If createMode is NonReadableSecondary or OnlineSecondary, this value is ignored. - // - // The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API or one of the following commands: - // - // ```azurecli - // az sql db list-editions -l -o table - // ```` - // - // ```powershell - // Get-AzSqlServerServiceObjective -Location - // ```` - // . Possible values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2', 'GeneralPurpose', 'BusinessCritical', 'Hyperscale' - Edition DatabaseEdition `json:"edition,omitempty"` - // MaxSizeBytes - The max size of the database expressed in bytes. If createMode is not Default, this value is ignored. To see possible values, query the capabilities API (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) referred to by operationId: "Capabilities_ListByLocation." - MaxSizeBytes *string `json:"maxSizeBytes,omitempty"` - // RequestedServiceObjectiveID - The configured service level objective ID of the database. This is the service level objective that is in the process of being applied to the database. Once successfully updated, it will match the value of currentServiceObjectiveId property. If requestedServiceObjectiveId and requestedServiceObjectiveName are both updated, the value of requestedServiceObjectiveId overrides the value of requestedServiceObjectiveName. - // - // The list of SKUs may vary by region and support offer. To determine the service objective ids that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API. - RequestedServiceObjectiveID *uuid.UUID `json:"requestedServiceObjectiveId,omitempty"` - // RequestedServiceObjectiveName - The name of the configured service level objective of the database. This is the service level objective that is in the process of being applied to the database. Once successfully updated, it will match the value of serviceLevelObjective property. - // - // The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API or one of the following commands: - // - // ```azurecli - // az sql db list-editions -l -o table - // ```` - // - // ```powershell - // Get-AzSqlServerServiceObjective -Location - // ```` - // . Possible values include: 'ServiceObjectiveNameSystem', 'ServiceObjectiveNameSystem0', 'ServiceObjectiveNameSystem1', 'ServiceObjectiveNameSystem2', 'ServiceObjectiveNameSystem3', 'ServiceObjectiveNameSystem4', 'ServiceObjectiveNameSystem2L', 'ServiceObjectiveNameSystem3L', 'ServiceObjectiveNameSystem4L', 'ServiceObjectiveNameFree', 'ServiceObjectiveNameBasic', 'ServiceObjectiveNameS0', 'ServiceObjectiveNameS1', 'ServiceObjectiveNameS2', 'ServiceObjectiveNameS3', 'ServiceObjectiveNameS4', 'ServiceObjectiveNameS6', 'ServiceObjectiveNameS7', 'ServiceObjectiveNameS9', 'ServiceObjectiveNameS12', 'ServiceObjectiveNameP1', 'ServiceObjectiveNameP2', 'ServiceObjectiveNameP3', 'ServiceObjectiveNameP4', 'ServiceObjectiveNameP6', 'ServiceObjectiveNameP11', 'ServiceObjectiveNameP15', 'ServiceObjectiveNamePRS1', 'ServiceObjectiveNamePRS2', 'ServiceObjectiveNamePRS4', 'ServiceObjectiveNamePRS6', 'ServiceObjectiveNameDW100', 'ServiceObjectiveNameDW200', 'ServiceObjectiveNameDW300', 'ServiceObjectiveNameDW400', 'ServiceObjectiveNameDW500', 'ServiceObjectiveNameDW600', 'ServiceObjectiveNameDW1000', 'ServiceObjectiveNameDW1200', 'ServiceObjectiveNameDW1000c', 'ServiceObjectiveNameDW1500', 'ServiceObjectiveNameDW1500c', 'ServiceObjectiveNameDW2000', 'ServiceObjectiveNameDW2000c', 'ServiceObjectiveNameDW3000', 'ServiceObjectiveNameDW2500c', 'ServiceObjectiveNameDW3000c', 'ServiceObjectiveNameDW6000', 'ServiceObjectiveNameDW5000c', 'ServiceObjectiveNameDW6000c', 'ServiceObjectiveNameDW7500c', 'ServiceObjectiveNameDW10000c', 'ServiceObjectiveNameDW15000c', 'ServiceObjectiveNameDW30000c', 'ServiceObjectiveNameDS100', 'ServiceObjectiveNameDS200', 'ServiceObjectiveNameDS300', 'ServiceObjectiveNameDS400', 'ServiceObjectiveNameDS500', 'ServiceObjectiveNameDS600', 'ServiceObjectiveNameDS1000', 'ServiceObjectiveNameDS1200', 'ServiceObjectiveNameDS1500', 'ServiceObjectiveNameDS2000', 'ServiceObjectiveNameElasticPool' - RequestedServiceObjectiveName ServiceObjectiveName `json:"requestedServiceObjectiveName,omitempty"` - // ServiceLevelObjective - READ-ONLY; The current service level objective of the database. Possible values include: 'ServiceObjectiveNameSystem', 'ServiceObjectiveNameSystem0', 'ServiceObjectiveNameSystem1', 'ServiceObjectiveNameSystem2', 'ServiceObjectiveNameSystem3', 'ServiceObjectiveNameSystem4', 'ServiceObjectiveNameSystem2L', 'ServiceObjectiveNameSystem3L', 'ServiceObjectiveNameSystem4L', 'ServiceObjectiveNameFree', 'ServiceObjectiveNameBasic', 'ServiceObjectiveNameS0', 'ServiceObjectiveNameS1', 'ServiceObjectiveNameS2', 'ServiceObjectiveNameS3', 'ServiceObjectiveNameS4', 'ServiceObjectiveNameS6', 'ServiceObjectiveNameS7', 'ServiceObjectiveNameS9', 'ServiceObjectiveNameS12', 'ServiceObjectiveNameP1', 'ServiceObjectiveNameP2', 'ServiceObjectiveNameP3', 'ServiceObjectiveNameP4', 'ServiceObjectiveNameP6', 'ServiceObjectiveNameP11', 'ServiceObjectiveNameP15', 'ServiceObjectiveNamePRS1', 'ServiceObjectiveNamePRS2', 'ServiceObjectiveNamePRS4', 'ServiceObjectiveNamePRS6', 'ServiceObjectiveNameDW100', 'ServiceObjectiveNameDW200', 'ServiceObjectiveNameDW300', 'ServiceObjectiveNameDW400', 'ServiceObjectiveNameDW500', 'ServiceObjectiveNameDW600', 'ServiceObjectiveNameDW1000', 'ServiceObjectiveNameDW1200', 'ServiceObjectiveNameDW1000c', 'ServiceObjectiveNameDW1500', 'ServiceObjectiveNameDW1500c', 'ServiceObjectiveNameDW2000', 'ServiceObjectiveNameDW2000c', 'ServiceObjectiveNameDW3000', 'ServiceObjectiveNameDW2500c', 'ServiceObjectiveNameDW3000c', 'ServiceObjectiveNameDW6000', 'ServiceObjectiveNameDW5000c', 'ServiceObjectiveNameDW6000c', 'ServiceObjectiveNameDW7500c', 'ServiceObjectiveNameDW10000c', 'ServiceObjectiveNameDW15000c', 'ServiceObjectiveNameDW30000c', 'ServiceObjectiveNameDS100', 'ServiceObjectiveNameDS200', 'ServiceObjectiveNameDS300', 'ServiceObjectiveNameDS400', 'ServiceObjectiveNameDS500', 'ServiceObjectiveNameDS600', 'ServiceObjectiveNameDS1000', 'ServiceObjectiveNameDS1200', 'ServiceObjectiveNameDS1500', 'ServiceObjectiveNameDS2000', 'ServiceObjectiveNameElasticPool' - ServiceLevelObjective ServiceObjectiveName `json:"serviceLevelObjective,omitempty"` - // Status - READ-ONLY; The status of the database. - Status *string `json:"status,omitempty"` - // ElasticPoolName - The name of the elastic pool the database is in. If elasticPoolName and requestedServiceObjectiveName are both updated, the value of requestedServiceObjectiveName is ignored. Not supported for DataWarehouse edition. - ElasticPoolName *string `json:"elasticPoolName,omitempty"` - // DefaultSecondaryLocation - READ-ONLY; The default secondary region for this database. - DefaultSecondaryLocation *string `json:"defaultSecondaryLocation,omitempty"` - // ServiceTierAdvisors - READ-ONLY; The list of service tier advisors for this database. Expanded property - ServiceTierAdvisors *[]ServiceTierAdvisor `json:"serviceTierAdvisors,omitempty"` - // TransparentDataEncryption - READ-ONLY; The transparent data encryption info for this database. - TransparentDataEncryption *[]TransparentDataEncryption `json:"transparentDataEncryption,omitempty"` - // RecommendedIndex - READ-ONLY; The recommended indices for this database. - RecommendedIndex *[]RecommendedIndex `json:"recommendedIndex,omitempty"` - // FailoverGroupID - READ-ONLY; The resource identifier of the failover group containing this database. - FailoverGroupID *string `json:"failoverGroupId,omitempty"` - // ReadScale - Conditional. If the database is a geo-secondary, readScale indicates whether read-only connections are allowed to this database or not. Not supported for DataWarehouse edition. Possible values include: 'ReadScaleEnabled', 'ReadScaleDisabled' - ReadScale ReadScale `json:"readScale,omitempty"` - // SampleName - Indicates the name of the sample schema to apply when creating this database. If createMode is not Default, this value is ignored. Not supported for DataWarehouse edition. Possible values include: 'AdventureWorksLT' - SampleName SampleName `json:"sampleName,omitempty"` - // ZoneRedundant - Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones. - ZoneRedundant *bool `json:"zoneRedundant,omitempty"` +// AdvisorProperties properties for a Database, Server or Elastic Pool Advisor. +type AdvisorProperties struct { + // AdvisorStatus - READ-ONLY; Gets the status of availability of this advisor to customers. Possible values are 'GA', 'PublicPreview', 'LimitedPublicPreview' and 'PrivatePreview'. Possible values include: 'GA', 'PublicPreview', 'LimitedPublicPreview', 'PrivatePreview' + AdvisorStatus AdvisorStatus `json:"advisorStatus,omitempty"` + // AutoExecuteValue - Gets the auto-execute status (whether to let the system execute the recommendations) of this advisor. Possible values are 'Enabled' and 'Disabled'. Possible values include: 'Enabled', 'Disabled', 'Default' + AutoExecuteValue AutoExecuteStatus `json:"autoExecuteValue,omitempty"` + // RecommendationsStatus - READ-ONLY; Gets that status of recommendations for this advisor and reason for not having any recommendations. Possible values include, but are not limited to, 'Ok' (Recommendations available), LowActivity (not enough workload to analyze), 'DbSeemsTuned' (Database is doing well), etc. + RecommendationsStatus *string `json:"recommendationsStatus,omitempty"` + // LastChecked - READ-ONLY; Gets the time when the current resource was analyzed for recommendations by this advisor. + LastChecked *date.Time `json:"lastChecked,omitempty"` } -// DatabasesCreateImportOperationFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type DatabasesCreateImportOperationFuture struct { +// BackupLongTermRetentionPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type BackupLongTermRetentionPoliciesCreateOrUpdateFuture struct { azure.Future } // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. -func (future *DatabasesCreateImportOperationFuture) Result(client DatabasesClient) (ier ImportExportResponse, err error) { +func (future *BackupLongTermRetentionPoliciesCreateOrUpdateFuture) Result(client BackupLongTermRetentionPoliciesClient) (bltrp BackupLongTermRetentionPolicy, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesCreateImportOperationFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - err = azure.NewAsyncOpIncompleteError("sql.DatabasesCreateImportOperationFuture") + err = azure.NewAsyncOpIncompleteError("sql.BackupLongTermRetentionPoliciesCreateOrUpdateFuture") return } sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ier.Response.Response, err = future.GetResult(sender); err == nil && ier.Response.Response.StatusCode != http.StatusNoContent { - ier, err = client.CreateImportOperationResponder(ier.Response.Response) + if bltrp.Response.Response, err = future.GetResult(sender); err == nil && bltrp.Response.Response.StatusCode != http.StatusNoContent { + bltrp, err = client.CreateOrUpdateResponder(bltrp.Response.Response) if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesCreateImportOperationFuture", "Result", ier.Response.Response, "Failure responding to request") + err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionPoliciesCreateOrUpdateFuture", "Result", bltrp.Response.Response, "Failure responding to request") } } return } -// DatabasesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DatabasesCreateOrUpdateFuture struct { - azure.Future +// BackupLongTermRetentionPolicy a backup long term retention policy +type BackupLongTermRetentionPolicy struct { + autorest.Response `json:"-"` + // Location - READ-ONLY; The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // BackupLongTermRetentionPolicyProperties - The properties of the backup long term retention policy + *BackupLongTermRetentionPolicyProperties `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"` } -// 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) (d Database, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return +// MarshalJSON is the custom marshaler for BackupLongTermRetentionPolicy. +func (bltrp BackupLongTermRetentionPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if bltrp.BackupLongTermRetentionPolicyProperties != nil { + objectMap["properties"] = bltrp.BackupLongTermRetentionPolicyProperties } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.DatabasesCreateOrUpdateFuture") - return + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for BackupLongTermRetentionPolicy struct. +func (bltrp *BackupLongTermRetentionPolicy) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err } - 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, "sql.DatabasesCreateOrUpdateFuture", "Result", d.Response.Response, "Failure responding to request") + 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 + } + bltrp.Location = &location + } + case "properties": + if v != nil { + var backupLongTermRetentionPolicyProperties BackupLongTermRetentionPolicyProperties + err = json.Unmarshal(*v, &backupLongTermRetentionPolicyProperties) + if err != nil { + return err + } + bltrp.BackupLongTermRetentionPolicyProperties = &backupLongTermRetentionPolicyProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + bltrp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + bltrp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + bltrp.Type = &typeVar + } } } - return + + return nil } -// DatabaseSecurityAlertPolicy contains information about a database Threat Detection policy. -type DatabaseSecurityAlertPolicy struct { +// BackupLongTermRetentionPolicyListResult represents the response to a list long-term retention policies +// request. +type BackupLongTermRetentionPolicyListResult struct { autorest.Response `json:"-"` - // Location - The geo-location where the resource lives + // Value - The list of long-term retention policies in the database. + Value *[]BackupLongTermRetentionPolicy `json:"value,omitempty"` +} + +// BackupLongTermRetentionPolicyProperties the properties of a backup long term retention policy +type BackupLongTermRetentionPolicyProperties struct { + // State - The status of the backup long term retention policy. Possible values include: 'BackupLongTermRetentionPolicyStateDisabled', 'BackupLongTermRetentionPolicyStateEnabled' + State BackupLongTermRetentionPolicyState `json:"state,omitempty"` + // RecoveryServicesBackupPolicyResourceID - The azure recovery services backup protection policy resource id + RecoveryServicesBackupPolicyResourceID *string `json:"recoveryServicesBackupPolicyResourceId,omitempty"` +} + +// BackupLongTermRetentionVault a backup long term retention vault +type BackupLongTermRetentionVault struct { + autorest.Response `json:"-"` + // Location - READ-ONLY; The geo-location where the resource lives Location *string `json:"location,omitempty"` - // Kind - READ-ONLY; Resource kind. - Kind *string `json:"kind,omitempty"` - // DatabaseSecurityAlertPolicyProperties - Properties of the security alert policy. - *DatabaseSecurityAlertPolicyProperties `json:"properties,omitempty"` + // BackupLongTermRetentionVaultProperties - The properties of the backup long term retention vault + *BackupLongTermRetentionVaultProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -839,20 +1240,17 @@ type DatabaseSecurityAlertPolicy struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for DatabaseSecurityAlertPolicy. -func (dsap DatabaseSecurityAlertPolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for BackupLongTermRetentionVault. +func (bltrv BackupLongTermRetentionVault) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if dsap.Location != nil { - objectMap["location"] = dsap.Location - } - if dsap.DatabaseSecurityAlertPolicyProperties != nil { - objectMap["properties"] = dsap.DatabaseSecurityAlertPolicyProperties + if bltrv.BackupLongTermRetentionVaultProperties != nil { + objectMap["properties"] = bltrv.BackupLongTermRetentionVaultProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for DatabaseSecurityAlertPolicy struct. -func (dsap *DatabaseSecurityAlertPolicy) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for BackupLongTermRetentionVault struct. +func (bltrv *BackupLongTermRetentionVault) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -867,25 +1265,16 @@ func (dsap *DatabaseSecurityAlertPolicy) UnmarshalJSON(body []byte) error { if err != nil { return err } - dsap.Location = &location - } - case "kind": - if v != nil { - var kind string - err = json.Unmarshal(*v, &kind) - if err != nil { - return err - } - dsap.Kind = &kind + bltrv.Location = &location } case "properties": if v != nil { - var databaseSecurityAlertPolicyProperties DatabaseSecurityAlertPolicyProperties - err = json.Unmarshal(*v, &databaseSecurityAlertPolicyProperties) + var backupLongTermRetentionVaultProperties BackupLongTermRetentionVaultProperties + err = json.Unmarshal(*v, &backupLongTermRetentionVaultProperties) if err != nil { return err } - dsap.DatabaseSecurityAlertPolicyProperties = &databaseSecurityAlertPolicyProperties + bltrv.BackupLongTermRetentionVaultProperties = &backupLongTermRetentionVaultProperties } case "id": if v != nil { @@ -894,7 +1283,7 @@ func (dsap *DatabaseSecurityAlertPolicy) UnmarshalJSON(body []byte) error { if err != nil { return err } - dsap.ID = &ID + bltrv.ID = &ID } case "name": if v != nil { @@ -903,7 +1292,7 @@ func (dsap *DatabaseSecurityAlertPolicy) UnmarshalJSON(body []byte) error { if err != nil { return err } - dsap.Name = &name + bltrv.Name = &name } case "type": if v != nil { @@ -912,7 +1301,7 @@ func (dsap *DatabaseSecurityAlertPolicy) UnmarshalJSON(body []byte) error { if err != nil { return err } - dsap.Type = &typeVar + bltrv.Type = &typeVar } } } @@ -920,165 +1309,2981 @@ func (dsap *DatabaseSecurityAlertPolicy) UnmarshalJSON(body []byte) error { return nil } -// DatabaseSecurityAlertPolicyProperties properties for a database Threat Detection policy. -type DatabaseSecurityAlertPolicyProperties struct { - // State - Specifies the state of the policy. If state is Enabled, storageEndpoint and storageAccountAccessKey are required. Possible values include: 'SecurityAlertPolicyStateNew', 'SecurityAlertPolicyStateEnabled', 'SecurityAlertPolicyStateDisabled' - State SecurityAlertPolicyState `json:"state,omitempty"` - // DisabledAlerts - Specifies the semicolon-separated list of alerts that are disabled, or empty string to disable no alerts. Possible values: Sql_Injection; Sql_Injection_Vulnerability; Access_Anomaly; Data_Exfiltration; Unsafe_Action. - DisabledAlerts *string `json:"disabledAlerts,omitempty"` - // EmailAddresses - Specifies the semicolon-separated list of e-mail addresses to which the alert is sent. - EmailAddresses *string `json:"emailAddresses,omitempty"` - // EmailAccountAdmins - Specifies that the alert is sent to the account administrators. Possible values include: 'SecurityAlertPolicyEmailAccountAdminsEnabled', 'SecurityAlertPolicyEmailAccountAdminsDisabled' - EmailAccountAdmins SecurityAlertPolicyEmailAccountAdmins `json:"emailAccountAdmins,omitempty"` - // StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs. If state is Enabled, storageEndpoint is required. - StorageEndpoint *string `json:"storageEndpoint,omitempty"` - // StorageAccountAccessKey - Specifies the identifier key of the Threat Detection audit storage account. If state is Enabled, storageAccountAccessKey is required. - StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` - // RetentionDays - Specifies the number of days to keep in the Threat Detection audit logs. - RetentionDays *int32 `json:"retentionDays,omitempty"` - // UseServerDefault - Specifies whether to use the default server policy. Possible values include: 'SecurityAlertPolicyUseServerDefaultEnabled', 'SecurityAlertPolicyUseServerDefaultDisabled' - UseServerDefault SecurityAlertPolicyUseServerDefault `json:"useServerDefault,omitempty"` -} - -// DatabasesExportFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DatabasesExportFuture struct { - azure.Future +// BackupLongTermRetentionVaultListResult represents the response to a list vaults request. +type BackupLongTermRetentionVaultListResult struct { + autorest.Response `json:"-"` + // Value - The list of vaults in the server. + Value *[]BackupLongTermRetentionVault `json:"value,omitempty"` } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DatabasesExportFuture) Result(client DatabasesClient) (ier ImportExportResponse, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesExportFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.DatabasesExportFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ier.Response.Response, err = future.GetResult(sender); err == nil && ier.Response.Response.StatusCode != http.StatusNoContent { - ier, err = client.ExportResponder(ier.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesExportFuture", "Result", ier.Response.Response, "Failure responding to request") - } - } - return +// BackupLongTermRetentionVaultProperties the properties of a backup long term retention vault. +type BackupLongTermRetentionVaultProperties struct { + // RecoveryServicesVaultResourceID - The azure recovery services vault resource id + RecoveryServicesVaultResourceID *string `json:"recoveryServicesVaultResourceId,omitempty"` } -// DatabasesImportFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DatabasesImportFuture struct { +// BackupLongTermRetentionVaultsCreateOrUpdateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type BackupLongTermRetentionVaultsCreateOrUpdateFuture struct { azure.Future } // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. -func (future *DatabasesImportFuture) Result(client DatabasesClient) (ier ImportExportResponse, err error) { +func (future *BackupLongTermRetentionVaultsCreateOrUpdateFuture) Result(client BackupLongTermRetentionVaultsClient) (bltrv BackupLongTermRetentionVault, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesImportFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionVaultsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - err = azure.NewAsyncOpIncompleteError("sql.DatabasesImportFuture") + err = azure.NewAsyncOpIncompleteError("sql.BackupLongTermRetentionVaultsCreateOrUpdateFuture") return } sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ier.Response.Response, err = future.GetResult(sender); err == nil && ier.Response.Response.StatusCode != http.StatusNoContent { - ier, err = client.ImportResponder(ier.Response.Response) + if bltrv.Response.Response, err = future.GetResult(sender); err == nil && bltrv.Response.Response.StatusCode != http.StatusNoContent { + bltrv, err = client.CreateOrUpdateResponder(bltrv.Response.Response) if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesImportFuture", "Result", ier.Response.Response, "Failure responding to request") + err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionVaultsCreateOrUpdateFuture", "Result", bltrv.Response.Response, "Failure responding to request") } } return } -// DatabasesPauseFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DatabasesPauseFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DatabasesPauseFuture) 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, "sql.DatabasesPauseFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.DatabasesPauseFuture") - return - } - ar.Response = future.Response() - return +// CheckNameAvailabilityRequest a request to check whether the specified name for a resource is available. +type CheckNameAvailabilityRequest struct { + // Name - The name whose availability is to be checked. + Name *string `json:"name,omitempty"` + // Type - The type of resource that is used as the scope of the availability check. + Type *string `json:"type,omitempty"` } -// DatabasesResumeFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// CheckNameAvailabilityResponse a response indicating whether the specified name for a resource is +// available. +type CheckNameAvailabilityResponse struct { + autorest.Response `json:"-"` + // Available - READ-ONLY; True if the name is available, otherwise false. + Available *bool `json:"available,omitempty"` + // Message - READ-ONLY; A message explaining why the name is unavailable. Will be null if the name is available. + Message *string `json:"message,omitempty"` + // Name - READ-ONLY; The name whose availability was checked. + Name *string `json:"name,omitempty"` + // Reason - READ-ONLY; The reason code explaining why the name is unavailable. Will be null if the name is available. Possible values include: 'Invalid', 'AlreadyExists' + Reason CheckNameAvailabilityReason `json:"reason,omitempty"` +} + +// Database represents a database. +type Database struct { + autorest.Response `json:"-"` + // Kind - READ-ONLY; Kind of database. This is metadata used for the Azure portal experience. + Kind *string `json:"kind,omitempty"` + // DatabaseProperties - The properties representing the resource. + *DatabaseProperties `json:"properties,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Database. +func (d Database) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if d.DatabaseProperties != nil { + objectMap["properties"] = d.DatabaseProperties + } + 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 Database struct. +func (d *Database) UnmarshalJSON(body []byte) error { + 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 string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + d.Kind = &kind + } + case "properties": + if v != nil { + var databaseProperties DatabaseProperties + err = json.Unmarshal(*v, &databaseProperties) + if err != nil { + return err + } + d.DatabaseProperties = &databaseProperties + } + 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 "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 +} + +// DatabaseConnectionPolicy a database connection policy. +type DatabaseConnectionPolicy struct { + autorest.Response `json:"-"` + // Kind - READ-ONLY; Resource kind. + Kind *string `json:"kind,omitempty"` + // Location - READ-ONLY; Resource location. + Location *string `json:"location,omitempty"` + // DatabaseConnectionPolicyProperties - Resource properties. + *DatabaseConnectionPolicyProperties `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 DatabaseConnectionPolicy. +func (dcp DatabaseConnectionPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dcp.DatabaseConnectionPolicyProperties != nil { + objectMap["properties"] = dcp.DatabaseConnectionPolicyProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DatabaseConnectionPolicy struct. +func (dcp *DatabaseConnectionPolicy) UnmarshalJSON(body []byte) error { + 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 string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + dcp.Kind = &kind + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + dcp.Location = &location + } + case "properties": + if v != nil { + var databaseConnectionPolicyProperties DatabaseConnectionPolicyProperties + err = json.Unmarshal(*v, &databaseConnectionPolicyProperties) + if err != nil { + return err + } + dcp.DatabaseConnectionPolicyProperties = &databaseConnectionPolicyProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dcp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dcp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dcp.Type = &typeVar + } + } + } + + return nil +} + +// DatabaseConnectionPolicyProperties properties of a database connection policy. +type DatabaseConnectionPolicyProperties struct { + // SecurityEnabledAccess - The state of security access. + SecurityEnabledAccess *string `json:"securityEnabledAccess,omitempty"` + // ProxyDNSName - The fully qualified host name of the auditing proxy. + ProxyDNSName *string `json:"proxyDnsName,omitempty"` + // ProxyPort - The port number of the auditing proxy. + ProxyPort *string `json:"proxyPort,omitempty"` + // Visibility - The visibility of the auditing proxy. + Visibility *string `json:"visibility,omitempty"` + // UseServerDefault - Whether server default is enabled or disabled. + UseServerDefault *string `json:"useServerDefault,omitempty"` + // RedirectionState - The state of proxy redirection. + RedirectionState *string `json:"redirectionState,omitempty"` + // State - The connection policy state. + State *string `json:"state,omitempty"` +} + +// DatabaseListResult represents the response to a list database request. +type DatabaseListResult struct { + autorest.Response `json:"-"` + // Value - The list of databases housed in the server. + Value *[]Database `json:"value,omitempty"` +} + +// DatabaseProperties represents the properties of a database. +type DatabaseProperties struct { + // Collation - The collation of the database. If createMode is not Default, this value is ignored. + Collation *string `json:"collation,omitempty"` + // CreationDate - READ-ONLY; The creation date of the database (ISO8601 format). + CreationDate *date.Time `json:"creationDate,omitempty"` + // ContainmentState - READ-ONLY; The containment state of the database. + ContainmentState *int64 `json:"containmentState,omitempty"` + // CurrentServiceObjectiveID - READ-ONLY; The current service level objective ID of the database. This is the ID of the service level objective that is currently active. + CurrentServiceObjectiveID *uuid.UUID `json:"currentServiceObjectiveId,omitempty"` + // DatabaseID - READ-ONLY; The ID of the database. + DatabaseID *uuid.UUID `json:"databaseId,omitempty"` + // EarliestRestoreDate - READ-ONLY; This records the earliest start date and time that restore is available for this database (ISO8601 format). + EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"` + // CreateMode - Specifies the mode of database creation. + // Default: regular database creation. + // Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified as the resource ID of the source database. + // OnlineSecondary/NonReadableSecondary: creates a database as a (readable or nonreadable) secondary replica of an existing database. sourceDatabaseId must be specified as the resource ID of the existing primary database. + // PointInTimeRestore: Creates a database by restoring a point in time backup of an existing database. sourceDatabaseId must be specified as the resource ID of the existing database, and restorePointInTime must be specified. + // Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be specified as the recoverable database resource ID to restore. + // Restore: Creates a database by restoring a backup of a deleted database. sourceDatabaseId must be specified. If sourceDatabaseId is the database's original resource ID, then sourceDatabaseDeletionDate must be specified. Otherwise sourceDatabaseId must be the restorable dropped database resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be specified to restore from an earlier point in time. + // RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention vault. recoveryServicesRecoveryPointResourceId must be specified as the recovery point resource ID. + // Copy, NonReadableSecondary, OnlineSecondary and RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. Possible values include: 'CreateModeCopy', 'CreateModeDefault', 'CreateModeNonReadableSecondary', 'CreateModeOnlineSecondary', 'CreateModePointInTimeRestore', 'CreateModeRecovery', 'CreateModeRestore', 'CreateModeRestoreLongTermRetentionBackup' + CreateMode CreateMode `json:"createMode,omitempty"` + // SourceDatabaseID - Conditional. If createMode is Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, or Restore, then this value is required. Specifies the resource ID of the source database. If createMode is NonReadableSecondary or OnlineSecondary, the name of the source database must be the same as the new database being created. + SourceDatabaseID *string `json:"sourceDatabaseId,omitempty"` + // SourceDatabaseDeletionDate - Conditional. If createMode is Restore and sourceDatabaseId is the deleted database's original resource id when it existed (as opposed to its current restorable dropped database id), then this value is required. Specifies the time that the database was deleted. + SourceDatabaseDeletionDate *date.Time `json:"sourceDatabaseDeletionDate,omitempty"` + // RestorePointInTime - Conditional. If createMode is PointInTimeRestore, this value is required. If createMode is Restore, this value is optional. Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. Must be greater than or equal to the source database's earliestRestoreDate value. + RestorePointInTime *date.Time `json:"restorePointInTime,omitempty"` + // RecoveryServicesRecoveryPointResourceID - Conditional. If createMode is RestoreLongTermRetentionBackup, then this value is required. Specifies the resource ID of the recovery point to restore from. + RecoveryServicesRecoveryPointResourceID *string `json:"recoveryServicesRecoveryPointResourceId,omitempty"` + // Edition - The edition of the database. The DatabaseEditions enumeration contains all the valid editions. If createMode is NonReadableSecondary or OnlineSecondary, this value is ignored. + // + // The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API or one of the following commands: + // + // ```azurecli + // az sql db list-editions -l -o table + // ```` + // + // ```powershell + // Get-AzSqlServerServiceObjective -Location + // ```` + // . Possible values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2', 'GeneralPurpose', 'BusinessCritical', 'Hyperscale' + Edition DatabaseEdition `json:"edition,omitempty"` + // MaxSizeBytes - The max size of the database expressed in bytes. If createMode is not Default, this value is ignored. To see possible values, query the capabilities API (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) referred to by operationId: "Capabilities_ListByLocation." + MaxSizeBytes *string `json:"maxSizeBytes,omitempty"` + // RequestedServiceObjectiveID - The configured service level objective ID of the database. This is the service level objective that is in the process of being applied to the database. Once successfully updated, it will match the value of currentServiceObjectiveId property. If requestedServiceObjectiveId and requestedServiceObjectiveName are both updated, the value of requestedServiceObjectiveId overrides the value of requestedServiceObjectiveName. + // + // The list of SKUs may vary by region and support offer. To determine the service objective ids that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API. + RequestedServiceObjectiveID *uuid.UUID `json:"requestedServiceObjectiveId,omitempty"` + // RequestedServiceObjectiveName - The name of the configured service level objective of the database. This is the service level objective that is in the process of being applied to the database. Once successfully updated, it will match the value of serviceLevelObjective property. + // + // The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API or one of the following commands: + // + // ```azurecli + // az sql db list-editions -l -o table + // ```` + // + // ```powershell + // Get-AzSqlServerServiceObjective -Location + // ```` + // . Possible values include: 'ServiceObjectiveNameSystem', 'ServiceObjectiveNameSystem0', 'ServiceObjectiveNameSystem1', 'ServiceObjectiveNameSystem2', 'ServiceObjectiveNameSystem3', 'ServiceObjectiveNameSystem4', 'ServiceObjectiveNameSystem2L', 'ServiceObjectiveNameSystem3L', 'ServiceObjectiveNameSystem4L', 'ServiceObjectiveNameFree', 'ServiceObjectiveNameBasic', 'ServiceObjectiveNameS0', 'ServiceObjectiveNameS1', 'ServiceObjectiveNameS2', 'ServiceObjectiveNameS3', 'ServiceObjectiveNameS4', 'ServiceObjectiveNameS6', 'ServiceObjectiveNameS7', 'ServiceObjectiveNameS9', 'ServiceObjectiveNameS12', 'ServiceObjectiveNameP1', 'ServiceObjectiveNameP2', 'ServiceObjectiveNameP3', 'ServiceObjectiveNameP4', 'ServiceObjectiveNameP6', 'ServiceObjectiveNameP11', 'ServiceObjectiveNameP15', 'ServiceObjectiveNamePRS1', 'ServiceObjectiveNamePRS2', 'ServiceObjectiveNamePRS4', 'ServiceObjectiveNamePRS6', 'ServiceObjectiveNameDW100', 'ServiceObjectiveNameDW200', 'ServiceObjectiveNameDW300', 'ServiceObjectiveNameDW400', 'ServiceObjectiveNameDW500', 'ServiceObjectiveNameDW600', 'ServiceObjectiveNameDW1000', 'ServiceObjectiveNameDW1200', 'ServiceObjectiveNameDW1000c', 'ServiceObjectiveNameDW1500', 'ServiceObjectiveNameDW1500c', 'ServiceObjectiveNameDW2000', 'ServiceObjectiveNameDW2000c', 'ServiceObjectiveNameDW3000', 'ServiceObjectiveNameDW2500c', 'ServiceObjectiveNameDW3000c', 'ServiceObjectiveNameDW6000', 'ServiceObjectiveNameDW5000c', 'ServiceObjectiveNameDW6000c', 'ServiceObjectiveNameDW7500c', 'ServiceObjectiveNameDW10000c', 'ServiceObjectiveNameDW15000c', 'ServiceObjectiveNameDW30000c', 'ServiceObjectiveNameDS100', 'ServiceObjectiveNameDS200', 'ServiceObjectiveNameDS300', 'ServiceObjectiveNameDS400', 'ServiceObjectiveNameDS500', 'ServiceObjectiveNameDS600', 'ServiceObjectiveNameDS1000', 'ServiceObjectiveNameDS1200', 'ServiceObjectiveNameDS1500', 'ServiceObjectiveNameDS2000', 'ServiceObjectiveNameElasticPool' + RequestedServiceObjectiveName ServiceObjectiveName `json:"requestedServiceObjectiveName,omitempty"` + // ServiceLevelObjective - READ-ONLY; The current service level objective of the database. Possible values include: 'ServiceObjectiveNameSystem', 'ServiceObjectiveNameSystem0', 'ServiceObjectiveNameSystem1', 'ServiceObjectiveNameSystem2', 'ServiceObjectiveNameSystem3', 'ServiceObjectiveNameSystem4', 'ServiceObjectiveNameSystem2L', 'ServiceObjectiveNameSystem3L', 'ServiceObjectiveNameSystem4L', 'ServiceObjectiveNameFree', 'ServiceObjectiveNameBasic', 'ServiceObjectiveNameS0', 'ServiceObjectiveNameS1', 'ServiceObjectiveNameS2', 'ServiceObjectiveNameS3', 'ServiceObjectiveNameS4', 'ServiceObjectiveNameS6', 'ServiceObjectiveNameS7', 'ServiceObjectiveNameS9', 'ServiceObjectiveNameS12', 'ServiceObjectiveNameP1', 'ServiceObjectiveNameP2', 'ServiceObjectiveNameP3', 'ServiceObjectiveNameP4', 'ServiceObjectiveNameP6', 'ServiceObjectiveNameP11', 'ServiceObjectiveNameP15', 'ServiceObjectiveNamePRS1', 'ServiceObjectiveNamePRS2', 'ServiceObjectiveNamePRS4', 'ServiceObjectiveNamePRS6', 'ServiceObjectiveNameDW100', 'ServiceObjectiveNameDW200', 'ServiceObjectiveNameDW300', 'ServiceObjectiveNameDW400', 'ServiceObjectiveNameDW500', 'ServiceObjectiveNameDW600', 'ServiceObjectiveNameDW1000', 'ServiceObjectiveNameDW1200', 'ServiceObjectiveNameDW1000c', 'ServiceObjectiveNameDW1500', 'ServiceObjectiveNameDW1500c', 'ServiceObjectiveNameDW2000', 'ServiceObjectiveNameDW2000c', 'ServiceObjectiveNameDW3000', 'ServiceObjectiveNameDW2500c', 'ServiceObjectiveNameDW3000c', 'ServiceObjectiveNameDW6000', 'ServiceObjectiveNameDW5000c', 'ServiceObjectiveNameDW6000c', 'ServiceObjectiveNameDW7500c', 'ServiceObjectiveNameDW10000c', 'ServiceObjectiveNameDW15000c', 'ServiceObjectiveNameDW30000c', 'ServiceObjectiveNameDS100', 'ServiceObjectiveNameDS200', 'ServiceObjectiveNameDS300', 'ServiceObjectiveNameDS400', 'ServiceObjectiveNameDS500', 'ServiceObjectiveNameDS600', 'ServiceObjectiveNameDS1000', 'ServiceObjectiveNameDS1200', 'ServiceObjectiveNameDS1500', 'ServiceObjectiveNameDS2000', 'ServiceObjectiveNameElasticPool' + ServiceLevelObjective ServiceObjectiveName `json:"serviceLevelObjective,omitempty"` + // Status - READ-ONLY; The status of the database. + Status *string `json:"status,omitempty"` + // ElasticPoolName - The name of the elastic pool the database is in. If elasticPoolName and requestedServiceObjectiveName are both updated, the value of requestedServiceObjectiveName is ignored. Not supported for DataWarehouse edition. + ElasticPoolName *string `json:"elasticPoolName,omitempty"` + // DefaultSecondaryLocation - READ-ONLY; The default secondary region for this database. + DefaultSecondaryLocation *string `json:"defaultSecondaryLocation,omitempty"` + // ServiceTierAdvisors - READ-ONLY; The list of service tier advisors for this database. Expanded property + ServiceTierAdvisors *[]ServiceTierAdvisor `json:"serviceTierAdvisors,omitempty"` + // TransparentDataEncryption - READ-ONLY; The transparent data encryption info for this database. + TransparentDataEncryption *[]TransparentDataEncryption `json:"transparentDataEncryption,omitempty"` + // RecommendedIndex - READ-ONLY; The recommended indices for this database. + RecommendedIndex *[]RecommendedIndex `json:"recommendedIndex,omitempty"` + // FailoverGroupID - READ-ONLY; The resource identifier of the failover group containing this database. + FailoverGroupID *string `json:"failoverGroupId,omitempty"` + // ReadScale - Conditional. If the database is a geo-secondary, readScale indicates whether read-only connections are allowed to this database or not. Not supported for DataWarehouse edition. Possible values include: 'ReadScaleEnabled', 'ReadScaleDisabled' + ReadScale ReadScale `json:"readScale,omitempty"` + // SampleName - Indicates the name of the sample schema to apply when creating this database. If createMode is not Default, this value is ignored. Not supported for DataWarehouse edition. Possible values include: 'AdventureWorksLT' + SampleName SampleName `json:"sampleName,omitempty"` + // ZoneRedundant - Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones. + ZoneRedundant *bool `json:"zoneRedundant,omitempty"` +} + +// DatabasesCreateImportOperationFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type DatabasesCreateImportOperationFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DatabasesCreateImportOperationFuture) Result(client DatabasesClient) (ier ImportExportResponse, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesCreateImportOperationFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("sql.DatabasesCreateImportOperationFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ier.Response.Response, err = future.GetResult(sender); err == nil && ier.Response.Response.StatusCode != http.StatusNoContent { + ier, err = client.CreateImportOperationResponder(ier.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesCreateImportOperationFuture", "Result", ier.Response.Response, "Failure responding to request") + } + } + return +} + +// 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) (d Database, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("sql.DatabasesCreateOrUpdateFuture") + 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, "sql.DatabasesCreateOrUpdateFuture", "Result", d.Response.Response, "Failure responding to request") + } + } + return +} + +// DatabaseSecurityAlertPolicy contains information about a database Threat Detection policy. +type DatabaseSecurityAlertPolicy struct { + autorest.Response `json:"-"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // Kind - READ-ONLY; Resource kind. + Kind *string `json:"kind,omitempty"` + // DatabaseSecurityAlertPolicyProperties - Properties of the security alert policy. + *DatabaseSecurityAlertPolicyProperties `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 DatabaseSecurityAlertPolicy. +func (dsap DatabaseSecurityAlertPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dsap.Location != nil { + objectMap["location"] = dsap.Location + } + if dsap.DatabaseSecurityAlertPolicyProperties != nil { + objectMap["properties"] = dsap.DatabaseSecurityAlertPolicyProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DatabaseSecurityAlertPolicy struct. +func (dsap *DatabaseSecurityAlertPolicy) UnmarshalJSON(body []byte) error { + 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 + } + dsap.Location = &location + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + dsap.Kind = &kind + } + case "properties": + if v != nil { + var databaseSecurityAlertPolicyProperties DatabaseSecurityAlertPolicyProperties + err = json.Unmarshal(*v, &databaseSecurityAlertPolicyProperties) + if err != nil { + return err + } + dsap.DatabaseSecurityAlertPolicyProperties = &databaseSecurityAlertPolicyProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dsap.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dsap.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dsap.Type = &typeVar + } + } + } + + return nil +} + +// DatabaseSecurityAlertPolicyProperties properties for a database Threat Detection policy. +type DatabaseSecurityAlertPolicyProperties struct { + // State - Specifies the state of the policy. If state is Enabled, storageEndpoint and storageAccountAccessKey are required. Possible values include: 'SecurityAlertPolicyStateNew', 'SecurityAlertPolicyStateEnabled', 'SecurityAlertPolicyStateDisabled' + State SecurityAlertPolicyState `json:"state,omitempty"` + // DisabledAlerts - Specifies the semicolon-separated list of alerts that are disabled, or empty string to disable no alerts. Possible values: Sql_Injection; Sql_Injection_Vulnerability; Access_Anomaly; Data_Exfiltration; Unsafe_Action. + DisabledAlerts *string `json:"disabledAlerts,omitempty"` + // EmailAddresses - Specifies the semicolon-separated list of e-mail addresses to which the alert is sent. + EmailAddresses *string `json:"emailAddresses,omitempty"` + // EmailAccountAdmins - Specifies that the alert is sent to the account administrators. Possible values include: 'SecurityAlertPolicyEmailAccountAdminsEnabled', 'SecurityAlertPolicyEmailAccountAdminsDisabled' + EmailAccountAdmins SecurityAlertPolicyEmailAccountAdmins `json:"emailAccountAdmins,omitempty"` + // StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs. If state is Enabled, storageEndpoint is required. + StorageEndpoint *string `json:"storageEndpoint,omitempty"` + // StorageAccountAccessKey - Specifies the identifier key of the Threat Detection audit storage account. If state is Enabled, storageAccountAccessKey is required. + StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` + // RetentionDays - Specifies the number of days to keep in the Threat Detection audit logs. + RetentionDays *int32 `json:"retentionDays,omitempty"` + // UseServerDefault - Specifies whether to use the default server policy. Possible values include: 'SecurityAlertPolicyUseServerDefaultEnabled', 'SecurityAlertPolicyUseServerDefaultDisabled' + UseServerDefault SecurityAlertPolicyUseServerDefault `json:"useServerDefault,omitempty"` +} + +// DatabasesExportFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DatabasesExportFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DatabasesExportFuture) Result(client DatabasesClient) (ier ImportExportResponse, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesExportFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("sql.DatabasesExportFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ier.Response.Response, err = future.GetResult(sender); err == nil && ier.Response.Response.StatusCode != http.StatusNoContent { + ier, err = client.ExportResponder(ier.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesExportFuture", "Result", ier.Response.Response, "Failure responding to request") + } + } + return +} + +// DatabasesImportFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DatabasesImportFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DatabasesImportFuture) Result(client DatabasesClient) (ier ImportExportResponse, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesImportFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("sql.DatabasesImportFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ier.Response.Response, err = future.GetResult(sender); err == nil && ier.Response.Response.StatusCode != http.StatusNoContent { + ier, err = client.ImportResponder(ier.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesImportFuture", "Result", ier.Response.Response, "Failure responding to request") + } + } + return +} + +// DatabasesPauseFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DatabasesPauseFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DatabasesPauseFuture) 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, "sql.DatabasesPauseFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("sql.DatabasesPauseFuture") + return + } + ar.Response = future.Response() + return +} + +// DatabasesResumeFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type DatabasesResumeFuture struct { azure.Future } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DatabasesResumeFuture) Result(client DatabasesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DatabasesResumeFuture) 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, "sql.DatabasesResumeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("sql.DatabasesResumeFuture") + return + } + ar.Response = future.Response() + return +} + +// 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) (d Database, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("sql.DatabasesUpdateFuture") + 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.UpdateResponder(d.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesUpdateFuture", "Result", d.Response.Response, "Failure responding to request") + } + } + return +} + +// DatabaseTableAuditingPolicy a database table auditing policy. +type DatabaseTableAuditingPolicy struct { + autorest.Response `json:"-"` + // Kind - READ-ONLY; Resource kind. + Kind *string `json:"kind,omitempty"` + // Location - READ-ONLY; Resource location. + Location *string `json:"location,omitempty"` + // DatabaseTableAuditingPolicyProperties - Resource properties. + *DatabaseTableAuditingPolicyProperties `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 DatabaseTableAuditingPolicy. +func (dtap DatabaseTableAuditingPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dtap.DatabaseTableAuditingPolicyProperties != nil { + objectMap["properties"] = dtap.DatabaseTableAuditingPolicyProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DatabaseTableAuditingPolicy struct. +func (dtap *DatabaseTableAuditingPolicy) UnmarshalJSON(body []byte) error { + 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 string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + dtap.Kind = &kind + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + dtap.Location = &location + } + case "properties": + if v != nil { + var databaseTableAuditingPolicyProperties DatabaseTableAuditingPolicyProperties + err = json.Unmarshal(*v, &databaseTableAuditingPolicyProperties) + if err != nil { + return err + } + dtap.DatabaseTableAuditingPolicyProperties = &databaseTableAuditingPolicyProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dtap.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dtap.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dtap.Type = &typeVar + } + } + } + + return nil +} + +// DatabaseTableAuditingPolicyListResult represents the response to a list database table auditing policies +// request. +type DatabaseTableAuditingPolicyListResult struct { + autorest.Response `json:"-"` + // Value - The list of database table auditing policies. + Value *[]DatabaseTableAuditingPolicy `json:"value,omitempty"` +} + +// DatabaseTableAuditingPolicyProperties properties of a database table auditing policy. +type DatabaseTableAuditingPolicyProperties struct { + // UseServerDefault - Whether server default is enabled or disabled. + UseServerDefault *string `json:"useServerDefault,omitempty"` + // AuditingState - The state of the policy. + AuditingState *string `json:"auditingState,omitempty"` + // AuditLogsTableName - The audit logs table name. + AuditLogsTableName *string `json:"auditLogsTableName,omitempty"` + // EventTypesToAudit - Comma-separated list of event types to audit. + EventTypesToAudit *string `json:"eventTypesToAudit,omitempty"` + // FullAuditLogsTableName - The full audit logs table name. + FullAuditLogsTableName *string `json:"fullAuditLogsTableName,omitempty"` + // RetentionDays - The number of days to keep in the audit logs. + RetentionDays *string `json:"retentionDays,omitempty"` + // StorageAccountKey - The key of the auditing storage account. + StorageAccountKey *string `json:"storageAccountKey,omitempty"` + // StorageAccountName - The table storage account name + StorageAccountName *string `json:"storageAccountName,omitempty"` + // StorageAccountResourceGroupName - The table storage account resource group name + StorageAccountResourceGroupName *string `json:"storageAccountResourceGroupName,omitempty"` + // StorageAccountSecondaryKey - The secondary key of the auditing storage account. + StorageAccountSecondaryKey *string `json:"storageAccountSecondaryKey,omitempty"` + // StorageAccountSubscriptionID - The table storage subscription Id. + StorageAccountSubscriptionID *uuid.UUID `json:"storageAccountSubscriptionId,omitempty"` + // StorageTableEndpoint - The storage table endpoint. + StorageTableEndpoint *string `json:"storageTableEndpoint,omitempty"` +} + +// DatabaseUpdate represents a database update. +type DatabaseUpdate struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // DatabaseProperties - The properties representing the resource. + *DatabaseProperties `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 DatabaseUpdate. +func (du DatabaseUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if du.Tags != nil { + objectMap["tags"] = du.Tags + } + if du.DatabaseProperties != nil { + objectMap["properties"] = du.DatabaseProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DatabaseUpdate struct. +func (du *DatabaseUpdate) UnmarshalJSON(body []byte) error { + 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 + } + du.Tags = tags + } + case "properties": + if v != nil { + var databaseProperties DatabaseProperties + err = json.Unmarshal(*v, &databaseProperties) + if err != nil { + return err + } + du.DatabaseProperties = &databaseProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + du.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + du.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + du.Type = &typeVar + } + } + } + + return nil +} + +// DatabaseUsage the database usages. +type DatabaseUsage struct { + // Name - READ-ONLY; The name of the usage metric. + Name *string `json:"name,omitempty"` + // ResourceName - READ-ONLY; The name of the resource. + ResourceName *string `json:"resourceName,omitempty"` + // DisplayName - READ-ONLY; The usage metric display name. + DisplayName *string `json:"displayName,omitempty"` + // CurrentValue - READ-ONLY; The current value of the usage metric. + CurrentValue *float64 `json:"currentValue,omitempty"` + // Limit - READ-ONLY; The current limit of the usage metric. + Limit *float64 `json:"limit,omitempty"` + // Unit - READ-ONLY; The units of the usage metric. + Unit *string `json:"unit,omitempty"` + // NextResetTime - READ-ONLY; The next reset time for the usage metric (ISO8601 format). + NextResetTime *date.Time `json:"nextResetTime,omitempty"` +} + +// DatabaseUsageListResult the response to a list database metrics request. +type DatabaseUsageListResult struct { + autorest.Response `json:"-"` + // Value - The list of database usages for the database. + Value *[]DatabaseUsage `json:"value,omitempty"` +} + +// DataMaskingPolicy represents a database data masking policy. +type DataMaskingPolicy struct { + autorest.Response `json:"-"` + // DataMaskingPolicyProperties - The properties of the data masking policy. + *DataMaskingPolicyProperties `json:"properties,omitempty"` + // Location - READ-ONLY; The location of the data masking policy. + Location *string `json:"location,omitempty"` + // Kind - READ-ONLY; The kind of data masking policy. Metadata, used for Azure portal. + Kind *string `json:"kind,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DataMaskingPolicy. +func (dmp DataMaskingPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dmp.DataMaskingPolicyProperties != nil { + objectMap["properties"] = dmp.DataMaskingPolicyProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DataMaskingPolicy struct. +func (dmp *DataMaskingPolicy) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var dataMaskingPolicyProperties DataMaskingPolicyProperties + err = json.Unmarshal(*v, &dataMaskingPolicyProperties) + if err != nil { + return err + } + dmp.DataMaskingPolicyProperties = &dataMaskingPolicyProperties + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + dmp.Location = &location + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + dmp.Kind = &kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dmp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dmp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dmp.Type = &typeVar + } + } + } + + return nil +} + +// DataMaskingPolicyProperties the properties of a database data masking policy. +type DataMaskingPolicyProperties struct { + // DataMaskingState - The state of the data masking policy. Possible values include: 'DataMaskingStateDisabled', 'DataMaskingStateEnabled' + DataMaskingState DataMaskingState `json:"dataMaskingState,omitempty"` + // ExemptPrincipals - The list of the exempt principals. Specifies the semicolon-separated list of database users for which the data masking policy does not apply. The specified users receive data results without masking for all of the database queries. + ExemptPrincipals *string `json:"exemptPrincipals,omitempty"` + // ApplicationPrincipals - READ-ONLY; The list of the application principals. This is a legacy parameter and is no longer used. + ApplicationPrincipals *string `json:"applicationPrincipals,omitempty"` + // MaskingLevel - READ-ONLY; The masking level. This is a legacy parameter and is no longer used. + MaskingLevel *string `json:"maskingLevel,omitempty"` +} + +// DataMaskingRule represents a database data masking rule. +type DataMaskingRule struct { + autorest.Response `json:"-"` + // DataMaskingRuleProperties - The properties of the resource. + *DataMaskingRuleProperties `json:"properties,omitempty"` + // Location - READ-ONLY; The location of the data masking rule. + Location *string `json:"location,omitempty"` + // Kind - READ-ONLY; The kind of Data Masking Rule. Metadata, used for Azure portal. + Kind *string `json:"kind,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DataMaskingRule. +func (dmr DataMaskingRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dmr.DataMaskingRuleProperties != nil { + objectMap["properties"] = dmr.DataMaskingRuleProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DataMaskingRule struct. +func (dmr *DataMaskingRule) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var dataMaskingRuleProperties DataMaskingRuleProperties + err = json.Unmarshal(*v, &dataMaskingRuleProperties) + if err != nil { + return err + } + dmr.DataMaskingRuleProperties = &dataMaskingRuleProperties + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + dmr.Location = &location + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + dmr.Kind = &kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dmr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dmr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dmr.Type = &typeVar + } + } + } + + return nil +} + +// DataMaskingRuleListResult the response to a list data masking rules request. +type DataMaskingRuleListResult struct { + autorest.Response `json:"-"` + // Value - The list of database data masking rules. + Value *[]DataMaskingRule `json:"value,omitempty"` +} + +// DataMaskingRuleProperties the properties of a database data masking rule. +type DataMaskingRuleProperties struct { + // ID - READ-ONLY; The rule Id. + ID *string `json:"id,omitempty"` + // AliasName - The alias name. This is a legacy parameter and is no longer used. + AliasName *string `json:"aliasName,omitempty"` + // RuleState - The rule state. Used to delete a rule. To delete an existing rule, specify the schemaName, tableName, columnName, maskingFunction, and specify ruleState as disabled. However, if the rule doesn't already exist, the rule will be created with ruleState set to enabled, regardless of the provided value of ruleState. Possible values include: 'DataMaskingRuleStateDisabled', 'DataMaskingRuleStateEnabled' + RuleState DataMaskingRuleState `json:"ruleState,omitempty"` + // SchemaName - The schema name on which the data masking rule is applied. + SchemaName *string `json:"schemaName,omitempty"` + // TableName - The table name on which the data masking rule is applied. + TableName *string `json:"tableName,omitempty"` + // ColumnName - The column name on which the data masking rule is applied. + ColumnName *string `json:"columnName,omitempty"` + // MaskingFunction - The masking function that is used for the data masking rule. Possible values include: 'DataMaskingFunctionDefault', 'DataMaskingFunctionCCN', 'DataMaskingFunctionEmail', 'DataMaskingFunctionNumber', 'DataMaskingFunctionSSN', 'DataMaskingFunctionText' + MaskingFunction DataMaskingFunction `json:"maskingFunction,omitempty"` + // NumberFrom - The numberFrom property of the masking rule. Required if maskingFunction is set to Number, otherwise this parameter will be ignored. + NumberFrom *string `json:"numberFrom,omitempty"` + // NumberTo - The numberTo property of the data masking rule. Required if maskingFunction is set to Number, otherwise this parameter will be ignored. + NumberTo *string `json:"numberTo,omitempty"` + // PrefixSize - If maskingFunction is set to Text, the number of characters to show unmasked in the beginning of the string. Otherwise, this parameter will be ignored. + PrefixSize *string `json:"prefixSize,omitempty"` + // SuffixSize - If maskingFunction is set to Text, the number of characters to show unmasked at the end of the string. Otherwise, this parameter will be ignored. + SuffixSize *string `json:"suffixSize,omitempty"` + // ReplacementString - If maskingFunction is set to Text, the character to use for masking the unexposed part of the string. Otherwise, this parameter will be ignored. + ReplacementString *string `json:"replacementString,omitempty"` +} + +// DisasterRecoveryConfiguration represents a disaster recovery configuration. +type DisasterRecoveryConfiguration struct { + autorest.Response `json:"-"` + // DisasterRecoveryConfigurationProperties - The properties representing the resource. + *DisasterRecoveryConfigurationProperties `json:"properties,omitempty"` + // Location - READ-ONLY; Location of the server that contains this disaster recovery configuration. + Location *string `json:"location,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 DisasterRecoveryConfiguration. +func (drc DisasterRecoveryConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if drc.DisasterRecoveryConfigurationProperties != nil { + objectMap["properties"] = drc.DisasterRecoveryConfigurationProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DisasterRecoveryConfiguration struct. +func (drc *DisasterRecoveryConfiguration) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var disasterRecoveryConfigurationProperties DisasterRecoveryConfigurationProperties + err = json.Unmarshal(*v, &disasterRecoveryConfigurationProperties) + if err != nil { + return err + } + drc.DisasterRecoveryConfigurationProperties = &disasterRecoveryConfigurationProperties + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + drc.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + drc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + drc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + drc.Type = &typeVar + } + } + } + + return nil +} + +// DisasterRecoveryConfigurationListResult represents the response to a List disaster recovery +// configuration request. +type DisasterRecoveryConfigurationListResult struct { + autorest.Response `json:"-"` + // Value - The list of disaster recovery configurations housed under the server. + Value *[]DisasterRecoveryConfiguration `json:"value,omitempty"` +} + +// DisasterRecoveryConfigurationProperties represents the properties of a disaster recovery configuration. +type DisasterRecoveryConfigurationProperties struct { + // Status - READ-ONLY; The status of the disaster recovery configuration. Possible values include: 'Creating', 'Ready', 'FailingOver', 'Dropping' + Status DisasterRecoveryConfigurationStatus `json:"status,omitempty"` + // AutoFailover - Whether or not failover can be done automatically. Possible values include: 'Off', 'On' + AutoFailover DisasterRecoveryConfigurationAutoFailover `json:"autoFailover,omitempty"` + // FailoverPolicy - How aggressive the automatic failover should be. Possible values include: 'Manual', 'Automatic' + FailoverPolicy DisasterRecoveryConfigurationFailoverPolicy `json:"failoverPolicy,omitempty"` + // PartnerServerID - Id of the partner server. + PartnerServerID *string `json:"partnerServerId,omitempty"` + // LogicalServerName - READ-ONLY; Logical name of the server. + LogicalServerName *string `json:"logicalServerName,omitempty"` + // PartnerLogicalServerName - READ-ONLY; Logical name of the partner server. + PartnerLogicalServerName *string `json:"partnerLogicalServerName,omitempty"` + // Role - READ-ONLY; The role of the current server in the disaster recovery configuration. Possible values include: 'None', 'Primary', 'Secondary' + Role DisasterRecoveryConfigurationRole `json:"role,omitempty"` +} + +// DisasterRecoveryConfigurationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type DisasterRecoveryConfigurationsCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DisasterRecoveryConfigurationsCreateOrUpdateFuture) Result(client DisasterRecoveryConfigurationsClient) (drc DisasterRecoveryConfiguration, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DisasterRecoveryConfigurationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("sql.DisasterRecoveryConfigurationsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if drc.Response.Response, err = future.GetResult(sender); err == nil && drc.Response.Response.StatusCode != http.StatusNoContent { + drc, err = client.CreateOrUpdateResponder(drc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DisasterRecoveryConfigurationsCreateOrUpdateFuture", "Result", drc.Response.Response, "Failure responding to request") + } + } + return +} + +// DisasterRecoveryConfigurationsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type DisasterRecoveryConfigurationsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DisasterRecoveryConfigurationsDeleteFuture) Result(client DisasterRecoveryConfigurationsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DisasterRecoveryConfigurationsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("sql.DisasterRecoveryConfigurationsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// DisasterRecoveryConfigurationsFailoverAllowDataLossFuture an abstraction for monitoring and retrieving +// the results of a long-running operation. +type DisasterRecoveryConfigurationsFailoverAllowDataLossFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DisasterRecoveryConfigurationsFailoverAllowDataLossFuture) Result(client DisasterRecoveryConfigurationsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DisasterRecoveryConfigurationsFailoverAllowDataLossFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("sql.DisasterRecoveryConfigurationsFailoverAllowDataLossFuture") + return + } + ar.Response = future.Response() + return +} + +// DisasterRecoveryConfigurationsFailoverFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type DisasterRecoveryConfigurationsFailoverFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DisasterRecoveryConfigurationsFailoverFuture) Result(client DisasterRecoveryConfigurationsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DisasterRecoveryConfigurationsFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("sql.DisasterRecoveryConfigurationsFailoverFuture") + return + } + ar.Response = future.Response() + return +} + +// EditionCapability the database edition capabilities. +type EditionCapability struct { + // Name - READ-ONLY; The edition name. + Name *string `json:"name,omitempty"` + // Status - READ-ONLY; The status of the edition. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' + Status CapabilityStatus `json:"status,omitempty"` + // SupportedServiceLevelObjectives - READ-ONLY; The list of supported service objectives for the edition. + SupportedServiceLevelObjectives *[]ServiceObjectiveCapability `json:"supportedServiceLevelObjectives,omitempty"` + // ZoneRedundant - READ-ONLY; Whether or not zone redundancy is supported for the edition. + ZoneRedundant *bool `json:"zoneRedundant,omitempty"` +} + +// ElasticPool represents a database elastic pool. +type ElasticPool struct { + autorest.Response `json:"-"` + // ElasticPoolProperties - The properties representing the resource. + *ElasticPoolProperties `json:"properties,omitempty"` + // Kind - READ-ONLY; Kind of elastic pool. This is metadata used for the Azure portal experience. + Kind *string `json:"kind,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ElasticPool. +func (ep ElasticPool) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ep.ElasticPoolProperties != nil { + objectMap["properties"] = ep.ElasticPoolProperties + } + if ep.Location != nil { + objectMap["location"] = ep.Location + } + if ep.Tags != nil { + objectMap["tags"] = ep.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ElasticPool struct. +func (ep *ElasticPool) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var elasticPoolProperties ElasticPoolProperties + err = json.Unmarshal(*v, &elasticPoolProperties) + if err != nil { + return err + } + ep.ElasticPoolProperties = &elasticPoolProperties + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ep.Kind = &kind + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ep.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ep.Tags = tags + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ep.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ep.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ep.Type = &typeVar + } + } + } + + return nil +} + +// ElasticPoolActivity represents the activity on an elastic pool. +type ElasticPoolActivity struct { + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // ElasticPoolActivityProperties - The properties representing the resource. + *ElasticPoolActivityProperties `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 ElasticPoolActivity. +func (epa ElasticPoolActivity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if epa.Location != nil { + objectMap["location"] = epa.Location + } + if epa.ElasticPoolActivityProperties != nil { + objectMap["properties"] = epa.ElasticPoolActivityProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ElasticPoolActivity struct. +func (epa *ElasticPoolActivity) UnmarshalJSON(body []byte) error { + 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 + } + epa.Location = &location + } + case "properties": + if v != nil { + var elasticPoolActivityProperties ElasticPoolActivityProperties + err = json.Unmarshal(*v, &elasticPoolActivityProperties) + if err != nil { + return err + } + epa.ElasticPoolActivityProperties = &elasticPoolActivityProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + epa.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + epa.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + epa.Type = &typeVar + } + } + } + + return nil +} + +// ElasticPoolActivityListResult represents the response to a list elastic pool activity request. +type ElasticPoolActivityListResult struct { + autorest.Response `json:"-"` + // Value - The list of elastic pool activities. + Value *[]ElasticPoolActivity `json:"value,omitempty"` +} + +// ElasticPoolActivityProperties represents the properties of an elastic pool. +type ElasticPoolActivityProperties struct { + // EndTime - READ-ONLY; The time the operation finished (ISO8601 format). + EndTime *date.Time `json:"endTime,omitempty"` + // ErrorCode - READ-ONLY; The error code if available. + ErrorCode *int32 `json:"errorCode,omitempty"` + // ErrorMessage - READ-ONLY; The error message if available. + ErrorMessage *string `json:"errorMessage,omitempty"` + // ErrorSeverity - READ-ONLY; The error severity if available. + ErrorSeverity *int32 `json:"errorSeverity,omitempty"` + // Operation - READ-ONLY; The operation name. + Operation *string `json:"operation,omitempty"` + // OperationID - READ-ONLY; The unique operation ID. + OperationID *uuid.UUID `json:"operationId,omitempty"` + // PercentComplete - READ-ONLY; The percentage complete if available. + PercentComplete *int32 `json:"percentComplete,omitempty"` + // RequestedDatabaseDtuMax - READ-ONLY; The requested max DTU per database if available. + RequestedDatabaseDtuMax *int32 `json:"requestedDatabaseDtuMax,omitempty"` + // RequestedDatabaseDtuMin - READ-ONLY; The requested min DTU per database if available. + RequestedDatabaseDtuMin *int32 `json:"requestedDatabaseDtuMin,omitempty"` + // RequestedDtu - READ-ONLY; The requested DTU for the pool if available. + RequestedDtu *int32 `json:"requestedDtu,omitempty"` + // RequestedElasticPoolName - READ-ONLY; The requested name for the elastic pool if available. + RequestedElasticPoolName *string `json:"requestedElasticPoolName,omitempty"` + // RequestedStorageLimitInGB - READ-ONLY; The requested storage limit for the pool in GB if available. + RequestedStorageLimitInGB *int64 `json:"requestedStorageLimitInGB,omitempty"` + // ElasticPoolName - READ-ONLY; The name of the elastic pool. + ElasticPoolName *string `json:"elasticPoolName,omitempty"` + // ServerName - READ-ONLY; The name of the server the elastic pool is in. + ServerName *string `json:"serverName,omitempty"` + // StartTime - READ-ONLY; The time the operation started (ISO8601 format). + StartTime *date.Time `json:"startTime,omitempty"` + // State - READ-ONLY; The current state of the operation. + State *string `json:"state,omitempty"` + // RequestedStorageLimitInMB - READ-ONLY; The requested storage limit in MB. + RequestedStorageLimitInMB *int32 `json:"requestedStorageLimitInMB,omitempty"` + // RequestedDatabaseDtuGuarantee - READ-ONLY; The requested per database DTU guarantee. + RequestedDatabaseDtuGuarantee *int32 `json:"requestedDatabaseDtuGuarantee,omitempty"` + // RequestedDatabaseDtuCap - READ-ONLY; The requested per database DTU cap. + RequestedDatabaseDtuCap *int32 `json:"requestedDatabaseDtuCap,omitempty"` + // RequestedDtuGuarantee - READ-ONLY; The requested DTU guarantee. + RequestedDtuGuarantee *int32 `json:"requestedDtuGuarantee,omitempty"` +} + +// ElasticPoolDatabaseActivity represents the activity on an elastic pool. +type ElasticPoolDatabaseActivity struct { + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // ElasticPoolDatabaseActivityProperties - The properties representing the resource. + *ElasticPoolDatabaseActivityProperties `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 ElasticPoolDatabaseActivity. +func (epda ElasticPoolDatabaseActivity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if epda.Location != nil { + objectMap["location"] = epda.Location + } + if epda.ElasticPoolDatabaseActivityProperties != nil { + objectMap["properties"] = epda.ElasticPoolDatabaseActivityProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ElasticPoolDatabaseActivity struct. +func (epda *ElasticPoolDatabaseActivity) UnmarshalJSON(body []byte) error { + 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 + } + epda.Location = &location + } + case "properties": + if v != nil { + var elasticPoolDatabaseActivityProperties ElasticPoolDatabaseActivityProperties + err = json.Unmarshal(*v, &elasticPoolDatabaseActivityProperties) + if err != nil { + return err + } + epda.ElasticPoolDatabaseActivityProperties = &elasticPoolDatabaseActivityProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + epda.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + epda.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + epda.Type = &typeVar + } + } + } + + return nil +} + +// ElasticPoolDatabaseActivityListResult represents the response to a list elastic pool database activity +// request. +type ElasticPoolDatabaseActivityListResult struct { + autorest.Response `json:"-"` + // Value - The list of elastic pool database activities. + Value *[]ElasticPoolDatabaseActivity `json:"value,omitempty"` +} + +// ElasticPoolDatabaseActivityProperties represents the properties of an elastic pool database activity. +type ElasticPoolDatabaseActivityProperties struct { + // DatabaseName - READ-ONLY; The database name. + DatabaseName *string `json:"databaseName,omitempty"` + // EndTime - READ-ONLY; The time the operation finished (ISO8601 format). + EndTime *date.Time `json:"endTime,omitempty"` + // ErrorCode - READ-ONLY; The error code if available. + ErrorCode *int32 `json:"errorCode,omitempty"` + // ErrorMessage - READ-ONLY; The error message if available. + ErrorMessage *string `json:"errorMessage,omitempty"` + // ErrorSeverity - READ-ONLY; The error severity if available. + ErrorSeverity *int32 `json:"errorSeverity,omitempty"` + // Operation - READ-ONLY; The operation name. + Operation *string `json:"operation,omitempty"` + // OperationID - READ-ONLY; The unique operation ID. + OperationID *uuid.UUID `json:"operationId,omitempty"` + // PercentComplete - READ-ONLY; The percentage complete if available. + PercentComplete *int32 `json:"percentComplete,omitempty"` + // RequestedElasticPoolName - READ-ONLY; The name for the elastic pool the database is moving into if available. + RequestedElasticPoolName *string `json:"requestedElasticPoolName,omitempty"` + // CurrentElasticPoolName - READ-ONLY; The name of the current elastic pool the database is in if available. + CurrentElasticPoolName *string `json:"currentElasticPoolName,omitempty"` + // CurrentServiceObjective - READ-ONLY; The name of the current service objective if available. + CurrentServiceObjective *string `json:"currentServiceObjective,omitempty"` + // RequestedServiceObjective - READ-ONLY; The name of the requested service objective if available. + RequestedServiceObjective *string `json:"requestedServiceObjective,omitempty"` + // ServerName - READ-ONLY; The name of the server the elastic pool is in. + ServerName *string `json:"serverName,omitempty"` + // StartTime - READ-ONLY; The time the operation started (ISO8601 format). + StartTime *date.Time `json:"startTime,omitempty"` + // State - READ-ONLY; The current state of the operation. + State *string `json:"state,omitempty"` +} + +// ElasticPoolDtuCapability the Elastic Pool DTU capability. +type ElasticPoolDtuCapability struct { + // Limit - READ-ONLY; The maximum size of the database (see 'unit' for the units). + Limit *int64 `json:"limit,omitempty"` + // MaxDatabaseCount - READ-ONLY; The maximum number of databases supported. + MaxDatabaseCount *int64 `json:"maxDatabaseCount,omitempty"` + // Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' + Status CapabilityStatus `json:"status,omitempty"` + // SupportedMaxSizes - READ-ONLY; The list of supported max sizes. + SupportedMaxSizes *[]MaxSizeCapability `json:"supportedMaxSizes,omitempty"` + // IncludedMaxSize - READ-ONLY; The included (free) max size for this service level objective. + IncludedMaxSize *MaxSizeCapability `json:"includedMaxSize,omitempty"` + // SupportedPerDatabaseMaxSizes - READ-ONLY; The list of supported max database sizes. + SupportedPerDatabaseMaxSizes *[]MaxSizeCapability `json:"supportedPerDatabaseMaxSizes,omitempty"` + // SupportedPerDatabaseMaxDtus - READ-ONLY; The list of supported max database DTUs. + SupportedPerDatabaseMaxDtus *[]ElasticPoolPerDatabaseMaxDtuCapability `json:"supportedPerDatabaseMaxDtus,omitempty"` +} + +// ElasticPoolEditionCapability the elastic pool edition capabilities. +type ElasticPoolEditionCapability struct { + // Name - READ-ONLY; The elastic pool edition name. + Name *string `json:"name,omitempty"` + // Status - READ-ONLY; The status of the elastic pool edition. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' + Status CapabilityStatus `json:"status,omitempty"` + // SupportedElasticPoolDtus - READ-ONLY; The list of supported elastic pool DTU levels for the edition. + SupportedElasticPoolDtus *[]ElasticPoolDtuCapability `json:"supportedElasticPoolDtus,omitempty"` + // ZoneRedundant - READ-ONLY; Whether or not zone redundancy is supported for the edition. + ZoneRedundant *bool `json:"zoneRedundant,omitempty"` +} + +// ElasticPoolListResult represents the response to a list elastic pool request. +type ElasticPoolListResult struct { + autorest.Response `json:"-"` + // Value - The list of elastic pools hosted in the server. + Value *[]ElasticPool `json:"value,omitempty"` +} + +// ElasticPoolPerDatabaseMaxDtuCapability the max per-database DTU capability. +type ElasticPoolPerDatabaseMaxDtuCapability struct { + // Limit - READ-ONLY; The maximum DTUs per database. + Limit *int64 `json:"limit,omitempty"` + // Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' + Status CapabilityStatus `json:"status,omitempty"` + // SupportedPerDatabaseMinDtus - READ-ONLY; The list of supported min database DTUs. + SupportedPerDatabaseMinDtus *[]ElasticPoolPerDatabaseMinDtuCapability `json:"supportedPerDatabaseMinDtus,omitempty"` +} + +// ElasticPoolPerDatabaseMinDtuCapability the minimum per-database DTU capability. +type ElasticPoolPerDatabaseMinDtuCapability struct { + // Limit - READ-ONLY; The maximum DTUs per database. + Limit *int64 `json:"limit,omitempty"` + // Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' + Status CapabilityStatus `json:"status,omitempty"` +} + +// ElasticPoolProperties represents the properties of an elastic pool. +type ElasticPoolProperties struct { + // CreationDate - READ-ONLY; The creation date of the elastic pool (ISO8601 format). + CreationDate *date.Time `json:"creationDate,omitempty"` + // State - READ-ONLY; The state of the elastic pool. Possible values include: 'ElasticPoolStateCreating', 'ElasticPoolStateReady', 'ElasticPoolStateDisabled' + State ElasticPoolState `json:"state,omitempty"` + // Edition - The edition of the elastic pool. Possible values include: 'ElasticPoolEditionBasic', 'ElasticPoolEditionStandard', 'ElasticPoolEditionPremium', 'ElasticPoolEditionGeneralPurpose', 'ElasticPoolEditionBusinessCritical' + Edition ElasticPoolEdition `json:"edition,omitempty"` + // Dtu - The total shared DTU for the database elastic pool. + Dtu *int32 `json:"dtu,omitempty"` + // DatabaseDtuMax - The maximum DTU any one database can consume. + DatabaseDtuMax *int32 `json:"databaseDtuMax,omitempty"` + // DatabaseDtuMin - The minimum DTU all databases are guaranteed. + DatabaseDtuMin *int32 `json:"databaseDtuMin,omitempty"` + // StorageMB - Gets storage limit for the database elastic pool in MB. + StorageMB *int32 `json:"storageMB,omitempty"` + // ZoneRedundant - Whether or not this database elastic pool is zone redundant, which means the replicas of this database will be spread across multiple availability zones. + ZoneRedundant *bool `json:"zoneRedundant,omitempty"` +} + +// ElasticPoolsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ElasticPoolsCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ElasticPoolsCreateOrUpdateFuture) Result(client ElasticPoolsClient) (ep ElasticPool, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ElasticPoolsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("sql.ElasticPoolsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ep.Response.Response, err = future.GetResult(sender); err == nil && ep.Response.Response.StatusCode != http.StatusNoContent { + ep, err = client.CreateOrUpdateResponder(ep.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ElasticPoolsCreateOrUpdateFuture", "Result", ep.Response.Response, "Failure responding to request") + } + } + return +} + +// ElasticPoolsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ElasticPoolsUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ElasticPoolsUpdateFuture) Result(client ElasticPoolsClient) (ep ElasticPool, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ElasticPoolsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("sql.ElasticPoolsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ep.Response.Response, err = future.GetResult(sender); err == nil && ep.Response.Response.StatusCode != http.StatusNoContent { + ep, err = client.UpdateResponder(ep.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ElasticPoolsUpdateFuture", "Result", ep.Response.Response, "Failure responding to request") + } + } + return +} + +// ElasticPoolUpdate represents an elastic pool update. +type ElasticPoolUpdate struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ElasticPoolProperties - The properties representing the resource. + *ElasticPoolProperties `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 ElasticPoolUpdate. +func (epu ElasticPoolUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if epu.Tags != nil { + objectMap["tags"] = epu.Tags + } + if epu.ElasticPoolProperties != nil { + objectMap["properties"] = epu.ElasticPoolProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ElasticPoolUpdate struct. +func (epu *ElasticPoolUpdate) UnmarshalJSON(body []byte) error { + 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 + } + epu.Tags = tags + } + case "properties": + if v != nil { + var elasticPoolProperties ElasticPoolProperties + err = json.Unmarshal(*v, &elasticPoolProperties) + if err != nil { + return err + } + epu.ElasticPoolProperties = &elasticPoolProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + epu.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + epu.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + epu.Type = &typeVar + } + } + } + + return nil +} + +// ExportRequest export database parameters. +type ExportRequest struct { + // StorageKeyType - The type of the storage key to use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + StorageKeyType StorageKeyType `json:"storageKeyType,omitempty"` + // StorageKey - The storage key to use. If storage key type is SharedAccessKey, it must be preceded with a "?." + StorageKey *string `json:"storageKey,omitempty"` + // StorageURI - The storage uri to use. + StorageURI *string `json:"storageUri,omitempty"` + // AdministratorLogin - The name of the SQL administrator. + AdministratorLogin *string `json:"administratorLogin,omitempty"` + // AdministratorLoginPassword - The password of the SQL administrator. + AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"` + // AuthenticationType - The authentication type. Possible values include: 'SQL', 'ADPassword' + AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` +} + +// ExtensionListResult represents the response to a list extensions request. +type ExtensionListResult struct { + autorest.Response `json:"-"` + // Value - The list of extensions. + Value *[]interface{} `json:"value,omitempty"` +} + +// FirewallRule represents a server firewall rule. +type FirewallRule struct { + autorest.Response `json:"-"` + // Kind - READ-ONLY; Kind of server that contains this firewall rule. + Kind *string `json:"kind,omitempty"` + // Location - READ-ONLY; Location of the server that contains this firewall rule. + Location *string `json:"location,omitempty"` + // FirewallRuleProperties - The properties representing the resource. + *FirewallRuleProperties `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 FirewallRule. +func (fr FirewallRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if fr.FirewallRuleProperties != nil { + objectMap["properties"] = fr.FirewallRuleProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for FirewallRule struct. +func (fr *FirewallRule) UnmarshalJSON(body []byte) error { + 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 string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + fr.Kind = &kind + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + fr.Location = &location + } + case "properties": + if v != nil { + var firewallRuleProperties FirewallRuleProperties + err = json.Unmarshal(*v, &firewallRuleProperties) + if err != nil { + return err + } + fr.FirewallRuleProperties = &firewallRuleProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + fr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + fr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + fr.Type = &typeVar + } + } + } + + return nil +} + +// FirewallRuleListResult represents the response to a List Firewall Rules request. +type FirewallRuleListResult struct { + autorest.Response `json:"-"` + // Value - The list of server firewall rules. + Value *[]FirewallRule `json:"value,omitempty"` +} + +// FirewallRuleProperties represents the properties of a server firewall rule. +type FirewallRuleProperties struct { + // StartIPAddress - The start IP address of the firewall rule. Must be IPv4 format. Use value '0.0.0.0' to represent all Azure-internal IP addresses. + StartIPAddress *string `json:"startIpAddress,omitempty"` + // EndIPAddress - The end IP address of the firewall rule. Must be IPv4 format. Must be greater than or equal to startIpAddress. Use value '0.0.0.0' to represent all Azure-internal IP addresses. + EndIPAddress *string `json:"endIpAddress,omitempty"` +} + +// GeoBackupPolicy a database geo backup policy. +type GeoBackupPolicy struct { + autorest.Response `json:"-"` + // GeoBackupPolicyProperties - The properties of the geo backup policy. + *GeoBackupPolicyProperties `json:"properties,omitempty"` + // Kind - READ-ONLY; Kind of geo backup policy. This is metadata used for the Azure portal experience. + Kind *string `json:"kind,omitempty"` + // Location - READ-ONLY; Backup policy location. + Location *string `json:"location,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 GeoBackupPolicy. +func (gbp GeoBackupPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gbp.GeoBackupPolicyProperties != nil { + objectMap["properties"] = gbp.GeoBackupPolicyProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for GeoBackupPolicy struct. +func (gbp *GeoBackupPolicy) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var geoBackupPolicyProperties GeoBackupPolicyProperties + err = json.Unmarshal(*v, &geoBackupPolicyProperties) + if err != nil { + return err + } + gbp.GeoBackupPolicyProperties = &geoBackupPolicyProperties + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + gbp.Kind = &kind + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + gbp.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + gbp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + gbp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + gbp.Type = &typeVar + } + } + } + + return nil +} + +// GeoBackupPolicyListResult the response to a list geo backup policies request. +type GeoBackupPolicyListResult struct { + autorest.Response `json:"-"` + // Value - The list of geo backup policies. + Value *[]GeoBackupPolicy `json:"value,omitempty"` +} + +// GeoBackupPolicyProperties the properties of the geo backup policy. +type GeoBackupPolicyProperties struct { + // State - The state of the geo backup policy. Possible values include: 'GeoBackupPolicyStateDisabled', 'GeoBackupPolicyStateEnabled' + State GeoBackupPolicyState `json:"state,omitempty"` + // StorageType - READ-ONLY; The storage type of the geo backup policy. + StorageType *string `json:"storageType,omitempty"` +} + +// ImportExportResponse response for Import/Export Get operation. +type ImportExportResponse struct { + autorest.Response `json:"-"` + // ImportExportResponseProperties - The import/export operation properties. + *ImportExportResponseProperties `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 ImportExportResponse. +func (ier ImportExportResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ier.ImportExportResponseProperties != nil { + objectMap["properties"] = ier.ImportExportResponseProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ImportExportResponse struct. +func (ier *ImportExportResponse) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var importExportResponseProperties ImportExportResponseProperties + err = json.Unmarshal(*v, &importExportResponseProperties) + if err != nil { + return err + } + ier.ImportExportResponseProperties = &importExportResponseProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ier.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ier.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ier.Type = &typeVar + } + } + } + + return nil +} + +// ImportExportResponseProperties response for Import/Export Status operation. +type ImportExportResponseProperties struct { + // RequestType - READ-ONLY; The request type of the operation. + RequestType *string `json:"requestType,omitempty"` + // RequestID - READ-ONLY; The request type of the operation. + RequestID *uuid.UUID `json:"requestId,omitempty"` + // ServerName - READ-ONLY; The name of the server. + ServerName *string `json:"serverName,omitempty"` + // DatabaseName - READ-ONLY; The name of the database. + DatabaseName *string `json:"databaseName,omitempty"` + // Status - READ-ONLY; The status message returned from the server. + Status *string `json:"status,omitempty"` + // LastModifiedTime - READ-ONLY; The operation status last modified time. + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + // QueuedTime - READ-ONLY; The operation queued time. + QueuedTime *string `json:"queuedTime,omitempty"` + // BlobURI - READ-ONLY; The blob uri. + BlobURI *string `json:"blobUri,omitempty"` + // ErrorMessage - READ-ONLY; The error message returned from the server. + ErrorMessage *string `json:"errorMessage,omitempty"` +} + +// ImportExtensionProperties represents the properties for an import operation +type ImportExtensionProperties struct { + // OperationMode - The type of import operation being performed. This is always Import. + OperationMode *string `json:"operationMode,omitempty"` + // StorageKeyType - The type of the storage key to use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + StorageKeyType StorageKeyType `json:"storageKeyType,omitempty"` + // StorageKey - The storage key to use. If storage key type is SharedAccessKey, it must be preceded with a "?." + StorageKey *string `json:"storageKey,omitempty"` + // StorageURI - The storage uri to use. + StorageURI *string `json:"storageUri,omitempty"` + // AdministratorLogin - The name of the SQL administrator. + AdministratorLogin *string `json:"administratorLogin,omitempty"` + // AdministratorLoginPassword - The password of the SQL administrator. + AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"` + // AuthenticationType - The authentication type. Possible values include: 'SQL', 'ADPassword' + AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` +} + +// ImportExtensionRequest import database parameters. +type ImportExtensionRequest struct { + // Name - The name of the extension. + Name *string `json:"name,omitempty"` + // Type - The type of the extension. + Type *string `json:"type,omitempty"` + // ImportExtensionProperties - Represents the properties of the resource. + *ImportExtensionProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ImportExtensionRequest. +func (ier ImportExtensionRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ier.Name != nil { + objectMap["name"] = ier.Name + } + if ier.Type != nil { + objectMap["type"] = ier.Type + } + if ier.ImportExtensionProperties != nil { + objectMap["properties"] = ier.ImportExtensionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ImportExtensionRequest struct. +func (ier *ImportExtensionRequest) UnmarshalJSON(body []byte) error { + 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 + } + ier.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ier.Type = &typeVar + } + case "properties": + if v != nil { + var importExtensionProperties ImportExtensionProperties + err = json.Unmarshal(*v, &importExtensionProperties) + if err != nil { + return err + } + ier.ImportExtensionProperties = &importExtensionProperties + } + } + } + + return nil +} + +// ImportRequest import database parameters. +type ImportRequest struct { + // DatabaseName - The name of the database to import. + DatabaseName *string `json:"databaseName,omitempty"` + // Edition - The edition for the database being created. + // + // The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API or one of the following commands: + // + // ```azurecli + // az sql db list-editions -l -o table + // ```` + // + // ```powershell + // Get-AzSqlServerServiceObjective -Location + // ```` + // . Possible values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2', 'GeneralPurpose', 'BusinessCritical', 'Hyperscale' + Edition DatabaseEdition `json:"edition,omitempty"` + // ServiceObjectiveName - The name of the service objective to assign to the database. Possible values include: 'ServiceObjectiveNameSystem', 'ServiceObjectiveNameSystem0', 'ServiceObjectiveNameSystem1', 'ServiceObjectiveNameSystem2', 'ServiceObjectiveNameSystem3', 'ServiceObjectiveNameSystem4', 'ServiceObjectiveNameSystem2L', 'ServiceObjectiveNameSystem3L', 'ServiceObjectiveNameSystem4L', 'ServiceObjectiveNameFree', 'ServiceObjectiveNameBasic', 'ServiceObjectiveNameS0', 'ServiceObjectiveNameS1', 'ServiceObjectiveNameS2', 'ServiceObjectiveNameS3', 'ServiceObjectiveNameS4', 'ServiceObjectiveNameS6', 'ServiceObjectiveNameS7', 'ServiceObjectiveNameS9', 'ServiceObjectiveNameS12', 'ServiceObjectiveNameP1', 'ServiceObjectiveNameP2', 'ServiceObjectiveNameP3', 'ServiceObjectiveNameP4', 'ServiceObjectiveNameP6', 'ServiceObjectiveNameP11', 'ServiceObjectiveNameP15', 'ServiceObjectiveNamePRS1', 'ServiceObjectiveNamePRS2', 'ServiceObjectiveNamePRS4', 'ServiceObjectiveNamePRS6', 'ServiceObjectiveNameDW100', 'ServiceObjectiveNameDW200', 'ServiceObjectiveNameDW300', 'ServiceObjectiveNameDW400', 'ServiceObjectiveNameDW500', 'ServiceObjectiveNameDW600', 'ServiceObjectiveNameDW1000', 'ServiceObjectiveNameDW1200', 'ServiceObjectiveNameDW1000c', 'ServiceObjectiveNameDW1500', 'ServiceObjectiveNameDW1500c', 'ServiceObjectiveNameDW2000', 'ServiceObjectiveNameDW2000c', 'ServiceObjectiveNameDW3000', 'ServiceObjectiveNameDW2500c', 'ServiceObjectiveNameDW3000c', 'ServiceObjectiveNameDW6000', 'ServiceObjectiveNameDW5000c', 'ServiceObjectiveNameDW6000c', 'ServiceObjectiveNameDW7500c', 'ServiceObjectiveNameDW10000c', 'ServiceObjectiveNameDW15000c', 'ServiceObjectiveNameDW30000c', 'ServiceObjectiveNameDS100', 'ServiceObjectiveNameDS200', 'ServiceObjectiveNameDS300', 'ServiceObjectiveNameDS400', 'ServiceObjectiveNameDS500', 'ServiceObjectiveNameDS600', 'ServiceObjectiveNameDS1000', 'ServiceObjectiveNameDS1200', 'ServiceObjectiveNameDS1500', 'ServiceObjectiveNameDS2000', 'ServiceObjectiveNameElasticPool' + ServiceObjectiveName ServiceObjectiveName `json:"serviceObjectiveName,omitempty"` + // MaxSizeBytes - The maximum size for the newly imported database. + MaxSizeBytes *string `json:"maxSizeBytes,omitempty"` + // StorageKeyType - The type of the storage key to use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + StorageKeyType StorageKeyType `json:"storageKeyType,omitempty"` + // StorageKey - The storage key to use. If storage key type is SharedAccessKey, it must be preceded with a "?." + StorageKey *string `json:"storageKey,omitempty"` + // StorageURI - The storage uri to use. + StorageURI *string `json:"storageUri,omitempty"` + // AdministratorLogin - The name of the SQL administrator. + AdministratorLogin *string `json:"administratorLogin,omitempty"` + // AdministratorLoginPassword - The password of the SQL administrator. + AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"` + // AuthenticationType - The authentication type. Possible values include: 'SQL', 'ADPassword' + AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` +} + +// LocationCapabilities the capabilities for a location. +type LocationCapabilities struct { + autorest.Response `json:"-"` + // Name - READ-ONLY; The location name. + Name *string `json:"name,omitempty"` + // Status - READ-ONLY; Azure SQL Database's status for the location. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' + Status CapabilityStatus `json:"status,omitempty"` + // SupportedServerVersions - READ-ONLY; The list of supported server versions. + SupportedServerVersions *[]ServerVersionCapability `json:"supportedServerVersions,omitempty"` +} + +// MaxSizeCapability the maximum size limits for a database. +type MaxSizeCapability struct { + // Limit - READ-ONLY; The maximum size of the database (see 'unit' for the units). + Limit *int64 `json:"limit,omitempty"` + // Unit - READ-ONLY; The units that the limit is expressed in. Possible values include: 'Megabytes', 'Gigabytes', 'Terabytes', 'Petabytes' + Unit MaxSizeUnits `json:"unit,omitempty"` + // Status - READ-ONLY; The status of the maximum size capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' + Status CapabilityStatus `json:"status,omitempty"` +} + +// Metric database metrics. +type Metric struct { + // StartTime - READ-ONLY; The start time for the metric (ISO-8601 format). + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - READ-ONLY; The end time for the metric (ISO-8601 format). + EndTime *date.Time `json:"endTime,omitempty"` + // TimeGrain - READ-ONLY; The time step to be used to summarize the metric values. + TimeGrain *string `json:"timeGrain,omitempty"` + // Unit - READ-ONLY; The unit of the metric. Possible values include: 'UnitTypeCount', 'UnitTypeBytes', 'UnitTypeSeconds', 'UnitTypePercent', 'UnitTypeCountPerSecond', 'UnitTypeBytesPerSecond' + Unit UnitType `json:"unit,omitempty"` + // Name - READ-ONLY; The name information for the metric. + Name *MetricName `json:"name,omitempty"` + // MetricValues - READ-ONLY; The metric values for the specified time window and timestep. + MetricValues *[]MetricValue `json:"metricValues,omitempty"` +} + +// MetricAvailability a metric availability value. +type MetricAvailability struct { + // Retention - READ-ONLY; The length of retention for the database metric. + Retention *string `json:"retention,omitempty"` + // TimeGrain - READ-ONLY; The granularity of the database metric. + TimeGrain *string `json:"timeGrain,omitempty"` +} + +// MetricDefinition a database metric definition. +type MetricDefinition struct { + // Name - READ-ONLY; The name information for the metric. + Name *MetricName `json:"name,omitempty"` + // PrimaryAggregationType - READ-ONLY; The primary aggregation type defining how metric values are displayed. Possible values include: 'PrimaryAggregationTypeNone', 'PrimaryAggregationTypeAverage', 'PrimaryAggregationTypeCount', 'PrimaryAggregationTypeMinimum', 'PrimaryAggregationTypeMaximum', 'PrimaryAggregationTypeTotal' + PrimaryAggregationType PrimaryAggregationType `json:"primaryAggregationType,omitempty"` + // ResourceURI - READ-ONLY; The resource uri of the database. + ResourceURI *string `json:"resourceUri,omitempty"` + // Unit - READ-ONLY; The unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond' + Unit UnitDefinitionType `json:"unit,omitempty"` + // MetricAvailabilities - READ-ONLY; The list of database metric availabilities for the metric. + MetricAvailabilities *[]MetricAvailability `json:"metricAvailabilities,omitempty"` +} + +// MetricDefinitionListResult the response to a list database metric definitions request. +type MetricDefinitionListResult struct { + autorest.Response `json:"-"` + // Value - The list of metric definitions for the database. + Value *[]MetricDefinition `json:"value,omitempty"` +} + +// MetricListResult the response to a list database metrics request. +type MetricListResult struct { + autorest.Response `json:"-"` + // Value - The list of metrics for the database. + Value *[]Metric `json:"value,omitempty"` +} + +// MetricName a database metric name. +type MetricName struct { + // Value - READ-ONLY; The name of the database metric. + Value *string `json:"value,omitempty"` + // LocalizedValue - READ-ONLY; The friendly name of the database metric. + LocalizedValue *string `json:"localizedValue,omitempty"` +} + +// MetricValue represents database metrics. +type MetricValue struct { + // Count - READ-ONLY; The number of values for the metric. + Count *float64 `json:"count,omitempty"` + // Average - READ-ONLY; The average value of the metric. + Average *float64 `json:"average,omitempty"` + // Maximum - READ-ONLY; The max value of the metric. + Maximum *float64 `json:"maximum,omitempty"` + // Minimum - READ-ONLY; The min value of the metric. + Minimum *float64 `json:"minimum,omitempty"` + // Timestamp - READ-ONLY; The metric timestamp (ISO-8601 format). + Timestamp *date.Time `json:"timestamp,omitempty"` + // Total - READ-ONLY; The total value of the metric. + Total *float64 `json:"total,omitempty"` +} + +// Operation SQL REST API operation definition. +type Operation struct { + // Name - Operation name: {provider}/{resource}/{operation} + Name *string `json:"name,omitempty"` + // Display - Display metadata associated with the operation. + Display *OperationDisplay `json:"display,omitempty"` +} + +// OperationDisplay display metadata associated with the operation. +type OperationDisplay struct { + // Provider - Service provider: Microsoft SQL Database. + Provider *string `json:"provider,omitempty"` + // Resource - Resource on which the operation is performed: Server, Database, etc. + Resource *string `json:"resource,omitempty"` + // Operation - Type of operation: get, read, delete, etc. + Operation *string `json:"operation,omitempty"` +} + +// OperationImpact the impact of an operation, both in absolute and relative terms. +type OperationImpact struct { + // Name - READ-ONLY; The name of the impact dimension. + Name *string `json:"name,omitempty"` + // Unit - READ-ONLY; The unit in which estimated impact to dimension is measured. + Unit *string `json:"unit,omitempty"` + // ChangeValueAbsolute - READ-ONLY; The absolute impact to dimension. + ChangeValueAbsolute *float64 `json:"changeValueAbsolute,omitempty"` + // ChangeValueRelative - READ-ONLY; The relative impact to dimension (null if not applicable) + ChangeValueRelative *float64 `json:"changeValueRelative,omitempty"` +} + +// OperationListResult result of the request to list SQL 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 SQL operations supported by the SQL 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"` +} + +// PerformanceLevel a possible performance level of a service objective capability. +type PerformanceLevel struct { + // Unit - READ-ONLY; Unit type used to measure service objective performance level. Possible values include: 'DTU' + Unit PerformanceLevelUnit `json:"unit,omitempty"` + // Value - READ-ONLY; Performance level value. + Value *int32 `json:"value,omitempty"` +} + +// ProxyResource ARM proxy resource. +type ProxyResource struct { + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// QueryInterval a database query. +type QueryInterval struct { + // IntervalStartTime - READ-ONLY; The start time of the measurement interval (ISO8601 format). + IntervalStartTime *date.Time `json:"intervalStartTime,omitempty"` + // ExecutionCount - READ-ONLY; The number of times the query was executed during this interval. + ExecutionCount *float64 `json:"executionCount,omitempty"` + // Metrics - READ-ONLY; The list of query metrics during this interval. + Metrics *[]QueryMetric `json:"metrics,omitempty"` +} + +// QueryMetric a database query. +type QueryMetric struct { + // Name - READ-ONLY; The name of the metric + Name *string `json:"name,omitempty"` + // DisplayName - READ-ONLY; The name of the metric for display in user interface + DisplayName *string `json:"displayName,omitempty"` + // Unit - READ-ONLY; The unit of measurement. Possible values include: 'Percentage', 'KB', 'Microseconds' + Unit QueryMetricUnit `json:"unit,omitempty"` + // Value - READ-ONLY; The measured value + Value *float64 `json:"value,omitempty"` +} + +// QueryStatistic a database query. +type QueryStatistic struct { + // QueryID - READ-ONLY; The id of the query + QueryID *string `json:"queryId,omitempty"` + // Intervals - READ-ONLY; The list of query intervals. + Intervals *[]QueryInterval `json:"intervals,omitempty"` +} + +// QueryStatisticListResult represents the response to a get query request. +type QueryStatisticListResult struct { + autorest.Response `json:"-"` + // Value - The query. + Value *[]QueryStatistic `json:"value,omitempty"` +} + +// QueryText ... +type QueryText struct { + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // QueryText - READ-ONLY; Query text. + QueryText *string `json:"queryText,omitempty"` +} + +// QueryTextListResult represents the response to a get query text request. +type QueryTextListResult struct { + autorest.Response `json:"-"` + // Value - The query text. + Value *[]QueryText `json:"value,omitempty"` +} + +// RecommendedElasticPool represents a recommended elastic pool. +type RecommendedElasticPool struct { + autorest.Response `json:"-"` + // RecommendedElasticPoolProperties - The properties representing the resource. + *RecommendedElasticPoolProperties `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 RecommendedElasticPool. +func (rep RecommendedElasticPool) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rep.RecommendedElasticPoolProperties != nil { + objectMap["properties"] = rep.RecommendedElasticPoolProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RecommendedElasticPool struct. +func (rep *RecommendedElasticPool) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var recommendedElasticPoolProperties RecommendedElasticPoolProperties + err = json.Unmarshal(*v, &recommendedElasticPoolProperties) + if err != nil { + return err + } + rep.RecommendedElasticPoolProperties = &recommendedElasticPoolProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rep.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rep.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rep.Type = &typeVar + } + } + } + + return nil +} + +// RecommendedElasticPoolListMetricsResult represents the response to a list recommended elastic pool +// metrics request. +type RecommendedElasticPoolListMetricsResult struct { + autorest.Response `json:"-"` + // Value - The list of recommended elastic pools metrics. + Value *[]RecommendedElasticPoolMetric `json:"value,omitempty"` +} + +// RecommendedElasticPoolListResult represents the response to a list recommended elastic pool request. +type RecommendedElasticPoolListResult struct { + autorest.Response `json:"-"` + // Value - The list of recommended elastic pools hosted in the server. + Value *[]RecommendedElasticPool `json:"value,omitempty"` +} + +// RecommendedElasticPoolMetric represents recommended elastic pool metric. +type RecommendedElasticPoolMetric struct { + // DateTime - The time of metric (ISO8601 format). + DateTime *date.Time `json:"dateTime,omitempty"` + // Dtu - Gets or sets the DTUs (Database Transaction Units). See https://azure.microsoft.com/documentation/articles/sql-database-what-is-a-dtu/ + Dtu *float64 `json:"dtu,omitempty"` + // SizeGB - Gets or sets size in gigabytes. + SizeGB *float64 `json:"sizeGB,omitempty"` +} + +// RecommendedElasticPoolProperties represents the properties of a recommended elastic pool. +type RecommendedElasticPoolProperties struct { + // DatabaseEdition - READ-ONLY; The edition of the recommended elastic pool. The ElasticPoolEdition enumeration contains all the valid editions. Possible values include: 'ElasticPoolEditionBasic', 'ElasticPoolEditionStandard', 'ElasticPoolEditionPremium', 'ElasticPoolEditionGeneralPurpose', 'ElasticPoolEditionBusinessCritical' + DatabaseEdition ElasticPoolEdition `json:"databaseEdition,omitempty"` + // Dtu - The DTU for the recommended elastic pool. + Dtu *float64 `json:"dtu,omitempty"` + // DatabaseDtuMin - The minimum DTU for the database. + DatabaseDtuMin *float64 `json:"databaseDtuMin,omitempty"` + // DatabaseDtuMax - The maximum DTU for the database. + DatabaseDtuMax *float64 `json:"databaseDtuMax,omitempty"` + // StorageMB - Gets storage size in megabytes. + StorageMB *float64 `json:"storageMB,omitempty"` + // ObservationPeriodStart - READ-ONLY; The observation period start (ISO8601 format). + ObservationPeriodStart *date.Time `json:"observationPeriodStart,omitempty"` + // ObservationPeriodEnd - READ-ONLY; The observation period start (ISO8601 format). + ObservationPeriodEnd *date.Time `json:"observationPeriodEnd,omitempty"` + // MaxObservedDtu - READ-ONLY; Gets maximum observed DTU. + MaxObservedDtu *float64 `json:"maxObservedDtu,omitempty"` + // MaxObservedStorageMB - READ-ONLY; Gets maximum observed storage in megabytes. + MaxObservedStorageMB *float64 `json:"maxObservedStorageMB,omitempty"` + // Databases - READ-ONLY; The list of databases in this pool. Expanded property + Databases *[]Database `json:"databases,omitempty"` + // Metrics - READ-ONLY; The list of databases housed in the server. Expanded property + Metrics *[]RecommendedElasticPoolMetric `json:"metrics,omitempty"` +} + +// RecommendedIndex represents a database recommended index. +type RecommendedIndex struct { + // RecommendedIndexProperties - READ-ONLY; The properties representing the resource. + *RecommendedIndexProperties `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 RecommendedIndex. +func (ri RecommendedIndex) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RecommendedIndex struct. +func (ri *RecommendedIndex) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesResumeFuture", "Result", future.Response(), "Polling failure") - return + return err } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.DatabasesResumeFuture") - return + for k, v := range m { + switch k { + case "properties": + if v != nil { + var recommendedIndexProperties RecommendedIndexProperties + err = json.Unmarshal(*v, &recommendedIndexProperties) + if err != nil { + return err + } + ri.RecommendedIndexProperties = &recommendedIndexProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ri.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ri.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ri.Type = &typeVar + } + } } - ar.Response = future.Response() - return + + return nil } -// DatabasesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DatabasesUpdateFuture struct { - azure.Future +// RecommendedIndexProperties represents the properties of a database recommended index. +type RecommendedIndexProperties struct { + // Action - READ-ONLY; The proposed index action. You can create a missing index, drop an unused index, or rebuild an existing index to improve its performance. Possible values include: 'Create', 'Drop', 'Rebuild' + Action RecommendedIndexAction `json:"action,omitempty"` + // State - READ-ONLY; The current recommendation state. Possible values include: 'Active', 'Pending', 'Executing', 'Verifying', 'PendingRevert', 'Reverting', 'Reverted', 'Ignored', 'Expired', 'Blocked', 'Success' + State RecommendedIndexState `json:"state,omitempty"` + // Created - READ-ONLY; The UTC datetime showing when this resource was created (ISO8601 format). + Created *date.Time `json:"created,omitempty"` + // LastModified - READ-ONLY; The UTC datetime of when was this resource last changed (ISO8601 format). + LastModified *date.Time `json:"lastModified,omitempty"` + // IndexType - READ-ONLY; The type of index (CLUSTERED, NONCLUSTERED, COLUMNSTORE, CLUSTERED COLUMNSTORE). Possible values include: 'CLUSTERED', 'NONCLUSTERED', 'COLUMNSTORE', 'CLUSTEREDCOLUMNSTORE' + IndexType RecommendedIndexType `json:"indexType,omitempty"` + // Schema - READ-ONLY; The schema where table to build index over resides + Schema *string `json:"schema,omitempty"` + // Table - READ-ONLY; The table on which to build index. + Table *string `json:"table,omitempty"` + // Columns - READ-ONLY; Columns over which to build index + Columns *[]string `json:"columns,omitempty"` + // IncludedColumns - READ-ONLY; The list of column names to be included in the index + IncludedColumns *[]string `json:"includedColumns,omitempty"` + // IndexScript - READ-ONLY; The full build index script + IndexScript *string `json:"indexScript,omitempty"` + // EstimatedImpact - READ-ONLY; The estimated impact of doing recommended index action. + EstimatedImpact *[]OperationImpact `json:"estimatedImpact,omitempty"` + // ReportedImpact - READ-ONLY; The values reported after index action is complete. + ReportedImpact *[]OperationImpact `json:"reportedImpact,omitempty"` } -// 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) (d Database, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesUpdateFuture", "Result", future.Response(), "Polling failure") - return +// RecoverableDatabase a recoverable database +type RecoverableDatabase struct { + autorest.Response `json:"-"` + // RecoverableDatabaseProperties - The properties of a recoverable database + *RecoverableDatabaseProperties `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 RecoverableDatabase. +func (rd RecoverableDatabase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rd.RecoverableDatabaseProperties != nil { + objectMap["properties"] = rd.RecoverableDatabaseProperties } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.DatabasesUpdateFuture") - return + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RecoverableDatabase struct. +func (rd *RecoverableDatabase) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err } - 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.UpdateResponder(d.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesUpdateFuture", "Result", d.Response.Response, "Failure responding to request") + for k, v := range m { + switch k { + case "properties": + if v != nil { + var recoverableDatabaseProperties RecoverableDatabaseProperties + err = json.Unmarshal(*v, &recoverableDatabaseProperties) + if err != nil { + return err + } + rd.RecoverableDatabaseProperties = &recoverableDatabaseProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rd.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rd.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rd.Type = &typeVar + } } } - return + + return nil } -// DatabaseUpdate represents a database update. -type DatabaseUpdate struct { - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // DatabaseProperties - The properties representing the resource. - *DatabaseProperties `json:"properties,omitempty"` +// RecoverableDatabaseListResult the response to a list recoverable databases request +type RecoverableDatabaseListResult struct { + autorest.Response `json:"-"` + // Value - A list of recoverable databases + Value *[]RecoverableDatabase `json:"value,omitempty"` +} + +// RecoverableDatabaseProperties the properties of a recoverable database +type RecoverableDatabaseProperties struct { + // Edition - READ-ONLY; The edition of the database + Edition *string `json:"edition,omitempty"` + // ServiceLevelObjective - READ-ONLY; The service level objective name of the database + ServiceLevelObjective *string `json:"serviceLevelObjective,omitempty"` + // ElasticPoolName - READ-ONLY; The elastic pool name of the database + ElasticPoolName *string `json:"elasticPoolName,omitempty"` + // LastAvailableBackupDate - READ-ONLY; The last available backup date of the database (ISO8601 format) + LastAvailableBackupDate *date.Time `json:"lastAvailableBackupDate,omitempty"` +} + +// ReplicationLink represents a database replication link. +type ReplicationLink struct { + autorest.Response `json:"-"` + // Location - READ-ONLY; Location of the server that contains this firewall rule. + Location *string `json:"location,omitempty"` + // ReplicationLinkProperties - The properties representing the resource. + *ReplicationLinkProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -1087,20 +4292,17 @@ type DatabaseUpdate struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for DatabaseUpdate. -func (du DatabaseUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if du.Tags != nil { - objectMap["tags"] = du.Tags - } - if du.DatabaseProperties != nil { - objectMap["properties"] = du.DatabaseProperties +// MarshalJSON is the custom marshaler for ReplicationLink. +func (rl ReplicationLink) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rl.ReplicationLinkProperties != nil { + objectMap["properties"] = rl.ReplicationLinkProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for DatabaseUpdate struct. -func (du *DatabaseUpdate) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ReplicationLink struct. +func (rl *ReplicationLink) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -1108,23 +4310,23 @@ func (du *DatabaseUpdate) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "tags": + case "location": if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) + var location string + err = json.Unmarshal(*v, &location) if err != nil { return err } - du.Tags = tags + rl.Location = &location } case "properties": if v != nil { - var databaseProperties DatabaseProperties - err = json.Unmarshal(*v, &databaseProperties) + var replicationLinkProperties ReplicationLinkProperties + err = json.Unmarshal(*v, &replicationLinkProperties) if err != nil { return err } - du.DatabaseProperties = &databaseProperties + rl.ReplicationLinkProperties = &replicationLinkProperties } case "id": if v != nil { @@ -1133,7 +4335,7 @@ func (du *DatabaseUpdate) UnmarshalJSON(body []byte) error { if err != nil { return err } - du.ID = &ID + rl.ID = &ID } case "name": if v != nil { @@ -1142,7 +4344,7 @@ func (du *DatabaseUpdate) UnmarshalJSON(body []byte) error { if err != nil { return err } - du.Name = &name + rl.Name = &name } case "type": if v != nil { @@ -1151,7 +4353,7 @@ func (du *DatabaseUpdate) UnmarshalJSON(body []byte) error { if err != nil { return err } - du.Type = &typeVar + rl.Type = &typeVar } } } @@ -1159,17 +4361,100 @@ func (du *DatabaseUpdate) UnmarshalJSON(body []byte) error { return nil } -// ElasticPool represents a database elastic pool. -type ElasticPool struct { +// ReplicationLinkListResult represents the response to a List database replication link request. +type ReplicationLinkListResult struct { autorest.Response `json:"-"` - // ElasticPoolProperties - The properties representing the resource. - *ElasticPoolProperties `json:"properties,omitempty"` - // Kind - READ-ONLY; Kind of elastic pool. This is metadata used for the Azure portal experience. - Kind *string `json:"kind,omitempty"` - // Location - Resource location. + // Value - The list of database replication links housed in the database. + Value *[]ReplicationLink `json:"value,omitempty"` +} + +// ReplicationLinkProperties represents the properties of a database replication link. +type ReplicationLinkProperties struct { + // IsTerminationAllowed - READ-ONLY; Legacy value indicating whether termination is allowed. Currently always returns true. + IsTerminationAllowed *bool `json:"isTerminationAllowed,omitempty"` + // ReplicationMode - READ-ONLY; Replication mode of this replication link. + ReplicationMode *string `json:"replicationMode,omitempty"` + // PartnerServer - READ-ONLY; The name of the server hosting the partner database. + PartnerServer *string `json:"partnerServer,omitempty"` + // PartnerDatabase - READ-ONLY; The name of the partner database. + PartnerDatabase *string `json:"partnerDatabase,omitempty"` + // PartnerLocation - READ-ONLY; The Azure Region of the partner database. + PartnerLocation *string `json:"partnerLocation,omitempty"` + // Role - READ-ONLY; The role of the database in the replication link. Possible values include: 'ReplicationRolePrimary', 'ReplicationRoleSecondary', 'ReplicationRoleNonReadableSecondary', 'ReplicationRoleSource', 'ReplicationRoleCopy' + Role ReplicationRole `json:"role,omitempty"` + // PartnerRole - READ-ONLY; The role of the partner database in the replication link. Possible values include: 'ReplicationRolePrimary', 'ReplicationRoleSecondary', 'ReplicationRoleNonReadableSecondary', 'ReplicationRoleSource', 'ReplicationRoleCopy' + PartnerRole ReplicationRole `json:"partnerRole,omitempty"` + // StartTime - READ-ONLY; The start time for the replication link. + StartTime *date.Time `json:"startTime,omitempty"` + // PercentComplete - READ-ONLY; The percentage of seeding complete for the replication link. + PercentComplete *int32 `json:"percentComplete,omitempty"` + // ReplicationState - READ-ONLY; The replication state for the replication link. Possible values include: 'PENDING', 'SEEDING', 'CATCHUP', 'SUSPENDED' + ReplicationState ReplicationState `json:"replicationState,omitempty"` +} + +// ReplicationLinksFailoverAllowDataLossFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ReplicationLinksFailoverAllowDataLossFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ReplicationLinksFailoverAllowDataLossFuture) Result(client ReplicationLinksClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ReplicationLinksFailoverAllowDataLossFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("sql.ReplicationLinksFailoverAllowDataLossFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationLinksFailoverFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationLinksFailoverFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ReplicationLinksFailoverFuture) Result(client ReplicationLinksClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ReplicationLinksFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("sql.ReplicationLinksFailoverFuture") + return + } + ar.Response = future.Response() + return +} + +// Resource ARM resource. +type Resource struct { + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// RestorableDroppedDatabase a restorable dropped database +type RestorableDroppedDatabase struct { + autorest.Response `json:"-"` + // Location - READ-ONLY; The geo-location where the resource lives Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` + // RestorableDroppedDatabaseProperties - The properties of a restorable dropped database + *RestorableDroppedDatabaseProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -1178,23 +4463,17 @@ type ElasticPool struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for ElasticPool. -func (ep ElasticPool) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for RestorableDroppedDatabase. +func (rdd RestorableDroppedDatabase) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if ep.ElasticPoolProperties != nil { - objectMap["properties"] = ep.ElasticPoolProperties - } - if ep.Location != nil { - objectMap["location"] = ep.Location - } - if ep.Tags != nil { - objectMap["tags"] = ep.Tags + if rdd.RestorableDroppedDatabaseProperties != nil { + objectMap["properties"] = rdd.RestorableDroppedDatabaseProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ElasticPool struct. -func (ep *ElasticPool) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for RestorableDroppedDatabase struct. +func (rdd *RestorableDroppedDatabase) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -1202,24 +4481,6 @@ func (ep *ElasticPool) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "properties": - if v != nil { - var elasticPoolProperties ElasticPoolProperties - err = json.Unmarshal(*v, &elasticPoolProperties) - if err != nil { - return err - } - ep.ElasticPoolProperties = &elasticPoolProperties - } - case "kind": - if v != nil { - var kind string - err = json.Unmarshal(*v, &kind) - if err != nil { - return err - } - ep.Kind = &kind - } case "location": if v != nil { var location string @@ -1227,16 +4488,16 @@ func (ep *ElasticPool) UnmarshalJSON(body []byte) error { if err != nil { return err } - ep.Location = &location + rdd.Location = &location } - case "tags": + case "properties": if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) + var restorableDroppedDatabaseProperties RestorableDroppedDatabaseProperties + err = json.Unmarshal(*v, &restorableDroppedDatabaseProperties) if err != nil { return err } - ep.Tags = tags + rdd.RestorableDroppedDatabaseProperties = &restorableDroppedDatabaseProperties } case "id": if v != nil { @@ -1245,7 +4506,7 @@ func (ep *ElasticPool) UnmarshalJSON(body []byte) error { if err != nil { return err } - ep.ID = &ID + rdd.ID = &ID } case "name": if v != nil { @@ -1254,7 +4515,7 @@ func (ep *ElasticPool) UnmarshalJSON(body []byte) error { if err != nil { return err } - ep.Name = &name + rdd.Name = &name } case "type": if v != nil { @@ -1263,7 +4524,7 @@ func (ep *ElasticPool) UnmarshalJSON(body []byte) error { if err != nil { return err } - ep.Type = &typeVar + rdd.Type = &typeVar } } } @@ -1271,12 +4532,37 @@ func (ep *ElasticPool) UnmarshalJSON(body []byte) error { return nil } -// ElasticPoolActivity represents the activity on an elastic pool. -type ElasticPoolActivity struct { - // Location - The geo-location where the resource lives - Location *string `json:"location,omitempty"` - // ElasticPoolActivityProperties - The properties representing the resource. - *ElasticPoolActivityProperties `json:"properties,omitempty"` +// RestorableDroppedDatabaseListResult the response to a list restorable dropped databases request +type RestorableDroppedDatabaseListResult struct { + autorest.Response `json:"-"` + // Value - A list of restorable dropped databases + Value *[]RestorableDroppedDatabase `json:"value,omitempty"` +} + +// RestorableDroppedDatabaseProperties the properties of a restorable dropped database +type RestorableDroppedDatabaseProperties struct { + // DatabaseName - READ-ONLY; The name of the database + DatabaseName *string `json:"databaseName,omitempty"` + // Edition - READ-ONLY; The edition of the database + Edition *string `json:"edition,omitempty"` + // MaxSizeBytes - READ-ONLY; The max size in bytes of the database + MaxSizeBytes *string `json:"maxSizeBytes,omitempty"` + // ServiceLevelObjective - READ-ONLY; The service level objective name of the database + ServiceLevelObjective *string `json:"serviceLevelObjective,omitempty"` + // ElasticPoolName - READ-ONLY; The elastic pool name of the database + ElasticPoolName *string `json:"elasticPoolName,omitempty"` + // CreationDate - READ-ONLY; The creation date of the database (ISO8601 format) + CreationDate *date.Time `json:"creationDate,omitempty"` + // DeletionDate - READ-ONLY; The deletion date of the database (ISO8601 format) + DeletionDate *date.Time `json:"deletionDate,omitempty"` + // EarliestRestoreDate - READ-ONLY; The earliest restore date of the database (ISO8601 format) + EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"` +} + +// RestorePoint a database restore point. +type RestorePoint struct { + // RestorePointProperties - The properties of the restore point. + *RestorePointProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -1285,20 +4571,17 @@ type ElasticPoolActivity struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for ElasticPoolActivity. -func (epa ElasticPoolActivity) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for RestorePoint. +func (rp RestorePoint) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if epa.Location != nil { - objectMap["location"] = epa.Location - } - if epa.ElasticPoolActivityProperties != nil { - objectMap["properties"] = epa.ElasticPoolActivityProperties + if rp.RestorePointProperties != nil { + objectMap["properties"] = rp.RestorePointProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ElasticPoolActivity struct. -func (epa *ElasticPoolActivity) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for RestorePoint struct. +func (rp *RestorePoint) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -1306,23 +4589,14 @@ func (epa *ElasticPoolActivity) UnmarshalJSON(body []byte) error { } 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 - } - epa.Location = &location - } case "properties": if v != nil { - var elasticPoolActivityProperties ElasticPoolActivityProperties - err = json.Unmarshal(*v, &elasticPoolActivityProperties) + var restorePointProperties RestorePointProperties + err = json.Unmarshal(*v, &restorePointProperties) if err != nil { return err } - epa.ElasticPoolActivityProperties = &elasticPoolActivityProperties + rp.RestorePointProperties = &restorePointProperties } case "id": if v != nil { @@ -1331,7 +4605,7 @@ func (epa *ElasticPoolActivity) UnmarshalJSON(body []byte) error { if err != nil { return err } - epa.ID = &ID + rp.ID = &ID } case "name": if v != nil { @@ -1340,7 +4614,7 @@ func (epa *ElasticPoolActivity) UnmarshalJSON(body []byte) error { if err != nil { return err } - epa.Name = &name + rp.Name = &name } case "type": if v != nil { @@ -1349,71 +4623,42 @@ func (epa *ElasticPoolActivity) UnmarshalJSON(body []byte) error { if err != nil { return err } - epa.Type = &typeVar + rp.Type = &typeVar } } } - return nil -} - -// ElasticPoolActivityListResult represents the response to a list elastic pool activity request. -type ElasticPoolActivityListResult struct { - autorest.Response `json:"-"` - // Value - The list of elastic pool activities. - Value *[]ElasticPoolActivity `json:"value,omitempty"` -} - -// ElasticPoolActivityProperties represents the properties of an elastic pool. -type ElasticPoolActivityProperties struct { - // EndTime - READ-ONLY; The time the operation finished (ISO8601 format). - EndTime *date.Time `json:"endTime,omitempty"` - // ErrorCode - READ-ONLY; The error code if available. - ErrorCode *int32 `json:"errorCode,omitempty"` - // ErrorMessage - READ-ONLY; The error message if available. - ErrorMessage *string `json:"errorMessage,omitempty"` - // ErrorSeverity - READ-ONLY; The error severity if available. - ErrorSeverity *int32 `json:"errorSeverity,omitempty"` - // Operation - READ-ONLY; The operation name. - Operation *string `json:"operation,omitempty"` - // OperationID - READ-ONLY; The unique operation ID. - OperationID *uuid.UUID `json:"operationId,omitempty"` - // PercentComplete - READ-ONLY; The percentage complete if available. - PercentComplete *int32 `json:"percentComplete,omitempty"` - // RequestedDatabaseDtuMax - READ-ONLY; The requested max DTU per database if available. - RequestedDatabaseDtuMax *int32 `json:"requestedDatabaseDtuMax,omitempty"` - // RequestedDatabaseDtuMin - READ-ONLY; The requested min DTU per database if available. - RequestedDatabaseDtuMin *int32 `json:"requestedDatabaseDtuMin,omitempty"` - // RequestedDtu - READ-ONLY; The requested DTU for the pool if available. - RequestedDtu *int32 `json:"requestedDtu,omitempty"` - // RequestedElasticPoolName - READ-ONLY; The requested name for the elastic pool if available. - RequestedElasticPoolName *string `json:"requestedElasticPoolName,omitempty"` - // RequestedStorageLimitInGB - READ-ONLY; The requested storage limit for the pool in GB if available. - RequestedStorageLimitInGB *int64 `json:"requestedStorageLimitInGB,omitempty"` - // ElasticPoolName - READ-ONLY; The name of the elastic pool. - ElasticPoolName *string `json:"elasticPoolName,omitempty"` - // ServerName - READ-ONLY; The name of the server the elastic pool is in. - ServerName *string `json:"serverName,omitempty"` - // StartTime - READ-ONLY; The time the operation started (ISO8601 format). - StartTime *date.Time `json:"startTime,omitempty"` - // State - READ-ONLY; The current state of the operation. - State *string `json:"state,omitempty"` - // RequestedStorageLimitInMB - READ-ONLY; The requested storage limit in MB. - RequestedStorageLimitInMB *int32 `json:"requestedStorageLimitInMB,omitempty"` - // RequestedDatabaseDtuGuarantee - READ-ONLY; The requested per database DTU guarantee. - RequestedDatabaseDtuGuarantee *int32 `json:"requestedDatabaseDtuGuarantee,omitempty"` - // RequestedDatabaseDtuCap - READ-ONLY; The requested per database DTU cap. - RequestedDatabaseDtuCap *int32 `json:"requestedDatabaseDtuCap,omitempty"` - // RequestedDtuGuarantee - READ-ONLY; The requested DTU guarantee. - RequestedDtuGuarantee *int32 `json:"requestedDtuGuarantee,omitempty"` + return nil } -// ElasticPoolDatabaseActivity represents the activity on an elastic pool. -type ElasticPoolDatabaseActivity struct { - // Location - The geo-location where the resource lives +// RestorePointListResult the response to a list database restore points request. +type RestorePointListResult struct { + autorest.Response `json:"-"` + // Value - The list of database restore points. + Value *[]RestorePoint `json:"value,omitempty"` +} + +// RestorePointProperties represents the properties of a database restore point. +type RestorePointProperties struct { + // RestorePointType - READ-ONLY; The restore point type of the database restore point. Possible values include: 'DISCRETE', 'CONTINUOUS' + RestorePointType RestorePointType `json:"restorePointType,omitempty"` + // RestorePointCreationDate - READ-ONLY; Restore point creation time (ISO8601 format). Populated when restorePointType = CONTINUOUS. Null otherwise. + RestorePointCreationDate *date.Time `json:"restorePointCreationDate,omitempty"` + // EarliestRestoreDate - READ-ONLY; Earliest restore time (ISO8601 format). Populated when restorePointType = DISCRETE. Null otherwise. + EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"` +} + +// Server represents a server. +type Server struct { + autorest.Response `json:"-"` + // Kind - READ-ONLY; Kind of sql server. This is metadata used for the Azure portal experience. + Kind *string `json:"kind,omitempty"` + // ServerProperties - Represents the properties of the resource. + *ServerProperties `json:"properties,omitempty"` + // Location - Resource location. Location *string `json:"location,omitempty"` - // ElasticPoolDatabaseActivityProperties - The properties representing the resource. - *ElasticPoolDatabaseActivityProperties `json:"properties,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -1422,20 +4667,23 @@ type ElasticPoolDatabaseActivity struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for ElasticPoolDatabaseActivity. -func (epda ElasticPoolDatabaseActivity) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for Server. +func (s Server) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if epda.Location != nil { - objectMap["location"] = epda.Location + if s.ServerProperties != nil { + objectMap["properties"] = s.ServerProperties } - if epda.ElasticPoolDatabaseActivityProperties != nil { - objectMap["properties"] = epda.ElasticPoolDatabaseActivityProperties + if s.Location != nil { + objectMap["location"] = s.Location + } + if s.Tags != nil { + objectMap["tags"] = s.Tags } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ElasticPoolDatabaseActivity struct. -func (epda *ElasticPoolDatabaseActivity) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for Server struct. +func (s *Server) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -1443,6 +4691,24 @@ func (epda *ElasticPoolDatabaseActivity) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + s.Kind = &kind + } + case "properties": + if v != nil { + var serverProperties ServerProperties + err = json.Unmarshal(*v, &serverProperties) + if err != nil { + return err + } + s.ServerProperties = &serverProperties + } case "location": if v != nil { var location string @@ -1450,16 +4716,16 @@ func (epda *ElasticPoolDatabaseActivity) UnmarshalJSON(body []byte) error { if err != nil { return err } - epda.Location = &location + s.Location = &location } - case "properties": + case "tags": if v != nil { - var elasticPoolDatabaseActivityProperties ElasticPoolDatabaseActivityProperties - err = json.Unmarshal(*v, &elasticPoolDatabaseActivityProperties) + var tags map[string]*string + err = json.Unmarshal(*v, &tags) if err != nil { return err } - epda.ElasticPoolDatabaseActivityProperties = &elasticPoolDatabaseActivityProperties + s.Tags = tags } case "id": if v != nil { @@ -1468,7 +4734,7 @@ func (epda *ElasticPoolDatabaseActivity) UnmarshalJSON(body []byte) error { if err != nil { return err } - epda.ID = &ID + s.ID = &ID } case "name": if v != nil { @@ -1477,7 +4743,7 @@ func (epda *ElasticPoolDatabaseActivity) UnmarshalJSON(body []byte) error { if err != nil { return err } - epda.Name = &name + s.Name = &name } case "type": if v != nil { @@ -1486,7 +4752,7 @@ func (epda *ElasticPoolDatabaseActivity) UnmarshalJSON(body []byte) error { if err != nil { return err } - epda.Type = &typeVar + s.Type = &typeVar } } } @@ -1494,139 +4760,30 @@ func (epda *ElasticPoolDatabaseActivity) UnmarshalJSON(body []byte) error { return nil } -// ElasticPoolDatabaseActivityListResult represents the response to a list elastic pool database activity -// request. -type ElasticPoolDatabaseActivityListResult struct { +// ServerAdministratorListResult the response to a list Active Directory Administrators request. +type ServerAdministratorListResult struct { autorest.Response `json:"-"` - // Value - The list of elastic pool database activities. - Value *[]ElasticPoolDatabaseActivity `json:"value,omitempty"` + // Value - The list of server Active Directory Administrators for the server. + Value *[]ServerAzureADAdministrator `json:"value,omitempty"` } -// ElasticPoolDatabaseActivityProperties represents the properties of an elastic pool database activity. -type ElasticPoolDatabaseActivityProperties struct { - // DatabaseName - READ-ONLY; The database name. - DatabaseName *string `json:"databaseName,omitempty"` - // EndTime - READ-ONLY; The time the operation finished (ISO8601 format). - EndTime *date.Time `json:"endTime,omitempty"` - // ErrorCode - READ-ONLY; The error code if available. - ErrorCode *int32 `json:"errorCode,omitempty"` - // ErrorMessage - READ-ONLY; The error message if available. - ErrorMessage *string `json:"errorMessage,omitempty"` - // ErrorSeverity - READ-ONLY; The error severity if available. - ErrorSeverity *int32 `json:"errorSeverity,omitempty"` - // Operation - READ-ONLY; The operation name. - Operation *string `json:"operation,omitempty"` - // OperationID - READ-ONLY; The unique operation ID. - OperationID *uuid.UUID `json:"operationId,omitempty"` - // PercentComplete - READ-ONLY; The percentage complete if available. - PercentComplete *int32 `json:"percentComplete,omitempty"` - // RequestedElasticPoolName - READ-ONLY; The name for the elastic pool the database is moving into if available. - RequestedElasticPoolName *string `json:"requestedElasticPoolName,omitempty"` - // CurrentElasticPoolName - READ-ONLY; The name of the current elastic pool the database is in if available. - CurrentElasticPoolName *string `json:"currentElasticPoolName,omitempty"` - // CurrentServiceObjective - READ-ONLY; The name of the current service objective if available. - CurrentServiceObjective *string `json:"currentServiceObjective,omitempty"` - // RequestedServiceObjective - READ-ONLY; The name of the requested service objective if available. - RequestedServiceObjective *string `json:"requestedServiceObjective,omitempty"` - // ServerName - READ-ONLY; The name of the server the elastic pool is in. - ServerName *string `json:"serverName,omitempty"` - // StartTime - READ-ONLY; The time the operation started (ISO8601 format). - StartTime *date.Time `json:"startTime,omitempty"` - // State - READ-ONLY; The current state of the operation. - State *string `json:"state,omitempty"` +// ServerAdministratorProperties the properties of an server Administrator. +type ServerAdministratorProperties struct { + // AdministratorType - The type of administrator. + AdministratorType *string `json:"administratorType,omitempty"` + // Login - The server administrator login value. + Login *string `json:"login,omitempty"` + // Sid - The server administrator Sid (Secure ID). + Sid *uuid.UUID `json:"sid,omitempty"` + // TenantID - The server Active Directory Administrator tenant id. + TenantID *uuid.UUID `json:"tenantId,omitempty"` } -// ElasticPoolListResult represents the response to a list elastic pool request. -type ElasticPoolListResult struct { +// ServerAzureADAdministrator an server Active Directory Administrator. +type ServerAzureADAdministrator struct { autorest.Response `json:"-"` - // Value - The list of elastic pools hosted in the server. - Value *[]ElasticPool `json:"value,omitempty"` -} - -// ElasticPoolProperties represents the properties of an elastic pool. -type ElasticPoolProperties struct { - // CreationDate - READ-ONLY; The creation date of the elastic pool (ISO8601 format). - CreationDate *date.Time `json:"creationDate,omitempty"` - // State - READ-ONLY; The state of the elastic pool. Possible values include: 'Creating', 'Ready', 'Disabled' - State ElasticPoolState `json:"state,omitempty"` - // Edition - The edition of the elastic pool. Possible values include: 'ElasticPoolEditionBasic', 'ElasticPoolEditionStandard', 'ElasticPoolEditionPremium', 'ElasticPoolEditionGeneralPurpose', 'ElasticPoolEditionBusinessCritical' - Edition ElasticPoolEdition `json:"edition,omitempty"` - // Dtu - The total shared DTU for the database elastic pool. - Dtu *int32 `json:"dtu,omitempty"` - // DatabaseDtuMax - The maximum DTU any one database can consume. - DatabaseDtuMax *int32 `json:"databaseDtuMax,omitempty"` - // DatabaseDtuMin - The minimum DTU all databases are guaranteed. - DatabaseDtuMin *int32 `json:"databaseDtuMin,omitempty"` - // StorageMB - Gets storage limit for the database elastic pool in MB. - StorageMB *int32 `json:"storageMB,omitempty"` - // ZoneRedundant - Whether or not this database elastic pool is zone redundant, which means the replicas of this database will be spread across multiple availability zones. - ZoneRedundant *bool `json:"zoneRedundant,omitempty"` -} - -// ElasticPoolsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ElasticPoolsCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ElasticPoolsCreateOrUpdateFuture) Result(client ElasticPoolsClient) (ep ElasticPool, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ElasticPoolsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ElasticPoolsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ep.Response.Response, err = future.GetResult(sender); err == nil && ep.Response.Response.StatusCode != http.StatusNoContent { - ep, err = client.CreateOrUpdateResponder(ep.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ElasticPoolsCreateOrUpdateFuture", "Result", ep.Response.Response, "Failure responding to request") - } - } - return -} - -// ElasticPoolsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ElasticPoolsUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ElasticPoolsUpdateFuture) Result(client ElasticPoolsClient) (ep ElasticPool, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ElasticPoolsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ElasticPoolsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ep.Response.Response, err = future.GetResult(sender); err == nil && ep.Response.Response.StatusCode != http.StatusNoContent { - ep, err = client.UpdateResponder(ep.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ElasticPoolsUpdateFuture", "Result", ep.Response.Response, "Failure responding to request") - } - } - return -} - -// ElasticPoolUpdate represents an elastic pool update. -type ElasticPoolUpdate struct { - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ElasticPoolProperties - The properties representing the resource. - *ElasticPoolProperties `json:"properties,omitempty"` + // ServerAdministratorProperties - The properties of the resource. + *ServerAdministratorProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -1635,20 +4792,17 @@ type ElasticPoolUpdate struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for ElasticPoolUpdate. -func (epu ElasticPoolUpdate) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ServerAzureADAdministrator. +func (saaa ServerAzureADAdministrator) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if epu.Tags != nil { - objectMap["tags"] = epu.Tags - } - if epu.ElasticPoolProperties != nil { - objectMap["properties"] = epu.ElasticPoolProperties + if saaa.ServerAdministratorProperties != nil { + objectMap["properties"] = saaa.ServerAdministratorProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ElasticPoolUpdate struct. -func (epu *ElasticPoolUpdate) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ServerAzureADAdministrator struct. +func (saaa *ServerAzureADAdministrator) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -1656,23 +4810,14 @@ func (epu *ElasticPoolUpdate) UnmarshalJSON(body []byte) error { } 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 - } - epu.Tags = tags - } case "properties": if v != nil { - var elasticPoolProperties ElasticPoolProperties - err = json.Unmarshal(*v, &elasticPoolProperties) + var serverAdministratorProperties ServerAdministratorProperties + err = json.Unmarshal(*v, &serverAdministratorProperties) if err != nil { return err } - epu.ElasticPoolProperties = &elasticPoolProperties + saaa.ServerAdministratorProperties = &serverAdministratorProperties } case "id": if v != nil { @@ -1681,7 +4826,7 @@ func (epu *ElasticPoolUpdate) UnmarshalJSON(body []byte) error { if err != nil { return err } - epu.ID = &ID + saaa.ID = &ID } case "name": if v != nil { @@ -1690,7 +4835,7 @@ func (epu *ElasticPoolUpdate) UnmarshalJSON(body []byte) error { if err != nil { return err } - epu.Name = &name + saaa.Name = &name } case "type": if v != nil { @@ -1699,7 +4844,7 @@ func (epu *ElasticPoolUpdate) UnmarshalJSON(body []byte) error { if err != nil { return err } - epu.Type = &typeVar + saaa.Type = &typeVar } } } @@ -1707,31 +4852,73 @@ func (epu *ElasticPoolUpdate) UnmarshalJSON(body []byte) error { return nil } -// ExportRequest export database parameters. -type ExportRequest struct { - // StorageKeyType - The type of the storage key to use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - StorageKeyType StorageKeyType `json:"storageKeyType,omitempty"` - // StorageKey - The storage key to use. If storage key type is SharedAccessKey, it must be preceded with a "?." - StorageKey *string `json:"storageKey,omitempty"` - // StorageURI - The storage uri to use. - StorageURI *string `json:"storageUri,omitempty"` - // AdministratorLogin - The name of the SQL administrator. - AdministratorLogin *string `json:"administratorLogin,omitempty"` - // AdministratorLoginPassword - The password of the SQL administrator. - AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"` - // AuthenticationType - The authentication type. Possible values include: 'SQL', 'ADPassword' - AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` +// ServerAzureADAdministratorsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ServerAzureADAdministratorsCreateOrUpdateFuture struct { + azure.Future } -// FirewallRule represents a server firewall rule. -type FirewallRule struct { +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ServerAzureADAdministratorsCreateOrUpdateFuture) Result(client ServerAzureADAdministratorsClient) (saaa ServerAzureADAdministrator, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerAzureADAdministratorsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("sql.ServerAzureADAdministratorsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if saaa.Response.Response, err = future.GetResult(sender); err == nil && saaa.Response.Response.StatusCode != http.StatusNoContent { + saaa, err = client.CreateOrUpdateResponder(saaa.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerAzureADAdministratorsCreateOrUpdateFuture", "Result", saaa.Response.Response, "Failure responding to request") + } + } + return +} + +// ServerAzureADAdministratorsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ServerAzureADAdministratorsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ServerAzureADAdministratorsDeleteFuture) Result(client ServerAzureADAdministratorsClient) (saaa ServerAzureADAdministrator, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerAzureADAdministratorsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("sql.ServerAzureADAdministratorsDeleteFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if saaa.Response.Response, err = future.GetResult(sender); err == nil && saaa.Response.Response.StatusCode != http.StatusNoContent { + saaa, err = client.DeleteResponder(saaa.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerAzureADAdministratorsDeleteFuture", "Result", saaa.Response.Response, "Failure responding to request") + } + } + return +} + +// ServerCommunicationLink server communication link. +type ServerCommunicationLink struct { autorest.Response `json:"-"` - // Kind - READ-ONLY; Kind of server that contains this firewall rule. - Kind *string `json:"kind,omitempty"` - // Location - READ-ONLY; Location of the server that contains this firewall rule. + // ServerCommunicationLinkProperties - The properties of resource. + *ServerCommunicationLinkProperties `json:"properties,omitempty"` + // Location - READ-ONLY; Communication link location. Location *string `json:"location,omitempty"` - // FirewallRuleProperties - The properties representing the resource. - *FirewallRuleProperties `json:"properties,omitempty"` + // Kind - READ-ONLY; Communication link kind. This property is used for Azure Portal metadata. + Kind *string `json:"kind,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -1740,17 +4927,17 @@ type FirewallRule struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for FirewallRule. -func (fr FirewallRule) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ServerCommunicationLink. +func (scl ServerCommunicationLink) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if fr.FirewallRuleProperties != nil { - objectMap["properties"] = fr.FirewallRuleProperties + if scl.ServerCommunicationLinkProperties != nil { + objectMap["properties"] = scl.ServerCommunicationLinkProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for FirewallRule struct. -func (fr *FirewallRule) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ServerCommunicationLink struct. +func (scl *ServerCommunicationLink) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -1758,14 +4945,14 @@ func (fr *FirewallRule) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "kind": + case "properties": if v != nil { - var kind string - err = json.Unmarshal(*v, &kind) + var serverCommunicationLinkProperties ServerCommunicationLinkProperties + err = json.Unmarshal(*v, &serverCommunicationLinkProperties) if err != nil { return err } - fr.Kind = &kind + scl.ServerCommunicationLinkProperties = &serverCommunicationLinkProperties } case "location": if v != nil { @@ -1774,16 +4961,16 @@ func (fr *FirewallRule) UnmarshalJSON(body []byte) error { if err != nil { return err } - fr.Location = &location + scl.Location = &location } - case "properties": + case "kind": if v != nil { - var firewallRuleProperties FirewallRuleProperties - err = json.Unmarshal(*v, &firewallRuleProperties) + var kind string + err = json.Unmarshal(*v, &kind) if err != nil { return err } - fr.FirewallRuleProperties = &firewallRuleProperties + scl.Kind = &kind } case "id": if v != nil { @@ -1792,7 +4979,7 @@ func (fr *FirewallRule) UnmarshalJSON(body []byte) error { if err != nil { return err } - fr.ID = &ID + scl.ID = &ID } case "name": if v != nil { @@ -1801,7 +4988,7 @@ func (fr *FirewallRule) UnmarshalJSON(body []byte) error { if err != nil { return err } - fr.Name = &name + scl.Name = &name } case "type": if v != nil { @@ -1810,7 +4997,7 @@ func (fr *FirewallRule) UnmarshalJSON(body []byte) error { if err != nil { return err } - fr.Type = &typeVar + scl.Type = &typeVar } } } @@ -1818,26 +5005,59 @@ func (fr *FirewallRule) UnmarshalJSON(body []byte) error { return nil } -// FirewallRuleListResult represents the response to a List Firewall Rules request. -type FirewallRuleListResult struct { +// ServerCommunicationLinkListResult a list of server communication links. +type ServerCommunicationLinkListResult struct { autorest.Response `json:"-"` - // Value - The list of server firewall rules. - Value *[]FirewallRule `json:"value,omitempty"` + // Value - The list of server communication links. + Value *[]ServerCommunicationLink `json:"value,omitempty"` } -// FirewallRuleProperties represents the properties of a server firewall rule. -type FirewallRuleProperties struct { - // StartIPAddress - The start IP address of the firewall rule. Must be IPv4 format. Use value '0.0.0.0' to represent all Azure-internal IP addresses. - StartIPAddress *string `json:"startIpAddress,omitempty"` - // EndIPAddress - The end IP address of the firewall rule. Must be IPv4 format. Must be greater than or equal to startIpAddress. Use value '0.0.0.0' to represent all Azure-internal IP addresses. - EndIPAddress *string `json:"endIpAddress,omitempty"` +// ServerCommunicationLinkProperties the properties of a server communication link. +type ServerCommunicationLinkProperties struct { + // State - READ-ONLY; The state. + State *string `json:"state,omitempty"` + // PartnerServer - The name of the partner server. + PartnerServer *string `json:"partnerServer,omitempty"` } -// ImportExportResponse response for Import/Export Get operation. -type ImportExportResponse struct { +// ServerCommunicationLinksCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ServerCommunicationLinksCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ServerCommunicationLinksCreateOrUpdateFuture) Result(client ServerCommunicationLinksClient) (scl ServerCommunicationLink, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerCommunicationLinksCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("sql.ServerCommunicationLinksCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if scl.Response.Response, err = future.GetResult(sender); err == nil && scl.Response.Response.StatusCode != http.StatusNoContent { + scl, err = client.CreateOrUpdateResponder(scl.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerCommunicationLinksCreateOrUpdateFuture", "Result", scl.Response.Response, "Failure responding to request") + } + } + return +} + +// ServerConnectionPolicy a server secure connection policy. +type ServerConnectionPolicy struct { autorest.Response `json:"-"` - // ImportExportResponseProperties - The import/export operation properties. - *ImportExportResponseProperties `json:"properties,omitempty"` + // Kind - READ-ONLY; Metadata used for the Azure portal experience. + Kind *string `json:"kind,omitempty"` + // Location - READ-ONLY; Resource location. + Location *string `json:"location,omitempty"` + // ServerConnectionPolicyProperties - The properties of the server secure connection policy. + *ServerConnectionPolicyProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -1846,17 +5066,17 @@ type ImportExportResponse struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for ImportExportResponse. -func (ier ImportExportResponse) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ServerConnectionPolicy. +func (scp ServerConnectionPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if ier.ImportExportResponseProperties != nil { - objectMap["properties"] = ier.ImportExportResponseProperties + if scp.ServerConnectionPolicyProperties != nil { + objectMap["properties"] = scp.ServerConnectionPolicyProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ImportExportResponse struct. -func (ier *ImportExportResponse) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ServerConnectionPolicy struct. +func (scp *ServerConnectionPolicy) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -1864,14 +5084,32 @@ func (ier *ImportExportResponse) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + scp.Kind = &kind + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + scp.Location = &location + } case "properties": if v != nil { - var importExportResponseProperties ImportExportResponseProperties - err = json.Unmarshal(*v, &importExportResponseProperties) + var serverConnectionPolicyProperties ServerConnectionPolicyProperties + err = json.Unmarshal(*v, &serverConnectionPolicyProperties) if err != nil { return err } - ier.ImportExportResponseProperties = &importExportResponseProperties + scp.ServerConnectionPolicyProperties = &serverConnectionPolicyProperties } case "id": if v != nil { @@ -1880,7 +5118,7 @@ func (ier *ImportExportResponse) UnmarshalJSON(body []byte) error { if err != nil { return err } - ier.ID = &ID + scp.ID = &ID } case "name": if v != nil { @@ -1889,7 +5127,7 @@ func (ier *ImportExportResponse) UnmarshalJSON(body []byte) error { if err != nil { return err } - ier.Name = &name + scp.Name = &name } case "type": if v != nil { @@ -1898,7 +5136,7 @@ func (ier *ImportExportResponse) UnmarshalJSON(body []byte) error { if err != nil { return err } - ier.Type = &typeVar + scp.Type = &typeVar } } } @@ -1906,73 +5144,65 @@ func (ier *ImportExportResponse) UnmarshalJSON(body []byte) error { return nil } -// ImportExportResponseProperties response for Import/Export Status operation. -type ImportExportResponseProperties struct { - // RequestType - READ-ONLY; The request type of the operation. - RequestType *string `json:"requestType,omitempty"` - // RequestID - READ-ONLY; The request type of the operation. - RequestID *uuid.UUID `json:"requestId,omitempty"` - // ServerName - READ-ONLY; The name of the server. - ServerName *string `json:"serverName,omitempty"` - // DatabaseName - READ-ONLY; The name of the database. - DatabaseName *string `json:"databaseName,omitempty"` - // Status - READ-ONLY; The status message returned from the server. - Status *string `json:"status,omitempty"` - // LastModifiedTime - READ-ONLY; The operation status last modified time. - LastModifiedTime *string `json:"lastModifiedTime,omitempty"` - // QueuedTime - READ-ONLY; The operation queued time. - QueuedTime *string `json:"queuedTime,omitempty"` - // BlobURI - READ-ONLY; The blob uri. - BlobURI *string `json:"blobUri,omitempty"` - // ErrorMessage - READ-ONLY; The error message returned from the server. - ErrorMessage *string `json:"errorMessage,omitempty"` +// ServerConnectionPolicyProperties the properties of a server secure connection policy. +type ServerConnectionPolicyProperties struct { + // ConnectionType - The server connection type. Possible values include: 'ServerConnectionTypeDefault', 'ServerConnectionTypeProxy', 'ServerConnectionTypeRedirect' + ConnectionType ServerConnectionType `json:"connectionType,omitempty"` } -// ImportExtensionProperties represents the properties for an import operation -type ImportExtensionProperties struct { - // OperationMode - The type of import operation being performed. This is always Import. - OperationMode *string `json:"operationMode,omitempty"` - // StorageKeyType - The type of the storage key to use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - StorageKeyType StorageKeyType `json:"storageKeyType,omitempty"` - // StorageKey - The storage key to use. If storage key type is SharedAccessKey, it must be preceded with a "?." - StorageKey *string `json:"storageKey,omitempty"` - // StorageURI - The storage uri to use. - StorageURI *string `json:"storageUri,omitempty"` - // AdministratorLogin - The name of the SQL administrator. +// ServerListResult represents the response to a get server request. +type ServerListResult struct { + autorest.Response `json:"-"` + // Value - The list of servers. + Value *[]Server `json:"value,omitempty"` +} + +// ServerProperties represents the properties of a server. +type ServerProperties struct { + // FullyQualifiedDomainName - READ-ONLY; The fully qualified domain name of the server. + FullyQualifiedDomainName *string `json:"fullyQualifiedDomainName,omitempty"` + // Version - The version of the server. Possible values include: 'TwoFullStopZero', 'OneTwoFullStopZero' + Version ServerVersion `json:"version,omitempty"` + // AdministratorLogin - Administrator username for the server. Can only be specified when the server is being created (and is required for creation). AdministratorLogin *string `json:"administratorLogin,omitempty"` - // AdministratorLoginPassword - The password of the SQL administrator. + // AdministratorLoginPassword - The administrator login password (required for server creation). AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"` - // AuthenticationType - The authentication type. Possible values include: 'SQL', 'ADPassword' - AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` + // ExternalAdministratorSid - READ-ONLY; The ID of the Active Azure Directory object with admin permissions on this server. Legacy parameter, always null. To check for Active Directory admin, query .../servers/{serverName}/administrators. + ExternalAdministratorSid *uuid.UUID `json:"externalAdministratorSid,omitempty"` + // ExternalAdministratorLogin - READ-ONLY; The display name of the Azure Active Directory object with admin permissions on this server. Legacy parameter, always null. To check for Active Directory admin, query .../servers/{serverName}/administrators + ExternalAdministratorLogin *string `json:"externalAdministratorLogin,omitempty"` + // State - READ-ONLY; The state of the server. Possible values include: 'ServerStateReady', 'ServerStateDisabled' + State ServerState `json:"state,omitempty"` } -// ImportExtensionRequest import database parameters. -type ImportExtensionRequest struct { - // Name - The name of the extension. +// ServerTableAuditingPolicy a server table auditing policy. +type ServerTableAuditingPolicy struct { + autorest.Response `json:"-"` + // Kind - READ-ONLY; Resource kind. + Kind *string `json:"kind,omitempty"` + // Location - READ-ONLY; Resource location. + Location *string `json:"location,omitempty"` + // ServerTableAuditingPolicyProperties - Resource properties. + *ServerTableAuditingPolicyProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. Name *string `json:"name,omitempty"` - // Type - The type of the extension. + // Type - READ-ONLY; Resource type. Type *string `json:"type,omitempty"` - // ImportExtensionProperties - Represents the properties of the resource. - *ImportExtensionProperties `json:"properties,omitempty"` } -// MarshalJSON is the custom marshaler for ImportExtensionRequest. -func (ier ImportExtensionRequest) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ServerTableAuditingPolicy. +func (stap ServerTableAuditingPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if ier.Name != nil { - objectMap["name"] = ier.Name - } - if ier.Type != nil { - objectMap["type"] = ier.Type - } - if ier.ImportExtensionProperties != nil { - objectMap["properties"] = ier.ImportExtensionProperties + if stap.ServerTableAuditingPolicyProperties != nil { + objectMap["properties"] = stap.ServerTableAuditingPolicyProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ImportExtensionRequest struct. -func (ier *ImportExtensionRequest) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ServerTableAuditingPolicy struct. +func (stap *ServerTableAuditingPolicy) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -1980,32 +5210,59 @@ func (ier *ImportExtensionRequest) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "name": + case "kind": if v != nil { - var name string - err = json.Unmarshal(*v, &name) + var kind string + err = json.Unmarshal(*v, &kind) if err != nil { return err } - ier.Name = &name + stap.Kind = &kind } - case "type": + case "location": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var location string + err = json.Unmarshal(*v, &location) if err != nil { return err } - ier.Type = &typeVar + stap.Location = &location } case "properties": if v != nil { - var importExtensionProperties ImportExtensionProperties - err = json.Unmarshal(*v, &importExtensionProperties) + var serverTableAuditingPolicyProperties ServerTableAuditingPolicyProperties + err = json.Unmarshal(*v, &serverTableAuditingPolicyProperties) if err != nil { return err } - ier.ImportExtensionProperties = &importExtensionProperties + stap.ServerTableAuditingPolicyProperties = &serverTableAuditingPolicyProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + stap.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + stap.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + stap.Type = &typeVar } } } @@ -2013,68 +5270,46 @@ func (ier *ImportExtensionRequest) UnmarshalJSON(body []byte) error { return nil } -// ImportRequest import database parameters. -type ImportRequest struct { - // DatabaseName - The name of the database to import. - DatabaseName *string `json:"databaseName,omitempty"` - // Edition - The edition for the database being created. - // - // The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API or one of the following commands: - // - // ```azurecli - // az sql db list-editions -l -o table - // ```` - // - // ```powershell - // Get-AzSqlServerServiceObjective -Location - // ```` - // . Possible values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2', 'GeneralPurpose', 'BusinessCritical', 'Hyperscale' - Edition DatabaseEdition `json:"edition,omitempty"` - // ServiceObjectiveName - The name of the service objective to assign to the database. Possible values include: 'ServiceObjectiveNameSystem', 'ServiceObjectiveNameSystem0', 'ServiceObjectiveNameSystem1', 'ServiceObjectiveNameSystem2', 'ServiceObjectiveNameSystem3', 'ServiceObjectiveNameSystem4', 'ServiceObjectiveNameSystem2L', 'ServiceObjectiveNameSystem3L', 'ServiceObjectiveNameSystem4L', 'ServiceObjectiveNameFree', 'ServiceObjectiveNameBasic', 'ServiceObjectiveNameS0', 'ServiceObjectiveNameS1', 'ServiceObjectiveNameS2', 'ServiceObjectiveNameS3', 'ServiceObjectiveNameS4', 'ServiceObjectiveNameS6', 'ServiceObjectiveNameS7', 'ServiceObjectiveNameS9', 'ServiceObjectiveNameS12', 'ServiceObjectiveNameP1', 'ServiceObjectiveNameP2', 'ServiceObjectiveNameP3', 'ServiceObjectiveNameP4', 'ServiceObjectiveNameP6', 'ServiceObjectiveNameP11', 'ServiceObjectiveNameP15', 'ServiceObjectiveNamePRS1', 'ServiceObjectiveNamePRS2', 'ServiceObjectiveNamePRS4', 'ServiceObjectiveNamePRS6', 'ServiceObjectiveNameDW100', 'ServiceObjectiveNameDW200', 'ServiceObjectiveNameDW300', 'ServiceObjectiveNameDW400', 'ServiceObjectiveNameDW500', 'ServiceObjectiveNameDW600', 'ServiceObjectiveNameDW1000', 'ServiceObjectiveNameDW1200', 'ServiceObjectiveNameDW1000c', 'ServiceObjectiveNameDW1500', 'ServiceObjectiveNameDW1500c', 'ServiceObjectiveNameDW2000', 'ServiceObjectiveNameDW2000c', 'ServiceObjectiveNameDW3000', 'ServiceObjectiveNameDW2500c', 'ServiceObjectiveNameDW3000c', 'ServiceObjectiveNameDW6000', 'ServiceObjectiveNameDW5000c', 'ServiceObjectiveNameDW6000c', 'ServiceObjectiveNameDW7500c', 'ServiceObjectiveNameDW10000c', 'ServiceObjectiveNameDW15000c', 'ServiceObjectiveNameDW30000c', 'ServiceObjectiveNameDS100', 'ServiceObjectiveNameDS200', 'ServiceObjectiveNameDS300', 'ServiceObjectiveNameDS400', 'ServiceObjectiveNameDS500', 'ServiceObjectiveNameDS600', 'ServiceObjectiveNameDS1000', 'ServiceObjectiveNameDS1200', 'ServiceObjectiveNameDS1500', 'ServiceObjectiveNameDS2000', 'ServiceObjectiveNameElasticPool' - ServiceObjectiveName ServiceObjectiveName `json:"serviceObjectiveName,omitempty"` - // MaxSizeBytes - The maximum size for the newly imported database. - MaxSizeBytes *string `json:"maxSizeBytes,omitempty"` - // StorageKeyType - The type of the storage key to use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - StorageKeyType StorageKeyType `json:"storageKeyType,omitempty"` - // StorageKey - The storage key to use. If storage key type is SharedAccessKey, it must be preceded with a "?." - StorageKey *string `json:"storageKey,omitempty"` - // StorageURI - The storage uri to use. - StorageURI *string `json:"storageUri,omitempty"` - // AdministratorLogin - The name of the SQL administrator. - AdministratorLogin *string `json:"administratorLogin,omitempty"` - // AdministratorLoginPassword - The password of the SQL administrator. - AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"` - // AuthenticationType - The authentication type. Possible values include: 'SQL', 'ADPassword' - AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` -} - -// OperationImpact the impact of an operation, both in absolute and relative terms. -type OperationImpact struct { - // Name - READ-ONLY; The name of the impact dimension. - Name *string `json:"name,omitempty"` - // Unit - READ-ONLY; The unit in which estimated impact to dimension is measured. - Unit *string `json:"unit,omitempty"` - // ChangeValueAbsolute - READ-ONLY; The absolute impact to dimension. - ChangeValueAbsolute *float64 `json:"changeValueAbsolute,omitempty"` - // ChangeValueRelative - READ-ONLY; The relative impact to dimension (null if not applicable) - ChangeValueRelative *float64 `json:"changeValueRelative,omitempty"` +// ServerTableAuditingPolicyListResult represents the response to a list server table auditing policies +// request. +type ServerTableAuditingPolicyListResult struct { + autorest.Response `json:"-"` + // Value - The list of server table auditing policies. + Value *[]ServerTableAuditingPolicy `json:"value,omitempty"` } -// ProxyResource ARM proxy resource. -type ProxyResource struct { - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` +// ServerTableAuditingPolicyProperties properties of a server table auditing policy. +type ServerTableAuditingPolicyProperties struct { + // AuditingState - The state of the policy. + AuditingState *string `json:"auditingState,omitempty"` + // AuditLogsTableName - The audit logs table name. + AuditLogsTableName *string `json:"auditLogsTableName,omitempty"` + // EventTypesToAudit - Comma-separated list of event types to audit. + EventTypesToAudit *string `json:"eventTypesToAudit,omitempty"` + // FullAuditLogsTableName - The full audit logs table name. + FullAuditLogsTableName *string `json:"fullAuditLogsTableName,omitempty"` + // RetentionDays - The number of days to keep in the audit logs. + RetentionDays *string `json:"retentionDays,omitempty"` + // StorageAccountKey - The key of the auditing storage account. + StorageAccountKey *string `json:"storageAccountKey,omitempty"` + // StorageAccountName - The table storage account name + StorageAccountName *string `json:"storageAccountName,omitempty"` + // StorageAccountResourceGroupName - The table storage account resource group name + StorageAccountResourceGroupName *string `json:"storageAccountResourceGroupName,omitempty"` + // StorageAccountSecondaryKey - The secondary key of the auditing storage account. + StorageAccountSecondaryKey *string `json:"storageAccountSecondaryKey,omitempty"` + // StorageAccountSubscriptionID - The table storage subscription Id. + StorageAccountSubscriptionID *uuid.UUID `json:"storageAccountSubscriptionId,omitempty"` + // StorageTableEndpoint - The storage table endpoint. + StorageTableEndpoint *string `json:"storageTableEndpoint,omitempty"` } -// RecommendedElasticPool represents a recommended elastic pool. -type RecommendedElasticPool struct { - autorest.Response `json:"-"` - // RecommendedElasticPoolProperties - The properties representing the resource. - *RecommendedElasticPoolProperties `json:"properties,omitempty"` +// ServerUpdate represents an update to a server. +type ServerUpdate struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ServerProperties - Represents the properties of the resource. + *ServerProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -2083,17 +5318,20 @@ type RecommendedElasticPool struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for RecommendedElasticPool. -func (rep RecommendedElasticPool) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ServerUpdate. +func (su ServerUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if rep.RecommendedElasticPoolProperties != nil { - objectMap["properties"] = rep.RecommendedElasticPoolProperties + if su.Tags != nil { + objectMap["tags"] = su.Tags + } + if su.ServerProperties != nil { + objectMap["properties"] = su.ServerProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for RecommendedElasticPool struct. -func (rep *RecommendedElasticPool) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ServerUpdate struct. +func (su *ServerUpdate) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -2101,14 +5339,23 @@ func (rep *RecommendedElasticPool) UnmarshalJSON(body []byte) error { } 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 + } + su.Tags = tags + } case "properties": if v != nil { - var recommendedElasticPoolProperties RecommendedElasticPoolProperties - err = json.Unmarshal(*v, &recommendedElasticPoolProperties) + var serverProperties ServerProperties + err = json.Unmarshal(*v, &serverProperties) if err != nil { return err } - rep.RecommendedElasticPoolProperties = &recommendedElasticPoolProperties + su.ServerProperties = &serverProperties } case "id": if v != nil { @@ -2117,7 +5364,7 @@ func (rep *RecommendedElasticPool) UnmarshalJSON(body []byte) error { if err != nil { return err } - rep.ID = &ID + su.ID = &ID } case "name": if v != nil { @@ -2126,7 +5373,7 @@ func (rep *RecommendedElasticPool) UnmarshalJSON(body []byte) error { if err != nil { return err } - rep.Name = &name + su.Name = &name } case "type": if v != nil { @@ -2135,7 +5382,7 @@ func (rep *RecommendedElasticPool) UnmarshalJSON(body []byte) error { if err != nil { return err } - rep.Type = &typeVar + su.Type = &typeVar } } } @@ -2143,61 +5390,48 @@ func (rep *RecommendedElasticPool) UnmarshalJSON(body []byte) error { return nil } -// RecommendedElasticPoolListMetricsResult represents the response to a list recommended elastic pool -// metrics request. -type RecommendedElasticPoolListMetricsResult struct { - autorest.Response `json:"-"` - // Value - The list of recommended elastic pools metrics. - Value *[]RecommendedElasticPoolMetric `json:"value,omitempty"` +// ServerUsage represents server metrics. +type ServerUsage struct { + // Name - READ-ONLY; Name of the server usage metric. + Name *string `json:"name,omitempty"` + // ResourceName - READ-ONLY; The name of the resource. + ResourceName *string `json:"resourceName,omitempty"` + // DisplayName - READ-ONLY; The metric display name. + DisplayName *string `json:"displayName,omitempty"` + // CurrentValue - READ-ONLY; The current value of the metric. + CurrentValue *float64 `json:"currentValue,omitempty"` + // Limit - READ-ONLY; The current limit of the metric. + Limit *float64 `json:"limit,omitempty"` + // Unit - READ-ONLY; The units of the metric. + Unit *string `json:"unit,omitempty"` + // NextResetTime - READ-ONLY; The next reset time for the metric (ISO8601 format). + NextResetTime *date.Time `json:"nextResetTime,omitempty"` } -// RecommendedElasticPoolListResult represents the response to a list recommended elastic pool request. -type RecommendedElasticPoolListResult struct { +// ServerUsageListResult represents the response to a list server metrics request. +type ServerUsageListResult struct { autorest.Response `json:"-"` - // Value - The list of recommended elastic pools hosted in the server. - Value *[]RecommendedElasticPool `json:"value,omitempty"` -} - -// RecommendedElasticPoolMetric represents recommended elastic pool metric. -type RecommendedElasticPoolMetric struct { - // DateTime - The time of metric (ISO8601 format). - DateTime *date.Time `json:"dateTime,omitempty"` - // Dtu - Gets or sets the DTUs (Database Transaction Units). See https://azure.microsoft.com/documentation/articles/sql-database-what-is-a-dtu/ - Dtu *float64 `json:"dtu,omitempty"` - // SizeGB - Gets or sets size in gigabytes. - SizeGB *float64 `json:"sizeGB,omitempty"` + // Value - The list of server metrics for the server. + Value *[]ServerUsage `json:"value,omitempty"` } -// RecommendedElasticPoolProperties represents the properties of a recommended elastic pool. -type RecommendedElasticPoolProperties struct { - // DatabaseEdition - READ-ONLY; The edition of the recommended elastic pool. The ElasticPoolEdition enumeration contains all the valid editions. Possible values include: 'ElasticPoolEditionBasic', 'ElasticPoolEditionStandard', 'ElasticPoolEditionPremium', 'ElasticPoolEditionGeneralPurpose', 'ElasticPoolEditionBusinessCritical' - DatabaseEdition ElasticPoolEdition `json:"databaseEdition,omitempty"` - // Dtu - The DTU for the recommended elastic pool. - Dtu *float64 `json:"dtu,omitempty"` - // DatabaseDtuMin - The minimum DTU for the database. - DatabaseDtuMin *float64 `json:"databaseDtuMin,omitempty"` - // DatabaseDtuMax - The maximum DTU for the database. - DatabaseDtuMax *float64 `json:"databaseDtuMax,omitempty"` - // StorageMB - Gets storage size in megabytes. - StorageMB *float64 `json:"storageMB,omitempty"` - // ObservationPeriodStart - READ-ONLY; The observation period start (ISO8601 format). - ObservationPeriodStart *date.Time `json:"observationPeriodStart,omitempty"` - // ObservationPeriodEnd - READ-ONLY; The observation period start (ISO8601 format). - ObservationPeriodEnd *date.Time `json:"observationPeriodEnd,omitempty"` - // MaxObservedDtu - READ-ONLY; Gets maximum observed DTU. - MaxObservedDtu *float64 `json:"maxObservedDtu,omitempty"` - // MaxObservedStorageMB - READ-ONLY; Gets maximum observed storage in megabytes. - MaxObservedStorageMB *float64 `json:"maxObservedStorageMB,omitempty"` - // Databases - READ-ONLY; The list of databases in this pool. Expanded property - Databases *[]Database `json:"databases,omitempty"` - // Metrics - READ-ONLY; The list of databases housed in the server. Expanded property - Metrics *[]RecommendedElasticPoolMetric `json:"metrics,omitempty"` +// ServerVersionCapability the server capabilities. +type ServerVersionCapability struct { + // Name - READ-ONLY; The server version name. + Name *string `json:"name,omitempty"` + // Status - READ-ONLY; The status of the server version. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' + Status CapabilityStatus `json:"status,omitempty"` + // SupportedEditions - READ-ONLY; The list of supported database editions. + SupportedEditions *[]EditionCapability `json:"supportedEditions,omitempty"` + // SupportedElasticPoolEditions - READ-ONLY; The list of supported elastic pool editions. + SupportedElasticPoolEditions *[]ElasticPoolEditionCapability `json:"supportedElasticPoolEditions,omitempty"` } -// RecommendedIndex represents a database recommended index. -type RecommendedIndex struct { - // RecommendedIndexProperties - READ-ONLY; The properties representing the resource. - *RecommendedIndexProperties `json:"properties,omitempty"` +// ServiceObjective represents a database service objective. +type ServiceObjective struct { + autorest.Response `json:"-"` + // ServiceObjectiveProperties - Represents the properties of the resource. + *ServiceObjectiveProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -2206,14 +5440,17 @@ type RecommendedIndex struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for RecommendedIndex. -func (ri RecommendedIndex) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ServiceObjective. +func (so ServiceObjective) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + if so.ServiceObjectiveProperties != nil { + objectMap["properties"] = so.ServiceObjectiveProperties + } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for RecommendedIndex struct. -func (ri *RecommendedIndex) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ServiceObjective struct. +func (so *ServiceObjective) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -2223,12 +5460,12 @@ func (ri *RecommendedIndex) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var recommendedIndexProperties RecommendedIndexProperties - err = json.Unmarshal(*v, &recommendedIndexProperties) + var serviceObjectiveProperties ServiceObjectiveProperties + err = json.Unmarshal(*v, &serviceObjectiveProperties) if err != nil { return err } - ri.RecommendedIndexProperties = &recommendedIndexProperties + so.ServiceObjectiveProperties = &serviceObjectiveProperties } case "id": if v != nil { @@ -2237,7 +5474,7 @@ func (ri *RecommendedIndex) UnmarshalJSON(body []byte) error { if err != nil { return err } - ri.ID = &ID + so.ID = &ID } case "name": if v != nil { @@ -2246,7 +5483,7 @@ func (ri *RecommendedIndex) UnmarshalJSON(body []byte) error { if err != nil { return err } - ri.Name = &name + so.Name = &name } case "type": if v != nil { @@ -2255,7 +5492,7 @@ func (ri *RecommendedIndex) UnmarshalJSON(body []byte) error { if err != nil { return err } - ri.Type = &typeVar + so.Type = &typeVar } } } @@ -2263,60 +5500,30 @@ func (ri *RecommendedIndex) UnmarshalJSON(body []byte) error { return nil } -// RecommendedIndexProperties represents the properties of a database recommended index. -type RecommendedIndexProperties struct { - // Action - READ-ONLY; The proposed index action. You can create a missing index, drop an unused index, or rebuild an existing index to improve its performance. Possible values include: 'Create', 'Drop', 'Rebuild' - Action RecommendedIndexAction `json:"action,omitempty"` - // State - READ-ONLY; The current recommendation state. Possible values include: 'Active', 'Pending', 'Executing', 'Verifying', 'PendingRevert', 'Reverting', 'Reverted', 'Ignored', 'Expired', 'Blocked', 'Success' - State RecommendedIndexState `json:"state,omitempty"` - // Created - READ-ONLY; The UTC datetime showing when this resource was created (ISO8601 format). - Created *date.Time `json:"created,omitempty"` - // LastModified - READ-ONLY; The UTC datetime of when was this resource last changed (ISO8601 format). - LastModified *date.Time `json:"lastModified,omitempty"` - // IndexType - READ-ONLY; The type of index (CLUSTERED, NONCLUSTERED, COLUMNSTORE, CLUSTERED COLUMNSTORE). Possible values include: 'CLUSTERED', 'NONCLUSTERED', 'COLUMNSTORE', 'CLUSTEREDCOLUMNSTORE' - IndexType RecommendedIndexType `json:"indexType,omitempty"` - // Schema - READ-ONLY; The schema where table to build index over resides - Schema *string `json:"schema,omitempty"` - // Table - READ-ONLY; The table on which to build index. - Table *string `json:"table,omitempty"` - // Columns - READ-ONLY; Columns over which to build index - Columns *[]string `json:"columns,omitempty"` - // IncludedColumns - READ-ONLY; The list of column names to be included in the index - IncludedColumns *[]string `json:"includedColumns,omitempty"` - // IndexScript - READ-ONLY; The full build index script - IndexScript *string `json:"indexScript,omitempty"` - // EstimatedImpact - READ-ONLY; The estimated impact of doing recommended index action. - EstimatedImpact *[]OperationImpact `json:"estimatedImpact,omitempty"` - // ReportedImpact - READ-ONLY; The values reported after index action is complete. - ReportedImpact *[]OperationImpact `json:"reportedImpact,omitempty"` -} - -// ReplicationLink represents a database replication link. -type ReplicationLink struct { - autorest.Response `json:"-"` - // Location - READ-ONLY; Location of the server that contains this firewall rule. - Location *string `json:"location,omitempty"` - // ReplicationLinkProperties - The properties representing the resource. - *ReplicationLinkProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. +// ServiceObjectiveCapability the service objectives capability. +type ServiceObjectiveCapability struct { + // Name - READ-ONLY; The service objective name. Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` + // Status - READ-ONLY; The status of the service objective. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' + Status CapabilityStatus `json:"status,omitempty"` + // PerformanceLevel - READ-ONLY; The performance level of the service objective capability. + *PerformanceLevel `json:"performanceLevel,omitempty"` + // ID - READ-ONLY; The unique ID of the service objective. + ID *uuid.UUID `json:"id,omitempty"` + // SupportedMaxSizes - READ-ONLY; The list of supported maximum database sizes for this service objective. + SupportedMaxSizes *[]MaxSizeCapability `json:"supportedMaxSizes,omitempty"` + // IncludedMaxSize - READ-ONLY; The included (free) max size for this service level objective. + IncludedMaxSize *MaxSizeCapability `json:"includedMaxSize,omitempty"` } -// MarshalJSON is the custom marshaler for ReplicationLink. -func (rl ReplicationLink) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ServiceObjectiveCapability. +func (soc ServiceObjectiveCapability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if rl.ReplicationLinkProperties != nil { - objectMap["properties"] = rl.ReplicationLinkProperties - } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ReplicationLink struct. -func (rl *ReplicationLink) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ServiceObjectiveCapability struct. +func (soc *ServiceObjectiveCapability) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -2324,50 +5531,59 @@ func (rl *ReplicationLink) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "location": + case "name": if v != nil { - var location string - err = json.Unmarshal(*v, &location) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - rl.Location = &location + soc.Name = &name } - case "properties": + case "status": if v != nil { - var replicationLinkProperties ReplicationLinkProperties - err = json.Unmarshal(*v, &replicationLinkProperties) + var status CapabilityStatus + err = json.Unmarshal(*v, &status) if err != nil { return err } - rl.ReplicationLinkProperties = &replicationLinkProperties + soc.Status = status + } + case "performanceLevel": + if v != nil { + var performanceLevel PerformanceLevel + err = json.Unmarshal(*v, &performanceLevel) + if err != nil { + return err + } + soc.PerformanceLevel = &performanceLevel } case "id": if v != nil { - var ID string + var ID uuid.UUID err = json.Unmarshal(*v, &ID) if err != nil { return err } - rl.ID = &ID + soc.ID = &ID } - case "name": + case "supportedMaxSizes": if v != nil { - var name string - err = json.Unmarshal(*v, &name) + var supportedMaxSizes []MaxSizeCapability + err = json.Unmarshal(*v, &supportedMaxSizes) if err != nil { return err } - rl.Name = &name + soc.SupportedMaxSizes = &supportedMaxSizes } - case "type": + case "includedMaxSize": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var includedMaxSize MaxSizeCapability + err = json.Unmarshal(*v, &includedMaxSize) if err != nil { return err } - rl.Type = &typeVar + soc.IncludedMaxSize = &includedMaxSize } } } @@ -2375,91 +5591,25 @@ func (rl *ReplicationLink) UnmarshalJSON(body []byte) error { return nil } -// ReplicationLinkListResult represents the response to a List database replication link request. -type ReplicationLinkListResult struct { +// ServiceObjectiveListResult represents the response to a get database service objectives request. +type ServiceObjectiveListResult struct { autorest.Response `json:"-"` - // Value - The list of database replication links housed in the database. - Value *[]ReplicationLink `json:"value,omitempty"` -} - -// ReplicationLinkProperties represents the properties of a database replication link. -type ReplicationLinkProperties struct { - // IsTerminationAllowed - READ-ONLY; Legacy value indicating whether termination is allowed. Currently always returns true. - IsTerminationAllowed *bool `json:"isTerminationAllowed,omitempty"` - // ReplicationMode - READ-ONLY; Replication mode of this replication link. - ReplicationMode *string `json:"replicationMode,omitempty"` - // PartnerServer - READ-ONLY; The name of the server hosting the partner database. - PartnerServer *string `json:"partnerServer,omitempty"` - // PartnerDatabase - READ-ONLY; The name of the partner database. - PartnerDatabase *string `json:"partnerDatabase,omitempty"` - // PartnerLocation - READ-ONLY; The Azure Region of the partner database. - PartnerLocation *string `json:"partnerLocation,omitempty"` - // Role - READ-ONLY; The role of the database in the replication link. Possible values include: 'ReplicationRolePrimary', 'ReplicationRoleSecondary', 'ReplicationRoleNonReadableSecondary', 'ReplicationRoleSource', 'ReplicationRoleCopy' - Role ReplicationRole `json:"role,omitempty"` - // PartnerRole - READ-ONLY; The role of the partner database in the replication link. Possible values include: 'ReplicationRolePrimary', 'ReplicationRoleSecondary', 'ReplicationRoleNonReadableSecondary', 'ReplicationRoleSource', 'ReplicationRoleCopy' - PartnerRole ReplicationRole `json:"partnerRole,omitempty"` - // StartTime - READ-ONLY; The start time for the replication link. - StartTime *date.Time `json:"startTime,omitempty"` - // PercentComplete - READ-ONLY; The percentage of seeding complete for the replication link. - PercentComplete *int32 `json:"percentComplete,omitempty"` - // ReplicationState - READ-ONLY; The replication state for the replication link. Possible values include: 'PENDING', 'SEEDING', 'CATCHUP', 'SUSPENDED' - ReplicationState ReplicationState `json:"replicationState,omitempty"` + // Value - The list of database service objectives. + Value *[]ServiceObjective `json:"value,omitempty"` } -// ReplicationLinksFailoverAllowDataLossFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type ReplicationLinksFailoverAllowDataLossFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ReplicationLinksFailoverAllowDataLossFuture) Result(client ReplicationLinksClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ReplicationLinksFailoverAllowDataLossFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ReplicationLinksFailoverAllowDataLossFuture") - return - } - ar.Response = future.Response() - return -} - -// ReplicationLinksFailoverFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ReplicationLinksFailoverFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ReplicationLinksFailoverFuture) Result(client ReplicationLinksClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ReplicationLinksFailoverFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ReplicationLinksFailoverFuture") - return - } - ar.Response = future.Response() - return -} - -// Resource ARM resource. -type Resource struct { - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` +// ServiceObjectiveProperties represents the properties of a database service objective. +type ServiceObjectiveProperties struct { + // ServiceObjectiveName - READ-ONLY; The name for the service objective. + ServiceObjectiveName *string `json:"serviceObjectiveName,omitempty"` + // IsDefault - READ-ONLY; Gets whether the service level objective is the default service objective. + IsDefault *bool `json:"isDefault,omitempty"` + // IsSystem - READ-ONLY; Gets whether the service level objective is a system service objective. + IsSystem *bool `json:"isSystem,omitempty"` + // Description - READ-ONLY; The description for the service level objective. + Description *string `json:"description,omitempty"` + // Enabled - READ-ONLY; Gets whether the service level objective is enabled. + Enabled *bool `json:"enabled,omitempty"` } // ServiceTierAdvisor represents a Service Tier Advisor. @@ -2591,6 +5741,59 @@ type SloUsageMetric struct { InRangeTimeRatio *float64 `json:"inRangeTimeRatio,omitempty"` } +// TableAuditingPolicyProperties properties of a table auditing policy. +type TableAuditingPolicyProperties struct { + // AuditingState - The state of the policy. + AuditingState *string `json:"auditingState,omitempty"` + // AuditLogsTableName - The audit logs table name. + AuditLogsTableName *string `json:"auditLogsTableName,omitempty"` + // EventTypesToAudit - Comma-separated list of event types to audit. + EventTypesToAudit *string `json:"eventTypesToAudit,omitempty"` + // FullAuditLogsTableName - The full audit logs table name. + FullAuditLogsTableName *string `json:"fullAuditLogsTableName,omitempty"` + // RetentionDays - The number of days to keep in the audit logs. + RetentionDays *string `json:"retentionDays,omitempty"` + // StorageAccountKey - The key of the auditing storage account. + StorageAccountKey *string `json:"storageAccountKey,omitempty"` + // StorageAccountName - The table storage account name + StorageAccountName *string `json:"storageAccountName,omitempty"` + // StorageAccountResourceGroupName - The table storage account resource group name + StorageAccountResourceGroupName *string `json:"storageAccountResourceGroupName,omitempty"` + // StorageAccountSecondaryKey - The secondary key of the auditing storage account. + StorageAccountSecondaryKey *string `json:"storageAccountSecondaryKey,omitempty"` + // StorageAccountSubscriptionID - The table storage subscription Id. + StorageAccountSubscriptionID *uuid.UUID `json:"storageAccountSubscriptionId,omitempty"` + // StorageTableEndpoint - The storage table endpoint. + StorageTableEndpoint *string `json:"storageTableEndpoint,omitempty"` +} + +// TopQueries a database query. +type TopQueries struct { + // AggregationFunction - READ-ONLY; The function that is used to aggregate each query's metrics. Possible values include: 'Min', 'Max', 'Avg', 'Sum' + AggregationFunction QueryAggregationFunction `json:"aggregationFunction,omitempty"` + // ExecutionType - READ-ONLY; The execution type that is used to filter the query instances that are returned. Possible values include: 'Any', 'Regular', 'Irregular', 'Aborted', 'Exception' + ExecutionType QueryExecutionType `json:"executionType,omitempty"` + // IntervalType - READ-ONLY; The duration of the interval (ISO8601 duration format). + IntervalType *string `json:"intervalType,omitempty"` + // NumberOfTopQueries - READ-ONLY; The number of requested queries. + NumberOfTopQueries *float64 `json:"numberOfTopQueries,omitempty"` + // ObservationStartTime - READ-ONLY; The start time for queries that are returned (ISO8601 format) + ObservationStartTime *date.Time `json:"observationStartTime,omitempty"` + // ObservationEndTime - READ-ONLY; The end time for queries that are returned (ISO8601 format) + ObservationEndTime *date.Time `json:"observationEndTime,omitempty"` + // ObservedMetric - READ-ONLY; The type of metric to use for ordering the top metrics. Possible values include: 'CPU', 'Io', 'Logio', 'Duration', 'ExecutionCount' + ObservedMetric QueryObservedMetricType `json:"observedMetric,omitempty"` + // Queries - READ-ONLY; The list of queries. + Queries *[]QueryStatistic `json:"queries,omitempty"` +} + +// TopQueriesListResult represents the response to a get top queries request. +type TopQueriesListResult struct { + autorest.Response `json:"-"` + // Value - The list of top queries. + Value *[]TopQueries `json:"value,omitempty"` +} + // TrackedResource ARM tracked top level resource. type TrackedResource struct { // Location - Resource location. @@ -2801,6 +6004,14 @@ type TransparentDataEncryptionActivityProperties struct { PercentComplete *float64 `json:"percentComplete,omitempty"` } +// TransparentDataEncryptionListResult represents the response to a list transparent data encryption +// configurations request. +type TransparentDataEncryptionListResult struct { + autorest.Response `json:"-"` + // Value - The list of transparent data encryption configurations. + Value *[]TransparentDataEncryption `json:"value,omitempty"` +} + // TransparentDataEncryptionProperties represents the properties of a database transparent data encryption. type TransparentDataEncryptionProperties struct { // Status - The status of the database transparent data encryption. Possible values include: 'TransparentDataEncryptionStatusEnabled', 'TransparentDataEncryptionStatusDisabled' diff --git a/services/sql/mgmt/2014-04-01/sql/operations.go b/services/sql/mgmt/2014-04-01/sql/operations.go new file mode 100644 index 000000000000..18a4cb800c85 --- /dev/null +++ b/services/sql/mgmt/2014-04-01/sql/operations.go @@ -0,0 +1,111 @@ +package sql + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// OperationsClient is the the Azure SQL Database management API provides a RESTful set of web services that interact +// with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, and +// delete databases. +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 of the available SQL Rest API operations. +func (client OperationsClient) List(ctx context.Context) (result OperationListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.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, "sql.OperationsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.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 = "2014-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.Sql/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 +} diff --git a/services/sql/mgmt/2014-04-01/sql/queries.go b/services/sql/mgmt/2014-04-01/sql/queries.go new file mode 100644 index 000000000000..c783532b4683 --- /dev/null +++ b/services/sql/mgmt/2014-04-01/sql/queries.go @@ -0,0 +1,123 @@ +package sql + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if 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" +) + +// QueriesClient is the the Azure SQL Database management API provides a RESTful set of web services that interact with +// Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, and delete +// databases. +type QueriesClient struct { + BaseClient +} + +// NewQueriesClient creates an instance of the QueriesClient client. +func NewQueriesClient(subscriptionID string) QueriesClient { + return NewQueriesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewQueriesClientWithBaseURI creates an instance of the QueriesClient client. +func NewQueriesClientWithBaseURI(baseURI string, subscriptionID string) QueriesClient { + return QueriesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListByDatabase gets a list of top queries by 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 QueriesClient) ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result TopQueriesListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/QueriesClient.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, serverName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.QueriesClient", "ListByDatabase", nil, "Failure preparing request") + return + } + + resp, err := client.ListByDatabaseSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.QueriesClient", "ListByDatabase", resp, "Failure sending request") + return + } + + result, err = client.ListByDatabaseResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.QueriesClient", "ListByDatabase", resp, "Failure responding to request") + } + + return +} + +// ListByDatabasePreparer prepares the ListByDatabase request. +func (client QueriesClient) 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 = "2014-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.Sql/servers/{serverName}/databases/{databaseName}/topQueries", 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 QueriesClient) 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 QueriesClient) ListByDatabaseResponder(resp *http.Response) (result TopQueriesListResult, 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/sql/mgmt/2018-06-15-preview/sql/elasticpoolactivities.go b/services/sql/mgmt/2014-04-01/sql/querystatistics.go similarity index 51% rename from services/preview/sql/mgmt/2018-06-15-preview/sql/elasticpoolactivities.go rename to services/sql/mgmt/2014-04-01/sql/querystatistics.go index 94df73d2fff9..4b948db0a3a2 100644 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/elasticpoolactivities.go +++ b/services/sql/mgmt/2014-04-01/sql/querystatistics.go @@ -25,32 +25,33 @@ import ( "net/http" ) -// ElasticPoolActivitiesClient is the the Azure SQL Database management API provides a RESTful set of web services that +// QueryStatisticsClient is the the Azure SQL Database management API provides a RESTful set of web services that // interact with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, // and delete databases. -type ElasticPoolActivitiesClient struct { +type QueryStatisticsClient struct { BaseClient } -// NewElasticPoolActivitiesClient creates an instance of the ElasticPoolActivitiesClient client. -func NewElasticPoolActivitiesClient(subscriptionID string) ElasticPoolActivitiesClient { - return NewElasticPoolActivitiesClientWithBaseURI(DefaultBaseURI, subscriptionID) +// NewQueryStatisticsClient creates an instance of the QueryStatisticsClient client. +func NewQueryStatisticsClient(subscriptionID string) QueryStatisticsClient { + return NewQueryStatisticsClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewElasticPoolActivitiesClientWithBaseURI creates an instance of the ElasticPoolActivitiesClient client. -func NewElasticPoolActivitiesClientWithBaseURI(baseURI string, subscriptionID string) ElasticPoolActivitiesClient { - return ElasticPoolActivitiesClient{NewWithBaseURI(baseURI, subscriptionID)} +// NewQueryStatisticsClientWithBaseURI creates an instance of the QueryStatisticsClient client. +func NewQueryStatisticsClientWithBaseURI(baseURI string, subscriptionID string) QueryStatisticsClient { + return QueryStatisticsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// ListByElasticPool returns elastic pool activities. +// ListByQuery lists a query's statistics. // 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. -// elasticPoolName - the name of the elastic pool for which to get the current activity. -func (client ElasticPoolActivitiesClient) ListByElasticPool(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (result ElasticPoolActivityListResult, err error) { +// databaseName - the name of the database. +// queryID - the id of the query +func (client QueryStatisticsClient) ListByQuery(ctx context.Context, resourceGroupName string, serverName string, databaseName string, queryID string) (result QueryStatisticListResult, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ElasticPoolActivitiesClient.ListByElasticPool") + ctx = tracing.StartSpan(ctx, fqdn+"/QueryStatisticsClient.ListByQuery") defer func() { sc := -1 if result.Response.Response != nil { @@ -59,31 +60,32 @@ func (client ElasticPoolActivitiesClient) ListByElasticPool(ctx context.Context, tracing.EndSpan(ctx, sc, err) }() } - req, err := client.ListByElasticPoolPreparer(ctx, resourceGroupName, serverName, elasticPoolName) + req, err := client.ListByQueryPreparer(ctx, resourceGroupName, serverName, databaseName, queryID) if err != nil { - err = autorest.NewErrorWithError(err, "sql.ElasticPoolActivitiesClient", "ListByElasticPool", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "sql.QueryStatisticsClient", "ListByQuery", nil, "Failure preparing request") return } - resp, err := client.ListByElasticPoolSender(req) + resp, err := client.ListByQuerySender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ElasticPoolActivitiesClient", "ListByElasticPool", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "sql.QueryStatisticsClient", "ListByQuery", resp, "Failure sending request") return } - result, err = client.ListByElasticPoolResponder(resp) + result, err = client.ListByQueryResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "sql.ElasticPoolActivitiesClient", "ListByElasticPool", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "sql.QueryStatisticsClient", "ListByQuery", resp, "Failure responding to request") } return } -// ListByElasticPoolPreparer prepares the ListByElasticPool request. -func (client ElasticPoolActivitiesClient) ListByElasticPoolPreparer(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (*http.Request, error) { +// ListByQueryPreparer prepares the ListByQuery request. +func (client QueryStatisticsClient) ListByQueryPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, queryID string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "elasticPoolName": autorest.Encode("path", elasticPoolName), + "databaseName": autorest.Encode("path", databaseName), + "queryId": autorest.Encode("path", queryID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serverName": autorest.Encode("path", serverName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -97,21 +99,21 @@ func (client ElasticPoolActivitiesClient) ListByElasticPoolPreparer(ctx context. preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/elasticPoolActivity", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/topQueries/{queryId}/statistics", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListByElasticPoolSender sends the ListByElasticPool request. The method will close the +// ListByQuerySender sends the ListByQuery request. The method will close the // http.Response Body if it receives an error. -func (client ElasticPoolActivitiesClient) ListByElasticPoolSender(req *http.Request) (*http.Response, error) { +func (client QueryStatisticsClient) ListByQuerySender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// ListByElasticPoolResponder handles the response to the ListByElasticPool request. The method always +// ListByQueryResponder handles the response to the ListByQuery request. The method always // closes the http.Response Body. -func (client ElasticPoolActivitiesClient) ListByElasticPoolResponder(resp *http.Response) (result ElasticPoolActivityListResult, err error) { +func (client QueryStatisticsClient) ListByQueryResponder(resp *http.Response) (result QueryStatisticListResult, err error) { err = autorest.Respond( resp, client.ByInspecting(), diff --git a/services/sql/mgmt/2014-04-01/sql/querytexts.go b/services/sql/mgmt/2014-04-01/sql/querytexts.go new file mode 100644 index 000000000000..133a7a07db30 --- /dev/null +++ b/services/sql/mgmt/2014-04-01/sql/querytexts.go @@ -0,0 +1,125 @@ +package sql + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if 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" +) + +// QueryTextsClient is the the Azure SQL Database management API provides a RESTful set of web services that interact +// with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, and +// delete databases. +type QueryTextsClient struct { + BaseClient +} + +// NewQueryTextsClient creates an instance of the QueryTextsClient client. +func NewQueryTextsClient(subscriptionID string) QueryTextsClient { + return NewQueryTextsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewQueryTextsClientWithBaseURI creates an instance of the QueryTextsClient client. +func NewQueryTextsClientWithBaseURI(baseURI string, subscriptionID string) QueryTextsClient { + return QueryTextsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListByQuery gets a query's text. +// 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. +// queryID - the id of the query +func (client QueryTextsClient) ListByQuery(ctx context.Context, resourceGroupName string, serverName string, databaseName string, queryID string) (result QueryTextListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/QueryTextsClient.ListByQuery") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListByQueryPreparer(ctx, resourceGroupName, serverName, databaseName, queryID) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.QueryTextsClient", "ListByQuery", nil, "Failure preparing request") + return + } + + resp, err := client.ListByQuerySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.QueryTextsClient", "ListByQuery", resp, "Failure sending request") + return + } + + result, err = client.ListByQueryResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.QueryTextsClient", "ListByQuery", resp, "Failure responding to request") + } + + return +} + +// ListByQueryPreparer prepares the ListByQuery request. +func (client QueryTextsClient) ListByQueryPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, queryID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "databaseName": autorest.Encode("path", databaseName), + "queryId": autorest.Encode("path", queryID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2014-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.Sql/servers/{serverName}/databases/{databaseName}/topQueries/{queryId}/queryText", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByQuerySender sends the ListByQuery request. The method will close the +// http.Response Body if it receives an error. +func (client QueryTextsClient) ListByQuerySender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByQueryResponder handles the response to the ListByQuery request. The method always +// closes the http.Response Body. +func (client QueryTextsClient) ListByQueryResponder(resp *http.Response) (result QueryTextListResult, 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/sql/mgmt/2018-06-15-preview/sql/recoverabledatabases.go b/services/sql/mgmt/2014-04-01/sql/recoverabledatabases.go similarity index 100% rename from services/preview/sql/mgmt/2018-06-15-preview/sql/recoverabledatabases.go rename to services/sql/mgmt/2014-04-01/sql/recoverabledatabases.go diff --git a/services/preview/sql/mgmt/2018-06-15-preview/sql/restorabledroppeddatabases.go b/services/sql/mgmt/2014-04-01/sql/restorabledroppeddatabases.go similarity index 100% rename from services/preview/sql/mgmt/2018-06-15-preview/sql/restorabledroppeddatabases.go rename to services/sql/mgmt/2014-04-01/sql/restorabledroppeddatabases.go diff --git a/services/sql/mgmt/2014-04-01/sql/restorepoints.go b/services/sql/mgmt/2014-04-01/sql/restorepoints.go new file mode 100644 index 000000000000..a261a52b7584 --- /dev/null +++ b/services/sql/mgmt/2014-04-01/sql/restorepoints.go @@ -0,0 +1,123 @@ +package sql + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if 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" +) + +// RestorePointsClient is the the Azure SQL Database management API provides a RESTful set of web services that +// interact with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, +// and delete databases. +type RestorePointsClient struct { + BaseClient +} + +// NewRestorePointsClient creates an instance of the RestorePointsClient client. +func NewRestorePointsClient(subscriptionID string) RestorePointsClient { + return NewRestorePointsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewRestorePointsClientWithBaseURI creates an instance of the RestorePointsClient client. +func NewRestorePointsClientWithBaseURI(baseURI string, subscriptionID string) RestorePointsClient { + return RestorePointsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListByDatabase gets a list of database restore points. +// 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 to get available restore points. +func (client RestorePointsClient) ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result RestorePointListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointsClient.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, serverName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.RestorePointsClient", "ListByDatabase", nil, "Failure preparing request") + return + } + + resp, err := client.ListByDatabaseSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.RestorePointsClient", "ListByDatabase", resp, "Failure sending request") + return + } + + result, err = client.ListByDatabaseResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.RestorePointsClient", "ListByDatabase", resp, "Failure responding to request") + } + + return +} + +// ListByDatabasePreparer prepares the ListByDatabase request. +func (client RestorePointsClient) 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 = "2014-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.Sql/servers/{serverName}/databases/{databaseName}/restorePoints", 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 RestorePointsClient) 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 RestorePointsClient) ListByDatabaseResponder(resp *http.Response) (result RestorePointListResult, 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/sql/mgmt/2018-06-15-preview/sql/firewallrules.go b/services/sql/mgmt/2014-04-01/sql/serveradvisors.go similarity index 57% rename from services/preview/sql/mgmt/2018-06-15-preview/sql/firewallrules.go rename to services/sql/mgmt/2014-04-01/sql/serveradvisors.go index daa8a1f832c7..9893c9d4ac6c 100644 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/firewallrules.go +++ b/services/sql/mgmt/2014-04-01/sql/serveradvisors.go @@ -21,38 +21,37 @@ 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" ) -// FirewallRulesClient is the the Azure SQL Database management API provides a RESTful set of web services that +// ServerAdvisorsClient is the the Azure SQL Database management API provides a RESTful set of web services that // interact with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, // and delete databases. -type FirewallRulesClient struct { +type ServerAdvisorsClient struct { BaseClient } -// NewFirewallRulesClient creates an instance of the FirewallRulesClient client. -func NewFirewallRulesClient(subscriptionID string) FirewallRulesClient { - return NewFirewallRulesClientWithBaseURI(DefaultBaseURI, subscriptionID) +// NewServerAdvisorsClient creates an instance of the ServerAdvisorsClient client. +func NewServerAdvisorsClient(subscriptionID string) ServerAdvisorsClient { + return NewServerAdvisorsClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewFirewallRulesClientWithBaseURI creates an instance of the FirewallRulesClient client. -func NewFirewallRulesClientWithBaseURI(baseURI string, subscriptionID string) FirewallRulesClient { - return FirewallRulesClient{NewWithBaseURI(baseURI, subscriptionID)} +// NewServerAdvisorsClientWithBaseURI creates an instance of the ServerAdvisorsClient client. +func NewServerAdvisorsClientWithBaseURI(baseURI string, subscriptionID string) ServerAdvisorsClient { + return ServerAdvisorsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate creates or updates a firewall rule. +// CreateOrUpdate creates or updates a server advisor. // 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. -// firewallRuleName - the name of the firewall rule. -// parameters - the required parameters for creating or updating a firewall rule. -func (client FirewallRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, parameters FirewallRule) (result FirewallRule, err error) { +// advisorName - the name of the Server Advisor. +// parameters - the requested advisor resource state. +func (client ServerAdvisorsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, advisorName string, parameters Advisor) (result Advisor, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallRulesClient.CreateOrUpdate") + ctx = tracing.StartSpan(ctx, fqdn+"/ServerAdvisorsClient.CreateOrUpdate") defer func() { sc := -1 if result.Response.Response != nil { @@ -61,40 +60,31 @@ func (client FirewallRulesClient) CreateOrUpdate(ctx context.Context, resourceGr tracing.EndSpan(ctx, sc, err) }() } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.FirewallRuleProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.FirewallRuleProperties.StartIPAddress", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.FirewallRuleProperties.EndIPAddress", Name: validation.Null, Rule: true, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("sql.FirewallRulesClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, firewallRuleName, parameters) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, advisorName, parameters) if err != nil { - err = autorest.NewErrorWithError(err, "sql.FirewallRulesClient", "CreateOrUpdate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "sql.ServerAdvisorsClient", "CreateOrUpdate", nil, "Failure preparing request") return } resp, err := client.CreateOrUpdateSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.FirewallRulesClient", "CreateOrUpdate", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "sql.ServerAdvisorsClient", "CreateOrUpdate", resp, "Failure sending request") return } result, err = client.CreateOrUpdateResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "sql.FirewallRulesClient", "CreateOrUpdate", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "sql.ServerAdvisorsClient", "CreateOrUpdate", resp, "Failure responding to request") } return } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client FirewallRulesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, parameters FirewallRule) (*http.Request, error) { +func (client ServerAdvisorsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, advisorName string, parameters Advisor) (*http.Request, error) { pathParameters := map[string]interface{}{ - "firewallRuleName": autorest.Encode("path", firewallRuleName), + "advisorName": autorest.Encode("path", advisorName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serverName": autorest.Encode("path", serverName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -111,7 +101,7 @@ func (client FirewallRulesClient) CreateOrUpdatePreparer(ctx context.Context, re autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advisors/{advisorName}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -119,66 +109,66 @@ func (client FirewallRulesClient) CreateOrUpdatePreparer(ctx context.Context, re // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. -func (client FirewallRulesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { +func (client ServerAdvisorsClient) 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 FirewallRulesClient) CreateOrUpdateResponder(resp *http.Response) (result FirewallRule, err error) { +func (client ServerAdvisorsClient) CreateOrUpdateResponder(resp *http.Response) (result Advisor, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// Delete deletes a firewall rule. +// Get gets a server advisor. // 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. -// firewallRuleName - the name of the firewall rule. -func (client FirewallRulesClient) Delete(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string) (result autorest.Response, err error) { +// advisorName - the name of the Server Advisor. +func (client ServerAdvisorsClient) Get(ctx context.Context, resourceGroupName string, serverName string, advisorName string) (result Advisor, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallRulesClient.Delete") + ctx = tracing.StartSpan(ctx, fqdn+"/ServerAdvisorsClient.Get") defer func() { sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } - req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, firewallRuleName) + req, err := client.GetPreparer(ctx, resourceGroupName, serverName, advisorName) if err != nil { - err = autorest.NewErrorWithError(err, "sql.FirewallRulesClient", "Delete", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "sql.ServerAdvisorsClient", "Get", nil, "Failure preparing request") return } - resp, err := client.DeleteSender(req) + resp, err := client.GetSender(req) if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "sql.FirewallRulesClient", "Delete", resp, "Failure sending request") + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.ServerAdvisorsClient", "Get", resp, "Failure sending request") return } - result, err = client.DeleteResponder(resp) + result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "sql.FirewallRulesClient", "Delete", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "sql.ServerAdvisorsClient", "Get", resp, "Failure responding to request") } return } -// DeletePreparer prepares the Delete request. -func (client FirewallRulesClient) DeletePreparer(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string) (*http.Request, error) { +// GetPreparer prepares the Get request. +func (client ServerAdvisorsClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, advisorName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "firewallRuleName": autorest.Encode("path", firewallRuleName), + "advisorName": autorest.Encode("path", advisorName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serverName": autorest.Encode("path", serverName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -190,41 +180,41 @@ func (client FirewallRulesClient) DeletePreparer(ctx context.Context, resourceGr } preparer := autorest.CreatePreparer( - autorest.AsDelete(), + autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advisors/{advisorName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// DeleteSender sends the Delete request. The method will close the +// GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. -func (client FirewallRulesClient) DeleteSender(req *http.Request) (*http.Response, error) { +func (client ServerAdvisorsClient) GetSender(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 +// GetResponder handles the response to the Get request. The method always // closes the http.Response Body. -func (client FirewallRulesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { +func (client ServerAdvisorsClient) GetResponder(resp *http.Response) (result Advisor, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) - result.Response = resp + result.Response = autorest.Response{Response: resp} return } -// Get gets a firewall rule. +// ListByServer gets a list of server advisors. // 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. -// firewallRuleName - the name of the firewall rule. -func (client FirewallRulesClient) Get(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string) (result FirewallRule, err error) { +func (client ServerAdvisorsClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result AdvisorListResult, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallRulesClient.Get") + ctx = tracing.StartSpan(ctx, fqdn+"/ServerAdvisorsClient.ListByServer") defer func() { sc := -1 if result.Response.Response != nil { @@ -233,31 +223,30 @@ func (client FirewallRulesClient) Get(ctx context.Context, resourceGroupName str tracing.EndSpan(ctx, sc, err) }() } - req, err := client.GetPreparer(ctx, resourceGroupName, serverName, firewallRuleName) + req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) if err != nil { - err = autorest.NewErrorWithError(err, "sql.FirewallRulesClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "sql.ServerAdvisorsClient", "ListByServer", nil, "Failure preparing request") return } - resp, err := client.GetSender(req) + resp, err := client.ListByServerSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.FirewallRulesClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "sql.ServerAdvisorsClient", "ListByServer", resp, "Failure sending request") return } - result, err = client.GetResponder(resp) + result, err = client.ListByServerResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "sql.FirewallRulesClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "sql.ServerAdvisorsClient", "ListByServer", resp, "Failure responding to request") } return } -// GetPreparer prepares the Get request. -func (client FirewallRulesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string) (*http.Request, error) { +// ListByServerPreparer prepares the ListByServer request. +func (client ServerAdvisorsClient) ListByServerPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "firewallRuleName": autorest.Encode("path", firewallRuleName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serverName": autorest.Encode("path", serverName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -271,21 +260,21 @@ func (client FirewallRulesClient) GetPreparer(ctx context.Context, resourceGroup preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advisors", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetSender sends the Get request. The method will close the +// ListByServerSender sends the ListByServer request. The method will close the // http.Response Body if it receives an error. -func (client FirewallRulesClient) GetSender(req *http.Request) (*http.Response, error) { +func (client ServerAdvisorsClient) ListByServerSender(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 +// ListByServerResponder handles the response to the ListByServer request. The method always // closes the http.Response Body. -func (client FirewallRulesClient) GetResponder(resp *http.Response) (result FirewallRule, err error) { +func (client ServerAdvisorsClient) ListByServerResponder(resp *http.Response) (result AdvisorListResult, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -296,14 +285,16 @@ func (client FirewallRulesClient) GetResponder(resp *http.Response) (result Fire return } -// ListByServer returns a list of firewall rules. +// Update updates a server advisor. // 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 FirewallRulesClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result FirewallRuleListResult, err error) { +// advisorName - the name of the Server Advisor. +// parameters - the requested advisor resource state. +func (client ServerAdvisorsClient) Update(ctx context.Context, resourceGroupName string, serverName string, advisorName string, parameters Advisor) (result Advisor, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallRulesClient.ListByServer") + ctx = tracing.StartSpan(ctx, fqdn+"/ServerAdvisorsClient.Update") defer func() { sc := -1 if result.Response.Response != nil { @@ -312,30 +303,31 @@ func (client FirewallRulesClient) ListByServer(ctx context.Context, resourceGrou tracing.EndSpan(ctx, sc, err) }() } - req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) + req, err := client.UpdatePreparer(ctx, resourceGroupName, serverName, advisorName, parameters) if err != nil { - err = autorest.NewErrorWithError(err, "sql.FirewallRulesClient", "ListByServer", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "sql.ServerAdvisorsClient", "Update", nil, "Failure preparing request") return } - resp, err := client.ListByServerSender(req) + resp, err := client.UpdateSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.FirewallRulesClient", "ListByServer", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "sql.ServerAdvisorsClient", "Update", resp, "Failure sending request") return } - result, err = client.ListByServerResponder(resp) + result, err = client.UpdateResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "sql.FirewallRulesClient", "ListByServer", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "sql.ServerAdvisorsClient", "Update", resp, "Failure responding to request") } return } -// ListByServerPreparer prepares the ListByServer request. -func (client FirewallRulesClient) ListByServerPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { +// UpdatePreparer prepares the Update request. +func (client ServerAdvisorsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, advisorName string, parameters Advisor) (*http.Request, error) { pathParameters := map[string]interface{}{ + "advisorName": autorest.Encode("path", advisorName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serverName": autorest.Encode("path", serverName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -346,24 +338,28 @@ func (client FirewallRulesClient) ListByServerPreparer(ctx context.Context, reso "api-version": APIVersion, } + parameters.Kind = nil + parameters.Location = nil preparer := autorest.CreatePreparer( - autorest.AsGet(), + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advisors/{advisorName}", pathParameters), + autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListByServerSender sends the ListByServer request. The method will close the +// UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. -func (client FirewallRulesClient) ListByServerSender(req *http.Request) (*http.Response, error) { +func (client ServerAdvisorsClient) UpdateSender(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 +// UpdateResponder handles the response to the Update request. The method always // closes the http.Response Body. -func (client FirewallRulesClient) ListByServerResponder(resp *http.Response) (result FirewallRuleListResult, err error) { +func (client ServerAdvisorsClient) UpdateResponder(resp *http.Response) (result Advisor, err error) { err = autorest.Respond( resp, client.ByInspecting(), diff --git a/services/preview/sql/mgmt/2018-06-15-preview/sql/serverazureadadministrators.go b/services/sql/mgmt/2014-04-01/sql/serverazureadadministrators.go similarity index 100% rename from services/preview/sql/mgmt/2018-06-15-preview/sql/serverazureadadministrators.go rename to services/sql/mgmt/2014-04-01/sql/serverazureadadministrators.go diff --git a/services/preview/sql/mgmt/2018-06-15-preview/sql/servercommunicationlinks.go b/services/sql/mgmt/2014-04-01/sql/servercommunicationlinks.go similarity index 100% rename from services/preview/sql/mgmt/2018-06-15-preview/sql/servercommunicationlinks.go rename to services/sql/mgmt/2014-04-01/sql/servercommunicationlinks.go diff --git a/services/preview/sql/mgmt/2018-06-15-preview/sql/serverconnectionpolicies.go b/services/sql/mgmt/2014-04-01/sql/serverconnectionpolicies.go similarity index 100% rename from services/preview/sql/mgmt/2018-06-15-preview/sql/serverconnectionpolicies.go rename to services/sql/mgmt/2014-04-01/sql/serverconnectionpolicies.go diff --git a/services/sql/mgmt/2014-04-01/sql/servers.go b/services/sql/mgmt/2014-04-01/sql/servers.go index b3f03509242d..46ff8f9126cb 100644 --- a/services/sql/mgmt/2014-04-01/sql/servers.go +++ b/services/sql/mgmt/2014-04-01/sql/servers.go @@ -125,3 +125,469 @@ func (client ServersClient) CheckNameAvailabilityResponder(resp *http.Response) result.Response = autorest.Response{Response: resp} return } + +// CreateOrUpdate creates or updates a new 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. +// parameters - the required parameters for creating or updating a server. +func (client ServersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters Server) (result Server, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServersClient.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, serverName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServersClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.ServersClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServersClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ServersClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, parameters Server) (*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 = "2014-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + parameters.Kind = 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.Sql/servers/{serverName}", 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 ServersClient) 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 ServersClient) CreateOrUpdateResponder(resp *http.Response) (result Server, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a SQL server. +// Parameters: +// resourceGroupName - 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 ServersClient) Delete(ctx context.Context, resourceGroupName string, serverName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServersClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, serverName) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServersClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "sql.ServersClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServersClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ServersClient) DeletePreparer(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 = "2014-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.Sql/servers/{serverName}", 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 ServersClient) 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 ServersClient) 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 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 ServersClient) Get(ctx context.Context, resourceGroupName string, serverName string) (result Server, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServersClient.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, serverName) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.ServersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServersClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ServersClient) GetPreparer(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 = "2014-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.Sql/servers/{serverName}", 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 ServersClient) 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 ServersClient) GetResponder(resp *http.Response) (result Server, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List returns a list of servers. +func (client ServersClient) List(ctx context.Context) (result ServerListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServersClient.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, "sql.ServersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.ServersClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServersClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ServersClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2014-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Sql/servers", 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 ServersClient) 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 ServersClient) ListResponder(resp *http.Response) (result ServerListResult, 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 returns a list of servers in a resource group. +// Parameters: +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +func (client ServersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ServerListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServersClient.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, "sql.ServersClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.ServersClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServersClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client ServersClient) 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 = "2014-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.Sql/servers", 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 ServersClient) 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 ServersClient) ListByResourceGroupResponder(resp *http.Response) (result ServerListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update updates an existing 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. +// parameters - the required parameters for updating a server. +func (client ServersClient) Update(ctx context.Context, resourceGroupName string, serverName string, parameters ServerUpdate) (result Server, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServersClient.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, serverName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServersClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.ServersClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServersClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ServersClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, parameters ServerUpdate) (*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 = "2014-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}", 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 ServersClient) 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 ServersClient) UpdateResponder(resp *http.Response) (result Server, 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/sql/mgmt/2018-06-15-preview/sql/serversecurityalertpolicies.go b/services/sql/mgmt/2014-04-01/sql/servertableauditingpolicies.go similarity index 58% rename from services/preview/sql/mgmt/2018-06-15-preview/sql/serversecurityalertpolicies.go rename to services/sql/mgmt/2014-04-01/sql/servertableauditingpolicies.go index 89d98348b85a..230ddf261780 100644 --- a/services/preview/sql/mgmt/2018-06-15-preview/sql/serversecurityalertpolicies.go +++ b/services/sql/mgmt/2014-04-01/sql/servertableauditingpolicies.go @@ -25,74 +25,83 @@ import ( "net/http" ) -// ServerSecurityAlertPoliciesClient is the the Azure SQL Database management API provides a RESTful set of web +// ServerTableAuditingPoliciesClient is the the Azure SQL Database management API provides a RESTful set of web // services that interact with Azure SQL Database services to manage your databases. The API enables you to create, // retrieve, update, and delete databases. -type ServerSecurityAlertPoliciesClient struct { +type ServerTableAuditingPoliciesClient struct { BaseClient } -// NewServerSecurityAlertPoliciesClient creates an instance of the ServerSecurityAlertPoliciesClient client. -func NewServerSecurityAlertPoliciesClient(subscriptionID string) ServerSecurityAlertPoliciesClient { - return NewServerSecurityAlertPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) +// NewServerTableAuditingPoliciesClient creates an instance of the ServerTableAuditingPoliciesClient client. +func NewServerTableAuditingPoliciesClient(subscriptionID string) ServerTableAuditingPoliciesClient { + return NewServerTableAuditingPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewServerSecurityAlertPoliciesClientWithBaseURI creates an instance of the ServerSecurityAlertPoliciesClient client. -func NewServerSecurityAlertPoliciesClientWithBaseURI(baseURI string, subscriptionID string) ServerSecurityAlertPoliciesClient { - return ServerSecurityAlertPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} +// NewServerTableAuditingPoliciesClientWithBaseURI creates an instance of the ServerTableAuditingPoliciesClient client. +func NewServerTableAuditingPoliciesClientWithBaseURI(baseURI string, subscriptionID string) ServerTableAuditingPoliciesClient { + return ServerTableAuditingPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate creates or updates a threat detection policy. +// CreateOrUpdate creates or updates a server's table auditing policy. Table auditing is deprecated, use blob auditing +// instead. // 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. -// parameters - the server security alert policy. -func (client ServerSecurityAlertPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters ServerSecurityAlertPolicy) (result ServerSecurityAlertPoliciesCreateOrUpdateFuture, err error) { +// parameters - the server table auditing policy. +func (client ServerTableAuditingPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters ServerTableAuditingPolicy) (result ServerTableAuditingPolicy, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServerSecurityAlertPoliciesClient.CreateOrUpdate") + ctx = tracing.StartSpan(ctx, fqdn+"/ServerTableAuditingPoliciesClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, parameters) if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerSecurityAlertPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "sql.ServerTableAuditingPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") return } - result, err = client.CreateOrUpdateSender(req) + resp, err := client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerSecurityAlertPoliciesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.ServerTableAuditingPoliciesClient", "CreateOrUpdate", resp, "Failure sending request") return } + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerTableAuditingPoliciesClient", "CreateOrUpdate", resp, "Failure responding to request") + } + return } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ServerSecurityAlertPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, parameters ServerSecurityAlertPolicy) (*http.Request, error) { +func (client ServerTableAuditingPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, parameters ServerTableAuditingPolicy) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), - "securityAlertPolicyName": autorest.Encode("path", "Default"), "serverName": autorest.Encode("path", serverName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tableAuditingPolicyName": autorest.Encode("path", "default"), } - const APIVersion = "2017-03-01-preview" + const APIVersion = "2014-04-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } + parameters.Kind = nil + parameters.Location = 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.Sql/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingPolicies/{tableAuditingPolicyName}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -100,38 +109,32 @@ func (client ServerSecurityAlertPoliciesClient) CreateOrUpdatePreparer(ctx conte // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. -func (client ServerSecurityAlertPoliciesClient) CreateOrUpdateSender(req *http.Request) (future ServerSecurityAlertPoliciesCreateOrUpdateFuture, err error) { +func (client ServerTableAuditingPoliciesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, 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 + return autorest.SendWithSender(client, req, sd...) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always // closes the http.Response Body. -func (client ServerSecurityAlertPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result ServerSecurityAlertPolicy, err error) { +func (client ServerTableAuditingPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result ServerTableAuditingPolicy, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// Get get a server's security alert policy. +// Get gets a server's table auditing policy. Table auditing is deprecated, use blob auditing instead. // 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 ServerSecurityAlertPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string) (result ServerSecurityAlertPolicy, err error) { +func (client ServerTableAuditingPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string) (result ServerTableAuditingPolicy, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServerSecurityAlertPoliciesClient.Get") + ctx = tracing.StartSpan(ctx, fqdn+"/ServerTableAuditingPoliciesClient.Get") defer func() { sc := -1 if result.Response.Response != nil { @@ -142,35 +145,35 @@ func (client ServerSecurityAlertPoliciesClient) Get(ctx context.Context, resourc } req, err := client.GetPreparer(ctx, resourceGroupName, serverName) if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerSecurityAlertPoliciesClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "sql.ServerTableAuditingPoliciesClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ServerSecurityAlertPoliciesClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "sql.ServerTableAuditingPoliciesClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerSecurityAlertPoliciesClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "sql.ServerTableAuditingPoliciesClient", "Get", resp, "Failure responding to request") } return } // GetPreparer prepares the Get request. -func (client ServerSecurityAlertPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { +func (client ServerTableAuditingPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), - "securityAlertPolicyName": autorest.Encode("path", "Default"), "serverName": autorest.Encode("path", serverName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tableAuditingPolicyName": autorest.Encode("path", "default"), } - const APIVersion = "2017-03-01-preview" + const APIVersion = "2014-04-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -178,21 +181,21 @@ func (client ServerSecurityAlertPoliciesClient) GetPreparer(ctx context.Context, preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingPolicies/{tableAuditingPolicyName}", 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 ServerSecurityAlertPoliciesClient) GetSender(req *http.Request) (*http.Response, error) { +func (client ServerTableAuditingPoliciesClient) 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 ServerSecurityAlertPoliciesClient) GetResponder(resp *http.Response) (result ServerSecurityAlertPolicy, err error) { +func (client ServerTableAuditingPoliciesClient) GetResponder(resp *http.Response) (result ServerTableAuditingPolicy, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -203,53 +206,52 @@ func (client ServerSecurityAlertPoliciesClient) GetResponder(resp *http.Response return } -// ListByServer get the server's threat detection policies. +// ListByServer lists a server's table auditing policies. Table auditing is deprecated, use blob auditing instead. // 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 ServerSecurityAlertPoliciesClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result LogicalServerSecurityAlertPolicyListResultPage, err error) { +func (client ServerTableAuditingPoliciesClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result ServerTableAuditingPolicyListResult, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServerSecurityAlertPoliciesClient.ListByServer") + ctx = tracing.StartSpan(ctx, fqdn+"/ServerTableAuditingPoliciesClient.ListByServer") defer func() { sc := -1 - if result.lssaplr.Response.Response != nil { - sc = result.lssaplr.Response.Response.StatusCode + if result.Response.Response != nil { + sc = result.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.ServerSecurityAlertPoliciesClient", "ListByServer", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "sql.ServerTableAuditingPoliciesClient", "ListByServer", nil, "Failure preparing request") return } resp, err := client.ListByServerSender(req) if err != nil { - result.lssaplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ServerSecurityAlertPoliciesClient", "ListByServer", resp, "Failure sending request") + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.ServerTableAuditingPoliciesClient", "ListByServer", resp, "Failure sending request") return } - result.lssaplr, err = client.ListByServerResponder(resp) + result, err = client.ListByServerResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerSecurityAlertPoliciesClient", "ListByServer", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "sql.ServerTableAuditingPoliciesClient", "ListByServer", resp, "Failure responding to request") } return } // ListByServerPreparer prepares the ListByServer request. -func (client ServerSecurityAlertPoliciesClient) ListByServerPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { +func (client ServerTableAuditingPoliciesClient) 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" + const APIVersion = "2014-04-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -257,21 +259,21 @@ func (client ServerSecurityAlertPoliciesClient) ListByServerPreparer(ctx context preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingPolicies", 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 ServerSecurityAlertPoliciesClient) ListByServerSender(req *http.Request) (*http.Response, error) { +func (client ServerTableAuditingPoliciesClient) 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 ServerSecurityAlertPoliciesClient) ListByServerResponder(resp *http.Response) (result LogicalServerSecurityAlertPolicyListResult, err error) { +func (client ServerTableAuditingPoliciesClient) ListByServerResponder(resp *http.Response) (result ServerTableAuditingPolicyListResult, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -281,40 +283,3 @@ func (client ServerSecurityAlertPoliciesClient) ListByServerResponder(resp *http result.Response = autorest.Response{Response: resp} return } - -// listByServerNextResults retrieves the next set of results, if any. -func (client ServerSecurityAlertPoliciesClient) listByServerNextResults(ctx context.Context, lastResults LogicalServerSecurityAlertPolicyListResult) (result LogicalServerSecurityAlertPolicyListResult, err error) { - req, err := lastResults.logicalServerSecurityAlertPolicyListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.ServerSecurityAlertPoliciesClient", "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.ServerSecurityAlertPoliciesClient", "listByServerNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerSecurityAlertPoliciesClient", "listByServerNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByServerComplete enumerates all values, automatically crossing page boundaries as required. -func (client ServerSecurityAlertPoliciesClient) ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string) (result LogicalServerSecurityAlertPolicyListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServerSecurityAlertPoliciesClient.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/2018-06-15-preview/sql/serverusages.go b/services/sql/mgmt/2014-04-01/sql/serverusages.go similarity index 100% rename from services/preview/sql/mgmt/2018-06-15-preview/sql/serverusages.go rename to services/sql/mgmt/2014-04-01/sql/serverusages.go diff --git a/services/preview/sql/mgmt/2018-06-15-preview/sql/serviceobjectives.go b/services/sql/mgmt/2014-04-01/sql/serviceobjectives.go similarity index 100% rename from services/preview/sql/mgmt/2018-06-15-preview/sql/serviceobjectives.go rename to services/sql/mgmt/2014-04-01/sql/serviceobjectives.go diff --git a/services/sql/mgmt/2014-04-01/sql/sqlapi/interfaces.go b/services/sql/mgmt/2014-04-01/sql/sqlapi/interfaces.go index 29c023154f3e..0e49e81fd8b6 100644 --- a/services/sql/mgmt/2014-04-01/sql/sqlapi/interfaces.go +++ b/services/sql/mgmt/2014-04-01/sql/sqlapi/interfaces.go @@ -23,13 +23,87 @@ import ( "github.com/Azure/go-autorest/autorest" ) +// ServerAdvisorsClientAPI contains the set of methods on the ServerAdvisorsClient type. +type ServerAdvisorsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, advisorName string, parameters sql.Advisor) (result sql.Advisor, err error) + Get(ctx context.Context, resourceGroupName string, serverName string, advisorName string) (result sql.Advisor, err error) + ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.AdvisorListResult, err error) + Update(ctx context.Context, resourceGroupName string, serverName string, advisorName string, parameters sql.Advisor) (result sql.Advisor, err error) +} + +var _ ServerAdvisorsClientAPI = (*sql.ServerAdvisorsClient)(nil) + +// DatabaseAdvisorsClientAPI contains the set of methods on the DatabaseAdvisorsClient type. +type DatabaseAdvisorsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, advisorName string, parameters sql.Advisor) (result sql.Advisor, err error) + Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, advisorName string) (result sql.Advisor, err error) + ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.AdvisorListResult, err error) +} + +var _ DatabaseAdvisorsClientAPI = (*sql.DatabaseAdvisorsClient)(nil) + +// BackupLongTermRetentionPoliciesClientAPI contains the set of methods on the BackupLongTermRetentionPoliciesClient type. +type BackupLongTermRetentionPoliciesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.BackupLongTermRetentionPolicy) (result sql.BackupLongTermRetentionPoliciesCreateOrUpdateFuture, err error) + Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.BackupLongTermRetentionPolicy, err error) + ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.BackupLongTermRetentionPolicyListResult, err error) +} + +var _ BackupLongTermRetentionPoliciesClientAPI = (*sql.BackupLongTermRetentionPoliciesClient)(nil) + +// BackupLongTermRetentionVaultsClientAPI contains the set of methods on the BackupLongTermRetentionVaultsClient type. +type BackupLongTermRetentionVaultsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters sql.BackupLongTermRetentionVault) (result sql.BackupLongTermRetentionVaultsCreateOrUpdateFuture, err error) + Get(ctx context.Context, resourceGroupName string, serverName string) (result sql.BackupLongTermRetentionVault, err error) + ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.BackupLongTermRetentionVaultListResult, err error) +} + +var _ BackupLongTermRetentionVaultsClientAPI = (*sql.BackupLongTermRetentionVaultsClient)(nil) + +// RecoverableDatabasesClientAPI contains the set of methods on the RecoverableDatabasesClient type. +type RecoverableDatabasesClientAPI interface { + Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.RecoverableDatabase, err error) + ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.RecoverableDatabaseListResult, err error) +} + +var _ RecoverableDatabasesClientAPI = (*sql.RecoverableDatabasesClient)(nil) + +// RestorableDroppedDatabasesClientAPI contains the set of methods on the RestorableDroppedDatabasesClient type. +type RestorableDroppedDatabasesClientAPI interface { + Get(ctx context.Context, resourceGroupName string, serverName string, restorableDroppededDatabaseID string) (result sql.RestorableDroppedDatabase, err error) + ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.RestorableDroppedDatabaseListResult, err error) +} + +var _ RestorableDroppedDatabasesClientAPI = (*sql.RestorableDroppedDatabasesClient)(nil) + +// CapabilitiesClientAPI contains the set of methods on the CapabilitiesClient type. +type CapabilitiesClientAPI interface { + ListByLocation(ctx context.Context, locationID string) (result sql.LocationCapabilities, err error) +} + +var _ CapabilitiesClientAPI = (*sql.CapabilitiesClient)(nil) + // ServersClientAPI contains the set of methods on the ServersClient type. type ServersClientAPI interface { CheckNameAvailability(ctx context.Context, parameters sql.CheckNameAvailabilityRequest) (result sql.CheckNameAvailabilityResponse, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters sql.Server) (result sql.Server, err error) + Delete(ctx context.Context, resourceGroupName string, serverName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, serverName string) (result sql.Server, err error) + List(ctx context.Context) (result sql.ServerListResult, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result sql.ServerListResult, err error) + Update(ctx context.Context, resourceGroupName string, serverName string, parameters sql.ServerUpdate) (result sql.Server, err error) } var _ ServersClientAPI = (*sql.ServersClient)(nil) +// ServerConnectionPoliciesClientAPI contains the set of methods on the ServerConnectionPoliciesClient type. +type ServerConnectionPoliciesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters sql.ServerConnectionPolicy) (result sql.ServerConnectionPolicy, err error) + Get(ctx context.Context, resourceGroupName string, serverName string) (result sql.ServerConnectionPolicy, err error) +} + +var _ ServerConnectionPoliciesClientAPI = (*sql.ServerConnectionPoliciesClient)(nil) + // DatabasesClientAPI contains the set of methods on the DatabasesClient type. type DatabasesClientAPI interface { CreateImportOperation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.ImportExtensionRequest) (result sql.DatabasesCreateImportOperationFuture, err error) @@ -43,6 +117,8 @@ type DatabasesClientAPI interface { ListByElasticPool(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (result sql.DatabaseListResult, err error) ListByRecommendedElasticPool(ctx context.Context, resourceGroupName string, serverName string, recommendedElasticPoolName string) (result sql.DatabaseListResult, err error) ListByServer(ctx context.Context, resourceGroupName string, serverName string, expand string, filter string) (result sql.DatabaseListResult, err error) + ListMetricDefinitions(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.MetricDefinitionListResult, err error) + ListMetrics(ctx context.Context, resourceGroupName string, serverName string, databaseName string, filter string) (result sql.MetricListResult, err error) Pause(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.DatabasesPauseFuture, err error) Resume(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.DatabasesResumeFuture, err error) Update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.DatabaseUpdate) (result sql.DatabasesUpdateFuture, err error) @@ -50,12 +126,65 @@ type DatabasesClientAPI interface { var _ DatabasesClientAPI = (*sql.DatabasesClient)(nil) +// DatabaseThreatDetectionPoliciesClientAPI contains the set of methods on the DatabaseThreatDetectionPoliciesClient type. +type DatabaseThreatDetectionPoliciesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.DatabaseSecurityAlertPolicy) (result sql.DatabaseSecurityAlertPolicy, err error) + Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.DatabaseSecurityAlertPolicy, err error) +} + +var _ DatabaseThreatDetectionPoliciesClientAPI = (*sql.DatabaseThreatDetectionPoliciesClient)(nil) + +// DataMaskingPoliciesClientAPI contains the set of methods on the DataMaskingPoliciesClient type. +type DataMaskingPoliciesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.DataMaskingPolicy) (result sql.DataMaskingPolicy, err error) + Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.DataMaskingPolicy, err error) +} + +var _ DataMaskingPoliciesClientAPI = (*sql.DataMaskingPoliciesClient)(nil) + +// DataMaskingRulesClientAPI contains the set of methods on the DataMaskingRulesClient type. +type DataMaskingRulesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, dataMaskingRuleName string, parameters sql.DataMaskingRule) (result sql.DataMaskingRule, err error) + ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.DataMaskingRuleListResult, err error) +} + +var _ DataMaskingRulesClientAPI = (*sql.DataMaskingRulesClient)(nil) + +// TransparentDataEncryptionConfigurationsClientAPI contains the set of methods on the TransparentDataEncryptionConfigurationsClient type. +type TransparentDataEncryptionConfigurationsClientAPI interface { + ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.TransparentDataEncryptionListResult, err error) +} + +var _ TransparentDataEncryptionConfigurationsClientAPI = (*sql.TransparentDataEncryptionConfigurationsClient)(nil) + +// ExtensionsClientAPI contains the set of methods on the ExtensionsClient type. +type ExtensionsClientAPI interface { + Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result autorest.Response, err error) + ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.ExtensionListResult, err error) +} + +var _ ExtensionsClientAPI = (*sql.ExtensionsClient)(nil) + +// DisasterRecoveryConfigurationsClientAPI contains the set of methods on the DisasterRecoveryConfigurationsClient type. +type DisasterRecoveryConfigurationsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, disasterRecoveryConfigurationName string) (result sql.DisasterRecoveryConfigurationsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, serverName string, disasterRecoveryConfigurationName string) (result sql.DisasterRecoveryConfigurationsDeleteFuture, err error) + Failover(ctx context.Context, resourceGroupName string, serverName string, disasterRecoveryConfigurationName string) (result sql.DisasterRecoveryConfigurationsFailoverFuture, err error) + FailoverAllowDataLoss(ctx context.Context, resourceGroupName string, serverName string, disasterRecoveryConfigurationName string) (result sql.DisasterRecoveryConfigurationsFailoverAllowDataLossFuture, err error) + Get(ctx context.Context, resourceGroupName string, serverName string, disasterRecoveryConfigurationName string) (result sql.DisasterRecoveryConfiguration, err error) + List(ctx context.Context, resourceGroupName string, serverName string) (result sql.DisasterRecoveryConfigurationListResult, err error) +} + +var _ DisasterRecoveryConfigurationsClientAPI = (*sql.DisasterRecoveryConfigurationsClient)(nil) + // ElasticPoolsClientAPI contains the set of methods on the ElasticPoolsClient type. type ElasticPoolsClientAPI interface { CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, parameters sql.ElasticPool) (result sql.ElasticPoolsCreateOrUpdateFuture, err error) Delete(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (result autorest.Response, err error) Get(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (result sql.ElasticPool, err error) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.ElasticPoolListResult, err error) + ListMetricDefinitions(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (result sql.MetricDefinitionListResult, err error) + ListMetrics(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, filter string) (result sql.MetricListResult, err error) Update(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, parameters sql.ElasticPoolUpdate) (result sql.ElasticPoolsUpdateFuture, err error) } @@ -71,6 +200,43 @@ type FirewallRulesClientAPI interface { var _ FirewallRulesClientAPI = (*sql.FirewallRulesClient)(nil) +// GeoBackupPoliciesClientAPI contains the set of methods on the GeoBackupPoliciesClient type. +type GeoBackupPoliciesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.GeoBackupPolicy) (result sql.GeoBackupPolicy, err error) + Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.GeoBackupPolicy, err error) + ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.GeoBackupPolicyListResult, err error) +} + +var _ GeoBackupPoliciesClientAPI = (*sql.GeoBackupPoliciesClient)(nil) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result sql.OperationListResult, err error) +} + +var _ OperationsClientAPI = (*sql.OperationsClient)(nil) + +// QueriesClientAPI contains the set of methods on the QueriesClient type. +type QueriesClientAPI interface { + ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.TopQueriesListResult, err error) +} + +var _ QueriesClientAPI = (*sql.QueriesClient)(nil) + +// QueryStatisticsClientAPI contains the set of methods on the QueryStatisticsClient type. +type QueryStatisticsClientAPI interface { + ListByQuery(ctx context.Context, resourceGroupName string, serverName string, databaseName string, queryID string) (result sql.QueryStatisticListResult, err error) +} + +var _ QueryStatisticsClientAPI = (*sql.QueryStatisticsClient)(nil) + +// QueryTextsClientAPI contains the set of methods on the QueryTextsClient type. +type QueryTextsClientAPI interface { + ListByQuery(ctx context.Context, resourceGroupName string, serverName string, databaseName string, queryID string) (result sql.QueryTextListResult, err error) +} + +var _ QueryTextsClientAPI = (*sql.QueryTextsClient)(nil) + // RecommendedElasticPoolsClientAPI contains the set of methods on the RecommendedElasticPoolsClient type. type RecommendedElasticPoolsClientAPI interface { Get(ctx context.Context, resourceGroupName string, serverName string, recommendedElasticPoolName string) (result sql.RecommendedElasticPool, err error) @@ -91,6 +257,41 @@ type ReplicationLinksClientAPI interface { var _ ReplicationLinksClientAPI = (*sql.ReplicationLinksClient)(nil) +// RestorePointsClientAPI contains the set of methods on the RestorePointsClient type. +type RestorePointsClientAPI interface { + ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.RestorePointListResult, err error) +} + +var _ RestorePointsClientAPI = (*sql.RestorePointsClient)(nil) + +// ServerAzureADAdministratorsClientAPI contains the set of methods on the ServerAzureADAdministratorsClient type. +type ServerAzureADAdministratorsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, properties sql.ServerAzureADAdministrator) (result sql.ServerAzureADAdministratorsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, serverName string) (result sql.ServerAzureADAdministratorsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, serverName string) (result sql.ServerAzureADAdministrator, err error) + ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.ServerAdministratorListResult, err error) +} + +var _ ServerAzureADAdministratorsClientAPI = (*sql.ServerAzureADAdministratorsClient)(nil) + +// ServerCommunicationLinksClientAPI contains the set of methods on the ServerCommunicationLinksClient type. +type ServerCommunicationLinksClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, communicationLinkName string, parameters sql.ServerCommunicationLink) (result sql.ServerCommunicationLinksCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, serverName string, communicationLinkName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, serverName string, communicationLinkName string) (result sql.ServerCommunicationLink, err error) + ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.ServerCommunicationLinkListResult, err error) +} + +var _ ServerCommunicationLinksClientAPI = (*sql.ServerCommunicationLinksClient)(nil) + +// ServiceObjectivesClientAPI contains the set of methods on the ServiceObjectivesClient type. +type ServiceObjectivesClientAPI interface { + Get(ctx context.Context, resourceGroupName string, serverName string, serviceObjectiveName string) (result sql.ServiceObjective, err error) + ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.ServiceObjectiveListResult, err error) +} + +var _ ServiceObjectivesClientAPI = (*sql.ServiceObjectivesClient)(nil) + // ElasticPoolActivitiesClientAPI contains the set of methods on the ElasticPoolActivitiesClient type. type ElasticPoolActivitiesClientAPI interface { ListByElasticPool(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (result sql.ElasticPoolActivityListResult, err error) @@ -128,10 +329,42 @@ type TransparentDataEncryptionActivitiesClientAPI interface { var _ TransparentDataEncryptionActivitiesClientAPI = (*sql.TransparentDataEncryptionActivitiesClient)(nil) -// DatabaseThreatDetectionPoliciesClientAPI contains the set of methods on the DatabaseThreatDetectionPoliciesClient type. -type DatabaseThreatDetectionPoliciesClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.DatabaseSecurityAlertPolicy) (result sql.DatabaseSecurityAlertPolicy, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.DatabaseSecurityAlertPolicy, err error) +// ServerTableAuditingPoliciesClientAPI contains the set of methods on the ServerTableAuditingPoliciesClient type. +type ServerTableAuditingPoliciesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters sql.ServerTableAuditingPolicy) (result sql.ServerTableAuditingPolicy, err error) + Get(ctx context.Context, resourceGroupName string, serverName string) (result sql.ServerTableAuditingPolicy, err error) + ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.ServerTableAuditingPolicyListResult, err error) } -var _ DatabaseThreatDetectionPoliciesClientAPI = (*sql.DatabaseThreatDetectionPoliciesClient)(nil) +var _ ServerTableAuditingPoliciesClientAPI = (*sql.ServerTableAuditingPoliciesClient)(nil) + +// DatabaseTableAuditingPoliciesClientAPI contains the set of methods on the DatabaseTableAuditingPoliciesClient type. +type DatabaseTableAuditingPoliciesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.DatabaseTableAuditingPolicy) (result sql.DatabaseTableAuditingPolicy, err error) + Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.DatabaseTableAuditingPolicy, err error) + ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.DatabaseTableAuditingPolicyListResult, err error) +} + +var _ DatabaseTableAuditingPoliciesClientAPI = (*sql.DatabaseTableAuditingPoliciesClient)(nil) + +// DatabaseConnectionPoliciesClientAPI contains the set of methods on the DatabaseConnectionPoliciesClient type. +type DatabaseConnectionPoliciesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.DatabaseConnectionPolicy) (result sql.DatabaseConnectionPolicy, err error) + Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.DatabaseConnectionPolicy, err error) +} + +var _ DatabaseConnectionPoliciesClientAPI = (*sql.DatabaseConnectionPoliciesClient)(nil) + +// ServerUsagesClientAPI contains the set of methods on the ServerUsagesClient type. +type ServerUsagesClientAPI interface { + ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.ServerUsageListResult, err error) +} + +var _ ServerUsagesClientAPI = (*sql.ServerUsagesClient)(nil) + +// DatabaseUsagesClientAPI contains the set of methods on the DatabaseUsagesClient type. +type DatabaseUsagesClientAPI interface { + ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.DatabaseUsageListResult, err error) +} + +var _ DatabaseUsagesClientAPI = (*sql.DatabaseUsagesClient)(nil) diff --git a/services/sql/mgmt/2014-04-01/sql/transparentdataencryptionconfigurations.go b/services/sql/mgmt/2014-04-01/sql/transparentdataencryptionconfigurations.go new file mode 100644 index 000000000000..8bd126bc0d97 --- /dev/null +++ b/services/sql/mgmt/2014-04-01/sql/transparentdataencryptionconfigurations.go @@ -0,0 +1,126 @@ +package sql + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if 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" +) + +// TransparentDataEncryptionConfigurationsClient is the the Azure SQL Database management API provides a RESTful set of +// web services that interact with Azure SQL Database services to manage your databases. The API enables you to create, +// retrieve, update, and delete databases. +type TransparentDataEncryptionConfigurationsClient struct { + BaseClient +} + +// NewTransparentDataEncryptionConfigurationsClient creates an instance of the +// TransparentDataEncryptionConfigurationsClient client. +func NewTransparentDataEncryptionConfigurationsClient(subscriptionID string) TransparentDataEncryptionConfigurationsClient { + return NewTransparentDataEncryptionConfigurationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewTransparentDataEncryptionConfigurationsClientWithBaseURI creates an instance of the +// TransparentDataEncryptionConfigurationsClient client. +func NewTransparentDataEncryptionConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) TransparentDataEncryptionConfigurationsClient { + return TransparentDataEncryptionConfigurationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListByDatabase gets a list of a database's transparent data encryption configurations. There is only ever one +// element, named 'current', so GetTransparentDataEncryptionConfiguration should be used instead. +// 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 for which the transparent data encryption applies. +func (client TransparentDataEncryptionConfigurationsClient) ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result TransparentDataEncryptionListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TransparentDataEncryptionConfigurationsClient.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, serverName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.TransparentDataEncryptionConfigurationsClient", "ListByDatabase", nil, "Failure preparing request") + return + } + + resp, err := client.ListByDatabaseSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.TransparentDataEncryptionConfigurationsClient", "ListByDatabase", resp, "Failure sending request") + return + } + + result, err = client.ListByDatabaseResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.TransparentDataEncryptionConfigurationsClient", "ListByDatabase", resp, "Failure responding to request") + } + + return +} + +// ListByDatabasePreparer prepares the ListByDatabase request. +func (client TransparentDataEncryptionConfigurationsClient) 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 = "2014-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.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption", 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 TransparentDataEncryptionConfigurationsClient) 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 TransparentDataEncryptionConfigurationsClient) ListByDatabaseResponder(resp *http.Response) (result TransparentDataEncryptionListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/storage/mgmt/2019-04-01/storage/accounts.go b/services/storage/mgmt/2019-04-01/storage/accounts.go index 4ca8db150dec..9b5daba19e50 100644 --- a/services/storage/mgmt/2019-04-01/storage/accounts.go +++ b/services/storage/mgmt/2019-04-01/storage/accounts.go @@ -164,6 +164,16 @@ func (client AccountsClient) Create(ctx context.Context, resourceGroupName strin {Target: "parameters.AccountPropertiesCreateParameters", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.AccountPropertiesCreateParameters.CustomDomain", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.AccountPropertiesCreateParameters.CustomDomain.Name", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.AccountPropertiesCreateParameters.AzureFilesIdentityBasedAuthentication", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.AccountPropertiesCreateParameters.AzureFilesIdentityBasedAuthentication.ActiveDirectoryProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.AccountPropertiesCreateParameters.AzureFilesIdentityBasedAuthentication.ActiveDirectoryProperties.DomainName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.AccountPropertiesCreateParameters.AzureFilesIdentityBasedAuthentication.ActiveDirectoryProperties.NetBiosDomainName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.AccountPropertiesCreateParameters.AzureFilesIdentityBasedAuthentication.ActiveDirectoryProperties.ForestName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.AccountPropertiesCreateParameters.AzureFilesIdentityBasedAuthentication.ActiveDirectoryProperties.DomainGUID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.AccountPropertiesCreateParameters.AzureFilesIdentityBasedAuthentication.ActiveDirectoryProperties.DomainSid", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.AccountPropertiesCreateParameters.AzureFilesIdentityBasedAuthentication.ActiveDirectoryProperties.AzureStorageSid", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, }}}}, {TargetValue: client.SubscriptionID, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { @@ -817,13 +827,14 @@ func (client AccountsClient) ListByResourceGroupResponder(resp *http.Response) ( return } -// ListKeys lists the access keys for the specified storage account. +// ListKeys lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. // accountName - the name of the storage account within the specified resource group. Storage account names // must be between 3 and 24 characters in length and use numbers and lower-case letters only. -func (client AccountsClient) ListKeys(ctx context.Context, resourceGroupName string, accountName string) (result AccountListKeysResult, err error) { +// expand - specifies type of the key to be listed. Possible value is kerb. +func (client AccountsClient) ListKeys(ctx context.Context, resourceGroupName string, accountName string, expand ListKeyExpand) (result AccountListKeysResult, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListKeys") defer func() { @@ -847,7 +858,7 @@ func (client AccountsClient) ListKeys(ctx context.Context, resourceGroupName str return result, validation.NewError("storage.AccountsClient", "ListKeys", err.Error()) } - req, err := client.ListKeysPreparer(ctx, resourceGroupName, accountName) + req, err := client.ListKeysPreparer(ctx, resourceGroupName, accountName, expand) if err != nil { err = autorest.NewErrorWithError(err, "storage.AccountsClient", "ListKeys", nil, "Failure preparing request") return @@ -869,7 +880,7 @@ func (client AccountsClient) ListKeys(ctx context.Context, resourceGroupName str } // ListKeysPreparer prepares the ListKeys request. -func (client AccountsClient) ListKeysPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { +func (client AccountsClient) ListKeysPreparer(ctx context.Context, resourceGroupName string, accountName string, expand ListKeyExpand) (*http.Request, error) { pathParameters := map[string]interface{}{ "accountName": autorest.Encode("path", accountName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -880,6 +891,9 @@ func (client AccountsClient) ListKeysPreparer(ctx context.Context, resourceGroup queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if len(string(expand)) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } preparer := autorest.CreatePreparer( autorest.AsPost(), @@ -1008,13 +1022,13 @@ func (client AccountsClient) ListServiceSASResponder(resp *http.Response) (resul return } -// RegenerateKey regenerates one of the access keys for the specified storage account. +// RegenerateKey regenerates one of the access keys or Kerberos keys for the specified storage account. // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. // accountName - the name of the storage account within the specified resource group. Storage account names // must be between 3 and 24 characters in length and use numbers and lower-case letters only. -// regenerateKey - specifies name of the key which should be regenerated -- key1 or key2. +// regenerateKey - specifies name of the key which should be regenerated -- key1, key2, kerb1, kerb2. func (client AccountsClient) RegenerateKey(ctx context.Context, resourceGroupName string, accountName string, regenerateKey AccountRegenerateKeyParameters) (result AccountListKeysResult, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.RegenerateKey") diff --git a/services/storage/mgmt/2019-04-01/storage/models.go b/services/storage/mgmt/2019-04-01/storage/models.go index 8cba20da6e24..b6326d0faba7 100644 --- a/services/storage/mgmt/2019-04-01/storage/models.go +++ b/services/storage/mgmt/2019-04-01/storage/models.go @@ -148,13 +148,15 @@ type DirectoryServiceOptions string const ( // DirectoryServiceOptionsAADDS ... DirectoryServiceOptionsAADDS DirectoryServiceOptions = "AADDS" + // DirectoryServiceOptionsAD ... + DirectoryServiceOptionsAD DirectoryServiceOptions = "AD" // DirectoryServiceOptionsNone ... DirectoryServiceOptionsNone DirectoryServiceOptions = "None" ) // PossibleDirectoryServiceOptionsValues returns an array of possible values for the DirectoryServiceOptions const type. func PossibleDirectoryServiceOptionsValues() []DirectoryServiceOptions { - return []DirectoryServiceOptions{DirectoryServiceOptionsAADDS, DirectoryServiceOptionsNone} + return []DirectoryServiceOptions{DirectoryServiceOptionsAADDS, DirectoryServiceOptionsAD, DirectoryServiceOptionsNone} } // GeoReplicationStatus enumerates the values for geo replication status. @@ -338,6 +340,19 @@ func PossibleLeaseStatusValues() []LeaseStatus { return []LeaseStatus{LeaseStatusLocked, LeaseStatusUnlocked} } +// ListKeyExpand enumerates the values for list key expand. +type ListKeyExpand string + +const ( + // Kerb ... + Kerb ListKeyExpand = "kerb" +) + +// PossibleListKeyExpandValues returns an array of possible values for the ListKeyExpand const type. +func PossibleListKeyExpandValues() []ListKeyExpand { + return []ListKeyExpand{Kerb} +} + // Permissions enumerates the values for permissions. type Permissions string @@ -1070,7 +1085,7 @@ type AccountPropertiesUpdateParameters struct { // AccountRegenerateKeyParameters the parameters used to regenerate the storage account key. type AccountRegenerateKeyParameters struct { - // KeyName - The name of storage keys that want to be regenerated, possible values are key1, key2. + // KeyName - The name of storage keys that want to be regenerated, possible values are key1, key2, kerb1, kerb2. KeyName *string `json:"keyName,omitempty"` } @@ -1242,6 +1257,22 @@ func (aup *AccountUpdateParameters) UnmarshalJSON(body []byte) error { return nil } +// ActiveDirectoryProperties settings properties for Active Directory (AD). +type ActiveDirectoryProperties struct { + // DomainName - Specifies the primary domain that the AD DNS server is authoritative for. + DomainName *string `json:"domainName,omitempty"` + // NetBiosDomainName - Specifies the NetBIOS domain name. + NetBiosDomainName *string `json:"netBiosDomainName,omitempty"` + // ForestName - Specifies the Active Directory forest to get. + ForestName *string `json:"forestName,omitempty"` + // DomainGUID - Specifies the domain GUID. + DomainGUID *string `json:"domainGuid,omitempty"` + // DomainSid - Specifies the security identifier (SID). + DomainSid *string `json:"domainSid,omitempty"` + // AzureStorageSid - Specifies the security identifier (SID) for Azure Storage. + AzureStorageSid *string `json:"azureStorageSid,omitempty"` +} + // AzureEntityResource the resource model definition for a Azure Resource Manager resource with an etag. type AzureEntityResource struct { // Etag - READ-ONLY; Resource Etag. @@ -1256,8 +1287,10 @@ type AzureEntityResource struct { // AzureFilesIdentityBasedAuthentication settings for Azure Files identity based authentication. type AzureFilesIdentityBasedAuthentication struct { - // DirectoryServiceOptions - Indicates the directory service used. Possible values include: 'DirectoryServiceOptionsNone', 'DirectoryServiceOptionsAADDS' + // DirectoryServiceOptions - Indicates the directory service used. Possible values include: 'DirectoryServiceOptionsNone', 'DirectoryServiceOptionsAADDS', 'DirectoryServiceOptionsAD' DirectoryServiceOptions DirectoryServiceOptions `json:"directoryServiceOptions,omitempty"` + // ActiveDirectoryProperties - Required if choose AD. + ActiveDirectoryProperties *ActiveDirectoryProperties `json:"activeDirectoryProperties,omitempty"` } // BlobContainer properties of the blob container, including Id, resource name, resource type, Etag. 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 2b70fbf217e2..1e83ebd6eb83 100644 --- a/services/storage/mgmt/2019-04-01/storage/storageapi/interfaces.go +++ b/services/storage/mgmt/2019-04-01/storage/storageapi/interfaces.go @@ -47,7 +47,7 @@ type AccountsClientAPI interface { 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) + ListKeys(ctx context.Context, resourceGroupName string, accountName string, expand storage.ListKeyExpand) (result storage.AccountListKeysResult, err error) ListServiceSAS(ctx context.Context, resourceGroupName string, accountName string, parameters storage.ServiceSasParameters) (result storage.ListServiceSasResponse, err error) RegenerateKey(ctx context.Context, resourceGroupName string, accountName string, regenerateKey storage.AccountRegenerateKeyParameters) (result storage.AccountListKeysResult, err error) RevokeUserDelegationKeys(ctx context.Context, resourceGroupName string, accountName string) (result autorest.Response, err error) diff --git a/services/storagecache/mgmt/2019-11-01/storagecache/caches.go b/services/storagecache/mgmt/2019-11-01/storagecache/caches.go new file mode 100644 index 000000000000..4ace44960ee5 --- /dev/null +++ b/services/storagecache/mgmt/2019-11-01/storagecache/caches.go @@ -0,0 +1,951 @@ +package storagecache + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// CachesClient is the a Storage Cache provides scalable caching service for NAS clients, serving data from either +// NFSv3 or Blob at-rest storage (referred to as "Storage Targets"). These operations allow you to manage Caches. +type CachesClient struct { + BaseClient +} + +// NewCachesClient creates an instance of the CachesClient client. +func NewCachesClient(subscriptionID string) CachesClient { + return NewCachesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCachesClientWithBaseURI creates an instance of the CachesClient client. +func NewCachesClientWithBaseURI(baseURI string, subscriptionID string) CachesClient { + return CachesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or update a Cache. +// Parameters: +// resourceGroupName - target resource group. +// cacheName - name of Cache. +// cache - object containing the user-selectable properties of the new Cache. If read-only properties are +// included, they must match the existing values of those properties. +func (client CachesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, cacheName string, cache *Cache) (result CachesCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CachesClient.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: cacheName, + Constraints: []validation.Constraint{{Target: "cacheName", Name: validation.Pattern, Rule: `^[-0-9a-zA-Z_]{1,31}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagecache.CachesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, cacheName, cache) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.CachesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.CachesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client CachesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, cacheName string, cache *Cache) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cacheName": autorest.Encode("path", cacheName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + cache.ID = nil + cache.Name = nil + cache.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.StorageCache/caches/{cacheName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if cache != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(cache)) + } + 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 CachesClient) CreateOrUpdateSender(req *http.Request) (future CachesCreateOrUpdateFuture, 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 CachesClient) CreateOrUpdateResponder(resp *http.Response) (result Cache, 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 schedules a Cache for deletion. +// Parameters: +// resourceGroupName - target resource group. +// cacheName - name of Cache. +func (client CachesClient) Delete(ctx context.Context, resourceGroupName string, cacheName string) (result CachesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CachesClient.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: cacheName, + Constraints: []validation.Constraint{{Target: "cacheName", Name: validation.Pattern, Rule: `^[-0-9a-zA-Z_]{1,31}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagecache.CachesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, cacheName) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.CachesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.CachesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client CachesClient) DeletePreparer(ctx context.Context, resourceGroupName string, cacheName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cacheName": autorest.Encode("path", cacheName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}", 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 CachesClient) DeleteSender(req *http.Request) (future CachesDeleteFuture, 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 CachesClient) DeleteResponder(resp *http.Response) (result SetObject, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Flush tells a Cache to write all dirty data to the Storage Target(s). During the flush, clients will see errors +// returned until the flush is complete. +// Parameters: +// resourceGroupName - target resource group. +// cacheName - name of Cache. +func (client CachesClient) Flush(ctx context.Context, resourceGroupName string, cacheName string) (result CachesFlushFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CachesClient.Flush") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: cacheName, + Constraints: []validation.Constraint{{Target: "cacheName", Name: validation.Pattern, Rule: `^[-0-9a-zA-Z_]{1,31}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagecache.CachesClient", "Flush", err.Error()) + } + + req, err := client.FlushPreparer(ctx, resourceGroupName, cacheName) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.CachesClient", "Flush", nil, "Failure preparing request") + return + } + + result, err = client.FlushSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.CachesClient", "Flush", result.Response(), "Failure sending request") + return + } + + return +} + +// FlushPreparer prepares the Flush request. +func (client CachesClient) FlushPreparer(ctx context.Context, resourceGroupName string, cacheName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cacheName": autorest.Encode("path", cacheName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/flush", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// FlushSender sends the Flush request. The method will close the +// http.Response Body if it receives an error. +func (client CachesClient) FlushSender(req *http.Request) (future CachesFlushFuture, 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 +} + +// FlushResponder handles the response to the Flush request. The method always +// closes the http.Response Body. +func (client CachesClient) FlushResponder(resp *http.Response) (result SetObject, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get returns a Cache. +// Parameters: +// resourceGroupName - target resource group. +// cacheName - name of Cache. +func (client CachesClient) Get(ctx context.Context, resourceGroupName string, cacheName string) (result Cache, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CachesClient.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: cacheName, + Constraints: []validation.Constraint{{Target: "cacheName", Name: validation.Pattern, Rule: `^[-0-9a-zA-Z_]{1,31}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagecache.CachesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, cacheName) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.CachesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storagecache.CachesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.CachesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client CachesClient) GetPreparer(ctx context.Context, resourceGroupName string, cacheName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cacheName": autorest.Encode("path", cacheName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}", 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 CachesClient) 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 CachesClient) GetResponder(resp *http.Response) (result Cache, 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 all Caches the user has access to under a subscription. +func (client CachesClient) List(ctx context.Context) (result CachesListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CachesClient.List") + defer func() { + sc := -1 + if result.clr.Response.Response != nil { + sc = result.clr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.CachesClient", "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, "storagecache.CachesClient", "List", resp, "Failure sending request") + return + } + + result.clr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.CachesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client CachesClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.StorageCache/caches", 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 CachesClient) 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 CachesClient) ListResponder(resp *http.Response) (result CachesListResult, 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 CachesClient) listNextResults(ctx context.Context, lastResults CachesListResult) (result CachesListResult, err error) { + req, err := lastResults.cachesListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "storagecache.CachesClient", "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, "storagecache.CachesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.CachesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client CachesClient) ListComplete(ctx context.Context) (result CachesListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CachesClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByResourceGroup returns all Caches the user has access to under a resource group. +// Parameters: +// resourceGroupName - target resource group. +func (client CachesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result CachesListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CachesClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.clr.Response.Response != nil { + sc = result.clr.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, "storagecache.CachesClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.clr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storagecache.CachesClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.clr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.CachesClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client CachesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches", 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 CachesClient) 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 CachesClient) ListByResourceGroupResponder(resp *http.Response) (result CachesListResult, 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 CachesClient) listByResourceGroupNextResults(ctx context.Context, lastResults CachesListResult) (result CachesListResult, err error) { + req, err := lastResults.cachesListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "storagecache.CachesClient", "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, "storagecache.CachesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.CachesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client CachesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result CachesListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CachesClient.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 +} + +// Start tells a Stopped state Cache to transition to Active state. +// Parameters: +// resourceGroupName - target resource group. +// cacheName - name of Cache. +func (client CachesClient) Start(ctx context.Context, resourceGroupName string, cacheName string) (result CachesStartFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CachesClient.Start") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: cacheName, + Constraints: []validation.Constraint{{Target: "cacheName", Name: validation.Pattern, Rule: `^[-0-9a-zA-Z_]{1,31}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagecache.CachesClient", "Start", err.Error()) + } + + req, err := client.StartPreparer(ctx, resourceGroupName, cacheName) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.CachesClient", "Start", nil, "Failure preparing request") + return + } + + result, err = client.StartSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.CachesClient", "Start", result.Response(), "Failure sending request") + return + } + + return +} + +// StartPreparer prepares the Start request. +func (client CachesClient) StartPreparer(ctx context.Context, resourceGroupName string, cacheName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cacheName": autorest.Encode("path", cacheName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/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 CachesClient) StartSender(req *http.Request) (future CachesStartFuture, 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 CachesClient) StartResponder(resp *http.Response) (result SetObject, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Stop tells an Active Cache to transition to Stopped state. +// Parameters: +// resourceGroupName - target resource group. +// cacheName - name of Cache. +func (client CachesClient) Stop(ctx context.Context, resourceGroupName string, cacheName string) (result CachesStopFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CachesClient.Stop") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: cacheName, + Constraints: []validation.Constraint{{Target: "cacheName", Name: validation.Pattern, Rule: `^[-0-9a-zA-Z_]{1,31}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagecache.CachesClient", "Stop", err.Error()) + } + + req, err := client.StopPreparer(ctx, resourceGroupName, cacheName) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.CachesClient", "Stop", nil, "Failure preparing request") + return + } + + result, err = client.StopSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.CachesClient", "Stop", result.Response(), "Failure sending request") + return + } + + return +} + +// StopPreparer prepares the Stop request. +func (client CachesClient) StopPreparer(ctx context.Context, resourceGroupName string, cacheName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cacheName": autorest.Encode("path", cacheName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/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 CachesClient) StopSender(req *http.Request) (future CachesStopFuture, 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 CachesClient) StopResponder(resp *http.Response) (result SetObject, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update update a Cache instance. +// Parameters: +// resourceGroupName - target resource group. +// cacheName - name of Cache. +// cache - object containing the user-selectable properties of the Cache. If read-only properties are included, +// they must match the existing values of those properties. +func (client CachesClient) Update(ctx context.Context, resourceGroupName string, cacheName string, cache *Cache) (result Cache, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CachesClient.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: cacheName, + Constraints: []validation.Constraint{{Target: "cacheName", Name: validation.Pattern, Rule: `^[-0-9a-zA-Z_]{1,31}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagecache.CachesClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, cacheName, cache) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.CachesClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storagecache.CachesClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.CachesClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client CachesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, cacheName string, cache *Cache) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cacheName": autorest.Encode("path", cacheName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + cache.ID = nil + cache.Name = nil + cache.Type = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if cache != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(cache)) + } + 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 CachesClient) 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 CachesClient) UpdateResponder(resp *http.Response) (result Cache, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpgradeFirmware upgrade a Cache's firmware if a new version is available. Otherwise, this operation has no effect. +// Parameters: +// resourceGroupName - target resource group. +// cacheName - name of Cache. +func (client CachesClient) UpgradeFirmware(ctx context.Context, resourceGroupName string, cacheName string) (result CachesUpgradeFirmwareFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CachesClient.UpgradeFirmware") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: cacheName, + Constraints: []validation.Constraint{{Target: "cacheName", Name: validation.Pattern, Rule: `^[-0-9a-zA-Z_]{1,31}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagecache.CachesClient", "UpgradeFirmware", err.Error()) + } + + req, err := client.UpgradeFirmwarePreparer(ctx, resourceGroupName, cacheName) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.CachesClient", "UpgradeFirmware", nil, "Failure preparing request") + return + } + + result, err = client.UpgradeFirmwareSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.CachesClient", "UpgradeFirmware", result.Response(), "Failure sending request") + return + } + + return +} + +// UpgradeFirmwarePreparer prepares the UpgradeFirmware request. +func (client CachesClient) UpgradeFirmwarePreparer(ctx context.Context, resourceGroupName string, cacheName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cacheName": autorest.Encode("path", cacheName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/upgrade", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpgradeFirmwareSender sends the UpgradeFirmware request. The method will close the +// http.Response Body if it receives an error. +func (client CachesClient) UpgradeFirmwareSender(req *http.Request) (future CachesUpgradeFirmwareFuture, 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 +} + +// UpgradeFirmwareResponder handles the response to the UpgradeFirmware request. The method always +// closes the http.Response Body. +func (client CachesClient) UpgradeFirmwareResponder(resp *http.Response) (result SetObject, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/storagecache/mgmt/2019-11-01/storagecache/client.go b/services/storagecache/mgmt/2019-11-01/storagecache/client.go new file mode 100644 index 000000000000..36b7e67ad288 --- /dev/null +++ b/services/storagecache/mgmt/2019-11-01/storagecache/client.go @@ -0,0 +1,52 @@ +// Package storagecache implements the Azure ARM Storagecache service API version 2019-11-01. +// +// A Storage Cache provides scalable caching service for NAS clients, serving data from either NFSv3 or Blob at-rest +// storage (referred to as "Storage Targets"). These operations allow you to manage Caches. +package storagecache + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Storagecache + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Storagecache. +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/storagecache/mgmt/2019-11-01/storagecache/models.go b/services/storagecache/mgmt/2019-11-01/storagecache/models.go new file mode 100644 index 000000000000..b02cecd0b3ec --- /dev/null +++ b/services/storagecache/mgmt/2019-11-01/storagecache/models.go @@ -0,0 +1,1481 @@ +package storagecache + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "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/storagecache/mgmt/2019-11-01/storagecache" + +// FirmwareStatusType enumerates the values for firmware status type. +type FirmwareStatusType string + +const ( + // Available ... + Available FirmwareStatusType = "available" + // Unavailable ... + Unavailable FirmwareStatusType = "unavailable" +) + +// PossibleFirmwareStatusTypeValues returns an array of possible values for the FirmwareStatusType const type. +func PossibleFirmwareStatusTypeValues() []FirmwareStatusType { + return []FirmwareStatusType{Available, Unavailable} +} + +// HealthStateType enumerates the values for health state type. +type HealthStateType string + +const ( + // Degraded ... + Degraded HealthStateType = "Degraded" + // Down ... + Down HealthStateType = "Down" + // Flushing ... + Flushing HealthStateType = "Flushing" + // Healthy ... + Healthy HealthStateType = "Healthy" + // Stopped ... + Stopped HealthStateType = "Stopped" + // Stopping ... + Stopping HealthStateType = "Stopping" + // Transitioning ... + Transitioning HealthStateType = "Transitioning" + // Unknown ... + Unknown HealthStateType = "Unknown" + // Upgrading ... + Upgrading HealthStateType = "Upgrading" +) + +// PossibleHealthStateTypeValues returns an array of possible values for the HealthStateType const type. +func PossibleHealthStateTypeValues() []HealthStateType { + return []HealthStateType{Degraded, Down, Flushing, Healthy, Stopped, Stopping, Transitioning, Unknown, Upgrading} +} + +// ProvisioningStateType enumerates the values for provisioning state type. +type ProvisioningStateType string + +const ( + // Cancelled ... + Cancelled ProvisioningStateType = "Cancelled" + // Creating ... + Creating ProvisioningStateType = "Creating" + // Deleting ... + Deleting ProvisioningStateType = "Deleting" + // Failed ... + Failed ProvisioningStateType = "Failed" + // Succeeded ... + Succeeded ProvisioningStateType = "Succeeded" + // Updating ... + Updating ProvisioningStateType = "Updating" +) + +// PossibleProvisioningStateTypeValues returns an array of possible values for the ProvisioningStateType const type. +func PossibleProvisioningStateTypeValues() []ProvisioningStateType { + return []ProvisioningStateType{Cancelled, Creating, Deleting, Failed, Succeeded, Updating} +} + +// ReasonCode enumerates the values for reason code. +type ReasonCode string + +const ( + // NotAvailableForSubscription ... + NotAvailableForSubscription ReasonCode = "NotAvailableForSubscription" + // QuotaID ... + QuotaID ReasonCode = "QuotaId" +) + +// PossibleReasonCodeValues returns an array of possible values for the ReasonCode const type. +func PossibleReasonCodeValues() []ReasonCode { + return []ReasonCode{NotAvailableForSubscription, QuotaID} +} + +// StorageTargetType enumerates the values for storage target type. +type StorageTargetType string + +const ( + // StorageTargetTypeClfs ... + StorageTargetTypeClfs StorageTargetType = "clfs" + // StorageTargetTypeNfs3 ... + StorageTargetTypeNfs3 StorageTargetType = "nfs3" + // StorageTargetTypeUnknown ... + StorageTargetTypeUnknown StorageTargetType = "unknown" +) + +// PossibleStorageTargetTypeValues returns an array of possible values for the StorageTargetType const type. +func PossibleStorageTargetTypeValues() []StorageTargetType { + return []StorageTargetType{StorageTargetTypeClfs, StorageTargetTypeNfs3, StorageTargetTypeUnknown} +} + +// APIOperation REST API operation description: see +// https://github.com/Azure/azure-rest-api-specs/blob/master/documentation/openapi-authoring-automated-guidelines.md#r3023-operationsapiimplementation +type APIOperation struct { + // Display - The object that represents the operation. + Display *APIOperationDisplay `json:"display,omitempty"` + // Name - Operation name: {provider}/{resource}/{operation} + Name *string `json:"name,omitempty"` +} + +// APIOperationDisplay the object that represents the operation. +type APIOperationDisplay struct { + // Operation - Operation type: Read, write, delete, etc. + Operation *string `json:"operation,omitempty"` + // Provider - Service provider: Microsoft.StorageCache + Provider *string `json:"provider,omitempty"` + // Resource - Resource on which the operation is performed: Cache, etc. + Resource *string `json:"resource,omitempty"` +} + +// APIOperationListResult result of the request to list Resource Provider operations. It contains a list of +// operations and a URL link to get the next set of results. +type APIOperationListResult struct { + autorest.Response `json:"-"` + // NextLink - URL to get the next set of operation list results if there are any. + NextLink *string `json:"nextLink,omitempty"` + // Value - List of Resource Provider operations supported by the Microsoft.StorageCache resource provider. + Value *[]APIOperation `json:"value,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} +} + +// Cache a Cache instance. Follows Azure Resource Manager standards: +// https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/resource-api-reference.md +type Cache struct { + autorest.Response `json:"-"` + // Tags - ARM tags as name/value pairs. + Tags interface{} `json:"tags,omitempty"` + // ID - READ-ONLY; Resource ID of the Cache. + ID *string `json:"id,omitempty"` + // Location - Region name string. + Location *string `json:"location,omitempty"` + // Name - READ-ONLY; Name of Cache. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the Cache; Microsoft.StorageCache/Cache + Type *string `json:"type,omitempty"` + // CacheProperties - Properties of the Cache. + *CacheProperties `json:"properties,omitempty"` + // Sku - SKU for the Cache. + Sku *CacheSku `json:"sku,omitempty"` +} + +// MarshalJSON is the custom marshaler for Cache. +func (c Cache) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if c.Tags != nil { + objectMap["tags"] = c.Tags + } + if c.Location != nil { + objectMap["location"] = c.Location + } + if c.CacheProperties != nil { + objectMap["properties"] = c.CacheProperties + } + if c.Sku != nil { + objectMap["sku"] = c.Sku + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Cache struct. +func (c *Cache) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "tags": + if v != nil { + var tags interface{} + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + c.Tags = tags + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + c.ID = &ID + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + c.Location = &location + } + 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 "properties": + if v != nil { + var cacheProperties CacheProperties + err = json.Unmarshal(*v, &cacheProperties) + if err != nil { + return err + } + c.CacheProperties = &cacheProperties + } + case "sku": + if v != nil { + var sku CacheSku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + c.Sku = &sku + } + } + } + + return nil +} + +// CacheHealth an indication of Cache health. Gives more information about health than just that related to +// provisioning. +type CacheHealth struct { + // State - List of Cache health states. Possible values include: 'Unknown', 'Healthy', 'Degraded', 'Down', 'Transitioning', 'Stopping', 'Stopped', 'Upgrading', 'Flushing' + State HealthStateType `json:"state,omitempty"` + // StatusDescription - Describes explanation of state. + StatusDescription *string `json:"statusDescription,omitempty"` +} + +// CacheProperties properties of the Cache. +type CacheProperties struct { + // CacheSizeGB - The size of this Cache, in GB. + CacheSizeGB *int32 `json:"cacheSizeGB,omitempty"` + // Health - READ-ONLY; Health of the Cache. + Health *CacheHealth `json:"health,omitempty"` + // MountAddresses - READ-ONLY; Array of IP addresses that can be used by clients mounting this Cache. + MountAddresses *[]string `json:"mountAddresses,omitempty"` + // ProvisioningState - ARM provisioning state, see https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Creating', 'Deleting', 'Updating' + ProvisioningState ProvisioningStateType `json:"provisioningState,omitempty"` + // Subnet - Subnet used for the Cache. + Subnet *string `json:"subnet,omitempty"` + // UpgradeStatus - Upgrade status of the Cache. + UpgradeStatus *CacheUpgradeStatus `json:"upgradeStatus,omitempty"` +} + +// CachesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type CachesCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *CachesCreateOrUpdateFuture) Result(client CachesClient) (c Cache, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.CachesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("storagecache.CachesCreateOrUpdateFuture") + 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, "storagecache.CachesCreateOrUpdateFuture", "Result", c.Response.Response, "Failure responding to request") + } + } + return +} + +// CachesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type CachesDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *CachesDeleteFuture) Result(client CachesClient) (so SetObject, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.CachesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("storagecache.CachesDeleteFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if so.Response.Response, err = future.GetResult(sender); err == nil && so.Response.Response.StatusCode != http.StatusNoContent { + so, err = client.DeleteResponder(so.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.CachesDeleteFuture", "Result", so.Response.Response, "Failure responding to request") + } + } + return +} + +// CachesFlushFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type CachesFlushFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *CachesFlushFuture) Result(client CachesClient) (so SetObject, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.CachesFlushFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("storagecache.CachesFlushFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if so.Response.Response, err = future.GetResult(sender); err == nil && so.Response.Response.StatusCode != http.StatusNoContent { + so, err = client.FlushResponder(so.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.CachesFlushFuture", "Result", so.Response.Response, "Failure responding to request") + } + } + return +} + +// CacheSku SKU for the Cache. +type CacheSku struct { + // Name - SKU name for this Cache. + Name *string `json:"name,omitempty"` +} + +// CachesListResult result of the request to list Caches. It contains a list of Caches and a URL link to +// get the next set of results. +type CachesListResult struct { + autorest.Response `json:"-"` + // NextLink - URL to get the next set of Cache list results, if there are any. + NextLink *string `json:"nextLink,omitempty"` + // Value - List of Caches. + Value *[]Cache `json:"value,omitempty"` +} + +// CachesListResultIterator provides access to a complete listing of Cache values. +type CachesListResultIterator struct { + i int + page CachesListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *CachesListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CachesListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *CachesListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter CachesListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter CachesListResultIterator) Response() CachesListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter CachesListResultIterator) Value() Cache { + if !iter.page.NotDone() { + return Cache{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the CachesListResultIterator type. +func NewCachesListResultIterator(page CachesListResultPage) CachesListResultIterator { + return CachesListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (clr CachesListResult) IsEmpty() bool { + return clr.Value == nil || len(*clr.Value) == 0 +} + +// cachesListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (clr CachesListResult) cachesListResultPreparer(ctx context.Context) (*http.Request, error) { + if clr.NextLink == nil || len(to.String(clr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(clr.NextLink))) +} + +// CachesListResultPage contains a page of Cache values. +type CachesListResultPage struct { + fn func(context.Context, CachesListResult) (CachesListResult, error) + clr CachesListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *CachesListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CachesListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.clr) + if err != nil { + return err + } + page.clr = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *CachesListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page CachesListResultPage) NotDone() bool { + return !page.clr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page CachesListResultPage) Response() CachesListResult { + return page.clr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page CachesListResultPage) Values() []Cache { + if page.clr.IsEmpty() { + return nil + } + return *page.clr.Value +} + +// Creates a new instance of the CachesListResultPage type. +func NewCachesListResultPage(getNextPage func(context.Context, CachesListResult) (CachesListResult, error)) CachesListResultPage { + return CachesListResultPage{fn: getNextPage} +} + +// CachesStartFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type CachesStartFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *CachesStartFuture) Result(client CachesClient) (so SetObject, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.CachesStartFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("storagecache.CachesStartFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if so.Response.Response, err = future.GetResult(sender); err == nil && so.Response.Response.StatusCode != http.StatusNoContent { + so, err = client.StartResponder(so.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.CachesStartFuture", "Result", so.Response.Response, "Failure responding to request") + } + } + return +} + +// CachesStopFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type CachesStopFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *CachesStopFuture) Result(client CachesClient) (so SetObject, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.CachesStopFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("storagecache.CachesStopFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if so.Response.Response, err = future.GetResult(sender); err == nil && so.Response.Response.StatusCode != http.StatusNoContent { + so, err = client.StopResponder(so.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.CachesStopFuture", "Result", so.Response.Response, "Failure responding to request") + } + } + return +} + +// CachesUpgradeFirmwareFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type CachesUpgradeFirmwareFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *CachesUpgradeFirmwareFuture) Result(client CachesClient) (so SetObject, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.CachesUpgradeFirmwareFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("storagecache.CachesUpgradeFirmwareFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if so.Response.Response, err = future.GetResult(sender); err == nil && so.Response.Response.StatusCode != http.StatusNoContent { + so, err = client.UpgradeFirmwareResponder(so.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.CachesUpgradeFirmwareFuture", "Result", so.Response.Response, "Failure responding to request") + } + } + return +} + +// CacheUpgradeStatus properties describing the software upgrade state of the Cache. +type CacheUpgradeStatus struct { + // CurrentFirmwareVersion - READ-ONLY; Version string of the firmware currently installed on this Cache. + CurrentFirmwareVersion *string `json:"currentFirmwareVersion,omitempty"` + // FirmwareUpdateStatus - READ-ONLY; True if there is a firmware update ready to install on this Cache. The firmware will automatically be installed after firmwareUpdateDeadline if not triggered earlier via the upgrade operation. Possible values include: 'Available', 'Unavailable' + FirmwareUpdateStatus FirmwareStatusType `json:"firmwareUpdateStatus,omitempty"` + // FirmwareUpdateDeadline - READ-ONLY; Time at which the pending firmware update will automatically be installed on the Cache. + FirmwareUpdateDeadline *date.Time `json:"firmwareUpdateDeadline,omitempty"` + // LastFirmwareUpdate - READ-ONLY; Time of the last successful firmware update. + LastFirmwareUpdate *date.Time `json:"lastFirmwareUpdate,omitempty"` + // PendingFirmwareVersion - READ-ONLY; When firmwareUpdateAvailable is true, this field holds the version string for the update. + PendingFirmwareVersion *string `json:"pendingFirmwareVersion,omitempty"` +} + +// ClfsTarget storage container for use as a CLFS Storage Target. +type ClfsTarget struct { + // Target - Resource ID of storage container. + Target *string `json:"target,omitempty"` +} + +// CloudError an error response. +type CloudError struct { + // Error - The body of the error. + Error *CloudErrorBody `json:"error,omitempty"` +} + +// CloudErrorBody an error response. +type CloudErrorBody struct { + // Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + Code *string `json:"code,omitempty"` + // Details - A list of additional details about the error. + Details *[]CloudErrorBody `json:"details,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"` +} + +// NamespaceJunction a namespace junction. +type NamespaceJunction struct { + // NamespacePath - Namespace path on a Cache for a Storage Target. + NamespacePath *string `json:"namespacePath,omitempty"` + // TargetPath - Path in Storage Target to which namespacePath points. + TargetPath *string `json:"targetPath,omitempty"` + // NfsExport - NFS export where targetPath exists. + NfsExport *string `json:"nfsExport,omitempty"` +} + +// Nfs3Target an NFSv3 mount point for use as a Storage Target. +type Nfs3Target struct { + // Target - IP address or host name of an NFSv3 host (e.g., 10.0.44.44). + Target *string `json:"target,omitempty"` + // UsageModel - Identifies the primary usage model to be used for this Storage Target. Get choices from .../usageModels + UsageModel *string `json:"usageModel,omitempty"` +} + +// ResourceSku a resource SKU. +type ResourceSku struct { + // ResourceType - READ-ONLY; The type of resource the SKU applies to. + ResourceType *string `json:"resourceType,omitempty"` + // Capabilities - A list of capabilities of this SKU, such as throughput or ops/sec. + Capabilities *[]ResourceSkuCapabilities `json:"capabilities,omitempty"` + // Locations - READ-ONLY; The set of locations that the SKU is available. This will be supported and registered Azure Geo Regions (e.g., West US, East US, Southeast Asia, etc.). + Locations *[]string `json:"locations,omitempty"` + // LocationInfo - The set of locations that the SKU is available. + LocationInfo *[]ResourceSkuLocationInfo `json:"locationInfo,omitempty"` + // Name - The name of this SKU. + Name *string `json:"name,omitempty"` + // Restrictions - The restrictions preventing this SKU from being used. This is empty if there are no restrictions. + Restrictions *[]Restriction `json:"restrictions,omitempty"` +} + +// ResourceSkuCapabilities a resource SKU capability. +type ResourceSkuCapabilities struct { + // Name - Name of a capability, such as ops/sec. + Name *string `json:"name,omitempty"` + // Value - Quantity, if the capability is measured by quantity. + Value *string `json:"value,omitempty"` +} + +// ResourceSkuLocationInfo resource SKU location information. +type ResourceSkuLocationInfo struct { + // Location - Location where this SKU is available. + Location *string `json:"location,omitempty"` + // Zones - Zones if any. + Zones *[]string `json:"zones,omitempty"` +} + +// ResourceSkusResult the response from the List Cache SKUs operation. +type ResourceSkusResult struct { + autorest.Response `json:"-"` + // NextLink - The URI to fetch the next page of Cache SKUs. + NextLink *string `json:"nextLink,omitempty"` + // Value - READ-ONLY; The list of SKUs available for the subscription. + Value *[]ResourceSku `json:"value,omitempty"` +} + +// ResourceSkusResultIterator provides access to a complete listing of ResourceSku values. +type ResourceSkusResultIterator struct { + i int + page ResourceSkusResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ResourceSkusResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ResourceSkusResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ResourceSkusResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ResourceSkusResultIterator) Response() ResourceSkusResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ResourceSkusResultIterator) Value() ResourceSku { + if !iter.page.NotDone() { + return ResourceSku{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ResourceSkusResultIterator type. +func NewResourceSkusResultIterator(page ResourceSkusResultPage) ResourceSkusResultIterator { + return ResourceSkusResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rsr ResourceSkusResult) IsEmpty() bool { + return rsr.Value == nil || len(*rsr.Value) == 0 +} + +// resourceSkusResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rsr ResourceSkusResult) resourceSkusResultPreparer(ctx context.Context) (*http.Request, error) { + if rsr.NextLink == nil || len(to.String(rsr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rsr.NextLink))) +} + +// ResourceSkusResultPage contains a page of ResourceSku values. +type ResourceSkusResultPage struct { + fn func(context.Context, ResourceSkusResult) (ResourceSkusResult, error) + rsr ResourceSkusResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ResourceSkusResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusResultPage.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.rsr) + if err != nil { + return err + } + page.rsr = 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 *ResourceSkusResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ResourceSkusResultPage) NotDone() bool { + return !page.rsr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ResourceSkusResultPage) Response() ResourceSkusResult { + return page.rsr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ResourceSkusResultPage) Values() []ResourceSku { + if page.rsr.IsEmpty() { + return nil + } + return *page.rsr.Value +} + +// Creates a new instance of the ResourceSkusResultPage type. +func NewResourceSkusResultPage(getNextPage func(context.Context, ResourceSkusResult) (ResourceSkusResult, error)) ResourceSkusResultPage { + return ResourceSkusResultPage{fn: getNextPage} +} + +// Restriction the restrictions preventing this SKU from being used. +type Restriction struct { + // Type - READ-ONLY; The type of restrictions. In this version, the only possible value for this is location. + Type *string `json:"type,omitempty"` + // Values - READ-ONLY; The value of restrictions. If the restriction type is set to location, then this would be the different locations where the SKU is restricted. + Values *[]string `json:"values,omitempty"` + // ReasonCode - The reason for the restriction. As of now this can be "QuotaId" or "NotAvailableForSubscription". "QuotaId" is set when the SKU has requiredQuotas parameter as the subscription does not belong to that quota. "NotAvailableForSubscription" is related to capacity at the datacenter. Possible values include: 'QuotaID', 'NotAvailableForSubscription' + ReasonCode ReasonCode `json:"reasonCode,omitempty"` +} + +// SetObject ... +type SetObject struct { + autorest.Response `json:"-"` + Value interface{} `json:"value,omitempty"` +} + +// StorageTarget a storage system being cached by a Cache. +type StorageTarget struct { + autorest.Response `json:"-"` + // Name - READ-ONLY; Name of the Storage Target. + Name *string `json:"name,omitempty"` + // ID - READ-ONLY; Resource ID of the Storage Target. + ID *string `json:"id,omitempty"` + // Type - READ-ONLY; Type of the Storage Target; Microsoft.StorageCache/Cache/StorageTarget + Type *string `json:"type,omitempty"` + // StorageTargetProperties - Properties of the Storage Target. + *StorageTargetProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for StorageTarget. +func (st StorageTarget) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if st.StorageTargetProperties != nil { + objectMap["properties"] = st.StorageTargetProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for StorageTarget struct. +func (st *StorageTarget) UnmarshalJSON(body []byte) error { + 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 + } + st.Name = &name + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + st.ID = &ID + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + st.Type = &typeVar + } + case "properties": + if v != nil { + var storageTargetProperties StorageTargetProperties + err = json.Unmarshal(*v, &storageTargetProperties) + if err != nil { + return err + } + st.StorageTargetProperties = &storageTargetProperties + } + } + } + + return nil +} + +// StorageTargetProperties properties of the Storage Target. +type StorageTargetProperties struct { + // Junctions - List of Cache namespace junctions to target for namespace associations. + Junctions *[]NamespaceJunction `json:"junctions,omitempty"` + // TargetType - Type of the Storage Target. Possible values include: 'StorageTargetTypeNfs3', 'StorageTargetTypeClfs', 'StorageTargetTypeUnknown' + TargetType StorageTargetType `json:"targetType,omitempty"` + // ProvisioningState - ARM provisioning state, see https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Creating', 'Deleting', 'Updating' + ProvisioningState ProvisioningStateType `json:"provisioningState,omitempty"` + // Nfs3 - Properties when targetType is nfs3. + Nfs3 *Nfs3Target `json:"nfs3,omitempty"` + // Clfs - Properties when targetType is clfs. + Clfs *ClfsTarget `json:"clfs,omitempty"` + // Unknown - Properties when targetType is unknown. + Unknown *UnknownTarget `json:"unknown,omitempty"` +} + +// StorageTargetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type StorageTargetsCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *StorageTargetsCreateOrUpdateFuture) Result(client StorageTargetsClient) (st StorageTarget, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.StorageTargetsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("storagecache.StorageTargetsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if st.Response.Response, err = future.GetResult(sender); err == nil && st.Response.Response.StatusCode != http.StatusNoContent { + st, err = client.CreateOrUpdateResponder(st.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.StorageTargetsCreateOrUpdateFuture", "Result", st.Response.Response, "Failure responding to request") + } + } + return +} + +// StorageTargetsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type StorageTargetsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *StorageTargetsDeleteFuture) Result(client StorageTargetsClient) (so SetObject, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.StorageTargetsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("storagecache.StorageTargetsDeleteFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if so.Response.Response, err = future.GetResult(sender); err == nil && so.Response.Response.StatusCode != http.StatusNoContent { + so, err = client.DeleteResponder(so.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.StorageTargetsDeleteFuture", "Result", so.Response.Response, "Failure responding to request") + } + } + return +} + +// StorageTargetsResult a list of Storage Targets. +type StorageTargetsResult struct { + autorest.Response `json:"-"` + // NextLink - The URI to fetch the next page of Storage Targets. + NextLink *string `json:"nextLink,omitempty"` + // Value - The list of Storage Targets defined for the Cache. + Value *[]StorageTarget `json:"value,omitempty"` +} + +// StorageTargetsResultIterator provides access to a complete listing of StorageTarget values. +type StorageTargetsResultIterator struct { + i int + page StorageTargetsResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *StorageTargetsResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageTargetsResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *StorageTargetsResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter StorageTargetsResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter StorageTargetsResultIterator) Response() StorageTargetsResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter StorageTargetsResultIterator) Value() StorageTarget { + if !iter.page.NotDone() { + return StorageTarget{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the StorageTargetsResultIterator type. +func NewStorageTargetsResultIterator(page StorageTargetsResultPage) StorageTargetsResultIterator { + return StorageTargetsResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (str StorageTargetsResult) IsEmpty() bool { + return str.Value == nil || len(*str.Value) == 0 +} + +// storageTargetsResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (str StorageTargetsResult) storageTargetsResultPreparer(ctx context.Context) (*http.Request, error) { + if str.NextLink == nil || len(to.String(str.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(str.NextLink))) +} + +// StorageTargetsResultPage contains a page of StorageTarget values. +type StorageTargetsResultPage struct { + fn func(context.Context, StorageTargetsResult) (StorageTargetsResult, error) + str StorageTargetsResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *StorageTargetsResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageTargetsResultPage.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.str) + if err != nil { + return err + } + page.str = 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 *StorageTargetsResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page StorageTargetsResultPage) NotDone() bool { + return !page.str.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page StorageTargetsResultPage) Response() StorageTargetsResult { + return page.str +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page StorageTargetsResultPage) Values() []StorageTarget { + if page.str.IsEmpty() { + return nil + } + return *page.str.Value +} + +// Creates a new instance of the StorageTargetsResultPage type. +func NewStorageTargetsResultPage(getNextPage func(context.Context, StorageTargetsResult) (StorageTargetsResult, error)) StorageTargetsResultPage { + return StorageTargetsResultPage{fn: getNextPage} +} + +// UnknownTarget storage container for use as an Unknown Storage Target. +type UnknownTarget struct { + // UnknownMap - Dictionary of string->string pairs containing information about the Storage Target. + UnknownMap map[string]*string `json:"unknownMap"` +} + +// MarshalJSON is the custom marshaler for UnknownTarget. +func (ut UnknownTarget) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ut.UnknownMap != nil { + objectMap["unknownMap"] = ut.UnknownMap + } + return json.Marshal(objectMap) +} + +// UsageModel a usage model. +type UsageModel struct { + // Display - Localized information describing this usage model. + Display *UsageModelDisplay `json:"display,omitempty"` + // ModelName - Non-localized keyword name for this usage model. + ModelName *string `json:"modelName,omitempty"` + // TargetType - The type of Storage Target to which this model is applicable (only nfs3 as of this version). + TargetType *string `json:"targetType,omitempty"` +} + +// UsageModelDisplay localized information describing this usage model. +type UsageModelDisplay struct { + // Description - String to display for this usage model. + Description *string `json:"description,omitempty"` +} + +// UsageModelsResult a list of Cache usage models. +type UsageModelsResult struct { + autorest.Response `json:"-"` + // NextLink - The URI to fetch the next page of Cache usage models. + NextLink *string `json:"nextLink,omitempty"` + // Value - The list of usage models available for the subscription. + Value *[]UsageModel `json:"value,omitempty"` +} + +// UsageModelsResultIterator provides access to a complete listing of UsageModel values. +type UsageModelsResultIterator struct { + i int + page UsageModelsResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *UsageModelsResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsageModelsResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *UsageModelsResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter UsageModelsResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter UsageModelsResultIterator) Response() UsageModelsResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter UsageModelsResultIterator) Value() UsageModel { + if !iter.page.NotDone() { + return UsageModel{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the UsageModelsResultIterator type. +func NewUsageModelsResultIterator(page UsageModelsResultPage) UsageModelsResultIterator { + return UsageModelsResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (umr UsageModelsResult) IsEmpty() bool { + return umr.Value == nil || len(*umr.Value) == 0 +} + +// usageModelsResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (umr UsageModelsResult) usageModelsResultPreparer(ctx context.Context) (*http.Request, error) { + if umr.NextLink == nil || len(to.String(umr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(umr.NextLink))) +} + +// UsageModelsResultPage contains a page of UsageModel values. +type UsageModelsResultPage struct { + fn func(context.Context, UsageModelsResult) (UsageModelsResult, error) + umr UsageModelsResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *UsageModelsResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsageModelsResultPage.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.umr) + if err != nil { + return err + } + page.umr = 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 *UsageModelsResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page UsageModelsResultPage) NotDone() bool { + return !page.umr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page UsageModelsResultPage) Response() UsageModelsResult { + return page.umr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page UsageModelsResultPage) Values() []UsageModel { + if page.umr.IsEmpty() { + return nil + } + return *page.umr.Value +} + +// Creates a new instance of the UsageModelsResultPage type. +func NewUsageModelsResultPage(getNextPage func(context.Context, UsageModelsResult) (UsageModelsResult, error)) UsageModelsResultPage { + return UsageModelsResultPage{fn: getNextPage} +} diff --git a/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/availableoperations.go b/services/storagecache/mgmt/2019-11-01/storagecache/operations.go similarity index 52% rename from services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/availableoperations.go rename to services/storagecache/mgmt/2019-11-01/storagecache/operations.go index cc03164184a7..fa94de5d5e2e 100644 --- a/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/availableoperations.go +++ b/services/storagecache/mgmt/2019-11-01/storagecache/operations.go @@ -1,4 +1,4 @@ -package vmwarecloudsimple +package storagecache // Copyright (c) Microsoft and contributors. All rights reserved. // @@ -25,25 +25,26 @@ import ( "net/http" ) -// AvailableOperationsClient is the description of the new service -type AvailableOperationsClient struct { +// OperationsClient is the a Storage Cache provides scalable caching service for NAS clients, serving data from either +// NFSv3 or Blob at-rest storage (referred to as "Storage Targets"). These operations allow you to manage Caches. +type OperationsClient struct { BaseClient } -// NewAvailableOperationsClient creates an instance of the AvailableOperationsClient client. -func NewAvailableOperationsClient(referer string, regionID string, subscriptionID string) AvailableOperationsClient { - return NewAvailableOperationsClientWithBaseURI(DefaultBaseURI, referer, regionID, subscriptionID) +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewAvailableOperationsClientWithBaseURI creates an instance of the AvailableOperationsClient client. -func NewAvailableOperationsClientWithBaseURI(baseURI string, referer string, regionID string, subscriptionID string) AvailableOperationsClient { - return AvailableOperationsClient{NewWithBaseURI(baseURI, referer, regionID, subscriptionID)} +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client. +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// List return list of operations -func (client AvailableOperationsClient) List(ctx context.Context) (result AvailableOperationsListResponsePage, err error) { +// List lists all of the available Resource Provider operations. +func (client OperationsClient) List(ctx context.Context) (result APIOperationListResultPage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailableOperationsClient.List") + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") defer func() { sc := -1 if result.aolr.Response.Response != nil { @@ -55,28 +56,28 @@ func (client AvailableOperationsClient) List(ctx context.Context) (result Availa result.fn = client.listNextResults req, err := client.ListPreparer(ctx) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.AvailableOperationsClient", "List", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "storagecache.OperationsClient", "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, "vmwarecloudsimple.AvailableOperationsClient", "List", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "storagecache.OperationsClient", "List", resp, "Failure sending request") return } result.aolr, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.AvailableOperationsClient", "List", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "storagecache.OperationsClient", "List", resp, "Failure responding to request") } return } // ListPreparer prepares the List request. -func (client AvailableOperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2019-04-01" +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2019-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -84,21 +85,21 @@ func (client AvailableOperationsClient) ListPreparer(ctx context.Context) (*http preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/providers/Microsoft.VMwareCloudSimple/operations"), + autorest.WithPath("/providers/Microsoft.StorageCache/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 AvailableOperationsClient) ListSender(req *http.Request) (*http.Response, 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 AvailableOperationsClient) ListResponder(resp *http.Response) (result AvailableOperationsListResponse, err error) { +func (client OperationsClient) ListResponder(resp *http.Response) (result APIOperationListResult, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -110,10 +111,10 @@ func (client AvailableOperationsClient) ListResponder(resp *http.Response) (resu } // listNextResults retrieves the next set of results, if any. -func (client AvailableOperationsClient) listNextResults(ctx context.Context, lastResults AvailableOperationsListResponse) (result AvailableOperationsListResponse, err error) { - req, err := lastResults.availableOperationsListResponsePreparer(ctx) +func (client OperationsClient) listNextResults(ctx context.Context, lastResults APIOperationListResult) (result APIOperationListResult, err error) { + req, err := lastResults.aPIOperationListResultPreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.AvailableOperationsClient", "listNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "storagecache.OperationsClient", "listNextResults", nil, "Failure preparing next results request") } if req == nil { return @@ -121,19 +122,19 @@ func (client AvailableOperationsClient) listNextResults(ctx context.Context, las resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.AvailableOperationsClient", "listNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "storagecache.OperationsClient", "listNextResults", resp, "Failure sending next results request") } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.AvailableOperationsClient", "listNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "storagecache.OperationsClient", "listNextResults", resp, "Failure responding to next results request") } return } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client AvailableOperationsClient) ListComplete(ctx context.Context) (result AvailableOperationsListResponseIterator, err error) { +func (client OperationsClient) ListComplete(ctx context.Context) (result APIOperationListResultIterator, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailableOperationsClient.List") + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") defer func() { sc := -1 if result.Response().Response.Response != nil { diff --git a/services/storagecache/mgmt/2019-11-01/storagecache/skus.go b/services/storagecache/mgmt/2019-11-01/storagecache/skus.go new file mode 100644 index 000000000000..db004443cc76 --- /dev/null +++ b/services/storagecache/mgmt/2019-11-01/storagecache/skus.go @@ -0,0 +1,152 @@ +package storagecache + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// SkusClient is the a Storage Cache provides scalable caching service for NAS clients, serving data from either NFSv3 +// or Blob at-rest storage (referred to as "Storage Targets"). These operations allow you to manage Caches. +type SkusClient struct { + BaseClient +} + +// NewSkusClient creates an instance of the SkusClient client. +func NewSkusClient(subscriptionID string) SkusClient { + return NewSkusClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSkusClientWithBaseURI creates an instance of the SkusClient client. +func NewSkusClientWithBaseURI(baseURI string, subscriptionID string) SkusClient { + return SkusClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List get the list of StorageCache.Cache SKUs available to this subscription. +func (client SkusClient) List(ctx context.Context) (result ResourceSkusResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SkusClient.List") + defer func() { + sc := -1 + if result.rsr.Response.Response != nil { + sc = result.rsr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.SkusClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rsr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storagecache.SkusClient", "List", resp, "Failure sending request") + return + } + + result.rsr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.SkusClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client SkusClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.StorageCache/skus", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client SkusClient) ListSender(req *http.Request) (*http.Response, error) { + 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 SkusClient) ListResponder(resp *http.Response) (result ResourceSkusResult, 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 SkusClient) listNextResults(ctx context.Context, lastResults ResourceSkusResult) (result ResourceSkusResult, err error) { + req, err := lastResults.resourceSkusResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "storagecache.SkusClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "storagecache.SkusClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.SkusClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client SkusClient) ListComplete(ctx context.Context) (result ResourceSkusResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SkusClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} diff --git a/services/storagecache/mgmt/2019-11-01/storagecache/storagecacheapi/interfaces.go b/services/storagecache/mgmt/2019-11-01/storagecache/storagecacheapi/interfaces.go new file mode 100644 index 000000000000..3982c025cc92 --- /dev/null +++ b/services/storagecache/mgmt/2019-11-01/storagecache/storagecacheapi/interfaces.go @@ -0,0 +1,70 @@ +package storagecacheapi + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by 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/storagecache/mgmt/2019-11-01/storagecache" +) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result storagecache.APIOperationListResultPage, err error) +} + +var _ OperationsClientAPI = (*storagecache.OperationsClient)(nil) + +// SkusClientAPI contains the set of methods on the SkusClient type. +type SkusClientAPI interface { + List(ctx context.Context) (result storagecache.ResourceSkusResultPage, err error) +} + +var _ SkusClientAPI = (*storagecache.SkusClient)(nil) + +// UsageModelsClientAPI contains the set of methods on the UsageModelsClient type. +type UsageModelsClientAPI interface { + List(ctx context.Context) (result storagecache.UsageModelsResultPage, err error) +} + +var _ UsageModelsClientAPI = (*storagecache.UsageModelsClient)(nil) + +// CachesClientAPI contains the set of methods on the CachesClient type. +type CachesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, cacheName string, cache *storagecache.Cache) (result storagecache.CachesCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, cacheName string) (result storagecache.CachesDeleteFuture, err error) + Flush(ctx context.Context, resourceGroupName string, cacheName string) (result storagecache.CachesFlushFuture, err error) + Get(ctx context.Context, resourceGroupName string, cacheName string) (result storagecache.Cache, err error) + List(ctx context.Context) (result storagecache.CachesListResultPage, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result storagecache.CachesListResultPage, err error) + Start(ctx context.Context, resourceGroupName string, cacheName string) (result storagecache.CachesStartFuture, err error) + Stop(ctx context.Context, resourceGroupName string, cacheName string) (result storagecache.CachesStopFuture, err error) + Update(ctx context.Context, resourceGroupName string, cacheName string, cache *storagecache.Cache) (result storagecache.Cache, err error) + UpgradeFirmware(ctx context.Context, resourceGroupName string, cacheName string) (result storagecache.CachesUpgradeFirmwareFuture, err error) +} + +var _ CachesClientAPI = (*storagecache.CachesClient)(nil) + +// StorageTargetsClientAPI contains the set of methods on the StorageTargetsClient type. +type StorageTargetsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, cacheName string, storageTargetName string, storagetarget *storagecache.StorageTarget) (result storagecache.StorageTargetsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, cacheName string, storageTargetName string) (result storagecache.StorageTargetsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, cacheName string, storageTargetName string) (result storagecache.StorageTarget, err error) + ListByCache(ctx context.Context, resourceGroupName string, cacheName string) (result storagecache.StorageTargetsResultPage, err error) +} + +var _ StorageTargetsClientAPI = (*storagecache.StorageTargetsClient)(nil) diff --git a/services/storagecache/mgmt/2019-11-01/storagecache/storagetargets.go b/services/storagecache/mgmt/2019-11-01/storagecache/storagetargets.go new file mode 100644 index 000000000000..a42b3f26904f --- /dev/null +++ b/services/storagecache/mgmt/2019-11-01/storagecache/storagetargets.go @@ -0,0 +1,448 @@ +package storagecache + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// StorageTargetsClient is the a Storage Cache provides scalable caching service for NAS clients, serving data from +// either NFSv3 or Blob at-rest storage (referred to as "Storage Targets"). These operations allow you to manage +// Caches. +type StorageTargetsClient struct { + BaseClient +} + +// NewStorageTargetsClient creates an instance of the StorageTargetsClient client. +func NewStorageTargetsClient(subscriptionID string) StorageTargetsClient { + return NewStorageTargetsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewStorageTargetsClientWithBaseURI creates an instance of the StorageTargetsClient client. +func NewStorageTargetsClientWithBaseURI(baseURI string, subscriptionID string) StorageTargetsClient { + return StorageTargetsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or update a Storage Target. This operation is allowed at any time, but if the Cache is down or +// unhealthy, the actual creation/modification of the Storage Target may be delayed until the Cache is healthy again. +// Parameters: +// resourceGroupName - target resource group. +// cacheName - name of Cache. +// storageTargetName - name of the Storage Target. +// storagetarget - object containing the definition of a Storage Target. +func (client StorageTargetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, cacheName string, storageTargetName string, storagetarget *StorageTarget) (result StorageTargetsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageTargetsClient.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: cacheName, + Constraints: []validation.Constraint{{Target: "cacheName", Name: validation.Pattern, Rule: `^[-0-9a-zA-Z_]{1,31}$`, Chain: nil}}}, + {TargetValue: storageTargetName, + Constraints: []validation.Constraint{{Target: "storageTargetName", Name: validation.Pattern, Rule: `^[-0-9a-zA-Z_]{1,31}$`, Chain: nil}}}, + {TargetValue: storagetarget, + Constraints: []validation.Constraint{{Target: "storagetarget", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "storagetarget.StorageTargetProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "storagetarget.StorageTargetProperties.Nfs3", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "storagetarget.StorageTargetProperties.Nfs3.Target", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "storagetarget.StorageTargetProperties.Nfs3.Target", Name: validation.Pattern, Rule: `^[-.0-9a-zA-Z]+$`, Chain: nil}}}, + }}, + }}, + }}}}}); err != nil { + return result, validation.NewError("storagecache.StorageTargetsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, cacheName, storageTargetName, storagetarget) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.StorageTargetsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.StorageTargetsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client StorageTargetsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, cacheName string, storageTargetName string, storagetarget *StorageTarget) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cacheName": autorest.Encode("path", cacheName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storageTargetName": autorest.Encode("path", storageTargetName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + storagetarget.Name = nil + storagetarget.ID = nil + storagetarget.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.StorageCache/caches/{cacheName}/storageTargets/{storageTargetName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if storagetarget != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(storagetarget)) + } + 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 StorageTargetsClient) CreateOrUpdateSender(req *http.Request) (future StorageTargetsCreateOrUpdateFuture, 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 StorageTargetsClient) CreateOrUpdateResponder(resp *http.Response) (result StorageTarget, 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 removes a Storage Target from a Cache. This operation is allowed at any time, but if the Cache is down or +// unhealthy, the actual removal of the Storage Target may be delayed until the Cache is healthy again. Note that if +// the Cache has data to flush to the Storage Target, the data will be flushed before the Storage Target will be +// deleted. +// Parameters: +// resourceGroupName - target resource group. +// cacheName - name of Cache. +// storageTargetName - name of Storage Target. +func (client StorageTargetsClient) Delete(ctx context.Context, resourceGroupName string, cacheName string, storageTargetName string) (result StorageTargetsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageTargetsClient.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: cacheName, + Constraints: []validation.Constraint{{Target: "cacheName", Name: validation.Pattern, Rule: `^[-0-9a-zA-Z_]{1,31}$`, Chain: nil}}}, + {TargetValue: storageTargetName, + Constraints: []validation.Constraint{{Target: "storageTargetName", Name: validation.Pattern, Rule: `^[-0-9a-zA-Z_]{1,31}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagecache.StorageTargetsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, cacheName, storageTargetName) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.StorageTargetsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.StorageTargetsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client StorageTargetsClient) DeletePreparer(ctx context.Context, resourceGroupName string, cacheName string, storageTargetName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cacheName": autorest.Encode("path", cacheName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storageTargetName": autorest.Encode("path", storageTargetName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/storageTargets/{storageTargetName}", 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 StorageTargetsClient) DeleteSender(req *http.Request) (future StorageTargetsDeleteFuture, 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 StorageTargetsClient) DeleteResponder(resp *http.Response) (result SetObject, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get returns a Storage Target from a Cache. +// Parameters: +// resourceGroupName - target resource group. +// cacheName - name of Cache. +// storageTargetName - name of the Storage Target. +func (client StorageTargetsClient) Get(ctx context.Context, resourceGroupName string, cacheName string, storageTargetName string) (result StorageTarget, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageTargetsClient.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: cacheName, + Constraints: []validation.Constraint{{Target: "cacheName", Name: validation.Pattern, Rule: `^[-0-9a-zA-Z_]{1,31}$`, Chain: nil}}}, + {TargetValue: storageTargetName, + Constraints: []validation.Constraint{{Target: "storageTargetName", Name: validation.Pattern, Rule: `^[-0-9a-zA-Z_]{1,31}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagecache.StorageTargetsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, cacheName, storageTargetName) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.StorageTargetsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storagecache.StorageTargetsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.StorageTargetsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client StorageTargetsClient) GetPreparer(ctx context.Context, resourceGroupName string, cacheName string, storageTargetName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cacheName": autorest.Encode("path", cacheName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storageTargetName": autorest.Encode("path", storageTargetName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/storageTargets/{storageTargetName}", 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 StorageTargetsClient) 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 StorageTargetsClient) GetResponder(resp *http.Response) (result StorageTarget, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByCache returns a list of Storage Targets for the specified Cache. +// Parameters: +// resourceGroupName - target resource group. +// cacheName - name of Cache. +func (client StorageTargetsClient) ListByCache(ctx context.Context, resourceGroupName string, cacheName string) (result StorageTargetsResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageTargetsClient.ListByCache") + defer func() { + sc := -1 + if result.str.Response.Response != nil { + sc = result.str.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: cacheName, + Constraints: []validation.Constraint{{Target: "cacheName", Name: validation.Pattern, Rule: `^[-0-9a-zA-Z_]{1,31}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagecache.StorageTargetsClient", "ListByCache", err.Error()) + } + + result.fn = client.listByCacheNextResults + req, err := client.ListByCachePreparer(ctx, resourceGroupName, cacheName) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.StorageTargetsClient", "ListByCache", nil, "Failure preparing request") + return + } + + resp, err := client.ListByCacheSender(req) + if err != nil { + result.str.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storagecache.StorageTargetsClient", "ListByCache", resp, "Failure sending request") + return + } + + result.str, err = client.ListByCacheResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.StorageTargetsClient", "ListByCache", resp, "Failure responding to request") + } + + return +} + +// ListByCachePreparer prepares the ListByCache request. +func (client StorageTargetsClient) ListByCachePreparer(ctx context.Context, resourceGroupName string, cacheName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cacheName": autorest.Encode("path", cacheName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/storageTargets", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByCacheSender sends the ListByCache request. The method will close the +// http.Response Body if it receives an error. +func (client StorageTargetsClient) ListByCacheSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByCacheResponder handles the response to the ListByCache request. The method always +// closes the http.Response Body. +func (client StorageTargetsClient) ListByCacheResponder(resp *http.Response) (result StorageTargetsResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByCacheNextResults retrieves the next set of results, if any. +func (client StorageTargetsClient) listByCacheNextResults(ctx context.Context, lastResults StorageTargetsResult) (result StorageTargetsResult, err error) { + req, err := lastResults.storageTargetsResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "storagecache.StorageTargetsClient", "listByCacheNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByCacheSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "storagecache.StorageTargetsClient", "listByCacheNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByCacheResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.StorageTargetsClient", "listByCacheNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByCacheComplete enumerates all values, automatically crossing page boundaries as required. +func (client StorageTargetsClient) ListByCacheComplete(ctx context.Context, resourceGroupName string, cacheName string) (result StorageTargetsResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageTargetsClient.ListByCache") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByCache(ctx, resourceGroupName, cacheName) + return +} diff --git a/services/storagecache/mgmt/2019-11-01/storagecache/usagemodels.go b/services/storagecache/mgmt/2019-11-01/storagecache/usagemodels.go new file mode 100644 index 000000000000..ea4c66bcadd1 --- /dev/null +++ b/services/storagecache/mgmt/2019-11-01/storagecache/usagemodels.go @@ -0,0 +1,152 @@ +package storagecache + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// UsageModelsClient is the a Storage Cache provides scalable caching service for NAS clients, serving data from either +// NFSv3 or Blob at-rest storage (referred to as "Storage Targets"). These operations allow you to manage Caches. +type UsageModelsClient struct { + BaseClient +} + +// NewUsageModelsClient creates an instance of the UsageModelsClient client. +func NewUsageModelsClient(subscriptionID string) UsageModelsClient { + return NewUsageModelsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewUsageModelsClientWithBaseURI creates an instance of the UsageModelsClient client. +func NewUsageModelsClientWithBaseURI(baseURI string, subscriptionID string) UsageModelsClient { + return UsageModelsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List get the list of Cache Usage Models available to this subscription. +func (client UsageModelsClient) List(ctx context.Context) (result UsageModelsResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsageModelsClient.List") + defer func() { + sc := -1 + if result.umr.Response.Response != nil { + sc = result.umr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.UsageModelsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.umr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storagecache.UsageModelsClient", "List", resp, "Failure sending request") + return + } + + result.umr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.UsageModelsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client UsageModelsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.StorageCache/usageModels", 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 UsageModelsClient) 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 UsageModelsClient) ListResponder(resp *http.Response) (result UsageModelsResult, 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 UsageModelsClient) listNextResults(ctx context.Context, lastResults UsageModelsResult) (result UsageModelsResult, err error) { + req, err := lastResults.usageModelsResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "storagecache.UsageModelsClient", "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, "storagecache.UsageModelsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.UsageModelsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client UsageModelsClient) ListComplete(ctx context.Context) (result UsageModelsResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsageModelsClient.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/storagecache/mgmt/2019-11-01/storagecache/version.go b/services/storagecache/mgmt/2019-11-01/storagecache/version.go new file mode 100644 index 000000000000..6fce0a61b77b --- /dev/null +++ b/services/storagecache/mgmt/2019-11-01/storagecache/version.go @@ -0,0 +1,30 @@ +package storagecache + +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 + " storagecache/2019-11-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/client.go b/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/client.go index 459c8f6808d9..755ae354bb34 100644 --- a/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/client.go +++ b/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/client.go @@ -21,11 +21,7 @@ package vmwarecloudsimple // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( - "context" "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" ) const ( @@ -37,176 +33,21 @@ const ( type BaseClient struct { autorest.Client BaseURI string - Referer string - RegionID string SubscriptionID string + Referer string } // New creates an instance of the BaseClient client. -func New(referer string, regionID string, subscriptionID string) BaseClient { - return NewWithBaseURI(DefaultBaseURI, referer, regionID, subscriptionID) +func New(subscriptionID string, referer string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID, referer) } // NewWithBaseURI creates an instance of the BaseClient client. -func NewWithBaseURI(baseURI string, referer string, regionID string, subscriptionID string) BaseClient { +func NewWithBaseURI(baseURI string, subscriptionID string, referer string) BaseClient { return BaseClient{ Client: autorest.NewClientWithUserAgent(UserAgent()), BaseURI: baseURI, - Referer: referer, - RegionID: regionID, SubscriptionID: subscriptionID, + Referer: referer, } } - -// GetOperationResultByRegion return an async operation -// Parameters: -// operationID - operation id -func (client BaseClient) GetOperationResultByRegion(ctx context.Context, operationID string) (result OperationResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetOperationResultByRegion") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetOperationResultByRegionPreparer(ctx, operationID) - if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.BaseClient", "GetOperationResultByRegion", nil, "Failure preparing request") - return - } - - resp, err := client.GetOperationResultByRegionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.BaseClient", "GetOperationResultByRegion", resp, "Failure sending request") - return - } - - result, err = client.GetOperationResultByRegionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.BaseClient", "GetOperationResultByRegion", resp, "Failure responding to request") - } - - return -} - -// GetOperationResultByRegionPreparer prepares the GetOperationResultByRegion request. -func (client BaseClient) GetOperationResultByRegionPreparer(ctx context.Context, operationID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "operationId": autorest.Encode("path", operationID), - "regionId": autorest.Encode("path", client.RegionID), - "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}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/operationResults/{operationId}", pathParameters), - autorest.WithQueryParameters(queryParameters), - autorest.WithHeader("Referer", client.Referer)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetOperationResultByRegionSender sends the GetOperationResultByRegion request. The method will close the -// http.Response Body if it receives an error. -func (client BaseClient) GetOperationResultByRegionSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// GetOperationResultByRegionResponder handles the response to the GetOperationResultByRegion request. The method always -// closes the http.Response Body. -func (client BaseClient) GetOperationResultByRegionResponder(resp *http.Response) (result OperationResource, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetPrivateCloud returns private cloud by its name -// Parameters: -// pcName - the private cloud name -func (client BaseClient) GetPrivateCloud(ctx context.Context, pcName string) (result PrivateCloud, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPrivateCloud") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPrivateCloudPreparer(ctx, pcName) - if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.BaseClient", "GetPrivateCloud", nil, "Failure preparing request") - return - } - - resp, err := client.GetPrivateCloudSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.BaseClient", "GetPrivateCloud", resp, "Failure sending request") - return - } - - result, err = client.GetPrivateCloudResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.BaseClient", "GetPrivateCloud", resp, "Failure responding to request") - } - - return -} - -// GetPrivateCloudPreparer prepares the GetPrivateCloud request. -func (client BaseClient) GetPrivateCloudPreparer(ctx context.Context, pcName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "pcName": autorest.Encode("path", pcName), - "regionId": autorest.Encode("path", client.RegionID), - "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}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetPrivateCloudSender sends the GetPrivateCloud request. The method will close the -// http.Response Body if it receives an error. -func (client BaseClient) GetPrivateCloudSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// GetPrivateCloudResponder handles the response to the GetPrivateCloud request. The method always -// closes the http.Response Body. -func (client BaseClient) GetPrivateCloudResponder(resp *http.Response) (result PrivateCloud, 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/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/customizationpolicies.go b/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/customizationpolicies.go new file mode 100644 index 000000000000..dec85de9114d --- /dev/null +++ b/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/customizationpolicies.go @@ -0,0 +1,240 @@ +package vmwarecloudsimple + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if 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" +) + +// CustomizationPoliciesClient is the description of the new service +type CustomizationPoliciesClient struct { + BaseClient +} + +// NewCustomizationPoliciesClient creates an instance of the CustomizationPoliciesClient client. +func NewCustomizationPoliciesClient(subscriptionID string, referer string) CustomizationPoliciesClient { + return NewCustomizationPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID, referer) +} + +// NewCustomizationPoliciesClientWithBaseURI creates an instance of the CustomizationPoliciesClient client. +func NewCustomizationPoliciesClientWithBaseURI(baseURI string, subscriptionID string, referer string) CustomizationPoliciesClient { + return CustomizationPoliciesClient{NewWithBaseURI(baseURI, subscriptionID, referer)} +} + +// Get returns customization policy by its name +// Parameters: +// regionID - the region Id (westus, eastus) +// pcName - the private cloud name +// customizationPolicyName - customization policy name +func (client CustomizationPoliciesClient) Get(ctx context.Context, regionID string, pcName string, customizationPolicyName string) (result CustomizationPolicy, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomizationPoliciesClient.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, regionID, pcName, customizationPolicyName) + if err != nil { + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.CustomizationPoliciesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.CustomizationPoliciesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.CustomizationPoliciesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client CustomizationPoliciesClient) GetPreparer(ctx context.Context, regionID string, pcName string, customizationPolicyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "customizationPolicyName": autorest.Encode("path", customizationPolicyName), + "pcName": autorest.Encode("path", pcName), + "regionId": autorest.Encode("path", regionID), + "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}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}/customizationPolicies/{customizationPolicyName}", 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 CustomizationPoliciesClient) 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 CustomizationPoliciesClient) GetResponder(resp *http.Response) (result CustomizationPolicy, 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 list of customization policies in region for private cloud +// Parameters: +// regionID - the region Id (westus, eastus) +// pcName - the private cloud name +// filter - the filter to apply on the list operation. only type is allowed here as a filter e.g. $filter=type +// eq 'xxxx' +func (client CustomizationPoliciesClient) List(ctx context.Context, regionID string, pcName string, filter string) (result CustomizationPoliciesListResponsePage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomizationPoliciesClient.List") + defer func() { + sc := -1 + if result.cplr.Response.Response != nil { + sc = result.cplr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, regionID, pcName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.CustomizationPoliciesClient", "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, "vmwarecloudsimple.CustomizationPoliciesClient", "List", resp, "Failure sending request") + return + } + + result.cplr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.CustomizationPoliciesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client CustomizationPoliciesClient) ListPreparer(ctx context.Context, regionID string, pcName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "pcName": autorest.Encode("path", pcName), + "regionId": autorest.Encode("path", regionID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-04-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.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}/customizationPolicies", 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 CustomizationPoliciesClient) 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 CustomizationPoliciesClient) ListResponder(resp *http.Response) (result CustomizationPoliciesListResponse, 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 CustomizationPoliciesClient) listNextResults(ctx context.Context, lastResults CustomizationPoliciesListResponse) (result CustomizationPoliciesListResponse, err error) { + req, err := lastResults.customizationPoliciesListResponsePreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.CustomizationPoliciesClient", "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, "vmwarecloudsimple.CustomizationPoliciesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.CustomizationPoliciesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client CustomizationPoliciesClient) ListComplete(ctx context.Context, regionID string, pcName string, filter string) (result CustomizationPoliciesListResponseIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomizationPoliciesClient.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, regionID, pcName, filter) + return +} diff --git a/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/dedicatedcloudnode.go b/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/dedicatedcloudnodes.go similarity index 72% rename from services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/dedicatedcloudnode.go rename to services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/dedicatedcloudnodes.go index f335be6e69d6..5efd7a2c2c69 100644 --- a/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/dedicatedcloudnode.go +++ b/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/dedicatedcloudnodes.go @@ -26,19 +26,19 @@ import ( "net/http" ) -// DedicatedCloudNodeClient is the description of the new service -type DedicatedCloudNodeClient struct { +// DedicatedCloudNodesClient is the description of the new service +type DedicatedCloudNodesClient struct { BaseClient } -// NewDedicatedCloudNodeClient creates an instance of the DedicatedCloudNodeClient client. -func NewDedicatedCloudNodeClient(referer string, regionID string, subscriptionID string) DedicatedCloudNodeClient { - return NewDedicatedCloudNodeClientWithBaseURI(DefaultBaseURI, referer, regionID, subscriptionID) +// NewDedicatedCloudNodesClient creates an instance of the DedicatedCloudNodesClient client. +func NewDedicatedCloudNodesClient(subscriptionID string, referer string) DedicatedCloudNodesClient { + return NewDedicatedCloudNodesClientWithBaseURI(DefaultBaseURI, subscriptionID, referer) } -// NewDedicatedCloudNodeClientWithBaseURI creates an instance of the DedicatedCloudNodeClient client. -func NewDedicatedCloudNodeClientWithBaseURI(baseURI string, referer string, regionID string, subscriptionID string) DedicatedCloudNodeClient { - return DedicatedCloudNodeClient{NewWithBaseURI(baseURI, referer, regionID, subscriptionID)} +// NewDedicatedCloudNodesClientWithBaseURI creates an instance of the DedicatedCloudNodesClient client. +func NewDedicatedCloudNodesClientWithBaseURI(baseURI string, subscriptionID string, referer string) DedicatedCloudNodesClient { + return DedicatedCloudNodesClient{NewWithBaseURI(baseURI, subscriptionID, referer)} } // CreateOrUpdate returns dedicated cloud node by its name @@ -46,9 +46,9 @@ func NewDedicatedCloudNodeClientWithBaseURI(baseURI string, referer string, regi // resourceGroupName - the name of the resource group // dedicatedCloudNodeName - dedicated cloud node name // dedicatedCloudNodeRequest - create Dedicated Cloud Node request -func (client DedicatedCloudNodeClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, dedicatedCloudNodeName string, dedicatedCloudNodeRequest DedicatedCloudNode) (result DedicatedCloudNodeCreateOrUpdateFuture, err error) { +func (client DedicatedCloudNodesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, dedicatedCloudNodeName string, dedicatedCloudNodeRequest DedicatedCloudNode) (result DedicatedCloudNodesCreateOrUpdateFuture, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedCloudNodeClient.CreateOrUpdate") + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedCloudNodesClient.CreateOrUpdate") defer func() { sc := -1 if result.Response() != nil { @@ -59,11 +59,11 @@ func (client DedicatedCloudNodeClient) CreateOrUpdate(ctx context.Context, resou } if err := validation.Validate([]validation.Validation{ {TargetValue: dedicatedCloudNodeName, - Constraints: []validation.Constraint{{Target: "dedicatedCloudNodeName", Name: validation.Pattern, Rule: `^[-a-zA-Z0-9]+$`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "dedicatedCloudNodeName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]([-_.a-zA-Z0-9]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: dedicatedCloudNodeRequest, Constraints: []validation.Constraint{{Target: "dedicatedCloudNodeRequest.Location", Name: validation.Null, Rule: true, Chain: nil}, {Target: "dedicatedCloudNodeRequest.Name", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "dedicatedCloudNodeRequest.Name", Name: validation.Pattern, Rule: `^[-a-zA-Z0-9]+$`, Chain: nil}}}, + Chain: []validation.Constraint{{Target: "dedicatedCloudNodeRequest.Name", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]([-_.a-zA-Z0-9]*[a-zA-Z0-9])?$`, Chain: nil}}}, {Target: "dedicatedCloudNodeRequest.DedicatedCloudNodeProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "dedicatedCloudNodeRequest.DedicatedCloudNodeProperties.AvailabilityZoneID", Name: validation.Null, Rule: true, Chain: nil}, {Target: "dedicatedCloudNodeRequest.DedicatedCloudNodeProperties.NodesCount", Name: validation.Null, Rule: true, Chain: nil}, @@ -76,18 +76,18 @@ func (client DedicatedCloudNodeClient) CreateOrUpdate(ctx context.Context, resou }}, {Target: "dedicatedCloudNodeRequest.Sku", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "dedicatedCloudNodeRequest.Sku.Name", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("vmwarecloudsimple.DedicatedCloudNodeClient", "CreateOrUpdate", err.Error()) + return result, validation.NewError("vmwarecloudsimple.DedicatedCloudNodesClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, dedicatedCloudNodeName, dedicatedCloudNodeRequest) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodeClient", "CreateOrUpdate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodesClient", "CreateOrUpdate", nil, "Failure preparing request") return } result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodeClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodesClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -95,7 +95,7 @@ func (client DedicatedCloudNodeClient) CreateOrUpdate(ctx context.Context, resou } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DedicatedCloudNodeClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, dedicatedCloudNodeName string, dedicatedCloudNodeRequest DedicatedCloudNode) (*http.Request, error) { +func (client DedicatedCloudNodesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, dedicatedCloudNodeName string, dedicatedCloudNodeRequest DedicatedCloudNode) (*http.Request, error) { pathParameters := map[string]interface{}{ "dedicatedCloudNodeName": autorest.Encode("path", dedicatedCloudNodeName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -123,7 +123,7 @@ func (client DedicatedCloudNodeClient) CreateOrUpdatePreparer(ctx context.Contex // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. -func (client DedicatedCloudNodeClient) CreateOrUpdateSender(req *http.Request) (future DedicatedCloudNodeCreateOrUpdateFuture, err error) { +func (client DedicatedCloudNodesClient) CreateOrUpdateSender(req *http.Request) (future DedicatedCloudNodesCreateOrUpdateFuture, err error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) var resp *http.Response resp, err = autorest.SendWithSender(client, req, sd...) @@ -136,7 +136,7 @@ func (client DedicatedCloudNodeClient) CreateOrUpdateSender(req *http.Request) ( // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always // closes the http.Response Body. -func (client DedicatedCloudNodeClient) CreateOrUpdateResponder(resp *http.Response) (result DedicatedCloudNode, err error) { +func (client DedicatedCloudNodesClient) CreateOrUpdateResponder(resp *http.Response) (result DedicatedCloudNode, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -151,9 +151,9 @@ func (client DedicatedCloudNodeClient) CreateOrUpdateResponder(resp *http.Respon // Parameters: // resourceGroupName - the name of the resource group // dedicatedCloudNodeName - dedicated cloud node name -func (client DedicatedCloudNodeClient) Delete(ctx context.Context, resourceGroupName string, dedicatedCloudNodeName string) (result autorest.Response, err error) { +func (client DedicatedCloudNodesClient) Delete(ctx context.Context, resourceGroupName string, dedicatedCloudNodeName string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedCloudNodeClient.Delete") + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedCloudNodesClient.Delete") defer func() { sc := -1 if result.Response != nil { @@ -164,33 +164,33 @@ func (client DedicatedCloudNodeClient) Delete(ctx context.Context, resourceGroup } if err := validation.Validate([]validation.Validation{ {TargetValue: dedicatedCloudNodeName, - Constraints: []validation.Constraint{{Target: "dedicatedCloudNodeName", Name: validation.Pattern, Rule: `^[-a-zA-Z0-9]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("vmwarecloudsimple.DedicatedCloudNodeClient", "Delete", err.Error()) + Constraints: []validation.Constraint{{Target: "dedicatedCloudNodeName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]([-_.a-zA-Z0-9]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("vmwarecloudsimple.DedicatedCloudNodesClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, resourceGroupName, dedicatedCloudNodeName) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodeClient", "Delete", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodesClient", "Delete", nil, "Failure preparing request") return } resp, err := client.DeleteSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodeClient", "Delete", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodesClient", "Delete", resp, "Failure sending request") return } result, err = client.DeleteResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodeClient", "Delete", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodesClient", "Delete", resp, "Failure responding to request") } return } // DeletePreparer prepares the Delete request. -func (client DedicatedCloudNodeClient) DeletePreparer(ctx context.Context, resourceGroupName string, dedicatedCloudNodeName string) (*http.Request, error) { +func (client DedicatedCloudNodesClient) DeletePreparer(ctx context.Context, resourceGroupName string, dedicatedCloudNodeName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "dedicatedCloudNodeName": autorest.Encode("path", dedicatedCloudNodeName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -212,14 +212,14 @@ func (client DedicatedCloudNodeClient) DeletePreparer(ctx context.Context, resou // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. -func (client DedicatedCloudNodeClient) DeleteSender(req *http.Request) (*http.Response, error) { +func (client DedicatedCloudNodesClient) 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 DedicatedCloudNodeClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { +func (client DedicatedCloudNodesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -233,9 +233,9 @@ func (client DedicatedCloudNodeClient) DeleteResponder(resp *http.Response) (res // Parameters: // resourceGroupName - the name of the resource group // dedicatedCloudNodeName - dedicated cloud node name -func (client DedicatedCloudNodeClient) Get(ctx context.Context, resourceGroupName string, dedicatedCloudNodeName string) (result DedicatedCloudNode, err error) { +func (client DedicatedCloudNodesClient) Get(ctx context.Context, resourceGroupName string, dedicatedCloudNodeName string) (result DedicatedCloudNode, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedCloudNodeClient.Get") + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedCloudNodesClient.Get") defer func() { sc := -1 if result.Response.Response != nil { @@ -246,56 +246,62 @@ func (client DedicatedCloudNodeClient) Get(ctx context.Context, resourceGroupNam } if err := validation.Validate([]validation.Validation{ {TargetValue: dedicatedCloudNodeName, - Constraints: []validation.Constraint{{Target: "dedicatedCloudNodeName", Name: validation.Pattern, Rule: `^[-a-zA-Z0-9]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("vmwarecloudsimple.DedicatedCloudNodeClient", "Get", err.Error()) + Constraints: []validation.Constraint{{Target: "dedicatedCloudNodeName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]([-_.a-zA-Z0-9]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("vmwarecloudsimple.DedicatedCloudNodesClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, resourceGroupName, dedicatedCloudNodeName) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodeClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodesClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodeClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodesClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodeClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodesClient", "Get", resp, "Failure responding to request") } return } // GetPreparer prepares the Get request. -func (client DedicatedCloudNodeClient) GetPreparer(ctx context.Context, resourceGroupName string, dedicatedCloudNodeName string) (*http.Request, error) { +func (client DedicatedCloudNodesClient) GetPreparer(ctx context.Context, resourceGroupName string, dedicatedCloudNodeName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "dedicatedCloudNodeName": autorest.Encode("path", dedicatedCloudNodeName), "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.VMwareCloudSimple/dedicatedCloudNodes/{dedicatedCloudNodeName}", pathParameters)) + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudNodes/{dedicatedCloudNodeName}", 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 DedicatedCloudNodeClient) GetSender(req *http.Request) (*http.Response, error) { +func (client DedicatedCloudNodesClient) 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 DedicatedCloudNodeClient) GetResponder(resp *http.Response) (result DedicatedCloudNode, err error) { +func (client DedicatedCloudNodesClient) GetResponder(resp *http.Response) (result DedicatedCloudNode, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -312,9 +318,9 @@ func (client DedicatedCloudNodeClient) GetResponder(resp *http.Response) (result // filter - the filter to apply on the list operation // top - the maximum number of record sets to return // skipToken - to be used by nextLink implementation -func (client DedicatedCloudNodeClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string, top *int32, skipToken string) (result DedicatedCloudNodeListResponsePage, err error) { +func (client DedicatedCloudNodesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string, top *int32, skipToken string) (result DedicatedCloudNodeListResponsePage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedCloudNodeClient.ListByResourceGroup") + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedCloudNodesClient.ListByResourceGroup") defer func() { sc := -1 if result.dcnlr.Response.Response != nil { @@ -326,27 +332,27 @@ func (client DedicatedCloudNodeClient) ListByResourceGroup(ctx context.Context, result.fn = client.listByResourceGroupNextResults req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, filter, top, skipToken) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodeClient", "ListByResourceGroup", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodesClient", "ListByResourceGroup", nil, "Failure preparing request") return } resp, err := client.ListByResourceGroupSender(req) if err != nil { result.dcnlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodeClient", "ListByResourceGroup", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodesClient", "ListByResourceGroup", resp, "Failure sending request") return } result.dcnlr, err = client.ListByResourceGroupResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodeClient", "ListByResourceGroup", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodesClient", "ListByResourceGroup", resp, "Failure responding to request") } return } // ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client DedicatedCloudNodeClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, filter string, top *int32, skipToken string) (*http.Request, error) { +func (client DedicatedCloudNodesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, filter string, top *int32, skipToken string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -376,14 +382,14 @@ func (client DedicatedCloudNodeClient) ListByResourceGroupPreparer(ctx context.C // ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the // http.Response Body if it receives an error. -func (client DedicatedCloudNodeClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { +func (client DedicatedCloudNodesClient) 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 DedicatedCloudNodeClient) ListByResourceGroupResponder(resp *http.Response) (result DedicatedCloudNodeListResponse, err error) { +func (client DedicatedCloudNodesClient) ListByResourceGroupResponder(resp *http.Response) (result DedicatedCloudNodeListResponse, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -395,10 +401,10 @@ func (client DedicatedCloudNodeClient) ListByResourceGroupResponder(resp *http.R } // listByResourceGroupNextResults retrieves the next set of results, if any. -func (client DedicatedCloudNodeClient) listByResourceGroupNextResults(ctx context.Context, lastResults DedicatedCloudNodeListResponse) (result DedicatedCloudNodeListResponse, err error) { +func (client DedicatedCloudNodesClient) listByResourceGroupNextResults(ctx context.Context, lastResults DedicatedCloudNodeListResponse) (result DedicatedCloudNodeListResponse, err error) { req, err := lastResults.dedicatedCloudNodeListResponsePreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodeClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") } if req == nil { return @@ -406,19 +412,19 @@ func (client DedicatedCloudNodeClient) listByResourceGroupNextResults(ctx contex resp, err := client.ListByResourceGroupSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodeClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") } result, err = client.ListByResourceGroupResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodeClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") } return } // ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client DedicatedCloudNodeClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, filter string, top *int32, skipToken string) (result DedicatedCloudNodeListResponseIterator, err error) { +func (client DedicatedCloudNodesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, filter string, top *int32, skipToken string) (result DedicatedCloudNodeListResponseIterator, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedCloudNodeClient.ListByResourceGroup") + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedCloudNodesClient.ListByResourceGroup") defer func() { sc := -1 if result.Response().Response.Response != nil { @@ -436,9 +442,9 @@ func (client DedicatedCloudNodeClient) ListByResourceGroupComplete(ctx context.C // filter - the filter to apply on the list operation // top - the maximum number of record sets to return // skipToken - to be used by nextLink implementation -func (client DedicatedCloudNodeClient) ListBySubscription(ctx context.Context, filter string, top *int32, skipToken string) (result DedicatedCloudNodeListResponsePage, err error) { +func (client DedicatedCloudNodesClient) ListBySubscription(ctx context.Context, filter string, top *int32, skipToken string) (result DedicatedCloudNodeListResponsePage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedCloudNodeClient.ListBySubscription") + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedCloudNodesClient.ListBySubscription") defer func() { sc := -1 if result.dcnlr.Response.Response != nil { @@ -450,27 +456,27 @@ func (client DedicatedCloudNodeClient) ListBySubscription(ctx context.Context, f result.fn = client.listBySubscriptionNextResults req, err := client.ListBySubscriptionPreparer(ctx, filter, top, skipToken) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodeClient", "ListBySubscription", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodesClient", "ListBySubscription", nil, "Failure preparing request") return } resp, err := client.ListBySubscriptionSender(req) if err != nil { result.dcnlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodeClient", "ListBySubscription", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodesClient", "ListBySubscription", resp, "Failure sending request") return } result.dcnlr, err = client.ListBySubscriptionResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodeClient", "ListBySubscription", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodesClient", "ListBySubscription", resp, "Failure responding to request") } return } // ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client DedicatedCloudNodeClient) ListBySubscriptionPreparer(ctx context.Context, filter string, top *int32, skipToken string) (*http.Request, error) { +func (client DedicatedCloudNodesClient) ListBySubscriptionPreparer(ctx context.Context, filter string, top *int32, skipToken string) (*http.Request, error) { pathParameters := map[string]interface{}{ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -499,14 +505,14 @@ func (client DedicatedCloudNodeClient) ListBySubscriptionPreparer(ctx context.Co // ListBySubscriptionSender sends the ListBySubscription request. The method will close the // http.Response Body if it receives an error. -func (client DedicatedCloudNodeClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { +func (client DedicatedCloudNodesClient) 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 DedicatedCloudNodeClient) ListBySubscriptionResponder(resp *http.Response) (result DedicatedCloudNodeListResponse, err error) { +func (client DedicatedCloudNodesClient) ListBySubscriptionResponder(resp *http.Response) (result DedicatedCloudNodeListResponse, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -518,10 +524,10 @@ func (client DedicatedCloudNodeClient) ListBySubscriptionResponder(resp *http.Re } // listBySubscriptionNextResults retrieves the next set of results, if any. -func (client DedicatedCloudNodeClient) listBySubscriptionNextResults(ctx context.Context, lastResults DedicatedCloudNodeListResponse) (result DedicatedCloudNodeListResponse, err error) { +func (client DedicatedCloudNodesClient) listBySubscriptionNextResults(ctx context.Context, lastResults DedicatedCloudNodeListResponse) (result DedicatedCloudNodeListResponse, err error) { req, err := lastResults.dedicatedCloudNodeListResponsePreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodeClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodesClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") } if req == nil { return @@ -529,19 +535,19 @@ func (client DedicatedCloudNodeClient) listBySubscriptionNextResults(ctx context resp, err := client.ListBySubscriptionSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodeClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodesClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") } result, err = client.ListBySubscriptionResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodeClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodesClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") } return } // ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client DedicatedCloudNodeClient) ListBySubscriptionComplete(ctx context.Context, filter string, top *int32, skipToken string) (result DedicatedCloudNodeListResponseIterator, err error) { +func (client DedicatedCloudNodesClient) ListBySubscriptionComplete(ctx context.Context, filter string, top *int32, skipToken string) (result DedicatedCloudNodeListResponseIterator, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedCloudNodeClient.ListBySubscription") + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedCloudNodesClient.ListBySubscription") defer func() { sc := -1 if result.Response().Response.Response != nil { @@ -559,9 +565,9 @@ func (client DedicatedCloudNodeClient) ListBySubscriptionComplete(ctx context.Co // resourceGroupName - the name of the resource group // dedicatedCloudNodeName - dedicated cloud node name // dedicatedCloudNodeRequest - patch Dedicated Cloud Node request -func (client DedicatedCloudNodeClient) Update(ctx context.Context, resourceGroupName string, dedicatedCloudNodeName string, dedicatedCloudNodeRequest PatchPayload) (result DedicatedCloudNode, err error) { +func (client DedicatedCloudNodesClient) Update(ctx context.Context, resourceGroupName string, dedicatedCloudNodeName string, dedicatedCloudNodeRequest PatchPayload) (result DedicatedCloudNode, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedCloudNodeClient.Update") + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedCloudNodesClient.Update") defer func() { sc := -1 if result.Response.Response != nil { @@ -572,33 +578,33 @@ func (client DedicatedCloudNodeClient) Update(ctx context.Context, resourceGroup } if err := validation.Validate([]validation.Validation{ {TargetValue: dedicatedCloudNodeName, - Constraints: []validation.Constraint{{Target: "dedicatedCloudNodeName", Name: validation.Pattern, Rule: `^[-a-zA-Z0-9]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("vmwarecloudsimple.DedicatedCloudNodeClient", "Update", err.Error()) + Constraints: []validation.Constraint{{Target: "dedicatedCloudNodeName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]([-_.a-zA-Z0-9]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("vmwarecloudsimple.DedicatedCloudNodesClient", "Update", err.Error()) } req, err := client.UpdatePreparer(ctx, resourceGroupName, dedicatedCloudNodeName, dedicatedCloudNodeRequest) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodeClient", "Update", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodesClient", "Update", nil, "Failure preparing request") return } resp, err := client.UpdateSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodeClient", "Update", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodesClient", "Update", resp, "Failure sending request") return } result, err = client.UpdateResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodeClient", "Update", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodesClient", "Update", resp, "Failure responding to request") } return } // UpdatePreparer prepares the Update request. -func (client DedicatedCloudNodeClient) UpdatePreparer(ctx context.Context, resourceGroupName string, dedicatedCloudNodeName string, dedicatedCloudNodeRequest PatchPayload) (*http.Request, error) { +func (client DedicatedCloudNodesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, dedicatedCloudNodeName string, dedicatedCloudNodeRequest PatchPayload) (*http.Request, error) { pathParameters := map[string]interface{}{ "dedicatedCloudNodeName": autorest.Encode("path", dedicatedCloudNodeName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -622,14 +628,14 @@ func (client DedicatedCloudNodeClient) UpdatePreparer(ctx context.Context, resou // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. -func (client DedicatedCloudNodeClient) UpdateSender(req *http.Request) (*http.Response, error) { +func (client DedicatedCloudNodesClient) 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 DedicatedCloudNodeClient) UpdateResponder(resp *http.Response) (result DedicatedCloudNode, err error) { +func (client DedicatedCloudNodesClient) UpdateResponder(resp *http.Response) (result DedicatedCloudNode, err error) { err = autorest.Respond( resp, client.ByInspecting(), diff --git a/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/dedicatedcloudservice.go b/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/dedicatedcloudservices.go similarity index 71% rename from services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/dedicatedcloudservice.go rename to services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/dedicatedcloudservices.go index 751e355b071b..5a8b8bd9569f 100644 --- a/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/dedicatedcloudservice.go +++ b/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/dedicatedcloudservices.go @@ -26,19 +26,19 @@ import ( "net/http" ) -// DedicatedCloudServiceClient is the description of the new service -type DedicatedCloudServiceClient struct { +// DedicatedCloudServicesClient is the description of the new service +type DedicatedCloudServicesClient struct { BaseClient } -// NewDedicatedCloudServiceClient creates an instance of the DedicatedCloudServiceClient client. -func NewDedicatedCloudServiceClient(referer string, regionID string, subscriptionID string) DedicatedCloudServiceClient { - return NewDedicatedCloudServiceClientWithBaseURI(DefaultBaseURI, referer, regionID, subscriptionID) +// NewDedicatedCloudServicesClient creates an instance of the DedicatedCloudServicesClient client. +func NewDedicatedCloudServicesClient(subscriptionID string, referer string) DedicatedCloudServicesClient { + return NewDedicatedCloudServicesClientWithBaseURI(DefaultBaseURI, subscriptionID, referer) } -// NewDedicatedCloudServiceClientWithBaseURI creates an instance of the DedicatedCloudServiceClient client. -func NewDedicatedCloudServiceClientWithBaseURI(baseURI string, referer string, regionID string, subscriptionID string) DedicatedCloudServiceClient { - return DedicatedCloudServiceClient{NewWithBaseURI(baseURI, referer, regionID, subscriptionID)} +// NewDedicatedCloudServicesClientWithBaseURI creates an instance of the DedicatedCloudServicesClient client. +func NewDedicatedCloudServicesClientWithBaseURI(baseURI string, subscriptionID string, referer string) DedicatedCloudServicesClient { + return DedicatedCloudServicesClient{NewWithBaseURI(baseURI, subscriptionID, referer)} } // CreateOrUpdate create dedicate cloud service @@ -46,9 +46,9 @@ func NewDedicatedCloudServiceClientWithBaseURI(baseURI string, referer string, r // resourceGroupName - the name of the resource group // dedicatedCloudServiceName - dedicated cloud Service name // dedicatedCloudServiceRequest - create Dedicated Cloud Service request -func (client DedicatedCloudServiceClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, dedicatedCloudServiceName string, dedicatedCloudServiceRequest DedicatedCloudService) (result DedicatedCloudService, err error) { +func (client DedicatedCloudServicesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, dedicatedCloudServiceName string, dedicatedCloudServiceRequest DedicatedCloudService) (result DedicatedCloudService, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedCloudServiceClient.CreateOrUpdate") + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedCloudServicesClient.CreateOrUpdate") defer func() { sc := -1 if result.Response.Response != nil { @@ -59,39 +59,39 @@ func (client DedicatedCloudServiceClient) CreateOrUpdate(ctx context.Context, re } if err := validation.Validate([]validation.Validation{ {TargetValue: dedicatedCloudServiceName, - Constraints: []validation.Constraint{{Target: "dedicatedCloudServiceName", Name: validation.Pattern, Rule: `^[-a-zA-Z0-9]+$`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "dedicatedCloudServiceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]([-_.a-zA-Z0-9]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: dedicatedCloudServiceRequest, Constraints: []validation.Constraint{{Target: "dedicatedCloudServiceRequest.Location", Name: validation.Null, Rule: true, Chain: nil}, {Target: "dedicatedCloudServiceRequest.Name", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "dedicatedCloudServiceRequest.Name", Name: validation.Pattern, Rule: `^[-a-zA-Z0-9]+$`, Chain: nil}}}, + Chain: []validation.Constraint{{Target: "dedicatedCloudServiceRequest.Name", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]([-_.a-zA-Z0-9]*[a-zA-Z0-9])?$`, Chain: nil}}}, {Target: "dedicatedCloudServiceRequest.DedicatedCloudServiceProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "dedicatedCloudServiceRequest.DedicatedCloudServiceProperties.GatewaySubnet", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("vmwarecloudsimple.DedicatedCloudServiceClient", "CreateOrUpdate", err.Error()) + return result, validation.NewError("vmwarecloudsimple.DedicatedCloudServicesClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, dedicatedCloudServiceName, dedicatedCloudServiceRequest) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServiceClient", "CreateOrUpdate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServicesClient", "CreateOrUpdate", nil, "Failure preparing request") return } resp, err := client.CreateOrUpdateSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServiceClient", "CreateOrUpdate", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServicesClient", "CreateOrUpdate", resp, "Failure sending request") return } result, err = client.CreateOrUpdateResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServiceClient", "CreateOrUpdate", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServicesClient", "CreateOrUpdate", resp, "Failure responding to request") } return } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DedicatedCloudServiceClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, dedicatedCloudServiceName string, dedicatedCloudServiceRequest DedicatedCloudService) (*http.Request, error) { +func (client DedicatedCloudServicesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, dedicatedCloudServiceName string, dedicatedCloudServiceRequest DedicatedCloudService) (*http.Request, error) { pathParameters := map[string]interface{}{ "dedicatedCloudServiceName": autorest.Encode("path", dedicatedCloudServiceName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -118,14 +118,14 @@ func (client DedicatedCloudServiceClient) CreateOrUpdatePreparer(ctx context.Con // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. -func (client DedicatedCloudServiceClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { +func (client DedicatedCloudServicesClient) 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 DedicatedCloudServiceClient) CreateOrUpdateResponder(resp *http.Response) (result DedicatedCloudService, err error) { +func (client DedicatedCloudServicesClient) CreateOrUpdateResponder(resp *http.Response) (result DedicatedCloudService, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -140,9 +140,9 @@ func (client DedicatedCloudServiceClient) CreateOrUpdateResponder(resp *http.Res // Parameters: // resourceGroupName - the name of the resource group // dedicatedCloudServiceName - dedicated cloud service name -func (client DedicatedCloudServiceClient) Delete(ctx context.Context, resourceGroupName string, dedicatedCloudServiceName string) (result DedicatedCloudServiceDeleteFuture, err error) { +func (client DedicatedCloudServicesClient) Delete(ctx context.Context, resourceGroupName string, dedicatedCloudServiceName string) (result DedicatedCloudServicesDeleteFuture, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedCloudServiceClient.Delete") + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedCloudServicesClient.Delete") defer func() { sc := -1 if result.Response() != nil { @@ -153,13 +153,13 @@ func (client DedicatedCloudServiceClient) Delete(ctx context.Context, resourceGr } req, err := client.DeletePreparer(ctx, resourceGroupName, dedicatedCloudServiceName) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServiceClient", "Delete", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServicesClient", "Delete", nil, "Failure preparing request") return } result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServiceClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServicesClient", "Delete", result.Response(), "Failure sending request") return } @@ -167,7 +167,7 @@ func (client DedicatedCloudServiceClient) Delete(ctx context.Context, resourceGr } // DeletePreparer prepares the Delete request. -func (client DedicatedCloudServiceClient) DeletePreparer(ctx context.Context, resourceGroupName string, dedicatedCloudServiceName string) (*http.Request, error) { +func (client DedicatedCloudServicesClient) DeletePreparer(ctx context.Context, resourceGroupName string, dedicatedCloudServiceName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "dedicatedCloudServiceName": autorest.Encode("path", dedicatedCloudServiceName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -189,7 +189,7 @@ func (client DedicatedCloudServiceClient) DeletePreparer(ctx context.Context, re // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. -func (client DedicatedCloudServiceClient) DeleteSender(req *http.Request) (future DedicatedCloudServiceDeleteFuture, err error) { +func (client DedicatedCloudServicesClient) DeleteSender(req *http.Request) (future DedicatedCloudServicesDeleteFuture, err error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) var resp *http.Response resp, err = autorest.SendWithSender(client, req, sd...) @@ -202,7 +202,7 @@ func (client DedicatedCloudServiceClient) DeleteSender(req *http.Request) (futur // DeleteResponder handles the response to the Delete request. The method always // closes the http.Response Body. -func (client DedicatedCloudServiceClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { +func (client DedicatedCloudServicesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -216,9 +216,9 @@ func (client DedicatedCloudServiceClient) DeleteResponder(resp *http.Response) ( // Parameters: // resourceGroupName - the name of the resource group // dedicatedCloudServiceName - dedicated cloud Service name -func (client DedicatedCloudServiceClient) Get(ctx context.Context, resourceGroupName string, dedicatedCloudServiceName string) (result DedicatedCloudService, err error) { +func (client DedicatedCloudServicesClient) Get(ctx context.Context, resourceGroupName string, dedicatedCloudServiceName string) (result DedicatedCloudService, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedCloudServiceClient.Get") + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedCloudServicesClient.Get") defer func() { sc := -1 if result.Response.Response != nil { @@ -229,27 +229,27 @@ func (client DedicatedCloudServiceClient) Get(ctx context.Context, resourceGroup } req, err := client.GetPreparer(ctx, resourceGroupName, dedicatedCloudServiceName) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServiceClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServicesClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServiceClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServicesClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServiceClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServicesClient", "Get", resp, "Failure responding to request") } return } // GetPreparer prepares the Get request. -func (client DedicatedCloudServiceClient) GetPreparer(ctx context.Context, resourceGroupName string, dedicatedCloudServiceName string) (*http.Request, error) { +func (client DedicatedCloudServicesClient) GetPreparer(ctx context.Context, resourceGroupName string, dedicatedCloudServiceName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "dedicatedCloudServiceName": autorest.Encode("path", dedicatedCloudServiceName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -271,14 +271,14 @@ func (client DedicatedCloudServiceClient) GetPreparer(ctx context.Context, resou // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. -func (client DedicatedCloudServiceClient) GetSender(req *http.Request) (*http.Response, error) { +func (client DedicatedCloudServicesClient) 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 DedicatedCloudServiceClient) GetResponder(resp *http.Response) (result DedicatedCloudService, err error) { +func (client DedicatedCloudServicesClient) GetResponder(resp *http.Response) (result DedicatedCloudService, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -289,15 +289,15 @@ func (client DedicatedCloudServiceClient) GetResponder(resp *http.Response) (res return } -// ListByResourceGroup returns list of dedicated cloud service within resource group +// ListByResourceGroup returns list of dedicated cloud services within a resource group // Parameters: // resourceGroupName - the name of the resource group // filter - the filter to apply on the list operation // top - the maximum number of record sets to return // skipToken - to be used by nextLink implementation -func (client DedicatedCloudServiceClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string, top *int32, skipToken string) (result DedicatedCloudServiceListResponsePage, err error) { +func (client DedicatedCloudServicesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string, top *int32, skipToken string) (result DedicatedCloudServiceListResponsePage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedCloudServiceClient.ListByResourceGroup") + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedCloudServicesClient.ListByResourceGroup") defer func() { sc := -1 if result.dcslr.Response.Response != nil { @@ -309,27 +309,27 @@ func (client DedicatedCloudServiceClient) ListByResourceGroup(ctx context.Contex result.fn = client.listByResourceGroupNextResults req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, filter, top, skipToken) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServiceClient", "ListByResourceGroup", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServicesClient", "ListByResourceGroup", nil, "Failure preparing request") return } resp, err := client.ListByResourceGroupSender(req) if err != nil { result.dcslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServiceClient", "ListByResourceGroup", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServicesClient", "ListByResourceGroup", resp, "Failure sending request") return } result.dcslr, err = client.ListByResourceGroupResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServiceClient", "ListByResourceGroup", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServicesClient", "ListByResourceGroup", resp, "Failure responding to request") } return } // ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client DedicatedCloudServiceClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, filter string, top *int32, skipToken string) (*http.Request, error) { +func (client DedicatedCloudServicesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, filter string, top *int32, skipToken string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -359,14 +359,14 @@ func (client DedicatedCloudServiceClient) ListByResourceGroupPreparer(ctx contex // ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the // http.Response Body if it receives an error. -func (client DedicatedCloudServiceClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { +func (client DedicatedCloudServicesClient) 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 DedicatedCloudServiceClient) ListByResourceGroupResponder(resp *http.Response) (result DedicatedCloudServiceListResponse, err error) { +func (client DedicatedCloudServicesClient) ListByResourceGroupResponder(resp *http.Response) (result DedicatedCloudServiceListResponse, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -378,10 +378,10 @@ func (client DedicatedCloudServiceClient) ListByResourceGroupResponder(resp *htt } // listByResourceGroupNextResults retrieves the next set of results, if any. -func (client DedicatedCloudServiceClient) listByResourceGroupNextResults(ctx context.Context, lastResults DedicatedCloudServiceListResponse) (result DedicatedCloudServiceListResponse, err error) { +func (client DedicatedCloudServicesClient) listByResourceGroupNextResults(ctx context.Context, lastResults DedicatedCloudServiceListResponse) (result DedicatedCloudServiceListResponse, err error) { req, err := lastResults.dedicatedCloudServiceListResponsePreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServiceClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServicesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") } if req == nil { return @@ -389,19 +389,19 @@ func (client DedicatedCloudServiceClient) listByResourceGroupNextResults(ctx con resp, err := client.ListByResourceGroupSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServiceClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServicesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") } result, err = client.ListByResourceGroupResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServiceClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServicesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") } return } // ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client DedicatedCloudServiceClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, filter string, top *int32, skipToken string) (result DedicatedCloudServiceListResponseIterator, err error) { +func (client DedicatedCloudServicesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, filter string, top *int32, skipToken string) (result DedicatedCloudServiceListResponseIterator, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedCloudServiceClient.ListByResourceGroup") + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedCloudServicesClient.ListByResourceGroup") defer func() { sc := -1 if result.Response().Response.Response != nil { @@ -419,9 +419,9 @@ func (client DedicatedCloudServiceClient) ListByResourceGroupComplete(ctx contex // filter - the filter to apply on the list operation // top - the maximum number of record sets to return // skipToken - to be used by nextLink implementation -func (client DedicatedCloudServiceClient) ListBySubscription(ctx context.Context, filter string, top *int32, skipToken string) (result DedicatedCloudServiceListResponsePage, err error) { +func (client DedicatedCloudServicesClient) ListBySubscription(ctx context.Context, filter string, top *int32, skipToken string) (result DedicatedCloudServiceListResponsePage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedCloudServiceClient.ListBySubscription") + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedCloudServicesClient.ListBySubscription") defer func() { sc := -1 if result.dcslr.Response.Response != nil { @@ -433,27 +433,27 @@ func (client DedicatedCloudServiceClient) ListBySubscription(ctx context.Context result.fn = client.listBySubscriptionNextResults req, err := client.ListBySubscriptionPreparer(ctx, filter, top, skipToken) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServiceClient", "ListBySubscription", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServicesClient", "ListBySubscription", nil, "Failure preparing request") return } resp, err := client.ListBySubscriptionSender(req) if err != nil { result.dcslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServiceClient", "ListBySubscription", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServicesClient", "ListBySubscription", resp, "Failure sending request") return } result.dcslr, err = client.ListBySubscriptionResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServiceClient", "ListBySubscription", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServicesClient", "ListBySubscription", resp, "Failure responding to request") } return } // ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client DedicatedCloudServiceClient) ListBySubscriptionPreparer(ctx context.Context, filter string, top *int32, skipToken string) (*http.Request, error) { +func (client DedicatedCloudServicesClient) ListBySubscriptionPreparer(ctx context.Context, filter string, top *int32, skipToken string) (*http.Request, error) { pathParameters := map[string]interface{}{ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -482,14 +482,14 @@ func (client DedicatedCloudServiceClient) ListBySubscriptionPreparer(ctx context // ListBySubscriptionSender sends the ListBySubscription request. The method will close the // http.Response Body if it receives an error. -func (client DedicatedCloudServiceClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { +func (client DedicatedCloudServicesClient) 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 DedicatedCloudServiceClient) ListBySubscriptionResponder(resp *http.Response) (result DedicatedCloudServiceListResponse, err error) { +func (client DedicatedCloudServicesClient) ListBySubscriptionResponder(resp *http.Response) (result DedicatedCloudServiceListResponse, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -501,10 +501,10 @@ func (client DedicatedCloudServiceClient) ListBySubscriptionResponder(resp *http } // listBySubscriptionNextResults retrieves the next set of results, if any. -func (client DedicatedCloudServiceClient) listBySubscriptionNextResults(ctx context.Context, lastResults DedicatedCloudServiceListResponse) (result DedicatedCloudServiceListResponse, err error) { +func (client DedicatedCloudServicesClient) listBySubscriptionNextResults(ctx context.Context, lastResults DedicatedCloudServiceListResponse) (result DedicatedCloudServiceListResponse, err error) { req, err := lastResults.dedicatedCloudServiceListResponsePreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServiceClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServicesClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") } if req == nil { return @@ -512,19 +512,19 @@ func (client DedicatedCloudServiceClient) listBySubscriptionNextResults(ctx cont resp, err := client.ListBySubscriptionSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServiceClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServicesClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") } result, err = client.ListBySubscriptionResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServiceClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServicesClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") } return } // ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client DedicatedCloudServiceClient) ListBySubscriptionComplete(ctx context.Context, filter string, top *int32, skipToken string) (result DedicatedCloudServiceListResponseIterator, err error) { +func (client DedicatedCloudServicesClient) ListBySubscriptionComplete(ctx context.Context, filter string, top *int32, skipToken string) (result DedicatedCloudServiceListResponseIterator, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedCloudServiceClient.ListBySubscription") + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedCloudServicesClient.ListBySubscription") defer func() { sc := -1 if result.Response().Response.Response != nil { @@ -542,9 +542,9 @@ func (client DedicatedCloudServiceClient) ListBySubscriptionComplete(ctx context // resourceGroupName - the name of the resource group // dedicatedCloudServiceName - dedicated cloud service name // dedicatedCloudServiceRequest - patch Dedicated Cloud Service request -func (client DedicatedCloudServiceClient) Update(ctx context.Context, resourceGroupName string, dedicatedCloudServiceName string, dedicatedCloudServiceRequest PatchPayload) (result DedicatedCloudService, err error) { +func (client DedicatedCloudServicesClient) Update(ctx context.Context, resourceGroupName string, dedicatedCloudServiceName string, dedicatedCloudServiceRequest PatchPayload) (result DedicatedCloudService, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedCloudServiceClient.Update") + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedCloudServicesClient.Update") defer func() { sc := -1 if result.Response.Response != nil { @@ -555,27 +555,27 @@ func (client DedicatedCloudServiceClient) Update(ctx context.Context, resourceGr } req, err := client.UpdatePreparer(ctx, resourceGroupName, dedicatedCloudServiceName, dedicatedCloudServiceRequest) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServiceClient", "Update", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServicesClient", "Update", nil, "Failure preparing request") return } resp, err := client.UpdateSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServiceClient", "Update", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServicesClient", "Update", resp, "Failure sending request") return } result, err = client.UpdateResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServiceClient", "Update", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServicesClient", "Update", resp, "Failure responding to request") } return } // UpdatePreparer prepares the Update request. -func (client DedicatedCloudServiceClient) UpdatePreparer(ctx context.Context, resourceGroupName string, dedicatedCloudServiceName string, dedicatedCloudServiceRequest PatchPayload) (*http.Request, error) { +func (client DedicatedCloudServicesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, dedicatedCloudServiceName string, dedicatedCloudServiceRequest PatchPayload) (*http.Request, error) { pathParameters := map[string]interface{}{ "dedicatedCloudServiceName": autorest.Encode("path", dedicatedCloudServiceName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -599,14 +599,14 @@ func (client DedicatedCloudServiceClient) UpdatePreparer(ctx context.Context, re // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. -func (client DedicatedCloudServiceClient) UpdateSender(req *http.Request) (*http.Response, error) { +func (client DedicatedCloudServicesClient) 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 DedicatedCloudServiceClient) UpdateResponder(resp *http.Response) (result DedicatedCloudService, err error) { +func (client DedicatedCloudServicesClient) UpdateResponder(resp *http.Response) (result DedicatedCloudService, err error) { err = autorest.Respond( resp, client.ByInspecting(), diff --git a/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/models.go b/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/models.go index 5553a3032a98..c175e6e04798 100644 --- a/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/models.go +++ b/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/models.go @@ -47,6 +47,21 @@ func PossibleAggregationTypeValues() []AggregationType { return []AggregationType{Average, Total} } +// Allocation enumerates the values for allocation. +type Allocation string + +const ( + // Dynamic ... + Dynamic Allocation = "dynamic" + // Static ... + Static Allocation = "static" +) + +// PossibleAllocationValues returns an array of possible values for the Allocation const type. +func PossibleAllocationValues() []Allocation { + return []Allocation{Dynamic, Static} +} + // DiskIndependenceMode enumerates the values for disk independence mode. type DiskIndependenceMode string @@ -187,6 +202,78 @@ func PossibleStopModeValues() []StopMode { return []StopMode{Poweroff, Reboot, Shutdown, Suspend} } +// Type enumerates the values for type. +type Type string + +const ( + // CUSTOMNAME ... + CUSTOMNAME Type = "CUSTOM_NAME" + // FIXED ... + FIXED Type = "FIXED" + // PREFIXBASED ... + PREFIXBASED Type = "PREFIX_BASED" + // USERDEFINED ... + USERDEFINED Type = "USER_DEFINED" + // VIRTUALMACHINENAME ... + VIRTUALMACHINENAME Type = "VIRTUAL_MACHINE_NAME" +) + +// PossibleTypeValues returns an array of possible values for the Type const type. +func PossibleTypeValues() []Type { + return []Type{CUSTOMNAME, FIXED, PREFIXBASED, USERDEFINED, VIRTUALMACHINENAME} +} + +// Type1 enumerates the values for type 1. +type Type1 string + +const ( + // Type1CUSTOM ... + Type1CUSTOM Type1 = "CUSTOM" + // Type1DHCPIP ... + Type1DHCPIP Type1 = "DHCP_IP" + // Type1FIXEDIP ... + Type1FIXEDIP Type1 = "FIXED_IP" + // Type1USERDEFINED ... + Type1USERDEFINED Type1 = "USER_DEFINED" +) + +// PossibleType1Values returns an array of possible values for the Type1 const type. +func PossibleType1Values() []Type1 { + return []Type1{Type1CUSTOM, Type1DHCPIP, Type1FIXEDIP, Type1USERDEFINED} +} + +// Type2 enumerates the values for type 2. +type Type2 string + +const ( + // LINUX ... + LINUX Type2 = "LINUX" + // WINDOWS ... + WINDOWS Type2 = "WINDOWS" + // WINDOWSTEXT ... + WINDOWSTEXT Type2 = "WINDOWS_TEXT" +) + +// PossibleType2Values returns an array of possible values for the Type2 const type. +func PossibleType2Values() []Type2 { + return []Type2{LINUX, WINDOWS, WINDOWSTEXT} +} + +// Type3 enumerates the values for type 3. +type Type3 string + +const ( + // Type3LINUX ... + Type3LINUX Type3 = "LINUX" + // Type3WINDOWS ... + Type3WINDOWS Type3 = "WINDOWS" +) + +// PossibleType3Values returns an array of possible values for the Type3 const type. +func PossibleType3Values() []Type3 { + return []Type3{Type3LINUX, Type3WINDOWS} +} + // UsageCount enumerates the values for usage count. type UsageCount string @@ -534,6 +621,319 @@ type CSRPErrorBody struct { Target *string `json:"target,omitempty"` } +// CustomizationHostName host name model +type CustomizationHostName struct { + // Name - Hostname + Name *string `json:"name,omitempty"` + // Type - Type of host name. Possible values include: 'USERDEFINED', 'PREFIXBASED', 'FIXED', 'VIRTUALMACHINENAME', 'CUSTOMNAME' + Type Type `json:"type,omitempty"` +} + +// CustomizationIdentity ... +type CustomizationIdentity struct { + // Data - Windows Text Identity. Prepared data + Data *string `json:"data,omitempty"` + // HostName - Virtual machine host name settings + HostName *CustomizationHostName `json:"hostName,omitempty"` + // Type - Identity type. Possible values include: 'WINDOWSTEXT', 'WINDOWS', 'LINUX' + Type Type2 `json:"type,omitempty"` + // UserData - Windows Identity. User data customization + UserData *CustomizationIdentityUserData `json:"userData,omitempty"` +} + +// CustomizationIdentityUserData windows Identity. User data customization +type CustomizationIdentityUserData struct { + // IsPasswordPredefined - Is password predefined in customization policy + IsPasswordPredefined *bool `json:"isPasswordPredefined,omitempty"` +} + +// CustomizationIPAddress ... +type CustomizationIPAddress struct { + // Argument - Argument when Custom ip type is selected + Argument *string `json:"argument,omitempty"` + // IPAddress - Defined Ip Address when Fixed ip type is selected + IPAddress *string `json:"ipAddress,omitempty"` + // Type - Customization Specification ip type. Possible values include: 'Type1CUSTOM', 'Type1DHCPIP', 'Type1FIXEDIP', 'Type1USERDEFINED' + Type Type1 `json:"type,omitempty"` +} + +// CustomizationIPSettings ... +type CustomizationIPSettings struct { + // Gateway - The list of gateways + Gateway *[]string `json:"gateway,omitempty"` + // IP - Ip address customization settings + IP *CustomizationIPAddress `json:"ip,omitempty"` + // SubnetMask - Adapter subnet mask + SubnetMask *string `json:"subnetMask,omitempty"` +} + +// CustomizationNicSetting ... +type CustomizationNicSetting struct { + // Adapter - The list of adapters' settings + Adapter *CustomizationIPSettings `json:"adapter,omitempty"` + // MacAddress - NIC mac address + MacAddress *string `json:"macAddress,omitempty"` +} + +// CustomizationPoliciesListResponse list of customization polices response model +type CustomizationPoliciesListResponse struct { + autorest.Response `json:"-"` + // NextLink - Link for next list of the Customization policy + NextLink *string `json:"nextLink,omitempty"` + // Value - List of the customization policies + Value *[]CustomizationPolicy `json:"value,omitempty"` +} + +// CustomizationPoliciesListResponseIterator provides access to a complete listing of CustomizationPolicy +// values. +type CustomizationPoliciesListResponseIterator struct { + i int + page CustomizationPoliciesListResponsePage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *CustomizationPoliciesListResponseIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomizationPoliciesListResponseIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *CustomizationPoliciesListResponseIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter CustomizationPoliciesListResponseIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter CustomizationPoliciesListResponseIterator) Response() CustomizationPoliciesListResponse { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter CustomizationPoliciesListResponseIterator) Value() CustomizationPolicy { + if !iter.page.NotDone() { + return CustomizationPolicy{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the CustomizationPoliciesListResponseIterator type. +func NewCustomizationPoliciesListResponseIterator(page CustomizationPoliciesListResponsePage) CustomizationPoliciesListResponseIterator { + return CustomizationPoliciesListResponseIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (cplr CustomizationPoliciesListResponse) IsEmpty() bool { + return cplr.Value == nil || len(*cplr.Value) == 0 +} + +// customizationPoliciesListResponsePreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (cplr CustomizationPoliciesListResponse) customizationPoliciesListResponsePreparer(ctx context.Context) (*http.Request, error) { + if cplr.NextLink == nil || len(to.String(cplr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(cplr.NextLink))) +} + +// CustomizationPoliciesListResponsePage contains a page of CustomizationPolicy values. +type CustomizationPoliciesListResponsePage struct { + fn func(context.Context, CustomizationPoliciesListResponse) (CustomizationPoliciesListResponse, error) + cplr CustomizationPoliciesListResponse +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *CustomizationPoliciesListResponsePage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomizationPoliciesListResponsePage.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.cplr) + if err != nil { + return err + } + page.cplr = 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 *CustomizationPoliciesListResponsePage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page CustomizationPoliciesListResponsePage) NotDone() bool { + return !page.cplr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page CustomizationPoliciesListResponsePage) Response() CustomizationPoliciesListResponse { + return page.cplr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page CustomizationPoliciesListResponsePage) Values() []CustomizationPolicy { + if page.cplr.IsEmpty() { + return nil + } + return *page.cplr.Value +} + +// Creates a new instance of the CustomizationPoliciesListResponsePage type. +func NewCustomizationPoliciesListResponsePage(getNextPage func(context.Context, CustomizationPoliciesListResponse) (CustomizationPoliciesListResponse, error)) CustomizationPoliciesListResponsePage { + return CustomizationPoliciesListResponsePage{fn: getNextPage} +} + +// CustomizationPolicy the virtual machine customization policy +type CustomizationPolicy struct { + autorest.Response `json:"-"` + // ID - Customization policy azure id + ID *string `json:"id,omitempty"` + // Location - Azure region + Location *string `json:"location,omitempty"` + // Name - READ-ONLY; Customization policy name + Name *string `json:"name,omitempty"` + // CustomizationPolicyProperties - Customization Policy properties + *CustomizationPolicyProperties `json:"properties,omitempty"` + // Type - READ-ONLY + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for CustomizationPolicy. +func (cp CustomizationPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cp.ID != nil { + objectMap["id"] = cp.ID + } + if cp.Location != nil { + objectMap["location"] = cp.Location + } + if cp.CustomizationPolicyProperties != nil { + objectMap["properties"] = cp.CustomizationPolicyProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CustomizationPolicy struct. +func (cp *CustomizationPolicy) UnmarshalJSON(body []byte) error { + 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 + } + cp.ID = &ID + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + cp.Location = &location + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cp.Name = &name + } + case "properties": + if v != nil { + var customizationPolicyProperties CustomizationPolicyProperties + err = json.Unmarshal(*v, &customizationPolicyProperties) + if err != nil { + return err + } + cp.CustomizationPolicyProperties = &customizationPolicyProperties + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cp.Type = &typeVar + } + } + } + + return nil +} + +// CustomizationPolicyProperties the properties of Customization policy +type CustomizationPolicyProperties struct { + // Description - Policy description + Description *string `json:"description,omitempty"` + // PrivateCloudID - The Private cloud id + PrivateCloudID *string `json:"privateCloudId,omitempty"` + // Specification - Detailed customization policy specification + Specification *CustomizationSpecification `json:"specification,omitempty"` + // Type - The type of customization (Linux or Windows). Possible values include: 'Type3LINUX', 'Type3WINDOWS' + Type Type3 `json:"type,omitempty"` + // Version - Policy version + Version *string `json:"version,omitempty"` +} + +// CustomizationSpecification the specification for Customization Policy +type CustomizationSpecification struct { + // Identity - Customization Identity. It contains data about user and hostname + Identity *CustomizationIdentity `json:"identity,omitempty"` + // NicSettings - Network interface settings + NicSettings *[]CustomizationNicSetting `json:"nicSettings,omitempty"` +} + // DedicatedCloudNode dedicated cloud node model type DedicatedCloudNode struct { autorest.Response `json:"-"` @@ -649,35 +1049,6 @@ func (dcn *DedicatedCloudNode) UnmarshalJSON(body []byte) error { return nil } -// DedicatedCloudNodeCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type DedicatedCloudNodeCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DedicatedCloudNodeCreateOrUpdateFuture) Result(client DedicatedCloudNodeClient) (dcn DedicatedCloudNode, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodeCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("vmwarecloudsimple.DedicatedCloudNodeCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if dcn.Response.Response, err = future.GetResult(sender); err == nil && dcn.Response.Response.StatusCode != http.StatusNoContent { - dcn, err = client.CreateOrUpdateResponder(dcn.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodeCreateOrUpdateFuture", "Result", dcn.Response.Response, "Failure responding to request") - } - } - return -} - // DedicatedCloudNodeListResponse list of dedicated nodes response model type DedicatedCloudNodeListResponse struct { autorest.Response `json:"-"` @@ -1019,6 +1390,35 @@ func (dcnp *DedicatedCloudNodeProperties) UnmarshalJSON(body []byte) error { return nil } +// DedicatedCloudNodesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type DedicatedCloudNodesCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DedicatedCloudNodesCreateOrUpdateFuture) Result(client DedicatedCloudNodesClient) (dcn DedicatedCloudNode, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("vmwarecloudsimple.DedicatedCloudNodesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if dcn.Response.Response, err = future.GetResult(sender); err == nil && dcn.Response.Response.StatusCode != http.StatusNoContent { + dcn, err = client.CreateOrUpdateResponder(dcn.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudNodesCreateOrUpdateFuture", "Result", dcn.Response.Response, "Failure responding to request") + } + } + return +} + // DedicatedCloudService dedicated cloud service model type DedicatedCloudService struct { autorest.Response `json:"-"` @@ -1120,29 +1520,6 @@ func (dcs *DedicatedCloudService) UnmarshalJSON(body []byte) error { return nil } -// DedicatedCloudServiceDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type DedicatedCloudServiceDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DedicatedCloudServiceDeleteFuture) Result(client DedicatedCloudServiceClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServiceDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("vmwarecloudsimple.DedicatedCloudServiceDeleteFuture") - return - } - ar.Response = future.Response() - return -} - // DedicatedCloudServiceListResponse list of dedicated cloud services type DedicatedCloudServiceListResponse struct { autorest.Response `json:"-"` @@ -1296,12 +1673,67 @@ type DedicatedCloudServiceProperties struct { GatewaySubnet *string `json:"gatewaySubnet,omitempty"` // IsAccountOnboarded - READ-ONLY; indicates whether account onboarded or not in a given region. Possible values include: 'NotOnBoarded', 'OnBoarded', 'OnBoardingFailed', 'OnBoarding' IsAccountOnboarded OnboardingStatus `json:"isAccountOnboarded,omitempty"` - // Nodes - total nodes purchased + // Nodes - READ-ONLY; total nodes purchased Nodes *int32 `json:"nodes,omitempty"` - // ServiceURL - link to a service management web portal + // ServiceURL - READ-ONLY; link to a service management web portal ServiceURL *string `json:"serviceURL,omitempty"` } +// DedicatedCloudServicesDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type DedicatedCloudServicesDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DedicatedCloudServicesDeleteFuture) Result(client DedicatedCloudServicesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.DedicatedCloudServicesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("vmwarecloudsimple.DedicatedCloudServicesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// GuestOSCustomization guest OS Customization properties +type GuestOSCustomization struct { + // DNSServers - List of dns servers to use + DNSServers *[]string `json:"dnsServers,omitempty"` + // HostName - Virtual Machine hostname + HostName *string `json:"hostName,omitempty"` + // Password - Password for login + Password *string `json:"password,omitempty"` + // PolicyID - id of customization policy + PolicyID *string `json:"policyId,omitempty"` + // Username - Username for login + Username *string `json:"username,omitempty"` +} + +// GuestOSNICCustomization guest OS nic customization +type GuestOSNICCustomization struct { + // Allocation - IP address allocation method. Possible values include: 'Static', 'Dynamic' + Allocation Allocation `json:"allocation,omitempty"` + // DNSServers - List of dns servers to use + DNSServers *[]string `json:"dnsServers,omitempty"` + // Gateway - Gateway addresses assigned to nic + Gateway *[]string `json:"gateway,omitempty"` + // IPAddress - Static ip address for nic + IPAddress *string `json:"ipAddress,omitempty"` + // Mask - Network mask for nic + Mask *string `json:"mask,omitempty"` + // PrimaryWinsServer - primary WINS server for Windows + PrimaryWinsServer *string `json:"primaryWinsServer,omitempty"` + // SecondaryWinsServer - secondary WINS server for Windows + SecondaryWinsServer *string `json:"secondaryWinsServer,omitempty"` +} + // OperationError operation error model type OperationError struct { // Code - Error's code @@ -1641,7 +2073,7 @@ type ResourcePool struct { autorest.Response `json:"-"` // ID - resource pool id (privateCloudId:vsphereId) ID *string `json:"id,omitempty"` - // Location - Azure region + // Location - READ-ONLY; Azure region Location *string `json:"location,omitempty"` // Name - READ-ONLY; {ResourcePoolName} Name *string `json:"name,omitempty"` @@ -1659,9 +2091,6 @@ func (rp ResourcePool) MarshalJSON() ([]byte, error) { if rp.ID != nil { objectMap["id"] = rp.ID } - if rp.Location != nil { - objectMap["location"] = rp.Location - } if rp.ResourcePoolProperties != nil { objectMap["properties"] = rp.ResourcePoolProperties } @@ -2370,58 +2799,6 @@ func (VM *VirtualMachine) UnmarshalJSON(body []byte) error { return nil } -// VirtualMachineCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachineCreateOrUpdateFuture) Result(client VirtualMachineClient) (VM VirtualMachine, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("vmwarecloudsimple.VirtualMachineCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if VM.Response.Response, err = future.GetResult(sender); err == nil && VM.Response.Response.StatusCode != http.StatusNoContent { - VM, err = client.CreateOrUpdateResponder(VM.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineCreateOrUpdateFuture", "Result", VM.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualMachineDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachineDeleteFuture) Result(client VirtualMachineClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("vmwarecloudsimple.VirtualMachineDeleteFuture") - return - } - ar.Response = future.Response() - return -} - // VirtualMachineListResponse list of virtual machines type VirtualMachineListResponse struct { autorest.Response `json:"-"` @@ -2574,6 +2951,8 @@ type VirtualMachineProperties struct { AmountOfRAM *int32 `json:"amountOfRam,omitempty"` // Controllers - READ-ONLY; The list of Virtual Disks' Controllers Controllers *[]VirtualDiskController `json:"controllers,omitempty"` + // Customization - Virtual machine properties + Customization *GuestOSCustomization `json:"customization,omitempty"` // Disks - The list of Virtual Disks Disks *[]VirtualDisk `json:"disks,omitempty"` // Dnsname - READ-ONLY; The DNS name of Virtual Machine in VCenter @@ -2582,15 +2961,15 @@ type VirtualMachineProperties struct { ExposeToGuestVM *bool `json:"exposeToGuestVM,omitempty"` // Folder - READ-ONLY; The path to virtual machine folder in VCenter Folder *string `json:"folder,omitempty"` - // GuestOS - The name of Guest OS + // GuestOS - READ-ONLY; The name of Guest OS GuestOS *string `json:"guestOS,omitempty"` - // GuestOSType - The Guest OS type. Possible values include: 'Linux', 'Windows', 'Other' + // GuestOSType - READ-ONLY; The Guest OS type. Possible values include: 'Linux', 'Windows', 'Other' GuestOSType GuestOSType `json:"guestOSType,omitempty"` // Nics - The list of Virtual NICs Nics *[]VirtualNic `json:"nics,omitempty"` // NumberOfCores - The number of CPU cores NumberOfCores *int32 `json:"numberOfCores,omitempty"` - // Password - Password for login + // Password - Password for login. Deprecated - use customization property Password *string `json:"password,omitempty"` // PrivateCloudID - Private Cloud Id PrivateCloudID *string `json:"privateCloudId,omitempty"` @@ -2604,7 +2983,7 @@ type VirtualMachineProperties struct { Status VirtualMachineStatus `json:"status,omitempty"` // TemplateID - Virtual Machine Template Id TemplateID *string `json:"templateId,omitempty"` - // Username - Username for login + // Username - Username for login. Deprecated - use customization property Username *string `json:"username,omitempty"` // VSphereNetworks - The list of Virtual VSphere Networks VSphereNetworks *[]string `json:"vSphereNetworks,omitempty"` @@ -2614,46 +2993,98 @@ type VirtualMachineProperties struct { Vmwaretools *string `json:"vmwaretools,omitempty"` } -// VirtualMachineStartFuture an abstraction for monitoring and retrieving the results of a long-running +// VirtualMachinesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VirtualMachinesCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *VirtualMachinesCreateOrUpdateFuture) Result(client VirtualMachinesClient) (VM VirtualMachine, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachinesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("vmwarecloudsimple.VirtualMachinesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if VM.Response.Response, err = future.GetResult(sender); err == nil && VM.Response.Response.StatusCode != http.StatusNoContent { + VM, err = client.CreateOrUpdateResponder(VM.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachinesCreateOrUpdateFuture", "Result", VM.Response.Response, "Failure responding to request") + } + } + return +} + +// VirtualMachinesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. -type VirtualMachineStartFuture struct { +type VirtualMachinesDeleteFuture struct { azure.Future } // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. -func (future *VirtualMachineStartFuture) Result(client VirtualMachineClient) (ar autorest.Response, err error) { +func (future *VirtualMachinesDeleteFuture) Result(client VirtualMachinesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineStartFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachinesDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - err = azure.NewAsyncOpIncompleteError("vmwarecloudsimple.VirtualMachineStartFuture") + err = azure.NewAsyncOpIncompleteError("vmwarecloudsimple.VirtualMachinesDeleteFuture") return } ar.Response = future.Response() return } -// VirtualMachineStopFuture an abstraction for monitoring and retrieving the results of a long-running +// VirtualMachinesStartFuture an abstraction for monitoring and retrieving the results of a long-running // operation. -type VirtualMachineStopFuture struct { +type VirtualMachinesStartFuture struct { azure.Future } // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. -func (future *VirtualMachineStopFuture) Result(client VirtualMachineClient) (ar autorest.Response, err error) { +func (future *VirtualMachinesStartFuture) Result(client VirtualMachinesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineStopFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachinesStartFuture", "Result", future.Response(), "Polling failure") return } if !done { - err = azure.NewAsyncOpIncompleteError("vmwarecloudsimple.VirtualMachineStopFuture") + err = azure.NewAsyncOpIncompleteError("vmwarecloudsimple.VirtualMachinesStartFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachinesStopFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type VirtualMachinesStopFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *VirtualMachinesStopFuture) Result(client VirtualMachinesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachinesStopFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("vmwarecloudsimple.VirtualMachinesStopFuture") return } ar.Response = future.Response() @@ -2666,6 +3097,35 @@ type VirtualMachineStopMode struct { Mode StopMode `json:"mode,omitempty"` } +// VirtualMachinesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type VirtualMachinesUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *VirtualMachinesUpdateFuture) Result(client VirtualMachinesClient) (VM VirtualMachine, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachinesUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("vmwarecloudsimple.VirtualMachinesUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if VM.Response.Response, err = future.GetResult(sender); err == nil && VM.Response.Response.StatusCode != http.StatusNoContent { + VM, err = client.UpdateResponder(VM.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachinesUpdateFuture", "Result", VM.Response.Response, "Failure responding to request") + } + } + return +} + // VirtualMachineTemplate virtual machine template model type VirtualMachineTemplate struct { autorest.Response `json:"-"` @@ -2912,9 +3372,9 @@ type VirtualMachineTemplateProperties struct { Disks *[]VirtualDisk `json:"disks,omitempty"` // ExposeToGuestVM - Expose Guest OS or not ExposeToGuestVM *bool `json:"exposeToGuestVM,omitempty"` - // GuestOS - The Guest OS + // GuestOS - READ-ONLY; The Guest OS GuestOS *string `json:"guestOS,omitempty"` - // GuestOSType - The Guest OS types + // GuestOSType - READ-ONLY; The Guest OS types GuestOSType *string `json:"guestOSType,omitempty"` // Nics - The list of Virtual NICs Nics *[]VirtualNic `json:"nics,omitempty"` @@ -2932,35 +3392,6 @@ type VirtualMachineTemplateProperties struct { Vmwaretools *string `json:"vmwaretools,omitempty"` } -// VirtualMachineUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualMachineUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachineUpdateFuture) Result(client VirtualMachineClient) (VM VirtualMachine, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("vmwarecloudsimple.VirtualMachineUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if VM.Response.Response, err = future.GetResult(sender); err == nil && VM.Response.Response.StatusCode != http.StatusNoContent { - VM, err = client.UpdateResponder(VM.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineUpdateFuture", "Result", VM.Response.Response, "Failure responding to request") - } - } - return -} - // VirtualNetwork virtual network model type VirtualNetwork struct { autorest.Response `json:"-"` @@ -2968,7 +3399,7 @@ type VirtualNetwork struct { Assignable *bool `json:"assignable,omitempty"` // ID - virtual network id (privateCloudId:vsphereId) ID *string `json:"id,omitempty"` - // Location - Azure region + // Location - READ-ONLY; Azure region Location *string `json:"location,omitempty"` // Name - READ-ONLY; {VirtualNetworkName} Name *string `json:"name,omitempty"` @@ -2984,9 +3415,6 @@ func (vn VirtualNetwork) MarshalJSON() ([]byte, error) { if vn.ID != nil { objectMap["id"] = vn.ID } - if vn.Location != nil { - objectMap["location"] = vn.Location - } if vn.VirtualNetworkProperties != nil { objectMap["properties"] = vn.VirtualNetworkProperties } @@ -3216,11 +3644,13 @@ type VirtualNetworkProperties struct { // VirtualNic virtual NIC model type VirtualNic struct { + // Customization - guest OS customization for nic + Customization *GuestOSNICCustomization `json:"customization,omitempty"` // IPAddresses - NIC ip address IPAddresses *[]string `json:"ipAddresses,omitempty"` // MacAddress - NIC MAC address MacAddress *string `json:"macAddress,omitempty"` - // Network - The list of Virtual Networks + // Network - Virtual Network Network *VirtualNetwork `json:"network,omitempty"` // NicType - NIC type. Possible values include: 'E1000', 'E1000E', 'PCNET32', 'VMXNET', 'VMXNET2', 'VMXNET3' NicType NICType `json:"nicType,omitempty"` diff --git a/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/operations.go b/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/operations.go new file mode 100644 index 000000000000..0d9056e95f88 --- /dev/null +++ b/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/operations.go @@ -0,0 +1,225 @@ +package vmwarecloudsimple + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if 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 description of the new service +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string, referer string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID, referer) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client. +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string, referer string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID, referer)} +} + +// Get return an async operation +// Parameters: +// regionID - the region Id (westus, eastus) +// operationID - operation id +func (client OperationsClient) Get(ctx context.Context, regionID string, operationID string) (result OperationResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.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, regionID, operationID) + if err != nil { + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.OperationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.OperationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.OperationsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client OperationsClient) GetPreparer(ctx context.Context, regionID string, operationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "operationId": autorest.Encode("path", operationID), + "regionId": autorest.Encode("path", regionID), + "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}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/operationResults/{operationId}", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("Referer", client.Referer)) + 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 OperationsClient) 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 OperationsClient) GetResponder(resp *http.Response) (result OperationResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List return list of operations +func (client OperationsClient) List(ctx context.Context) (result AvailableOperationsListResponsePage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.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) + if err != nil { + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.OperationsClient", "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, "vmwarecloudsimple.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.aolr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.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-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.VMwareCloudSimple/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 AvailableOperationsListResponse, 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 AvailableOperationsListResponse) (result AvailableOperationsListResponse, err error) { + req, err := lastResults.availableOperationsListResponsePreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.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, "vmwarecloudsimple.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.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 AvailableOperationsListResponseIterator, 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/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/privateclouds.go b/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/privateclouds.go new file mode 100644 index 000000000000..9854e510db2a --- /dev/null +++ b/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/privateclouds.go @@ -0,0 +1,231 @@ +package vmwarecloudsimple + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if 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" +) + +// PrivateCloudsClient is the description of the new service +type PrivateCloudsClient struct { + BaseClient +} + +// NewPrivateCloudsClient creates an instance of the PrivateCloudsClient client. +func NewPrivateCloudsClient(subscriptionID string, referer string) PrivateCloudsClient { + return NewPrivateCloudsClientWithBaseURI(DefaultBaseURI, subscriptionID, referer) +} + +// NewPrivateCloudsClientWithBaseURI creates an instance of the PrivateCloudsClient client. +func NewPrivateCloudsClientWithBaseURI(baseURI string, subscriptionID string, referer string) PrivateCloudsClient { + return PrivateCloudsClient{NewWithBaseURI(baseURI, subscriptionID, referer)} +} + +// Get returns private cloud by its name +// Parameters: +// pcName - the private cloud name +// regionID - the region Id (westus, eastus) +func (client PrivateCloudsClient) Get(ctx context.Context, pcName string, regionID string) (result PrivateCloud, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateCloudsClient.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, pcName, regionID) + if err != nil { + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.PrivateCloudsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.PrivateCloudsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.PrivateCloudsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client PrivateCloudsClient) GetPreparer(ctx context.Context, pcName string, regionID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "pcName": autorest.Encode("path", pcName), + "regionId": autorest.Encode("path", regionID), + "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}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}", 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 PrivateCloudsClient) 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 PrivateCloudsClient) GetResponder(resp *http.Response) (result PrivateCloud, 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 list of private clouds in particular region +// Parameters: +// regionID - the region Id (westus, eastus) +func (client PrivateCloudsClient) List(ctx context.Context, regionID string) (result PrivateCloudListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateCloudsClient.List") + defer func() { + sc := -1 + if result.pcl.Response.Response != nil { + sc = result.pcl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, regionID) + if err != nil { + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.PrivateCloudsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.pcl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.PrivateCloudsClient", "List", resp, "Failure sending request") + return + } + + result.pcl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.PrivateCloudsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client PrivateCloudsClient) ListPreparer(ctx context.Context, regionID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "regionId": autorest.Encode("path", regionID), + "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}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds", 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 PrivateCloudsClient) 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 PrivateCloudsClient) ListResponder(resp *http.Response) (result PrivateCloudList, 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 PrivateCloudsClient) listNextResults(ctx context.Context, lastResults PrivateCloudList) (result PrivateCloudList, err error) { + req, err := lastResults.privateCloudListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.PrivateCloudsClient", "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, "vmwarecloudsimple.PrivateCloudsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.PrivateCloudsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client PrivateCloudsClient) ListComplete(ctx context.Context, regionID string) (result PrivateCloudListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateCloudsClient.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, regionID) + return +} diff --git a/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/resourcepoolbypc.go b/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/resourcepoolbypc.go deleted file mode 100644 index 86087350ffe8..000000000000 --- a/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/resourcepoolbypc.go +++ /dev/null @@ -1,119 +0,0 @@ -package vmwarecloudsimple - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// ResourcePoolByPCClient is the description of the new service -type ResourcePoolByPCClient struct { - BaseClient -} - -// NewResourcePoolByPCClient creates an instance of the ResourcePoolByPCClient client. -func NewResourcePoolByPCClient(referer string, regionID string, subscriptionID string) ResourcePoolByPCClient { - return NewResourcePoolByPCClientWithBaseURI(DefaultBaseURI, referer, regionID, subscriptionID) -} - -// NewResourcePoolByPCClientWithBaseURI creates an instance of the ResourcePoolByPCClient client. -func NewResourcePoolByPCClientWithBaseURI(baseURI string, referer string, regionID string, subscriptionID string) ResourcePoolByPCClient { - return ResourcePoolByPCClient{NewWithBaseURI(baseURI, referer, regionID, subscriptionID)} -} - -// Get returns resource pool templates by its name -// Parameters: -// pcName - the private cloud name -// resourcePoolName - resource pool id (vsphereId) -func (client ResourcePoolByPCClient) Get(ctx context.Context, pcName string, resourcePoolName string) (result ResourcePool, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourcePoolByPCClient.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, pcName, resourcePoolName) - if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.ResourcePoolByPCClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.ResourcePoolByPCClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.ResourcePoolByPCClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ResourcePoolByPCClient) GetPreparer(ctx context.Context, pcName string, resourcePoolName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "pcName": autorest.Encode("path", pcName), - "regionId": autorest.Encode("path", client.RegionID), - "resourcePoolName": autorest.Encode("path", resourcePoolName), - "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}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}/resourcePools/{resourcePoolName}", 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 ResourcePoolByPCClient) 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 ResourcePoolByPCClient) GetResponder(resp *http.Response) (result ResourcePool, 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/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/resourcepools.go b/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/resourcepools.go new file mode 100644 index 000000000000..6ec7d5d3678e --- /dev/null +++ b/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/resourcepools.go @@ -0,0 +1,235 @@ +package vmwarecloudsimple + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if 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" +) + +// ResourcePoolsClient is the description of the new service +type ResourcePoolsClient struct { + BaseClient +} + +// NewResourcePoolsClient creates an instance of the ResourcePoolsClient client. +func NewResourcePoolsClient(subscriptionID string, referer string) ResourcePoolsClient { + return NewResourcePoolsClientWithBaseURI(DefaultBaseURI, subscriptionID, referer) +} + +// NewResourcePoolsClientWithBaseURI creates an instance of the ResourcePoolsClient client. +func NewResourcePoolsClientWithBaseURI(baseURI string, subscriptionID string, referer string) ResourcePoolsClient { + return ResourcePoolsClient{NewWithBaseURI(baseURI, subscriptionID, referer)} +} + +// Get returns resource pool templates by its name +// Parameters: +// regionID - the region Id (westus, eastus) +// pcName - the private cloud name +// resourcePoolName - resource pool id (vsphereId) +func (client ResourcePoolsClient) Get(ctx context.Context, regionID string, pcName string, resourcePoolName string) (result ResourcePool, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourcePoolsClient.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, regionID, pcName, resourcePoolName) + if err != nil { + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.ResourcePoolsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.ResourcePoolsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.ResourcePoolsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ResourcePoolsClient) GetPreparer(ctx context.Context, regionID string, pcName string, resourcePoolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "pcName": autorest.Encode("path", pcName), + "regionId": autorest.Encode("path", regionID), + "resourcePoolName": autorest.Encode("path", resourcePoolName), + "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}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}/resourcePools/{resourcePoolName}", 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 ResourcePoolsClient) 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 ResourcePoolsClient) GetResponder(resp *http.Response) (result ResourcePool, 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 list of resource pools in region for private cloud +// Parameters: +// regionID - the region Id (westus, eastus) +// pcName - the private cloud name +func (client ResourcePoolsClient) List(ctx context.Context, regionID string, pcName string) (result ResourcePoolsListResponsePage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourcePoolsClient.List") + defer func() { + sc := -1 + if result.rplr.Response.Response != nil { + sc = result.rplr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, regionID, pcName) + if err != nil { + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.ResourcePoolsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rplr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.ResourcePoolsClient", "List", resp, "Failure sending request") + return + } + + result.rplr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.ResourcePoolsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ResourcePoolsClient) ListPreparer(ctx context.Context, regionID string, pcName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "pcName": autorest.Encode("path", pcName), + "regionId": autorest.Encode("path", regionID), + "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}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}/resourcePools", 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 ResourcePoolsClient) 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 ResourcePoolsClient) ListResponder(resp *http.Response) (result ResourcePoolsListResponse, 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 ResourcePoolsClient) listNextResults(ctx context.Context, lastResults ResourcePoolsListResponse) (result ResourcePoolsListResponse, err error) { + req, err := lastResults.resourcePoolsListResponsePreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.ResourcePoolsClient", "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, "vmwarecloudsimple.ResourcePoolsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.ResourcePoolsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ResourcePoolsClient) ListComplete(ctx context.Context, regionID string, pcName string) (result ResourcePoolsListResponseIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourcePoolsClient.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, regionID, pcName) + return +} diff --git a/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/resourcepoolsbypc.go b/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/resourcepoolsbypc.go deleted file mode 100644 index 3bfd167cd49c..000000000000 --- a/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/resourcepoolsbypc.go +++ /dev/null @@ -1,155 +0,0 @@ -package vmwarecloudsimple - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// ResourcePoolsByPCClient is the description of the new service -type ResourcePoolsByPCClient struct { - BaseClient -} - -// NewResourcePoolsByPCClient creates an instance of the ResourcePoolsByPCClient client. -func NewResourcePoolsByPCClient(referer string, regionID string, subscriptionID string) ResourcePoolsByPCClient { - return NewResourcePoolsByPCClientWithBaseURI(DefaultBaseURI, referer, regionID, subscriptionID) -} - -// NewResourcePoolsByPCClientWithBaseURI creates an instance of the ResourcePoolsByPCClient client. -func NewResourcePoolsByPCClientWithBaseURI(baseURI string, referer string, regionID string, subscriptionID string) ResourcePoolsByPCClient { - return ResourcePoolsByPCClient{NewWithBaseURI(baseURI, referer, regionID, subscriptionID)} -} - -// List returns list of resource pools in region for private cloud -// Parameters: -// pcName - the private cloud name -func (client ResourcePoolsByPCClient) List(ctx context.Context, pcName string) (result ResourcePoolsListResponsePage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourcePoolsByPCClient.List") - defer func() { - sc := -1 - if result.rplr.Response.Response != nil { - sc = result.rplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, pcName) - if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.ResourcePoolsByPCClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.rplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.ResourcePoolsByPCClient", "List", resp, "Failure sending request") - return - } - - result.rplr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.ResourcePoolsByPCClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client ResourcePoolsByPCClient) ListPreparer(ctx context.Context, pcName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "pcName": autorest.Encode("path", pcName), - "regionId": autorest.Encode("path", client.RegionID), - "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}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}/resourcePools", 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 ResourcePoolsByPCClient) 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 ResourcePoolsByPCClient) ListResponder(resp *http.Response) (result ResourcePoolsListResponse, 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 ResourcePoolsByPCClient) listNextResults(ctx context.Context, lastResults ResourcePoolsListResponse) (result ResourcePoolsListResponse, err error) { - req, err := lastResults.resourcePoolsListResponsePreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.ResourcePoolsByPCClient", "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, "vmwarecloudsimple.ResourcePoolsByPCClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.ResourcePoolsByPCClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ResourcePoolsByPCClient) ListComplete(ctx context.Context, pcName string) (result ResourcePoolsListResponseIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourcePoolsByPCClient.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, pcName) - return -} diff --git a/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/skusavailabilitywithinregion.go b/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/skusavailability.go similarity index 60% rename from services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/skusavailabilitywithinregion.go rename to services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/skusavailability.go index 4097676d454a..e21ebca4196d 100644 --- a/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/skusavailabilitywithinregion.go +++ b/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/skusavailability.go @@ -25,28 +25,28 @@ import ( "net/http" ) -// SkusAvailabilityWithinRegionClient is the description of the new service -type SkusAvailabilityWithinRegionClient struct { +// SkusAvailabilityClient is the description of the new service +type SkusAvailabilityClient struct { BaseClient } -// NewSkusAvailabilityWithinRegionClient creates an instance of the SkusAvailabilityWithinRegionClient client. -func NewSkusAvailabilityWithinRegionClient(referer string, regionID string, subscriptionID string) SkusAvailabilityWithinRegionClient { - return NewSkusAvailabilityWithinRegionClientWithBaseURI(DefaultBaseURI, referer, regionID, subscriptionID) +// NewSkusAvailabilityClient creates an instance of the SkusAvailabilityClient client. +func NewSkusAvailabilityClient(subscriptionID string, referer string) SkusAvailabilityClient { + return NewSkusAvailabilityClientWithBaseURI(DefaultBaseURI, subscriptionID, referer) } -// NewSkusAvailabilityWithinRegionClientWithBaseURI creates an instance of the SkusAvailabilityWithinRegionClient -// client. -func NewSkusAvailabilityWithinRegionClientWithBaseURI(baseURI string, referer string, regionID string, subscriptionID string) SkusAvailabilityWithinRegionClient { - return SkusAvailabilityWithinRegionClient{NewWithBaseURI(baseURI, referer, regionID, subscriptionID)} +// NewSkusAvailabilityClientWithBaseURI creates an instance of the SkusAvailabilityClient client. +func NewSkusAvailabilityClientWithBaseURI(baseURI string, subscriptionID string, referer string) SkusAvailabilityClient { + return SkusAvailabilityClient{NewWithBaseURI(baseURI, subscriptionID, referer)} } // List returns list of available resources in region // Parameters: +// regionID - the region Id (westus, eastus) // skuID - sku id, if no sku is passed availability for all skus will be returned -func (client SkusAvailabilityWithinRegionClient) List(ctx context.Context, skuID string) (result SkuAvailabilityListResponsePage, err error) { +func (client SkusAvailabilityClient) List(ctx context.Context, regionID string, skuID string) (result SkuAvailabilityListResponsePage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SkusAvailabilityWithinRegionClient.List") + ctx = tracing.StartSpan(ctx, fqdn+"/SkusAvailabilityClient.List") defer func() { sc := -1 if result.salr.Response.Response != nil { @@ -56,31 +56,31 @@ func (client SkusAvailabilityWithinRegionClient) List(ctx context.Context, skuID }() } result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, skuID) + req, err := client.ListPreparer(ctx, regionID, skuID) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.SkusAvailabilityWithinRegionClient", "List", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.SkusAvailabilityClient", "List", nil, "Failure preparing request") return } resp, err := client.ListSender(req) if err != nil { result.salr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.SkusAvailabilityWithinRegionClient", "List", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.SkusAvailabilityClient", "List", resp, "Failure sending request") return } result.salr, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.SkusAvailabilityWithinRegionClient", "List", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.SkusAvailabilityClient", "List", resp, "Failure responding to request") } return } // ListPreparer prepares the List request. -func (client SkusAvailabilityWithinRegionClient) ListPreparer(ctx context.Context, skuID string) (*http.Request, error) { +func (client SkusAvailabilityClient) ListPreparer(ctx context.Context, regionID string, skuID string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "regionId": autorest.Encode("path", client.RegionID), + "regionId": autorest.Encode("path", regionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -102,14 +102,14 @@ func (client SkusAvailabilityWithinRegionClient) ListPreparer(ctx context.Contex // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. -func (client SkusAvailabilityWithinRegionClient) ListSender(req *http.Request) (*http.Response, error) { +func (client SkusAvailabilityClient) 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 SkusAvailabilityWithinRegionClient) ListResponder(resp *http.Response) (result SkuAvailabilityListResponse, err error) { +func (client SkusAvailabilityClient) ListResponder(resp *http.Response) (result SkuAvailabilityListResponse, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -121,10 +121,10 @@ func (client SkusAvailabilityWithinRegionClient) ListResponder(resp *http.Respon } // listNextResults retrieves the next set of results, if any. -func (client SkusAvailabilityWithinRegionClient) listNextResults(ctx context.Context, lastResults SkuAvailabilityListResponse) (result SkuAvailabilityListResponse, err error) { +func (client SkusAvailabilityClient) listNextResults(ctx context.Context, lastResults SkuAvailabilityListResponse) (result SkuAvailabilityListResponse, err error) { req, err := lastResults.skuAvailabilityListResponsePreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.SkusAvailabilityWithinRegionClient", "listNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.SkusAvailabilityClient", "listNextResults", nil, "Failure preparing next results request") } if req == nil { return @@ -132,19 +132,19 @@ func (client SkusAvailabilityWithinRegionClient) listNextResults(ctx context.Con resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.SkusAvailabilityWithinRegionClient", "listNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.SkusAvailabilityClient", "listNextResults", resp, "Failure sending next results request") } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.SkusAvailabilityWithinRegionClient", "listNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.SkusAvailabilityClient", "listNextResults", resp, "Failure responding to next results request") } return } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client SkusAvailabilityWithinRegionClient) ListComplete(ctx context.Context, skuID string) (result SkuAvailabilityListResponseIterator, err error) { +func (client SkusAvailabilityClient) ListComplete(ctx context.Context, regionID string, skuID string) (result SkuAvailabilityListResponseIterator, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SkusAvailabilityWithinRegionClient.List") + ctx = tracing.StartSpan(ctx, fqdn+"/SkusAvailabilityClient.List") defer func() { sc := -1 if result.Response().Response.Response != nil { @@ -153,6 +153,6 @@ func (client SkusAvailabilityWithinRegionClient) ListComplete(ctx context.Contex tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.List(ctx, skuID) + result.page, err = client.List(ctx, regionID, skuID) return } diff --git a/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/usageswithinregion.go b/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/usages.go similarity index 64% rename from services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/usageswithinregion.go rename to services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/usages.go index faed1f6ebce5..71300088db19 100644 --- a/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/usageswithinregion.go +++ b/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/usages.go @@ -25,28 +25,29 @@ import ( "net/http" ) -// UsagesWithinRegionClient is the description of the new service -type UsagesWithinRegionClient struct { +// UsagesClient is the description of the new service +type UsagesClient struct { BaseClient } -// NewUsagesWithinRegionClient creates an instance of the UsagesWithinRegionClient client. -func NewUsagesWithinRegionClient(referer string, regionID string, subscriptionID string) UsagesWithinRegionClient { - return NewUsagesWithinRegionClientWithBaseURI(DefaultBaseURI, referer, regionID, subscriptionID) +// NewUsagesClient creates an instance of the UsagesClient client. +func NewUsagesClient(subscriptionID string, referer string) UsagesClient { + return NewUsagesClientWithBaseURI(DefaultBaseURI, subscriptionID, referer) } -// NewUsagesWithinRegionClientWithBaseURI creates an instance of the UsagesWithinRegionClient client. -func NewUsagesWithinRegionClientWithBaseURI(baseURI string, referer string, regionID string, subscriptionID string) UsagesWithinRegionClient { - return UsagesWithinRegionClient{NewWithBaseURI(baseURI, referer, regionID, subscriptionID)} +// NewUsagesClientWithBaseURI creates an instance of the UsagesClient client. +func NewUsagesClientWithBaseURI(baseURI string, subscriptionID string, referer string) UsagesClient { + return UsagesClient{NewWithBaseURI(baseURI, subscriptionID, referer)} } // List returns list of usage in region // Parameters: +// regionID - the region Id (westus, eastus) // filter - the filter to apply on the list operation. only name.value is allowed here as a filter e.g. // $filter=name.value eq 'xxxx' -func (client UsagesWithinRegionClient) List(ctx context.Context, filter string) (result UsageListResponsePage, err error) { +func (client UsagesClient) List(ctx context.Context, regionID string, filter string) (result UsageListResponsePage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/UsagesWithinRegionClient.List") + ctx = tracing.StartSpan(ctx, fqdn+"/UsagesClient.List") defer func() { sc := -1 if result.ulr.Response.Response != nil { @@ -56,31 +57,31 @@ func (client UsagesWithinRegionClient) List(ctx context.Context, filter string) }() } result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, filter) + req, err := client.ListPreparer(ctx, regionID, filter) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.UsagesWithinRegionClient", "List", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.UsagesClient", "List", nil, "Failure preparing request") return } resp, err := client.ListSender(req) if err != nil { result.ulr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.UsagesWithinRegionClient", "List", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.UsagesClient", "List", resp, "Failure sending request") return } result.ulr, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.UsagesWithinRegionClient", "List", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.UsagesClient", "List", resp, "Failure responding to request") } return } // ListPreparer prepares the List request. -func (client UsagesWithinRegionClient) ListPreparer(ctx context.Context, filter string) (*http.Request, error) { +func (client UsagesClient) ListPreparer(ctx context.Context, regionID string, filter string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "regionId": autorest.Encode("path", client.RegionID), + "regionId": autorest.Encode("path", regionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -102,14 +103,14 @@ func (client UsagesWithinRegionClient) ListPreparer(ctx context.Context, filter // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. -func (client UsagesWithinRegionClient) ListSender(req *http.Request) (*http.Response, error) { +func (client UsagesClient) 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 UsagesWithinRegionClient) ListResponder(resp *http.Response) (result UsageListResponse, err error) { +func (client UsagesClient) ListResponder(resp *http.Response) (result UsageListResponse, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -121,10 +122,10 @@ func (client UsagesWithinRegionClient) ListResponder(resp *http.Response) (resul } // listNextResults retrieves the next set of results, if any. -func (client UsagesWithinRegionClient) listNextResults(ctx context.Context, lastResults UsageListResponse) (result UsageListResponse, err error) { +func (client UsagesClient) listNextResults(ctx context.Context, lastResults UsageListResponse) (result UsageListResponse, err error) { req, err := lastResults.usageListResponsePreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.UsagesWithinRegionClient", "listNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.UsagesClient", "listNextResults", nil, "Failure preparing next results request") } if req == nil { return @@ -132,19 +133,19 @@ func (client UsagesWithinRegionClient) listNextResults(ctx context.Context, last resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.UsagesWithinRegionClient", "listNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.UsagesClient", "listNextResults", resp, "Failure sending next results request") } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.UsagesWithinRegionClient", "listNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.UsagesClient", "listNextResults", resp, "Failure responding to next results request") } return } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client UsagesWithinRegionClient) ListComplete(ctx context.Context, filter string) (result UsageListResponseIterator, err error) { +func (client UsagesClient) ListComplete(ctx context.Context, regionID string, filter string) (result UsageListResponseIterator, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/UsagesWithinRegionClient.List") + ctx = tracing.StartSpan(ctx, fqdn+"/UsagesClient.List") defer func() { sc := -1 if result.Response().Response.Response != nil { @@ -153,6 +154,6 @@ func (client UsagesWithinRegionClient) ListComplete(ctx context.Context, filter tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.List(ctx, filter) + result.page, err = client.List(ctx, regionID, filter) return } diff --git a/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/virtualmachine.go b/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/virtualmachines.go similarity index 74% rename from services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/virtualmachine.go rename to services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/virtualmachines.go index 47b48f6a22ae..8670e61ce367 100644 --- a/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/virtualmachine.go +++ b/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/virtualmachines.go @@ -26,19 +26,19 @@ import ( "net/http" ) -// VirtualMachineClient is the description of the new service -type VirtualMachineClient struct { +// VirtualMachinesClient is the description of the new service +type VirtualMachinesClient struct { BaseClient } -// NewVirtualMachineClient creates an instance of the VirtualMachineClient client. -func NewVirtualMachineClient(referer string, regionID string, subscriptionID string) VirtualMachineClient { - return NewVirtualMachineClientWithBaseURI(DefaultBaseURI, referer, regionID, subscriptionID) +// NewVirtualMachinesClient creates an instance of the VirtualMachinesClient client. +func NewVirtualMachinesClient(subscriptionID string, referer string) VirtualMachinesClient { + return NewVirtualMachinesClientWithBaseURI(DefaultBaseURI, subscriptionID, referer) } -// NewVirtualMachineClientWithBaseURI creates an instance of the VirtualMachineClient client. -func NewVirtualMachineClientWithBaseURI(baseURI string, referer string, regionID string, subscriptionID string) VirtualMachineClient { - return VirtualMachineClient{NewWithBaseURI(baseURI, referer, regionID, subscriptionID)} +// NewVirtualMachinesClientWithBaseURI creates an instance of the VirtualMachinesClient client. +func NewVirtualMachinesClientWithBaseURI(baseURI string, subscriptionID string, referer string) VirtualMachinesClient { + return VirtualMachinesClient{NewWithBaseURI(baseURI, subscriptionID, referer)} } // CreateOrUpdate create Or Update Virtual Machine @@ -46,9 +46,9 @@ func NewVirtualMachineClientWithBaseURI(baseURI string, referer string, regionID // resourceGroupName - the name of the resource group // virtualMachineName - virtual machine name // virtualMachineRequest - create or Update Virtual Machine request -func (client VirtualMachineClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualMachineName string, virtualMachineRequest VirtualMachine) (result VirtualMachineCreateOrUpdateFuture, err error) { +func (client VirtualMachinesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualMachineName string, virtualMachineRequest VirtualMachine) (result VirtualMachinesCreateOrUpdateFuture, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineClient.CreateOrUpdate") + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.CreateOrUpdate") defer func() { sc := -1 if result.Response() != nil { @@ -59,31 +59,30 @@ func (client VirtualMachineClient) CreateOrUpdate(ctx context.Context, resourceG } if err := validation.Validate([]validation.Validation{ {TargetValue: virtualMachineName, - Constraints: []validation.Constraint{{Target: "virtualMachineName", Name: validation.Pattern, Rule: `^[-a-zA-Z0-9]+$`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "virtualMachineName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]([-_.a-zA-Z0-9]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: virtualMachineRequest, Constraints: []validation.Constraint{{Target: "virtualMachineRequest.Location", Name: validation.Null, Rule: true, Chain: nil}, {Target: "virtualMachineRequest.Name", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "virtualMachineRequest.Name", Name: validation.Pattern, Rule: `^[-a-zA-Z0-9]+$`, Chain: nil}}}, + Chain: []validation.Constraint{{Target: "virtualMachineRequest.Name", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]([-_.a-zA-Z0-9]*[a-zA-Z0-9])?$`, Chain: nil}}}, {Target: "virtualMachineRequest.VirtualMachineProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "virtualMachineRequest.VirtualMachineProperties.AmountOfRAM", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "virtualMachineRequest.VirtualMachineProperties.GuestOS", Name: validation.Null, Rule: true, Chain: nil}, {Target: "virtualMachineRequest.VirtualMachineProperties.NumberOfCores", Name: validation.Null, Rule: true, Chain: nil}, {Target: "virtualMachineRequest.VirtualMachineProperties.PrivateCloudID", Name: validation.Null, Rule: true, Chain: nil}, {Target: "virtualMachineRequest.VirtualMachineProperties.ResourcePool", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "virtualMachineRequest.VirtualMachineProperties.ResourcePool.ID", Name: validation.Null, Rule: true, Chain: nil}}}, }}}}}); err != nil { - return result, validation.NewError("vmwarecloudsimple.VirtualMachineClient", "CreateOrUpdate", err.Error()) + return result, validation.NewError("vmwarecloudsimple.VirtualMachinesClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualMachineName, virtualMachineRequest) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineClient", "CreateOrUpdate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachinesClient", "CreateOrUpdate", nil, "Failure preparing request") return } result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachinesClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -91,7 +90,7 @@ func (client VirtualMachineClient) CreateOrUpdate(ctx context.Context, resourceG } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualMachineClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, virtualMachineName string, virtualMachineRequest VirtualMachine) (*http.Request, error) { +func (client VirtualMachinesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, virtualMachineName string, virtualMachineRequest VirtualMachine) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -119,7 +118,7 @@ func (client VirtualMachineClient) CreateOrUpdatePreparer(ctx context.Context, r // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. -func (client VirtualMachineClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachineCreateOrUpdateFuture, err error) { +func (client VirtualMachinesClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachinesCreateOrUpdateFuture, err error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) var resp *http.Response resp, err = autorest.SendWithSender(client, req, sd...) @@ -132,7 +131,7 @@ func (client VirtualMachineClient) CreateOrUpdateSender(req *http.Request) (futu // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always // closes the http.Response Body. -func (client VirtualMachineClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachine, err error) { +func (client VirtualMachinesClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachine, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -147,9 +146,9 @@ func (client VirtualMachineClient) CreateOrUpdateResponder(resp *http.Response) // Parameters: // resourceGroupName - the name of the resource group // virtualMachineName - virtual machine name -func (client VirtualMachineClient) Delete(ctx context.Context, resourceGroupName string, virtualMachineName string) (result VirtualMachineDeleteFuture, err error) { +func (client VirtualMachinesClient) Delete(ctx context.Context, resourceGroupName string, virtualMachineName string) (result VirtualMachinesDeleteFuture, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineClient.Delete") + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Delete") defer func() { sc := -1 if result.Response() != nil { @@ -160,13 +159,13 @@ func (client VirtualMachineClient) Delete(ctx context.Context, resourceGroupName } req, err := client.DeletePreparer(ctx, resourceGroupName, virtualMachineName) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineClient", "Delete", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachinesClient", "Delete", nil, "Failure preparing request") return } result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachinesClient", "Delete", result.Response(), "Failure sending request") return } @@ -174,7 +173,7 @@ func (client VirtualMachineClient) Delete(ctx context.Context, resourceGroupName } // DeletePreparer prepares the Delete request. -func (client VirtualMachineClient) DeletePreparer(ctx context.Context, resourceGroupName string, virtualMachineName string) (*http.Request, error) { +func (client VirtualMachinesClient) DeletePreparer(ctx context.Context, resourceGroupName string, virtualMachineName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -197,7 +196,7 @@ func (client VirtualMachineClient) DeletePreparer(ctx context.Context, resourceG // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. -func (client VirtualMachineClient) DeleteSender(req *http.Request) (future VirtualMachineDeleteFuture, err error) { +func (client VirtualMachinesClient) DeleteSender(req *http.Request) (future VirtualMachinesDeleteFuture, err error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) var resp *http.Response resp, err = autorest.SendWithSender(client, req, sd...) @@ -210,7 +209,7 @@ func (client VirtualMachineClient) DeleteSender(req *http.Request) (future Virtu // DeleteResponder handles the response to the Delete request. The method always // closes the http.Response Body. -func (client VirtualMachineClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { +func (client VirtualMachinesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -224,9 +223,9 @@ func (client VirtualMachineClient) DeleteResponder(resp *http.Response) (result // Parameters: // resourceGroupName - the name of the resource group // virtualMachineName - virtual machine name -func (client VirtualMachineClient) Get(ctx context.Context, resourceGroupName string, virtualMachineName string) (result VirtualMachine, err error) { +func (client VirtualMachinesClient) Get(ctx context.Context, resourceGroupName string, virtualMachineName string) (result VirtualMachine, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineClient.Get") + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Get") defer func() { sc := -1 if result.Response.Response != nil { @@ -237,27 +236,27 @@ func (client VirtualMachineClient) Get(ctx context.Context, resourceGroupName st } req, err := client.GetPreparer(ctx, resourceGroupName, virtualMachineName) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachinesClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachinesClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachinesClient", "Get", resp, "Failure responding to request") } return } // GetPreparer prepares the Get request. -func (client VirtualMachineClient) GetPreparer(ctx context.Context, resourceGroupName string, virtualMachineName string) (*http.Request, error) { +func (client VirtualMachinesClient) GetPreparer(ctx context.Context, resourceGroupName string, virtualMachineName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -279,14 +278,14 @@ func (client VirtualMachineClient) GetPreparer(ctx context.Context, resourceGrou // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. -func (client VirtualMachineClient) GetSender(req *http.Request) (*http.Response, error) { +func (client VirtualMachinesClient) 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 VirtualMachineClient) GetResponder(resp *http.Response) (result VirtualMachine, err error) { +func (client VirtualMachinesClient) GetResponder(resp *http.Response) (result VirtualMachine, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -303,9 +302,9 @@ func (client VirtualMachineClient) GetResponder(resp *http.Response) (result Vir // filter - the filter to apply on the list operation // top - the maximum number of record sets to return // skipToken - to be used by nextLink implementation -func (client VirtualMachineClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string, top *int32, skipToken string) (result VirtualMachineListResponsePage, err error) { +func (client VirtualMachinesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string, top *int32, skipToken string) (result VirtualMachineListResponsePage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineClient.ListByResourceGroup") + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ListByResourceGroup") defer func() { sc := -1 if result.vmlr.Response.Response != nil { @@ -317,27 +316,27 @@ func (client VirtualMachineClient) ListByResourceGroup(ctx context.Context, reso result.fn = client.listByResourceGroupNextResults req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, filter, top, skipToken) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineClient", "ListByResourceGroup", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachinesClient", "ListByResourceGroup", nil, "Failure preparing request") return } resp, err := client.ListByResourceGroupSender(req) if err != nil { result.vmlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineClient", "ListByResourceGroup", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachinesClient", "ListByResourceGroup", resp, "Failure sending request") return } result.vmlr, err = client.ListByResourceGroupResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineClient", "ListByResourceGroup", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachinesClient", "ListByResourceGroup", resp, "Failure responding to request") } return } // ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client VirtualMachineClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, filter string, top *int32, skipToken string) (*http.Request, error) { +func (client VirtualMachinesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, filter string, top *int32, skipToken string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -367,14 +366,14 @@ func (client VirtualMachineClient) ListByResourceGroupPreparer(ctx context.Conte // ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the // http.Response Body if it receives an error. -func (client VirtualMachineClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { +func (client VirtualMachinesClient) 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 VirtualMachineClient) ListByResourceGroupResponder(resp *http.Response) (result VirtualMachineListResponse, err error) { +func (client VirtualMachinesClient) ListByResourceGroupResponder(resp *http.Response) (result VirtualMachineListResponse, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -386,10 +385,10 @@ func (client VirtualMachineClient) ListByResourceGroupResponder(resp *http.Respo } // listByResourceGroupNextResults retrieves the next set of results, if any. -func (client VirtualMachineClient) listByResourceGroupNextResults(ctx context.Context, lastResults VirtualMachineListResponse) (result VirtualMachineListResponse, err error) { +func (client VirtualMachinesClient) listByResourceGroupNextResults(ctx context.Context, lastResults VirtualMachineListResponse) (result VirtualMachineListResponse, err error) { req, err := lastResults.virtualMachineListResponsePreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachinesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") } if req == nil { return @@ -397,19 +396,19 @@ func (client VirtualMachineClient) listByResourceGroupNextResults(ctx context.Co resp, err := client.ListByResourceGroupSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachinesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") } result, err = client.ListByResourceGroupResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachinesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") } return } // ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachineClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, filter string, top *int32, skipToken string) (result VirtualMachineListResponseIterator, err error) { +func (client VirtualMachinesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, filter string, top *int32, skipToken string) (result VirtualMachineListResponseIterator, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineClient.ListByResourceGroup") + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ListByResourceGroup") defer func() { sc := -1 if result.Response().Response.Response != nil { @@ -427,9 +426,9 @@ func (client VirtualMachineClient) ListByResourceGroupComplete(ctx context.Conte // filter - the filter to apply on the list operation // top - the maximum number of record sets to return // skipToken - to be used by nextLink implementation -func (client VirtualMachineClient) ListBySubscription(ctx context.Context, filter string, top *int32, skipToken string) (result VirtualMachineListResponsePage, err error) { +func (client VirtualMachinesClient) ListBySubscription(ctx context.Context, filter string, top *int32, skipToken string) (result VirtualMachineListResponsePage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineClient.ListBySubscription") + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ListBySubscription") defer func() { sc := -1 if result.vmlr.Response.Response != nil { @@ -441,27 +440,27 @@ func (client VirtualMachineClient) ListBySubscription(ctx context.Context, filte result.fn = client.listBySubscriptionNextResults req, err := client.ListBySubscriptionPreparer(ctx, filter, top, skipToken) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineClient", "ListBySubscription", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachinesClient", "ListBySubscription", nil, "Failure preparing request") return } resp, err := client.ListBySubscriptionSender(req) if err != nil { result.vmlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineClient", "ListBySubscription", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachinesClient", "ListBySubscription", resp, "Failure sending request") return } result.vmlr, err = client.ListBySubscriptionResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineClient", "ListBySubscription", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachinesClient", "ListBySubscription", resp, "Failure responding to request") } return } // ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client VirtualMachineClient) ListBySubscriptionPreparer(ctx context.Context, filter string, top *int32, skipToken string) (*http.Request, error) { +func (client VirtualMachinesClient) ListBySubscriptionPreparer(ctx context.Context, filter string, top *int32, skipToken string) (*http.Request, error) { pathParameters := map[string]interface{}{ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -490,14 +489,14 @@ func (client VirtualMachineClient) ListBySubscriptionPreparer(ctx context.Contex // ListBySubscriptionSender sends the ListBySubscription request. The method will close the // http.Response Body if it receives an error. -func (client VirtualMachineClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { +func (client VirtualMachinesClient) 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 VirtualMachineClient) ListBySubscriptionResponder(resp *http.Response) (result VirtualMachineListResponse, err error) { +func (client VirtualMachinesClient) ListBySubscriptionResponder(resp *http.Response) (result VirtualMachineListResponse, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -509,10 +508,10 @@ func (client VirtualMachineClient) ListBySubscriptionResponder(resp *http.Respon } // listBySubscriptionNextResults retrieves the next set of results, if any. -func (client VirtualMachineClient) listBySubscriptionNextResults(ctx context.Context, lastResults VirtualMachineListResponse) (result VirtualMachineListResponse, err error) { +func (client VirtualMachinesClient) listBySubscriptionNextResults(ctx context.Context, lastResults VirtualMachineListResponse) (result VirtualMachineListResponse, err error) { req, err := lastResults.virtualMachineListResponsePreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachinesClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") } if req == nil { return @@ -520,19 +519,19 @@ func (client VirtualMachineClient) listBySubscriptionNextResults(ctx context.Con resp, err := client.ListBySubscriptionSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachinesClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") } result, err = client.ListBySubscriptionResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachinesClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") } return } // ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachineClient) ListBySubscriptionComplete(ctx context.Context, filter string, top *int32, skipToken string) (result VirtualMachineListResponseIterator, err error) { +func (client VirtualMachinesClient) ListBySubscriptionComplete(ctx context.Context, filter string, top *int32, skipToken string) (result VirtualMachineListResponseIterator, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineClient.ListBySubscription") + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ListBySubscription") defer func() { sc := -1 if result.Response().Response.Response != nil { @@ -549,9 +548,9 @@ func (client VirtualMachineClient) ListBySubscriptionComplete(ctx context.Contex // Parameters: // resourceGroupName - the name of the resource group // virtualMachineName - virtual machine name -func (client VirtualMachineClient) Start(ctx context.Context, resourceGroupName string, virtualMachineName string) (result VirtualMachineStartFuture, err error) { +func (client VirtualMachinesClient) Start(ctx context.Context, resourceGroupName string, virtualMachineName string) (result VirtualMachinesStartFuture, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineClient.Start") + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Start") defer func() { sc := -1 if result.Response() != nil { @@ -562,13 +561,13 @@ func (client VirtualMachineClient) Start(ctx context.Context, resourceGroupName } req, err := client.StartPreparer(ctx, resourceGroupName, virtualMachineName) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineClient", "Start", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachinesClient", "Start", nil, "Failure preparing request") return } result, err = client.StartSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineClient", "Start", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachinesClient", "Start", result.Response(), "Failure sending request") return } @@ -576,7 +575,7 @@ func (client VirtualMachineClient) Start(ctx context.Context, resourceGroupName } // StartPreparer prepares the Start request. -func (client VirtualMachineClient) StartPreparer(ctx context.Context, resourceGroupName string, virtualMachineName string) (*http.Request, error) { +func (client VirtualMachinesClient) StartPreparer(ctx context.Context, resourceGroupName string, virtualMachineName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -599,7 +598,7 @@ func (client VirtualMachineClient) StartPreparer(ctx context.Context, resourceGr // StartSender sends the Start request. The method will close the // http.Response Body if it receives an error. -func (client VirtualMachineClient) StartSender(req *http.Request) (future VirtualMachineStartFuture, err error) { +func (client VirtualMachinesClient) StartSender(req *http.Request) (future VirtualMachinesStartFuture, err error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) var resp *http.Response resp, err = autorest.SendWithSender(client, req, sd...) @@ -612,7 +611,7 @@ func (client VirtualMachineClient) StartSender(req *http.Request) (future Virtua // StartResponder handles the response to the Start request. The method always // closes the http.Response Body. -func (client VirtualMachineClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { +func (client VirtualMachinesClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -628,9 +627,9 @@ func (client VirtualMachineClient) StartResponder(resp *http.Response) (result a // virtualMachineName - virtual machine name // mParameter - body stop mode parameter (reboot, shutdown, etc...) // mode - query stop mode parameter (reboot, shutdown, etc...) -func (client VirtualMachineClient) Stop(ctx context.Context, resourceGroupName string, virtualMachineName string, mParameter *VirtualMachineStopMode, mode StopMode) (result VirtualMachineStopFuture, err error) { +func (client VirtualMachinesClient) Stop(ctx context.Context, resourceGroupName string, virtualMachineName string, mParameter *VirtualMachineStopMode, mode StopMode) (result VirtualMachinesStopFuture, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineClient.Stop") + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Stop") defer func() { sc := -1 if result.Response() != nil { @@ -641,13 +640,13 @@ func (client VirtualMachineClient) Stop(ctx context.Context, resourceGroupName s } req, err := client.StopPreparer(ctx, resourceGroupName, virtualMachineName, mParameter, mode) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineClient", "Stop", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachinesClient", "Stop", nil, "Failure preparing request") return } result, err = client.StopSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineClient", "Stop", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachinesClient", "Stop", result.Response(), "Failure sending request") return } @@ -655,7 +654,7 @@ func (client VirtualMachineClient) Stop(ctx context.Context, resourceGroupName s } // StopPreparer prepares the Stop request. -func (client VirtualMachineClient) StopPreparer(ctx context.Context, resourceGroupName string, virtualMachineName string, mParameter *VirtualMachineStopMode, mode StopMode) (*http.Request, error) { +func (client VirtualMachinesClient) StopPreparer(ctx context.Context, resourceGroupName string, virtualMachineName string, mParameter *VirtualMachineStopMode, mode StopMode) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -686,7 +685,7 @@ func (client VirtualMachineClient) StopPreparer(ctx context.Context, resourceGro // StopSender sends the Stop request. The method will close the // http.Response Body if it receives an error. -func (client VirtualMachineClient) StopSender(req *http.Request) (future VirtualMachineStopFuture, err error) { +func (client VirtualMachinesClient) StopSender(req *http.Request) (future VirtualMachinesStopFuture, err error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) var resp *http.Response resp, err = autorest.SendWithSender(client, req, sd...) @@ -699,7 +698,7 @@ func (client VirtualMachineClient) StopSender(req *http.Request) (future Virtual // StopResponder handles the response to the Stop request. The method always // closes the http.Response Body. -func (client VirtualMachineClient) StopResponder(resp *http.Response) (result autorest.Response, err error) { +func (client VirtualMachinesClient) StopResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -714,9 +713,9 @@ func (client VirtualMachineClient) StopResponder(resp *http.Response) (result au // resourceGroupName - the name of the resource group // virtualMachineName - virtual machine name // virtualMachineRequest - patch virtual machine request -func (client VirtualMachineClient) Update(ctx context.Context, resourceGroupName string, virtualMachineName string, virtualMachineRequest PatchPayload) (result VirtualMachineUpdateFuture, err error) { +func (client VirtualMachinesClient) Update(ctx context.Context, resourceGroupName string, virtualMachineName string, virtualMachineRequest PatchPayload) (result VirtualMachinesUpdateFuture, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineClient.Update") + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Update") defer func() { sc := -1 if result.Response() != nil { @@ -727,13 +726,13 @@ func (client VirtualMachineClient) Update(ctx context.Context, resourceGroupName } req, err := client.UpdatePreparer(ctx, resourceGroupName, virtualMachineName, virtualMachineRequest) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineClient", "Update", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachinesClient", "Update", nil, "Failure preparing request") return } result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineClient", "Update", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachinesClient", "Update", result.Response(), "Failure sending request") return } @@ -741,7 +740,7 @@ func (client VirtualMachineClient) Update(ctx context.Context, resourceGroupName } // UpdatePreparer prepares the Update request. -func (client VirtualMachineClient) UpdatePreparer(ctx context.Context, resourceGroupName string, virtualMachineName string, virtualMachineRequest PatchPayload) (*http.Request, error) { +func (client VirtualMachinesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, virtualMachineName string, virtualMachineRequest PatchPayload) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -765,7 +764,7 @@ func (client VirtualMachineClient) UpdatePreparer(ctx context.Context, resourceG // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. -func (client VirtualMachineClient) UpdateSender(req *http.Request) (future VirtualMachineUpdateFuture, err error) { +func (client VirtualMachinesClient) UpdateSender(req *http.Request) (future VirtualMachinesUpdateFuture, err error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) var resp *http.Response resp, err = autorest.SendWithSender(client, req, sd...) @@ -778,7 +777,7 @@ func (client VirtualMachineClient) UpdateSender(req *http.Request) (future Virtu // UpdateResponder handles the response to the Update request. The method always // closes the http.Response Body. -func (client VirtualMachineClient) UpdateResponder(resp *http.Response) (result VirtualMachine, err error) { +func (client VirtualMachinesClient) UpdateResponder(resp *http.Response) (result VirtualMachine, err error) { err = autorest.Respond( resp, client.ByInspecting(), diff --git a/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/virtualmachinetemplatebypc.go b/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/virtualmachinetemplatebypc.go deleted file mode 100644 index 56bfb9e4816a..000000000000 --- a/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/virtualmachinetemplatebypc.go +++ /dev/null @@ -1,119 +0,0 @@ -package vmwarecloudsimple - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// VirtualMachineTemplateByPCClient is the description of the new service -type VirtualMachineTemplateByPCClient struct { - BaseClient -} - -// NewVirtualMachineTemplateByPCClient creates an instance of the VirtualMachineTemplateByPCClient client. -func NewVirtualMachineTemplateByPCClient(referer string, regionID string, subscriptionID string) VirtualMachineTemplateByPCClient { - return NewVirtualMachineTemplateByPCClientWithBaseURI(DefaultBaseURI, referer, regionID, subscriptionID) -} - -// NewVirtualMachineTemplateByPCClientWithBaseURI creates an instance of the VirtualMachineTemplateByPCClient client. -func NewVirtualMachineTemplateByPCClientWithBaseURI(baseURI string, referer string, regionID string, subscriptionID string) VirtualMachineTemplateByPCClient { - return VirtualMachineTemplateByPCClient{NewWithBaseURI(baseURI, referer, regionID, subscriptionID)} -} - -// Get returns virtual machine templates by its name -// Parameters: -// pcName - the private cloud name -// virtualMachineTemplateName - virtual machine template id (vsphereId) -func (client VirtualMachineTemplateByPCClient) Get(ctx context.Context, pcName string, virtualMachineTemplateName string) (result VirtualMachineTemplate, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineTemplateByPCClient.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, pcName, virtualMachineTemplateName) - if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineTemplateByPCClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineTemplateByPCClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineTemplateByPCClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualMachineTemplateByPCClient) GetPreparer(ctx context.Context, pcName string, virtualMachineTemplateName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "pcName": autorest.Encode("path", pcName), - "regionId": autorest.Encode("path", client.RegionID), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualMachineTemplateName": autorest.Encode("path", virtualMachineTemplateName), - } - - 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}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}/virtualMachineTemplates/{virtualMachineTemplateName}", 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 VirtualMachineTemplateByPCClient) 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 VirtualMachineTemplateByPCClient) GetResponder(resp *http.Response) (result VirtualMachineTemplate, 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/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/virtualmachinetemplates.go b/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/virtualmachinetemplates.go new file mode 100644 index 000000000000..ef66d5e2d6aa --- /dev/null +++ b/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/virtualmachinetemplates.go @@ -0,0 +1,237 @@ +package vmwarecloudsimple + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if 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" +) + +// VirtualMachineTemplatesClient is the description of the new service +type VirtualMachineTemplatesClient struct { + BaseClient +} + +// NewVirtualMachineTemplatesClient creates an instance of the VirtualMachineTemplatesClient client. +func NewVirtualMachineTemplatesClient(subscriptionID string, referer string) VirtualMachineTemplatesClient { + return NewVirtualMachineTemplatesClientWithBaseURI(DefaultBaseURI, subscriptionID, referer) +} + +// NewVirtualMachineTemplatesClientWithBaseURI creates an instance of the VirtualMachineTemplatesClient client. +func NewVirtualMachineTemplatesClientWithBaseURI(baseURI string, subscriptionID string, referer string) VirtualMachineTemplatesClient { + return VirtualMachineTemplatesClient{NewWithBaseURI(baseURI, subscriptionID, referer)} +} + +// Get returns virtual machine templates by its name +// Parameters: +// regionID - the region Id (westus, eastus) +// pcName - the private cloud name +// virtualMachineTemplateName - virtual machine template id (vsphereId) +func (client VirtualMachineTemplatesClient) Get(ctx context.Context, regionID string, pcName string, virtualMachineTemplateName string) (result VirtualMachineTemplate, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineTemplatesClient.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, regionID, pcName, virtualMachineTemplateName) + if err != nil { + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineTemplatesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineTemplatesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineTemplatesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client VirtualMachineTemplatesClient) GetPreparer(ctx context.Context, regionID string, pcName string, virtualMachineTemplateName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "pcName": autorest.Encode("path", pcName), + "regionId": autorest.Encode("path", regionID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualMachineTemplateName": autorest.Encode("path", virtualMachineTemplateName), + } + + 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}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}/virtualMachineTemplates/{virtualMachineTemplateName}", 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 VirtualMachineTemplatesClient) 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 VirtualMachineTemplatesClient) GetResponder(resp *http.Response) (result VirtualMachineTemplate, 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 list of virtual machine templates in region for private cloud +// Parameters: +// pcName - the private cloud name +// regionID - the region Id (westus, eastus) +// resourcePoolName - resource pool used to derive vSphere cluster which contains VM templates +func (client VirtualMachineTemplatesClient) List(ctx context.Context, pcName string, regionID string, resourcePoolName string) (result VirtualMachineTemplateListResponsePage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineTemplatesClient.List") + defer func() { + sc := -1 + if result.vmtlr.Response.Response != nil { + sc = result.vmtlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, pcName, regionID, resourcePoolName) + if err != nil { + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineTemplatesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.vmtlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineTemplatesClient", "List", resp, "Failure sending request") + return + } + + result.vmtlr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineTemplatesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client VirtualMachineTemplatesClient) ListPreparer(ctx context.Context, pcName string, regionID string, resourcePoolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "pcName": autorest.Encode("path", pcName), + "regionId": autorest.Encode("path", regionID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "resourcePoolName": autorest.Encode("query", resourcePoolName), + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}/virtualMachineTemplates", 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 VirtualMachineTemplatesClient) 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 VirtualMachineTemplatesClient) ListResponder(resp *http.Response) (result VirtualMachineTemplateListResponse, 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 VirtualMachineTemplatesClient) listNextResults(ctx context.Context, lastResults VirtualMachineTemplateListResponse) (result VirtualMachineTemplateListResponse, err error) { + req, err := lastResults.virtualMachineTemplateListResponsePreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineTemplatesClient", "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, "vmwarecloudsimple.VirtualMachineTemplatesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineTemplatesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client VirtualMachineTemplatesClient) ListComplete(ctx context.Context, pcName string, regionID string, resourcePoolName string) (result VirtualMachineTemplateListResponseIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineTemplatesClient.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, pcName, regionID, resourcePoolName) + return +} diff --git a/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/virtualmachinetemplatesbypc.go b/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/virtualmachinetemplatesbypc.go deleted file mode 100644 index 451c778e3c4b..000000000000 --- a/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/virtualmachinetemplatesbypc.go +++ /dev/null @@ -1,157 +0,0 @@ -package vmwarecloudsimple - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// VirtualMachineTemplatesByPCClient is the description of the new service -type VirtualMachineTemplatesByPCClient struct { - BaseClient -} - -// NewVirtualMachineTemplatesByPCClient creates an instance of the VirtualMachineTemplatesByPCClient client. -func NewVirtualMachineTemplatesByPCClient(referer string, regionID string, subscriptionID string) VirtualMachineTemplatesByPCClient { - return NewVirtualMachineTemplatesByPCClientWithBaseURI(DefaultBaseURI, referer, regionID, subscriptionID) -} - -// NewVirtualMachineTemplatesByPCClientWithBaseURI creates an instance of the VirtualMachineTemplatesByPCClient client. -func NewVirtualMachineTemplatesByPCClientWithBaseURI(baseURI string, referer string, regionID string, subscriptionID string) VirtualMachineTemplatesByPCClient { - return VirtualMachineTemplatesByPCClient{NewWithBaseURI(baseURI, referer, regionID, subscriptionID)} -} - -// List returns list of virtual machine templates in region for private cloud -// Parameters: -// pcName - the private cloud name -// resourcePoolName - resource pool used to derive vSphere cluster which contains VM templates -func (client VirtualMachineTemplatesByPCClient) List(ctx context.Context, pcName string, resourcePoolName string) (result VirtualMachineTemplateListResponsePage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineTemplatesByPCClient.List") - defer func() { - sc := -1 - if result.vmtlr.Response.Response != nil { - sc = result.vmtlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, pcName, resourcePoolName) - if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineTemplatesByPCClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.vmtlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineTemplatesByPCClient", "List", resp, "Failure sending request") - return - } - - result.vmtlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineTemplatesByPCClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualMachineTemplatesByPCClient) ListPreparer(ctx context.Context, pcName string, resourcePoolName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "pcName": autorest.Encode("path", pcName), - "regionId": autorest.Encode("path", client.RegionID), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-04-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - "resourcePoolName": autorest.Encode("query", resourcePoolName), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}/virtualMachineTemplates", 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 VirtualMachineTemplatesByPCClient) 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 VirtualMachineTemplatesByPCClient) ListResponder(resp *http.Response) (result VirtualMachineTemplateListResponse, 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 VirtualMachineTemplatesByPCClient) listNextResults(ctx context.Context, lastResults VirtualMachineTemplateListResponse) (result VirtualMachineTemplateListResponse, err error) { - req, err := lastResults.virtualMachineTemplateListResponsePreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineTemplatesByPCClient", "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, "vmwarecloudsimple.VirtualMachineTemplatesByPCClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualMachineTemplatesByPCClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachineTemplatesByPCClient) ListComplete(ctx context.Context, pcName string, resourcePoolName string) (result VirtualMachineTemplateListResponseIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineTemplatesByPCClient.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, pcName, resourcePoolName) - return -} diff --git a/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/virtualnetworkbypc.go b/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/virtualnetworkbypc.go deleted file mode 100644 index 8d3a8aee7b7f..000000000000 --- a/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/virtualnetworkbypc.go +++ /dev/null @@ -1,119 +0,0 @@ -package vmwarecloudsimple - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// VirtualNetworkByPCClient is the description of the new service -type VirtualNetworkByPCClient struct { - BaseClient -} - -// NewVirtualNetworkByPCClient creates an instance of the VirtualNetworkByPCClient client. -func NewVirtualNetworkByPCClient(referer string, regionID string, subscriptionID string) VirtualNetworkByPCClient { - return NewVirtualNetworkByPCClientWithBaseURI(DefaultBaseURI, referer, regionID, subscriptionID) -} - -// NewVirtualNetworkByPCClientWithBaseURI creates an instance of the VirtualNetworkByPCClient client. -func NewVirtualNetworkByPCClientWithBaseURI(baseURI string, referer string, regionID string, subscriptionID string) VirtualNetworkByPCClient { - return VirtualNetworkByPCClient{NewWithBaseURI(baseURI, referer, regionID, subscriptionID)} -} - -// Get return virtual network by its name -// Parameters: -// pcName - the private cloud name -// virtualNetworkName - virtual network id (vsphereId) -func (client VirtualNetworkByPCClient) Get(ctx context.Context, pcName string, virtualNetworkName string) (result VirtualNetwork, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkByPCClient.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, pcName, virtualNetworkName) - if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualNetworkByPCClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualNetworkByPCClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualNetworkByPCClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualNetworkByPCClient) GetPreparer(ctx context.Context, pcName string, virtualNetworkName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "pcName": autorest.Encode("path", pcName), - "regionId": autorest.Encode("path", client.RegionID), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkName": autorest.Encode("path", virtualNetworkName), - } - - 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}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}/virtualNetworks/{virtualNetworkName}", 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 VirtualNetworkByPCClient) 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 VirtualNetworkByPCClient) GetResponder(resp *http.Response) (result VirtualNetwork, 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/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/virtualnetworks.go b/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/virtualnetworks.go new file mode 100644 index 000000000000..ca2631e25aeb --- /dev/null +++ b/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/virtualnetworks.go @@ -0,0 +1,237 @@ +package vmwarecloudsimple + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if 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" +) + +// VirtualNetworksClient is the description of the new service +type VirtualNetworksClient struct { + BaseClient +} + +// NewVirtualNetworksClient creates an instance of the VirtualNetworksClient client. +func NewVirtualNetworksClient(subscriptionID string, referer string) VirtualNetworksClient { + return NewVirtualNetworksClientWithBaseURI(DefaultBaseURI, subscriptionID, referer) +} + +// NewVirtualNetworksClientWithBaseURI creates an instance of the VirtualNetworksClient client. +func NewVirtualNetworksClientWithBaseURI(baseURI string, subscriptionID string, referer string) VirtualNetworksClient { + return VirtualNetworksClient{NewWithBaseURI(baseURI, subscriptionID, referer)} +} + +// Get return virtual network by its name +// Parameters: +// regionID - the region Id (westus, eastus) +// pcName - the private cloud name +// virtualNetworkName - virtual network id (vsphereId) +func (client VirtualNetworksClient) Get(ctx context.Context, regionID string, pcName string, virtualNetworkName string) (result VirtualNetwork, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworksClient.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, regionID, pcName, virtualNetworkName) + if err != nil { + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualNetworksClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualNetworksClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualNetworksClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client VirtualNetworksClient) GetPreparer(ctx context.Context, regionID string, pcName string, virtualNetworkName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "pcName": autorest.Encode("path", pcName), + "regionId": autorest.Encode("path", regionID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualNetworkName": autorest.Encode("path", virtualNetworkName), + } + + 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}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}/virtualNetworks/{virtualNetworkName}", 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 VirtualNetworksClient) 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 VirtualNetworksClient) GetResponder(resp *http.Response) (result VirtualNetwork, 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 return list of virtual networks in location for private cloud +// Parameters: +// regionID - the region Id (westus, eastus) +// pcName - the private cloud name +// resourcePoolName - resource pool used to derive vSphere cluster which contains virtual networks +func (client VirtualNetworksClient) List(ctx context.Context, regionID string, pcName string, resourcePoolName string) (result VirtualNetworkListResponsePage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworksClient.List") + defer func() { + sc := -1 + if result.vnlr.Response.Response != nil { + sc = result.vnlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, regionID, pcName, resourcePoolName) + if err != nil { + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualNetworksClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.vnlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualNetworksClient", "List", resp, "Failure sending request") + return + } + + result.vnlr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualNetworksClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client VirtualNetworksClient) ListPreparer(ctx context.Context, regionID string, pcName string, resourcePoolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "pcName": autorest.Encode("path", pcName), + "regionId": autorest.Encode("path", regionID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "resourcePoolName": autorest.Encode("query", resourcePoolName), + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}/virtualNetworks", 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 VirtualNetworksClient) 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 VirtualNetworksClient) ListResponder(resp *http.Response) (result VirtualNetworkListResponse, 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 VirtualNetworksClient) listNextResults(ctx context.Context, lastResults VirtualNetworkListResponse) (result VirtualNetworkListResponse, err error) { + req, err := lastResults.virtualNetworkListResponsePreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualNetworksClient", "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, "vmwarecloudsimple.VirtualNetworksClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualNetworksClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client VirtualNetworksClient) ListComplete(ctx context.Context, regionID string, pcName string, resourcePoolName string) (result VirtualNetworkListResponseIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworksClient.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, regionID, pcName, resourcePoolName) + return +} diff --git a/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/virtualnetworksbypc.go b/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/virtualnetworksbypc.go deleted file mode 100644 index 73c398498275..000000000000 --- a/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/virtualnetworksbypc.go +++ /dev/null @@ -1,157 +0,0 @@ -package vmwarecloudsimple - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if 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" -) - -// VirtualNetworksByPCClient is the description of the new service -type VirtualNetworksByPCClient struct { - BaseClient -} - -// NewVirtualNetworksByPCClient creates an instance of the VirtualNetworksByPCClient client. -func NewVirtualNetworksByPCClient(referer string, regionID string, subscriptionID string) VirtualNetworksByPCClient { - return NewVirtualNetworksByPCClientWithBaseURI(DefaultBaseURI, referer, regionID, subscriptionID) -} - -// NewVirtualNetworksByPCClientWithBaseURI creates an instance of the VirtualNetworksByPCClient client. -func NewVirtualNetworksByPCClientWithBaseURI(baseURI string, referer string, regionID string, subscriptionID string) VirtualNetworksByPCClient { - return VirtualNetworksByPCClient{NewWithBaseURI(baseURI, referer, regionID, subscriptionID)} -} - -// List return list of virtual networks in location for private cloud -// Parameters: -// pcName - the private cloud name -// resourcePoolName - resource pool used to derive vSphere cluster which contains virtual networks -func (client VirtualNetworksByPCClient) List(ctx context.Context, pcName string, resourcePoolName string) (result VirtualNetworkListResponsePage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworksByPCClient.List") - defer func() { - sc := -1 - if result.vnlr.Response.Response != nil { - sc = result.vnlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, pcName, resourcePoolName) - if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualNetworksByPCClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.vnlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualNetworksByPCClient", "List", resp, "Failure sending request") - return - } - - result.vnlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualNetworksByPCClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualNetworksByPCClient) ListPreparer(ctx context.Context, pcName string, resourcePoolName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "pcName": autorest.Encode("path", pcName), - "regionId": autorest.Encode("path", client.RegionID), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-04-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - "resourcePoolName": autorest.Encode("query", resourcePoolName), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}/virtualNetworks", 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 VirtualNetworksByPCClient) 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 VirtualNetworksByPCClient) ListResponder(resp *http.Response) (result VirtualNetworkListResponse, 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 VirtualNetworksByPCClient) listNextResults(ctx context.Context, lastResults VirtualNetworkListResponse) (result VirtualNetworkListResponse, err error) { - req, err := lastResults.virtualNetworkListResponsePreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualNetworksByPCClient", "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, "vmwarecloudsimple.VirtualNetworksByPCClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "vmwarecloudsimple.VirtualNetworksByPCClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualNetworksByPCClient) ListComplete(ctx context.Context, pcName string, resourcePoolName string) (result VirtualNetworkListResponseIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworksByPCClient.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, pcName, resourcePoolName) - return -} diff --git a/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/vmwarecloudsimpleapi/interfaces.go b/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/vmwarecloudsimpleapi/interfaces.go index e572ab6327ee..fbb0889b07f1 100644 --- a/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/vmwarecloudsimpleapi/interfaces.go +++ b/services/vmwarecloudsimple/mgmt/2019-04-01/vmwarecloudsimple/vmwarecloudsimpleapi/interfaces.go @@ -23,24 +23,17 @@ import ( "github.com/Azure/go-autorest/autorest" ) -// BaseClientAPI contains the set of methods on the BaseClient type. -type BaseClientAPI interface { - GetOperationResultByRegion(ctx context.Context, operationID string) (result vmwarecloudsimple.OperationResource, err error) - GetPrivateCloud(ctx context.Context, pcName string) (result vmwarecloudsimple.PrivateCloud, err error) -} - -var _ BaseClientAPI = (*vmwarecloudsimple.BaseClient)(nil) - -// AvailableOperationsClientAPI contains the set of methods on the AvailableOperationsClient type. -type AvailableOperationsClientAPI interface { +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + Get(ctx context.Context, regionID string, operationID string) (result vmwarecloudsimple.OperationResource, err error) List(ctx context.Context) (result vmwarecloudsimple.AvailableOperationsListResponsePage, err error) } -var _ AvailableOperationsClientAPI = (*vmwarecloudsimple.AvailableOperationsClient)(nil) +var _ OperationsClientAPI = (*vmwarecloudsimple.OperationsClient)(nil) -// DedicatedCloudNodeClientAPI contains the set of methods on the DedicatedCloudNodeClient type. -type DedicatedCloudNodeClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, dedicatedCloudNodeName string, dedicatedCloudNodeRequest vmwarecloudsimple.DedicatedCloudNode) (result vmwarecloudsimple.DedicatedCloudNodeCreateOrUpdateFuture, err error) +// DedicatedCloudNodesClientAPI contains the set of methods on the DedicatedCloudNodesClient type. +type DedicatedCloudNodesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, dedicatedCloudNodeName string, dedicatedCloudNodeRequest vmwarecloudsimple.DedicatedCloudNode) (result vmwarecloudsimple.DedicatedCloudNodesCreateOrUpdateFuture, err error) Delete(ctx context.Context, resourceGroupName string, dedicatedCloudNodeName string) (result autorest.Response, err error) Get(ctx context.Context, resourceGroupName string, dedicatedCloudNodeName string) (result vmwarecloudsimple.DedicatedCloudNode, err error) ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string, top *int32, skipToken string) (result vmwarecloudsimple.DedicatedCloudNodeListResponsePage, err error) @@ -48,93 +41,84 @@ type DedicatedCloudNodeClientAPI interface { Update(ctx context.Context, resourceGroupName string, dedicatedCloudNodeName string, dedicatedCloudNodeRequest vmwarecloudsimple.PatchPayload) (result vmwarecloudsimple.DedicatedCloudNode, err error) } -var _ DedicatedCloudNodeClientAPI = (*vmwarecloudsimple.DedicatedCloudNodeClient)(nil) +var _ DedicatedCloudNodesClientAPI = (*vmwarecloudsimple.DedicatedCloudNodesClient)(nil) -// DedicatedCloudServiceClientAPI contains the set of methods on the DedicatedCloudServiceClient type. -type DedicatedCloudServiceClientAPI interface { +// DedicatedCloudServicesClientAPI contains the set of methods on the DedicatedCloudServicesClient type. +type DedicatedCloudServicesClientAPI interface { CreateOrUpdate(ctx context.Context, resourceGroupName string, dedicatedCloudServiceName string, dedicatedCloudServiceRequest vmwarecloudsimple.DedicatedCloudService) (result vmwarecloudsimple.DedicatedCloudService, err error) - Delete(ctx context.Context, resourceGroupName string, dedicatedCloudServiceName string) (result vmwarecloudsimple.DedicatedCloudServiceDeleteFuture, err error) + Delete(ctx context.Context, resourceGroupName string, dedicatedCloudServiceName string) (result vmwarecloudsimple.DedicatedCloudServicesDeleteFuture, err error) Get(ctx context.Context, resourceGroupName string, dedicatedCloudServiceName string) (result vmwarecloudsimple.DedicatedCloudService, err error) ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string, top *int32, skipToken string) (result vmwarecloudsimple.DedicatedCloudServiceListResponsePage, err error) ListBySubscription(ctx context.Context, filter string, top *int32, skipToken string) (result vmwarecloudsimple.DedicatedCloudServiceListResponsePage, err error) Update(ctx context.Context, resourceGroupName string, dedicatedCloudServiceName string, dedicatedCloudServiceRequest vmwarecloudsimple.PatchPayload) (result vmwarecloudsimple.DedicatedCloudService, err error) } -var _ DedicatedCloudServiceClientAPI = (*vmwarecloudsimple.DedicatedCloudServiceClient)(nil) - -// SkusAvailabilityWithinRegionClientAPI contains the set of methods on the SkusAvailabilityWithinRegionClient type. -type SkusAvailabilityWithinRegionClientAPI interface { - List(ctx context.Context, skuID string) (result vmwarecloudsimple.SkuAvailabilityListResponsePage, err error) -} - -var _ SkusAvailabilityWithinRegionClientAPI = (*vmwarecloudsimple.SkusAvailabilityWithinRegionClient)(nil) - -// PrivateCloudByRegionClientAPI contains the set of methods on the PrivateCloudByRegionClient type. -type PrivateCloudByRegionClientAPI interface { - List(ctx context.Context) (result vmwarecloudsimple.PrivateCloudListPage, err error) -} - -var _ PrivateCloudByRegionClientAPI = (*vmwarecloudsimple.PrivateCloudByRegionClient)(nil) +var _ DedicatedCloudServicesClientAPI = (*vmwarecloudsimple.DedicatedCloudServicesClient)(nil) -// ResourcePoolsByPCClientAPI contains the set of methods on the ResourcePoolsByPCClient type. -type ResourcePoolsByPCClientAPI interface { - List(ctx context.Context, pcName string) (result vmwarecloudsimple.ResourcePoolsListResponsePage, err error) +// SkusAvailabilityClientAPI contains the set of methods on the SkusAvailabilityClient type. +type SkusAvailabilityClientAPI interface { + List(ctx context.Context, regionID string, skuID string) (result vmwarecloudsimple.SkuAvailabilityListResponsePage, err error) } -var _ ResourcePoolsByPCClientAPI = (*vmwarecloudsimple.ResourcePoolsByPCClient)(nil) +var _ SkusAvailabilityClientAPI = (*vmwarecloudsimple.SkusAvailabilityClient)(nil) -// ResourcePoolByPCClientAPI contains the set of methods on the ResourcePoolByPCClient type. -type ResourcePoolByPCClientAPI interface { - Get(ctx context.Context, pcName string, resourcePoolName string) (result vmwarecloudsimple.ResourcePool, err error) +// PrivateCloudsClientAPI contains the set of methods on the PrivateCloudsClient type. +type PrivateCloudsClientAPI interface { + Get(ctx context.Context, pcName string, regionID string) (result vmwarecloudsimple.PrivateCloud, err error) + List(ctx context.Context, regionID string) (result vmwarecloudsimple.PrivateCloudListPage, err error) } -var _ ResourcePoolByPCClientAPI = (*vmwarecloudsimple.ResourcePoolByPCClient)(nil) +var _ PrivateCloudsClientAPI = (*vmwarecloudsimple.PrivateCloudsClient)(nil) -// VirtualMachineTemplatesByPCClientAPI contains the set of methods on the VirtualMachineTemplatesByPCClient type. -type VirtualMachineTemplatesByPCClientAPI interface { - List(ctx context.Context, pcName string, resourcePoolName string) (result vmwarecloudsimple.VirtualMachineTemplateListResponsePage, err error) +// CustomizationPoliciesClientAPI contains the set of methods on the CustomizationPoliciesClient type. +type CustomizationPoliciesClientAPI interface { + Get(ctx context.Context, regionID string, pcName string, customizationPolicyName string) (result vmwarecloudsimple.CustomizationPolicy, err error) + List(ctx context.Context, regionID string, pcName string, filter string) (result vmwarecloudsimple.CustomizationPoliciesListResponsePage, err error) } -var _ VirtualMachineTemplatesByPCClientAPI = (*vmwarecloudsimple.VirtualMachineTemplatesByPCClient)(nil) +var _ CustomizationPoliciesClientAPI = (*vmwarecloudsimple.CustomizationPoliciesClient)(nil) -// VirtualMachineTemplateByPCClientAPI contains the set of methods on the VirtualMachineTemplateByPCClient type. -type VirtualMachineTemplateByPCClientAPI interface { - Get(ctx context.Context, pcName string, virtualMachineTemplateName string) (result vmwarecloudsimple.VirtualMachineTemplate, err error) +// ResourcePoolsClientAPI contains the set of methods on the ResourcePoolsClient type. +type ResourcePoolsClientAPI interface { + Get(ctx context.Context, regionID string, pcName string, resourcePoolName string) (result vmwarecloudsimple.ResourcePool, err error) + List(ctx context.Context, regionID string, pcName string) (result vmwarecloudsimple.ResourcePoolsListResponsePage, err error) } -var _ VirtualMachineTemplateByPCClientAPI = (*vmwarecloudsimple.VirtualMachineTemplateByPCClient)(nil) +var _ ResourcePoolsClientAPI = (*vmwarecloudsimple.ResourcePoolsClient)(nil) -// VirtualNetworksByPCClientAPI contains the set of methods on the VirtualNetworksByPCClient type. -type VirtualNetworksByPCClientAPI interface { - List(ctx context.Context, pcName string, resourcePoolName string) (result vmwarecloudsimple.VirtualNetworkListResponsePage, err error) +// VirtualMachineTemplatesClientAPI contains the set of methods on the VirtualMachineTemplatesClient type. +type VirtualMachineTemplatesClientAPI interface { + Get(ctx context.Context, regionID string, pcName string, virtualMachineTemplateName string) (result vmwarecloudsimple.VirtualMachineTemplate, err error) + List(ctx context.Context, pcName string, regionID string, resourcePoolName string) (result vmwarecloudsimple.VirtualMachineTemplateListResponsePage, err error) } -var _ VirtualNetworksByPCClientAPI = (*vmwarecloudsimple.VirtualNetworksByPCClient)(nil) +var _ VirtualMachineTemplatesClientAPI = (*vmwarecloudsimple.VirtualMachineTemplatesClient)(nil) -// VirtualNetworkByPCClientAPI contains the set of methods on the VirtualNetworkByPCClient type. -type VirtualNetworkByPCClientAPI interface { - Get(ctx context.Context, pcName string, virtualNetworkName string) (result vmwarecloudsimple.VirtualNetwork, err error) +// VirtualNetworksClientAPI contains the set of methods on the VirtualNetworksClient type. +type VirtualNetworksClientAPI interface { + Get(ctx context.Context, regionID string, pcName string, virtualNetworkName string) (result vmwarecloudsimple.VirtualNetwork, err error) + List(ctx context.Context, regionID string, pcName string, resourcePoolName string) (result vmwarecloudsimple.VirtualNetworkListResponsePage, err error) } -var _ VirtualNetworkByPCClientAPI = (*vmwarecloudsimple.VirtualNetworkByPCClient)(nil) +var _ VirtualNetworksClientAPI = (*vmwarecloudsimple.VirtualNetworksClient)(nil) -// UsagesWithinRegionClientAPI contains the set of methods on the UsagesWithinRegionClient type. -type UsagesWithinRegionClientAPI interface { - List(ctx context.Context, filter string) (result vmwarecloudsimple.UsageListResponsePage, err error) +// UsagesClientAPI contains the set of methods on the UsagesClient type. +type UsagesClientAPI interface { + List(ctx context.Context, regionID string, filter string) (result vmwarecloudsimple.UsageListResponsePage, err error) } -var _ UsagesWithinRegionClientAPI = (*vmwarecloudsimple.UsagesWithinRegionClient)(nil) +var _ UsagesClientAPI = (*vmwarecloudsimple.UsagesClient)(nil) -// VirtualMachineClientAPI contains the set of methods on the VirtualMachineClient type. -type VirtualMachineClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualMachineName string, virtualMachineRequest vmwarecloudsimple.VirtualMachine) (result vmwarecloudsimple.VirtualMachineCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, virtualMachineName string) (result vmwarecloudsimple.VirtualMachineDeleteFuture, err error) +// VirtualMachinesClientAPI contains the set of methods on the VirtualMachinesClient type. +type VirtualMachinesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualMachineName string, virtualMachineRequest vmwarecloudsimple.VirtualMachine) (result vmwarecloudsimple.VirtualMachinesCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, virtualMachineName string) (result vmwarecloudsimple.VirtualMachinesDeleteFuture, err error) Get(ctx context.Context, resourceGroupName string, virtualMachineName string) (result vmwarecloudsimple.VirtualMachine, err error) ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string, top *int32, skipToken string) (result vmwarecloudsimple.VirtualMachineListResponsePage, err error) ListBySubscription(ctx context.Context, filter string, top *int32, skipToken string) (result vmwarecloudsimple.VirtualMachineListResponsePage, err error) - Start(ctx context.Context, resourceGroupName string, virtualMachineName string) (result vmwarecloudsimple.VirtualMachineStartFuture, err error) - Stop(ctx context.Context, resourceGroupName string, virtualMachineName string, mParameter *vmwarecloudsimple.VirtualMachineStopMode, mode vmwarecloudsimple.StopMode) (result vmwarecloudsimple.VirtualMachineStopFuture, err error) - Update(ctx context.Context, resourceGroupName string, virtualMachineName string, virtualMachineRequest vmwarecloudsimple.PatchPayload) (result vmwarecloudsimple.VirtualMachineUpdateFuture, err error) + Start(ctx context.Context, resourceGroupName string, virtualMachineName string) (result vmwarecloudsimple.VirtualMachinesStartFuture, err error) + Stop(ctx context.Context, resourceGroupName string, virtualMachineName string, mParameter *vmwarecloudsimple.VirtualMachineStopMode, mode vmwarecloudsimple.StopMode) (result vmwarecloudsimple.VirtualMachinesStopFuture, err error) + Update(ctx context.Context, resourceGroupName string, virtualMachineName string, virtualMachineRequest vmwarecloudsimple.PatchPayload) (result vmwarecloudsimple.VirtualMachinesUpdateFuture, err error) } -var _ VirtualMachineClientAPI = (*vmwarecloudsimple.VirtualMachineClient)(nil) +var _ VirtualMachinesClientAPI = (*vmwarecloudsimple.VirtualMachinesClient)(nil) diff --git a/services/web/mgmt/2018-02-01/web/apps.go b/services/web/mgmt/2018-02-01/web/apps.go index 6a7668705ff9..8f6ca74fe918 100644 --- a/services/web/mgmt/2018-02-01/web/apps.go +++ b/services/web/mgmt/2018-02-01/web/apps.go @@ -1061,8 +1061,7 @@ func (client AppsClient) CreateFunctionResponder(resp *http.Response) (result Fu // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. // functionName - function name. -// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the -// production slot. +// slot - name of the deployment slot. // functionEnvelope - function details. func (client AppsClient) CreateInstanceFunctionSlot(ctx context.Context, resourceGroupName string, name string, functionName string, slot string, functionEnvelope FunctionEnvelope) (result AppsCreateInstanceFunctionSlotFuture, err error) { if tracing.IsEnabled() { @@ -1999,15 +1998,16 @@ func (client AppsClient) CreateOrUpdateDomainOwnershipIdentifierSlotResponder(re return } -// CreateOrUpdateHostNameBinding creates a hostname binding for an app. +// CreateOrUpdateFunctionSecret add or update a function secret. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -// hostName - hostname in the hostname binding. -// hostNameBinding - binding details. This is the JSON representation of a HostNameBinding object. -func (client AppsClient) CreateOrUpdateHostNameBinding(ctx context.Context, resourceGroupName string, name string, hostName string, hostNameBinding HostNameBinding) (result HostNameBinding, err error) { +// name - site name. +// functionName - the name of the function. +// keyName - the name of the key. +// key - the key to create or update +func (client AppsClient) CreateOrUpdateFunctionSecret(ctx context.Context, resourceGroupName string, name string, functionName string, keyName string, key KeyInfo) (result KeyInfo, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateHostNameBinding") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateFunctionSecret") defer func() { sc := -1 if result.Response.Response != nil { @@ -2021,34 +2021,35 @@ func (client AppsClient) CreateOrUpdateHostNameBinding(ctx context.Context, reso Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "CreateOrUpdateHostNameBinding", err.Error()) + return result, validation.NewError("web.AppsClient", "CreateOrUpdateFunctionSecret", err.Error()) } - req, err := client.CreateOrUpdateHostNameBindingPreparer(ctx, resourceGroupName, name, hostName, hostNameBinding) + req, err := client.CreateOrUpdateFunctionSecretPreparer(ctx, resourceGroupName, name, functionName, keyName, key) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHostNameBinding", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateFunctionSecret", nil, "Failure preparing request") return } - resp, err := client.CreateOrUpdateHostNameBindingSender(req) + resp, err := client.CreateOrUpdateFunctionSecretSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHostNameBinding", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateFunctionSecret", resp, "Failure sending request") return } - result, err = client.CreateOrUpdateHostNameBindingResponder(resp) + result, err = client.CreateOrUpdateFunctionSecretResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHostNameBinding", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateFunctionSecret", resp, "Failure responding to request") } return } -// CreateOrUpdateHostNameBindingPreparer prepares the CreateOrUpdateHostNameBinding request. -func (client AppsClient) CreateOrUpdateHostNameBindingPreparer(ctx context.Context, resourceGroupName string, name string, hostName string, hostNameBinding HostNameBinding) (*http.Request, error) { +// CreateOrUpdateFunctionSecretPreparer prepares the CreateOrUpdateFunctionSecret request. +func (client AppsClient) CreateOrUpdateFunctionSecretPreparer(ctx context.Context, resourceGroupName string, name string, functionName string, keyName string, key KeyInfo) (*http.Request, error) { pathParameters := map[string]interface{}{ - "hostName": autorest.Encode("path", hostName), + "functionName": autorest.Encode("path", functionName), + "keyName": autorest.Encode("path", keyName), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -2063,43 +2064,43 @@ func (client AppsClient) CreateOrUpdateHostNameBindingPreparer(ctx context.Conte autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}", pathParameters), - autorest.WithJSON(hostNameBinding), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/keys/{keyName}", pathParameters), + autorest.WithJSON(key), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// CreateOrUpdateHostNameBindingSender sends the CreateOrUpdateHostNameBinding request. The method will close the +// CreateOrUpdateFunctionSecretSender sends the CreateOrUpdateFunctionSecret request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) CreateOrUpdateHostNameBindingSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) CreateOrUpdateFunctionSecretSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// CreateOrUpdateHostNameBindingResponder handles the response to the CreateOrUpdateHostNameBinding request. The method always +// CreateOrUpdateFunctionSecretResponder handles the response to the CreateOrUpdateFunctionSecret request. The method always // closes the http.Response Body. -func (client AppsClient) CreateOrUpdateHostNameBindingResponder(resp *http.Response) (result HostNameBinding, err error) { +func (client AppsClient) CreateOrUpdateFunctionSecretResponder(resp *http.Response) (result KeyInfo, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// CreateOrUpdateHostNameBindingSlot creates a hostname binding for an app. +// CreateOrUpdateFunctionSecretSlot add or update a function secret. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -// hostName - hostname in the hostname binding. -// hostNameBinding - binding details. This is the JSON representation of a HostNameBinding object. -// slot - name of the deployment slot. If a slot is not specified, the API will create a binding for the -// production slot. -func (client AppsClient) CreateOrUpdateHostNameBindingSlot(ctx context.Context, resourceGroupName string, name string, hostName string, hostNameBinding HostNameBinding, slot string) (result HostNameBinding, err error) { +// name - site name. +// functionName - the name of the function. +// keyName - the name of the key. +// slot - name of the deployment slot. +// key - the key to create or update +func (client AppsClient) CreateOrUpdateFunctionSecretSlot(ctx context.Context, resourceGroupName string, name string, functionName string, keyName string, slot string, key KeyInfo) (result KeyInfo, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateHostNameBindingSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateFunctionSecretSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -2113,34 +2114,35 @@ func (client AppsClient) CreateOrUpdateHostNameBindingSlot(ctx context.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("web.AppsClient", "CreateOrUpdateHostNameBindingSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "CreateOrUpdateFunctionSecretSlot", err.Error()) } - req, err := client.CreateOrUpdateHostNameBindingSlotPreparer(ctx, resourceGroupName, name, hostName, hostNameBinding, slot) + req, err := client.CreateOrUpdateFunctionSecretSlotPreparer(ctx, resourceGroupName, name, functionName, keyName, slot, key) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHostNameBindingSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateFunctionSecretSlot", nil, "Failure preparing request") return } - resp, err := client.CreateOrUpdateHostNameBindingSlotSender(req) + resp, err := client.CreateOrUpdateFunctionSecretSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHostNameBindingSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateFunctionSecretSlot", resp, "Failure sending request") return } - result, err = client.CreateOrUpdateHostNameBindingSlotResponder(resp) + result, err = client.CreateOrUpdateFunctionSecretSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHostNameBindingSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateFunctionSecretSlot", resp, "Failure responding to request") } return } -// CreateOrUpdateHostNameBindingSlotPreparer prepares the CreateOrUpdateHostNameBindingSlot request. -func (client AppsClient) CreateOrUpdateHostNameBindingSlotPreparer(ctx context.Context, resourceGroupName string, name string, hostName string, hostNameBinding HostNameBinding, slot string) (*http.Request, error) { +// CreateOrUpdateFunctionSecretSlotPreparer prepares the CreateOrUpdateFunctionSecretSlot request. +func (client AppsClient) CreateOrUpdateFunctionSecretSlotPreparer(ctx context.Context, resourceGroupName string, name string, functionName string, keyName string, slot string, key KeyInfo) (*http.Request, error) { pathParameters := map[string]interface{}{ - "hostName": autorest.Encode("path", hostName), + "functionName": autorest.Encode("path", functionName), + "keyName": autorest.Encode("path", keyName), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), "slot": autorest.Encode("path", slot), @@ -2156,42 +2158,41 @@ func (client AppsClient) CreateOrUpdateHostNameBindingSlotPreparer(ctx context.C autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}", pathParameters), - autorest.WithJSON(hostNameBinding), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/keys/{keyName}", pathParameters), + autorest.WithJSON(key), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// CreateOrUpdateHostNameBindingSlotSender sends the CreateOrUpdateHostNameBindingSlot request. The method will close the +// CreateOrUpdateFunctionSecretSlotSender sends the CreateOrUpdateFunctionSecretSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) CreateOrUpdateHostNameBindingSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) CreateOrUpdateFunctionSecretSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// CreateOrUpdateHostNameBindingSlotResponder handles the response to the CreateOrUpdateHostNameBindingSlot request. The method always +// CreateOrUpdateFunctionSecretSlotResponder handles the response to the CreateOrUpdateFunctionSecretSlot request. The method always // closes the http.Response Body. -func (client AppsClient) CreateOrUpdateHostNameBindingSlotResponder(resp *http.Response) (result HostNameBinding, err error) { +func (client AppsClient) CreateOrUpdateFunctionSecretSlotResponder(resp *http.Response) (result KeyInfo, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// CreateOrUpdateHybridConnection creates a new Hybrid Connection using a Service Bus relay. +// CreateOrUpdateHostNameBinding creates a hostname binding for an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - the name of the web app. -// namespaceName - the namespace for this hybrid connection. -// relayName - the relay name for this hybrid connection. -// connectionEnvelope - the details of the hybrid connection. -func (client AppsClient) CreateOrUpdateHybridConnection(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, connectionEnvelope HybridConnection) (result HybridConnection, err error) { +// name - name of the app. +// hostName - hostname in the hostname binding. +// hostNameBinding - binding details. This is the JSON representation of a HostNameBinding object. +func (client AppsClient) CreateOrUpdateHostNameBinding(ctx context.Context, resourceGroupName string, name string, hostName string, hostNameBinding HostNameBinding) (result HostNameBinding, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateHybridConnection") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateHostNameBinding") defer func() { sc := -1 if result.Response.Response != nil { @@ -2205,36 +2206,35 @@ func (client AppsClient) CreateOrUpdateHybridConnection(ctx context.Context, res Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "CreateOrUpdateHybridConnection", err.Error()) + return result, validation.NewError("web.AppsClient", "CreateOrUpdateHostNameBinding", err.Error()) } - req, err := client.CreateOrUpdateHybridConnectionPreparer(ctx, resourceGroupName, name, namespaceName, relayName, connectionEnvelope) + req, err := client.CreateOrUpdateHostNameBindingPreparer(ctx, resourceGroupName, name, hostName, hostNameBinding) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHybridConnection", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHostNameBinding", nil, "Failure preparing request") return } - resp, err := client.CreateOrUpdateHybridConnectionSender(req) + resp, err := client.CreateOrUpdateHostNameBindingSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHybridConnection", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHostNameBinding", resp, "Failure sending request") return } - result, err = client.CreateOrUpdateHybridConnectionResponder(resp) + result, err = client.CreateOrUpdateHostNameBindingResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHybridConnection", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHostNameBinding", resp, "Failure responding to request") } return } -// CreateOrUpdateHybridConnectionPreparer prepares the CreateOrUpdateHybridConnection request. -func (client AppsClient) CreateOrUpdateHybridConnectionPreparer(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, connectionEnvelope HybridConnection) (*http.Request, error) { +// CreateOrUpdateHostNameBindingPreparer prepares the CreateOrUpdateHostNameBinding request. +func (client AppsClient) CreateOrUpdateHostNameBindingPreparer(ctx context.Context, resourceGroupName string, name string, hostName string, hostNameBinding HostNameBinding) (*http.Request, error) { pathParameters := map[string]interface{}{ + "hostName": autorest.Encode("path", hostName), "name": autorest.Encode("path", name), - "namespaceName": autorest.Encode("path", namespaceName), - "relayName": autorest.Encode("path", relayName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -2248,22 +2248,22 @@ func (client AppsClient) CreateOrUpdateHybridConnectionPreparer(ctx context.Cont autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}", pathParameters), - autorest.WithJSON(connectionEnvelope), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}", pathParameters), + autorest.WithJSON(hostNameBinding), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// CreateOrUpdateHybridConnectionSender sends the CreateOrUpdateHybridConnection request. The method will close the +// CreateOrUpdateHostNameBindingSender sends the CreateOrUpdateHostNameBinding request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) CreateOrUpdateHybridConnectionSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) CreateOrUpdateHostNameBindingSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// CreateOrUpdateHybridConnectionResponder handles the response to the CreateOrUpdateHybridConnection request. The method always +// CreateOrUpdateHostNameBindingResponder handles the response to the CreateOrUpdateHostNameBinding request. The method always // closes the http.Response Body. -func (client AppsClient) CreateOrUpdateHybridConnectionResponder(resp *http.Response) (result HybridConnection, err error) { +func (client AppsClient) CreateOrUpdateHostNameBindingResponder(resp *http.Response) (result HostNameBinding, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -2274,17 +2274,17 @@ func (client AppsClient) CreateOrUpdateHybridConnectionResponder(resp *http.Resp return } -// CreateOrUpdateHybridConnectionSlot creates a new Hybrid Connection using a Service Bus relay. +// CreateOrUpdateHostNameBindingSlot creates a hostname binding for an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - the name of the web app. -// namespaceName - the namespace for this hybrid connection. -// relayName - the relay name for this hybrid connection. -// connectionEnvelope - the details of the hybrid connection. -// slot - the name of the slot for the web app. -func (client AppsClient) CreateOrUpdateHybridConnectionSlot(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, connectionEnvelope HybridConnection, slot string) (result HybridConnection, err error) { +// name - name of the app. +// hostName - hostname in the hostname binding. +// hostNameBinding - binding details. This is the JSON representation of a HostNameBinding object. +// slot - name of the deployment slot. If a slot is not specified, the API will create a binding for the +// production slot. +func (client AppsClient) CreateOrUpdateHostNameBindingSlot(ctx context.Context, resourceGroupName string, name string, hostName string, hostNameBinding HostNameBinding, slot string) (result HostNameBinding, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateHybridConnectionSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateHostNameBindingSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -2298,36 +2298,35 @@ func (client AppsClient) CreateOrUpdateHybridConnectionSlot(ctx context.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("web.AppsClient", "CreateOrUpdateHybridConnectionSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "CreateOrUpdateHostNameBindingSlot", err.Error()) } - req, err := client.CreateOrUpdateHybridConnectionSlotPreparer(ctx, resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot) + req, err := client.CreateOrUpdateHostNameBindingSlotPreparer(ctx, resourceGroupName, name, hostName, hostNameBinding, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHybridConnectionSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHostNameBindingSlot", nil, "Failure preparing request") return } - resp, err := client.CreateOrUpdateHybridConnectionSlotSender(req) + resp, err := client.CreateOrUpdateHostNameBindingSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHybridConnectionSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHostNameBindingSlot", resp, "Failure sending request") return } - result, err = client.CreateOrUpdateHybridConnectionSlotResponder(resp) + result, err = client.CreateOrUpdateHostNameBindingSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHybridConnectionSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHostNameBindingSlot", resp, "Failure responding to request") } return } -// CreateOrUpdateHybridConnectionSlotPreparer prepares the CreateOrUpdateHybridConnectionSlot request. -func (client AppsClient) CreateOrUpdateHybridConnectionSlotPreparer(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, connectionEnvelope HybridConnection, slot string) (*http.Request, error) { +// CreateOrUpdateHostNameBindingSlotPreparer prepares the CreateOrUpdateHostNameBindingSlot request. +func (client AppsClient) CreateOrUpdateHostNameBindingSlotPreparer(ctx context.Context, resourceGroupName string, name string, hostName string, hostNameBinding HostNameBinding, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ + "hostName": autorest.Encode("path", hostName), "name": autorest.Encode("path", name), - "namespaceName": autorest.Encode("path", namespaceName), - "relayName": autorest.Encode("path", relayName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -2342,22 +2341,22 @@ func (client AppsClient) CreateOrUpdateHybridConnectionSlotPreparer(ctx context. autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}", pathParameters), - autorest.WithJSON(connectionEnvelope), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}", pathParameters), + autorest.WithJSON(hostNameBinding), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// CreateOrUpdateHybridConnectionSlotSender sends the CreateOrUpdateHybridConnectionSlot request. The method will close the +// CreateOrUpdateHostNameBindingSlotSender sends the CreateOrUpdateHostNameBindingSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) CreateOrUpdateHybridConnectionSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) CreateOrUpdateHostNameBindingSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// CreateOrUpdateHybridConnectionSlotResponder handles the response to the CreateOrUpdateHybridConnectionSlot request. The method always +// CreateOrUpdateHostNameBindingSlotResponder handles the response to the CreateOrUpdateHostNameBindingSlot request. The method always // closes the http.Response Body. -func (client AppsClient) CreateOrUpdateHybridConnectionSlotResponder(resp *http.Response) (result HybridConnection, err error) { +func (client AppsClient) CreateOrUpdateHostNameBindingSlotResponder(resp *http.Response) (result HostNameBinding, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -2368,16 +2367,16 @@ func (client AppsClient) CreateOrUpdateHybridConnectionSlotResponder(resp *http. return } -// CreateOrUpdatePublicCertificate creates a hostname binding for an app. +// CreateOrUpdateHostSecret add or update a host level secret. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -// publicCertificateName - public certificate name. -// publicCertificate - public certificate details. This is the JSON representation of a PublicCertificate -// object. -func (client AppsClient) CreateOrUpdatePublicCertificate(ctx context.Context, resourceGroupName string, name string, publicCertificateName string, publicCertificate PublicCertificate) (result PublicCertificate, err error) { +// name - site name. +// keyType - the type of host key. +// keyName - the name of the key. +// key - the key to create or update +func (client AppsClient) CreateOrUpdateHostSecret(ctx context.Context, resourceGroupName string, name string, keyType string, keyName string, key KeyInfo) (result KeyInfo, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdatePublicCertificate") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateHostSecret") defer func() { sc := -1 if result.Response.Response != nil { @@ -2391,37 +2390,38 @@ func (client AppsClient) CreateOrUpdatePublicCertificate(ctx context.Context, re Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "CreateOrUpdatePublicCertificate", err.Error()) + return result, validation.NewError("web.AppsClient", "CreateOrUpdateHostSecret", err.Error()) } - req, err := client.CreateOrUpdatePublicCertificatePreparer(ctx, resourceGroupName, name, publicCertificateName, publicCertificate) + req, err := client.CreateOrUpdateHostSecretPreparer(ctx, resourceGroupName, name, keyType, keyName, key) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdatePublicCertificate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHostSecret", nil, "Failure preparing request") return } - resp, err := client.CreateOrUpdatePublicCertificateSender(req) + resp, err := client.CreateOrUpdateHostSecretSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdatePublicCertificate", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHostSecret", resp, "Failure sending request") return } - result, err = client.CreateOrUpdatePublicCertificateResponder(resp) + result, err = client.CreateOrUpdateHostSecretResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdatePublicCertificate", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHostSecret", resp, "Failure responding to request") } return } -// CreateOrUpdatePublicCertificatePreparer prepares the CreateOrUpdatePublicCertificate request. -func (client AppsClient) CreateOrUpdatePublicCertificatePreparer(ctx context.Context, resourceGroupName string, name string, publicCertificateName string, publicCertificate PublicCertificate) (*http.Request, error) { +// CreateOrUpdateHostSecretPreparer prepares the CreateOrUpdateHostSecret request. +func (client AppsClient) CreateOrUpdateHostSecretPreparer(ctx context.Context, resourceGroupName string, name string, keyType string, keyName string, key KeyInfo) (*http.Request, error) { pathParameters := map[string]interface{}{ - "name": autorest.Encode("path", name), - "publicCertificateName": autorest.Encode("path", publicCertificateName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "keyName": autorest.Encode("path", keyName), + "keyType": autorest.Encode("path", keyType), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2018-02-01" @@ -2433,44 +2433,43 @@ func (client AppsClient) CreateOrUpdatePublicCertificatePreparer(ctx context.Con autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}", pathParameters), - autorest.WithJSON(publicCertificate), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/{keyType}/{keyName}", pathParameters), + autorest.WithJSON(key), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// CreateOrUpdatePublicCertificateSender sends the CreateOrUpdatePublicCertificate request. The method will close the +// CreateOrUpdateHostSecretSender sends the CreateOrUpdateHostSecret request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) CreateOrUpdatePublicCertificateSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) CreateOrUpdateHostSecretSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// CreateOrUpdatePublicCertificateResponder handles the response to the CreateOrUpdatePublicCertificate request. The method always +// CreateOrUpdateHostSecretResponder handles the response to the CreateOrUpdateHostSecret request. The method always // closes the http.Response Body. -func (client AppsClient) CreateOrUpdatePublicCertificateResponder(resp *http.Response) (result PublicCertificate, err error) { +func (client AppsClient) CreateOrUpdateHostSecretResponder(resp *http.Response) (result KeyInfo, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// CreateOrUpdatePublicCertificateSlot creates a hostname binding for an app. +// CreateOrUpdateHostSecretSlot add or update a host level secret. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -// publicCertificateName - public certificate name. -// publicCertificate - public certificate details. This is the JSON representation of a PublicCertificate -// object. -// slot - name of the deployment slot. If a slot is not specified, the API will create a binding for the -// production slot. -func (client AppsClient) CreateOrUpdatePublicCertificateSlot(ctx context.Context, resourceGroupName string, name string, publicCertificateName string, publicCertificate PublicCertificate, slot string) (result PublicCertificate, err error) { +// name - site name. +// keyType - the type of host key. +// keyName - the name of the key. +// slot - name of the deployment slot. +// key - the key to create or update +func (client AppsClient) CreateOrUpdateHostSecretSlot(ctx context.Context, resourceGroupName string, name string, keyType string, keyName string, slot string, key KeyInfo) (result KeyInfo, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdatePublicCertificateSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateHostSecretSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -2484,38 +2483,39 @@ func (client AppsClient) CreateOrUpdatePublicCertificateSlot(ctx context.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("web.AppsClient", "CreateOrUpdatePublicCertificateSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "CreateOrUpdateHostSecretSlot", err.Error()) } - req, err := client.CreateOrUpdatePublicCertificateSlotPreparer(ctx, resourceGroupName, name, publicCertificateName, publicCertificate, slot) + req, err := client.CreateOrUpdateHostSecretSlotPreparer(ctx, resourceGroupName, name, keyType, keyName, slot, key) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdatePublicCertificateSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHostSecretSlot", nil, "Failure preparing request") return } - resp, err := client.CreateOrUpdatePublicCertificateSlotSender(req) + resp, err := client.CreateOrUpdateHostSecretSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdatePublicCertificateSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHostSecretSlot", resp, "Failure sending request") return } - result, err = client.CreateOrUpdatePublicCertificateSlotResponder(resp) + result, err = client.CreateOrUpdateHostSecretSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdatePublicCertificateSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHostSecretSlot", resp, "Failure responding to request") } return } -// CreateOrUpdatePublicCertificateSlotPreparer prepares the CreateOrUpdatePublicCertificateSlot request. -func (client AppsClient) CreateOrUpdatePublicCertificateSlotPreparer(ctx context.Context, resourceGroupName string, name string, publicCertificateName string, publicCertificate PublicCertificate, slot string) (*http.Request, error) { +// CreateOrUpdateHostSecretSlotPreparer prepares the CreateOrUpdateHostSecretSlot request. +func (client AppsClient) CreateOrUpdateHostSecretSlotPreparer(ctx context.Context, resourceGroupName string, name string, keyType string, keyName string, slot string, key KeyInfo) (*http.Request, error) { pathParameters := map[string]interface{}{ - "name": autorest.Encode("path", name), - "publicCertificateName": autorest.Encode("path", publicCertificateName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "keyName": autorest.Encode("path", keyName), + "keyType": autorest.Encode("path", keyType), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2018-02-01" @@ -2527,42 +2527,42 @@ func (client AppsClient) CreateOrUpdatePublicCertificateSlotPreparer(ctx context autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}", pathParameters), - autorest.WithJSON(publicCertificate), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/{keyType}/{keyName}", pathParameters), + autorest.WithJSON(key), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// CreateOrUpdatePublicCertificateSlotSender sends the CreateOrUpdatePublicCertificateSlot request. The method will close the +// CreateOrUpdateHostSecretSlotSender sends the CreateOrUpdateHostSecretSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) CreateOrUpdatePublicCertificateSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) CreateOrUpdateHostSecretSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// CreateOrUpdatePublicCertificateSlotResponder handles the response to the CreateOrUpdatePublicCertificateSlot request. The method always +// CreateOrUpdateHostSecretSlotResponder handles the response to the CreateOrUpdateHostSecretSlot request. The method always // closes the http.Response Body. -func (client AppsClient) CreateOrUpdatePublicCertificateSlotResponder(resp *http.Response) (result PublicCertificate, err error) { +func (client AppsClient) CreateOrUpdateHostSecretSlotResponder(resp *http.Response) (result KeyInfo, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// CreateOrUpdateRelayServiceConnection creates a new hybrid connection configuration (PUT), or updates an existing one -// (PATCH). +// CreateOrUpdateHybridConnection creates a new Hybrid Connection using a Service Bus relay. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -// entityName - name of the hybrid connection configuration. -// connectionEnvelope - details of the hybrid connection configuration. -func (client AppsClient) CreateOrUpdateRelayServiceConnection(ctx context.Context, resourceGroupName string, name string, entityName string, connectionEnvelope RelayServiceConnectionEntity) (result RelayServiceConnectionEntity, err error) { +// name - the name of the web app. +// namespaceName - the namespace for this hybrid connection. +// relayName - the relay name for this hybrid connection. +// connectionEnvelope - the details of the hybrid connection. +func (client AppsClient) CreateOrUpdateHybridConnection(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, connectionEnvelope HybridConnection) (result HybridConnection, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateRelayServiceConnection") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateHybridConnection") defer func() { sc := -1 if result.Response.Response != nil { @@ -2576,36 +2576,37 @@ func (client AppsClient) CreateOrUpdateRelayServiceConnection(ctx context.Contex Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "CreateOrUpdateRelayServiceConnection", err.Error()) + return result, validation.NewError("web.AppsClient", "CreateOrUpdateHybridConnection", err.Error()) } - req, err := client.CreateOrUpdateRelayServiceConnectionPreparer(ctx, resourceGroupName, name, entityName, connectionEnvelope) + req, err := client.CreateOrUpdateHybridConnectionPreparer(ctx, resourceGroupName, name, namespaceName, relayName, connectionEnvelope) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateRelayServiceConnection", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHybridConnection", nil, "Failure preparing request") return } - resp, err := client.CreateOrUpdateRelayServiceConnectionSender(req) + resp, err := client.CreateOrUpdateHybridConnectionSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateRelayServiceConnection", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHybridConnection", resp, "Failure sending request") return } - result, err = client.CreateOrUpdateRelayServiceConnectionResponder(resp) + result, err = client.CreateOrUpdateHybridConnectionResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateRelayServiceConnection", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHybridConnection", resp, "Failure responding to request") } return } -// CreateOrUpdateRelayServiceConnectionPreparer prepares the CreateOrUpdateRelayServiceConnection request. -func (client AppsClient) CreateOrUpdateRelayServiceConnectionPreparer(ctx context.Context, resourceGroupName string, name string, entityName string, connectionEnvelope RelayServiceConnectionEntity) (*http.Request, error) { +// CreateOrUpdateHybridConnectionPreparer prepares the CreateOrUpdateHybridConnection request. +func (client AppsClient) CreateOrUpdateHybridConnectionPreparer(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, connectionEnvelope HybridConnection) (*http.Request, error) { pathParameters := map[string]interface{}{ - "entityName": autorest.Encode("path", entityName), "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "namespaceName": autorest.Encode("path", namespaceName), + "relayName": autorest.Encode("path", relayName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -2618,22 +2619,22 @@ func (client AppsClient) CreateOrUpdateRelayServiceConnectionPreparer(ctx contex autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}", pathParameters), autorest.WithJSON(connectionEnvelope), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// CreateOrUpdateRelayServiceConnectionSender sends the CreateOrUpdateRelayServiceConnection request. The method will close the +// CreateOrUpdateHybridConnectionSender sends the CreateOrUpdateHybridConnection request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) CreateOrUpdateRelayServiceConnectionSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) CreateOrUpdateHybridConnectionSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// CreateOrUpdateRelayServiceConnectionResponder handles the response to the CreateOrUpdateRelayServiceConnection request. The method always +// CreateOrUpdateHybridConnectionResponder handles the response to the CreateOrUpdateHybridConnection request. The method always // closes the http.Response Body. -func (client AppsClient) CreateOrUpdateRelayServiceConnectionResponder(resp *http.Response) (result RelayServiceConnectionEntity, err error) { +func (client AppsClient) CreateOrUpdateHybridConnectionResponder(resp *http.Response) (result HybridConnection, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -2644,18 +2645,17 @@ func (client AppsClient) CreateOrUpdateRelayServiceConnectionResponder(resp *htt return } -// CreateOrUpdateRelayServiceConnectionSlot creates a new hybrid connection configuration (PUT), or updates an existing -// one (PATCH). +// CreateOrUpdateHybridConnectionSlot creates a new Hybrid Connection using a Service Bus relay. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -// entityName - name of the hybrid connection configuration. -// connectionEnvelope - details of the hybrid connection configuration. -// slot - name of the deployment slot. If a slot is not specified, the API will create or update a hybrid -// connection for the production slot. -func (client AppsClient) CreateOrUpdateRelayServiceConnectionSlot(ctx context.Context, resourceGroupName string, name string, entityName string, connectionEnvelope RelayServiceConnectionEntity, slot string) (result RelayServiceConnectionEntity, err error) { +// name - the name of the web app. +// namespaceName - the namespace for this hybrid connection. +// relayName - the relay name for this hybrid connection. +// connectionEnvelope - the details of the hybrid connection. +// slot - the name of the slot for the web app. +func (client AppsClient) CreateOrUpdateHybridConnectionSlot(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, connectionEnvelope HybridConnection, slot string) (result HybridConnection, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateRelayServiceConnectionSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateHybridConnectionSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -2669,35 +2669,36 @@ func (client AppsClient) CreateOrUpdateRelayServiceConnectionSlot(ctx context.Co Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "CreateOrUpdateRelayServiceConnectionSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "CreateOrUpdateHybridConnectionSlot", err.Error()) } - req, err := client.CreateOrUpdateRelayServiceConnectionSlotPreparer(ctx, resourceGroupName, name, entityName, connectionEnvelope, slot) + req, err := client.CreateOrUpdateHybridConnectionSlotPreparer(ctx, resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateRelayServiceConnectionSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHybridConnectionSlot", nil, "Failure preparing request") return } - resp, err := client.CreateOrUpdateRelayServiceConnectionSlotSender(req) + resp, err := client.CreateOrUpdateHybridConnectionSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateRelayServiceConnectionSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHybridConnectionSlot", resp, "Failure sending request") return } - result, err = client.CreateOrUpdateRelayServiceConnectionSlotResponder(resp) + result, err = client.CreateOrUpdateHybridConnectionSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateRelayServiceConnectionSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHybridConnectionSlot", resp, "Failure responding to request") } return } -// CreateOrUpdateRelayServiceConnectionSlotPreparer prepares the CreateOrUpdateRelayServiceConnectionSlot request. -func (client AppsClient) CreateOrUpdateRelayServiceConnectionSlotPreparer(ctx context.Context, resourceGroupName string, name string, entityName string, connectionEnvelope RelayServiceConnectionEntity, slot string) (*http.Request, error) { +// CreateOrUpdateHybridConnectionSlotPreparer prepares the CreateOrUpdateHybridConnectionSlot request. +func (client AppsClient) CreateOrUpdateHybridConnectionSlotPreparer(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, connectionEnvelope HybridConnection, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "entityName": autorest.Encode("path", entityName), "name": autorest.Encode("path", name), + "namespaceName": autorest.Encode("path", namespaceName), + "relayName": autorest.Encode("path", relayName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -2712,22 +2713,22 @@ func (client AppsClient) CreateOrUpdateRelayServiceConnectionSlotPreparer(ctx co autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}", pathParameters), autorest.WithJSON(connectionEnvelope), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// CreateOrUpdateRelayServiceConnectionSlotSender sends the CreateOrUpdateRelayServiceConnectionSlot request. The method will close the +// CreateOrUpdateHybridConnectionSlotSender sends the CreateOrUpdateHybridConnectionSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) CreateOrUpdateRelayServiceConnectionSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) CreateOrUpdateHybridConnectionSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// CreateOrUpdateRelayServiceConnectionSlotResponder handles the response to the CreateOrUpdateRelayServiceConnectionSlot request. The method always +// CreateOrUpdateHybridConnectionSlotResponder handles the response to the CreateOrUpdateHybridConnectionSlot request. The method always // closes the http.Response Body. -func (client AppsClient) CreateOrUpdateRelayServiceConnectionSlotResponder(resp *http.Response) (result RelayServiceConnectionEntity, err error) { +func (client AppsClient) CreateOrUpdateHybridConnectionSlotResponder(resp *http.Response) (result HybridConnection, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -2738,21 +2739,20 @@ func (client AppsClient) CreateOrUpdateRelayServiceConnectionSlotResponder(resp return } -// CreateOrUpdateSlot creates a new web, mobile, or API app in an existing resource group, or updates an existing app. +// CreateOrUpdatePublicCertificate creates a hostname binding for an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - unique name of the app to create or update. To create or update a deployment slot, use the {slot} -// parameter. -// siteEnvelope - a JSON representation of the app properties. See example. -// slot - name of the deployment slot to create or update. By default, this API attempts to create or modify -// the production slot. -func (client AppsClient) CreateOrUpdateSlot(ctx context.Context, resourceGroupName string, name string, siteEnvelope Site, slot string) (result AppsCreateOrUpdateSlotFuture, err error) { +// name - name of the app. +// publicCertificateName - public certificate name. +// publicCertificate - public certificate details. This is the JSON representation of a PublicCertificate +// object. +func (client AppsClient) CreateOrUpdatePublicCertificate(ctx context.Context, resourceGroupName string, name string, publicCertificateName string, publicCertificate PublicCertificate) (result PublicCertificate, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdatePublicCertificate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -2761,47 +2761,38 @@ func (client AppsClient) CreateOrUpdateSlot(ctx context.Context, resourceGroupNa {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, - {TargetValue: siteEnvelope, - Constraints: []validation.Constraint{{Target: "siteEnvelope.SiteProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "siteEnvelope.SiteProperties.SiteConfig", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "siteEnvelope.SiteProperties.SiteConfig.Push", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "siteEnvelope.SiteProperties.SiteConfig.Push.PushSettingsProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "siteEnvelope.SiteProperties.SiteConfig.Push.PushSettingsProperties.IsPushEnabled", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - {Target: "siteEnvelope.SiteProperties.SiteConfig.ReservedInstanceCount", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "siteEnvelope.SiteProperties.SiteConfig.ReservedInstanceCount", Name: validation.InclusiveMaximum, Rule: int64(10), Chain: nil}, - {Target: "siteEnvelope.SiteProperties.SiteConfig.ReservedInstanceCount", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, - }}, - }}, - {Target: "siteEnvelope.SiteProperties.CloningInfo", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "siteEnvelope.SiteProperties.CloningInfo.SourceWebAppID", Name: validation.Null, Rule: true, Chain: nil}}}, - }}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "CreateOrUpdateSlot", err.Error()) + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "CreateOrUpdatePublicCertificate", err.Error()) } - req, err := client.CreateOrUpdateSlotPreparer(ctx, resourceGroupName, name, siteEnvelope, slot) + req, err := client.CreateOrUpdatePublicCertificatePreparer(ctx, resourceGroupName, name, publicCertificateName, publicCertificate) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdatePublicCertificate", nil, "Failure preparing request") return } - result, err = client.CreateOrUpdateSlotSender(req) + resp, err := client.CreateOrUpdatePublicCertificateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateSlot", result.Response(), "Failure sending request") + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdatePublicCertificate", resp, "Failure sending request") return } + result, err = client.CreateOrUpdatePublicCertificateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdatePublicCertificate", resp, "Failure responding to request") + } + return } -// CreateOrUpdateSlotPreparer prepares the CreateOrUpdateSlot request. -func (client AppsClient) CreateOrUpdateSlotPreparer(ctx context.Context, resourceGroupName string, name string, siteEnvelope Site, slot string) (*http.Request, error) { +// CreateOrUpdatePublicCertificatePreparer prepares the CreateOrUpdatePublicCertificate request. +func (client AppsClient) CreateOrUpdatePublicCertificatePreparer(ctx context.Context, resourceGroupName string, name string, publicCertificateName string, publicCertificate PublicCertificate) (*http.Request, error) { pathParameters := map[string]interface{}{ - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "name": autorest.Encode("path", name), + "publicCertificateName": autorest.Encode("path", publicCertificateName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2018-02-01" @@ -2813,50 +2804,48 @@ func (client AppsClient) CreateOrUpdateSlotPreparer(ctx context.Context, resourc autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}", pathParameters), - autorest.WithJSON(siteEnvelope), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}", pathParameters), + autorest.WithJSON(publicCertificate), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// CreateOrUpdateSlotSender sends the CreateOrUpdateSlot request. The method will close the +// CreateOrUpdatePublicCertificateSender sends the CreateOrUpdatePublicCertificate request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) CreateOrUpdateSlotSender(req *http.Request) (future AppsCreateOrUpdateSlotFuture, err error) { +func (client AppsClient) CreateOrUpdatePublicCertificateSender(req *http.Request) (*http.Response, 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 + return autorest.SendWithSender(client, req, sd...) } -// CreateOrUpdateSlotResponder handles the response to the CreateOrUpdateSlot request. The method always +// CreateOrUpdatePublicCertificateResponder handles the response to the CreateOrUpdatePublicCertificate request. The method always // closes the http.Response Body. -func (client AppsClient) CreateOrUpdateSlotResponder(resp *http.Response) (result Site, err error) { +func (client AppsClient) CreateOrUpdatePublicCertificateResponder(resp *http.Response) (result PublicCertificate, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// CreateOrUpdateSourceControl updates the source control configuration of an app. +// CreateOrUpdatePublicCertificateSlot creates a hostname binding for an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// siteSourceControl - JSON representation of a SiteSourceControl object. See example. -func (client AppsClient) CreateOrUpdateSourceControl(ctx context.Context, resourceGroupName string, name string, siteSourceControl SiteSourceControl) (result AppsCreateOrUpdateSourceControlFuture, err error) { +// publicCertificateName - public certificate name. +// publicCertificate - public certificate details. This is the JSON representation of a PublicCertificate +// object. +// slot - name of the deployment slot. If a slot is not specified, the API will create a binding for the +// production slot. +func (client AppsClient) CreateOrUpdatePublicCertificateSlot(ctx context.Context, resourceGroupName string, name string, publicCertificateName string, publicCertificate PublicCertificate, slot string) (result PublicCertificate, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateSourceControl") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdatePublicCertificateSlot") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -2866,30 +2855,38 @@ func (client AppsClient) CreateOrUpdateSourceControl(ctx context.Context, resour Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "CreateOrUpdateSourceControl", err.Error()) + return result, validation.NewError("web.AppsClient", "CreateOrUpdatePublicCertificateSlot", err.Error()) } - req, err := client.CreateOrUpdateSourceControlPreparer(ctx, resourceGroupName, name, siteSourceControl) + req, err := client.CreateOrUpdatePublicCertificateSlotPreparer(ctx, resourceGroupName, name, publicCertificateName, publicCertificate, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateSourceControl", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdatePublicCertificateSlot", nil, "Failure preparing request") return } - result, err = client.CreateOrUpdateSourceControlSender(req) + resp, err := client.CreateOrUpdatePublicCertificateSlotSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateSourceControl", result.Response(), "Failure sending request") + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdatePublicCertificateSlot", resp, "Failure sending request") return } + result, err = client.CreateOrUpdatePublicCertificateSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdatePublicCertificateSlot", resp, "Failure responding to request") + } + return } -// CreateOrUpdateSourceControlPreparer prepares the CreateOrUpdateSourceControl request. -func (client AppsClient) CreateOrUpdateSourceControlPreparer(ctx context.Context, resourceGroupName string, name string, siteSourceControl SiteSourceControl) (*http.Request, error) { +// CreateOrUpdatePublicCertificateSlotPreparer prepares the CreateOrUpdatePublicCertificateSlot request. +func (client AppsClient) CreateOrUpdatePublicCertificateSlotPreparer(ctx context.Context, resourceGroupName string, name string, publicCertificateName string, publicCertificate PublicCertificate, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "name": autorest.Encode("path", name), + "publicCertificateName": autorest.Encode("path", publicCertificateName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2018-02-01" @@ -2901,52 +2898,46 @@ func (client AppsClient) CreateOrUpdateSourceControlPreparer(ctx context.Context autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web", pathParameters), - autorest.WithJSON(siteSourceControl), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}", pathParameters), + autorest.WithJSON(publicCertificate), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// CreateOrUpdateSourceControlSender sends the CreateOrUpdateSourceControl request. The method will close the +// CreateOrUpdatePublicCertificateSlotSender sends the CreateOrUpdatePublicCertificateSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) CreateOrUpdateSourceControlSender(req *http.Request) (future AppsCreateOrUpdateSourceControlFuture, err error) { +func (client AppsClient) CreateOrUpdatePublicCertificateSlotSender(req *http.Request) (*http.Response, 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 + return autorest.SendWithSender(client, req, sd...) } -// CreateOrUpdateSourceControlResponder handles the response to the CreateOrUpdateSourceControl request. The method always +// CreateOrUpdatePublicCertificateSlotResponder handles the response to the CreateOrUpdatePublicCertificateSlot request. The method always // closes the http.Response Body. -func (client AppsClient) CreateOrUpdateSourceControlResponder(resp *http.Response) (result SiteSourceControl, err error) { +func (client AppsClient) CreateOrUpdatePublicCertificateSlotResponder(resp *http.Response) (result PublicCertificate, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// CreateOrUpdateSourceControlSlot updates the source control configuration of an app. +// CreateOrUpdateRelayServiceConnection creates a new hybrid connection configuration (PUT), or updates an existing one +// (PATCH). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// siteSourceControl - JSON representation of a SiteSourceControl object. See example. -// slot - name of the deployment slot. If a slot is not specified, the API will update the source control -// configuration for the production slot. -func (client AppsClient) CreateOrUpdateSourceControlSlot(ctx context.Context, resourceGroupName string, name string, siteSourceControl SiteSourceControl, slot string) (result AppsCreateOrUpdateSourceControlSlotFuture, err error) { +// entityName - name of the hybrid connection configuration. +// connectionEnvelope - details of the hybrid connection configuration. +func (client AppsClient) CreateOrUpdateRelayServiceConnection(ctx context.Context, resourceGroupName string, name string, entityName string, connectionEnvelope RelayServiceConnectionEntity) (result RelayServiceConnectionEntity, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateSourceControlSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateRelayServiceConnection") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -2956,30 +2947,36 @@ func (client AppsClient) CreateOrUpdateSourceControlSlot(ctx context.Context, re Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "CreateOrUpdateSourceControlSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "CreateOrUpdateRelayServiceConnection", err.Error()) } - req, err := client.CreateOrUpdateSourceControlSlotPreparer(ctx, resourceGroupName, name, siteSourceControl, slot) + req, err := client.CreateOrUpdateRelayServiceConnectionPreparer(ctx, resourceGroupName, name, entityName, connectionEnvelope) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateSourceControlSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateRelayServiceConnection", nil, "Failure preparing request") return } - result, err = client.CreateOrUpdateSourceControlSlotSender(req) + resp, err := client.CreateOrUpdateRelayServiceConnectionSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateSourceControlSlot", result.Response(), "Failure sending request") + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateRelayServiceConnection", resp, "Failure sending request") return } + result, err = client.CreateOrUpdateRelayServiceConnectionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateRelayServiceConnection", resp, "Failure responding to request") + } + return } -// CreateOrUpdateSourceControlSlotPreparer prepares the CreateOrUpdateSourceControlSlot request. -func (client AppsClient) CreateOrUpdateSourceControlSlotPreparer(ctx context.Context, resourceGroupName string, name string, siteSourceControl SiteSourceControl, slot string) (*http.Request, error) { +// CreateOrUpdateRelayServiceConnectionPreparer prepares the CreateOrUpdateRelayServiceConnection request. +func (client AppsClient) CreateOrUpdateRelayServiceConnectionPreparer(ctx context.Context, resourceGroupName string, name string, entityName string, connectionEnvelope RelayServiceConnectionEntity) (*http.Request, error) { pathParameters := map[string]interface{}{ + "entityName": autorest.Encode("path", entityName), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -2992,49 +2989,44 @@ func (client AppsClient) CreateOrUpdateSourceControlSlotPreparer(ctx context.Con autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web", pathParameters), - autorest.WithJSON(siteSourceControl), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}", pathParameters), + autorest.WithJSON(connectionEnvelope), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// CreateOrUpdateSourceControlSlotSender sends the CreateOrUpdateSourceControlSlot request. The method will close the +// CreateOrUpdateRelayServiceConnectionSender sends the CreateOrUpdateRelayServiceConnection request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) CreateOrUpdateSourceControlSlotSender(req *http.Request) (future AppsCreateOrUpdateSourceControlSlotFuture, err error) { +func (client AppsClient) CreateOrUpdateRelayServiceConnectionSender(req *http.Request) (*http.Response, 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 + return autorest.SendWithSender(client, req, sd...) } -// CreateOrUpdateSourceControlSlotResponder handles the response to the CreateOrUpdateSourceControlSlot request. The method always +// CreateOrUpdateRelayServiceConnectionResponder handles the response to the CreateOrUpdateRelayServiceConnection request. The method always // closes the http.Response Body. -func (client AppsClient) CreateOrUpdateSourceControlSlotResponder(resp *http.Response) (result SiteSourceControl, err error) { +func (client AppsClient) CreateOrUpdateRelayServiceConnectionResponder(resp *http.Response) (result RelayServiceConnectionEntity, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// CreateOrUpdateSwiftVirtualNetworkConnection integrates this Web App with a Virtual Network. This requires that 1) -// "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet has already been -// delegated, and is not -// in use by another App Service Plan other than the one this App is in. +// CreateOrUpdateRelayServiceConnectionSlot creates a new hybrid connection configuration (PUT), or updates an existing +// one (PATCH). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// connectionEnvelope - properties of the Virtual Network connection. See example. -func (client AppsClient) CreateOrUpdateSwiftVirtualNetworkConnection(ctx context.Context, resourceGroupName string, name string, connectionEnvelope SwiftVirtualNetwork) (result SwiftVirtualNetwork, err error) { +// entityName - name of the hybrid connection configuration. +// connectionEnvelope - details of the hybrid connection configuration. +// slot - name of the deployment slot. If a slot is not specified, the API will create or update a hybrid +// connection for the production slot. +func (client AppsClient) CreateOrUpdateRelayServiceConnectionSlot(ctx context.Context, resourceGroupName string, name string, entityName string, connectionEnvelope RelayServiceConnectionEntity, slot string) (result RelayServiceConnectionEntity, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateSwiftVirtualNetworkConnection") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateRelayServiceConnectionSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -3048,35 +3040,37 @@ func (client AppsClient) CreateOrUpdateSwiftVirtualNetworkConnection(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("web.AppsClient", "CreateOrUpdateSwiftVirtualNetworkConnection", err.Error()) + return result, validation.NewError("web.AppsClient", "CreateOrUpdateRelayServiceConnectionSlot", err.Error()) } - req, err := client.CreateOrUpdateSwiftVirtualNetworkConnectionPreparer(ctx, resourceGroupName, name, connectionEnvelope) + req, err := client.CreateOrUpdateRelayServiceConnectionSlotPreparer(ctx, resourceGroupName, name, entityName, connectionEnvelope, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateSwiftVirtualNetworkConnection", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateRelayServiceConnectionSlot", nil, "Failure preparing request") return } - resp, err := client.CreateOrUpdateSwiftVirtualNetworkConnectionSender(req) + resp, err := client.CreateOrUpdateRelayServiceConnectionSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateSwiftVirtualNetworkConnection", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateRelayServiceConnectionSlot", resp, "Failure sending request") return } - result, err = client.CreateOrUpdateSwiftVirtualNetworkConnectionResponder(resp) + result, err = client.CreateOrUpdateRelayServiceConnectionSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateSwiftVirtualNetworkConnection", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateRelayServiceConnectionSlot", resp, "Failure responding to request") } return } -// CreateOrUpdateSwiftVirtualNetworkConnectionPreparer prepares the CreateOrUpdateSwiftVirtualNetworkConnection request. -func (client AppsClient) CreateOrUpdateSwiftVirtualNetworkConnectionPreparer(ctx context.Context, resourceGroupName string, name string, connectionEnvelope SwiftVirtualNetwork) (*http.Request, error) { +// CreateOrUpdateRelayServiceConnectionSlotPreparer prepares the CreateOrUpdateRelayServiceConnectionSlot request. +func (client AppsClient) CreateOrUpdateRelayServiceConnectionSlotPreparer(ctx context.Context, resourceGroupName string, name string, entityName string, connectionEnvelope RelayServiceConnectionEntity, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ + "entityName": autorest.Encode("path", entityName), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -3089,22 +3083,22 @@ func (client AppsClient) CreateOrUpdateSwiftVirtualNetworkConnectionPreparer(ctx autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}", pathParameters), autorest.WithJSON(connectionEnvelope), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// CreateOrUpdateSwiftVirtualNetworkConnectionSender sends the CreateOrUpdateSwiftVirtualNetworkConnection request. The method will close the +// CreateOrUpdateRelayServiceConnectionSlotSender sends the CreateOrUpdateRelayServiceConnectionSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) CreateOrUpdateSwiftVirtualNetworkConnectionSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) CreateOrUpdateRelayServiceConnectionSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// CreateOrUpdateSwiftVirtualNetworkConnectionResponder handles the response to the CreateOrUpdateSwiftVirtualNetworkConnection request. The method always +// CreateOrUpdateRelayServiceConnectionSlotResponder handles the response to the CreateOrUpdateRelayServiceConnectionSlot request. The method always // closes the http.Response Body. -func (client AppsClient) CreateOrUpdateSwiftVirtualNetworkConnectionResponder(resp *http.Response) (result SwiftVirtualNetwork, err error) { +func (client AppsClient) CreateOrUpdateRelayServiceConnectionSlotResponder(resp *http.Response) (result RelayServiceConnectionEntity, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -3115,23 +3109,21 @@ func (client AppsClient) CreateOrUpdateSwiftVirtualNetworkConnectionResponder(re return } -// CreateOrUpdateSwiftVirtualNetworkConnectionSlot integrates this Web App with a Virtual Network. This requires that -// 1) "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet has already been -// delegated, and is not -// in use by another App Service Plan other than the one this App is in. +// CreateOrUpdateSlot creates a new web, mobile, or API app in an existing resource group, or updates an existing app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -// connectionEnvelope - properties of the Virtual Network connection. See example. -// slot - name of the deployment slot. If a slot is not specified, the API will add or update connections for +// name - unique name of the app to create or update. To create or update a deployment slot, use the {slot} +// parameter. +// siteEnvelope - a JSON representation of the app properties. See example. +// slot - name of the deployment slot to create or update. By default, this API attempts to create or modify // the production slot. -func (client AppsClient) CreateOrUpdateSwiftVirtualNetworkConnectionSlot(ctx context.Context, resourceGroupName string, name string, connectionEnvelope SwiftVirtualNetwork, slot string) (result SwiftVirtualNetwork, err error) { +func (client AppsClient) CreateOrUpdateSlot(ctx context.Context, resourceGroupName string, name string, siteEnvelope Site, slot string) (result AppsCreateOrUpdateSlotFuture, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateSwiftVirtualNetworkConnectionSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateSlot") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.Response() != nil { + sc = result.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -3140,33 +3132,42 @@ func (client AppsClient) CreateOrUpdateSwiftVirtualNetworkConnectionSlot(ctx con {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "CreateOrUpdateSwiftVirtualNetworkConnectionSlot", err.Error()) + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: siteEnvelope, + Constraints: []validation.Constraint{{Target: "siteEnvelope.SiteProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteEnvelope.SiteProperties.SiteConfig", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteEnvelope.SiteProperties.SiteConfig.Push", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteEnvelope.SiteProperties.SiteConfig.Push.PushSettingsProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteEnvelope.SiteProperties.SiteConfig.Push.PushSettingsProperties.IsPushEnabled", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + {Target: "siteEnvelope.SiteProperties.SiteConfig.ReservedInstanceCount", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteEnvelope.SiteProperties.SiteConfig.ReservedInstanceCount", Name: validation.InclusiveMaximum, Rule: int64(10), Chain: nil}, + {Target: "siteEnvelope.SiteProperties.SiteConfig.ReservedInstanceCount", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, + }}, + }}, + {Target: "siteEnvelope.SiteProperties.CloningInfo", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteEnvelope.SiteProperties.CloningInfo.SourceWebAppID", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "CreateOrUpdateSlot", err.Error()) } - req, err := client.CreateOrUpdateSwiftVirtualNetworkConnectionSlotPreparer(ctx, resourceGroupName, name, connectionEnvelope, slot) + req, err := client.CreateOrUpdateSlotPreparer(ctx, resourceGroupName, name, siteEnvelope, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateSwiftVirtualNetworkConnectionSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateSlot", nil, "Failure preparing request") return } - resp, err := client.CreateOrUpdateSwiftVirtualNetworkConnectionSlotSender(req) + result, err = client.CreateOrUpdateSlotSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateSwiftVirtualNetworkConnectionSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateSlot", result.Response(), "Failure sending request") return } - result, err = client.CreateOrUpdateSwiftVirtualNetworkConnectionSlotResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateSwiftVirtualNetworkConnectionSlot", resp, "Failure responding to request") - } - return } -// CreateOrUpdateSwiftVirtualNetworkConnectionSlotPreparer prepares the CreateOrUpdateSwiftVirtualNetworkConnectionSlot request. -func (client AppsClient) CreateOrUpdateSwiftVirtualNetworkConnectionSlotPreparer(ctx context.Context, resourceGroupName string, name string, connectionEnvelope SwiftVirtualNetwork, slot string) (*http.Request, error) { +// CreateOrUpdateSlotPreparer prepares the CreateOrUpdateSlot request. +func (client AppsClient) CreateOrUpdateSlotPreparer(ctx context.Context, resourceGroupName string, name string, siteEnvelope Site, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -3183,46 +3184,50 @@ func (client AppsClient) CreateOrUpdateSwiftVirtualNetworkConnectionSlotPreparer autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork", pathParameters), - autorest.WithJSON(connectionEnvelope), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}", pathParameters), + autorest.WithJSON(siteEnvelope), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// CreateOrUpdateSwiftVirtualNetworkConnectionSlotSender sends the CreateOrUpdateSwiftVirtualNetworkConnectionSlot request. The method will close the +// CreateOrUpdateSlotSender sends the CreateOrUpdateSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) CreateOrUpdateSwiftVirtualNetworkConnectionSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) CreateOrUpdateSlotSender(req *http.Request) (future AppsCreateOrUpdateSlotFuture, err error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return } -// CreateOrUpdateSwiftVirtualNetworkConnectionSlotResponder handles the response to the CreateOrUpdateSwiftVirtualNetworkConnectionSlot request. The method always +// CreateOrUpdateSlotResponder handles the response to the CreateOrUpdateSlot request. The method always // closes the http.Response Body. -func (client AppsClient) CreateOrUpdateSwiftVirtualNetworkConnectionSlotResponder(resp *http.Response) (result SwiftVirtualNetwork, err error) { +func (client AppsClient) CreateOrUpdateSlotResponder(resp *http.Response) (result Site, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// CreateOrUpdateVnetConnection adds a Virtual Network connection to an app or slot (PUT) or updates the connection -// properties (PATCH). +// CreateOrUpdateSourceControl updates the source control configuration of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// vnetName - name of an existing Virtual Network. -// connectionEnvelope - properties of the Virtual Network connection. See example. -func (client AppsClient) CreateOrUpdateVnetConnection(ctx context.Context, resourceGroupName string, name string, vnetName string, connectionEnvelope VnetInfo) (result VnetInfo, err error) { +// siteSourceControl - JSON representation of a SiteSourceControl object. See example. +func (client AppsClient) CreateOrUpdateSourceControl(ctx context.Context, resourceGroupName string, name string, siteSourceControl SiteSourceControl) (result AppsCreateOrUpdateSourceControlFuture, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateVnetConnection") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateSourceControl") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.Response() != nil { + sc = result.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -3232,37 +3237,30 @@ func (client AppsClient) CreateOrUpdateVnetConnection(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "CreateOrUpdateVnetConnection", err.Error()) + return result, validation.NewError("web.AppsClient", "CreateOrUpdateSourceControl", err.Error()) } - req, err := client.CreateOrUpdateVnetConnectionPreparer(ctx, resourceGroupName, name, vnetName, connectionEnvelope) + req, err := client.CreateOrUpdateSourceControlPreparer(ctx, resourceGroupName, name, siteSourceControl) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateVnetConnection", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateSourceControl", nil, "Failure preparing request") return } - resp, err := client.CreateOrUpdateVnetConnectionSender(req) + result, err = client.CreateOrUpdateSourceControlSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateVnetConnection", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateSourceControl", result.Response(), "Failure sending request") return } - result, err = client.CreateOrUpdateVnetConnectionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateVnetConnection", resp, "Failure responding to request") - } - return } -// CreateOrUpdateVnetConnectionPreparer prepares the CreateOrUpdateVnetConnection request. -func (client AppsClient) CreateOrUpdateVnetConnectionPreparer(ctx context.Context, resourceGroupName string, name string, vnetName string, connectionEnvelope VnetInfo) (*http.Request, error) { +// CreateOrUpdateSourceControlPreparer prepares the CreateOrUpdateSourceControl request. +func (client AppsClient) CreateOrUpdateSourceControlPreparer(ctx context.Context, resourceGroupName string, name string, siteSourceControl SiteSourceControl) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vnetName": autorest.Encode("path", vnetName), } const APIVersion = "2018-02-01" @@ -3274,46 +3272,52 @@ func (client AppsClient) CreateOrUpdateVnetConnectionPreparer(ctx context.Contex autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}", pathParameters), - autorest.WithJSON(connectionEnvelope), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web", pathParameters), + autorest.WithJSON(siteSourceControl), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// CreateOrUpdateVnetConnectionSender sends the CreateOrUpdateVnetConnection request. The method will close the +// CreateOrUpdateSourceControlSender sends the CreateOrUpdateSourceControl request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) CreateOrUpdateVnetConnectionSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) CreateOrUpdateSourceControlSender(req *http.Request) (future AppsCreateOrUpdateSourceControlFuture, err error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return } -// CreateOrUpdateVnetConnectionResponder handles the response to the CreateOrUpdateVnetConnection request. The method always +// CreateOrUpdateSourceControlResponder handles the response to the CreateOrUpdateSourceControl request. The method always // closes the http.Response Body. -func (client AppsClient) CreateOrUpdateVnetConnectionResponder(resp *http.Response) (result VnetInfo, err error) { +func (client AppsClient) CreateOrUpdateSourceControlResponder(resp *http.Response) (result SiteSourceControl, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// CreateOrUpdateVnetConnectionGateway adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). +// CreateOrUpdateSourceControlSlot updates the source control configuration of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// vnetName - name of the Virtual Network. -// gatewayName - name of the gateway. Currently, the only supported string is "primary". -// connectionEnvelope - the properties to update this gateway with. -func (client AppsClient) CreateOrUpdateVnetConnectionGateway(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway) (result VnetGateway, err error) { +// siteSourceControl - JSON representation of a SiteSourceControl object. See example. +// slot - name of the deployment slot. If a slot is not specified, the API will update the source control +// configuration for the production slot. +func (client AppsClient) CreateOrUpdateSourceControlSlot(ctx context.Context, resourceGroupName string, name string, siteSourceControl SiteSourceControl, slot string) (result AppsCreateOrUpdateSourceControlSlotFuture, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateVnetConnectionGateway") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateSourceControlSlot") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.Response() != nil { + sc = result.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -3322,42 +3326,32 @@ func (client AppsClient) CreateOrUpdateVnetConnectionGateway(ctx context.Context {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, - {TargetValue: connectionEnvelope, - Constraints: []validation.Constraint{{Target: "connectionEnvelope.VnetGatewayProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "connectionEnvelope.VnetGatewayProperties.VpnPackageURI", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "CreateOrUpdateVnetConnectionGateway", err.Error()) + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "CreateOrUpdateSourceControlSlot", err.Error()) } - req, err := client.CreateOrUpdateVnetConnectionGatewayPreparer(ctx, resourceGroupName, name, vnetName, gatewayName, connectionEnvelope) + req, err := client.CreateOrUpdateSourceControlSlotPreparer(ctx, resourceGroupName, name, siteSourceControl, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateVnetConnectionGateway", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateSourceControlSlot", nil, "Failure preparing request") return } - resp, err := client.CreateOrUpdateVnetConnectionGatewaySender(req) + result, err = client.CreateOrUpdateSourceControlSlotSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateVnetConnectionGateway", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateSourceControlSlot", result.Response(), "Failure sending request") return } - result, err = client.CreateOrUpdateVnetConnectionGatewayResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateVnetConnectionGateway", resp, "Failure responding to request") - } - return } -// CreateOrUpdateVnetConnectionGatewayPreparer prepares the CreateOrUpdateVnetConnectionGateway request. -func (client AppsClient) CreateOrUpdateVnetConnectionGatewayPreparer(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway) (*http.Request, error) { +// CreateOrUpdateSourceControlSlotPreparer prepares the CreateOrUpdateSourceControlSlot request. +func (client AppsClient) CreateOrUpdateSourceControlSlotPreparer(ctx context.Context, resourceGroupName string, name string, siteSourceControl SiteSourceControl, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "gatewayName": autorest.Encode("path", gatewayName), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vnetName": autorest.Encode("path", vnetName), } const APIVersion = "2018-02-01" @@ -3369,44 +3363,49 @@ func (client AppsClient) CreateOrUpdateVnetConnectionGatewayPreparer(ctx context autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}", pathParameters), - autorest.WithJSON(connectionEnvelope), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web", pathParameters), + autorest.WithJSON(siteSourceControl), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// CreateOrUpdateVnetConnectionGatewaySender sends the CreateOrUpdateVnetConnectionGateway request. The method will close the +// CreateOrUpdateSourceControlSlotSender sends the CreateOrUpdateSourceControlSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) CreateOrUpdateVnetConnectionGatewaySender(req *http.Request) (*http.Response, error) { +func (client AppsClient) CreateOrUpdateSourceControlSlotSender(req *http.Request) (future AppsCreateOrUpdateSourceControlSlotFuture, err error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// CreateOrUpdateVnetConnectionGatewayResponder handles the response to the CreateOrUpdateVnetConnectionGateway request. The method always -// closes the http.Response Body. -func (client AppsClient) CreateOrUpdateVnetConnectionGatewayResponder(resp *http.Response) (result VnetGateway, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateSourceControlSlotResponder handles the response to the CreateOrUpdateSourceControlSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) CreateOrUpdateSourceControlSlotResponder(resp *http.Response) (result SiteSourceControl, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// CreateOrUpdateVnetConnectionGatewaySlot adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). +// CreateOrUpdateSwiftVirtualNetworkConnection integrates this Web App with a Virtual Network. This requires that 1) +// "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet has already been +// delegated, and is not +// in use by another App Service Plan other than the one this App is in. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// vnetName - name of the Virtual Network. -// gatewayName - name of the gateway. Currently, the only supported string is "primary". -// connectionEnvelope - the properties to update this gateway with. -// slot - name of the deployment slot. If a slot is not specified, the API will add or update a gateway for the -// production slot's Virtual Network. -func (client AppsClient) CreateOrUpdateVnetConnectionGatewaySlot(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway, slot string) (result VnetGateway, err error) { +// connectionEnvelope - properties of the Virtual Network connection. See example. +func (client AppsClient) CreateOrUpdateSwiftVirtualNetworkConnection(ctx context.Context, resourceGroupName string, name string, connectionEnvelope SwiftVirtualNetwork) (result SwiftVirtualNetwork, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateVnetConnectionGatewaySlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateSwiftVirtualNetworkConnection") defer func() { sc := -1 if result.Response.Response != nil { @@ -3419,43 +3418,37 @@ func (client AppsClient) CreateOrUpdateVnetConnectionGatewaySlot(ctx context.Con {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, - {TargetValue: connectionEnvelope, - Constraints: []validation.Constraint{{Target: "connectionEnvelope.VnetGatewayProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "connectionEnvelope.VnetGatewayProperties.VpnPackageURI", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "CreateOrUpdateVnetConnectionGatewaySlot", err.Error()) + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "CreateOrUpdateSwiftVirtualNetworkConnection", err.Error()) } - req, err := client.CreateOrUpdateVnetConnectionGatewaySlotPreparer(ctx, resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, slot) + req, err := client.CreateOrUpdateSwiftVirtualNetworkConnectionPreparer(ctx, resourceGroupName, name, connectionEnvelope) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateVnetConnectionGatewaySlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateSwiftVirtualNetworkConnection", nil, "Failure preparing request") return } - resp, err := client.CreateOrUpdateVnetConnectionGatewaySlotSender(req) + resp, err := client.CreateOrUpdateSwiftVirtualNetworkConnectionSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateVnetConnectionGatewaySlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateSwiftVirtualNetworkConnection", resp, "Failure sending request") return } - result, err = client.CreateOrUpdateVnetConnectionGatewaySlotResponder(resp) + result, err = client.CreateOrUpdateSwiftVirtualNetworkConnectionResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateVnetConnectionGatewaySlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateSwiftVirtualNetworkConnection", resp, "Failure responding to request") } return } -// CreateOrUpdateVnetConnectionGatewaySlotPreparer prepares the CreateOrUpdateVnetConnectionGatewaySlot request. -func (client AppsClient) CreateOrUpdateVnetConnectionGatewaySlotPreparer(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway, slot string) (*http.Request, error) { +// CreateOrUpdateSwiftVirtualNetworkConnectionPreparer prepares the CreateOrUpdateSwiftVirtualNetworkConnection request. +func (client AppsClient) CreateOrUpdateSwiftVirtualNetworkConnectionPreparer(ctx context.Context, resourceGroupName string, name string, connectionEnvelope SwiftVirtualNetwork) (*http.Request, error) { pathParameters := map[string]interface{}{ - "gatewayName": autorest.Encode("path", gatewayName), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vnetName": autorest.Encode("path", vnetName), } const APIVersion = "2018-02-01" @@ -3467,22 +3460,22 @@ func (client AppsClient) CreateOrUpdateVnetConnectionGatewaySlotPreparer(ctx con autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork", pathParameters), autorest.WithJSON(connectionEnvelope), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// CreateOrUpdateVnetConnectionGatewaySlotSender sends the CreateOrUpdateVnetConnectionGatewaySlot request. The method will close the +// CreateOrUpdateSwiftVirtualNetworkConnectionSender sends the CreateOrUpdateSwiftVirtualNetworkConnection request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) CreateOrUpdateVnetConnectionGatewaySlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) CreateOrUpdateSwiftVirtualNetworkConnectionSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// CreateOrUpdateVnetConnectionGatewaySlotResponder handles the response to the CreateOrUpdateVnetConnectionGatewaySlot request. The method always +// CreateOrUpdateSwiftVirtualNetworkConnectionResponder handles the response to the CreateOrUpdateSwiftVirtualNetworkConnection request. The method always // closes the http.Response Body. -func (client AppsClient) CreateOrUpdateVnetConnectionGatewaySlotResponder(resp *http.Response) (result VnetGateway, err error) { +func (client AppsClient) CreateOrUpdateSwiftVirtualNetworkConnectionResponder(resp *http.Response) (result SwiftVirtualNetwork, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -3493,18 +3486,19 @@ func (client AppsClient) CreateOrUpdateVnetConnectionGatewaySlotResponder(resp * return } -// CreateOrUpdateVnetConnectionSlot adds a Virtual Network connection to an app or slot (PUT) or updates the connection -// properties (PATCH). +// CreateOrUpdateSwiftVirtualNetworkConnectionSlot integrates this Web App with a Virtual Network. This requires that +// 1) "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet has already been +// delegated, and is not +// in use by another App Service Plan other than the one this App is in. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// vnetName - name of an existing Virtual Network. // connectionEnvelope - properties of the Virtual Network connection. See example. // slot - name of the deployment slot. If a slot is not specified, the API will add or update connections for // the production slot. -func (client AppsClient) CreateOrUpdateVnetConnectionSlot(ctx context.Context, resourceGroupName string, name string, vnetName string, connectionEnvelope VnetInfo, slot string) (result VnetInfo, err error) { +func (client AppsClient) CreateOrUpdateSwiftVirtualNetworkConnectionSlot(ctx context.Context, resourceGroupName string, name string, connectionEnvelope SwiftVirtualNetwork, slot string) (result SwiftVirtualNetwork, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateVnetConnectionSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateSwiftVirtualNetworkConnectionSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -3518,38 +3512,37 @@ func (client AppsClient) CreateOrUpdateVnetConnectionSlot(ctx context.Context, r Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "CreateOrUpdateVnetConnectionSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "CreateOrUpdateSwiftVirtualNetworkConnectionSlot", err.Error()) } - req, err := client.CreateOrUpdateVnetConnectionSlotPreparer(ctx, resourceGroupName, name, vnetName, connectionEnvelope, slot) + req, err := client.CreateOrUpdateSwiftVirtualNetworkConnectionSlotPreparer(ctx, resourceGroupName, name, connectionEnvelope, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateVnetConnectionSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateSwiftVirtualNetworkConnectionSlot", nil, "Failure preparing request") return } - resp, err := client.CreateOrUpdateVnetConnectionSlotSender(req) + resp, err := client.CreateOrUpdateSwiftVirtualNetworkConnectionSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateVnetConnectionSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateSwiftVirtualNetworkConnectionSlot", resp, "Failure sending request") return } - result, err = client.CreateOrUpdateVnetConnectionSlotResponder(resp) + result, err = client.CreateOrUpdateSwiftVirtualNetworkConnectionSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateVnetConnectionSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateSwiftVirtualNetworkConnectionSlot", resp, "Failure responding to request") } return } -// CreateOrUpdateVnetConnectionSlotPreparer prepares the CreateOrUpdateVnetConnectionSlot request. -func (client AppsClient) CreateOrUpdateVnetConnectionSlotPreparer(ctx context.Context, resourceGroupName string, name string, vnetName string, connectionEnvelope VnetInfo, slot string) (*http.Request, error) { +// CreateOrUpdateSwiftVirtualNetworkConnectionSlotPreparer prepares the CreateOrUpdateSwiftVirtualNetworkConnectionSlot request. +func (client AppsClient) CreateOrUpdateSwiftVirtualNetworkConnectionSlotPreparer(ctx context.Context, resourceGroupName string, name string, connectionEnvelope SwiftVirtualNetwork, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vnetName": autorest.Encode("path", vnetName), } const APIVersion = "2018-02-01" @@ -3561,22 +3554,22 @@ func (client AppsClient) CreateOrUpdateVnetConnectionSlotPreparer(ctx context.Co autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork", pathParameters), autorest.WithJSON(connectionEnvelope), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// CreateOrUpdateVnetConnectionSlotSender sends the CreateOrUpdateVnetConnectionSlot request. The method will close the +// CreateOrUpdateSwiftVirtualNetworkConnectionSlotSender sends the CreateOrUpdateSwiftVirtualNetworkConnectionSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) CreateOrUpdateVnetConnectionSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) CreateOrUpdateSwiftVirtualNetworkConnectionSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// CreateOrUpdateVnetConnectionSlotResponder handles the response to the CreateOrUpdateVnetConnectionSlot request. The method always +// CreateOrUpdateSwiftVirtualNetworkConnectionSlotResponder handles the response to the CreateOrUpdateSwiftVirtualNetworkConnectionSlot request. The method always // closes the http.Response Body. -func (client AppsClient) CreateOrUpdateVnetConnectionSlotResponder(resp *http.Response) (result VnetInfo, err error) { +func (client AppsClient) CreateOrUpdateSwiftVirtualNetworkConnectionSlotResponder(resp *http.Response) (result SwiftVirtualNetwork, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -3587,20 +3580,20 @@ func (client AppsClient) CreateOrUpdateVnetConnectionSlotResponder(resp *http.Re return } -// Delete deletes a web, mobile, or API app, or one of the deployment slots. +// CreateOrUpdateVnetConnection adds a Virtual Network connection to an app or slot (PUT) or updates the connection +// properties (PATCH). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app to delete. -// deleteMetrics - if true, web app metrics are also deleted. -// deleteEmptyServerFarm - specify true if the App Service plan will be empty after app deletion and you want -// to delete the empty App Service plan. By default, the empty App Service plan is not deleted. -func (client AppsClient) Delete(ctx context.Context, resourceGroupName string, name string, deleteMetrics *bool, deleteEmptyServerFarm *bool) (result autorest.Response, err error) { +// name - name of the app. +// vnetName - name of an existing Virtual Network. +// connectionEnvelope - properties of the Virtual Network connection. See example. +func (client AppsClient) CreateOrUpdateVnetConnection(ctx context.Context, resourceGroupName string, name string, vnetName string, connectionEnvelope VnetInfo) (result VnetInfo, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.Delete") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateVnetConnection") defer func() { sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -3610,88 +3603,88 @@ func (client AppsClient) Delete(ctx context.Context, resourceGroupName string, n Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "Delete", err.Error()) + return result, validation.NewError("web.AppsClient", "CreateOrUpdateVnetConnection", err.Error()) } - req, err := client.DeletePreparer(ctx, resourceGroupName, name, deleteMetrics, deleteEmptyServerFarm) + req, err := client.CreateOrUpdateVnetConnectionPreparer(ctx, resourceGroupName, name, vnetName, connectionEnvelope) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "Delete", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateVnetConnection", nil, "Failure preparing request") return } - resp, err := client.DeleteSender(req) + resp, err := client.CreateOrUpdateVnetConnectionSender(req) if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "web.AppsClient", "Delete", resp, "Failure sending request") + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateVnetConnection", resp, "Failure sending request") return } - result, err = client.DeleteResponder(resp) + result, err = client.CreateOrUpdateVnetConnectionResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "Delete", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateVnetConnection", resp, "Failure responding to request") } return } -// DeletePreparer prepares the Delete request. -func (client AppsClient) DeletePreparer(ctx context.Context, resourceGroupName string, name string, deleteMetrics *bool, deleteEmptyServerFarm *bool) (*http.Request, error) { +// CreateOrUpdateVnetConnectionPreparer prepares the CreateOrUpdateVnetConnection request. +func (client AppsClient) CreateOrUpdateVnetConnectionPreparer(ctx context.Context, resourceGroupName string, name string, vnetName string, connectionEnvelope VnetInfo) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vnetName": autorest.Encode("path", vnetName), } const APIVersion = "2018-02-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } - if deleteMetrics != nil { - queryParameters["deleteMetrics"] = autorest.Encode("query", *deleteMetrics) - } - if deleteEmptyServerFarm != nil { - queryParameters["deleteEmptyServerFarm"] = autorest.Encode("query", *deleteEmptyServerFarm) - } preparer := autorest.CreatePreparer( - autorest.AsDelete(), + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}", pathParameters), + autorest.WithJSON(connectionEnvelope), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// DeleteSender sends the Delete request. The method will close the +// CreateOrUpdateVnetConnectionSender sends the CreateOrUpdateVnetConnection request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) DeleteSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) CreateOrUpdateVnetConnectionSender(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 +// CreateOrUpdateVnetConnectionResponder handles the response to the CreateOrUpdateVnetConnection request. The method always // closes the http.Response Body. -func (client AppsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AppsClient) CreateOrUpdateVnetConnectionResponder(resp *http.Response) (result VnetInfo, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) - result.Response = resp + result.Response = autorest.Response{Response: resp} return } -// DeleteBackup deletes a backup of an app by its ID. +// CreateOrUpdateVnetConnectionGateway adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// backupID - ID of the backup. -func (client AppsClient) DeleteBackup(ctx context.Context, resourceGroupName string, name string, backupID string) (result autorest.Response, err error) { +// vnetName - name of the Virtual Network. +// gatewayName - name of the gateway. Currently, the only supported string is "primary". +// connectionEnvelope - the properties to update this gateway with. +func (client AppsClient) CreateOrUpdateVnetConnectionGateway(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway) (result VnetGateway, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteBackup") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateVnetConnectionGateway") defer func() { sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -3700,38 +3693,42 @@ func (client AppsClient) DeleteBackup(ctx context.Context, resourceGroupName str {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "DeleteBackup", err.Error()) + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: connectionEnvelope, + Constraints: []validation.Constraint{{Target: "connectionEnvelope.VnetGatewayProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "connectionEnvelope.VnetGatewayProperties.VpnPackageURI", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "CreateOrUpdateVnetConnectionGateway", err.Error()) } - req, err := client.DeleteBackupPreparer(ctx, resourceGroupName, name, backupID) + req, err := client.CreateOrUpdateVnetConnectionGatewayPreparer(ctx, resourceGroupName, name, vnetName, gatewayName, connectionEnvelope) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteBackup", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateVnetConnectionGateway", nil, "Failure preparing request") return } - resp, err := client.DeleteBackupSender(req) + resp, err := client.CreateOrUpdateVnetConnectionGatewaySender(req) if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteBackup", resp, "Failure sending request") + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateVnetConnectionGateway", resp, "Failure sending request") return } - result, err = client.DeleteBackupResponder(resp) + result, err = client.CreateOrUpdateVnetConnectionGatewayResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteBackup", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateVnetConnectionGateway", resp, "Failure responding to request") } return } -// DeleteBackupPreparer prepares the DeleteBackup request. -func (client AppsClient) DeleteBackupPreparer(ctx context.Context, resourceGroupName string, name string, backupID string) (*http.Request, error) { +// CreateOrUpdateVnetConnectionGatewayPreparer prepares the CreateOrUpdateVnetConnectionGateway request. +func (client AppsClient) CreateOrUpdateVnetConnectionGatewayPreparer(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway) (*http.Request, error) { pathParameters := map[string]interface{}{ - "backupId": autorest.Encode("path", backupID), + "gatewayName": autorest.Encode("path", gatewayName), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vnetName": autorest.Encode("path", vnetName), } const APIVersion = "2018-02-01" @@ -3740,43 +3737,51 @@ func (client AppsClient) DeleteBackupPreparer(ctx context.Context, resourceGroup } preparer := autorest.CreatePreparer( - autorest.AsDelete(), + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}", pathParameters), + autorest.WithJSON(connectionEnvelope), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// DeleteBackupSender sends the DeleteBackup request. The method will close the +// CreateOrUpdateVnetConnectionGatewaySender sends the CreateOrUpdateVnetConnectionGateway request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) DeleteBackupSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) CreateOrUpdateVnetConnectionGatewaySender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// DeleteBackupResponder handles the response to the DeleteBackup request. The method always +// CreateOrUpdateVnetConnectionGatewayResponder handles the response to the CreateOrUpdateVnetConnectionGateway request. The method always // closes the http.Response Body. -func (client AppsClient) DeleteBackupResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AppsClient) CreateOrUpdateVnetConnectionGatewayResponder(resp *http.Response) (result VnetGateway, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) - result.Response = resp + result.Response = autorest.Response{Response: resp} return } -// DeleteBackupConfiguration deletes the backup configuration of an app. +// CreateOrUpdateVnetConnectionGatewaySlot adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -func (client AppsClient) DeleteBackupConfiguration(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) { +// vnetName - name of the Virtual Network. +// gatewayName - name of the gateway. Currently, the only supported string is "primary". +// connectionEnvelope - the properties to update this gateway with. +// slot - name of the deployment slot. If a slot is not specified, the API will add or update a gateway for the +// production slot's Virtual Network. +func (client AppsClient) CreateOrUpdateVnetConnectionGatewaySlot(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway, slot string) (result VnetGateway, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteBackupConfiguration") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateVnetConnectionGatewaySlot") defer func() { sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -3785,37 +3790,43 @@ func (client AppsClient) DeleteBackupConfiguration(ctx context.Context, resource {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "DeleteBackupConfiguration", err.Error()) + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: connectionEnvelope, + Constraints: []validation.Constraint{{Target: "connectionEnvelope.VnetGatewayProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "connectionEnvelope.VnetGatewayProperties.VpnPackageURI", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "CreateOrUpdateVnetConnectionGatewaySlot", err.Error()) } - req, err := client.DeleteBackupConfigurationPreparer(ctx, resourceGroupName, name) + req, err := client.CreateOrUpdateVnetConnectionGatewaySlotPreparer(ctx, resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteBackupConfiguration", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateVnetConnectionGatewaySlot", nil, "Failure preparing request") return } - resp, err := client.DeleteBackupConfigurationSender(req) + resp, err := client.CreateOrUpdateVnetConnectionGatewaySlotSender(req) if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteBackupConfiguration", resp, "Failure sending request") + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateVnetConnectionGatewaySlot", resp, "Failure sending request") return } - result, err = client.DeleteBackupConfigurationResponder(resp) + result, err = client.CreateOrUpdateVnetConnectionGatewaySlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteBackupConfiguration", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateVnetConnectionGatewaySlot", resp, "Failure responding to request") } return } -// DeleteBackupConfigurationPreparer prepares the DeleteBackupConfiguration request. -func (client AppsClient) DeleteBackupConfigurationPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { +// CreateOrUpdateVnetConnectionGatewaySlotPreparer prepares the CreateOrUpdateVnetConnectionGatewaySlot request. +func (client AppsClient) CreateOrUpdateVnetConnectionGatewaySlotPreparer(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ + "gatewayName": autorest.Encode("path", gatewayName), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vnetName": autorest.Encode("path", vnetName), } const APIVersion = "2018-02-01" @@ -3824,45 +3835,51 @@ func (client AppsClient) DeleteBackupConfigurationPreparer(ctx context.Context, } preparer := autorest.CreatePreparer( - autorest.AsDelete(), + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/backup", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}", pathParameters), + autorest.WithJSON(connectionEnvelope), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// DeleteBackupConfigurationSender sends the DeleteBackupConfiguration request. The method will close the +// CreateOrUpdateVnetConnectionGatewaySlotSender sends the CreateOrUpdateVnetConnectionGatewaySlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) DeleteBackupConfigurationSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) CreateOrUpdateVnetConnectionGatewaySlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// DeleteBackupConfigurationResponder handles the response to the DeleteBackupConfiguration request. The method always +// CreateOrUpdateVnetConnectionGatewaySlotResponder handles the response to the CreateOrUpdateVnetConnectionGatewaySlot request. The method always // closes the http.Response Body. -func (client AppsClient) DeleteBackupConfigurationResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AppsClient) CreateOrUpdateVnetConnectionGatewaySlotResponder(resp *http.Response) (result VnetGateway, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) - result.Response = resp + result.Response = autorest.Response{Response: resp} return } -// DeleteBackupConfigurationSlot deletes the backup configuration of an app. +// CreateOrUpdateVnetConnectionSlot adds a Virtual Network connection to an app or slot (PUT) or updates the connection +// properties (PATCH). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// slot - name of the deployment slot. If a slot is not specified, the API will delete the backup configuration -// for the production slot. -func (client AppsClient) DeleteBackupConfigurationSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) { +// vnetName - name of an existing Virtual Network. +// connectionEnvelope - properties of the Virtual Network connection. See example. +// slot - name of the deployment slot. If a slot is not specified, the API will add or update connections for +// the production slot. +func (client AppsClient) CreateOrUpdateVnetConnectionSlot(ctx context.Context, resourceGroupName string, name string, vnetName string, connectionEnvelope VnetInfo, slot string) (result VnetInfo, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteBackupConfigurationSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateVnetConnectionSlot") defer func() { sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -3872,37 +3889,38 @@ func (client AppsClient) DeleteBackupConfigurationSlot(ctx context.Context, reso Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "DeleteBackupConfigurationSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "CreateOrUpdateVnetConnectionSlot", err.Error()) } - req, err := client.DeleteBackupConfigurationSlotPreparer(ctx, resourceGroupName, name, slot) + req, err := client.CreateOrUpdateVnetConnectionSlotPreparer(ctx, resourceGroupName, name, vnetName, connectionEnvelope, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteBackupConfigurationSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateVnetConnectionSlot", nil, "Failure preparing request") return } - resp, err := client.DeleteBackupConfigurationSlotSender(req) + resp, err := client.CreateOrUpdateVnetConnectionSlotSender(req) if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteBackupConfigurationSlot", resp, "Failure sending request") + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateVnetConnectionSlot", resp, "Failure sending request") return } - result, err = client.DeleteBackupConfigurationSlotResponder(resp) + result, err = client.CreateOrUpdateVnetConnectionSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteBackupConfigurationSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateVnetConnectionSlot", resp, "Failure responding to request") } return } -// DeleteBackupConfigurationSlotPreparer prepares the DeleteBackupConfigurationSlot request. -func (client AppsClient) DeleteBackupConfigurationSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { +// CreateOrUpdateVnetConnectionSlotPreparer prepares the CreateOrUpdateVnetConnectionSlot request. +func (client AppsClient) CreateOrUpdateVnetConnectionSlotPreparer(ctx context.Context, resourceGroupName string, name string, vnetName string, connectionEnvelope VnetInfo, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vnetName": autorest.Encode("path", vnetName), } const APIVersion = "2018-02-01" @@ -3911,42 +3929,45 @@ func (client AppsClient) DeleteBackupConfigurationSlotPreparer(ctx context.Conte } preparer := autorest.CreatePreparer( - autorest.AsDelete(), + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}", pathParameters), + autorest.WithJSON(connectionEnvelope), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// DeleteBackupConfigurationSlotSender sends the DeleteBackupConfigurationSlot request. The method will close the +// CreateOrUpdateVnetConnectionSlotSender sends the CreateOrUpdateVnetConnectionSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) DeleteBackupConfigurationSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) CreateOrUpdateVnetConnectionSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// DeleteBackupConfigurationSlotResponder handles the response to the DeleteBackupConfigurationSlot request. The method always +// CreateOrUpdateVnetConnectionSlotResponder handles the response to the CreateOrUpdateVnetConnectionSlot request. The method always // closes the http.Response Body. -func (client AppsClient) DeleteBackupConfigurationSlotResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AppsClient) CreateOrUpdateVnetConnectionSlotResponder(resp *http.Response) (result VnetInfo, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) - result.Response = resp + result.Response = autorest.Response{Response: resp} return } -// DeleteBackupSlot deletes a backup of an app by its ID. +// Delete deletes a web, mobile, or API app, or one of the deployment slots. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -// backupID - ID of the backup. -// slot - name of the deployment slot. If a slot is not specified, the API will delete a backup of the -// production slot. -func (client AppsClient) DeleteBackupSlot(ctx context.Context, resourceGroupName string, name string, backupID string, slot string) (result autorest.Response, err error) { +// name - name of the app to delete. +// deleteMetrics - if true, web app metrics are also deleted. +// deleteEmptyServerFarm - specify true if the App Service plan will be empty after app deletion and you want +// to delete the empty App Service plan. By default, the empty App Service plan is not deleted. +func (client AppsClient) Delete(ctx context.Context, resourceGroupName string, name string, deleteMetrics *bool, deleteEmptyServerFarm *bool) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteBackupSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.Delete") defer func() { sc := -1 if result.Response != nil { @@ -3960,37 +3981,35 @@ func (client AppsClient) DeleteBackupSlot(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "DeleteBackupSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "Delete", err.Error()) } - req, err := client.DeleteBackupSlotPreparer(ctx, resourceGroupName, name, backupID, slot) + req, err := client.DeletePreparer(ctx, resourceGroupName, name, deleteMetrics, deleteEmptyServerFarm) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteBackupSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "Delete", nil, "Failure preparing request") return } - resp, err := client.DeleteBackupSlotSender(req) + resp, err := client.DeleteSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteBackupSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "Delete", resp, "Failure sending request") return } - result, err = client.DeleteBackupSlotResponder(resp) + result, err = client.DeleteResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteBackupSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "Delete", resp, "Failure responding to request") } return } -// DeleteBackupSlotPreparer prepares the DeleteBackupSlot request. -func (client AppsClient) DeleteBackupSlotPreparer(ctx context.Context, resourceGroupName string, name string, backupID string, slot string) (*http.Request, error) { +// DeletePreparer prepares the Delete request. +func (client AppsClient) DeletePreparer(ctx context.Context, resourceGroupName string, name string, deleteMetrics *bool, deleteEmptyServerFarm *bool) (*http.Request, error) { pathParameters := map[string]interface{}{ - "backupId": autorest.Encode("path", backupID), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -3998,42 +4017,48 @@ func (client AppsClient) DeleteBackupSlotPreparer(ctx context.Context, resourceG queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if deleteMetrics != nil { + queryParameters["deleteMetrics"] = autorest.Encode("query", *deleteMetrics) + } + if deleteEmptyServerFarm != nil { + queryParameters["deleteEmptyServerFarm"] = autorest.Encode("query", *deleteEmptyServerFarm) + } preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// DeleteBackupSlotSender sends the DeleteBackupSlot request. The method will close the +// DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) DeleteBackupSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) DeleteSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// DeleteBackupSlotResponder handles the response to the DeleteBackupSlot request. The method always +// DeleteResponder handles the response to the Delete request. The method always // closes the http.Response Body. -func (client AppsClient) DeleteBackupSlotResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AppsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), autorest.ByClosing()) result.Response = resp return } -// DeleteContinuousWebJob delete a continuous web job by its ID for an app, or a deployment slot. +// DeleteBackup deletes a backup of an app by its ID. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - site name. -// webJobName - name of Web Job. -func (client AppsClient) DeleteContinuousWebJob(ctx context.Context, resourceGroupName string, name string, webJobName string) (result autorest.Response, err error) { +// name - name of the app. +// backupID - ID of the backup. +func (client AppsClient) DeleteBackup(ctx context.Context, resourceGroupName string, name string, backupID string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteContinuousWebJob") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteBackup") defer func() { sc := -1 if result.Response != nil { @@ -4047,37 +4072,37 @@ func (client AppsClient) DeleteContinuousWebJob(ctx context.Context, resourceGro Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "DeleteContinuousWebJob", err.Error()) + return result, validation.NewError("web.AppsClient", "DeleteBackup", err.Error()) } - req, err := client.DeleteContinuousWebJobPreparer(ctx, resourceGroupName, name, webJobName) + req, err := client.DeleteBackupPreparer(ctx, resourceGroupName, name, backupID) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteContinuousWebJob", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteBackup", nil, "Failure preparing request") return } - resp, err := client.DeleteContinuousWebJobSender(req) + resp, err := client.DeleteBackupSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteContinuousWebJob", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteBackup", resp, "Failure sending request") return } - result, err = client.DeleteContinuousWebJobResponder(resp) + result, err = client.DeleteBackupResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteContinuousWebJob", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteBackup", resp, "Failure responding to request") } return } -// DeleteContinuousWebJobPreparer prepares the DeleteContinuousWebJob request. -func (client AppsClient) DeleteContinuousWebJobPreparer(ctx context.Context, resourceGroupName string, name string, webJobName string) (*http.Request, error) { +// DeleteBackupPreparer prepares the DeleteBackup request. +func (client AppsClient) DeleteBackupPreparer(ctx context.Context, resourceGroupName string, name string, backupID string) (*http.Request, error) { pathParameters := map[string]interface{}{ + "backupId": autorest.Encode("path", backupID), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "webJobName": autorest.Encode("path", webJobName), } const APIVersion = "2018-02-01" @@ -4088,40 +4113,37 @@ func (client AppsClient) DeleteContinuousWebJobPreparer(ctx context.Context, res preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// DeleteContinuousWebJobSender sends the DeleteContinuousWebJob request. The method will close the +// DeleteBackupSender sends the DeleteBackup request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) DeleteContinuousWebJobSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) DeleteBackupSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// DeleteContinuousWebJobResponder handles the response to the DeleteContinuousWebJob request. The method always +// DeleteBackupResponder handles the response to the DeleteBackup request. The method always // closes the http.Response Body. -func (client AppsClient) DeleteContinuousWebJobResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AppsClient) DeleteBackupResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), autorest.ByClosing()) result.Response = resp return } -// DeleteContinuousWebJobSlot delete a continuous web job by its ID for an app, or a deployment slot. +// DeleteBackupConfiguration deletes the backup configuration of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - site name. -// webJobName - name of Web Job. -// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the -// production slot. -func (client AppsClient) DeleteContinuousWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (result autorest.Response, err error) { +// name - name of the app. +func (client AppsClient) DeleteBackupConfiguration(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteContinuousWebJobSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteBackupConfiguration") defer func() { sc := -1 if result.Response != nil { @@ -4135,38 +4157,36 @@ func (client AppsClient) DeleteContinuousWebJobSlot(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "DeleteContinuousWebJobSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "DeleteBackupConfiguration", err.Error()) } - req, err := client.DeleteContinuousWebJobSlotPreparer(ctx, resourceGroupName, name, webJobName, slot) + req, err := client.DeleteBackupConfigurationPreparer(ctx, resourceGroupName, name) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteContinuousWebJobSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteBackupConfiguration", nil, "Failure preparing request") return } - resp, err := client.DeleteContinuousWebJobSlotSender(req) + resp, err := client.DeleteBackupConfigurationSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteContinuousWebJobSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteBackupConfiguration", resp, "Failure sending request") return } - result, err = client.DeleteContinuousWebJobSlotResponder(resp) + result, err = client.DeleteBackupConfigurationResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteContinuousWebJobSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteBackupConfiguration", resp, "Failure responding to request") } return } -// DeleteContinuousWebJobSlotPreparer prepares the DeleteContinuousWebJobSlot request. -func (client AppsClient) DeleteContinuousWebJobSlotPreparer(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (*http.Request, error) { +// DeleteBackupConfigurationPreparer prepares the DeleteBackupConfiguration request. +func (client AppsClient) DeleteBackupConfigurationPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "webJobName": autorest.Encode("path", webJobName), } const APIVersion = "2018-02-01" @@ -4177,38 +4197,39 @@ func (client AppsClient) DeleteContinuousWebJobSlotPreparer(ctx context.Context, preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/backup", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// DeleteContinuousWebJobSlotSender sends the DeleteContinuousWebJobSlot request. The method will close the +// DeleteBackupConfigurationSender sends the DeleteBackupConfiguration request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) DeleteContinuousWebJobSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) DeleteBackupConfigurationSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// DeleteContinuousWebJobSlotResponder handles the response to the DeleteContinuousWebJobSlot request. The method always +// DeleteBackupConfigurationResponder handles the response to the DeleteBackupConfiguration request. The method always // closes the http.Response Body. -func (client AppsClient) DeleteContinuousWebJobSlotResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AppsClient) DeleteBackupConfigurationResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByClosing()) result.Response = resp return } -// DeleteDeployment delete a deployment by its ID for an app, or a deployment slot. +// DeleteBackupConfigurationSlot deletes the backup configuration of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// ID - deployment ID. -func (client AppsClient) DeleteDeployment(ctx context.Context, resourceGroupName string, name string, ID string) (result autorest.Response, err error) { +// slot - name of the deployment slot. If a slot is not specified, the API will delete the backup configuration +// for the production slot. +func (client AppsClient) DeleteBackupConfigurationSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteDeployment") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteBackupConfigurationSlot") defer func() { sc := -1 if result.Response != nil { @@ -4222,36 +4243,36 @@ func (client AppsClient) DeleteDeployment(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "DeleteDeployment", err.Error()) + return result, validation.NewError("web.AppsClient", "DeleteBackupConfigurationSlot", err.Error()) } - req, err := client.DeleteDeploymentPreparer(ctx, resourceGroupName, name, ID) + req, err := client.DeleteBackupConfigurationSlotPreparer(ctx, resourceGroupName, name, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteDeployment", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteBackupConfigurationSlot", nil, "Failure preparing request") return } - resp, err := client.DeleteDeploymentSender(req) + resp, err := client.DeleteBackupConfigurationSlotSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteDeployment", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteBackupConfigurationSlot", resp, "Failure sending request") return } - result, err = client.DeleteDeploymentResponder(resp) + result, err = client.DeleteBackupConfigurationSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteDeployment", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteBackupConfigurationSlot", resp, "Failure responding to request") } return } -// DeleteDeploymentPreparer prepares the DeleteDeployment request. -func (client AppsClient) DeleteDeploymentPreparer(ctx context.Context, resourceGroupName string, name string, ID string) (*http.Request, error) { +// DeleteBackupConfigurationSlotPreparer prepares the DeleteBackupConfigurationSlot request. +func (client AppsClient) DeleteBackupConfigurationSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "id": autorest.Encode("path", ID), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -4263,40 +4284,40 @@ func (client AppsClient) DeleteDeploymentPreparer(ctx context.Context, resourceG preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// DeleteDeploymentSender sends the DeleteDeployment request. The method will close the +// DeleteBackupConfigurationSlotSender sends the DeleteBackupConfigurationSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) DeleteDeploymentSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) DeleteBackupConfigurationSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// DeleteDeploymentResponder handles the response to the DeleteDeployment request. The method always +// DeleteBackupConfigurationSlotResponder handles the response to the DeleteBackupConfigurationSlot request. The method always // closes the http.Response Body. -func (client AppsClient) DeleteDeploymentResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AppsClient) DeleteBackupConfigurationSlotResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByClosing()) result.Response = resp return } -// DeleteDeploymentSlot delete a deployment by its ID for an app, or a deployment slot. +// DeleteBackupSlot deletes a backup of an app by its ID. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// ID - deployment ID. -// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the +// backupID - ID of the backup. +// slot - name of the deployment slot. If a slot is not specified, the API will delete a backup of the // production slot. -func (client AppsClient) DeleteDeploymentSlot(ctx context.Context, resourceGroupName string, name string, ID string, slot string) (result autorest.Response, err error) { +func (client AppsClient) DeleteBackupSlot(ctx context.Context, resourceGroupName string, name string, backupID string, slot string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteDeploymentSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteBackupSlot") defer func() { sc := -1 if result.Response != nil { @@ -4310,34 +4331,34 @@ func (client AppsClient) DeleteDeploymentSlot(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "DeleteDeploymentSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "DeleteBackupSlot", err.Error()) } - req, err := client.DeleteDeploymentSlotPreparer(ctx, resourceGroupName, name, ID, slot) + req, err := client.DeleteBackupSlotPreparer(ctx, resourceGroupName, name, backupID, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteDeploymentSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteBackupSlot", nil, "Failure preparing request") return } - resp, err := client.DeleteDeploymentSlotSender(req) + resp, err := client.DeleteBackupSlotSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteDeploymentSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteBackupSlot", resp, "Failure sending request") return } - result, err = client.DeleteDeploymentSlotResponder(resp) + result, err = client.DeleteBackupSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteDeploymentSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteBackupSlot", resp, "Failure responding to request") } return } -// DeleteDeploymentSlotPreparer prepares the DeleteDeploymentSlot request. -func (client AppsClient) DeleteDeploymentSlotPreparer(ctx context.Context, resourceGroupName string, name string, ID string, slot string) (*http.Request, error) { +// DeleteBackupSlotPreparer prepares the DeleteBackupSlot request. +func (client AppsClient) DeleteBackupSlotPreparer(ctx context.Context, resourceGroupName string, name string, backupID string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "id": autorest.Encode("path", ID), + "backupId": autorest.Encode("path", backupID), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), "slot": autorest.Encode("path", slot), @@ -4352,38 +4373,38 @@ func (client AppsClient) DeleteDeploymentSlotPreparer(ctx context.Context, resou preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// DeleteDeploymentSlotSender sends the DeleteDeploymentSlot request. The method will close the +// DeleteBackupSlotSender sends the DeleteBackupSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) DeleteDeploymentSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) DeleteBackupSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// DeleteDeploymentSlotResponder handles the response to the DeleteDeploymentSlot request. The method always +// DeleteBackupSlotResponder handles the response to the DeleteBackupSlot request. The method always // closes the http.Response Body. -func (client AppsClient) DeleteDeploymentSlotResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AppsClient) DeleteBackupSlotResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), autorest.ByClosing()) result.Response = resp return } -// DeleteDomainOwnershipIdentifier deletes a domain ownership identifier for a web app. +// DeleteContinuousWebJob delete a continuous web job by its ID for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -// domainOwnershipIdentifierName - name of domain ownership identifier. -func (client AppsClient) DeleteDomainOwnershipIdentifier(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string) (result autorest.Response, err error) { +// name - site name. +// webJobName - name of Web Job. +func (client AppsClient) DeleteContinuousWebJob(ctx context.Context, resourceGroupName string, name string, webJobName string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteDomainOwnershipIdentifier") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteContinuousWebJob") defer func() { sc := -1 if result.Response != nil { @@ -4397,37 +4418,37 @@ func (client AppsClient) DeleteDomainOwnershipIdentifier(ctx context.Context, re Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "DeleteDomainOwnershipIdentifier", err.Error()) + return result, validation.NewError("web.AppsClient", "DeleteContinuousWebJob", err.Error()) } - req, err := client.DeleteDomainOwnershipIdentifierPreparer(ctx, resourceGroupName, name, domainOwnershipIdentifierName) + req, err := client.DeleteContinuousWebJobPreparer(ctx, resourceGroupName, name, webJobName) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteDomainOwnershipIdentifier", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteContinuousWebJob", nil, "Failure preparing request") return } - resp, err := client.DeleteDomainOwnershipIdentifierSender(req) + resp, err := client.DeleteContinuousWebJobSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteDomainOwnershipIdentifier", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteContinuousWebJob", resp, "Failure sending request") return } - result, err = client.DeleteDomainOwnershipIdentifierResponder(resp) + result, err = client.DeleteContinuousWebJobResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteDomainOwnershipIdentifier", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteContinuousWebJob", resp, "Failure responding to request") } return } -// DeleteDomainOwnershipIdentifierPreparer prepares the DeleteDomainOwnershipIdentifier request. -func (client AppsClient) DeleteDomainOwnershipIdentifierPreparer(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string) (*http.Request, error) { +// DeleteContinuousWebJobPreparer prepares the DeleteContinuousWebJob request. +func (client AppsClient) DeleteContinuousWebJobPreparer(ctx context.Context, resourceGroupName string, name string, webJobName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "domainOwnershipIdentifierName": autorest.Encode("path", domainOwnershipIdentifierName), - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webJobName": autorest.Encode("path", webJobName), } const APIVersion = "2018-02-01" @@ -4438,21 +4459,21 @@ func (client AppsClient) DeleteDomainOwnershipIdentifierPreparer(ctx context.Con preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// DeleteDomainOwnershipIdentifierSender sends the DeleteDomainOwnershipIdentifier request. The method will close the +// DeleteContinuousWebJobSender sends the DeleteContinuousWebJob request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) DeleteDomainOwnershipIdentifierSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) DeleteContinuousWebJobSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// DeleteDomainOwnershipIdentifierResponder handles the response to the DeleteDomainOwnershipIdentifier request. The method always +// DeleteContinuousWebJobResponder handles the response to the DeleteContinuousWebJob request. The method always // closes the http.Response Body. -func (client AppsClient) DeleteDomainOwnershipIdentifierResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AppsClient) DeleteContinuousWebJobResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -4462,16 +4483,16 @@ func (client AppsClient) DeleteDomainOwnershipIdentifierResponder(resp *http.Res return } -// DeleteDomainOwnershipIdentifierSlot deletes a domain ownership identifier for a web app. +// DeleteContinuousWebJobSlot delete a continuous web job by its ID for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -// domainOwnershipIdentifierName - name of domain ownership identifier. -// slot - name of the deployment slot. If a slot is not specified, the API will delete the binding for the +// name - site name. +// webJobName - name of Web Job. +// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the // production slot. -func (client AppsClient) DeleteDomainOwnershipIdentifierSlot(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, slot string) (result autorest.Response, err error) { +func (client AppsClient) DeleteContinuousWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteDomainOwnershipIdentifierSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteContinuousWebJobSlot") defer func() { sc := -1 if result.Response != nil { @@ -4485,38 +4506,38 @@ func (client AppsClient) DeleteDomainOwnershipIdentifierSlot(ctx context.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("web.AppsClient", "DeleteDomainOwnershipIdentifierSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "DeleteContinuousWebJobSlot", err.Error()) } - req, err := client.DeleteDomainOwnershipIdentifierSlotPreparer(ctx, resourceGroupName, name, domainOwnershipIdentifierName, slot) + req, err := client.DeleteContinuousWebJobSlotPreparer(ctx, resourceGroupName, name, webJobName, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteDomainOwnershipIdentifierSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteContinuousWebJobSlot", nil, "Failure preparing request") return } - resp, err := client.DeleteDomainOwnershipIdentifierSlotSender(req) + resp, err := client.DeleteContinuousWebJobSlotSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteDomainOwnershipIdentifierSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteContinuousWebJobSlot", resp, "Failure sending request") return } - result, err = client.DeleteDomainOwnershipIdentifierSlotResponder(resp) + result, err = client.DeleteContinuousWebJobSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteDomainOwnershipIdentifierSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteContinuousWebJobSlot", resp, "Failure responding to request") } return } -// DeleteDomainOwnershipIdentifierSlotPreparer prepares the DeleteDomainOwnershipIdentifierSlot request. -func (client AppsClient) DeleteDomainOwnershipIdentifierSlotPreparer(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, slot string) (*http.Request, error) { +// DeleteContinuousWebJobSlotPreparer prepares the DeleteContinuousWebJobSlot request. +func (client AppsClient) DeleteContinuousWebJobSlotPreparer(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "domainOwnershipIdentifierName": autorest.Encode("path", domainOwnershipIdentifierName), - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webJobName": autorest.Encode("path", webJobName), } const APIVersion = "2018-02-01" @@ -4527,21 +4548,21 @@ func (client AppsClient) DeleteDomainOwnershipIdentifierSlotPreparer(ctx context preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// DeleteDomainOwnershipIdentifierSlotSender sends the DeleteDomainOwnershipIdentifierSlot request. The method will close the +// DeleteContinuousWebJobSlotSender sends the DeleteContinuousWebJobSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) DeleteDomainOwnershipIdentifierSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) DeleteContinuousWebJobSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// DeleteDomainOwnershipIdentifierSlotResponder handles the response to the DeleteDomainOwnershipIdentifierSlot request. The method always +// DeleteContinuousWebJobSlotResponder handles the response to the DeleteContinuousWebJobSlot request. The method always // closes the http.Response Body. -func (client AppsClient) DeleteDomainOwnershipIdentifierSlotResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AppsClient) DeleteContinuousWebJobSlotResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -4551,14 +4572,14 @@ func (client AppsClient) DeleteDomainOwnershipIdentifierSlotResponder(resp *http return } -// DeleteFunction delete a function for web site, or a deployment slot. +// DeleteDeployment delete a deployment by its ID for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - site name. -// functionName - function name. -func (client AppsClient) DeleteFunction(ctx context.Context, resourceGroupName string, name string, functionName string) (result autorest.Response, err error) { +// name - name of the app. +// ID - deployment ID. +func (client AppsClient) DeleteDeployment(ctx context.Context, resourceGroupName string, name string, ID string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteFunction") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteDeployment") defer func() { sc := -1 if result.Response != nil { @@ -4572,34 +4593,34 @@ func (client AppsClient) DeleteFunction(ctx context.Context, resourceGroupName s Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "DeleteFunction", err.Error()) + return result, validation.NewError("web.AppsClient", "DeleteDeployment", err.Error()) } - req, err := client.DeleteFunctionPreparer(ctx, resourceGroupName, name, functionName) + req, err := client.DeleteDeploymentPreparer(ctx, resourceGroupName, name, ID) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteFunction", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteDeployment", nil, "Failure preparing request") return } - resp, err := client.DeleteFunctionSender(req) + resp, err := client.DeleteDeploymentSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteFunction", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteDeployment", resp, "Failure sending request") return } - result, err = client.DeleteFunctionResponder(resp) + result, err = client.DeleteDeploymentResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteFunction", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteDeployment", resp, "Failure responding to request") } return } -// DeleteFunctionPreparer prepares the DeleteFunction request. -func (client AppsClient) DeleteFunctionPreparer(ctx context.Context, resourceGroupName string, name string, functionName string) (*http.Request, error) { +// DeleteDeploymentPreparer prepares the DeleteDeployment request. +func (client AppsClient) DeleteDeploymentPreparer(ctx context.Context, resourceGroupName string, name string, ID string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "functionName": autorest.Encode("path", functionName), + "id": autorest.Encode("path", ID), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -4613,38 +4634,40 @@ func (client AppsClient) DeleteFunctionPreparer(ctx context.Context, resourceGro preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// DeleteFunctionSender sends the DeleteFunction request. The method will close the +// DeleteDeploymentSender sends the DeleteDeployment request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) DeleteFunctionSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) DeleteDeploymentSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// DeleteFunctionResponder handles the response to the DeleteFunction request. The method always +// DeleteDeploymentResponder handles the response to the DeleteDeployment request. The method always // closes the http.Response Body. -func (client AppsClient) DeleteFunctionResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AppsClient) DeleteDeploymentResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp return } -// DeleteHostNameBinding deletes a hostname binding for an app. +// DeleteDeploymentSlot delete a deployment by its ID for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// hostName - hostname in the hostname binding. -func (client AppsClient) DeleteHostNameBinding(ctx context.Context, resourceGroupName string, name string, hostName string) (result autorest.Response, err error) { +// ID - deployment ID. +// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the +// production slot. +func (client AppsClient) DeleteDeploymentSlot(ctx context.Context, resourceGroupName string, name string, ID string, slot string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteHostNameBinding") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteDeploymentSlot") defer func() { sc := -1 if result.Response != nil { @@ -4658,36 +4681,37 @@ func (client AppsClient) DeleteHostNameBinding(ctx context.Context, resourceGrou Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "DeleteHostNameBinding", err.Error()) + return result, validation.NewError("web.AppsClient", "DeleteDeploymentSlot", err.Error()) } - req, err := client.DeleteHostNameBindingPreparer(ctx, resourceGroupName, name, hostName) + req, err := client.DeleteDeploymentSlotPreparer(ctx, resourceGroupName, name, ID, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHostNameBinding", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteDeploymentSlot", nil, "Failure preparing request") return } - resp, err := client.DeleteHostNameBindingSender(req) + resp, err := client.DeleteDeploymentSlotSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHostNameBinding", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteDeploymentSlot", resp, "Failure sending request") return } - result, err = client.DeleteHostNameBindingResponder(resp) + result, err = client.DeleteDeploymentSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHostNameBinding", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteDeploymentSlot", resp, "Failure responding to request") } return } -// DeleteHostNameBindingPreparer prepares the DeleteHostNameBinding request. -func (client AppsClient) DeleteHostNameBindingPreparer(ctx context.Context, resourceGroupName string, name string, hostName string) (*http.Request, error) { +// DeleteDeploymentSlotPreparer prepares the DeleteDeploymentSlot request. +func (client AppsClient) DeleteDeploymentSlotPreparer(ctx context.Context, resourceGroupName string, name string, ID string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "hostName": autorest.Encode("path", hostName), + "id": autorest.Encode("path", ID), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -4699,21 +4723,21 @@ func (client AppsClient) DeleteHostNameBindingPreparer(ctx context.Context, reso preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// DeleteHostNameBindingSender sends the DeleteHostNameBinding request. The method will close the +// DeleteDeploymentSlotSender sends the DeleteDeploymentSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) DeleteHostNameBindingSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) DeleteDeploymentSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// DeleteHostNameBindingResponder handles the response to the DeleteHostNameBinding request. The method always +// DeleteDeploymentSlotResponder handles the response to the DeleteDeploymentSlot request. The method always // closes the http.Response Body. -func (client AppsClient) DeleteHostNameBindingResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AppsClient) DeleteDeploymentSlotResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -4723,16 +4747,14 @@ func (client AppsClient) DeleteHostNameBindingResponder(resp *http.Response) (re return } -// DeleteHostNameBindingSlot deletes a hostname binding for an app. +// DeleteDomainOwnershipIdentifier deletes a domain ownership identifier for a web app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// slot - name of the deployment slot. If a slot is not specified, the API will delete the binding for the -// production slot. -// hostName - hostname in the hostname binding. -func (client AppsClient) DeleteHostNameBindingSlot(ctx context.Context, resourceGroupName string, name string, slot string, hostName string) (result autorest.Response, err error) { +// domainOwnershipIdentifierName - name of domain ownership identifier. +func (client AppsClient) DeleteDomainOwnershipIdentifier(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteHostNameBindingSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteDomainOwnershipIdentifier") defer func() { sc := -1 if result.Response != nil { @@ -4746,38 +4768,37 @@ func (client AppsClient) DeleteHostNameBindingSlot(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "DeleteHostNameBindingSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "DeleteDomainOwnershipIdentifier", err.Error()) } - req, err := client.DeleteHostNameBindingSlotPreparer(ctx, resourceGroupName, name, slot, hostName) + req, err := client.DeleteDomainOwnershipIdentifierPreparer(ctx, resourceGroupName, name, domainOwnershipIdentifierName) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHostNameBindingSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteDomainOwnershipIdentifier", nil, "Failure preparing request") return } - resp, err := client.DeleteHostNameBindingSlotSender(req) + resp, err := client.DeleteDomainOwnershipIdentifierSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHostNameBindingSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteDomainOwnershipIdentifier", resp, "Failure sending request") return } - result, err = client.DeleteHostNameBindingSlotResponder(resp) + result, err = client.DeleteDomainOwnershipIdentifierResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHostNameBindingSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteDomainOwnershipIdentifier", resp, "Failure responding to request") } return } -// DeleteHostNameBindingSlotPreparer prepares the DeleteHostNameBindingSlot request. -func (client AppsClient) DeleteHostNameBindingSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string, hostName string) (*http.Request, error) { +// DeleteDomainOwnershipIdentifierPreparer prepares the DeleteDomainOwnershipIdentifier request. +func (client AppsClient) DeleteDomainOwnershipIdentifierPreparer(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "hostName": autorest.Encode("path", hostName), - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "domainOwnershipIdentifierName": autorest.Encode("path", domainOwnershipIdentifierName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2018-02-01" @@ -4788,21 +4809,21 @@ func (client AppsClient) DeleteHostNameBindingSlotPreparer(ctx context.Context, preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// DeleteHostNameBindingSlotSender sends the DeleteHostNameBindingSlot request. The method will close the +// DeleteDomainOwnershipIdentifierSender sends the DeleteDomainOwnershipIdentifier request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) DeleteHostNameBindingSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) DeleteDomainOwnershipIdentifierSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// DeleteHostNameBindingSlotResponder handles the response to the DeleteHostNameBindingSlot request. The method always +// DeleteDomainOwnershipIdentifierResponder handles the response to the DeleteDomainOwnershipIdentifier request. The method always // closes the http.Response Body. -func (client AppsClient) DeleteHostNameBindingSlotResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AppsClient) DeleteDomainOwnershipIdentifierResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -4812,15 +4833,16 @@ func (client AppsClient) DeleteHostNameBindingSlotResponder(resp *http.Response) return } -// DeleteHybridConnection removes a Hybrid Connection from this site. +// DeleteDomainOwnershipIdentifierSlot deletes a domain ownership identifier for a web app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - the name of the web app. -// namespaceName - the namespace for this hybrid connection. -// relayName - the relay name for this hybrid connection. -func (client AppsClient) DeleteHybridConnection(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string) (result autorest.Response, err error) { +// name - name of the app. +// domainOwnershipIdentifierName - name of domain ownership identifier. +// slot - name of the deployment slot. If a slot is not specified, the API will delete the binding for the +// production slot. +func (client AppsClient) DeleteDomainOwnershipIdentifierSlot(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, slot string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteHybridConnection") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteDomainOwnershipIdentifierSlot") defer func() { sc := -1 if result.Response != nil { @@ -4834,38 +4856,38 @@ func (client AppsClient) DeleteHybridConnection(ctx context.Context, resourceGro Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "DeleteHybridConnection", err.Error()) + return result, validation.NewError("web.AppsClient", "DeleteDomainOwnershipIdentifierSlot", err.Error()) } - req, err := client.DeleteHybridConnectionPreparer(ctx, resourceGroupName, name, namespaceName, relayName) + req, err := client.DeleteDomainOwnershipIdentifierSlotPreparer(ctx, resourceGroupName, name, domainOwnershipIdentifierName, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHybridConnection", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteDomainOwnershipIdentifierSlot", nil, "Failure preparing request") return } - resp, err := client.DeleteHybridConnectionSender(req) + resp, err := client.DeleteDomainOwnershipIdentifierSlotSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHybridConnection", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteDomainOwnershipIdentifierSlot", resp, "Failure sending request") return } - result, err = client.DeleteHybridConnectionResponder(resp) + result, err = client.DeleteDomainOwnershipIdentifierSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHybridConnection", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteDomainOwnershipIdentifierSlot", resp, "Failure responding to request") } return } -// DeleteHybridConnectionPreparer prepares the DeleteHybridConnection request. -func (client AppsClient) DeleteHybridConnectionPreparer(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string) (*http.Request, error) { +// DeleteDomainOwnershipIdentifierSlotPreparer prepares the DeleteDomainOwnershipIdentifierSlot request. +func (client AppsClient) DeleteDomainOwnershipIdentifierSlotPreparer(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "name": autorest.Encode("path", name), - "namespaceName": autorest.Encode("path", namespaceName), - "relayName": autorest.Encode("path", relayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "domainOwnershipIdentifierName": autorest.Encode("path", domainOwnershipIdentifierName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2018-02-01" @@ -4876,40 +4898,38 @@ func (client AppsClient) DeleteHybridConnectionPreparer(ctx context.Context, res preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// DeleteHybridConnectionSender sends the DeleteHybridConnection request. The method will close the +// DeleteDomainOwnershipIdentifierSlotSender sends the DeleteDomainOwnershipIdentifierSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) DeleteHybridConnectionSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) DeleteDomainOwnershipIdentifierSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// DeleteHybridConnectionResponder handles the response to the DeleteHybridConnection request. The method always +// DeleteDomainOwnershipIdentifierSlotResponder handles the response to the DeleteDomainOwnershipIdentifierSlot request. The method always // closes the http.Response Body. -func (client AppsClient) DeleteHybridConnectionResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AppsClient) DeleteDomainOwnershipIdentifierSlotResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp return } -// DeleteHybridConnectionSlot removes a Hybrid Connection from this site. +// DeleteFunction delete a function for web site, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - the name of the web app. -// namespaceName - the namespace for this hybrid connection. -// relayName - the relay name for this hybrid connection. -// slot - the name of the slot for the web app. -func (client AppsClient) DeleteHybridConnectionSlot(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, slot string) (result autorest.Response, err error) { +// name - site name. +// functionName - function name. +func (client AppsClient) DeleteFunction(ctx context.Context, resourceGroupName string, name string, functionName string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteHybridConnectionSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteFunction") defer func() { sc := -1 if result.Response != nil { @@ -4923,38 +4943,36 @@ func (client AppsClient) DeleteHybridConnectionSlot(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "DeleteHybridConnectionSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "DeleteFunction", err.Error()) } - req, err := client.DeleteHybridConnectionSlotPreparer(ctx, resourceGroupName, name, namespaceName, relayName, slot) + req, err := client.DeleteFunctionPreparer(ctx, resourceGroupName, name, functionName) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHybridConnectionSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteFunction", nil, "Failure preparing request") return } - resp, err := client.DeleteHybridConnectionSlotSender(req) + resp, err := client.DeleteFunctionSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHybridConnectionSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteFunction", resp, "Failure sending request") return } - result, err = client.DeleteHybridConnectionSlotResponder(resp) + result, err = client.DeleteFunctionResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHybridConnectionSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteFunction", resp, "Failure responding to request") } return } -// DeleteHybridConnectionSlotPreparer prepares the DeleteHybridConnectionSlot request. -func (client AppsClient) DeleteHybridConnectionSlotPreparer(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, slot string) (*http.Request, error) { +// DeleteFunctionPreparer prepares the DeleteFunction request. +func (client AppsClient) DeleteFunctionPreparer(ctx context.Context, resourceGroupName string, name string, functionName string) (*http.Request, error) { pathParameters := map[string]interface{}{ + "functionName": autorest.Encode("path", functionName), "name": autorest.Encode("path", name), - "namespaceName": autorest.Encode("path", namespaceName), - "relayName": autorest.Encode("path", relayName), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -4966,40 +4984,39 @@ func (client AppsClient) DeleteHybridConnectionSlotPreparer(ctx context.Context, preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// DeleteHybridConnectionSlotSender sends the DeleteHybridConnectionSlot request. The method will close the +// DeleteFunctionSender sends the DeleteFunction request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) DeleteHybridConnectionSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) DeleteFunctionSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// DeleteHybridConnectionSlotResponder handles the response to the DeleteHybridConnectionSlot request. The method always +// DeleteFunctionResponder handles the response to the DeleteFunction request. The method always // closes the http.Response Body. -func (client AppsClient) DeleteHybridConnectionSlotResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AppsClient) DeleteFunctionResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), autorest.ByClosing()) result.Response = resp return } -// DeleteInstanceFunctionSlot delete a function for web site, or a deployment slot. +// DeleteFunctionSecret delete a function secret. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. -// functionName - function name. -// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the -// production slot. -func (client AppsClient) DeleteInstanceFunctionSlot(ctx context.Context, resourceGroupName string, name string, functionName string, slot string) (result autorest.Response, err error) { +// functionName - the name of the function. +// keyName - the name of the key. +func (client AppsClient) DeleteFunctionSecret(ctx context.Context, resourceGroupName string, name string, functionName string, keyName string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteInstanceFunctionSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteFunctionSecret") defer func() { sc := -1 if result.Response != nil { @@ -5013,37 +5030,37 @@ func (client AppsClient) DeleteInstanceFunctionSlot(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "DeleteInstanceFunctionSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "DeleteFunctionSecret", err.Error()) } - req, err := client.DeleteInstanceFunctionSlotPreparer(ctx, resourceGroupName, name, functionName, slot) + req, err := client.DeleteFunctionSecretPreparer(ctx, resourceGroupName, name, functionName, keyName) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteInstanceFunctionSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteFunctionSecret", nil, "Failure preparing request") return } - resp, err := client.DeleteInstanceFunctionSlotSender(req) + resp, err := client.DeleteFunctionSecretSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteInstanceFunctionSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteFunctionSecret", resp, "Failure sending request") return } - result, err = client.DeleteInstanceFunctionSlotResponder(resp) + result, err = client.DeleteFunctionSecretResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteInstanceFunctionSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteFunctionSecret", resp, "Failure responding to request") } return } -// DeleteInstanceFunctionSlotPreparer prepares the DeleteInstanceFunctionSlot request. -func (client AppsClient) DeleteInstanceFunctionSlotPreparer(ctx context.Context, resourceGroupName string, name string, functionName string, slot string) (*http.Request, error) { +// DeleteFunctionSecretPreparer prepares the DeleteFunctionSecret request. +func (client AppsClient) DeleteFunctionSecretPreparer(ctx context.Context, resourceGroupName string, name string, functionName string, keyName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "functionName": autorest.Encode("path", functionName), + "keyName": autorest.Encode("path", keyName), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -5055,21 +5072,21 @@ func (client AppsClient) DeleteInstanceFunctionSlotPreparer(ctx context.Context, preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/keys/{keyName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// DeleteInstanceFunctionSlotSender sends the DeleteInstanceFunctionSlot request. The method will close the +// DeleteFunctionSecretSender sends the DeleteFunctionSecret request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) DeleteInstanceFunctionSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) DeleteFunctionSecretSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// DeleteInstanceFunctionSlotResponder handles the response to the DeleteInstanceFunctionSlot request. The method always +// DeleteFunctionSecretResponder handles the response to the DeleteFunctionSecret request. The method always // closes the http.Response Body. -func (client AppsClient) DeleteInstanceFunctionSlotResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AppsClient) DeleteFunctionSecretResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -5079,17 +5096,16 @@ func (client AppsClient) DeleteInstanceFunctionSlotResponder(resp *http.Response return } -// DeleteInstanceProcess terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out -// instance in a web site. +// DeleteFunctionSecretSlot delete a function secret. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. -// processID - pID. -// instanceID - ID of a specific scaled-out instance. This is the value of the name property in the JSON -// response from "GET api/sites/{siteName}/instances". -func (client AppsClient) DeleteInstanceProcess(ctx context.Context, resourceGroupName string, name string, processID string, instanceID string) (result autorest.Response, err error) { +// functionName - the name of the function. +// keyName - the name of the key. +// slot - name of the deployment slot. +func (client AppsClient) DeleteFunctionSecretSlot(ctx context.Context, resourceGroupName string, name string, functionName string, keyName string, slot string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteInstanceProcess") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteFunctionSecretSlot") defer func() { sc := -1 if result.Response != nil { @@ -5103,37 +5119,38 @@ func (client AppsClient) DeleteInstanceProcess(ctx context.Context, resourceGrou Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "DeleteInstanceProcess", err.Error()) + return result, validation.NewError("web.AppsClient", "DeleteFunctionSecretSlot", err.Error()) } - req, err := client.DeleteInstanceProcessPreparer(ctx, resourceGroupName, name, processID, instanceID) + req, err := client.DeleteFunctionSecretSlotPreparer(ctx, resourceGroupName, name, functionName, keyName, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteInstanceProcess", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteFunctionSecretSlot", nil, "Failure preparing request") return } - resp, err := client.DeleteInstanceProcessSender(req) + resp, err := client.DeleteFunctionSecretSlotSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteInstanceProcess", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteFunctionSecretSlot", resp, "Failure sending request") return } - result, err = client.DeleteInstanceProcessResponder(resp) + result, err = client.DeleteFunctionSecretSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteInstanceProcess", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteFunctionSecretSlot", resp, "Failure responding to request") } return } -// DeleteInstanceProcessPreparer prepares the DeleteInstanceProcess request. -func (client AppsClient) DeleteInstanceProcessPreparer(ctx context.Context, resourceGroupName string, name string, processID string, instanceID string) (*http.Request, error) { +// DeleteFunctionSecretSlotPreparer prepares the DeleteFunctionSecretSlot request. +func (client AppsClient) DeleteFunctionSecretSlotPreparer(ctx context.Context, resourceGroupName string, name string, functionName string, keyName string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), + "functionName": autorest.Encode("path", functionName), + "keyName": autorest.Encode("path", keyName), "name": autorest.Encode("path", name), - "processId": autorest.Encode("path", processID), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -5145,21 +5162,21 @@ func (client AppsClient) DeleteInstanceProcessPreparer(ctx context.Context, reso preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/keys/{keyName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// DeleteInstanceProcessSender sends the DeleteInstanceProcess request. The method will close the +// DeleteFunctionSecretSlotSender sends the DeleteFunctionSecretSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) DeleteInstanceProcessSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) DeleteFunctionSecretSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// DeleteInstanceProcessResponder handles the response to the DeleteInstanceProcess request. The method always +// DeleteFunctionSecretSlotResponder handles the response to the DeleteFunctionSecretSlot request. The method always // closes the http.Response Body. -func (client AppsClient) DeleteInstanceProcessResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AppsClient) DeleteFunctionSecretSlotResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -5169,19 +5186,14 @@ func (client AppsClient) DeleteInstanceProcessResponder(resp *http.Response) (re return } -// DeleteInstanceProcessSlot terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out -// instance in a web site. +// DeleteHostNameBinding deletes a hostname binding for an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - site name. -// processID - pID. -// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the -// production slot. -// instanceID - ID of a specific scaled-out instance. This is the value of the name property in the JSON -// response from "GET api/sites/{siteName}/instances". -func (client AppsClient) DeleteInstanceProcessSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string) (result autorest.Response, err error) { +// name - name of the app. +// hostName - hostname in the hostname binding. +func (client AppsClient) DeleteHostNameBinding(ctx context.Context, resourceGroupName string, name string, hostName string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteInstanceProcessSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteHostNameBinding") defer func() { sc := -1 if result.Response != nil { @@ -5195,38 +5207,36 @@ func (client AppsClient) DeleteInstanceProcessSlot(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "DeleteInstanceProcessSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "DeleteHostNameBinding", err.Error()) } - req, err := client.DeleteInstanceProcessSlotPreparer(ctx, resourceGroupName, name, processID, slot, instanceID) + req, err := client.DeleteHostNameBindingPreparer(ctx, resourceGroupName, name, hostName) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteInstanceProcessSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHostNameBinding", nil, "Failure preparing request") return } - resp, err := client.DeleteInstanceProcessSlotSender(req) + resp, err := client.DeleteHostNameBindingSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteInstanceProcessSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHostNameBinding", resp, "Failure sending request") return } - result, err = client.DeleteInstanceProcessSlotResponder(resp) + result, err = client.DeleteHostNameBindingResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteInstanceProcessSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHostNameBinding", resp, "Failure responding to request") } return } -// DeleteInstanceProcessSlotPreparer prepares the DeleteInstanceProcessSlot request. -func (client AppsClient) DeleteInstanceProcessSlotPreparer(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string) (*http.Request, error) { +// DeleteHostNameBindingPreparer prepares the DeleteHostNameBinding request. +func (client AppsClient) DeleteHostNameBindingPreparer(ctx context.Context, resourceGroupName string, name string, hostName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), + "hostName": autorest.Encode("path", hostName), "name": autorest.Encode("path", name), - "processId": autorest.Encode("path", processID), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -5238,38 +5248,40 @@ func (client AppsClient) DeleteInstanceProcessSlotPreparer(ctx context.Context, preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// DeleteInstanceProcessSlotSender sends the DeleteInstanceProcessSlot request. The method will close the +// DeleteHostNameBindingSender sends the DeleteHostNameBinding request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) DeleteInstanceProcessSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) DeleteHostNameBindingSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// DeleteInstanceProcessSlotResponder handles the response to the DeleteInstanceProcessSlot request. The method always +// DeleteHostNameBindingResponder handles the response to the DeleteHostNameBinding request. The method always // closes the http.Response Body. -func (client AppsClient) DeleteInstanceProcessSlotResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AppsClient) DeleteHostNameBindingResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp return } -// DeletePremierAddOn delete a premier add-on from an app. +// DeleteHostNameBindingSlot deletes a hostname binding for an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// premierAddOnName - add-on name. -func (client AppsClient) DeletePremierAddOn(ctx context.Context, resourceGroupName string, name string, premierAddOnName string) (result autorest.Response, err error) { +// slot - name of the deployment slot. If a slot is not specified, the API will delete the binding for the +// production slot. +// hostName - hostname in the hostname binding. +func (client AppsClient) DeleteHostNameBindingSlot(ctx context.Context, resourceGroupName string, name string, slot string, hostName string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeletePremierAddOn") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteHostNameBindingSlot") defer func() { sc := -1 if result.Response != nil { @@ -5283,36 +5295,37 @@ func (client AppsClient) DeletePremierAddOn(ctx context.Context, resourceGroupNa Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "DeletePremierAddOn", err.Error()) + return result, validation.NewError("web.AppsClient", "DeleteHostNameBindingSlot", err.Error()) } - req, err := client.DeletePremierAddOnPreparer(ctx, resourceGroupName, name, premierAddOnName) + req, err := client.DeleteHostNameBindingSlotPreparer(ctx, resourceGroupName, name, slot, hostName) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeletePremierAddOn", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHostNameBindingSlot", nil, "Failure preparing request") return } - resp, err := client.DeletePremierAddOnSender(req) + resp, err := client.DeleteHostNameBindingSlotSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeletePremierAddOn", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHostNameBindingSlot", resp, "Failure sending request") return } - result, err = client.DeletePremierAddOnResponder(resp) + result, err = client.DeleteHostNameBindingSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeletePremierAddOn", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHostNameBindingSlot", resp, "Failure responding to request") } return } -// DeletePremierAddOnPreparer prepares the DeletePremierAddOn request. -func (client AppsClient) DeletePremierAddOnPreparer(ctx context.Context, resourceGroupName string, name string, premierAddOnName string) (*http.Request, error) { +// DeleteHostNameBindingSlotPreparer prepares the DeleteHostNameBindingSlot request. +func (client AppsClient) DeleteHostNameBindingSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string, hostName string) (*http.Request, error) { pathParameters := map[string]interface{}{ + "hostName": autorest.Encode("path", hostName), "name": autorest.Encode("path", name), - "premierAddOnName": autorest.Encode("path", premierAddOnName), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -5324,40 +5337,39 @@ func (client AppsClient) DeletePremierAddOnPreparer(ctx context.Context, resourc preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// DeletePremierAddOnSender sends the DeletePremierAddOn request. The method will close the +// DeleteHostNameBindingSlotSender sends the DeleteHostNameBindingSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) DeletePremierAddOnSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) DeleteHostNameBindingSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// DeletePremierAddOnResponder handles the response to the DeletePremierAddOn request. The method always +// DeleteHostNameBindingSlotResponder handles the response to the DeleteHostNameBindingSlot request. The method always // closes the http.Response Body. -func (client AppsClient) DeletePremierAddOnResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AppsClient) DeleteHostNameBindingSlotResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp return } -// DeletePremierAddOnSlot delete a premier add-on from an app. +// DeleteHostSecret delete a host level secret. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -// premierAddOnName - add-on name. -// slot - name of the deployment slot. If a slot is not specified, the API will delete the named add-on for the -// production slot. -func (client AppsClient) DeletePremierAddOnSlot(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, slot string) (result autorest.Response, err error) { +// name - site name. +// keyType - the type of host key. +// keyName - the name of the key. +func (client AppsClient) DeleteHostSecret(ctx context.Context, resourceGroupName string, name string, keyType string, keyName string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeletePremierAddOnSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteHostSecret") defer func() { sc := -1 if result.Response != nil { @@ -5371,37 +5383,37 @@ func (client AppsClient) DeletePremierAddOnSlot(ctx context.Context, resourceGro Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "DeletePremierAddOnSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "DeleteHostSecret", err.Error()) } - req, err := client.DeletePremierAddOnSlotPreparer(ctx, resourceGroupName, name, premierAddOnName, slot) + req, err := client.DeleteHostSecretPreparer(ctx, resourceGroupName, name, keyType, keyName) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeletePremierAddOnSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHostSecret", nil, "Failure preparing request") return } - resp, err := client.DeletePremierAddOnSlotSender(req) + resp, err := client.DeleteHostSecretSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeletePremierAddOnSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHostSecret", resp, "Failure sending request") return } - result, err = client.DeletePremierAddOnSlotResponder(resp) + result, err = client.DeleteHostSecretResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeletePremierAddOnSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHostSecret", resp, "Failure responding to request") } return } -// DeletePremierAddOnSlotPreparer prepares the DeletePremierAddOnSlot request. -func (client AppsClient) DeletePremierAddOnSlotPreparer(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, slot string) (*http.Request, error) { +// DeleteHostSecretPreparer prepares the DeleteHostSecret request. +func (client AppsClient) DeleteHostSecretPreparer(ctx context.Context, resourceGroupName string, name string, keyType string, keyName string) (*http.Request, error) { pathParameters := map[string]interface{}{ + "keyName": autorest.Encode("path", keyName), + "keyType": autorest.Encode("path", keyType), "name": autorest.Encode("path", name), - "premierAddOnName": autorest.Encode("path", premierAddOnName), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -5413,39 +5425,40 @@ func (client AppsClient) DeletePremierAddOnSlotPreparer(ctx context.Context, res preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/{keyType}/{keyName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// DeletePremierAddOnSlotSender sends the DeletePremierAddOnSlot request. The method will close the +// DeleteHostSecretSender sends the DeleteHostSecret request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) DeletePremierAddOnSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) DeleteHostSecretSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// DeletePremierAddOnSlotResponder handles the response to the DeletePremierAddOnSlot request. The method always +// DeleteHostSecretResponder handles the response to the DeleteHostSecret request. The method always // closes the http.Response Body. -func (client AppsClient) DeletePremierAddOnSlotResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AppsClient) DeleteHostSecretResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), autorest.ByClosing()) result.Response = resp return } -// DeleteProcess terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in -// a web site. +// DeleteHostSecretSlot delete a host level secret. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. -// processID - pID. -func (client AppsClient) DeleteProcess(ctx context.Context, resourceGroupName string, name string, processID string) (result autorest.Response, err error) { +// keyType - the type of host key. +// keyName - the name of the key. +// slot - name of the deployment slot. +func (client AppsClient) DeleteHostSecretSlot(ctx context.Context, resourceGroupName string, name string, keyType string, keyName string, slot string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteProcess") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteHostSecretSlot") defer func() { sc := -1 if result.Response != nil { @@ -5459,36 +5472,38 @@ func (client AppsClient) DeleteProcess(ctx context.Context, resourceGroupName st Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "DeleteProcess", err.Error()) + return result, validation.NewError("web.AppsClient", "DeleteHostSecretSlot", err.Error()) } - req, err := client.DeleteProcessPreparer(ctx, resourceGroupName, name, processID) + req, err := client.DeleteHostSecretSlotPreparer(ctx, resourceGroupName, name, keyType, keyName, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteProcess", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHostSecretSlot", nil, "Failure preparing request") return } - resp, err := client.DeleteProcessSender(req) + resp, err := client.DeleteHostSecretSlotSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteProcess", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHostSecretSlot", resp, "Failure sending request") return } - result, err = client.DeleteProcessResponder(resp) + result, err = client.DeleteHostSecretSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteProcess", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHostSecretSlot", resp, "Failure responding to request") } return } -// DeleteProcessPreparer prepares the DeleteProcess request. -func (client AppsClient) DeleteProcessPreparer(ctx context.Context, resourceGroupName string, name string, processID string) (*http.Request, error) { +// DeleteHostSecretSlotPreparer prepares the DeleteHostSecretSlot request. +func (client AppsClient) DeleteHostSecretSlotPreparer(ctx context.Context, resourceGroupName string, name string, keyType string, keyName string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ + "keyName": autorest.Encode("path", keyName), + "keyType": autorest.Encode("path", keyType), "name": autorest.Encode("path", name), - "processId": autorest.Encode("path", processID), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -5500,21 +5515,21 @@ func (client AppsClient) DeleteProcessPreparer(ctx context.Context, resourceGrou preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/{keyType}/{keyName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// DeleteProcessSender sends the DeleteProcess request. The method will close the +// DeleteHostSecretSlotSender sends the DeleteHostSecretSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) DeleteProcessSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) DeleteHostSecretSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// DeleteProcessResponder handles the response to the DeleteProcess request. The method always +// DeleteHostSecretSlotResponder handles the response to the DeleteHostSecretSlot request. The method always // closes the http.Response Body. -func (client AppsClient) DeleteProcessResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AppsClient) DeleteHostSecretSlotResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -5524,17 +5539,15 @@ func (client AppsClient) DeleteProcessResponder(resp *http.Response) (result aut return } -// DeleteProcessSlot terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out -// instance in a web site. +// DeleteHybridConnection removes a Hybrid Connection from this site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - site name. -// processID - pID. -// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the -// production slot. -func (client AppsClient) DeleteProcessSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string) (result autorest.Response, err error) { +// name - the name of the web app. +// namespaceName - the namespace for this hybrid connection. +// relayName - the relay name for this hybrid connection. +func (client AppsClient) DeleteHybridConnection(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteProcessSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteHybridConnection") defer func() { sc := -1 if result.Response != nil { @@ -5548,37 +5561,37 @@ func (client AppsClient) DeleteProcessSlot(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "DeleteProcessSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "DeleteHybridConnection", err.Error()) } - req, err := client.DeleteProcessSlotPreparer(ctx, resourceGroupName, name, processID, slot) + req, err := client.DeleteHybridConnectionPreparer(ctx, resourceGroupName, name, namespaceName, relayName) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteProcessSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHybridConnection", nil, "Failure preparing request") return } - resp, err := client.DeleteProcessSlotSender(req) + resp, err := client.DeleteHybridConnectionSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteProcessSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHybridConnection", resp, "Failure sending request") return } - result, err = client.DeleteProcessSlotResponder(resp) + result, err = client.DeleteHybridConnectionResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteProcessSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHybridConnection", resp, "Failure responding to request") } return } -// DeleteProcessSlotPreparer prepares the DeleteProcessSlot request. -func (client AppsClient) DeleteProcessSlotPreparer(ctx context.Context, resourceGroupName string, name string, processID string, slot string) (*http.Request, error) { +// DeleteHybridConnectionPreparer prepares the DeleteHybridConnection request. +func (client AppsClient) DeleteHybridConnectionPreparer(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), - "processId": autorest.Encode("path", processID), + "namespaceName": autorest.Encode("path", namespaceName), + "relayName": autorest.Encode("path", relayName), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -5590,38 +5603,40 @@ func (client AppsClient) DeleteProcessSlotPreparer(ctx context.Context, resource preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// DeleteProcessSlotSender sends the DeleteProcessSlot request. The method will close the +// DeleteHybridConnectionSender sends the DeleteHybridConnection request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) DeleteProcessSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) DeleteHybridConnectionSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// DeleteProcessSlotResponder handles the response to the DeleteProcessSlot request. The method always +// DeleteHybridConnectionResponder handles the response to the DeleteHybridConnection request. The method always // closes the http.Response Body. -func (client AppsClient) DeleteProcessSlotResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AppsClient) DeleteHybridConnectionResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), autorest.ByClosing()) result.Response = resp return } -// DeletePublicCertificate deletes a hostname binding for an app. +// DeleteHybridConnectionSlot removes a Hybrid Connection from this site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -// publicCertificateName - public certificate name. -func (client AppsClient) DeletePublicCertificate(ctx context.Context, resourceGroupName string, name string, publicCertificateName string) (result autorest.Response, err error) { +// name - the name of the web app. +// namespaceName - the namespace for this hybrid connection. +// relayName - the relay name for this hybrid connection. +// slot - the name of the slot for the web app. +func (client AppsClient) DeleteHybridConnectionSlot(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, slot string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeletePublicCertificate") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteHybridConnectionSlot") defer func() { sc := -1 if result.Response != nil { @@ -5635,37 +5650,39 @@ func (client AppsClient) DeletePublicCertificate(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "DeletePublicCertificate", err.Error()) + return result, validation.NewError("web.AppsClient", "DeleteHybridConnectionSlot", err.Error()) } - req, err := client.DeletePublicCertificatePreparer(ctx, resourceGroupName, name, publicCertificateName) + req, err := client.DeleteHybridConnectionSlotPreparer(ctx, resourceGroupName, name, namespaceName, relayName, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeletePublicCertificate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHybridConnectionSlot", nil, "Failure preparing request") return } - resp, err := client.DeletePublicCertificateSender(req) + resp, err := client.DeleteHybridConnectionSlotSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeletePublicCertificate", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHybridConnectionSlot", resp, "Failure sending request") return } - result, err = client.DeletePublicCertificateResponder(resp) + result, err = client.DeleteHybridConnectionSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeletePublicCertificate", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHybridConnectionSlot", resp, "Failure responding to request") } return } -// DeletePublicCertificatePreparer prepares the DeletePublicCertificate request. -func (client AppsClient) DeletePublicCertificatePreparer(ctx context.Context, resourceGroupName string, name string, publicCertificateName string) (*http.Request, error) { +// DeleteHybridConnectionSlotPreparer prepares the DeleteHybridConnectionSlot request. +func (client AppsClient) DeleteHybridConnectionSlotPreparer(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "name": autorest.Encode("path", name), - "publicCertificateName": autorest.Encode("path", publicCertificateName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "name": autorest.Encode("path", name), + "namespaceName": autorest.Encode("path", namespaceName), + "relayName": autorest.Encode("path", relayName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2018-02-01" @@ -5676,40 +5693,39 @@ func (client AppsClient) DeletePublicCertificatePreparer(ctx context.Context, re preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// DeletePublicCertificateSender sends the DeletePublicCertificate request. The method will close the +// DeleteHybridConnectionSlotSender sends the DeleteHybridConnectionSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) DeletePublicCertificateSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) DeleteHybridConnectionSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// DeletePublicCertificateResponder handles the response to the DeletePublicCertificate request. The method always +// DeleteHybridConnectionSlotResponder handles the response to the DeleteHybridConnectionSlot request. The method always // closes the http.Response Body. -func (client AppsClient) DeletePublicCertificateResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AppsClient) DeleteHybridConnectionSlotResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), autorest.ByClosing()) result.Response = resp return } -// DeletePublicCertificateSlot deletes a hostname binding for an app. +// DeleteInstanceFunctionSlot delete a function for web site, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -// slot - name of the deployment slot. If a slot is not specified, the API will delete the binding for the -// production slot. -// publicCertificateName - public certificate name. -func (client AppsClient) DeletePublicCertificateSlot(ctx context.Context, resourceGroupName string, name string, slot string, publicCertificateName string) (result autorest.Response, err error) { +// name - site name. +// functionName - function name. +// slot - name of the deployment slot. +func (client AppsClient) DeleteInstanceFunctionSlot(ctx context.Context, resourceGroupName string, name string, functionName string, slot string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeletePublicCertificateSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteInstanceFunctionSlot") defer func() { sc := -1 if result.Response != nil { @@ -5723,38 +5739,38 @@ func (client AppsClient) DeletePublicCertificateSlot(ctx context.Context, resour Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "DeletePublicCertificateSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "DeleteInstanceFunctionSlot", err.Error()) } - req, err := client.DeletePublicCertificateSlotPreparer(ctx, resourceGroupName, name, slot, publicCertificateName) + req, err := client.DeleteInstanceFunctionSlotPreparer(ctx, resourceGroupName, name, functionName, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeletePublicCertificateSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteInstanceFunctionSlot", nil, "Failure preparing request") return } - resp, err := client.DeletePublicCertificateSlotSender(req) + resp, err := client.DeleteInstanceFunctionSlotSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeletePublicCertificateSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteInstanceFunctionSlot", resp, "Failure sending request") return } - result, err = client.DeletePublicCertificateSlotResponder(resp) + result, err = client.DeleteInstanceFunctionSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeletePublicCertificateSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteInstanceFunctionSlot", resp, "Failure responding to request") } return } -// DeletePublicCertificateSlotPreparer prepares the DeletePublicCertificateSlot request. -func (client AppsClient) DeletePublicCertificateSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string, publicCertificateName string) (*http.Request, error) { +// DeleteInstanceFunctionSlotPreparer prepares the DeleteInstanceFunctionSlot request. +func (client AppsClient) DeleteInstanceFunctionSlotPreparer(ctx context.Context, resourceGroupName string, name string, functionName string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "name": autorest.Encode("path", name), - "publicCertificateName": autorest.Encode("path", publicCertificateName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "functionName": autorest.Encode("path", functionName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2018-02-01" @@ -5765,38 +5781,41 @@ func (client AppsClient) DeletePublicCertificateSlotPreparer(ctx context.Context preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// DeletePublicCertificateSlotSender sends the DeletePublicCertificateSlot request. The method will close the +// DeleteInstanceFunctionSlotSender sends the DeleteInstanceFunctionSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) DeletePublicCertificateSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) DeleteInstanceFunctionSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// DeletePublicCertificateSlotResponder handles the response to the DeletePublicCertificateSlot request. The method always +// DeleteInstanceFunctionSlotResponder handles the response to the DeleteInstanceFunctionSlot request. The method always // closes the http.Response Body. -func (client AppsClient) DeletePublicCertificateSlotResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AppsClient) DeleteInstanceFunctionSlotResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), autorest.ByClosing()) result.Response = resp return } -// DeleteRelayServiceConnection deletes a relay service connection by its name. +// DeleteInstanceProcess terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out +// instance in a web site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -// entityName - name of the hybrid connection configuration. -func (client AppsClient) DeleteRelayServiceConnection(ctx context.Context, resourceGroupName string, name string, entityName string) (result autorest.Response, err error) { +// name - site name. +// processID - pID. +// instanceID - ID of a specific scaled-out instance. This is the value of the name property in the JSON +// response from "GET api/sites/{siteName}/instances". +func (client AppsClient) DeleteInstanceProcess(ctx context.Context, resourceGroupName string, name string, processID string, instanceID string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteRelayServiceConnection") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteInstanceProcess") defer func() { sc := -1 if result.Response != nil { @@ -5810,35 +5829,36 @@ func (client AppsClient) DeleteRelayServiceConnection(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "DeleteRelayServiceConnection", err.Error()) + return result, validation.NewError("web.AppsClient", "DeleteInstanceProcess", err.Error()) } - req, err := client.DeleteRelayServiceConnectionPreparer(ctx, resourceGroupName, name, entityName) + req, err := client.DeleteInstanceProcessPreparer(ctx, resourceGroupName, name, processID, instanceID) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteRelayServiceConnection", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteInstanceProcess", nil, "Failure preparing request") return } - resp, err := client.DeleteRelayServiceConnectionSender(req) + resp, err := client.DeleteInstanceProcessSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteRelayServiceConnection", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteInstanceProcess", resp, "Failure sending request") return } - result, err = client.DeleteRelayServiceConnectionResponder(resp) + result, err = client.DeleteInstanceProcessResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteRelayServiceConnection", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteInstanceProcess", resp, "Failure responding to request") } return } -// DeleteRelayServiceConnectionPreparer prepares the DeleteRelayServiceConnection request. -func (client AppsClient) DeleteRelayServiceConnectionPreparer(ctx context.Context, resourceGroupName string, name string, entityName string) (*http.Request, error) { +// DeleteInstanceProcessPreparer prepares the DeleteInstanceProcess request. +func (client AppsClient) DeleteInstanceProcessPreparer(ctx context.Context, resourceGroupName string, name string, processID string, instanceID string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "entityName": autorest.Encode("path", entityName), + "instanceId": autorest.Encode("path", instanceID), "name": autorest.Encode("path", name), + "processId": autorest.Encode("path", processID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -5851,40 +5871,43 @@ func (client AppsClient) DeleteRelayServiceConnectionPreparer(ctx context.Contex preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// DeleteRelayServiceConnectionSender sends the DeleteRelayServiceConnection request. The method will close the +// DeleteInstanceProcessSender sends the DeleteInstanceProcess request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) DeleteRelayServiceConnectionSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) DeleteInstanceProcessSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// DeleteRelayServiceConnectionResponder handles the response to the DeleteRelayServiceConnection request. The method always +// DeleteInstanceProcessResponder handles the response to the DeleteInstanceProcess request. The method always // closes the http.Response Body. -func (client AppsClient) DeleteRelayServiceConnectionResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AppsClient) DeleteInstanceProcessResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), autorest.ByClosing()) result.Response = resp return } -// DeleteRelayServiceConnectionSlot deletes a relay service connection by its name. +// DeleteInstanceProcessSlot terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out +// instance in a web site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -// entityName - name of the hybrid connection configuration. -// slot - name of the deployment slot. If a slot is not specified, the API will delete a hybrid connection for -// the production slot. -func (client AppsClient) DeleteRelayServiceConnectionSlot(ctx context.Context, resourceGroupName string, name string, entityName string, slot string) (result autorest.Response, err error) { +// name - site name. +// processID - pID. +// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the +// production slot. +// instanceID - ID of a specific scaled-out instance. This is the value of the name property in the JSON +// response from "GET api/sites/{siteName}/instances". +func (client AppsClient) DeleteInstanceProcessSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteRelayServiceConnectionSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteInstanceProcessSlot") defer func() { sc := -1 if result.Response != nil { @@ -5898,35 +5921,36 @@ func (client AppsClient) DeleteRelayServiceConnectionSlot(ctx context.Context, r Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "DeleteRelayServiceConnectionSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "DeleteInstanceProcessSlot", err.Error()) } - req, err := client.DeleteRelayServiceConnectionSlotPreparer(ctx, resourceGroupName, name, entityName, slot) + req, err := client.DeleteInstanceProcessSlotPreparer(ctx, resourceGroupName, name, processID, slot, instanceID) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteRelayServiceConnectionSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteInstanceProcessSlot", nil, "Failure preparing request") return } - resp, err := client.DeleteRelayServiceConnectionSlotSender(req) + resp, err := client.DeleteInstanceProcessSlotSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteRelayServiceConnectionSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteInstanceProcessSlot", resp, "Failure sending request") return } - result, err = client.DeleteRelayServiceConnectionSlotResponder(resp) + result, err = client.DeleteInstanceProcessSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteRelayServiceConnectionSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteInstanceProcessSlot", resp, "Failure responding to request") } return } -// DeleteRelayServiceConnectionSlotPreparer prepares the DeleteRelayServiceConnectionSlot request. -func (client AppsClient) DeleteRelayServiceConnectionSlotPreparer(ctx context.Context, resourceGroupName string, name string, entityName string, slot string) (*http.Request, error) { +// DeleteInstanceProcessSlotPreparer prepares the DeleteInstanceProcessSlot request. +func (client AppsClient) DeleteInstanceProcessSlotPreparer(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "entityName": autorest.Encode("path", entityName), + "instanceId": autorest.Encode("path", instanceID), "name": autorest.Encode("path", name), + "processId": autorest.Encode("path", processID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -5940,38 +5964,38 @@ func (client AppsClient) DeleteRelayServiceConnectionSlotPreparer(ctx context.Co preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// DeleteRelayServiceConnectionSlotSender sends the DeleteRelayServiceConnectionSlot request. The method will close the +// DeleteInstanceProcessSlotSender sends the DeleteInstanceProcessSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) DeleteRelayServiceConnectionSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) DeleteInstanceProcessSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// DeleteRelayServiceConnectionSlotResponder handles the response to the DeleteRelayServiceConnectionSlot request. The method always +// DeleteInstanceProcessSlotResponder handles the response to the DeleteInstanceProcessSlot request. The method always // closes the http.Response Body. -func (client AppsClient) DeleteRelayServiceConnectionSlotResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AppsClient) DeleteInstanceProcessSlotResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), autorest.ByClosing()) result.Response = resp return } -// DeleteSiteExtension remove a site extension from a web site, or a deployment slot. +// DeletePremierAddOn delete a premier add-on from an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - site name. -// siteExtensionID - site extension name. -func (client AppsClient) DeleteSiteExtension(ctx context.Context, resourceGroupName string, name string, siteExtensionID string) (result autorest.Response, err error) { +// name - name of the app. +// premierAddOnName - add-on name. +func (client AppsClient) DeletePremierAddOn(ctx context.Context, resourceGroupName string, name string, premierAddOnName string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteSiteExtension") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeletePremierAddOn") defer func() { sc := -1 if result.Response != nil { @@ -5985,36 +6009,36 @@ func (client AppsClient) DeleteSiteExtension(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "DeleteSiteExtension", err.Error()) + return result, validation.NewError("web.AppsClient", "DeletePremierAddOn", err.Error()) } - req, err := client.DeleteSiteExtensionPreparer(ctx, resourceGroupName, name, siteExtensionID) + req, err := client.DeletePremierAddOnPreparer(ctx, resourceGroupName, name, premierAddOnName) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSiteExtension", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeletePremierAddOn", nil, "Failure preparing request") return } - resp, err := client.DeleteSiteExtensionSender(req) + resp, err := client.DeletePremierAddOnSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSiteExtension", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeletePremierAddOn", resp, "Failure sending request") return } - result, err = client.DeleteSiteExtensionResponder(resp) + result, err = client.DeletePremierAddOnResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSiteExtension", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeletePremierAddOn", resp, "Failure responding to request") } return } -// DeleteSiteExtensionPreparer prepares the DeleteSiteExtension request. -func (client AppsClient) DeleteSiteExtensionPreparer(ctx context.Context, resourceGroupName string, name string, siteExtensionID string) (*http.Request, error) { +// DeletePremierAddOnPreparer prepares the DeletePremierAddOn request. +func (client AppsClient) DeletePremierAddOnPreparer(ctx context.Context, resourceGroupName string, name string, premierAddOnName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), + "premierAddOnName": autorest.Encode("path", premierAddOnName), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "siteExtensionId": autorest.Encode("path", siteExtensionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -6026,40 +6050,40 @@ func (client AppsClient) DeleteSiteExtensionPreparer(ctx context.Context, resour preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// DeleteSiteExtensionSender sends the DeleteSiteExtension request. The method will close the +// DeletePremierAddOnSender sends the DeletePremierAddOn request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) DeleteSiteExtensionSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) DeletePremierAddOnSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// DeleteSiteExtensionResponder handles the response to the DeleteSiteExtension request. The method always +// DeletePremierAddOnResponder handles the response to the DeletePremierAddOn request. The method always // closes the http.Response Body. -func (client AppsClient) DeleteSiteExtensionResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AppsClient) DeletePremierAddOnResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByClosing()) result.Response = resp return } -// DeleteSiteExtensionSlot remove a site extension from a web site, or a deployment slot. +// DeletePremierAddOnSlot delete a premier add-on from an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - site name. -// siteExtensionID - site extension name. -// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the +// name - name of the app. +// premierAddOnName - add-on name. +// slot - name of the deployment slot. If a slot is not specified, the API will delete the named add-on for the // production slot. -func (client AppsClient) DeleteSiteExtensionSlot(ctx context.Context, resourceGroupName string, name string, siteExtensionID string, slot string) (result autorest.Response, err error) { +func (client AppsClient) DeletePremierAddOnSlot(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, slot string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteSiteExtensionSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeletePremierAddOnSlot") defer func() { sc := -1 if result.Response != nil { @@ -6073,36 +6097,36 @@ func (client AppsClient) DeleteSiteExtensionSlot(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "DeleteSiteExtensionSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "DeletePremierAddOnSlot", err.Error()) } - req, err := client.DeleteSiteExtensionSlotPreparer(ctx, resourceGroupName, name, siteExtensionID, slot) + req, err := client.DeletePremierAddOnSlotPreparer(ctx, resourceGroupName, name, premierAddOnName, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSiteExtensionSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeletePremierAddOnSlot", nil, "Failure preparing request") return } - resp, err := client.DeleteSiteExtensionSlotSender(req) + resp, err := client.DeletePremierAddOnSlotSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSiteExtensionSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeletePremierAddOnSlot", resp, "Failure sending request") return } - result, err = client.DeleteSiteExtensionSlotResponder(resp) + result, err = client.DeletePremierAddOnSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSiteExtensionSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeletePremierAddOnSlot", resp, "Failure responding to request") } return } -// DeleteSiteExtensionSlotPreparer prepares the DeleteSiteExtensionSlot request. -func (client AppsClient) DeleteSiteExtensionSlotPreparer(ctx context.Context, resourceGroupName string, name string, siteExtensionID string, slot string) (*http.Request, error) { +// DeletePremierAddOnSlotPreparer prepares the DeletePremierAddOnSlot request. +func (client AppsClient) DeletePremierAddOnSlotPreparer(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), + "premierAddOnName": autorest.Encode("path", premierAddOnName), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "siteExtensionId": autorest.Encode("path", siteExtensionID), "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -6115,41 +6139,39 @@ func (client AppsClient) DeleteSiteExtensionSlotPreparer(ctx context.Context, re preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// DeleteSiteExtensionSlotSender sends the DeleteSiteExtensionSlot request. The method will close the +// DeletePremierAddOnSlotSender sends the DeletePremierAddOnSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) DeleteSiteExtensionSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) DeletePremierAddOnSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// DeleteSiteExtensionSlotResponder handles the response to the DeleteSiteExtensionSlot request. The method always +// DeletePremierAddOnSlotResponder handles the response to the DeletePremierAddOnSlot request. The method always // closes the http.Response Body. -func (client AppsClient) DeleteSiteExtensionSlotResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AppsClient) DeletePremierAddOnSlotResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByClosing()) result.Response = resp return } -// DeleteSlot deletes a web, mobile, or API app, or one of the deployment slots. +// DeleteProcess terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in +// a web site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app to delete. -// slot - name of the deployment slot to delete. By default, the API deletes the production slot. -// deleteMetrics - if true, web app metrics are also deleted. -// deleteEmptyServerFarm - specify true if the App Service plan will be empty after app deletion and you want -// to delete the empty App Service plan. By default, the empty App Service plan is not deleted. -func (client AppsClient) DeleteSlot(ctx context.Context, resourceGroupName string, name string, slot string, deleteMetrics *bool, deleteEmptyServerFarm *bool) (result autorest.Response, err error) { +// name - site name. +// processID - pID. +func (client AppsClient) DeleteProcess(ctx context.Context, resourceGroupName string, name string, processID string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteProcess") defer func() { sc := -1 if result.Response != nil { @@ -6163,36 +6185,36 @@ func (client AppsClient) DeleteSlot(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "DeleteSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "DeleteProcess", err.Error()) } - req, err := client.DeleteSlotPreparer(ctx, resourceGroupName, name, slot, deleteMetrics, deleteEmptyServerFarm) + req, err := client.DeleteProcessPreparer(ctx, resourceGroupName, name, processID) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteProcess", nil, "Failure preparing request") return } - resp, err := client.DeleteSlotSender(req) + resp, err := client.DeleteProcessSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteProcess", resp, "Failure sending request") return } - result, err = client.DeleteSlotResponder(resp) + result, err = client.DeleteProcessResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteProcess", resp, "Failure responding to request") } return } -// DeleteSlotPreparer prepares the DeleteSlot request. -func (client AppsClient) DeleteSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string, deleteMetrics *bool, deleteEmptyServerFarm *bool) (*http.Request, error) { +// DeleteProcessPreparer prepares the DeleteProcess request. +func (client AppsClient) DeleteProcessPreparer(ctx context.Context, resourceGroupName string, name string, processID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), + "processId": autorest.Encode("path", processID), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -6200,31 +6222,25 @@ func (client AppsClient) DeleteSlotPreparer(ctx context.Context, resourceGroupNa queryParameters := map[string]interface{}{ "api-version": APIVersion, } - if deleteMetrics != nil { - queryParameters["deleteMetrics"] = autorest.Encode("query", *deleteMetrics) - } - if deleteEmptyServerFarm != nil { - queryParameters["deleteEmptyServerFarm"] = autorest.Encode("query", *deleteEmptyServerFarm) - } preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// DeleteSlotSender sends the DeleteSlot request. The method will close the +// DeleteProcessSender sends the DeleteProcess request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) DeleteSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) DeleteProcessSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// DeleteSlotResponder handles the response to the DeleteSlot request. The method always +// DeleteProcessResponder handles the response to the DeleteProcess request. The method always // closes the http.Response Body. -func (client AppsClient) DeleteSlotResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AppsClient) DeleteProcessResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -6234,13 +6250,17 @@ func (client AppsClient) DeleteSlotResponder(resp *http.Response) (result autore return } -// DeleteSourceControl deletes the source control configuration of an app. +// DeleteProcessSlot terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out +// instance in a web site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -func (client AppsClient) DeleteSourceControl(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) { +// name - site name. +// processID - pID. +// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the +// production slot. +func (client AppsClient) DeleteProcessSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteSourceControl") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteProcessSlot") defer func() { sc := -1 if result.Response != nil { @@ -6254,35 +6274,37 @@ func (client AppsClient) DeleteSourceControl(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "DeleteSourceControl", err.Error()) + return result, validation.NewError("web.AppsClient", "DeleteProcessSlot", err.Error()) } - req, err := client.DeleteSourceControlPreparer(ctx, resourceGroupName, name) + req, err := client.DeleteProcessSlotPreparer(ctx, resourceGroupName, name, processID, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSourceControl", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteProcessSlot", nil, "Failure preparing request") return } - resp, err := client.DeleteSourceControlSender(req) + resp, err := client.DeleteProcessSlotSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSourceControl", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteProcessSlot", resp, "Failure sending request") return } - result, err = client.DeleteSourceControlResponder(resp) + result, err = client.DeleteProcessSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSourceControl", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteProcessSlot", resp, "Failure responding to request") } return } -// DeleteSourceControlPreparer prepares the DeleteSourceControl request. -func (client AppsClient) DeleteSourceControlPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { +// DeleteProcessSlotPreparer prepares the DeleteProcessSlot request. +func (client AppsClient) DeleteProcessSlotPreparer(ctx context.Context, resourceGroupName string, name string, processID string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), + "processId": autorest.Encode("path", processID), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -6294,39 +6316,38 @@ func (client AppsClient) DeleteSourceControlPreparer(ctx context.Context, resour preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// DeleteSourceControlSender sends the DeleteSourceControl request. The method will close the +// DeleteProcessSlotSender sends the DeleteProcessSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) DeleteSourceControlSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) DeleteProcessSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// DeleteSourceControlResponder handles the response to the DeleteSourceControl request. The method always +// DeleteProcessSlotResponder handles the response to the DeleteProcessSlot request. The method always // closes the http.Response Body. -func (client AppsClient) DeleteSourceControlResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AppsClient) DeleteProcessSlotResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), autorest.ByClosing()) result.Response = resp return } -// DeleteSourceControlSlot deletes the source control configuration of an app. +// DeletePublicCertificate deletes a hostname binding for an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// slot - name of the deployment slot. If a slot is not specified, the API will delete the source control -// configuration for the production slot. -func (client AppsClient) DeleteSourceControlSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) { +// publicCertificateName - public certificate name. +func (client AppsClient) DeletePublicCertificate(ctx context.Context, resourceGroupName string, name string, publicCertificateName string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteSourceControlSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeletePublicCertificate") defer func() { sc := -1 if result.Response != nil { @@ -6340,37 +6361,37 @@ func (client AppsClient) DeleteSourceControlSlot(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "DeleteSourceControlSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "DeletePublicCertificate", err.Error()) } - req, err := client.DeleteSourceControlSlotPreparer(ctx, resourceGroupName, name, slot) + req, err := client.DeletePublicCertificatePreparer(ctx, resourceGroupName, name, publicCertificateName) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSourceControlSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeletePublicCertificate", nil, "Failure preparing request") return } - resp, err := client.DeleteSourceControlSlotSender(req) + resp, err := client.DeletePublicCertificateSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSourceControlSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeletePublicCertificate", resp, "Failure sending request") return } - result, err = client.DeleteSourceControlSlotResponder(resp) + result, err = client.DeletePublicCertificateResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSourceControlSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeletePublicCertificate", resp, "Failure responding to request") } return } -// DeleteSourceControlSlotPreparer prepares the DeleteSourceControlSlot request. -func (client AppsClient) DeleteSourceControlSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { +// DeletePublicCertificatePreparer prepares the DeletePublicCertificate request. +func (client AppsClient) DeletePublicCertificatePreparer(ctx context.Context, resourceGroupName string, name string, publicCertificateName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "name": autorest.Encode("path", name), + "publicCertificateName": autorest.Encode("path", publicCertificateName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2018-02-01" @@ -6381,37 +6402,40 @@ func (client AppsClient) DeleteSourceControlSlotPreparer(ctx context.Context, re preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// DeleteSourceControlSlotSender sends the DeleteSourceControlSlot request. The method will close the +// DeletePublicCertificateSender sends the DeletePublicCertificate request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) DeleteSourceControlSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) DeletePublicCertificateSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// DeleteSourceControlSlotResponder handles the response to the DeleteSourceControlSlot request. The method always +// DeletePublicCertificateResponder handles the response to the DeletePublicCertificate request. The method always // closes the http.Response Body. -func (client AppsClient) DeleteSourceControlSlotResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AppsClient) DeletePublicCertificateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp return } -// DeleteSwiftVirtualNetwork deletes a Swift Virtual Network connection from an app (or deployment slot). +// DeletePublicCertificateSlot deletes a hostname binding for an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -func (client AppsClient) DeleteSwiftVirtualNetwork(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) { +// slot - name of the deployment slot. If a slot is not specified, the API will delete the binding for the +// production slot. +// publicCertificateName - public certificate name. +func (client AppsClient) DeletePublicCertificateSlot(ctx context.Context, resourceGroupName string, name string, slot string, publicCertificateName string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteSwiftVirtualNetwork") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeletePublicCertificateSlot") defer func() { sc := -1 if result.Response != nil { @@ -6425,36 +6449,38 @@ func (client AppsClient) DeleteSwiftVirtualNetwork(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "DeleteSwiftVirtualNetwork", err.Error()) + return result, validation.NewError("web.AppsClient", "DeletePublicCertificateSlot", err.Error()) } - req, err := client.DeleteSwiftVirtualNetworkPreparer(ctx, resourceGroupName, name) + req, err := client.DeletePublicCertificateSlotPreparer(ctx, resourceGroupName, name, slot, publicCertificateName) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSwiftVirtualNetwork", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeletePublicCertificateSlot", nil, "Failure preparing request") return } - resp, err := client.DeleteSwiftVirtualNetworkSender(req) + resp, err := client.DeletePublicCertificateSlotSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSwiftVirtualNetwork", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeletePublicCertificateSlot", resp, "Failure sending request") return } - result, err = client.DeleteSwiftVirtualNetworkResponder(resp) + result, err = client.DeletePublicCertificateSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSwiftVirtualNetwork", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeletePublicCertificateSlot", resp, "Failure responding to request") } return } -// DeleteSwiftVirtualNetworkPreparer prepares the DeleteSwiftVirtualNetwork request. -func (client AppsClient) DeleteSwiftVirtualNetworkPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { +// DeletePublicCertificateSlotPreparer prepares the DeletePublicCertificateSlot request. +func (client AppsClient) DeletePublicCertificateSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string, publicCertificateName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "name": autorest.Encode("path", name), + "publicCertificateName": autorest.Encode("path", publicCertificateName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2018-02-01" @@ -6465,39 +6491,38 @@ func (client AppsClient) DeleteSwiftVirtualNetworkPreparer(ctx context.Context, preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// DeleteSwiftVirtualNetworkSender sends the DeleteSwiftVirtualNetwork request. The method will close the +// DeletePublicCertificateSlotSender sends the DeletePublicCertificateSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) DeleteSwiftVirtualNetworkSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) DeletePublicCertificateSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// DeleteSwiftVirtualNetworkResponder handles the response to the DeleteSwiftVirtualNetwork request. The method always +// DeletePublicCertificateSlotResponder handles the response to the DeletePublicCertificateSlot request. The method always // closes the http.Response Body. -func (client AppsClient) DeleteSwiftVirtualNetworkResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AppsClient) DeletePublicCertificateSlotResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp return } -// DeleteSwiftVirtualNetworkSlot deletes a Swift Virtual Network connection from an app (or deployment slot). +// DeleteRelayServiceConnection deletes a relay service connection by its name. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// slot - name of the deployment slot. If a slot is not specified, the API will delete the connection for the -// production slot. -func (client AppsClient) DeleteSwiftVirtualNetworkSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) { +// entityName - name of the hybrid connection configuration. +func (client AppsClient) DeleteRelayServiceConnection(ctx context.Context, resourceGroupName string, name string, entityName string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteSwiftVirtualNetworkSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteRelayServiceConnection") defer func() { sc := -1 if result.Response != nil { @@ -6511,36 +6536,36 @@ func (client AppsClient) DeleteSwiftVirtualNetworkSlot(ctx context.Context, reso Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "DeleteSwiftVirtualNetworkSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "DeleteRelayServiceConnection", err.Error()) } - req, err := client.DeleteSwiftVirtualNetworkSlotPreparer(ctx, resourceGroupName, name, slot) + req, err := client.DeleteRelayServiceConnectionPreparer(ctx, resourceGroupName, name, entityName) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSwiftVirtualNetworkSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteRelayServiceConnection", nil, "Failure preparing request") return } - resp, err := client.DeleteSwiftVirtualNetworkSlotSender(req) + resp, err := client.DeleteRelayServiceConnectionSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSwiftVirtualNetworkSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteRelayServiceConnection", resp, "Failure sending request") return } - result, err = client.DeleteSwiftVirtualNetworkSlotResponder(resp) + result, err = client.DeleteRelayServiceConnectionResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSwiftVirtualNetworkSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteRelayServiceConnection", resp, "Failure responding to request") } return } -// DeleteSwiftVirtualNetworkSlotPreparer prepares the DeleteSwiftVirtualNetworkSlot request. -func (client AppsClient) DeleteSwiftVirtualNetworkSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { +// DeleteRelayServiceConnectionPreparer prepares the DeleteRelayServiceConnection request. +func (client AppsClient) DeleteRelayServiceConnectionPreparer(ctx context.Context, resourceGroupName string, name string, entityName string) (*http.Request, error) { pathParameters := map[string]interface{}{ + "entityName": autorest.Encode("path", entityName), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -6552,21 +6577,21 @@ func (client AppsClient) DeleteSwiftVirtualNetworkSlotPreparer(ctx context.Conte preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// DeleteSwiftVirtualNetworkSlotSender sends the DeleteSwiftVirtualNetworkSlot request. The method will close the +// DeleteRelayServiceConnectionSender sends the DeleteRelayServiceConnection request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) DeleteSwiftVirtualNetworkSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) DeleteRelayServiceConnectionSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// DeleteSwiftVirtualNetworkSlotResponder handles the response to the DeleteSwiftVirtualNetworkSlot request. The method always +// DeleteRelayServiceConnectionResponder handles the response to the DeleteRelayServiceConnection request. The method always // closes the http.Response Body. -func (client AppsClient) DeleteSwiftVirtualNetworkSlotResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AppsClient) DeleteRelayServiceConnectionResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -6576,14 +6601,16 @@ func (client AppsClient) DeleteSwiftVirtualNetworkSlotResponder(resp *http.Respo return } -// DeleteTriggeredWebJob delete a triggered web job by its ID for an app, or a deployment slot. +// DeleteRelayServiceConnectionSlot deletes a relay service connection by its name. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - site name. -// webJobName - name of Web Job. -func (client AppsClient) DeleteTriggeredWebJob(ctx context.Context, resourceGroupName string, name string, webJobName string) (result autorest.Response, err error) { +// name - name of the app. +// entityName - name of the hybrid connection configuration. +// slot - name of the deployment slot. If a slot is not specified, the API will delete a hybrid connection for +// the production slot. +func (client AppsClient) DeleteRelayServiceConnectionSlot(ctx context.Context, resourceGroupName string, name string, entityName string, slot string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteTriggeredWebJob") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteRelayServiceConnectionSlot") defer func() { sc := -1 if result.Response != nil { @@ -6597,37 +6624,38 @@ func (client AppsClient) DeleteTriggeredWebJob(ctx context.Context, resourceGrou Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "DeleteTriggeredWebJob", err.Error()) + return result, validation.NewError("web.AppsClient", "DeleteRelayServiceConnectionSlot", err.Error()) } - req, err := client.DeleteTriggeredWebJobPreparer(ctx, resourceGroupName, name, webJobName) + req, err := client.DeleteRelayServiceConnectionSlotPreparer(ctx, resourceGroupName, name, entityName, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteTriggeredWebJob", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteRelayServiceConnectionSlot", nil, "Failure preparing request") return } - resp, err := client.DeleteTriggeredWebJobSender(req) + resp, err := client.DeleteRelayServiceConnectionSlotSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteTriggeredWebJob", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteRelayServiceConnectionSlot", resp, "Failure sending request") return } - result, err = client.DeleteTriggeredWebJobResponder(resp) + result, err = client.DeleteRelayServiceConnectionSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteTriggeredWebJob", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteRelayServiceConnectionSlot", resp, "Failure responding to request") } return } -// DeleteTriggeredWebJobPreparer prepares the DeleteTriggeredWebJob request. -func (client AppsClient) DeleteTriggeredWebJobPreparer(ctx context.Context, resourceGroupName string, name string, webJobName string) (*http.Request, error) { +// DeleteRelayServiceConnectionSlotPreparer prepares the DeleteRelayServiceConnectionSlot request. +func (client AppsClient) DeleteRelayServiceConnectionSlotPreparer(ctx context.Context, resourceGroupName string, name string, entityName string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ + "entityName": autorest.Encode("path", entityName), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "webJobName": autorest.Encode("path", webJobName), } const APIVersion = "2018-02-01" @@ -6638,40 +6666,38 @@ func (client AppsClient) DeleteTriggeredWebJobPreparer(ctx context.Context, reso preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// DeleteTriggeredWebJobSender sends the DeleteTriggeredWebJob request. The method will close the +// DeleteRelayServiceConnectionSlotSender sends the DeleteRelayServiceConnectionSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) DeleteTriggeredWebJobSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) DeleteRelayServiceConnectionSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// DeleteTriggeredWebJobResponder handles the response to the DeleteTriggeredWebJob request. The method always +// DeleteRelayServiceConnectionSlotResponder handles the response to the DeleteRelayServiceConnectionSlot request. The method always // closes the http.Response Body. -func (client AppsClient) DeleteTriggeredWebJobResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AppsClient) DeleteRelayServiceConnectionSlotResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), autorest.ByClosing()) result.Response = resp return } -// DeleteTriggeredWebJobSlot delete a triggered web job by its ID for an app, or a deployment slot. +// DeleteSiteExtension remove a site extension from a web site, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. -// webJobName - name of Web Job. -// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the -// production slot. -func (client AppsClient) DeleteTriggeredWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (result autorest.Response, err error) { +// siteExtensionID - site extension name. +func (client AppsClient) DeleteSiteExtension(ctx context.Context, resourceGroupName string, name string, siteExtensionID string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteTriggeredWebJobSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteSiteExtension") defer func() { sc := -1 if result.Response != nil { @@ -6685,38 +6711,37 @@ func (client AppsClient) DeleteTriggeredWebJobSlot(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "DeleteTriggeredWebJobSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "DeleteSiteExtension", err.Error()) } - req, err := client.DeleteTriggeredWebJobSlotPreparer(ctx, resourceGroupName, name, webJobName, slot) + req, err := client.DeleteSiteExtensionPreparer(ctx, resourceGroupName, name, siteExtensionID) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteTriggeredWebJobSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSiteExtension", nil, "Failure preparing request") return } - resp, err := client.DeleteTriggeredWebJobSlotSender(req) + resp, err := client.DeleteSiteExtensionSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteTriggeredWebJobSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSiteExtension", resp, "Failure sending request") return } - result, err = client.DeleteTriggeredWebJobSlotResponder(resp) + result, err = client.DeleteSiteExtensionResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteTriggeredWebJobSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSiteExtension", resp, "Failure responding to request") } return } -// DeleteTriggeredWebJobSlotPreparer prepares the DeleteTriggeredWebJobSlot request. -func (client AppsClient) DeleteTriggeredWebJobSlotPreparer(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (*http.Request, error) { +// DeleteSiteExtensionPreparer prepares the DeleteSiteExtension request. +func (client AppsClient) DeleteSiteExtensionPreparer(ctx context.Context, resourceGroupName string, name string, siteExtensionID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), + "siteExtensionId": autorest.Encode("path", siteExtensionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "webJobName": autorest.Encode("path", webJobName), } const APIVersion = "2018-02-01" @@ -6727,38 +6752,40 @@ func (client AppsClient) DeleteTriggeredWebJobSlotPreparer(ctx context.Context, preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// DeleteTriggeredWebJobSlotSender sends the DeleteTriggeredWebJobSlot request. The method will close the +// DeleteSiteExtensionSender sends the DeleteSiteExtension request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) DeleteTriggeredWebJobSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) DeleteSiteExtensionSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// DeleteTriggeredWebJobSlotResponder handles the response to the DeleteTriggeredWebJobSlot request. The method always +// DeleteSiteExtensionResponder handles the response to the DeleteSiteExtension request. The method always // closes the http.Response Body. -func (client AppsClient) DeleteTriggeredWebJobSlotResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AppsClient) DeleteSiteExtensionResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), autorest.ByClosing()) result.Response = resp return } -// DeleteVnetConnection deletes a connection from an app (or deployment slot to a named virtual network. +// DeleteSiteExtensionSlot remove a site extension from a web site, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -// vnetName - name of the virtual network. -func (client AppsClient) DeleteVnetConnection(ctx context.Context, resourceGroupName string, name string, vnetName string) (result autorest.Response, err error) { +// name - site name. +// siteExtensionID - site extension name. +// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the +// production slot. +func (client AppsClient) DeleteSiteExtensionSlot(ctx context.Context, resourceGroupName string, name string, siteExtensionID string, slot string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteVnetConnection") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteSiteExtensionSlot") defer func() { sc := -1 if result.Response != nil { @@ -6772,37 +6799,38 @@ func (client AppsClient) DeleteVnetConnection(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "DeleteVnetConnection", err.Error()) + return result, validation.NewError("web.AppsClient", "DeleteSiteExtensionSlot", err.Error()) } - req, err := client.DeleteVnetConnectionPreparer(ctx, resourceGroupName, name, vnetName) + req, err := client.DeleteSiteExtensionSlotPreparer(ctx, resourceGroupName, name, siteExtensionID, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteVnetConnection", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSiteExtensionSlot", nil, "Failure preparing request") return } - resp, err := client.DeleteVnetConnectionSender(req) + resp, err := client.DeleteSiteExtensionSlotSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteVnetConnection", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSiteExtensionSlot", resp, "Failure sending request") return } - result, err = client.DeleteVnetConnectionResponder(resp) + result, err = client.DeleteSiteExtensionSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteVnetConnection", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSiteExtensionSlot", resp, "Failure responding to request") } return } -// DeleteVnetConnectionPreparer prepares the DeleteVnetConnection request. -func (client AppsClient) DeleteVnetConnectionPreparer(ctx context.Context, resourceGroupName string, name string, vnetName string) (*http.Request, error) { +// DeleteSiteExtensionSlotPreparer prepares the DeleteSiteExtensionSlot request. +func (client AppsClient) DeleteSiteExtensionSlotPreparer(ctx context.Context, resourceGroupName string, name string, siteExtensionID string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "siteExtensionId": autorest.Encode("path", siteExtensionID), + "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vnetName": autorest.Encode("path", vnetName), } const APIVersion = "2018-02-01" @@ -6813,40 +6841,41 @@ func (client AppsClient) DeleteVnetConnectionPreparer(ctx context.Context, resou preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// DeleteVnetConnectionSender sends the DeleteVnetConnection request. The method will close the +// DeleteSiteExtensionSlotSender sends the DeleteSiteExtensionSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) DeleteVnetConnectionSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) DeleteSiteExtensionSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// DeleteVnetConnectionResponder handles the response to the DeleteVnetConnection request. The method always +// DeleteSiteExtensionSlotResponder handles the response to the DeleteSiteExtensionSlot request. The method always // closes the http.Response Body. -func (client AppsClient) DeleteVnetConnectionResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AppsClient) DeleteSiteExtensionSlotResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), autorest.ByClosing()) result.Response = resp return } -// DeleteVnetConnectionSlot deletes a connection from an app (or deployment slot to a named virtual network. +// DeleteSlot deletes a web, mobile, or API app, or one of the deployment slots. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -// vnetName - name of the virtual network. -// slot - name of the deployment slot. If a slot is not specified, the API will delete the connection for the -// production slot. -func (client AppsClient) DeleteVnetConnectionSlot(ctx context.Context, resourceGroupName string, name string, vnetName string, slot string) (result autorest.Response, err error) { +// name - name of the app to delete. +// slot - name of the deployment slot to delete. By default, the API deletes the production slot. +// deleteMetrics - if true, web app metrics are also deleted. +// deleteEmptyServerFarm - specify true if the App Service plan will be empty after app deletion and you want +// to delete the empty App Service plan. By default, the empty App Service plan is not deleted. +func (client AppsClient) DeleteSlot(ctx context.Context, resourceGroupName string, name string, slot string, deleteMetrics *bool, deleteEmptyServerFarm *bool) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteVnetConnectionSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteSlot") defer func() { sc := -1 if result.Response != nil { @@ -6860,85 +6889,88 @@ func (client AppsClient) DeleteVnetConnectionSlot(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "DeleteVnetConnectionSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "DeleteSlot", err.Error()) } - req, err := client.DeleteVnetConnectionSlotPreparer(ctx, resourceGroupName, name, vnetName, slot) + req, err := client.DeleteSlotPreparer(ctx, resourceGroupName, name, slot, deleteMetrics, deleteEmptyServerFarm) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteVnetConnectionSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSlot", nil, "Failure preparing request") return } - resp, err := client.DeleteVnetConnectionSlotSender(req) + resp, err := client.DeleteSlotSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteVnetConnectionSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSlot", resp, "Failure sending request") return } - result, err = client.DeleteVnetConnectionSlotResponder(resp) + result, err = client.DeleteSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteVnetConnectionSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSlot", resp, "Failure responding to request") } return } -// DeleteVnetConnectionSlotPreparer prepares the DeleteVnetConnectionSlot request. -func (client AppsClient) DeleteVnetConnectionSlotPreparer(ctx context.Context, resourceGroupName string, name string, vnetName string, slot string) (*http.Request, error) { +// DeleteSlotPreparer prepares the DeleteSlot request. +func (client AppsClient) DeleteSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string, deleteMetrics *bool, deleteEmptyServerFarm *bool) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vnetName": autorest.Encode("path", vnetName), } const APIVersion = "2018-02-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if deleteMetrics != nil { + queryParameters["deleteMetrics"] = autorest.Encode("query", *deleteMetrics) + } + if deleteEmptyServerFarm != nil { + queryParameters["deleteEmptyServerFarm"] = autorest.Encode("query", *deleteEmptyServerFarm) + } preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// DeleteVnetConnectionSlotSender sends the DeleteVnetConnectionSlot request. The method will close the +// DeleteSlotSender sends the DeleteSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) DeleteVnetConnectionSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) DeleteSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// DeleteVnetConnectionSlotResponder handles the response to the DeleteVnetConnectionSlot request. The method always +// DeleteSlotResponder handles the response to the DeleteSlot request. The method always // closes the http.Response Body. -func (client AppsClient) DeleteVnetConnectionSlotResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AppsClient) DeleteSlotResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), autorest.ByClosing()) result.Response = resp return } -// DiscoverBackup discovers an existing app backup that can be restored from a blob in Azure storage. Use this to get -// information about the databases stored in a backup. +// DeleteSourceControl deletes the source control configuration of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// request - a RestoreRequest object that includes Azure storage URL and blog name for discovery of backup. -func (client AppsClient) DiscoverBackup(ctx context.Context, resourceGroupName string, name string, request RestoreRequest) (result RestoreRequest, err error) { +func (client AppsClient) DeleteSourceControl(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DiscoverBackup") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteSourceControl") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.Response != nil { + sc = result.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -6947,38 +6979,33 @@ func (client AppsClient) DiscoverBackup(ctx context.Context, resourceGroupName s {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, - {TargetValue: request, - Constraints: []validation.Constraint{{Target: "request.RestoreRequestProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "request.RestoreRequestProperties.StorageAccountURL", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "request.RestoreRequestProperties.Overwrite", Name: validation.Null, Rule: true, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "DiscoverBackup", err.Error()) + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeleteSourceControl", err.Error()) } - req, err := client.DiscoverBackupPreparer(ctx, resourceGroupName, name, request) + req, err := client.DeleteSourceControlPreparer(ctx, resourceGroupName, name) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DiscoverBackup", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSourceControl", nil, "Failure preparing request") return } - resp, err := client.DiscoverBackupSender(req) + resp, err := client.DeleteSourceControlSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "DiscoverBackup", resp, "Failure sending request") + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSourceControl", resp, "Failure sending request") return } - result, err = client.DiscoverBackupResponder(resp) + result, err = client.DeleteSourceControlResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DiscoverBackup", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSourceControl", resp, "Failure responding to request") } return } -// DiscoverBackupPreparer prepares the DiscoverBackup request. -func (client AppsClient) DiscoverBackupPreparer(ctx context.Context, resourceGroupName string, name string, request RestoreRequest) (*http.Request, error) { +// DeleteSourceControlPreparer prepares the DeleteSourceControl request. +func (client AppsClient) DeleteSourceControlPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -6991,50 +7018,45 @@ func (client AppsClient) DiscoverBackupPreparer(ctx context.Context, resourceGro } preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), + autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/discoverbackup", pathParameters), - autorest.WithJSON(request), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// DiscoverBackupSender sends the DiscoverBackup request. The method will close the +// DeleteSourceControlSender sends the DeleteSourceControl request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) DiscoverBackupSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) DeleteSourceControlSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// DiscoverBackupResponder handles the response to the DiscoverBackup request. The method always +// DeleteSourceControlResponder handles the response to the DeleteSourceControl request. The method always // closes the http.Response Body. -func (client AppsClient) DiscoverBackupResponder(resp *http.Response) (result RestoreRequest, err error) { +func (client AppsClient) DeleteSourceControlResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNotFound), autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} + result.Response = resp return } -// DiscoverBackupSlot discovers an existing app backup that can be restored from a blob in Azure storage. Use this to -// get information about the databases stored in a backup. +// DeleteSourceControlSlot deletes the source control configuration of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// request - a RestoreRequest object that includes Azure storage URL and blog name for discovery of backup. -// slot - name of the deployment slot. If a slot is not specified, the API will perform discovery for the -// production slot. -func (client AppsClient) DiscoverBackupSlot(ctx context.Context, resourceGroupName string, name string, request RestoreRequest, slot string) (result RestoreRequest, err error) { +// slot - name of the deployment slot. If a slot is not specified, the API will delete the source control +// configuration for the production slot. +func (client AppsClient) DeleteSourceControlSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DiscoverBackupSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteSourceControlSlot") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.Response != nil { + sc = result.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -7043,38 +7065,33 @@ func (client AppsClient) DiscoverBackupSlot(ctx context.Context, resourceGroupNa {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, - {TargetValue: request, - Constraints: []validation.Constraint{{Target: "request.RestoreRequestProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "request.RestoreRequestProperties.StorageAccountURL", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "request.RestoreRequestProperties.Overwrite", Name: validation.Null, Rule: true, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "DiscoverBackupSlot", err.Error()) + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeleteSourceControlSlot", err.Error()) } - req, err := client.DiscoverBackupSlotPreparer(ctx, resourceGroupName, name, request, slot) + req, err := client.DeleteSourceControlSlotPreparer(ctx, resourceGroupName, name, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DiscoverBackupSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSourceControlSlot", nil, "Failure preparing request") return } - resp, err := client.DiscoverBackupSlotSender(req) + resp, err := client.DeleteSourceControlSlotSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "DiscoverBackupSlot", resp, "Failure sending request") + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSourceControlSlot", resp, "Failure sending request") return } - result, err = client.DiscoverBackupSlotResponder(resp) + result, err = client.DeleteSourceControlSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "DiscoverBackupSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSourceControlSlot", resp, "Failure responding to request") } return } -// DiscoverBackupSlotPreparer prepares the DiscoverBackupSlot request. -func (client AppsClient) DiscoverBackupSlotPreparer(ctx context.Context, resourceGroupName string, name string, request RestoreRequest, slot string) (*http.Request, error) { +// DeleteSourceControlSlotPreparer prepares the DeleteSourceControlSlot request. +func (client AppsClient) DeleteSourceControlSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -7088,42 +7105,39 @@ func (client AppsClient) DiscoverBackupSlotPreparer(ctx context.Context, resourc } preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), + autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/discoverbackup", pathParameters), - autorest.WithJSON(request), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// DiscoverBackupSlotSender sends the DiscoverBackupSlot request. The method will close the +// DeleteSourceControlSlotSender sends the DeleteSourceControlSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) DiscoverBackupSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) DeleteSourceControlSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// DiscoverBackupSlotResponder handles the response to the DiscoverBackupSlot request. The method always +// DeleteSourceControlSlotResponder handles the response to the DeleteSourceControlSlot request. The method always // closes the http.Response Body. -func (client AppsClient) DiscoverBackupSlotResponder(resp *http.Response) (result RestoreRequest, err error) { +func (client AppsClient) DeleteSourceControlSlotResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNotFound), autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} + result.Response = resp return } -// GenerateNewSitePublishingPassword generates a new publishing password for an app (or deployment slot, if specified). +// DeleteSwiftVirtualNetwork deletes a Swift Virtual Network connection from an app (or deployment slot). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -func (client AppsClient) GenerateNewSitePublishingPassword(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) { +func (client AppsClient) DeleteSwiftVirtualNetwork(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GenerateNewSitePublishingPassword") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteSwiftVirtualNetwork") defer func() { sc := -1 if result.Response != nil { @@ -7137,32 +7151,32 @@ func (client AppsClient) GenerateNewSitePublishingPassword(ctx context.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("web.AppsClient", "GenerateNewSitePublishingPassword", err.Error()) + return result, validation.NewError("web.AppsClient", "DeleteSwiftVirtualNetwork", err.Error()) } - req, err := client.GenerateNewSitePublishingPasswordPreparer(ctx, resourceGroupName, name) + req, err := client.DeleteSwiftVirtualNetworkPreparer(ctx, resourceGroupName, name) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GenerateNewSitePublishingPassword", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSwiftVirtualNetwork", nil, "Failure preparing request") return } - resp, err := client.GenerateNewSitePublishingPasswordSender(req) + resp, err := client.DeleteSwiftVirtualNetworkSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "web.AppsClient", "GenerateNewSitePublishingPassword", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSwiftVirtualNetwork", resp, "Failure sending request") return } - result, err = client.GenerateNewSitePublishingPasswordResponder(resp) + result, err = client.DeleteSwiftVirtualNetworkResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GenerateNewSitePublishingPassword", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSwiftVirtualNetwork", resp, "Failure responding to request") } return } -// GenerateNewSitePublishingPasswordPreparer prepares the GenerateNewSitePublishingPassword request. -func (client AppsClient) GenerateNewSitePublishingPasswordPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { +// DeleteSwiftVirtualNetworkPreparer prepares the DeleteSwiftVirtualNetwork request. +func (client AppsClient) DeleteSwiftVirtualNetworkPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -7175,42 +7189,41 @@ func (client AppsClient) GenerateNewSitePublishingPasswordPreparer(ctx context.C } preparer := autorest.CreatePreparer( - autorest.AsPost(), + autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/newpassword", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GenerateNewSitePublishingPasswordSender sends the GenerateNewSitePublishingPassword request. The method will close the +// DeleteSwiftVirtualNetworkSender sends the DeleteSwiftVirtualNetwork request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GenerateNewSitePublishingPasswordSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) DeleteSwiftVirtualNetworkSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GenerateNewSitePublishingPasswordResponder handles the response to the GenerateNewSitePublishingPassword request. The method always +// DeleteSwiftVirtualNetworkResponder handles the response to the DeleteSwiftVirtualNetwork request. The method always // closes the http.Response Body. -func (client AppsClient) GenerateNewSitePublishingPasswordResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AppsClient) DeleteSwiftVirtualNetworkResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), autorest.ByClosing()) result.Response = resp return } -// GenerateNewSitePublishingPasswordSlot generates a new publishing password for an app (or deployment slot, if -// specified). +// DeleteSwiftVirtualNetworkSlot deletes a Swift Virtual Network connection from an app (or deployment slot). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// slot - name of the deployment slot. If a slot is not specified, the API generate a new publishing password -// for the production slot. -func (client AppsClient) GenerateNewSitePublishingPasswordSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) { +// slot - name of the deployment slot. If a slot is not specified, the API will delete the connection for the +// production slot. +func (client AppsClient) DeleteSwiftVirtualNetworkSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GenerateNewSitePublishingPasswordSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteSwiftVirtualNetworkSlot") defer func() { sc := -1 if result.Response != nil { @@ -7224,32 +7237,32 @@ func (client AppsClient) GenerateNewSitePublishingPasswordSlot(ctx context.Conte Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GenerateNewSitePublishingPasswordSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "DeleteSwiftVirtualNetworkSlot", err.Error()) } - req, err := client.GenerateNewSitePublishingPasswordSlotPreparer(ctx, resourceGroupName, name, slot) + req, err := client.DeleteSwiftVirtualNetworkSlotPreparer(ctx, resourceGroupName, name, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GenerateNewSitePublishingPasswordSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSwiftVirtualNetworkSlot", nil, "Failure preparing request") return } - resp, err := client.GenerateNewSitePublishingPasswordSlotSender(req) + resp, err := client.DeleteSwiftVirtualNetworkSlotSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "web.AppsClient", "GenerateNewSitePublishingPasswordSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSwiftVirtualNetworkSlot", resp, "Failure sending request") return } - result, err = client.GenerateNewSitePublishingPasswordSlotResponder(resp) + result, err = client.DeleteSwiftVirtualNetworkSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GenerateNewSitePublishingPasswordSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSwiftVirtualNetworkSlot", resp, "Failure responding to request") } return } -// GenerateNewSitePublishingPasswordSlotPreparer prepares the GenerateNewSitePublishingPasswordSlot request. -func (client AppsClient) GenerateNewSitePublishingPasswordSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { +// DeleteSwiftVirtualNetworkSlotPreparer prepares the DeleteSwiftVirtualNetworkSlot request. +func (client AppsClient) DeleteSwiftVirtualNetworkSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -7263,43 +7276,44 @@ func (client AppsClient) GenerateNewSitePublishingPasswordSlotPreparer(ctx conte } preparer := autorest.CreatePreparer( - autorest.AsPost(), + autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/newpassword", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GenerateNewSitePublishingPasswordSlotSender sends the GenerateNewSitePublishingPasswordSlot request. The method will close the +// DeleteSwiftVirtualNetworkSlotSender sends the DeleteSwiftVirtualNetworkSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GenerateNewSitePublishingPasswordSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) DeleteSwiftVirtualNetworkSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GenerateNewSitePublishingPasswordSlotResponder handles the response to the GenerateNewSitePublishingPasswordSlot request. The method always +// DeleteSwiftVirtualNetworkSlotResponder handles the response to the DeleteSwiftVirtualNetworkSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GenerateNewSitePublishingPasswordSlotResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AppsClient) DeleteSwiftVirtualNetworkSlotResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), autorest.ByClosing()) result.Response = resp return } -// Get gets the details of a web, mobile, or API app. +// DeleteTriggeredWebJob delete a triggered web job by its ID for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -func (client AppsClient) Get(ctx context.Context, resourceGroupName string, name string) (result Site, err error) { +// name - site name. +// webJobName - name of Web Job. +func (client AppsClient) DeleteTriggeredWebJob(ctx context.Context, resourceGroupName string, name string, webJobName string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.Get") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteTriggeredWebJob") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.Response != nil { + sc = result.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -7309,36 +7323,37 @@ func (client AppsClient) Get(ctx context.Context, resourceGroupName string, name Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "Get", err.Error()) + return result, validation.NewError("web.AppsClient", "DeleteTriggeredWebJob", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, name) + req, err := client.DeleteTriggeredWebJobPreparer(ctx, resourceGroupName, name, webJobName) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteTriggeredWebJob", nil, "Failure preparing request") return } - resp, err := client.GetSender(req) + resp, err := client.DeleteTriggeredWebJobSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "Get", resp, "Failure sending request") + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteTriggeredWebJob", resp, "Failure sending request") return } - result, err = client.GetResponder(resp) + result, err = client.DeleteTriggeredWebJobResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteTriggeredWebJob", resp, "Failure responding to request") } return } -// GetPreparer prepares the Get request. -func (client AppsClient) GetPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { +// DeleteTriggeredWebJobPreparer prepares the DeleteTriggeredWebJob request. +func (client AppsClient) DeleteTriggeredWebJobPreparer(ctx context.Context, resourceGroupName string, name string, webJobName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webJobName": autorest.Encode("path", webJobName), } const APIVersion = "2018-02-01" @@ -7347,44 +7362,46 @@ func (client AppsClient) GetPreparer(ctx context.Context, resourceGroupName stri } preparer := autorest.CreatePreparer( - autorest.AsGet(), + autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetSender sends the Get request. The method will close the +// DeleteTriggeredWebJobSender sends the DeleteTriggeredWebJob request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) DeleteTriggeredWebJobSender(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 +// DeleteTriggeredWebJobResponder handles the response to the DeleteTriggeredWebJob request. The method always // closes the http.Response Body. -func (client AppsClient) GetResponder(resp *http.Response) (result Site, err error) { +func (client AppsClient) DeleteTriggeredWebJobResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), - autorest.ByUnmarshallingJSON(&result), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} + result.Response = resp return } -// GetAuthSettings gets the Authentication/Authorization settings of an app. +// DeleteTriggeredWebJobSlot delete a triggered web job by its ID for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -func (client AppsClient) GetAuthSettings(ctx context.Context, resourceGroupName string, name string) (result SiteAuthSettings, err error) { +// name - site name. +// webJobName - name of Web Job. +// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the +// production slot. +func (client AppsClient) DeleteTriggeredWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetAuthSettings") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteTriggeredWebJobSlot") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.Response != nil { + sc = result.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -7394,36 +7411,38 @@ func (client AppsClient) GetAuthSettings(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetAuthSettings", err.Error()) + return result, validation.NewError("web.AppsClient", "DeleteTriggeredWebJobSlot", err.Error()) } - req, err := client.GetAuthSettingsPreparer(ctx, resourceGroupName, name) + req, err := client.DeleteTriggeredWebJobSlotPreparer(ctx, resourceGroupName, name, webJobName, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAuthSettings", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteTriggeredWebJobSlot", nil, "Failure preparing request") return } - resp, err := client.GetAuthSettingsSender(req) + resp, err := client.DeleteTriggeredWebJobSlotSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAuthSettings", resp, "Failure sending request") + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteTriggeredWebJobSlot", resp, "Failure sending request") return } - result, err = client.GetAuthSettingsResponder(resp) + result, err = client.DeleteTriggeredWebJobSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAuthSettings", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteTriggeredWebJobSlot", resp, "Failure responding to request") } return } -// GetAuthSettingsPreparer prepares the GetAuthSettings request. -func (client AppsClient) GetAuthSettingsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { +// DeleteTriggeredWebJobSlotPreparer prepares the DeleteTriggeredWebJobSlot request. +func (client AppsClient) DeleteTriggeredWebJobSlotPreparer(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webJobName": autorest.Encode("path", webJobName), } const APIVersion = "2018-02-01" @@ -7432,46 +7451,44 @@ func (client AppsClient) GetAuthSettingsPreparer(ctx context.Context, resourceGr } preparer := autorest.CreatePreparer( - autorest.AsPost(), + autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettings/list", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetAuthSettingsSender sends the GetAuthSettings request. The method will close the +// DeleteTriggeredWebJobSlotSender sends the DeleteTriggeredWebJobSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetAuthSettingsSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) DeleteTriggeredWebJobSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetAuthSettingsResponder handles the response to the GetAuthSettings request. The method always +// DeleteTriggeredWebJobSlotResponder handles the response to the DeleteTriggeredWebJobSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetAuthSettingsResponder(resp *http.Response) (result SiteAuthSettings, err error) { +func (client AppsClient) DeleteTriggeredWebJobSlotResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} + result.Response = resp return } -// GetAuthSettingsSlot gets the Authentication/Authorization settings of an app. +// DeleteVnetConnection deletes a connection from an app (or deployment slot to a named virtual network. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// slot - name of the deployment slot. If a slot is not specified, the API will get the settings for the -// production slot. -func (client AppsClient) GetAuthSettingsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result SiteAuthSettings, err error) { +// vnetName - name of the virtual network. +func (client AppsClient) DeleteVnetConnection(ctx context.Context, resourceGroupName string, name string, vnetName string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetAuthSettingsSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteVnetConnection") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.Response != nil { + sc = result.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -7481,37 +7498,37 @@ func (client AppsClient) GetAuthSettingsSlot(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetAuthSettingsSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "DeleteVnetConnection", err.Error()) } - req, err := client.GetAuthSettingsSlotPreparer(ctx, resourceGroupName, name, slot) + req, err := client.DeleteVnetConnectionPreparer(ctx, resourceGroupName, name, vnetName) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAuthSettingsSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteVnetConnection", nil, "Failure preparing request") return } - resp, err := client.GetAuthSettingsSlotSender(req) + resp, err := client.DeleteVnetConnectionSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAuthSettingsSlot", resp, "Failure sending request") + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteVnetConnection", resp, "Failure sending request") return } - result, err = client.GetAuthSettingsSlotResponder(resp) + result, err = client.DeleteVnetConnectionResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAuthSettingsSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteVnetConnection", resp, "Failure responding to request") } return } -// GetAuthSettingsSlotPreparer prepares the GetAuthSettingsSlot request. -func (client AppsClient) GetAuthSettingsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { +// DeleteVnetConnectionPreparer prepares the DeleteVnetConnection request. +func (client AppsClient) DeleteVnetConnectionPreparer(ctx context.Context, resourceGroupName string, name string, vnetName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vnetName": autorest.Encode("path", vnetName), } const APIVersion = "2018-02-01" @@ -7520,44 +7537,46 @@ func (client AppsClient) GetAuthSettingsSlotPreparer(ctx context.Context, resour } preparer := autorest.CreatePreparer( - autorest.AsPost(), + autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings/list", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetAuthSettingsSlotSender sends the GetAuthSettingsSlot request. The method will close the +// DeleteVnetConnectionSender sends the DeleteVnetConnection request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetAuthSettingsSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) DeleteVnetConnectionSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetAuthSettingsSlotResponder handles the response to the GetAuthSettingsSlot request. The method always +// DeleteVnetConnectionResponder handles the response to the DeleteVnetConnection request. The method always // closes the http.Response Body. -func (client AppsClient) GetAuthSettingsSlotResponder(resp *http.Response) (result SiteAuthSettings, err error) { +func (client AppsClient) DeleteVnetConnectionResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} + result.Response = resp return } -// GetBackupConfiguration gets the backup configuration of an app. +// DeleteVnetConnectionSlot deletes a connection from an app (or deployment slot to a named virtual network. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -func (client AppsClient) GetBackupConfiguration(ctx context.Context, resourceGroupName string, name string) (result BackupRequest, err error) { +// vnetName - name of the virtual network. +// slot - name of the deployment slot. If a slot is not specified, the API will delete the connection for the +// production slot. +func (client AppsClient) DeleteVnetConnectionSlot(ctx context.Context, resourceGroupName string, name string, vnetName string, slot string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetBackupConfiguration") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteVnetConnectionSlot") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.Response != nil { + sc = result.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -7567,36 +7586,38 @@ func (client AppsClient) GetBackupConfiguration(ctx context.Context, resourceGro Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetBackupConfiguration", err.Error()) + return result, validation.NewError("web.AppsClient", "DeleteVnetConnectionSlot", err.Error()) } - req, err := client.GetBackupConfigurationPreparer(ctx, resourceGroupName, name) + req, err := client.DeleteVnetConnectionSlotPreparer(ctx, resourceGroupName, name, vnetName, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupConfiguration", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteVnetConnectionSlot", nil, "Failure preparing request") return } - resp, err := client.GetBackupConfigurationSender(req) + resp, err := client.DeleteVnetConnectionSlotSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupConfiguration", resp, "Failure sending request") + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteVnetConnectionSlot", resp, "Failure sending request") return } - result, err = client.GetBackupConfigurationResponder(resp) + result, err = client.DeleteVnetConnectionSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupConfiguration", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteVnetConnectionSlot", resp, "Failure responding to request") } return } -// GetBackupConfigurationPreparer prepares the GetBackupConfiguration request. -func (client AppsClient) GetBackupConfigurationPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { +// DeleteVnetConnectionSlotPreparer prepares the DeleteVnetConnectionSlot request. +func (client AppsClient) DeleteVnetConnectionSlotPreparer(ctx context.Context, resourceGroupName string, name string, vnetName string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vnetName": autorest.Encode("path", vnetName), } const APIVersion = "2018-02-01" @@ -7605,42 +7626,41 @@ func (client AppsClient) GetBackupConfigurationPreparer(ctx context.Context, res } preparer := autorest.CreatePreparer( - autorest.AsPost(), + autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/backup/list", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetBackupConfigurationSender sends the GetBackupConfiguration request. The method will close the +// DeleteVnetConnectionSlotSender sends the DeleteVnetConnectionSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetBackupConfigurationSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) DeleteVnetConnectionSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetBackupConfigurationResponder handles the response to the GetBackupConfiguration request. The method always +// DeleteVnetConnectionSlotResponder handles the response to the DeleteVnetConnectionSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetBackupConfigurationResponder(resp *http.Response) (result BackupRequest, err error) { +func (client AppsClient) DeleteVnetConnectionSlotResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} + result.Response = resp return } -// GetBackupConfigurationSlot gets the backup configuration of an app. +// DiscoverBackup discovers an existing app backup that can be restored from a blob in Azure storage. Use this to get +// information about the databases stored in a backup. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// slot - name of the deployment slot. If a slot is not specified, the API will get the backup configuration -// for the production slot. -func (client AppsClient) GetBackupConfigurationSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result BackupRequest, err error) { +// request - a RestoreRequest object that includes Azure storage URL and blog name for discovery of backup. +func (client AppsClient) DiscoverBackup(ctx context.Context, resourceGroupName string, name string, request RestoreRequest) (result RestoreRequest, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetBackupConfigurationSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DiscoverBackup") defer func() { sc := -1 if result.Response.Response != nil { @@ -7653,37 +7673,41 @@ func (client AppsClient) GetBackupConfigurationSlot(ctx context.Context, resourc {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetBackupConfigurationSlot", err.Error()) + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: request, + Constraints: []validation.Constraint{{Target: "request.RestoreRequestProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "request.RestoreRequestProperties.StorageAccountURL", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "request.RestoreRequestProperties.Overwrite", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DiscoverBackup", err.Error()) } - req, err := client.GetBackupConfigurationSlotPreparer(ctx, resourceGroupName, name, slot) + req, err := client.DiscoverBackupPreparer(ctx, resourceGroupName, name, request) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupConfigurationSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DiscoverBackup", nil, "Failure preparing request") return } - resp, err := client.GetBackupConfigurationSlotSender(req) + resp, err := client.DiscoverBackupSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupConfigurationSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DiscoverBackup", resp, "Failure sending request") return } - result, err = client.GetBackupConfigurationSlotResponder(resp) + result, err = client.DiscoverBackupResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupConfigurationSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DiscoverBackup", resp, "Failure responding to request") } return } -// GetBackupConfigurationSlotPreparer prepares the GetBackupConfigurationSlot request. -func (client AppsClient) GetBackupConfigurationSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { +// DiscoverBackupPreparer prepares the DiscoverBackup request. +func (client AppsClient) DiscoverBackupPreparer(ctx context.Context, resourceGroupName string, name string, request RestoreRequest) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -7693,23 +7717,25 @@ func (client AppsClient) GetBackupConfigurationSlotPreparer(ctx context.Context, } preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup/list", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/discoverbackup", pathParameters), + autorest.WithJSON(request), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetBackupConfigurationSlotSender sends the GetBackupConfigurationSlot request. The method will close the +// DiscoverBackupSender sends the DiscoverBackup request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetBackupConfigurationSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) DiscoverBackupSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetBackupConfigurationSlotResponder handles the response to the GetBackupConfigurationSlot request. The method always +// DiscoverBackupResponder handles the response to the DiscoverBackup request. The method always // closes the http.Response Body. -func (client AppsClient) GetBackupConfigurationSlotResponder(resp *http.Response) (result BackupRequest, err error) { +func (client AppsClient) DiscoverBackupResponder(resp *http.Response) (result RestoreRequest, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -7720,14 +7746,17 @@ func (client AppsClient) GetBackupConfigurationSlotResponder(resp *http.Response return } -// GetBackupStatus gets a backup of an app by its ID. +// DiscoverBackupSlot discovers an existing app backup that can be restored from a blob in Azure storage. Use this to +// get information about the databases stored in a backup. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// backupID - ID of the backup. -func (client AppsClient) GetBackupStatus(ctx context.Context, resourceGroupName string, name string, backupID string) (result BackupItem, err error) { +// request - a RestoreRequest object that includes Azure storage URL and blog name for discovery of backup. +// slot - name of the deployment slot. If a slot is not specified, the API will perform discovery for the +// production slot. +func (client AppsClient) DiscoverBackupSlot(ctx context.Context, resourceGroupName string, name string, request RestoreRequest, slot string) (result RestoreRequest, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetBackupStatus") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DiscoverBackupSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -7740,37 +7769,42 @@ func (client AppsClient) GetBackupStatus(ctx context.Context, resourceGroupName {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetBackupStatus", err.Error()) + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: request, + Constraints: []validation.Constraint{{Target: "request.RestoreRequestProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "request.RestoreRequestProperties.StorageAccountURL", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "request.RestoreRequestProperties.Overwrite", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DiscoverBackupSlot", err.Error()) } - req, err := client.GetBackupStatusPreparer(ctx, resourceGroupName, name, backupID) + req, err := client.DiscoverBackupSlotPreparer(ctx, resourceGroupName, name, request, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupStatus", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DiscoverBackupSlot", nil, "Failure preparing request") return } - resp, err := client.GetBackupStatusSender(req) + resp, err := client.DiscoverBackupSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupStatus", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DiscoverBackupSlot", resp, "Failure sending request") return } - result, err = client.GetBackupStatusResponder(resp) + result, err = client.DiscoverBackupSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupStatus", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "DiscoverBackupSlot", resp, "Failure responding to request") } return } -// GetBackupStatusPreparer prepares the GetBackupStatus request. -func (client AppsClient) GetBackupStatusPreparer(ctx context.Context, resourceGroupName string, name string, backupID string) (*http.Request, error) { +// DiscoverBackupSlotPreparer prepares the DiscoverBackupSlot request. +func (client AppsClient) DiscoverBackupSlotPreparer(ctx context.Context, resourceGroupName string, name string, request RestoreRequest, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "backupId": autorest.Encode("path", backupID), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -7780,23 +7814,25 @@ func (client AppsClient) GetBackupStatusPreparer(ctx context.Context, resourceGr } preparer := autorest.CreatePreparer( - autorest.AsGet(), + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/discoverbackup", pathParameters), + autorest.WithJSON(request), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetBackupStatusSender sends the GetBackupStatus request. The method will close the +// DiscoverBackupSlotSender sends the DiscoverBackupSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetBackupStatusSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) DiscoverBackupSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetBackupStatusResponder handles the response to the GetBackupStatus request. The method always +// DiscoverBackupSlotResponder handles the response to the DiscoverBackupSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetBackupStatusResponder(resp *http.Response) (result BackupItem, err error) { +func (client AppsClient) DiscoverBackupSlotResponder(resp *http.Response) (result RestoreRequest, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -7807,20 +7843,17 @@ func (client AppsClient) GetBackupStatusResponder(resp *http.Response) (result B return } -// GetBackupStatusSlot gets a backup of an app by its ID. +// GenerateNewSitePublishingPassword generates a new publishing password for an app (or deployment slot, if specified). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// backupID - ID of the backup. -// slot - name of the deployment slot. If a slot is not specified, the API will get a backup of the production -// slot. -func (client AppsClient) GetBackupStatusSlot(ctx context.Context, resourceGroupName string, name string, backupID string, slot string) (result BackupItem, err error) { +func (client AppsClient) GenerateNewSitePublishingPassword(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetBackupStatusSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GenerateNewSitePublishingPassword") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.Response != nil { + sc = result.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -7830,37 +7863,35 @@ func (client AppsClient) GetBackupStatusSlot(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetBackupStatusSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GenerateNewSitePublishingPassword", err.Error()) } - req, err := client.GetBackupStatusSlotPreparer(ctx, resourceGroupName, name, backupID, slot) + req, err := client.GenerateNewSitePublishingPasswordPreparer(ctx, resourceGroupName, name) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupStatusSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GenerateNewSitePublishingPassword", nil, "Failure preparing request") return } - resp, err := client.GetBackupStatusSlotSender(req) + resp, err := client.GenerateNewSitePublishingPasswordSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupStatusSlot", resp, "Failure sending request") + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "GenerateNewSitePublishingPassword", resp, "Failure sending request") return } - result, err = client.GetBackupStatusSlotResponder(resp) + result, err = client.GenerateNewSitePublishingPasswordResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupStatusSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GenerateNewSitePublishingPassword", resp, "Failure responding to request") } return } -// GetBackupStatusSlotPreparer prepares the GetBackupStatusSlot request. -func (client AppsClient) GetBackupStatusSlotPreparer(ctx context.Context, resourceGroupName string, name string, backupID string, slot string) (*http.Request, error) { +// GenerateNewSitePublishingPasswordPreparer prepares the GenerateNewSitePublishingPassword request. +func (client AppsClient) GenerateNewSitePublishingPasswordPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "backupId": autorest.Encode("path", backupID), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -7870,45 +7901,46 @@ func (client AppsClient) GetBackupStatusSlotPreparer(ctx context.Context, resour } preparer := autorest.CreatePreparer( - autorest.AsGet(), + autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/newpassword", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetBackupStatusSlotSender sends the GetBackupStatusSlot request. The method will close the +// GenerateNewSitePublishingPasswordSender sends the GenerateNewSitePublishingPassword request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetBackupStatusSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GenerateNewSitePublishingPasswordSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetBackupStatusSlotResponder handles the response to the GetBackupStatusSlot request. The method always +// GenerateNewSitePublishingPasswordResponder handles the response to the GenerateNewSitePublishingPassword request. The method always // closes the http.Response Body. -func (client AppsClient) GetBackupStatusSlotResponder(resp *http.Response) (result BackupItem, err error) { +func (client AppsClient) GenerateNewSitePublishingPasswordResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} + result.Response = resp return } -// GetConfiguration gets the configuration of an app, such as platform version and bitness, default documents, virtual -// applications, Always On, etc. +// GenerateNewSitePublishingPasswordSlot generates a new publishing password for an app (or deployment slot, if +// specified). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -func (client AppsClient) GetConfiguration(ctx context.Context, resourceGroupName string, name string) (result SiteConfigResource, err error) { +// slot - name of the deployment slot. If a slot is not specified, the API generate a new publishing password +// for the production slot. +func (client AppsClient) GenerateNewSitePublishingPasswordSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetConfiguration") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GenerateNewSitePublishingPasswordSlot") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.Response != nil { + sc = result.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -7918,35 +7950,36 @@ func (client AppsClient) GetConfiguration(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetConfiguration", err.Error()) + return result, validation.NewError("web.AppsClient", "GenerateNewSitePublishingPasswordSlot", err.Error()) } - req, err := client.GetConfigurationPreparer(ctx, resourceGroupName, name) + req, err := client.GenerateNewSitePublishingPasswordSlotPreparer(ctx, resourceGroupName, name, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetConfiguration", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GenerateNewSitePublishingPasswordSlot", nil, "Failure preparing request") return } - resp, err := client.GetConfigurationSender(req) + resp, err := client.GenerateNewSitePublishingPasswordSlotSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetConfiguration", resp, "Failure sending request") + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "GenerateNewSitePublishingPasswordSlot", resp, "Failure sending request") return } - result, err = client.GetConfigurationResponder(resp) + result, err = client.GenerateNewSitePublishingPasswordSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetConfiguration", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GenerateNewSitePublishingPasswordSlot", resp, "Failure responding to request") } return } -// GetConfigurationPreparer prepares the GetConfiguration request. -func (client AppsClient) GetConfigurationPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { +// GenerateNewSitePublishingPasswordSlotPreparer prepares the GenerateNewSitePublishingPasswordSlot request. +func (client AppsClient) GenerateNewSitePublishingPasswordSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -7956,43 +7989,39 @@ func (client AppsClient) GetConfigurationPreparer(ctx context.Context, resourceG } preparer := autorest.CreatePreparer( - autorest.AsGet(), + autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/newpassword", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetConfigurationSender sends the GetConfiguration request. The method will close the +// GenerateNewSitePublishingPasswordSlotSender sends the GenerateNewSitePublishingPasswordSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetConfigurationSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GenerateNewSitePublishingPasswordSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetConfigurationResponder handles the response to the GetConfiguration request. The method always +// GenerateNewSitePublishingPasswordSlotResponder handles the response to the GenerateNewSitePublishingPasswordSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetConfigurationResponder(resp *http.Response) (result SiteConfigResource, err error) { +func (client AppsClient) GenerateNewSitePublishingPasswordSlotResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} + result.Response = resp return } -// GetConfigurationSlot gets the configuration of an app, such as platform version and bitness, default documents, -// virtual applications, Always On, etc. +// Get gets the details of a web, mobile, or API app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// slot - name of the deployment slot. If a slot is not specified, the API will return configuration for the -// production slot. -func (client AppsClient) GetConfigurationSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result SiteConfigResource, err error) { +func (client AppsClient) Get(ctx context.Context, resourceGroupName string, name string) (result Site, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetConfigurationSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.Get") defer func() { sc := -1 if result.Response.Response != nil { @@ -8006,36 +8035,35 @@ func (client AppsClient) GetConfigurationSlot(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetConfigurationSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "Get", err.Error()) } - req, err := client.GetConfigurationSlotPreparer(ctx, resourceGroupName, name, slot) + req, err := client.GetPreparer(ctx, resourceGroupName, name) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetConfigurationSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "Get", nil, "Failure preparing request") return } - resp, err := client.GetConfigurationSlotSender(req) + resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetConfigurationSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "Get", resp, "Failure sending request") return } - result, err = client.GetConfigurationSlotResponder(resp) + result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetConfigurationSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "Get", resp, "Failure responding to request") } return } -// GetConfigurationSlotPreparer prepares the GetConfigurationSlot request. -func (client AppsClient) GetConfigurationSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { +// GetPreparer prepares the Get request. +func (client AppsClient) GetPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -8047,39 +8075,38 @@ func (client AppsClient) GetConfigurationSlotPreparer(ctx context.Context, resou preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetConfigurationSlotSender sends the GetConfigurationSlot request. The method will close the +// GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetConfigurationSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetConfigurationSlotResponder handles the response to the GetConfigurationSlot request. The method always +// GetResponder handles the response to the Get request. The method always // closes the http.Response Body. -func (client AppsClient) GetConfigurationSlotResponder(resp *http.Response) (result SiteConfigResource, err error) { +func (client AppsClient) GetResponder(resp *http.Response) (result Site, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetConfigurationSnapshot gets a snapshot of the configuration of an app at a previous point in time. +// GetAuthSettings gets the Authentication/Authorization settings of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// snapshotID - the ID of the snapshot to read. -func (client AppsClient) GetConfigurationSnapshot(ctx context.Context, resourceGroupName string, name string, snapshotID string) (result SiteConfigResource, err error) { +func (client AppsClient) GetAuthSettings(ctx context.Context, resourceGroupName string, name string) (result SiteAuthSettings, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetConfigurationSnapshot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetAuthSettings") defer func() { sc := -1 if result.Response.Response != nil { @@ -8093,36 +8120,35 @@ func (client AppsClient) GetConfigurationSnapshot(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetConfigurationSnapshot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetAuthSettings", err.Error()) } - req, err := client.GetConfigurationSnapshotPreparer(ctx, resourceGroupName, name, snapshotID) + req, err := client.GetAuthSettingsPreparer(ctx, resourceGroupName, name) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetConfigurationSnapshot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAuthSettings", nil, "Failure preparing request") return } - resp, err := client.GetConfigurationSnapshotSender(req) + resp, err := client.GetAuthSettingsSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetConfigurationSnapshot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAuthSettings", resp, "Failure sending request") return } - result, err = client.GetConfigurationSnapshotResponder(resp) + result, err = client.GetAuthSettingsResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetConfigurationSnapshot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAuthSettings", resp, "Failure responding to request") } return } -// GetConfigurationSnapshotPreparer prepares the GetConfigurationSnapshot request. -func (client AppsClient) GetConfigurationSnapshotPreparer(ctx context.Context, resourceGroupName string, name string, snapshotID string) (*http.Request, error) { +// GetAuthSettingsPreparer prepares the GetAuthSettings request. +func (client AppsClient) GetAuthSettingsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "snapshotId": autorest.Encode("path", snapshotID), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -8132,23 +8158,23 @@ func (client AppsClient) GetConfigurationSnapshotPreparer(ctx context.Context, r } preparer := autorest.CreatePreparer( - autorest.AsGet(), + autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots/{snapshotId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettings/list", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetConfigurationSnapshotSender sends the GetConfigurationSnapshot request. The method will close the +// GetAuthSettingsSender sends the GetAuthSettings request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetConfigurationSnapshotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetAuthSettingsSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetConfigurationSnapshotResponder handles the response to the GetConfigurationSnapshot request. The method always +// GetAuthSettingsResponder handles the response to the GetAuthSettings request. The method always // closes the http.Response Body. -func (client AppsClient) GetConfigurationSnapshotResponder(resp *http.Response) (result SiteConfigResource, err error) { +func (client AppsClient) GetAuthSettingsResponder(resp *http.Response) (result SiteAuthSettings, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -8159,16 +8185,15 @@ func (client AppsClient) GetConfigurationSnapshotResponder(resp *http.Response) return } -// GetConfigurationSnapshotSlot gets a snapshot of the configuration of an app at a previous point in time. +// GetAuthSettingsSlot gets the Authentication/Authorization settings of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// snapshotID - the ID of the snapshot to read. -// slot - name of the deployment slot. If a slot is not specified, the API will return configuration for the +// slot - name of the deployment slot. If a slot is not specified, the API will get the settings for the // production slot. -func (client AppsClient) GetConfigurationSnapshotSlot(ctx context.Context, resourceGroupName string, name string, snapshotID string, slot string) (result SiteConfigResource, err error) { +func (client AppsClient) GetAuthSettingsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result SiteAuthSettings, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetConfigurationSnapshotSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetAuthSettingsSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -8182,37 +8207,36 @@ func (client AppsClient) GetConfigurationSnapshotSlot(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetConfigurationSnapshotSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetAuthSettingsSlot", err.Error()) } - req, err := client.GetConfigurationSnapshotSlotPreparer(ctx, resourceGroupName, name, snapshotID, slot) + req, err := client.GetAuthSettingsSlotPreparer(ctx, resourceGroupName, name, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetConfigurationSnapshotSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAuthSettingsSlot", nil, "Failure preparing request") return } - resp, err := client.GetConfigurationSnapshotSlotSender(req) + resp, err := client.GetAuthSettingsSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetConfigurationSnapshotSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAuthSettingsSlot", resp, "Failure sending request") return } - result, err = client.GetConfigurationSnapshotSlotResponder(resp) + result, err = client.GetAuthSettingsSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetConfigurationSnapshotSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAuthSettingsSlot", resp, "Failure responding to request") } return } -// GetConfigurationSnapshotSlotPreparer prepares the GetConfigurationSnapshotSlot request. -func (client AppsClient) GetConfigurationSnapshotSlotPreparer(ctx context.Context, resourceGroupName string, name string, snapshotID string, slot string) (*http.Request, error) { +// GetAuthSettingsSlotPreparer prepares the GetAuthSettingsSlot request. +func (client AppsClient) GetAuthSettingsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), "slot": autorest.Encode("path", slot), - "snapshotId": autorest.Encode("path", snapshotID), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -8222,23 +8246,23 @@ func (client AppsClient) GetConfigurationSnapshotSlotPreparer(ctx context.Contex } preparer := autorest.CreatePreparer( - autorest.AsGet(), + autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots/{snapshotId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings/list", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetConfigurationSnapshotSlotSender sends the GetConfigurationSnapshotSlot request. The method will close the +// GetAuthSettingsSlotSender sends the GetAuthSettingsSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetConfigurationSnapshotSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetAuthSettingsSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetConfigurationSnapshotSlotResponder handles the response to the GetConfigurationSnapshotSlot request. The method always +// GetAuthSettingsSlotResponder handles the response to the GetAuthSettingsSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetConfigurationSnapshotSlotResponder(resp *http.Response) (result SiteConfigResource, err error) { +func (client AppsClient) GetAuthSettingsSlotResponder(resp *http.Response) (result SiteAuthSettings, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -8249,13 +8273,13 @@ func (client AppsClient) GetConfigurationSnapshotSlotResponder(resp *http.Respon return } -// GetContainerLogsZip gets the ZIP archived docker log files for the given site +// GetBackupConfiguration gets the backup configuration of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of web app. -func (client AppsClient) GetContainerLogsZip(ctx context.Context, resourceGroupName string, name string) (result ReadCloser, err error) { +// name - name of the app. +func (client AppsClient) GetBackupConfiguration(ctx context.Context, resourceGroupName string, name string) (result BackupRequest, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetContainerLogsZip") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetBackupConfiguration") defer func() { sc := -1 if result.Response.Response != nil { @@ -8269,32 +8293,32 @@ func (client AppsClient) GetContainerLogsZip(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetContainerLogsZip", err.Error()) + return result, validation.NewError("web.AppsClient", "GetBackupConfiguration", err.Error()) } - req, err := client.GetContainerLogsZipPreparer(ctx, resourceGroupName, name) + req, err := client.GetBackupConfigurationPreparer(ctx, resourceGroupName, name) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetContainerLogsZip", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupConfiguration", nil, "Failure preparing request") return } - resp, err := client.GetContainerLogsZipSender(req) + resp, err := client.GetBackupConfigurationSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetContainerLogsZip", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupConfiguration", resp, "Failure sending request") return } - result, err = client.GetContainerLogsZipResponder(resp) + result, err = client.GetBackupConfigurationResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetContainerLogsZip", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupConfiguration", resp, "Failure responding to request") } return } -// GetContainerLogsZipPreparer prepares the GetContainerLogsZip request. -func (client AppsClient) GetContainerLogsZipPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { +// GetBackupConfigurationPreparer prepares the GetBackupConfiguration request. +func (client AppsClient) GetBackupConfigurationPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -8309,38 +8333,40 @@ func (client AppsClient) GetContainerLogsZipPreparer(ctx context.Context, resour preparer := autorest.CreatePreparer( autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs/zip/download", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/backup/list", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetContainerLogsZipSender sends the GetContainerLogsZip request. The method will close the +// GetBackupConfigurationSender sends the GetBackupConfiguration request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetContainerLogsZipSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetBackupConfigurationSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetContainerLogsZipResponder handles the response to the GetContainerLogsZip request. The method always +// GetBackupConfigurationResponder handles the response to the GetBackupConfiguration request. The method always // closes the http.Response Body. -func (client AppsClient) GetContainerLogsZipResponder(resp *http.Response) (result ReadCloser, err error) { - result.Value = &resp.Body +func (client AppsClient) GetBackupConfigurationResponder(resp *http.Response) (result BackupRequest, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent)) + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetContainerLogsZipSlot gets the ZIP archived docker log files for the given site +// GetBackupConfigurationSlot gets the backup configuration of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of web app. -// slot - name of web app slot. If not specified then will default to production slot. -func (client AppsClient) GetContainerLogsZipSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result ReadCloser, err error) { +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API will get the backup configuration +// for the production slot. +func (client AppsClient) GetBackupConfigurationSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result BackupRequest, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetContainerLogsZipSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetBackupConfigurationSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -8354,32 +8380,32 @@ func (client AppsClient) GetContainerLogsZipSlot(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetContainerLogsZipSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetBackupConfigurationSlot", err.Error()) } - req, err := client.GetContainerLogsZipSlotPreparer(ctx, resourceGroupName, name, slot) + req, err := client.GetBackupConfigurationSlotPreparer(ctx, resourceGroupName, name, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetContainerLogsZipSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupConfigurationSlot", nil, "Failure preparing request") return } - resp, err := client.GetContainerLogsZipSlotSender(req) + resp, err := client.GetBackupConfigurationSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetContainerLogsZipSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupConfigurationSlot", resp, "Failure sending request") return } - result, err = client.GetContainerLogsZipSlotResponder(resp) + result, err = client.GetBackupConfigurationSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetContainerLogsZipSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupConfigurationSlot", resp, "Failure responding to request") } return } -// GetContainerLogsZipSlotPreparer prepares the GetContainerLogsZipSlot request. -func (client AppsClient) GetContainerLogsZipSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { +// GetBackupConfigurationSlotPreparer prepares the GetBackupConfigurationSlot request. +func (client AppsClient) GetBackupConfigurationSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -8395,38 +8421,39 @@ func (client AppsClient) GetContainerLogsZipSlotPreparer(ctx context.Context, re preparer := autorest.CreatePreparer( autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs/zip/download", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup/list", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetContainerLogsZipSlotSender sends the GetContainerLogsZipSlot request. The method will close the +// GetBackupConfigurationSlotSender sends the GetBackupConfigurationSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetContainerLogsZipSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetBackupConfigurationSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetContainerLogsZipSlotResponder handles the response to the GetContainerLogsZipSlot request. The method always +// GetBackupConfigurationSlotResponder handles the response to the GetBackupConfigurationSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetContainerLogsZipSlotResponder(resp *http.Response) (result ReadCloser, err error) { - result.Value = &resp.Body +func (client AppsClient) GetBackupConfigurationSlotResponder(resp *http.Response) (result BackupRequest, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent)) + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetContinuousWebJob gets a continuous web job by its ID for an app, or a deployment slot. +// GetBackupStatus gets a backup of an app by its ID. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - site name. -// webJobName - name of Web Job. -func (client AppsClient) GetContinuousWebJob(ctx context.Context, resourceGroupName string, name string, webJobName string) (result ContinuousWebJob, err error) { +// name - name of the app. +// backupID - ID of the backup. +func (client AppsClient) GetBackupStatus(ctx context.Context, resourceGroupName string, name string, backupID string) (result BackupItem, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetContinuousWebJob") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetBackupStatus") defer func() { sc := -1 if result.Response.Response != nil { @@ -8440,37 +8467,37 @@ func (client AppsClient) GetContinuousWebJob(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetContinuousWebJob", err.Error()) + return result, validation.NewError("web.AppsClient", "GetBackupStatus", err.Error()) } - req, err := client.GetContinuousWebJobPreparer(ctx, resourceGroupName, name, webJobName) + req, err := client.GetBackupStatusPreparer(ctx, resourceGroupName, name, backupID) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetContinuousWebJob", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupStatus", nil, "Failure preparing request") return } - resp, err := client.GetContinuousWebJobSender(req) + resp, err := client.GetBackupStatusSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetContinuousWebJob", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupStatus", resp, "Failure sending request") return } - result, err = client.GetContinuousWebJobResponder(resp) + result, err = client.GetBackupStatusResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetContinuousWebJob", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupStatus", resp, "Failure responding to request") } return } -// GetContinuousWebJobPreparer prepares the GetContinuousWebJob request. -func (client AppsClient) GetContinuousWebJobPreparer(ctx context.Context, resourceGroupName string, name string, webJobName string) (*http.Request, error) { +// GetBackupStatusPreparer prepares the GetBackupStatus request. +func (client AppsClient) GetBackupStatusPreparer(ctx context.Context, resourceGroupName string, name string, backupID string) (*http.Request, error) { pathParameters := map[string]interface{}{ + "backupId": autorest.Encode("path", backupID), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "webJobName": autorest.Encode("path", webJobName), } const APIVersion = "2018-02-01" @@ -8481,41 +8508,41 @@ func (client AppsClient) GetContinuousWebJobPreparer(ctx context.Context, resour preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetContinuousWebJobSender sends the GetContinuousWebJob request. The method will close the +// GetBackupStatusSender sends the GetBackupStatus request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetContinuousWebJobSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetBackupStatusSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetContinuousWebJobResponder handles the response to the GetContinuousWebJob request. The method always +// GetBackupStatusResponder handles the response to the GetBackupStatus request. The method always // closes the http.Response Body. -func (client AppsClient) GetContinuousWebJobResponder(resp *http.Response) (result ContinuousWebJob, err error) { +func (client AppsClient) GetBackupStatusResponder(resp *http.Response) (result BackupItem, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetContinuousWebJobSlot gets a continuous web job by its ID for an app, or a deployment slot. +// GetBackupStatusSlot gets a backup of an app by its ID. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - site name. -// webJobName - name of Web Job. -// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the -// production slot. -func (client AppsClient) GetContinuousWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (result ContinuousWebJob, err error) { +// name - name of the app. +// backupID - ID of the backup. +// slot - name of the deployment slot. If a slot is not specified, the API will get a backup of the production +// slot. +func (client AppsClient) GetBackupStatusSlot(ctx context.Context, resourceGroupName string, name string, backupID string, slot string) (result BackupItem, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetContinuousWebJobSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetBackupStatusSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -8529,38 +8556,38 @@ func (client AppsClient) GetContinuousWebJobSlot(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetContinuousWebJobSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetBackupStatusSlot", err.Error()) } - req, err := client.GetContinuousWebJobSlotPreparer(ctx, resourceGroupName, name, webJobName, slot) + req, err := client.GetBackupStatusSlotPreparer(ctx, resourceGroupName, name, backupID, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetContinuousWebJobSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupStatusSlot", nil, "Failure preparing request") return } - resp, err := client.GetContinuousWebJobSlotSender(req) + resp, err := client.GetBackupStatusSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetContinuousWebJobSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupStatusSlot", resp, "Failure sending request") return } - result, err = client.GetContinuousWebJobSlotResponder(resp) + result, err = client.GetBackupStatusSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetContinuousWebJobSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupStatusSlot", resp, "Failure responding to request") } return } -// GetContinuousWebJobSlotPreparer prepares the GetContinuousWebJobSlot request. -func (client AppsClient) GetContinuousWebJobSlotPreparer(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (*http.Request, error) { +// GetBackupStatusSlotPreparer prepares the GetBackupStatusSlot request. +func (client AppsClient) GetBackupStatusSlotPreparer(ctx context.Context, resourceGroupName string, name string, backupID string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ + "backupId": autorest.Encode("path", backupID), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "webJobName": autorest.Encode("path", webJobName), } const APIVersion = "2018-02-01" @@ -8571,39 +8598,39 @@ func (client AppsClient) GetContinuousWebJobSlotPreparer(ctx context.Context, re preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetContinuousWebJobSlotSender sends the GetContinuousWebJobSlot request. The method will close the +// GetBackupStatusSlotSender sends the GetBackupStatusSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetContinuousWebJobSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetBackupStatusSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetContinuousWebJobSlotResponder handles the response to the GetContinuousWebJobSlot request. The method always +// GetBackupStatusSlotResponder handles the response to the GetBackupStatusSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetContinuousWebJobSlotResponder(resp *http.Response) (result ContinuousWebJob, err error) { +func (client AppsClient) GetBackupStatusSlotResponder(resp *http.Response) (result BackupItem, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetDeployment get a deployment by its ID for an app, or a deployment slot. +// GetConfiguration gets the configuration of an app, such as platform version and bitness, default documents, virtual +// applications, Always On, etc. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// ID - deployment ID. -func (client AppsClient) GetDeployment(ctx context.Context, resourceGroupName string, name string, ID string) (result Deployment, err error) { +func (client AppsClient) GetConfiguration(ctx context.Context, resourceGroupName string, name string) (result SiteConfigResource, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetDeployment") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetConfiguration") defer func() { sc := -1 if result.Response.Response != nil { @@ -8617,34 +8644,33 @@ func (client AppsClient) GetDeployment(ctx context.Context, resourceGroupName st Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetDeployment", err.Error()) + return result, validation.NewError("web.AppsClient", "GetConfiguration", err.Error()) } - req, err := client.GetDeploymentPreparer(ctx, resourceGroupName, name, ID) + req, err := client.GetConfigurationPreparer(ctx, resourceGroupName, name) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDeployment", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetConfiguration", nil, "Failure preparing request") return } - resp, err := client.GetDeploymentSender(req) + resp, err := client.GetConfigurationSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDeployment", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetConfiguration", resp, "Failure sending request") return } - result, err = client.GetDeploymentResponder(resp) + result, err = client.GetConfigurationResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDeployment", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetConfiguration", resp, "Failure responding to request") } return } -// GetDeploymentPreparer prepares the GetDeployment request. -func (client AppsClient) GetDeploymentPreparer(ctx context.Context, resourceGroupName string, name string, ID string) (*http.Request, error) { +// GetConfigurationPreparer prepares the GetConfiguration request. +func (client AppsClient) GetConfigurationPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "id": autorest.Encode("path", ID), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -8658,21 +8684,21 @@ func (client AppsClient) GetDeploymentPreparer(ctx context.Context, resourceGrou preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetDeploymentSender sends the GetDeployment request. The method will close the +// GetConfigurationSender sends the GetConfiguration request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetDeploymentSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetConfigurationSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetDeploymentResponder handles the response to the GetDeployment request. The method always +// GetConfigurationResponder handles the response to the GetConfiguration request. The method always // closes the http.Response Body. -func (client AppsClient) GetDeploymentResponder(resp *http.Response) (result Deployment, err error) { +func (client AppsClient) GetConfigurationResponder(resp *http.Response) (result SiteConfigResource, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -8683,16 +8709,16 @@ func (client AppsClient) GetDeploymentResponder(resp *http.Response) (result Dep return } -// GetDeploymentSlot get a deployment by its ID for an app, or a deployment slot. +// GetConfigurationSlot gets the configuration of an app, such as platform version and bitness, default documents, +// virtual applications, Always On, etc. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// ID - deployment ID. -// slot - name of the deployment slot. If a slot is not specified, the API gets a deployment for the production -// slot. -func (client AppsClient) GetDeploymentSlot(ctx context.Context, resourceGroupName string, name string, ID string, slot string) (result Deployment, err error) { +// slot - name of the deployment slot. If a slot is not specified, the API will return configuration for the +// production slot. +func (client AppsClient) GetConfigurationSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result SiteConfigResource, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetDeploymentSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetConfigurationSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -8706,34 +8732,33 @@ func (client AppsClient) GetDeploymentSlot(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetDeploymentSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetConfigurationSlot", err.Error()) } - req, err := client.GetDeploymentSlotPreparer(ctx, resourceGroupName, name, ID, slot) + req, err := client.GetConfigurationSlotPreparer(ctx, resourceGroupName, name, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDeploymentSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetConfigurationSlot", nil, "Failure preparing request") return } - resp, err := client.GetDeploymentSlotSender(req) + resp, err := client.GetConfigurationSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDeploymentSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetConfigurationSlot", resp, "Failure sending request") return } - result, err = client.GetDeploymentSlotResponder(resp) + result, err = client.GetConfigurationSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDeploymentSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetConfigurationSlot", resp, "Failure responding to request") } return } -// GetDeploymentSlotPreparer prepares the GetDeploymentSlot request. -func (client AppsClient) GetDeploymentSlotPreparer(ctx context.Context, resourceGroupName string, name string, ID string, slot string) (*http.Request, error) { +// GetConfigurationSlotPreparer prepares the GetConfigurationSlot request. +func (client AppsClient) GetConfigurationSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "id": autorest.Encode("path", ID), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), "slot": autorest.Encode("path", slot), @@ -8748,21 +8773,21 @@ func (client AppsClient) GetDeploymentSlotPreparer(ctx context.Context, resource preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetDeploymentSlotSender sends the GetDeploymentSlot request. The method will close the +// GetConfigurationSlotSender sends the GetConfigurationSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetDeploymentSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetConfigurationSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetDeploymentSlotResponder handles the response to the GetDeploymentSlot request. The method always +// GetConfigurationSlotResponder handles the response to the GetConfigurationSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetDeploymentSlotResponder(resp *http.Response) (result Deployment, err error) { +func (client AppsClient) GetConfigurationSlotResponder(resp *http.Response) (result SiteConfigResource, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -8773,13 +8798,14 @@ func (client AppsClient) GetDeploymentSlotResponder(resp *http.Response) (result return } -// GetDiagnosticLogsConfiguration gets the logging configuration of an app. +// GetConfigurationSnapshot gets a snapshot of the configuration of an app at a previous point in time. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -func (client AppsClient) GetDiagnosticLogsConfiguration(ctx context.Context, resourceGroupName string, name string) (result SiteLogsConfig, err error) { +// snapshotID - the ID of the snapshot to read. +func (client AppsClient) GetConfigurationSnapshot(ctx context.Context, resourceGroupName string, name string, snapshotID string) (result SiteConfigResource, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetDiagnosticLogsConfiguration") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetConfigurationSnapshot") defer func() { sc := -1 if result.Response.Response != nil { @@ -8793,35 +8819,36 @@ func (client AppsClient) GetDiagnosticLogsConfiguration(ctx context.Context, res Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetDiagnosticLogsConfiguration", err.Error()) + return result, validation.NewError("web.AppsClient", "GetConfigurationSnapshot", err.Error()) } - req, err := client.GetDiagnosticLogsConfigurationPreparer(ctx, resourceGroupName, name) + req, err := client.GetConfigurationSnapshotPreparer(ctx, resourceGroupName, name, snapshotID) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDiagnosticLogsConfiguration", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetConfigurationSnapshot", nil, "Failure preparing request") return } - resp, err := client.GetDiagnosticLogsConfigurationSender(req) + resp, err := client.GetConfigurationSnapshotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDiagnosticLogsConfiguration", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetConfigurationSnapshot", resp, "Failure sending request") return } - result, err = client.GetDiagnosticLogsConfigurationResponder(resp) + result, err = client.GetConfigurationSnapshotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDiagnosticLogsConfiguration", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetConfigurationSnapshot", resp, "Failure responding to request") } return } -// GetDiagnosticLogsConfigurationPreparer prepares the GetDiagnosticLogsConfiguration request. -func (client AppsClient) GetDiagnosticLogsConfigurationPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { +// GetConfigurationSnapshotPreparer prepares the GetConfigurationSnapshot request. +func (client AppsClient) GetConfigurationSnapshotPreparer(ctx context.Context, resourceGroupName string, name string, snapshotID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "snapshotId": autorest.Encode("path", snapshotID), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -8833,21 +8860,21 @@ func (client AppsClient) GetDiagnosticLogsConfigurationPreparer(ctx context.Cont preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/logs", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots/{snapshotId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetDiagnosticLogsConfigurationSender sends the GetDiagnosticLogsConfiguration request. The method will close the +// GetConfigurationSnapshotSender sends the GetConfigurationSnapshot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetDiagnosticLogsConfigurationSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetConfigurationSnapshotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetDiagnosticLogsConfigurationResponder handles the response to the GetDiagnosticLogsConfiguration request. The method always +// GetConfigurationSnapshotResponder handles the response to the GetConfigurationSnapshot request. The method always // closes the http.Response Body. -func (client AppsClient) GetDiagnosticLogsConfigurationResponder(resp *http.Response) (result SiteLogsConfig, err error) { +func (client AppsClient) GetConfigurationSnapshotResponder(resp *http.Response) (result SiteConfigResource, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -8858,15 +8885,16 @@ func (client AppsClient) GetDiagnosticLogsConfigurationResponder(resp *http.Resp return } -// GetDiagnosticLogsConfigurationSlot gets the logging configuration of an app. +// GetConfigurationSnapshotSlot gets a snapshot of the configuration of an app at a previous point in time. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// slot - name of the deployment slot. If a slot is not specified, the API will get the logging configuration -// for the production slot. -func (client AppsClient) GetDiagnosticLogsConfigurationSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result SiteLogsConfig, err error) { +// snapshotID - the ID of the snapshot to read. +// slot - name of the deployment slot. If a slot is not specified, the API will return configuration for the +// production slot. +func (client AppsClient) GetConfigurationSnapshotSlot(ctx context.Context, resourceGroupName string, name string, snapshotID string, slot string) (result SiteConfigResource, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetDiagnosticLogsConfigurationSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetConfigurationSnapshotSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -8880,36 +8908,37 @@ func (client AppsClient) GetDiagnosticLogsConfigurationSlot(ctx context.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("web.AppsClient", "GetDiagnosticLogsConfigurationSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetConfigurationSnapshotSlot", err.Error()) } - req, err := client.GetDiagnosticLogsConfigurationSlotPreparer(ctx, resourceGroupName, name, slot) + req, err := client.GetConfigurationSnapshotSlotPreparer(ctx, resourceGroupName, name, snapshotID, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDiagnosticLogsConfigurationSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetConfigurationSnapshotSlot", nil, "Failure preparing request") return } - resp, err := client.GetDiagnosticLogsConfigurationSlotSender(req) + resp, err := client.GetConfigurationSnapshotSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDiagnosticLogsConfigurationSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetConfigurationSnapshotSlot", resp, "Failure sending request") return } - result, err = client.GetDiagnosticLogsConfigurationSlotResponder(resp) + result, err = client.GetConfigurationSnapshotSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDiagnosticLogsConfigurationSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetConfigurationSnapshotSlot", resp, "Failure responding to request") } return } -// GetDiagnosticLogsConfigurationSlotPreparer prepares the GetDiagnosticLogsConfigurationSlot request. -func (client AppsClient) GetDiagnosticLogsConfigurationSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { +// GetConfigurationSnapshotSlotPreparer prepares the GetConfigurationSnapshotSlot request. +func (client AppsClient) GetConfigurationSnapshotSlotPreparer(ctx context.Context, resourceGroupName string, name string, snapshotID string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), "slot": autorest.Encode("path", slot), + "snapshotId": autorest.Encode("path", snapshotID), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -8921,21 +8950,21 @@ func (client AppsClient) GetDiagnosticLogsConfigurationSlotPreparer(ctx context. preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots/{snapshotId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetDiagnosticLogsConfigurationSlotSender sends the GetDiagnosticLogsConfigurationSlot request. The method will close the +// GetConfigurationSnapshotSlotSender sends the GetConfigurationSnapshotSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetDiagnosticLogsConfigurationSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetConfigurationSnapshotSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetDiagnosticLogsConfigurationSlotResponder handles the response to the GetDiagnosticLogsConfigurationSlot request. The method always +// GetConfigurationSnapshotSlotResponder handles the response to the GetConfigurationSnapshotSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetDiagnosticLogsConfigurationSlotResponder(resp *http.Response) (result SiteLogsConfig, err error) { +func (client AppsClient) GetConfigurationSnapshotSlotResponder(resp *http.Response) (result SiteConfigResource, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -8946,14 +8975,13 @@ func (client AppsClient) GetDiagnosticLogsConfigurationSlotResponder(resp *http. return } -// GetDomainOwnershipIdentifier get domain ownership identifier for web app. +// GetContainerLogsZip gets the ZIP archived docker log files for the given site // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -// domainOwnershipIdentifierName - name of domain ownership identifier. -func (client AppsClient) GetDomainOwnershipIdentifier(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string) (result Identifier, err error) { +// name - name of web app. +func (client AppsClient) GetContainerLogsZip(ctx context.Context, resourceGroupName string, name string) (result ReadCloser, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetDomainOwnershipIdentifier") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetContainerLogsZip") defer func() { sc := -1 if result.Response.Response != nil { @@ -8967,37 +8995,36 @@ func (client AppsClient) GetDomainOwnershipIdentifier(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetDomainOwnershipIdentifier", err.Error()) + return result, validation.NewError("web.AppsClient", "GetContainerLogsZip", err.Error()) } - req, err := client.GetDomainOwnershipIdentifierPreparer(ctx, resourceGroupName, name, domainOwnershipIdentifierName) + req, err := client.GetContainerLogsZipPreparer(ctx, resourceGroupName, name) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDomainOwnershipIdentifier", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetContainerLogsZip", nil, "Failure preparing request") return } - resp, err := client.GetDomainOwnershipIdentifierSender(req) + resp, err := client.GetContainerLogsZipSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDomainOwnershipIdentifier", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetContainerLogsZip", resp, "Failure sending request") return } - result, err = client.GetDomainOwnershipIdentifierResponder(resp) + result, err = client.GetContainerLogsZipResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDomainOwnershipIdentifier", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetContainerLogsZip", resp, "Failure responding to request") } return } -// GetDomainOwnershipIdentifierPreparer prepares the GetDomainOwnershipIdentifier request. -func (client AppsClient) GetDomainOwnershipIdentifierPreparer(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string) (*http.Request, error) { +// GetContainerLogsZipPreparer prepares the GetContainerLogsZip request. +func (client AppsClient) GetContainerLogsZipPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "domainOwnershipIdentifierName": autorest.Encode("path", domainOwnershipIdentifierName), - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2018-02-01" @@ -9006,43 +9033,40 @@ func (client AppsClient) GetDomainOwnershipIdentifierPreparer(ctx context.Contex } preparer := autorest.CreatePreparer( - autorest.AsGet(), + autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs/zip/download", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetDomainOwnershipIdentifierSender sends the GetDomainOwnershipIdentifier request. The method will close the +// GetContainerLogsZipSender sends the GetContainerLogsZip request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetDomainOwnershipIdentifierSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetContainerLogsZipSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetDomainOwnershipIdentifierResponder handles the response to the GetDomainOwnershipIdentifier request. The method always +// GetContainerLogsZipResponder handles the response to the GetContainerLogsZip request. The method always // closes the http.Response Body. -func (client AppsClient) GetDomainOwnershipIdentifierResponder(resp *http.Response) (result Identifier, err error) { +func (client AppsClient) GetContainerLogsZipResponder(resp *http.Response) (result ReadCloser, err error) { + result.Value = &resp.Body err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent)) result.Response = autorest.Response{Response: resp} return } -// GetDomainOwnershipIdentifierSlot get domain ownership identifier for web app. +// GetContainerLogsZipSlot gets the ZIP archived docker log files for the given site // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -// domainOwnershipIdentifierName - name of domain ownership identifier. -// slot - name of the deployment slot. If a slot is not specified, the API will delete the binding for the -// production slot. -func (client AppsClient) GetDomainOwnershipIdentifierSlot(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, slot string) (result Identifier, err error) { +// name - name of web app. +// slot - name of web app slot. If not specified then will default to production slot. +func (client AppsClient) GetContainerLogsZipSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result ReadCloser, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetDomainOwnershipIdentifierSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetContainerLogsZipSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -9056,38 +9080,37 @@ func (client AppsClient) GetDomainOwnershipIdentifierSlot(ctx context.Context, r Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetDomainOwnershipIdentifierSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetContainerLogsZipSlot", err.Error()) } - req, err := client.GetDomainOwnershipIdentifierSlotPreparer(ctx, resourceGroupName, name, domainOwnershipIdentifierName, slot) + req, err := client.GetContainerLogsZipSlotPreparer(ctx, resourceGroupName, name, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDomainOwnershipIdentifierSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetContainerLogsZipSlot", nil, "Failure preparing request") return } - resp, err := client.GetDomainOwnershipIdentifierSlotSender(req) + resp, err := client.GetContainerLogsZipSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDomainOwnershipIdentifierSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetContainerLogsZipSlot", resp, "Failure sending request") return } - result, err = client.GetDomainOwnershipIdentifierSlotResponder(resp) + result, err = client.GetContainerLogsZipSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDomainOwnershipIdentifierSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetContainerLogsZipSlot", resp, "Failure responding to request") } return } -// GetDomainOwnershipIdentifierSlotPreparer prepares the GetDomainOwnershipIdentifierSlot request. -func (client AppsClient) GetDomainOwnershipIdentifierSlotPreparer(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, slot string) (*http.Request, error) { +// GetContainerLogsZipSlotPreparer prepares the GetContainerLogsZipSlot request. +func (client AppsClient) GetContainerLogsZipSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "domainOwnershipIdentifierName": autorest.Encode("path", domainOwnershipIdentifierName), - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2018-02-01" @@ -9096,41 +9119,40 @@ func (client AppsClient) GetDomainOwnershipIdentifierSlotPreparer(ctx context.Co } preparer := autorest.CreatePreparer( - autorest.AsGet(), + autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs/zip/download", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetDomainOwnershipIdentifierSlotSender sends the GetDomainOwnershipIdentifierSlot request. The method will close the +// GetContainerLogsZipSlotSender sends the GetContainerLogsZipSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetDomainOwnershipIdentifierSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetContainerLogsZipSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetDomainOwnershipIdentifierSlotResponder handles the response to the GetDomainOwnershipIdentifierSlot request. The method always +// GetContainerLogsZipSlotResponder handles the response to the GetContainerLogsZipSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetDomainOwnershipIdentifierSlotResponder(resp *http.Response) (result Identifier, err error) { +func (client AppsClient) GetContainerLogsZipSlotResponder(resp *http.Response) (result ReadCloser, err error) { + result.Value = &resp.Body err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent)) result.Response = autorest.Response{Response: resp} return } -// GetFunction get function information by its ID for web site, or a deployment slot. +// GetContinuousWebJob gets a continuous web job by its ID for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. -// functionName - function name. -func (client AppsClient) GetFunction(ctx context.Context, resourceGroupName string, name string, functionName string) (result FunctionEnvelope, err error) { +// webJobName - name of Web Job. +func (client AppsClient) GetContinuousWebJob(ctx context.Context, resourceGroupName string, name string, webJobName string) (result ContinuousWebJob, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetFunction") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetContinuousWebJob") defer func() { sc := -1 if result.Response.Response != nil { @@ -9144,37 +9166,37 @@ func (client AppsClient) GetFunction(ctx context.Context, resourceGroupName stri Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetFunction", err.Error()) + return result, validation.NewError("web.AppsClient", "GetContinuousWebJob", err.Error()) } - req, err := client.GetFunctionPreparer(ctx, resourceGroupName, name, functionName) + req, err := client.GetContinuousWebJobPreparer(ctx, resourceGroupName, name, webJobName) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetFunction", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetContinuousWebJob", nil, "Failure preparing request") return } - resp, err := client.GetFunctionSender(req) + resp, err := client.GetContinuousWebJobSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetFunction", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetContinuousWebJob", resp, "Failure sending request") return } - result, err = client.GetFunctionResponder(resp) + result, err = client.GetContinuousWebJobResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetFunction", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetContinuousWebJob", resp, "Failure responding to request") } return } -// GetFunctionPreparer prepares the GetFunction request. -func (client AppsClient) GetFunctionPreparer(ctx context.Context, resourceGroupName string, name string, functionName string) (*http.Request, error) { +// GetContinuousWebJobPreparer prepares the GetContinuousWebJob request. +func (client AppsClient) GetContinuousWebJobPreparer(ctx context.Context, resourceGroupName string, name string, webJobName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "functionName": autorest.Encode("path", functionName), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webJobName": autorest.Encode("path", webJobName), } const APIVersion = "2018-02-01" @@ -9185,21 +9207,21 @@ func (client AppsClient) GetFunctionPreparer(ctx context.Context, resourceGroupN preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetFunctionSender sends the GetFunction request. The method will close the +// GetContinuousWebJobSender sends the GetContinuousWebJob request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetFunctionSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetContinuousWebJobSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetFunctionResponder handles the response to the GetFunction request. The method always +// GetContinuousWebJobResponder handles the response to the GetContinuousWebJob request. The method always // closes the http.Response Body. -func (client AppsClient) GetFunctionResponder(resp *http.Response) (result FunctionEnvelope, err error) { +func (client AppsClient) GetContinuousWebJobResponder(resp *http.Response) (result ContinuousWebJob, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -9210,13 +9232,16 @@ func (client AppsClient) GetFunctionResponder(resp *http.Response) (result Funct return } -// GetFunctionsAdminToken fetch a short lived token that can be exchanged for a master key. +// GetContinuousWebJobSlot gets a continuous web job by its ID for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of web app. -func (client AppsClient) GetFunctionsAdminToken(ctx context.Context, resourceGroupName string, name string) (result String, err error) { +// name - site name. +// webJobName - name of Web Job. +// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the +// production slot. +func (client AppsClient) GetContinuousWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (result ContinuousWebJob, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetFunctionsAdminToken") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetContinuousWebJobSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -9230,36 +9255,38 @@ func (client AppsClient) GetFunctionsAdminToken(ctx context.Context, resourceGro Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetFunctionsAdminToken", err.Error()) + return result, validation.NewError("web.AppsClient", "GetContinuousWebJobSlot", err.Error()) } - req, err := client.GetFunctionsAdminTokenPreparer(ctx, resourceGroupName, name) + req, err := client.GetContinuousWebJobSlotPreparer(ctx, resourceGroupName, name, webJobName, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetFunctionsAdminToken", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetContinuousWebJobSlot", nil, "Failure preparing request") return } - resp, err := client.GetFunctionsAdminTokenSender(req) + resp, err := client.GetContinuousWebJobSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetFunctionsAdminToken", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetContinuousWebJobSlot", resp, "Failure sending request") return } - result, err = client.GetFunctionsAdminTokenResponder(resp) + result, err = client.GetContinuousWebJobSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetFunctionsAdminToken", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetContinuousWebJobSlot", resp, "Failure responding to request") } return } -// GetFunctionsAdminTokenPreparer prepares the GetFunctionsAdminToken request. -func (client AppsClient) GetFunctionsAdminTokenPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { +// GetContinuousWebJobSlotPreparer prepares the GetContinuousWebJobSlot request. +func (client AppsClient) GetContinuousWebJobSlotPreparer(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webJobName": autorest.Encode("path", webJobName), } const APIVersion = "2018-02-01" @@ -9270,39 +9297,39 @@ func (client AppsClient) GetFunctionsAdminTokenPreparer(ctx context.Context, res preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/admin/token", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetFunctionsAdminTokenSender sends the GetFunctionsAdminToken request. The method will close the +// GetContinuousWebJobSlotSender sends the GetContinuousWebJobSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetFunctionsAdminTokenSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetContinuousWebJobSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetFunctionsAdminTokenResponder handles the response to the GetFunctionsAdminToken request. The method always +// GetContinuousWebJobSlotResponder handles the response to the GetContinuousWebJobSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetFunctionsAdminTokenResponder(resp *http.Response) (result String, err error) { +func (client AppsClient) GetContinuousWebJobSlotResponder(resp *http.Response) (result ContinuousWebJob, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetFunctionsAdminTokenSlot fetch a short lived token that can be exchanged for a master key. +// GetDeployment get a deployment by its ID for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of web app. -// slot - name of web app slot. If not specified then will default to production slot. -func (client AppsClient) GetFunctionsAdminTokenSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result String, err error) { +// name - name of the app. +// ID - deployment ID. +func (client AppsClient) GetDeployment(ctx context.Context, resourceGroupName string, name string, ID string) (result Deployment, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetFunctionsAdminTokenSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetDeployment") defer func() { sc := -1 if result.Response.Response != nil { @@ -9316,36 +9343,36 @@ func (client AppsClient) GetFunctionsAdminTokenSlot(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetFunctionsAdminTokenSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetDeployment", err.Error()) } - req, err := client.GetFunctionsAdminTokenSlotPreparer(ctx, resourceGroupName, name, slot) + req, err := client.GetDeploymentPreparer(ctx, resourceGroupName, name, ID) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetFunctionsAdminTokenSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDeployment", nil, "Failure preparing request") return } - resp, err := client.GetFunctionsAdminTokenSlotSender(req) + resp, err := client.GetDeploymentSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetFunctionsAdminTokenSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDeployment", resp, "Failure sending request") return } - result, err = client.GetFunctionsAdminTokenSlotResponder(resp) + result, err = client.GetDeploymentResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetFunctionsAdminTokenSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDeployment", resp, "Failure responding to request") } return } -// GetFunctionsAdminTokenSlotPreparer prepares the GetFunctionsAdminTokenSlot request. -func (client AppsClient) GetFunctionsAdminTokenSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { +// GetDeploymentPreparer prepares the GetDeployment request. +func (client AppsClient) GetDeploymentPreparer(ctx context.Context, resourceGroupName string, name string, ID string) (*http.Request, error) { pathParameters := map[string]interface{}{ + "id": autorest.Encode("path", ID), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -9357,39 +9384,41 @@ func (client AppsClient) GetFunctionsAdminTokenSlotPreparer(ctx context.Context, preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/admin/token", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetFunctionsAdminTokenSlotSender sends the GetFunctionsAdminTokenSlot request. The method will close the +// GetDeploymentSender sends the GetDeployment request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetFunctionsAdminTokenSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetDeploymentSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetFunctionsAdminTokenSlotResponder handles the response to the GetFunctionsAdminTokenSlot request. The method always +// GetDeploymentResponder handles the response to the GetDeployment request. The method always // closes the http.Response Body. -func (client AppsClient) GetFunctionsAdminTokenSlotResponder(resp *http.Response) (result String, err error) { +func (client AppsClient) GetDeploymentResponder(resp *http.Response) (result Deployment, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetHostNameBinding get the named hostname binding for an app (or deployment slot, if specified). +// GetDeploymentSlot get a deployment by its ID for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// hostName - hostname in the hostname binding. -func (client AppsClient) GetHostNameBinding(ctx context.Context, resourceGroupName string, name string, hostName string) (result HostNameBinding, err error) { +// ID - deployment ID. +// slot - name of the deployment slot. If a slot is not specified, the API gets a deployment for the production +// slot. +func (client AppsClient) GetDeploymentSlot(ctx context.Context, resourceGroupName string, name string, ID string, slot string) (result Deployment, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetHostNameBinding") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetDeploymentSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -9403,36 +9432,37 @@ func (client AppsClient) GetHostNameBinding(ctx context.Context, resourceGroupNa Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetHostNameBinding", err.Error()) + return result, validation.NewError("web.AppsClient", "GetDeploymentSlot", err.Error()) } - req, err := client.GetHostNameBindingPreparer(ctx, resourceGroupName, name, hostName) + req, err := client.GetDeploymentSlotPreparer(ctx, resourceGroupName, name, ID, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetHostNameBinding", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDeploymentSlot", nil, "Failure preparing request") return } - resp, err := client.GetHostNameBindingSender(req) + resp, err := client.GetDeploymentSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetHostNameBinding", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDeploymentSlot", resp, "Failure sending request") return } - result, err = client.GetHostNameBindingResponder(resp) + result, err = client.GetDeploymentSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetHostNameBinding", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDeploymentSlot", resp, "Failure responding to request") } return } -// GetHostNameBindingPreparer prepares the GetHostNameBinding request. -func (client AppsClient) GetHostNameBindingPreparer(ctx context.Context, resourceGroupName string, name string, hostName string) (*http.Request, error) { +// GetDeploymentSlotPreparer prepares the GetDeploymentSlot request. +func (client AppsClient) GetDeploymentSlotPreparer(ctx context.Context, resourceGroupName string, name string, ID string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "hostName": autorest.Encode("path", hostName), + "id": autorest.Encode("path", ID), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -9444,21 +9474,21 @@ func (client AppsClient) GetHostNameBindingPreparer(ctx context.Context, resourc preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetHostNameBindingSender sends the GetHostNameBinding request. The method will close the +// GetDeploymentSlotSender sends the GetDeploymentSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetHostNameBindingSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetDeploymentSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetHostNameBindingResponder handles the response to the GetHostNameBinding request. The method always +// GetDeploymentSlotResponder handles the response to the GetDeploymentSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetHostNameBindingResponder(resp *http.Response) (result HostNameBinding, err error) { +func (client AppsClient) GetDeploymentSlotResponder(resp *http.Response) (result Deployment, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -9469,16 +9499,13 @@ func (client AppsClient) GetHostNameBindingResponder(resp *http.Response) (resul return } -// GetHostNameBindingSlot get the named hostname binding for an app (or deployment slot, if specified). +// GetDiagnosticLogsConfiguration gets the logging configuration of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// slot - name of the deployment slot. If a slot is not specified, the API the named binding for the production -// slot. -// hostName - hostname in the hostname binding. -func (client AppsClient) GetHostNameBindingSlot(ctx context.Context, resourceGroupName string, name string, slot string, hostName string) (result HostNameBinding, err error) { +func (client AppsClient) GetDiagnosticLogsConfiguration(ctx context.Context, resourceGroupName string, name string) (result SiteLogsConfig, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetHostNameBindingSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetDiagnosticLogsConfiguration") defer func() { sc := -1 if result.Response.Response != nil { @@ -9492,37 +9519,35 @@ func (client AppsClient) GetHostNameBindingSlot(ctx context.Context, resourceGro Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetHostNameBindingSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetDiagnosticLogsConfiguration", err.Error()) } - req, err := client.GetHostNameBindingSlotPreparer(ctx, resourceGroupName, name, slot, hostName) + req, err := client.GetDiagnosticLogsConfigurationPreparer(ctx, resourceGroupName, name) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetHostNameBindingSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDiagnosticLogsConfiguration", nil, "Failure preparing request") return } - resp, err := client.GetHostNameBindingSlotSender(req) + resp, err := client.GetDiagnosticLogsConfigurationSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetHostNameBindingSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDiagnosticLogsConfiguration", resp, "Failure sending request") return } - result, err = client.GetHostNameBindingSlotResponder(resp) + result, err = client.GetDiagnosticLogsConfigurationResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetHostNameBindingSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDiagnosticLogsConfiguration", resp, "Failure responding to request") } return } -// GetHostNameBindingSlotPreparer prepares the GetHostNameBindingSlot request. -func (client AppsClient) GetHostNameBindingSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string, hostName string) (*http.Request, error) { +// GetDiagnosticLogsConfigurationPreparer prepares the GetDiagnosticLogsConfiguration request. +func (client AppsClient) GetDiagnosticLogsConfigurationPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "hostName": autorest.Encode("path", hostName), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -9534,21 +9559,21 @@ func (client AppsClient) GetHostNameBindingSlotPreparer(ctx context.Context, res preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/logs", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetHostNameBindingSlotSender sends the GetHostNameBindingSlot request. The method will close the +// GetDiagnosticLogsConfigurationSender sends the GetDiagnosticLogsConfiguration request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetHostNameBindingSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetDiagnosticLogsConfigurationSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetHostNameBindingSlotResponder handles the response to the GetHostNameBindingSlot request. The method always +// GetDiagnosticLogsConfigurationResponder handles the response to the GetDiagnosticLogsConfiguration request. The method always // closes the http.Response Body. -func (client AppsClient) GetHostNameBindingSlotResponder(resp *http.Response) (result HostNameBinding, err error) { +func (client AppsClient) GetDiagnosticLogsConfigurationResponder(resp *http.Response) (result SiteLogsConfig, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -9559,15 +9584,15 @@ func (client AppsClient) GetHostNameBindingSlotResponder(resp *http.Response) (r return } -// GetHybridConnection retrieves a specific Service Bus Hybrid Connection used by this Web App. +// GetDiagnosticLogsConfigurationSlot gets the logging configuration of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - the name of the web app. -// namespaceName - the namespace for this hybrid connection. -// relayName - the relay name for this hybrid connection. -func (client AppsClient) GetHybridConnection(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string) (result HybridConnection, err error) { +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API will get the logging configuration +// for the production slot. +func (client AppsClient) GetDiagnosticLogsConfigurationSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result SiteLogsConfig, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetHybridConnection") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetDiagnosticLogsConfigurationSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -9581,37 +9606,36 @@ func (client AppsClient) GetHybridConnection(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetHybridConnection", err.Error()) + return result, validation.NewError("web.AppsClient", "GetDiagnosticLogsConfigurationSlot", err.Error()) } - req, err := client.GetHybridConnectionPreparer(ctx, resourceGroupName, name, namespaceName, relayName) + req, err := client.GetDiagnosticLogsConfigurationSlotPreparer(ctx, resourceGroupName, name, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetHybridConnection", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDiagnosticLogsConfigurationSlot", nil, "Failure preparing request") return } - resp, err := client.GetHybridConnectionSender(req) + resp, err := client.GetDiagnosticLogsConfigurationSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetHybridConnection", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDiagnosticLogsConfigurationSlot", resp, "Failure sending request") return } - result, err = client.GetHybridConnectionResponder(resp) + result, err = client.GetDiagnosticLogsConfigurationSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetHybridConnection", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDiagnosticLogsConfigurationSlot", resp, "Failure responding to request") } return } -// GetHybridConnectionPreparer prepares the GetHybridConnection request. -func (client AppsClient) GetHybridConnectionPreparer(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string) (*http.Request, error) { +// GetDiagnosticLogsConfigurationSlotPreparer prepares the GetDiagnosticLogsConfigurationSlot request. +func (client AppsClient) GetDiagnosticLogsConfigurationSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), - "namespaceName": autorest.Encode("path", namespaceName), - "relayName": autorest.Encode("path", relayName), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -9623,21 +9647,21 @@ func (client AppsClient) GetHybridConnectionPreparer(ctx context.Context, resour preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetHybridConnectionSender sends the GetHybridConnection request. The method will close the +// GetDiagnosticLogsConfigurationSlotSender sends the GetDiagnosticLogsConfigurationSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetHybridConnectionSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetDiagnosticLogsConfigurationSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetHybridConnectionResponder handles the response to the GetHybridConnection request. The method always +// GetDiagnosticLogsConfigurationSlotResponder handles the response to the GetDiagnosticLogsConfigurationSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetHybridConnectionResponder(resp *http.Response) (result HybridConnection, err error) { +func (client AppsClient) GetDiagnosticLogsConfigurationSlotResponder(resp *http.Response) (result SiteLogsConfig, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -9648,16 +9672,14 @@ func (client AppsClient) GetHybridConnectionResponder(resp *http.Response) (resu return } -// GetHybridConnectionSlot retrieves a specific Service Bus Hybrid Connection used by this Web App. +// GetDomainOwnershipIdentifier get domain ownership identifier for web app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - the name of the web app. -// namespaceName - the namespace for this hybrid connection. -// relayName - the relay name for this hybrid connection. -// slot - the name of the slot for the web app. -func (client AppsClient) GetHybridConnectionSlot(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, slot string) (result HybridConnection, err error) { +// name - name of the app. +// domainOwnershipIdentifierName - name of domain ownership identifier. +func (client AppsClient) GetDomainOwnershipIdentifier(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string) (result Identifier, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetHybridConnectionSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetDomainOwnershipIdentifier") defer func() { sc := -1 if result.Response.Response != nil { @@ -9671,39 +9693,37 @@ func (client AppsClient) GetHybridConnectionSlot(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetHybridConnectionSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetDomainOwnershipIdentifier", err.Error()) } - req, err := client.GetHybridConnectionSlotPreparer(ctx, resourceGroupName, name, namespaceName, relayName, slot) + req, err := client.GetDomainOwnershipIdentifierPreparer(ctx, resourceGroupName, name, domainOwnershipIdentifierName) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetHybridConnectionSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDomainOwnershipIdentifier", nil, "Failure preparing request") return } - resp, err := client.GetHybridConnectionSlotSender(req) + resp, err := client.GetDomainOwnershipIdentifierSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetHybridConnectionSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDomainOwnershipIdentifier", resp, "Failure sending request") return } - result, err = client.GetHybridConnectionSlotResponder(resp) + result, err = client.GetDomainOwnershipIdentifierResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetHybridConnectionSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDomainOwnershipIdentifier", resp, "Failure responding to request") } return } -// GetHybridConnectionSlotPreparer prepares the GetHybridConnectionSlot request. -func (client AppsClient) GetHybridConnectionSlotPreparer(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, slot string) (*http.Request, error) { +// GetDomainOwnershipIdentifierPreparer prepares the GetDomainOwnershipIdentifier request. +func (client AppsClient) GetDomainOwnershipIdentifierPreparer(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "name": autorest.Encode("path", name), - "namespaceName": autorest.Encode("path", namespaceName), - "relayName": autorest.Encode("path", relayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "domainOwnershipIdentifierName": autorest.Encode("path", domainOwnershipIdentifierName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2018-02-01" @@ -9714,21 +9734,21 @@ func (client AppsClient) GetHybridConnectionSlotPreparer(ctx context.Context, re preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetHybridConnectionSlotSender sends the GetHybridConnectionSlot request. The method will close the +// GetDomainOwnershipIdentifierSender sends the GetDomainOwnershipIdentifier request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetHybridConnectionSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetDomainOwnershipIdentifierSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetHybridConnectionSlotResponder handles the response to the GetHybridConnectionSlot request. The method always +// GetDomainOwnershipIdentifierResponder handles the response to the GetDomainOwnershipIdentifier request. The method always // closes the http.Response Body. -func (client AppsClient) GetHybridConnectionSlotResponder(resp *http.Response) (result HybridConnection, err error) { +func (client AppsClient) GetDomainOwnershipIdentifierResponder(resp *http.Response) (result Identifier, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -9739,16 +9759,16 @@ func (client AppsClient) GetHybridConnectionSlotResponder(resp *http.Response) ( return } -// GetInstanceFunctionSlot get function information by its ID for web site, or a deployment slot. +// GetDomainOwnershipIdentifierSlot get domain ownership identifier for web app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - site name. -// functionName - function name. -// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the +// name - name of the app. +// domainOwnershipIdentifierName - name of domain ownership identifier. +// slot - name of the deployment slot. If a slot is not specified, the API will delete the binding for the // production slot. -func (client AppsClient) GetInstanceFunctionSlot(ctx context.Context, resourceGroupName string, name string, functionName string, slot string) (result FunctionEnvelope, err error) { +func (client AppsClient) GetDomainOwnershipIdentifierSlot(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, slot string) (result Identifier, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceFunctionSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetDomainOwnershipIdentifierSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -9762,41 +9782,41 @@ func (client AppsClient) GetInstanceFunctionSlot(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetInstanceFunctionSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetDomainOwnershipIdentifierSlot", err.Error()) } - req, err := client.GetInstanceFunctionSlotPreparer(ctx, resourceGroupName, name, functionName, slot) + req, err := client.GetDomainOwnershipIdentifierSlotPreparer(ctx, resourceGroupName, name, domainOwnershipIdentifierName, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceFunctionSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDomainOwnershipIdentifierSlot", nil, "Failure preparing request") return } - resp, err := client.GetInstanceFunctionSlotSender(req) + resp, err := client.GetDomainOwnershipIdentifierSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceFunctionSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDomainOwnershipIdentifierSlot", resp, "Failure sending request") return } - result, err = client.GetInstanceFunctionSlotResponder(resp) + result, err = client.GetDomainOwnershipIdentifierSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceFunctionSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDomainOwnershipIdentifierSlot", resp, "Failure responding to request") } return } -// GetInstanceFunctionSlotPreparer prepares the GetInstanceFunctionSlot request. -func (client AppsClient) GetInstanceFunctionSlotPreparer(ctx context.Context, resourceGroupName string, name string, functionName string, slot string) (*http.Request, error) { +// GetDomainOwnershipIdentifierSlotPreparer prepares the GetDomainOwnershipIdentifierSlot request. +func (client AppsClient) GetDomainOwnershipIdentifierSlotPreparer(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "functionName": autorest.Encode("path", functionName), - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-02-01" + "domainOwnershipIdentifierName": autorest.Encode("path", domainOwnershipIdentifierName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-02-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -9804,39 +9824,39 @@ func (client AppsClient) GetInstanceFunctionSlotPreparer(ctx context.Context, re preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetInstanceFunctionSlotSender sends the GetInstanceFunctionSlot request. The method will close the +// GetDomainOwnershipIdentifierSlotSender sends the GetDomainOwnershipIdentifierSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetInstanceFunctionSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetDomainOwnershipIdentifierSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetInstanceFunctionSlotResponder handles the response to the GetInstanceFunctionSlot request. The method always +// GetDomainOwnershipIdentifierSlotResponder handles the response to the GetDomainOwnershipIdentifierSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetInstanceFunctionSlotResponder(resp *http.Response) (result FunctionEnvelope, err error) { +func (client AppsClient) GetDomainOwnershipIdentifierSlotResponder(resp *http.Response) (result Identifier, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetInstanceMSDeployLog get the MSDeploy Log for the last MSDeploy operation. +// GetFunction get function information by its ID for web site, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of web app. -// instanceID - ID of web app instance. -func (client AppsClient) GetInstanceMSDeployLog(ctx context.Context, resourceGroupName string, name string, instanceID string) (result MSDeployLog, err error) { +// name - site name. +// functionName - function name. +func (client AppsClient) GetFunction(ctx context.Context, resourceGroupName string, name string, functionName string) (result FunctionEnvelope, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceMSDeployLog") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetFunction") defer func() { sc := -1 if result.Response.Response != nil { @@ -9850,34 +9870,34 @@ func (client AppsClient) GetInstanceMSDeployLog(ctx context.Context, resourceGro Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetInstanceMSDeployLog", err.Error()) + return result, validation.NewError("web.AppsClient", "GetFunction", err.Error()) } - req, err := client.GetInstanceMSDeployLogPreparer(ctx, resourceGroupName, name, instanceID) + req, err := client.GetFunctionPreparer(ctx, resourceGroupName, name, functionName) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMSDeployLog", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetFunction", nil, "Failure preparing request") return } - resp, err := client.GetInstanceMSDeployLogSender(req) + resp, err := client.GetFunctionSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMSDeployLog", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetFunction", resp, "Failure sending request") return } - result, err = client.GetInstanceMSDeployLogResponder(resp) + result, err = client.GetFunctionResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMSDeployLog", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetFunction", resp, "Failure responding to request") } return } -// GetInstanceMSDeployLogPreparer prepares the GetInstanceMSDeployLog request. -func (client AppsClient) GetInstanceMSDeployLogPreparer(ctx context.Context, resourceGroupName string, name string, instanceID string) (*http.Request, error) { +// GetFunctionPreparer prepares the GetFunction request. +func (client AppsClient) GetFunctionPreparer(ctx context.Context, resourceGroupName string, name string, functionName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), + "functionName": autorest.Encode("path", functionName), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -9891,21 +9911,21 @@ func (client AppsClient) GetInstanceMSDeployLogPreparer(ctx context.Context, res preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy/log", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetInstanceMSDeployLogSender sends the GetInstanceMSDeployLog request. The method will close the +// GetFunctionSender sends the GetFunction request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetInstanceMSDeployLogSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetFunctionSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetInstanceMSDeployLogResponder handles the response to the GetInstanceMSDeployLog request. The method always +// GetFunctionResponder handles the response to the GetFunction request. The method always // closes the http.Response Body. -func (client AppsClient) GetInstanceMSDeployLogResponder(resp *http.Response) (result MSDeployLog, err error) { +func (client AppsClient) GetFunctionResponder(resp *http.Response) (result FunctionEnvelope, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -9916,15 +9936,13 @@ func (client AppsClient) GetInstanceMSDeployLogResponder(resp *http.Response) (r return } -// GetInstanceMSDeployLogSlot get the MSDeploy Log for the last MSDeploy operation. +// GetFunctionsAdminToken fetch a short lived token that can be exchanged for a master key. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of web app. -// slot - name of web app slot. If not specified then will default to production slot. -// instanceID - ID of web app instance. -func (client AppsClient) GetInstanceMSDeployLogSlot(ctx context.Context, resourceGroupName string, name string, slot string, instanceID string) (result MSDeployLog, err error) { +func (client AppsClient) GetFunctionsAdminToken(ctx context.Context, resourceGroupName string, name string) (result String, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceMSDeployLogSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetFunctionsAdminToken") defer func() { sc := -1 if result.Response.Response != nil { @@ -9938,37 +9956,35 @@ func (client AppsClient) GetInstanceMSDeployLogSlot(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetInstanceMSDeployLogSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetFunctionsAdminToken", err.Error()) } - req, err := client.GetInstanceMSDeployLogSlotPreparer(ctx, resourceGroupName, name, slot, instanceID) + req, err := client.GetFunctionsAdminTokenPreparer(ctx, resourceGroupName, name) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMSDeployLogSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetFunctionsAdminToken", nil, "Failure preparing request") return } - resp, err := client.GetInstanceMSDeployLogSlotSender(req) + resp, err := client.GetFunctionsAdminTokenSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMSDeployLogSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetFunctionsAdminToken", resp, "Failure sending request") return } - result, err = client.GetInstanceMSDeployLogSlotResponder(resp) + result, err = client.GetFunctionsAdminTokenResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMSDeployLogSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetFunctionsAdminToken", resp, "Failure responding to request") } return } -// GetInstanceMSDeployLogSlotPreparer prepares the GetInstanceMSDeployLogSlot request. -func (client AppsClient) GetInstanceMSDeployLogSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string, instanceID string) (*http.Request, error) { +// GetFunctionsAdminTokenPreparer prepares the GetFunctionsAdminToken request. +func (client AppsClient) GetFunctionsAdminTokenPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -9980,39 +9996,39 @@ func (client AppsClient) GetInstanceMSDeployLogSlotPreparer(ctx context.Context, preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy/log", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/admin/token", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetInstanceMSDeployLogSlotSender sends the GetInstanceMSDeployLogSlot request. The method will close the +// GetFunctionsAdminTokenSender sends the GetFunctionsAdminToken request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetInstanceMSDeployLogSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetFunctionsAdminTokenSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetInstanceMSDeployLogSlotResponder handles the response to the GetInstanceMSDeployLogSlot request. The method always +// GetFunctionsAdminTokenResponder handles the response to the GetFunctionsAdminToken request. The method always // closes the http.Response Body. -func (client AppsClient) GetInstanceMSDeployLogSlotResponder(resp *http.Response) (result MSDeployLog, err error) { +func (client AppsClient) GetFunctionsAdminTokenResponder(resp *http.Response) (result String, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), - autorest.ByUnmarshallingJSON(&result), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetInstanceMsDeployStatus get the status of the last MSDeploy operation. +// GetFunctionsAdminTokenSlot fetch a short lived token that can be exchanged for a master key. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of web app. -// instanceID - ID of web app instance. -func (client AppsClient) GetInstanceMsDeployStatus(ctx context.Context, resourceGroupName string, name string, instanceID string) (result MSDeployStatus, err error) { +// slot - name of web app slot. If not specified then will default to production slot. +func (client AppsClient) GetFunctionsAdminTokenSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result String, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceMsDeployStatus") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetFunctionsAdminTokenSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -10026,36 +10042,36 @@ func (client AppsClient) GetInstanceMsDeployStatus(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetInstanceMsDeployStatus", err.Error()) + return result, validation.NewError("web.AppsClient", "GetFunctionsAdminTokenSlot", err.Error()) } - req, err := client.GetInstanceMsDeployStatusPreparer(ctx, resourceGroupName, name, instanceID) + req, err := client.GetFunctionsAdminTokenSlotPreparer(ctx, resourceGroupName, name, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMsDeployStatus", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetFunctionsAdminTokenSlot", nil, "Failure preparing request") return } - resp, err := client.GetInstanceMsDeployStatusSender(req) + resp, err := client.GetFunctionsAdminTokenSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMsDeployStatus", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetFunctionsAdminTokenSlot", resp, "Failure sending request") return } - result, err = client.GetInstanceMsDeployStatusResponder(resp) + result, err = client.GetFunctionsAdminTokenSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMsDeployStatus", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetFunctionsAdminTokenSlot", resp, "Failure responding to request") } return } -// GetInstanceMsDeployStatusPreparer prepares the GetInstanceMsDeployStatus request. -func (client AppsClient) GetInstanceMsDeployStatusPreparer(ctx context.Context, resourceGroupName string, name string, instanceID string) (*http.Request, error) { +// GetFunctionsAdminTokenSlotPreparer prepares the GetFunctionsAdminTokenSlot request. +func (client AppsClient) GetFunctionsAdminTokenSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -10067,40 +10083,39 @@ func (client AppsClient) GetInstanceMsDeployStatusPreparer(ctx context.Context, preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/admin/token", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetInstanceMsDeployStatusSender sends the GetInstanceMsDeployStatus request. The method will close the +// GetFunctionsAdminTokenSlotSender sends the GetFunctionsAdminTokenSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetInstanceMsDeployStatusSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetFunctionsAdminTokenSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetInstanceMsDeployStatusResponder handles the response to the GetInstanceMsDeployStatus request. The method always +// GetFunctionsAdminTokenSlotResponder handles the response to the GetFunctionsAdminTokenSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetInstanceMsDeployStatusResponder(resp *http.Response) (result MSDeployStatus, err error) { +func (client AppsClient) GetFunctionsAdminTokenSlotResponder(resp *http.Response) (result String, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), + autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetInstanceMsDeployStatusSlot get the status of the last MSDeploy operation. +// GetHostNameBinding get the named hostname binding for an app (or deployment slot, if specified). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of web app. -// slot - name of web app slot. If not specified then will default to production slot. -// instanceID - ID of web app instance. -func (client AppsClient) GetInstanceMsDeployStatusSlot(ctx context.Context, resourceGroupName string, name string, slot string, instanceID string) (result MSDeployStatus, err error) { +// name - name of the app. +// hostName - hostname in the hostname binding. +func (client AppsClient) GetHostNameBinding(ctx context.Context, resourceGroupName string, name string, hostName string) (result HostNameBinding, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceMsDeployStatusSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetHostNameBinding") defer func() { sc := -1 if result.Response.Response != nil { @@ -10114,37 +10129,36 @@ func (client AppsClient) GetInstanceMsDeployStatusSlot(ctx context.Context, reso Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetInstanceMsDeployStatusSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetHostNameBinding", err.Error()) } - req, err := client.GetInstanceMsDeployStatusSlotPreparer(ctx, resourceGroupName, name, slot, instanceID) + req, err := client.GetHostNameBindingPreparer(ctx, resourceGroupName, name, hostName) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMsDeployStatusSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetHostNameBinding", nil, "Failure preparing request") return } - resp, err := client.GetInstanceMsDeployStatusSlotSender(req) + resp, err := client.GetHostNameBindingSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMsDeployStatusSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetHostNameBinding", resp, "Failure sending request") return } - result, err = client.GetInstanceMsDeployStatusSlotResponder(resp) + result, err = client.GetHostNameBindingResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMsDeployStatusSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetHostNameBinding", resp, "Failure responding to request") } return } -// GetInstanceMsDeployStatusSlotPreparer prepares the GetInstanceMsDeployStatusSlot request. -func (client AppsClient) GetInstanceMsDeployStatusSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string, instanceID string) (*http.Request, error) { +// GetHostNameBindingPreparer prepares the GetHostNameBinding request. +func (client AppsClient) GetHostNameBindingPreparer(ctx context.Context, resourceGroupName string, name string, hostName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), + "hostName": autorest.Encode("path", hostName), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -10156,21 +10170,21 @@ func (client AppsClient) GetInstanceMsDeployStatusSlotPreparer(ctx context.Conte preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetInstanceMsDeployStatusSlotSender sends the GetInstanceMsDeployStatusSlot request. The method will close the +// GetHostNameBindingSender sends the GetHostNameBinding request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetInstanceMsDeployStatusSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetHostNameBindingSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetInstanceMsDeployStatusSlotResponder handles the response to the GetInstanceMsDeployStatusSlot request. The method always +// GetHostNameBindingResponder handles the response to the GetHostNameBinding request. The method always // closes the http.Response Body. -func (client AppsClient) GetInstanceMsDeployStatusSlotResponder(resp *http.Response) (result MSDeployStatus, err error) { +func (client AppsClient) GetHostNameBindingResponder(resp *http.Response) (result HostNameBinding, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -10181,16 +10195,16 @@ func (client AppsClient) GetInstanceMsDeployStatusSlotResponder(resp *http.Respo return } -// GetInstanceProcess get process information by its ID for a specific scaled-out instance in a web site. +// GetHostNameBindingSlot get the named hostname binding for an app (or deployment slot, if specified). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - site name. -// processID - pID. -// instanceID - ID of a specific scaled-out instance. This is the value of the name property in the JSON -// response from "GET api/sites/{siteName}/instances". -func (client AppsClient) GetInstanceProcess(ctx context.Context, resourceGroupName string, name string, processID string, instanceID string) (result ProcessInfo, err error) { +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API the named binding for the production +// slot. +// hostName - hostname in the hostname binding. +func (client AppsClient) GetHostNameBindingSlot(ctx context.Context, resourceGroupName string, name string, slot string, hostName string) (result HostNameBinding, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceProcess") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetHostNameBindingSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -10204,37 +10218,37 @@ func (client AppsClient) GetInstanceProcess(ctx context.Context, resourceGroupNa Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetInstanceProcess", err.Error()) + return result, validation.NewError("web.AppsClient", "GetHostNameBindingSlot", err.Error()) } - req, err := client.GetInstanceProcessPreparer(ctx, resourceGroupName, name, processID, instanceID) + req, err := client.GetHostNameBindingSlotPreparer(ctx, resourceGroupName, name, slot, hostName) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcess", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetHostNameBindingSlot", nil, "Failure preparing request") return } - resp, err := client.GetInstanceProcessSender(req) + resp, err := client.GetHostNameBindingSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcess", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetHostNameBindingSlot", resp, "Failure sending request") return } - result, err = client.GetInstanceProcessResponder(resp) + result, err = client.GetHostNameBindingSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcess", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetHostNameBindingSlot", resp, "Failure responding to request") } return } -// GetInstanceProcessPreparer prepares the GetInstanceProcess request. -func (client AppsClient) GetInstanceProcessPreparer(ctx context.Context, resourceGroupName string, name string, processID string, instanceID string) (*http.Request, error) { +// GetHostNameBindingSlotPreparer prepares the GetHostNameBindingSlot request. +func (client AppsClient) GetHostNameBindingSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string, hostName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), + "hostName": autorest.Encode("path", hostName), "name": autorest.Encode("path", name), - "processId": autorest.Encode("path", processID), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -10246,41 +10260,40 @@ func (client AppsClient) GetInstanceProcessPreparer(ctx context.Context, resourc preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetInstanceProcessSender sends the GetInstanceProcess request. The method will close the +// GetHostNameBindingSlotSender sends the GetHostNameBindingSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetInstanceProcessSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetHostNameBindingSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetInstanceProcessResponder handles the response to the GetInstanceProcess request. The method always +// GetHostNameBindingSlotResponder handles the response to the GetHostNameBindingSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetInstanceProcessResponder(resp *http.Response) (result ProcessInfo, err error) { +func (client AppsClient) GetHostNameBindingSlotResponder(resp *http.Response) (result HostNameBinding, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetInstanceProcessDump get a memory dump of a process by its ID for a specific scaled-out instance in a web site. +// GetHybridConnection retrieves a specific Service Bus Hybrid Connection used by this Web App. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - site name. -// processID - pID. -// instanceID - ID of a specific scaled-out instance. This is the value of the name property in the JSON -// response from "GET api/sites/{siteName}/instances". -func (client AppsClient) GetInstanceProcessDump(ctx context.Context, resourceGroupName string, name string, processID string, instanceID string) (result ReadCloser, err error) { +// name - the name of the web app. +// namespaceName - the namespace for this hybrid connection. +// relayName - the relay name for this hybrid connection. +func (client AppsClient) GetHybridConnection(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string) (result HybridConnection, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceProcessDump") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetHybridConnection") defer func() { sc := -1 if result.Response.Response != nil { @@ -10294,36 +10307,36 @@ func (client AppsClient) GetInstanceProcessDump(ctx context.Context, resourceGro Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetInstanceProcessDump", err.Error()) + return result, validation.NewError("web.AppsClient", "GetHybridConnection", err.Error()) } - req, err := client.GetInstanceProcessDumpPreparer(ctx, resourceGroupName, name, processID, instanceID) + req, err := client.GetHybridConnectionPreparer(ctx, resourceGroupName, name, namespaceName, relayName) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessDump", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetHybridConnection", nil, "Failure preparing request") return } - resp, err := client.GetInstanceProcessDumpSender(req) + resp, err := client.GetHybridConnectionSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessDump", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetHybridConnection", resp, "Failure sending request") return } - result, err = client.GetInstanceProcessDumpResponder(resp) + result, err = client.GetHybridConnectionResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessDump", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetHybridConnection", resp, "Failure responding to request") } return } -// GetInstanceProcessDumpPreparer prepares the GetInstanceProcessDump request. -func (client AppsClient) GetInstanceProcessDumpPreparer(ctx context.Context, resourceGroupName string, name string, processID string, instanceID string) (*http.Request, error) { +// GetHybridConnectionPreparer prepares the GetHybridConnection request. +func (client AppsClient) GetHybridConnectionPreparer(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), "name": autorest.Encode("path", name), - "processId": autorest.Encode("path", processID), + "namespaceName": autorest.Encode("path", namespaceName), + "relayName": autorest.Encode("path", relayName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -10336,43 +10349,41 @@ func (client AppsClient) GetInstanceProcessDumpPreparer(ctx context.Context, res preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/dump", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetInstanceProcessDumpSender sends the GetInstanceProcessDump request. The method will close the +// GetHybridConnectionSender sends the GetHybridConnection request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetInstanceProcessDumpSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetHybridConnectionSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetInstanceProcessDumpResponder handles the response to the GetInstanceProcessDump request. The method always +// GetHybridConnectionResponder handles the response to the GetHybridConnection request. The method always // closes the http.Response Body. -func (client AppsClient) GetInstanceProcessDumpResponder(resp *http.Response) (result ReadCloser, err error) { - result.Value = &resp.Body +func (client AppsClient) GetHybridConnectionResponder(resp *http.Response) (result HybridConnection, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound)) + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetInstanceProcessDumpSlot get a memory dump of a process by its ID for a specific scaled-out instance in a web -// site. +// GetHybridConnectionSlot retrieves a specific Service Bus Hybrid Connection used by this Web App. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - site name. -// processID - pID. -// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the -// production slot. -// instanceID - ID of a specific scaled-out instance. This is the value of the name property in the JSON -// response from "GET api/sites/{siteName}/instances". -func (client AppsClient) GetInstanceProcessDumpSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string) (result ReadCloser, err error) { +// name - the name of the web app. +// namespaceName - the namespace for this hybrid connection. +// relayName - the relay name for this hybrid connection. +// slot - the name of the slot for the web app. +func (client AppsClient) GetHybridConnectionSlot(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, slot string) (result HybridConnection, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceProcessDumpSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetHybridConnectionSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -10386,36 +10397,36 @@ func (client AppsClient) GetInstanceProcessDumpSlot(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetInstanceProcessDumpSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetHybridConnectionSlot", err.Error()) } - req, err := client.GetInstanceProcessDumpSlotPreparer(ctx, resourceGroupName, name, processID, slot, instanceID) + req, err := client.GetHybridConnectionSlotPreparer(ctx, resourceGroupName, name, namespaceName, relayName, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessDumpSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetHybridConnectionSlot", nil, "Failure preparing request") return } - resp, err := client.GetInstanceProcessDumpSlotSender(req) + resp, err := client.GetHybridConnectionSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessDumpSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetHybridConnectionSlot", resp, "Failure sending request") return } - result, err = client.GetInstanceProcessDumpSlotResponder(resp) + result, err = client.GetHybridConnectionSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessDumpSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetHybridConnectionSlot", resp, "Failure responding to request") } return } -// GetInstanceProcessDumpSlotPreparer prepares the GetInstanceProcessDumpSlot request. -func (client AppsClient) GetInstanceProcessDumpSlotPreparer(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string) (*http.Request, error) { +// GetHybridConnectionSlotPreparer prepares the GetHybridConnectionSlot request. +func (client AppsClient) GetHybridConnectionSlotPreparer(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), "name": autorest.Encode("path", name), - "processId": autorest.Encode("path", processID), + "namespaceName": autorest.Encode("path", namespaceName), + "relayName": autorest.Encode("path", relayName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -10429,41 +10440,40 @@ func (client AppsClient) GetInstanceProcessDumpSlotPreparer(ctx context.Context, preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/dump", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetInstanceProcessDumpSlotSender sends the GetInstanceProcessDumpSlot request. The method will close the +// GetHybridConnectionSlotSender sends the GetHybridConnectionSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetInstanceProcessDumpSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetHybridConnectionSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetInstanceProcessDumpSlotResponder handles the response to the GetInstanceProcessDumpSlot request. The method always +// GetHybridConnectionSlotResponder handles the response to the GetHybridConnectionSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetInstanceProcessDumpSlotResponder(resp *http.Response) (result ReadCloser, err error) { - result.Value = &resp.Body +func (client AppsClient) GetHybridConnectionSlotResponder(resp *http.Response) (result HybridConnection, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound)) + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetInstanceProcessModule get process information by its ID for a specific scaled-out instance in a web site. +// GetInstanceFunctionSlot get function information by its ID for web site, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. -// processID - pID. -// baseAddress - module base address. -// instanceID - ID of a specific scaled-out instance. This is the value of the name property in the JSON -// response from "GET api/sites/{siteName}/instances". -func (client AppsClient) GetInstanceProcessModule(ctx context.Context, resourceGroupName string, name string, processID string, baseAddress string, instanceID string) (result ProcessModuleInfo, err error) { +// functionName - function name. +// slot - name of the deployment slot. +func (client AppsClient) GetInstanceFunctionSlot(ctx context.Context, resourceGroupName string, name string, functionName string, slot string) (result FunctionEnvelope, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceProcessModule") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceFunctionSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -10477,38 +10487,37 @@ func (client AppsClient) GetInstanceProcessModule(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetInstanceProcessModule", err.Error()) + return result, validation.NewError("web.AppsClient", "GetInstanceFunctionSlot", err.Error()) } - req, err := client.GetInstanceProcessModulePreparer(ctx, resourceGroupName, name, processID, baseAddress, instanceID) + req, err := client.GetInstanceFunctionSlotPreparer(ctx, resourceGroupName, name, functionName, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessModule", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceFunctionSlot", nil, "Failure preparing request") return } - resp, err := client.GetInstanceProcessModuleSender(req) + resp, err := client.GetInstanceFunctionSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessModule", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceFunctionSlot", resp, "Failure sending request") return } - result, err = client.GetInstanceProcessModuleResponder(resp) + result, err = client.GetInstanceFunctionSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessModule", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceFunctionSlot", resp, "Failure responding to request") } return } -// GetInstanceProcessModulePreparer prepares the GetInstanceProcessModule request. -func (client AppsClient) GetInstanceProcessModulePreparer(ctx context.Context, resourceGroupName string, name string, processID string, baseAddress string, instanceID string) (*http.Request, error) { +// GetInstanceFunctionSlotPreparer prepares the GetInstanceFunctionSlot request. +func (client AppsClient) GetInstanceFunctionSlotPreparer(ctx context.Context, resourceGroupName string, name string, functionName string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "baseAddress": autorest.Encode("path", baseAddress), - "instanceId": autorest.Encode("path", instanceID), + "functionName": autorest.Encode("path", functionName), "name": autorest.Encode("path", name), - "processId": autorest.Encode("path", processID), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -10520,21 +10529,21 @@ func (client AppsClient) GetInstanceProcessModulePreparer(ctx context.Context, r preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/modules/{baseAddress}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetInstanceProcessModuleSender sends the GetInstanceProcessModule request. The method will close the +// GetInstanceFunctionSlotSender sends the GetInstanceFunctionSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetInstanceProcessModuleSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetInstanceFunctionSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetInstanceProcessModuleResponder handles the response to the GetInstanceProcessModule request. The method always +// GetInstanceFunctionSlotResponder handles the response to the GetInstanceFunctionSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetInstanceProcessModuleResponder(resp *http.Response) (result ProcessModuleInfo, err error) { +func (client AppsClient) GetInstanceFunctionSlotResponder(resp *http.Response) (result FunctionEnvelope, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -10545,19 +10554,14 @@ func (client AppsClient) GetInstanceProcessModuleResponder(resp *http.Response) return } -// GetInstanceProcessModuleSlot get process information by its ID for a specific scaled-out instance in a web site. +// GetInstanceMSDeployLog get the MSDeploy Log for the last MSDeploy operation. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - site name. -// processID - pID. -// baseAddress - module base address. -// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the -// production slot. -// instanceID - ID of a specific scaled-out instance. This is the value of the name property in the JSON -// response from "GET api/sites/{siteName}/instances". -func (client AppsClient) GetInstanceProcessModuleSlot(ctx context.Context, resourceGroupName string, name string, processID string, baseAddress string, slot string, instanceID string) (result ProcessModuleInfo, err error) { +// name - name of web app. +// instanceID - ID of web app instance. +func (client AppsClient) GetInstanceMSDeployLog(ctx context.Context, resourceGroupName string, name string, instanceID string) (result MSDeployLog, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceProcessModuleSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceMSDeployLog") defer func() { sc := -1 if result.Response.Response != nil { @@ -10571,39 +10575,36 @@ func (client AppsClient) GetInstanceProcessModuleSlot(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetInstanceProcessModuleSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetInstanceMSDeployLog", err.Error()) } - req, err := client.GetInstanceProcessModuleSlotPreparer(ctx, resourceGroupName, name, processID, baseAddress, slot, instanceID) + req, err := client.GetInstanceMSDeployLogPreparer(ctx, resourceGroupName, name, instanceID) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessModuleSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMSDeployLog", nil, "Failure preparing request") return } - resp, err := client.GetInstanceProcessModuleSlotSender(req) + resp, err := client.GetInstanceMSDeployLogSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessModuleSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMSDeployLog", resp, "Failure sending request") return } - result, err = client.GetInstanceProcessModuleSlotResponder(resp) + result, err = client.GetInstanceMSDeployLogResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessModuleSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMSDeployLog", resp, "Failure responding to request") } return } -// GetInstanceProcessModuleSlotPreparer prepares the GetInstanceProcessModuleSlot request. -func (client AppsClient) GetInstanceProcessModuleSlotPreparer(ctx context.Context, resourceGroupName string, name string, processID string, baseAddress string, slot string, instanceID string) (*http.Request, error) { +// GetInstanceMSDeployLogPreparer prepares the GetInstanceMSDeployLog request. +func (client AppsClient) GetInstanceMSDeployLogPreparer(ctx context.Context, resourceGroupName string, name string, instanceID string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "baseAddress": autorest.Encode("path", baseAddress), "instanceId": autorest.Encode("path", instanceID), "name": autorest.Encode("path", name), - "processId": autorest.Encode("path", processID), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -10615,21 +10616,21 @@ func (client AppsClient) GetInstanceProcessModuleSlotPreparer(ctx context.Contex preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/modules/{baseAddress}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy/log", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetInstanceProcessModuleSlotSender sends the GetInstanceProcessModuleSlot request. The method will close the +// GetInstanceMSDeployLogSender sends the GetInstanceMSDeployLog request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetInstanceProcessModuleSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetInstanceMSDeployLogSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetInstanceProcessModuleSlotResponder handles the response to the GetInstanceProcessModuleSlot request. The method always +// GetInstanceMSDeployLogResponder handles the response to the GetInstanceMSDeployLog request. The method always // closes the http.Response Body. -func (client AppsClient) GetInstanceProcessModuleSlotResponder(resp *http.Response) (result ProcessModuleInfo, err error) { +func (client AppsClient) GetInstanceMSDeployLogResponder(resp *http.Response) (result MSDeployLog, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -10640,18 +10641,15 @@ func (client AppsClient) GetInstanceProcessModuleSlotResponder(resp *http.Respon return } -// GetInstanceProcessSlot get process information by its ID for a specific scaled-out instance in a web site. +// GetInstanceMSDeployLogSlot get the MSDeploy Log for the last MSDeploy operation. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - site name. -// processID - pID. -// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the -// production slot. -// instanceID - ID of a specific scaled-out instance. This is the value of the name property in the JSON -// response from "GET api/sites/{siteName}/instances". -func (client AppsClient) GetInstanceProcessSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string) (result ProcessInfo, err error) { +// name - name of web app. +// slot - name of web app slot. If not specified then will default to production slot. +// instanceID - ID of web app instance. +func (client AppsClient) GetInstanceMSDeployLogSlot(ctx context.Context, resourceGroupName string, name string, slot string, instanceID string) (result MSDeployLog, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceProcessSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceMSDeployLogSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -10665,36 +10663,35 @@ func (client AppsClient) GetInstanceProcessSlot(ctx context.Context, resourceGro Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetInstanceProcessSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetInstanceMSDeployLogSlot", err.Error()) } - req, err := client.GetInstanceProcessSlotPreparer(ctx, resourceGroupName, name, processID, slot, instanceID) + req, err := client.GetInstanceMSDeployLogSlotPreparer(ctx, resourceGroupName, name, slot, instanceID) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMSDeployLogSlot", nil, "Failure preparing request") return } - resp, err := client.GetInstanceProcessSlotSender(req) + resp, err := client.GetInstanceMSDeployLogSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMSDeployLogSlot", resp, "Failure sending request") return } - result, err = client.GetInstanceProcessSlotResponder(resp) + result, err = client.GetInstanceMSDeployLogSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMSDeployLogSlot", resp, "Failure responding to request") } return } -// GetInstanceProcessSlotPreparer prepares the GetInstanceProcessSlot request. -func (client AppsClient) GetInstanceProcessSlotPreparer(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string) (*http.Request, error) { +// GetInstanceMSDeployLogSlotPreparer prepares the GetInstanceMSDeployLogSlot request. +func (client AppsClient) GetInstanceMSDeployLogSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string, instanceID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "instanceId": autorest.Encode("path", instanceID), "name": autorest.Encode("path", name), - "processId": autorest.Encode("path", processID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -10708,21 +10705,21 @@ func (client AppsClient) GetInstanceProcessSlotPreparer(ctx context.Context, res preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy/log", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetInstanceProcessSlotSender sends the GetInstanceProcessSlot request. The method will close the +// GetInstanceMSDeployLogSlotSender sends the GetInstanceMSDeployLogSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetInstanceProcessSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetInstanceMSDeployLogSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetInstanceProcessSlotResponder handles the response to the GetInstanceProcessSlot request. The method always +// GetInstanceMSDeployLogSlotResponder handles the response to the GetInstanceMSDeployLogSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetInstanceProcessSlotResponder(resp *http.Response) (result ProcessInfo, err error) { +func (client AppsClient) GetInstanceMSDeployLogSlotResponder(resp *http.Response) (result MSDeployLog, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -10733,18 +10730,14 @@ func (client AppsClient) GetInstanceProcessSlotResponder(resp *http.Response) (r return } -// GetInstanceProcessThread get thread information by Thread ID for a specific process, in a specific scaled-out -// instance in a web site. +// GetInstanceMsDeployStatus get the status of the last MSDeploy operation. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - site name. -// processID - pID. -// threadID - tID. -// instanceID - ID of a specific scaled-out instance. This is the value of the name property in the JSON -// response from "GET api/sites/{siteName}/instances". -func (client AppsClient) GetInstanceProcessThread(ctx context.Context, resourceGroupName string, name string, processID string, threadID string, instanceID string) (result ProcessThreadInfo, err error) { +// name - name of web app. +// instanceID - ID of web app instance. +func (client AppsClient) GetInstanceMsDeployStatus(ctx context.Context, resourceGroupName string, name string, instanceID string) (result MSDeployStatus, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceProcessThread") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceMsDeployStatus") defer func() { sc := -1 if result.Response.Response != nil { @@ -10758,39 +10751,37 @@ func (client AppsClient) GetInstanceProcessThread(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetInstanceProcessThread", err.Error()) + return result, validation.NewError("web.AppsClient", "GetInstanceMsDeployStatus", err.Error()) } - req, err := client.GetInstanceProcessThreadPreparer(ctx, resourceGroupName, name, processID, threadID, instanceID) + req, err := client.GetInstanceMsDeployStatusPreparer(ctx, resourceGroupName, name, instanceID) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessThread", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMsDeployStatus", nil, "Failure preparing request") return } - resp, err := client.GetInstanceProcessThreadSender(req) + resp, err := client.GetInstanceMsDeployStatusSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessThread", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMsDeployStatus", resp, "Failure sending request") return } - result, err = client.GetInstanceProcessThreadResponder(resp) + result, err = client.GetInstanceMsDeployStatusResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessThread", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMsDeployStatus", resp, "Failure responding to request") } return } -// GetInstanceProcessThreadPreparer prepares the GetInstanceProcessThread request. -func (client AppsClient) GetInstanceProcessThreadPreparer(ctx context.Context, resourceGroupName string, name string, processID string, threadID string, instanceID string) (*http.Request, error) { +// GetInstanceMsDeployStatusPreparer prepares the GetInstanceMsDeployStatus request. +func (client AppsClient) GetInstanceMsDeployStatusPreparer(ctx context.Context, resourceGroupName string, name string, instanceID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "instanceId": autorest.Encode("path", instanceID), "name": autorest.Encode("path", name), - "processId": autorest.Encode("path", processID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "threadId": autorest.Encode("path", threadID), } const APIVersion = "2018-02-01" @@ -10801,45 +10792,40 @@ func (client AppsClient) GetInstanceProcessThreadPreparer(ctx context.Context, r preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/threads/{threadId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetInstanceProcessThreadSender sends the GetInstanceProcessThread request. The method will close the +// GetInstanceMsDeployStatusSender sends the GetInstanceMsDeployStatus request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetInstanceProcessThreadSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetInstanceMsDeployStatusSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetInstanceProcessThreadResponder handles the response to the GetInstanceProcessThread request. The method always +// GetInstanceMsDeployStatusResponder handles the response to the GetInstanceMsDeployStatus request. The method always // closes the http.Response Body. -func (client AppsClient) GetInstanceProcessThreadResponder(resp *http.Response) (result ProcessThreadInfo, err error) { +func (client AppsClient) GetInstanceMsDeployStatusResponder(resp *http.Response) (result MSDeployStatus, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetInstanceProcessThreadSlot get thread information by Thread ID for a specific process, in a specific scaled-out -// instance in a web site. +// GetInstanceMsDeployStatusSlot get the status of the last MSDeploy operation. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - site name. -// processID - pID. -// threadID - tID. -// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the -// production slot. -// instanceID - ID of a specific scaled-out instance. This is the value of the name property in the JSON -// response from "GET api/sites/{siteName}/instances". -func (client AppsClient) GetInstanceProcessThreadSlot(ctx context.Context, resourceGroupName string, name string, processID string, threadID string, slot string, instanceID string) (result ProcessThreadInfo, err error) { +// name - name of web app. +// slot - name of web app slot. If not specified then will default to production slot. +// instanceID - ID of web app instance. +func (client AppsClient) GetInstanceMsDeployStatusSlot(ctx context.Context, resourceGroupName string, name string, slot string, instanceID string) (result MSDeployStatus, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceProcessThreadSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceMsDeployStatusSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -10853,40 +10839,38 @@ func (client AppsClient) GetInstanceProcessThreadSlot(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetInstanceProcessThreadSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetInstanceMsDeployStatusSlot", err.Error()) } - req, err := client.GetInstanceProcessThreadSlotPreparer(ctx, resourceGroupName, name, processID, threadID, slot, instanceID) + req, err := client.GetInstanceMsDeployStatusSlotPreparer(ctx, resourceGroupName, name, slot, instanceID) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessThreadSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMsDeployStatusSlot", nil, "Failure preparing request") return } - resp, err := client.GetInstanceProcessThreadSlotSender(req) + resp, err := client.GetInstanceMsDeployStatusSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessThreadSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMsDeployStatusSlot", resp, "Failure sending request") return } - result, err = client.GetInstanceProcessThreadSlotResponder(resp) + result, err = client.GetInstanceMsDeployStatusSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessThreadSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMsDeployStatusSlot", resp, "Failure responding to request") } return } -// GetInstanceProcessThreadSlotPreparer prepares the GetInstanceProcessThreadSlot request. -func (client AppsClient) GetInstanceProcessThreadSlotPreparer(ctx context.Context, resourceGroupName string, name string, processID string, threadID string, slot string, instanceID string) (*http.Request, error) { +// GetInstanceMsDeployStatusSlotPreparer prepares the GetInstanceMsDeployStatusSlot request. +func (client AppsClient) GetInstanceMsDeployStatusSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string, instanceID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "instanceId": autorest.Encode("path", instanceID), "name": autorest.Encode("path", name), - "processId": autorest.Encode("path", processID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "threadId": autorest.Encode("path", threadID), } const APIVersion = "2018-02-01" @@ -10897,39 +10881,41 @@ func (client AppsClient) GetInstanceProcessThreadSlotPreparer(ctx context.Contex preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/threads/{threadId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetInstanceProcessThreadSlotSender sends the GetInstanceProcessThreadSlot request. The method will close the +// GetInstanceMsDeployStatusSlotSender sends the GetInstanceMsDeployStatusSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetInstanceProcessThreadSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetInstanceMsDeployStatusSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetInstanceProcessThreadSlotResponder handles the response to the GetInstanceProcessThreadSlot request. The method always +// GetInstanceMsDeployStatusSlotResponder handles the response to the GetInstanceMsDeployStatusSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetInstanceProcessThreadSlotResponder(resp *http.Response) (result ProcessThreadInfo, err error) { +func (client AppsClient) GetInstanceMsDeployStatusSlotResponder(resp *http.Response) (result MSDeployStatus, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetMigrateMySQLStatus returns the status of MySql in app migration, if one is active, and whether or not MySql in -// app is enabled +// GetInstanceProcess get process information by its ID for a specific scaled-out instance in a web site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of web app. -func (client AppsClient) GetMigrateMySQLStatus(ctx context.Context, resourceGroupName string, name string) (result MigrateMySQLStatus, err error) { +// name - site name. +// processID - pID. +// instanceID - ID of a specific scaled-out instance. This is the value of the name property in the JSON +// response from "GET api/sites/{siteName}/instances". +func (client AppsClient) GetInstanceProcess(ctx context.Context, resourceGroupName string, name string, processID string, instanceID string) (result ProcessInfo, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetMigrateMySQLStatus") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceProcess") defer func() { sc := -1 if result.Response.Response != nil { @@ -10943,34 +10929,36 @@ func (client AppsClient) GetMigrateMySQLStatus(ctx context.Context, resourceGrou Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetMigrateMySQLStatus", err.Error()) + return result, validation.NewError("web.AppsClient", "GetInstanceProcess", err.Error()) } - req, err := client.GetMigrateMySQLStatusPreparer(ctx, resourceGroupName, name) + req, err := client.GetInstanceProcessPreparer(ctx, resourceGroupName, name, processID, instanceID) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMigrateMySQLStatus", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcess", nil, "Failure preparing request") return } - resp, err := client.GetMigrateMySQLStatusSender(req) + resp, err := client.GetInstanceProcessSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMigrateMySQLStatus", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcess", resp, "Failure sending request") return } - result, err = client.GetMigrateMySQLStatusResponder(resp) + result, err = client.GetInstanceProcessResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMigrateMySQLStatus", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcess", resp, "Failure responding to request") } return } -// GetMigrateMySQLStatusPreparer prepares the GetMigrateMySQLStatus request. -func (client AppsClient) GetMigrateMySQLStatusPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { +// GetInstanceProcessPreparer prepares the GetInstanceProcess request. +func (client AppsClient) GetInstanceProcessPreparer(ctx context.Context, resourceGroupName string, name string, processID string, instanceID string) (*http.Request, error) { pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), "name": autorest.Encode("path", name), + "processId": autorest.Encode("path", processID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -10983,40 +10971,41 @@ func (client AppsClient) GetMigrateMySQLStatusPreparer(ctx context.Context, reso preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql/status", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetMigrateMySQLStatusSender sends the GetMigrateMySQLStatus request. The method will close the +// GetInstanceProcessSender sends the GetInstanceProcess request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetMigrateMySQLStatusSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetInstanceProcessSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetMigrateMySQLStatusResponder handles the response to the GetMigrateMySQLStatus request. The method always +// GetInstanceProcessResponder handles the response to the GetInstanceProcess request. The method always // closes the http.Response Body. -func (client AppsClient) GetMigrateMySQLStatusResponder(resp *http.Response) (result MigrateMySQLStatus, err error) { +func (client AppsClient) GetInstanceProcessResponder(resp *http.Response) (result ProcessInfo, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetMigrateMySQLStatusSlot returns the status of MySql in app migration, if one is active, and whether or not MySql -// in app is enabled +// GetInstanceProcessDump get a memory dump of a process by its ID for a specific scaled-out instance in a web site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of web app. -// slot - name of the deployment slot. -func (client AppsClient) GetMigrateMySQLStatusSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result MigrateMySQLStatus, err error) { +// name - site name. +// processID - pID. +// instanceID - ID of a specific scaled-out instance. This is the value of the name property in the JSON +// response from "GET api/sites/{siteName}/instances". +func (client AppsClient) GetInstanceProcessDump(ctx context.Context, resourceGroupName string, name string, processID string, instanceID string) (result ReadCloser, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetMigrateMySQLStatusSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceProcessDump") defer func() { sc := -1 if result.Response.Response != nil { @@ -11030,36 +11019,37 @@ func (client AppsClient) GetMigrateMySQLStatusSlot(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetMigrateMySQLStatusSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetInstanceProcessDump", err.Error()) } - req, err := client.GetMigrateMySQLStatusSlotPreparer(ctx, resourceGroupName, name, slot) + req, err := client.GetInstanceProcessDumpPreparer(ctx, resourceGroupName, name, processID, instanceID) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMigrateMySQLStatusSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessDump", nil, "Failure preparing request") return } - resp, err := client.GetMigrateMySQLStatusSlotSender(req) + resp, err := client.GetInstanceProcessDumpSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMigrateMySQLStatusSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessDump", resp, "Failure sending request") return } - result, err = client.GetMigrateMySQLStatusSlotResponder(resp) + result, err = client.GetInstanceProcessDumpResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMigrateMySQLStatusSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessDump", resp, "Failure responding to request") } return } -// GetMigrateMySQLStatusSlotPreparer prepares the GetMigrateMySQLStatusSlot request. -func (client AppsClient) GetMigrateMySQLStatusSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { +// GetInstanceProcessDumpPreparer prepares the GetInstanceProcessDump request. +func (client AppsClient) GetInstanceProcessDumpPreparer(ctx context.Context, resourceGroupName string, name string, processID string, instanceID string) (*http.Request, error) { pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), "name": autorest.Encode("path", name), + "processId": autorest.Encode("path", processID), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -11071,38 +11061,43 @@ func (client AppsClient) GetMigrateMySQLStatusSlotPreparer(ctx context.Context, preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/migratemysql/status", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/dump", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetMigrateMySQLStatusSlotSender sends the GetMigrateMySQLStatusSlot request. The method will close the +// GetInstanceProcessDumpSender sends the GetInstanceProcessDump request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetMigrateMySQLStatusSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetInstanceProcessDumpSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetMigrateMySQLStatusSlotResponder handles the response to the GetMigrateMySQLStatusSlot request. The method always +// GetInstanceProcessDumpResponder handles the response to the GetInstanceProcessDump request. The method always // closes the http.Response Body. -func (client AppsClient) GetMigrateMySQLStatusSlotResponder(resp *http.Response) (result MigrateMySQLStatus, err error) { +func (client AppsClient) GetInstanceProcessDumpResponder(resp *http.Response) (result ReadCloser, err error) { + result.Value = &resp.Body err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound)) result.Response = autorest.Response{Response: resp} return } -// GetMSDeployLog get the MSDeploy Log for the last MSDeploy operation. +// GetInstanceProcessDumpSlot get a memory dump of a process by its ID for a specific scaled-out instance in a web +// site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of web app. -func (client AppsClient) GetMSDeployLog(ctx context.Context, resourceGroupName string, name string) (result MSDeployLog, err error) { +// name - site name. +// processID - pID. +// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the +// production slot. +// instanceID - ID of a specific scaled-out instance. This is the value of the name property in the JSON +// response from "GET api/sites/{siteName}/instances". +func (client AppsClient) GetInstanceProcessDumpSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string) (result ReadCloser, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetMSDeployLog") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceProcessDumpSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -11116,35 +11111,38 @@ func (client AppsClient) GetMSDeployLog(ctx context.Context, resourceGroupName s Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetMSDeployLog", err.Error()) + return result, validation.NewError("web.AppsClient", "GetInstanceProcessDumpSlot", err.Error()) } - req, err := client.GetMSDeployLogPreparer(ctx, resourceGroupName, name) + req, err := client.GetInstanceProcessDumpSlotPreparer(ctx, resourceGroupName, name, processID, slot, instanceID) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMSDeployLog", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessDumpSlot", nil, "Failure preparing request") return } - resp, err := client.GetMSDeployLogSender(req) + resp, err := client.GetInstanceProcessDumpSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMSDeployLog", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessDumpSlot", resp, "Failure sending request") return } - result, err = client.GetMSDeployLogResponder(resp) + result, err = client.GetInstanceProcessDumpSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMSDeployLog", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessDumpSlot", resp, "Failure responding to request") } return } -// GetMSDeployLogPreparer prepares the GetMSDeployLog request. -func (client AppsClient) GetMSDeployLogPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { +// GetInstanceProcessDumpSlotPreparer prepares the GetInstanceProcessDumpSlot request. +func (client AppsClient) GetInstanceProcessDumpSlotPreparer(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string) (*http.Request, error) { pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), "name": autorest.Encode("path", name), + "processId": autorest.Encode("path", processID), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -11156,39 +11154,41 @@ func (client AppsClient) GetMSDeployLogPreparer(ctx context.Context, resourceGro preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy/log", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/dump", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetMSDeployLogSender sends the GetMSDeployLog request. The method will close the +// GetInstanceProcessDumpSlotSender sends the GetInstanceProcessDumpSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetMSDeployLogSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetInstanceProcessDumpSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetMSDeployLogResponder handles the response to the GetMSDeployLog request. The method always +// GetInstanceProcessDumpSlotResponder handles the response to the GetInstanceProcessDumpSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetMSDeployLogResponder(resp *http.Response) (result MSDeployLog, err error) { +func (client AppsClient) GetInstanceProcessDumpSlotResponder(resp *http.Response) (result ReadCloser, err error) { + result.Value = &resp.Body err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound)) result.Response = autorest.Response{Response: resp} return } -// GetMSDeployLogSlot get the MSDeploy Log for the last MSDeploy operation. +// GetInstanceProcessModule get process information by its ID for a specific scaled-out instance in a web site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of web app. -// slot - name of web app slot. If not specified then will default to production slot. -func (client AppsClient) GetMSDeployLogSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result MSDeployLog, err error) { +// name - site name. +// processID - pID. +// baseAddress - module base address. +// instanceID - ID of a specific scaled-out instance. This is the value of the name property in the JSON +// response from "GET api/sites/{siteName}/instances". +func (client AppsClient) GetInstanceProcessModule(ctx context.Context, resourceGroupName string, name string, processID string, baseAddress string, instanceID string) (result ProcessModuleInfo, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetMSDeployLogSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceProcessModule") defer func() { sc := -1 if result.Response.Response != nil { @@ -11202,36 +11202,38 @@ func (client AppsClient) GetMSDeployLogSlot(ctx context.Context, resourceGroupNa Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetMSDeployLogSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetInstanceProcessModule", err.Error()) } - req, err := client.GetMSDeployLogSlotPreparer(ctx, resourceGroupName, name, slot) + req, err := client.GetInstanceProcessModulePreparer(ctx, resourceGroupName, name, processID, baseAddress, instanceID) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMSDeployLogSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessModule", nil, "Failure preparing request") return } - resp, err := client.GetMSDeployLogSlotSender(req) + resp, err := client.GetInstanceProcessModuleSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMSDeployLogSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessModule", resp, "Failure sending request") return } - result, err = client.GetMSDeployLogSlotResponder(resp) + result, err = client.GetInstanceProcessModuleResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMSDeployLogSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessModule", resp, "Failure responding to request") } return } -// GetMSDeployLogSlotPreparer prepares the GetMSDeployLogSlot request. -func (client AppsClient) GetMSDeployLogSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { +// GetInstanceProcessModulePreparer prepares the GetInstanceProcessModule request. +func (client AppsClient) GetInstanceProcessModulePreparer(ctx context.Context, resourceGroupName string, name string, processID string, baseAddress string, instanceID string) (*http.Request, error) { pathParameters := map[string]interface{}{ + "baseAddress": autorest.Encode("path", baseAddress), + "instanceId": autorest.Encode("path", instanceID), "name": autorest.Encode("path", name), + "processId": autorest.Encode("path", processID), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -11243,21 +11245,21 @@ func (client AppsClient) GetMSDeployLogSlotPreparer(ctx context.Context, resourc preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy/log", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/modules/{baseAddress}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetMSDeployLogSlotSender sends the GetMSDeployLogSlot request. The method will close the +// GetInstanceProcessModuleSender sends the GetInstanceProcessModule request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetMSDeployLogSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetInstanceProcessModuleSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetMSDeployLogSlotResponder handles the response to the GetMSDeployLogSlot request. The method always +// GetInstanceProcessModuleResponder handles the response to the GetInstanceProcessModule request. The method always // closes the http.Response Body. -func (client AppsClient) GetMSDeployLogSlotResponder(resp *http.Response) (result MSDeployLog, err error) { +func (client AppsClient) GetInstanceProcessModuleResponder(resp *http.Response) (result ProcessModuleInfo, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -11268,13 +11270,19 @@ func (client AppsClient) GetMSDeployLogSlotResponder(resp *http.Response) (resul return } -// GetMSDeployStatus get the status of the last MSDeploy operation. +// GetInstanceProcessModuleSlot get process information by its ID for a specific scaled-out instance in a web site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of web app. -func (client AppsClient) GetMSDeployStatus(ctx context.Context, resourceGroupName string, name string) (result MSDeployStatus, err error) { +// name - site name. +// processID - pID. +// baseAddress - module base address. +// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the +// production slot. +// instanceID - ID of a specific scaled-out instance. This is the value of the name property in the JSON +// response from "GET api/sites/{siteName}/instances". +func (client AppsClient) GetInstanceProcessModuleSlot(ctx context.Context, resourceGroupName string, name string, processID string, baseAddress string, slot string, instanceID string) (result ProcessModuleInfo, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetMSDeployStatus") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceProcessModuleSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -11288,35 +11296,39 @@ func (client AppsClient) GetMSDeployStatus(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetMSDeployStatus", err.Error()) + return result, validation.NewError("web.AppsClient", "GetInstanceProcessModuleSlot", err.Error()) } - req, err := client.GetMSDeployStatusPreparer(ctx, resourceGroupName, name) + req, err := client.GetInstanceProcessModuleSlotPreparer(ctx, resourceGroupName, name, processID, baseAddress, slot, instanceID) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMSDeployStatus", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessModuleSlot", nil, "Failure preparing request") return } - resp, err := client.GetMSDeployStatusSender(req) + resp, err := client.GetInstanceProcessModuleSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMSDeployStatus", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessModuleSlot", resp, "Failure sending request") return } - result, err = client.GetMSDeployStatusResponder(resp) + result, err = client.GetInstanceProcessModuleSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMSDeployStatus", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessModuleSlot", resp, "Failure responding to request") } return } -// GetMSDeployStatusPreparer prepares the GetMSDeployStatus request. -func (client AppsClient) GetMSDeployStatusPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { +// GetInstanceProcessModuleSlotPreparer prepares the GetInstanceProcessModuleSlot request. +func (client AppsClient) GetInstanceProcessModuleSlotPreparer(ctx context.Context, resourceGroupName string, name string, processID string, baseAddress string, slot string, instanceID string) (*http.Request, error) { pathParameters := map[string]interface{}{ + "baseAddress": autorest.Encode("path", baseAddress), + "instanceId": autorest.Encode("path", instanceID), "name": autorest.Encode("path", name), + "processId": autorest.Encode("path", processID), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -11328,39 +11340,43 @@ func (client AppsClient) GetMSDeployStatusPreparer(ctx context.Context, resource preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/modules/{baseAddress}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetMSDeployStatusSender sends the GetMSDeployStatus request. The method will close the +// GetInstanceProcessModuleSlotSender sends the GetInstanceProcessModuleSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetMSDeployStatusSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetInstanceProcessModuleSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetMSDeployStatusResponder handles the response to the GetMSDeployStatus request. The method always +// GetInstanceProcessModuleSlotResponder handles the response to the GetInstanceProcessModuleSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetMSDeployStatusResponder(resp *http.Response) (result MSDeployStatus, err error) { +func (client AppsClient) GetInstanceProcessModuleSlotResponder(resp *http.Response) (result ProcessModuleInfo, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetMSDeployStatusSlot get the status of the last MSDeploy operation. +// GetInstanceProcessSlot get process information by its ID for a specific scaled-out instance in a web site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of web app. -// slot - name of web app slot. If not specified then will default to production slot. -func (client AppsClient) GetMSDeployStatusSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result MSDeployStatus, err error) { +// name - site name. +// processID - pID. +// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the +// production slot. +// instanceID - ID of a specific scaled-out instance. This is the value of the name property in the JSON +// response from "GET api/sites/{siteName}/instances". +func (client AppsClient) GetInstanceProcessSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string) (result ProcessInfo, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetMSDeployStatusSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceProcessSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -11374,34 +11390,36 @@ func (client AppsClient) GetMSDeployStatusSlot(ctx context.Context, resourceGrou Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetMSDeployStatusSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetInstanceProcessSlot", err.Error()) } - req, err := client.GetMSDeployStatusSlotPreparer(ctx, resourceGroupName, name, slot) + req, err := client.GetInstanceProcessSlotPreparer(ctx, resourceGroupName, name, processID, slot, instanceID) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMSDeployStatusSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessSlot", nil, "Failure preparing request") return } - resp, err := client.GetMSDeployStatusSlotSender(req) + resp, err := client.GetInstanceProcessSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMSDeployStatusSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessSlot", resp, "Failure sending request") return } - result, err = client.GetMSDeployStatusSlotResponder(resp) + result, err = client.GetInstanceProcessSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMSDeployStatusSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessSlot", resp, "Failure responding to request") } return } -// GetMSDeployStatusSlotPreparer prepares the GetMSDeployStatusSlot request. -func (client AppsClient) GetMSDeployStatusSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { +// GetInstanceProcessSlotPreparer prepares the GetInstanceProcessSlot request. +func (client AppsClient) GetInstanceProcessSlotPreparer(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string) (*http.Request, error) { pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), "name": autorest.Encode("path", name), + "processId": autorest.Encode("path", processID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -11415,39 +11433,43 @@ func (client AppsClient) GetMSDeployStatusSlotPreparer(ctx context.Context, reso preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetMSDeployStatusSlotSender sends the GetMSDeployStatusSlot request. The method will close the +// GetInstanceProcessSlotSender sends the GetInstanceProcessSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetMSDeployStatusSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetInstanceProcessSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetMSDeployStatusSlotResponder handles the response to the GetMSDeployStatusSlot request. The method always +// GetInstanceProcessSlotResponder handles the response to the GetInstanceProcessSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetMSDeployStatusSlotResponder(resp *http.Response) (result MSDeployStatus, err error) { +func (client AppsClient) GetInstanceProcessSlotResponder(resp *http.Response) (result ProcessInfo, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetNetworkTraceOperation gets a named operation for a network trace capturing (or deployment slot, if specified). +// GetInstanceProcessThread get thread information by Thread ID for a specific process, in a specific scaled-out +// instance in a web site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -// operationID - GUID of the operation. -func (client AppsClient) GetNetworkTraceOperation(ctx context.Context, resourceGroupName string, name string, operationID string) (result ListNetworkTrace, err error) { +// name - site name. +// processID - pID. +// threadID - tID. +// instanceID - ID of a specific scaled-out instance. This is the value of the name property in the JSON +// response from "GET api/sites/{siteName}/instances". +func (client AppsClient) GetInstanceProcessThread(ctx context.Context, resourceGroupName string, name string, processID string, threadID string, instanceID string) (result ProcessThreadInfo, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetNetworkTraceOperation") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceProcessThread") defer func() { sc := -1 if result.Response.Response != nil { @@ -11461,37 +11483,39 @@ func (client AppsClient) GetNetworkTraceOperation(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetNetworkTraceOperation", err.Error()) + return result, validation.NewError("web.AppsClient", "GetInstanceProcessThread", err.Error()) } - req, err := client.GetNetworkTraceOperationPreparer(ctx, resourceGroupName, name, operationID) + req, err := client.GetInstanceProcessThreadPreparer(ctx, resourceGroupName, name, processID, threadID, instanceID) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraceOperation", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessThread", nil, "Failure preparing request") return } - resp, err := client.GetNetworkTraceOperationSender(req) + resp, err := client.GetInstanceProcessThreadSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraceOperation", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessThread", resp, "Failure sending request") return } - result, err = client.GetNetworkTraceOperationResponder(resp) + result, err = client.GetInstanceProcessThreadResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraceOperation", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessThread", resp, "Failure responding to request") } return } -// GetNetworkTraceOperationPreparer prepares the GetNetworkTraceOperation request. -func (client AppsClient) GetNetworkTraceOperationPreparer(ctx context.Context, resourceGroupName string, name string, operationID string) (*http.Request, error) { +// GetInstanceProcessThreadPreparer prepares the GetInstanceProcessThread request. +func (client AppsClient) GetInstanceProcessThreadPreparer(ctx context.Context, resourceGroupName string, name string, processID string, threadID string, instanceID string) (*http.Request, error) { pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), "name": autorest.Encode("path", name), - "operationId": autorest.Encode("path", operationID), + "processId": autorest.Encode("path", processID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "threadId": autorest.Encode("path", threadID), } const APIVersion = "2018-02-01" @@ -11502,42 +11526,45 @@ func (client AppsClient) GetNetworkTraceOperationPreparer(ctx context.Context, r preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/operationresults/{operationId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/threads/{threadId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetNetworkTraceOperationSender sends the GetNetworkTraceOperation request. The method will close the +// GetInstanceProcessThreadSender sends the GetInstanceProcessThread request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetNetworkTraceOperationSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetInstanceProcessThreadSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetNetworkTraceOperationResponder handles the response to the GetNetworkTraceOperation request. The method always +// GetInstanceProcessThreadResponder handles the response to the GetInstanceProcessThread request. The method always // closes the http.Response Body. -func (client AppsClient) GetNetworkTraceOperationResponder(resp *http.Response) (result ListNetworkTrace, err error) { +func (client AppsClient) GetInstanceProcessThreadResponder(resp *http.Response) (result ProcessThreadInfo, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result.Value), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetNetworkTraceOperationSlot gets a named operation for a network trace capturing (or deployment slot, if -// specified). +// GetInstanceProcessThreadSlot get thread information by Thread ID for a specific process, in a specific scaled-out +// instance in a web site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -// operationID - GUID of the operation. -// slot - name of the deployment slot. If a slot is not specified, the API will get an operation for the +// name - site name. +// processID - pID. +// threadID - tID. +// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the // production slot. -func (client AppsClient) GetNetworkTraceOperationSlot(ctx context.Context, resourceGroupName string, name string, operationID string, slot string) (result ListNetworkTrace, err error) { +// instanceID - ID of a specific scaled-out instance. This is the value of the name property in the JSON +// response from "GET api/sites/{siteName}/instances". +func (client AppsClient) GetInstanceProcessThreadSlot(ctx context.Context, resourceGroupName string, name string, processID string, threadID string, slot string, instanceID string) (result ProcessThreadInfo, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetNetworkTraceOperationSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceProcessThreadSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -11551,38 +11578,40 @@ func (client AppsClient) GetNetworkTraceOperationSlot(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetNetworkTraceOperationSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetInstanceProcessThreadSlot", err.Error()) } - req, err := client.GetNetworkTraceOperationSlotPreparer(ctx, resourceGroupName, name, operationID, slot) + req, err := client.GetInstanceProcessThreadSlotPreparer(ctx, resourceGroupName, name, processID, threadID, slot, instanceID) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraceOperationSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessThreadSlot", nil, "Failure preparing request") return } - resp, err := client.GetNetworkTraceOperationSlotSender(req) + resp, err := client.GetInstanceProcessThreadSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraceOperationSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessThreadSlot", resp, "Failure sending request") return } - result, err = client.GetNetworkTraceOperationSlotResponder(resp) + result, err = client.GetInstanceProcessThreadSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraceOperationSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessThreadSlot", resp, "Failure responding to request") } return } -// GetNetworkTraceOperationSlotPreparer prepares the GetNetworkTraceOperationSlot request. -func (client AppsClient) GetNetworkTraceOperationSlotPreparer(ctx context.Context, resourceGroupName string, name string, operationID string, slot string) (*http.Request, error) { +// GetInstanceProcessThreadSlotPreparer prepares the GetInstanceProcessThreadSlot request. +func (client AppsClient) GetInstanceProcessThreadSlotPreparer(ctx context.Context, resourceGroupName string, name string, processID string, threadID string, slot string, instanceID string) (*http.Request, error) { pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), "name": autorest.Encode("path", name), - "operationId": autorest.Encode("path", operationID), + "processId": autorest.Encode("path", processID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "threadId": autorest.Encode("path", threadID), } const APIVersion = "2018-02-01" @@ -11593,42 +11622,39 @@ func (client AppsClient) GetNetworkTraceOperationSlotPreparer(ctx context.Contex preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/operationresults/{operationId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/threads/{threadId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetNetworkTraceOperationSlotSender sends the GetNetworkTraceOperationSlot request. The method will close the +// GetInstanceProcessThreadSlotSender sends the GetInstanceProcessThreadSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetNetworkTraceOperationSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetInstanceProcessThreadSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetNetworkTraceOperationSlotResponder handles the response to the GetNetworkTraceOperationSlot request. The method always +// GetInstanceProcessThreadSlotResponder handles the response to the GetInstanceProcessThreadSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetNetworkTraceOperationSlotResponder(resp *http.Response) (result ListNetworkTrace, err error) { +func (client AppsClient) GetInstanceProcessThreadSlotResponder(resp *http.Response) (result ProcessThreadInfo, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result.Value), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetNetworkTraceOperationSlotV2 gets a named operation for a network trace capturing (or deployment slot, if -// specified). +// GetMigrateMySQLStatus returns the status of MySql in app migration, if one is active, and whether or not MySql in +// app is enabled // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -// operationID - GUID of the operation. -// slot - name of the deployment slot. If a slot is not specified, the API will get an operation for the -// production slot. -func (client AppsClient) GetNetworkTraceOperationSlotV2(ctx context.Context, resourceGroupName string, name string, operationID string, slot string) (result ListNetworkTrace, err error) { +// name - name of web app. +func (client AppsClient) GetMigrateMySQLStatus(ctx context.Context, resourceGroupName string, name string) (result MigrateMySQLStatus, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetNetworkTraceOperationSlotV2") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetMigrateMySQLStatus") defer func() { sc := -1 if result.Response.Response != nil { @@ -11642,37 +11668,35 @@ func (client AppsClient) GetNetworkTraceOperationSlotV2(ctx context.Context, res Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetNetworkTraceOperationSlotV2", err.Error()) + return result, validation.NewError("web.AppsClient", "GetMigrateMySQLStatus", err.Error()) } - req, err := client.GetNetworkTraceOperationSlotV2Preparer(ctx, resourceGroupName, name, operationID, slot) + req, err := client.GetMigrateMySQLStatusPreparer(ctx, resourceGroupName, name) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraceOperationSlotV2", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMigrateMySQLStatus", nil, "Failure preparing request") return } - resp, err := client.GetNetworkTraceOperationSlotV2Sender(req) + resp, err := client.GetMigrateMySQLStatusSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraceOperationSlotV2", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMigrateMySQLStatus", resp, "Failure sending request") return } - result, err = client.GetNetworkTraceOperationSlotV2Responder(resp) + result, err = client.GetMigrateMySQLStatusResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraceOperationSlotV2", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMigrateMySQLStatus", resp, "Failure responding to request") } return } -// GetNetworkTraceOperationSlotV2Preparer prepares the GetNetworkTraceOperationSlotV2 request. -func (client AppsClient) GetNetworkTraceOperationSlotV2Preparer(ctx context.Context, resourceGroupName string, name string, operationID string, slot string) (*http.Request, error) { +// GetMigrateMySQLStatusPreparer prepares the GetMigrateMySQLStatus request. +func (client AppsClient) GetMigrateMySQLStatusPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), - "operationId": autorest.Encode("path", operationID), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -11684,39 +11708,40 @@ func (client AppsClient) GetNetworkTraceOperationSlotV2Preparer(ctx context.Cont preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTraces/current/operationresults/{operationId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql/status", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetNetworkTraceOperationSlotV2Sender sends the GetNetworkTraceOperationSlotV2 request. The method will close the +// GetMigrateMySQLStatusSender sends the GetMigrateMySQLStatus request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetNetworkTraceOperationSlotV2Sender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetMigrateMySQLStatusSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetNetworkTraceOperationSlotV2Responder handles the response to the GetNetworkTraceOperationSlotV2 request. The method always +// GetMigrateMySQLStatusResponder handles the response to the GetMigrateMySQLStatus request. The method always // closes the http.Response Body. -func (client AppsClient) GetNetworkTraceOperationSlotV2Responder(resp *http.Response) (result ListNetworkTrace, err error) { +func (client AppsClient) GetMigrateMySQLStatusResponder(resp *http.Response) (result MigrateMySQLStatus, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result.Value), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetNetworkTraceOperationV2 gets a named operation for a network trace capturing (or deployment slot, if specified). +// GetMigrateMySQLStatusSlot returns the status of MySql in app migration, if one is active, and whether or not MySql +// in app is enabled // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -// operationID - GUID of the operation. -func (client AppsClient) GetNetworkTraceOperationV2(ctx context.Context, resourceGroupName string, name string, operationID string) (result ListNetworkTrace, err error) { +// name - name of web app. +// slot - name of the deployment slot. +func (client AppsClient) GetMigrateMySQLStatusSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result MigrateMySQLStatus, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetNetworkTraceOperationV2") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetMigrateMySQLStatusSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -11730,36 +11755,36 @@ func (client AppsClient) GetNetworkTraceOperationV2(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetNetworkTraceOperationV2", err.Error()) + return result, validation.NewError("web.AppsClient", "GetMigrateMySQLStatusSlot", err.Error()) } - req, err := client.GetNetworkTraceOperationV2Preparer(ctx, resourceGroupName, name, operationID) + req, err := client.GetMigrateMySQLStatusSlotPreparer(ctx, resourceGroupName, name, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraceOperationV2", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMigrateMySQLStatusSlot", nil, "Failure preparing request") return } - resp, err := client.GetNetworkTraceOperationV2Sender(req) + resp, err := client.GetMigrateMySQLStatusSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraceOperationV2", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMigrateMySQLStatusSlot", resp, "Failure sending request") return } - result, err = client.GetNetworkTraceOperationV2Responder(resp) + result, err = client.GetMigrateMySQLStatusSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraceOperationV2", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMigrateMySQLStatusSlot", resp, "Failure responding to request") } return } -// GetNetworkTraceOperationV2Preparer prepares the GetNetworkTraceOperationV2 request. -func (client AppsClient) GetNetworkTraceOperationV2Preparer(ctx context.Context, resourceGroupName string, name string, operationID string) (*http.Request, error) { +// GetMigrateMySQLStatusSlotPreparer prepares the GetMigrateMySQLStatusSlot request. +func (client AppsClient) GetMigrateMySQLStatusSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), - "operationId": autorest.Encode("path", operationID), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -11771,39 +11796,38 @@ func (client AppsClient) GetNetworkTraceOperationV2Preparer(ctx context.Context, preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/current/operationresults/{operationId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/migratemysql/status", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetNetworkTraceOperationV2Sender sends the GetNetworkTraceOperationV2 request. The method will close the +// GetMigrateMySQLStatusSlotSender sends the GetMigrateMySQLStatusSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetNetworkTraceOperationV2Sender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetMigrateMySQLStatusSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetNetworkTraceOperationV2Responder handles the response to the GetNetworkTraceOperationV2 request. The method always +// GetMigrateMySQLStatusSlotResponder handles the response to the GetMigrateMySQLStatusSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetNetworkTraceOperationV2Responder(resp *http.Response) (result ListNetworkTrace, err error) { +func (client AppsClient) GetMigrateMySQLStatusSlotResponder(resp *http.Response) (result MigrateMySQLStatus, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result.Value), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetNetworkTraces gets a named operation for a network trace capturing (or deployment slot, if specified). +// GetMSDeployLog get the MSDeploy Log for the last MSDeploy operation. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -// operationID - GUID of the operation. -func (client AppsClient) GetNetworkTraces(ctx context.Context, resourceGroupName string, name string, operationID string) (result ListNetworkTrace, err error) { +// name - name of web app. +func (client AppsClient) GetMSDeployLog(ctx context.Context, resourceGroupName string, name string) (result MSDeployLog, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetNetworkTraces") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetMSDeployLog") defer func() { sc := -1 if result.Response.Response != nil { @@ -11817,35 +11841,34 @@ func (client AppsClient) GetNetworkTraces(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetNetworkTraces", err.Error()) + return result, validation.NewError("web.AppsClient", "GetMSDeployLog", err.Error()) } - req, err := client.GetNetworkTracesPreparer(ctx, resourceGroupName, name, operationID) + req, err := client.GetMSDeployLogPreparer(ctx, resourceGroupName, name) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraces", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMSDeployLog", nil, "Failure preparing request") return } - resp, err := client.GetNetworkTracesSender(req) + resp, err := client.GetMSDeployLogSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraces", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMSDeployLog", resp, "Failure sending request") return } - result, err = client.GetNetworkTracesResponder(resp) + result, err = client.GetMSDeployLogResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraces", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMSDeployLog", resp, "Failure responding to request") } return } -// GetNetworkTracesPreparer prepares the GetNetworkTraces request. -func (client AppsClient) GetNetworkTracesPreparer(ctx context.Context, resourceGroupName string, name string, operationID string) (*http.Request, error) { +// GetMSDeployLogPreparer prepares the GetMSDeployLog request. +func (client AppsClient) GetMSDeployLogPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), - "operationId": autorest.Encode("path", operationID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -11858,41 +11881,39 @@ func (client AppsClient) GetNetworkTracesPreparer(ctx context.Context, resourceG preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/{operationId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy/log", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetNetworkTracesSender sends the GetNetworkTraces request. The method will close the +// GetMSDeployLogSender sends the GetMSDeployLog request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetNetworkTracesSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetMSDeployLogSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetNetworkTracesResponder handles the response to the GetNetworkTraces request. The method always +// GetMSDeployLogResponder handles the response to the GetMSDeployLog request. The method always // closes the http.Response Body. -func (client AppsClient) GetNetworkTracesResponder(resp *http.Response) (result ListNetworkTrace, err error) { +func (client AppsClient) GetMSDeployLogResponder(resp *http.Response) (result MSDeployLog, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetNetworkTracesSlot gets a named operation for a network trace capturing (or deployment slot, if specified). +// GetMSDeployLogSlot get the MSDeploy Log for the last MSDeploy operation. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -// operationID - GUID of the operation. -// slot - name of the deployment slot. If a slot is not specified, the API will get an operation for the -// production slot. -func (client AppsClient) GetNetworkTracesSlot(ctx context.Context, resourceGroupName string, name string, operationID string, slot string) (result ListNetworkTrace, err error) { +// name - name of web app. +// slot - name of web app slot. If not specified then will default to production slot. +func (client AppsClient) GetMSDeployLogSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result MSDeployLog, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetNetworkTracesSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetMSDeployLogSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -11906,35 +11927,34 @@ func (client AppsClient) GetNetworkTracesSlot(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetNetworkTracesSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetMSDeployLogSlot", err.Error()) } - req, err := client.GetNetworkTracesSlotPreparer(ctx, resourceGroupName, name, operationID, slot) + req, err := client.GetMSDeployLogSlotPreparer(ctx, resourceGroupName, name, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTracesSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMSDeployLogSlot", nil, "Failure preparing request") return } - resp, err := client.GetNetworkTracesSlotSender(req) + resp, err := client.GetMSDeployLogSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTracesSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMSDeployLogSlot", resp, "Failure sending request") return } - result, err = client.GetNetworkTracesSlotResponder(resp) + result, err = client.GetMSDeployLogSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTracesSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMSDeployLogSlot", resp, "Failure responding to request") } return } -// GetNetworkTracesSlotPreparer prepares the GetNetworkTracesSlot request. -func (client AppsClient) GetNetworkTracesSlotPreparer(ctx context.Context, resourceGroupName string, name string, operationID string, slot string) (*http.Request, error) { +// GetMSDeployLogSlotPreparer prepares the GetMSDeployLogSlot request. +func (client AppsClient) GetMSDeployLogSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), - "operationId": autorest.Encode("path", operationID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -11948,41 +11968,38 @@ func (client AppsClient) GetNetworkTracesSlotPreparer(ctx context.Context, resou preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/{operationId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy/log", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetNetworkTracesSlotSender sends the GetNetworkTracesSlot request. The method will close the +// GetMSDeployLogSlotSender sends the GetMSDeployLogSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetNetworkTracesSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetMSDeployLogSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetNetworkTracesSlotResponder handles the response to the GetNetworkTracesSlot request. The method always +// GetMSDeployLogSlotResponder handles the response to the GetMSDeployLogSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetNetworkTracesSlotResponder(resp *http.Response) (result ListNetworkTrace, err error) { +func (client AppsClient) GetMSDeployLogSlotResponder(resp *http.Response) (result MSDeployLog, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetNetworkTracesSlotV2 gets a named operation for a network trace capturing (or deployment slot, if specified). +// GetMSDeployStatus get the status of the last MSDeploy operation. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -// operationID - GUID of the operation. -// slot - name of the deployment slot. If a slot is not specified, the API will get an operation for the -// production slot. -func (client AppsClient) GetNetworkTracesSlotV2(ctx context.Context, resourceGroupName string, name string, operationID string, slot string) (result ListNetworkTrace, err error) { +// name - name of web app. +func (client AppsClient) GetMSDeployStatus(ctx context.Context, resourceGroupName string, name string) (result MSDeployStatus, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetNetworkTracesSlotV2") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetMSDeployStatus") defer func() { sc := -1 if result.Response.Response != nil { @@ -11996,37 +12013,35 @@ func (client AppsClient) GetNetworkTracesSlotV2(ctx context.Context, resourceGro Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetNetworkTracesSlotV2", err.Error()) + return result, validation.NewError("web.AppsClient", "GetMSDeployStatus", err.Error()) } - req, err := client.GetNetworkTracesSlotV2Preparer(ctx, resourceGroupName, name, operationID, slot) + req, err := client.GetMSDeployStatusPreparer(ctx, resourceGroupName, name) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTracesSlotV2", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMSDeployStatus", nil, "Failure preparing request") return } - resp, err := client.GetNetworkTracesSlotV2Sender(req) + resp, err := client.GetMSDeployStatusSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTracesSlotV2", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMSDeployStatus", resp, "Failure sending request") return } - result, err = client.GetNetworkTracesSlotV2Responder(resp) + result, err = client.GetMSDeployStatusResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTracesSlotV2", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMSDeployStatus", resp, "Failure responding to request") } return } -// GetNetworkTracesSlotV2Preparer prepares the GetNetworkTracesSlotV2 request. -func (client AppsClient) GetNetworkTracesSlotV2Preparer(ctx context.Context, resourceGroupName string, name string, operationID string, slot string) (*http.Request, error) { +// GetMSDeployStatusPreparer prepares the GetMSDeployStatus request. +func (client AppsClient) GetMSDeployStatusPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), - "operationId": autorest.Encode("path", operationID), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -12038,39 +12053,39 @@ func (client AppsClient) GetNetworkTracesSlotV2Preparer(ctx context.Context, res preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTraces/{operationId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetNetworkTracesSlotV2Sender sends the GetNetworkTracesSlotV2 request. The method will close the +// GetMSDeployStatusSender sends the GetMSDeployStatus request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetNetworkTracesSlotV2Sender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetMSDeployStatusSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetNetworkTracesSlotV2Responder handles the response to the GetNetworkTracesSlotV2 request. The method always +// GetMSDeployStatusResponder handles the response to the GetMSDeployStatus request. The method always // closes the http.Response Body. -func (client AppsClient) GetNetworkTracesSlotV2Responder(resp *http.Response) (result ListNetworkTrace, err error) { +func (client AppsClient) GetMSDeployStatusResponder(resp *http.Response) (result MSDeployStatus, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetNetworkTracesV2 gets a named operation for a network trace capturing (or deployment slot, if specified). +// GetMSDeployStatusSlot get the status of the last MSDeploy operation. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -// operationID - GUID of the operation. -func (client AppsClient) GetNetworkTracesV2(ctx context.Context, resourceGroupName string, name string, operationID string) (result ListNetworkTrace, err error) { +// name - name of web app. +// slot - name of web app slot. If not specified then will default to production slot. +func (client AppsClient) GetMSDeployStatusSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result MSDeployStatus, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetNetworkTracesV2") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetMSDeployStatusSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -12084,36 +12099,36 @@ func (client AppsClient) GetNetworkTracesV2(ctx context.Context, resourceGroupNa Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetNetworkTracesV2", err.Error()) + return result, validation.NewError("web.AppsClient", "GetMSDeployStatusSlot", err.Error()) } - req, err := client.GetNetworkTracesV2Preparer(ctx, resourceGroupName, name, operationID) + req, err := client.GetMSDeployStatusSlotPreparer(ctx, resourceGroupName, name, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTracesV2", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMSDeployStatusSlot", nil, "Failure preparing request") return } - resp, err := client.GetNetworkTracesV2Sender(req) + resp, err := client.GetMSDeployStatusSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTracesV2", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMSDeployStatusSlot", resp, "Failure sending request") return } - result, err = client.GetNetworkTracesV2Responder(resp) + result, err = client.GetMSDeployStatusSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTracesV2", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMSDeployStatusSlot", resp, "Failure responding to request") } return } -// GetNetworkTracesV2Preparer prepares the GetNetworkTracesV2 request. -func (client AppsClient) GetNetworkTracesV2Preparer(ctx context.Context, resourceGroupName string, name string, operationID string) (*http.Request, error) { +// GetMSDeployStatusSlotPreparer prepares the GetMSDeployStatusSlot request. +func (client AppsClient) GetMSDeployStatusSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), - "operationId": autorest.Encode("path", operationID), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -12125,39 +12140,39 @@ func (client AppsClient) GetNetworkTracesV2Preparer(ctx context.Context, resourc preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/{operationId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetNetworkTracesV2Sender sends the GetNetworkTracesV2 request. The method will close the +// GetMSDeployStatusSlotSender sends the GetMSDeployStatusSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetNetworkTracesV2Sender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetMSDeployStatusSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetNetworkTracesV2Responder handles the response to the GetNetworkTracesV2 request. The method always +// GetMSDeployStatusSlotResponder handles the response to the GetMSDeployStatusSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetNetworkTracesV2Responder(resp *http.Response) (result ListNetworkTrace, err error) { +func (client AppsClient) GetMSDeployStatusSlotResponder(resp *http.Response) (result MSDeployStatus, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetPremierAddOn gets a named add-on of an app. +// GetNetworkTraceOperation gets a named operation for a network trace capturing (or deployment slot, if specified). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// premierAddOnName - add-on name. -func (client AppsClient) GetPremierAddOn(ctx context.Context, resourceGroupName string, name string, premierAddOnName string) (result PremierAddOn, err error) { +// operationID - GUID of the operation. +func (client AppsClient) GetNetworkTraceOperation(ctx context.Context, resourceGroupName string, name string, operationID string) (result ListNetworkTrace, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetPremierAddOn") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetNetworkTraceOperation") defer func() { sc := -1 if result.Response.Response != nil { @@ -12171,35 +12186,35 @@ func (client AppsClient) GetPremierAddOn(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetPremierAddOn", err.Error()) + return result, validation.NewError("web.AppsClient", "GetNetworkTraceOperation", err.Error()) } - req, err := client.GetPremierAddOnPreparer(ctx, resourceGroupName, name, premierAddOnName) + req, err := client.GetNetworkTraceOperationPreparer(ctx, resourceGroupName, name, operationID) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPremierAddOn", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraceOperation", nil, "Failure preparing request") return } - resp, err := client.GetPremierAddOnSender(req) + resp, err := client.GetNetworkTraceOperationSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPremierAddOn", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraceOperation", resp, "Failure sending request") return } - result, err = client.GetPremierAddOnResponder(resp) + result, err = client.GetNetworkTraceOperationResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPremierAddOn", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraceOperation", resp, "Failure responding to request") } return } -// GetPremierAddOnPreparer prepares the GetPremierAddOn request. -func (client AppsClient) GetPremierAddOnPreparer(ctx context.Context, resourceGroupName string, name string, premierAddOnName string) (*http.Request, error) { +// GetNetworkTraceOperationPreparer prepares the GetNetworkTraceOperation request. +func (client AppsClient) GetNetworkTraceOperationPreparer(ctx context.Context, resourceGroupName string, name string, operationID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), - "premierAddOnName": autorest.Encode("path", premierAddOnName), + "operationId": autorest.Encode("path", operationID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -12212,41 +12227,42 @@ func (client AppsClient) GetPremierAddOnPreparer(ctx context.Context, resourceGr preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/operationresults/{operationId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetPremierAddOnSender sends the GetPremierAddOn request. The method will close the +// GetNetworkTraceOperationSender sends the GetNetworkTraceOperation request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetPremierAddOnSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetNetworkTraceOperationSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetPremierAddOnResponder handles the response to the GetPremierAddOn request. The method always +// GetNetworkTraceOperationResponder handles the response to the GetNetworkTraceOperation request. The method always // closes the http.Response Body. -func (client AppsClient) GetPremierAddOnResponder(resp *http.Response) (result PremierAddOn, err error) { +func (client AppsClient) GetNetworkTraceOperationResponder(resp *http.Response) (result ListNetworkTrace, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetPremierAddOnSlot gets a named add-on of an app. +// GetNetworkTraceOperationSlot gets a named operation for a network trace capturing (or deployment slot, if +// specified). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// premierAddOnName - add-on name. -// slot - name of the deployment slot. If a slot is not specified, the API will get the named add-on for the +// operationID - GUID of the operation. +// slot - name of the deployment slot. If a slot is not specified, the API will get an operation for the // production slot. -func (client AppsClient) GetPremierAddOnSlot(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, slot string) (result PremierAddOn, err error) { +func (client AppsClient) GetNetworkTraceOperationSlot(ctx context.Context, resourceGroupName string, name string, operationID string, slot string) (result ListNetworkTrace, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetPremierAddOnSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetNetworkTraceOperationSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -12260,35 +12276,35 @@ func (client AppsClient) GetPremierAddOnSlot(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetPremierAddOnSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetNetworkTraceOperationSlot", err.Error()) } - req, err := client.GetPremierAddOnSlotPreparer(ctx, resourceGroupName, name, premierAddOnName, slot) + req, err := client.GetNetworkTraceOperationSlotPreparer(ctx, resourceGroupName, name, operationID, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPremierAddOnSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraceOperationSlot", nil, "Failure preparing request") return } - resp, err := client.GetPremierAddOnSlotSender(req) + resp, err := client.GetNetworkTraceOperationSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPremierAddOnSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraceOperationSlot", resp, "Failure sending request") return } - result, err = client.GetPremierAddOnSlotResponder(resp) + result, err = client.GetNetworkTraceOperationSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPremierAddOnSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraceOperationSlot", resp, "Failure responding to request") } return } -// GetPremierAddOnSlotPreparer prepares the GetPremierAddOnSlot request. -func (client AppsClient) GetPremierAddOnSlotPreparer(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, slot string) (*http.Request, error) { +// GetNetworkTraceOperationSlotPreparer prepares the GetNetworkTraceOperationSlot request. +func (client AppsClient) GetNetworkTraceOperationSlotPreparer(ctx context.Context, resourceGroupName string, name string, operationID string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), - "premierAddOnName": autorest.Encode("path", premierAddOnName), + "operationId": autorest.Encode("path", operationID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -12302,39 +12318,42 @@ func (client AppsClient) GetPremierAddOnSlotPreparer(ctx context.Context, resour preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/operationresults/{operationId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetPremierAddOnSlotSender sends the GetPremierAddOnSlot request. The method will close the +// GetNetworkTraceOperationSlotSender sends the GetNetworkTraceOperationSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetPremierAddOnSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetNetworkTraceOperationSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetPremierAddOnSlotResponder handles the response to the GetPremierAddOnSlot request. The method always +// GetNetworkTraceOperationSlotResponder handles the response to the GetNetworkTraceOperationSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetPremierAddOnSlotResponder(resp *http.Response) (result PremierAddOn, err error) { +func (client AppsClient) GetNetworkTraceOperationSlotResponder(resp *http.Response) (result ListNetworkTrace, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetPrivateAccess gets data around private site access enablement and authorized Virtual Networks that can access the -// site. +// GetNetworkTraceOperationSlotV2 gets a named operation for a network trace capturing (or deployment slot, if +// specified). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - the name of the web app. -func (client AppsClient) GetPrivateAccess(ctx context.Context, resourceGroupName string, name string) (result PrivateAccess, err error) { +// name - name of the app. +// operationID - GUID of the operation. +// slot - name of the deployment slot. If a slot is not specified, the API will get an operation for the +// production slot. +func (client AppsClient) GetNetworkTraceOperationSlotV2(ctx context.Context, resourceGroupName string, name string, operationID string, slot string) (result ListNetworkTrace, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetPrivateAccess") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetNetworkTraceOperationSlotV2") defer func() { sc := -1 if result.Response.Response != nil { @@ -12348,35 +12367,37 @@ func (client AppsClient) GetPrivateAccess(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetPrivateAccess", err.Error()) + return result, validation.NewError("web.AppsClient", "GetNetworkTraceOperationSlotV2", err.Error()) } - req, err := client.GetPrivateAccessPreparer(ctx, resourceGroupName, name) + req, err := client.GetNetworkTraceOperationSlotV2Preparer(ctx, resourceGroupName, name, operationID, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPrivateAccess", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraceOperationSlotV2", nil, "Failure preparing request") return } - resp, err := client.GetPrivateAccessSender(req) + resp, err := client.GetNetworkTraceOperationSlotV2Sender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPrivateAccess", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraceOperationSlotV2", resp, "Failure sending request") return } - result, err = client.GetPrivateAccessResponder(resp) + result, err = client.GetNetworkTraceOperationSlotV2Responder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPrivateAccess", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraceOperationSlotV2", resp, "Failure responding to request") } return } -// GetPrivateAccessPreparer prepares the GetPrivateAccess request. -func (client AppsClient) GetPrivateAccessPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { +// GetNetworkTraceOperationSlotV2Preparer prepares the GetNetworkTraceOperationSlotV2 request. +func (client AppsClient) GetNetworkTraceOperationSlotV2Preparer(ctx context.Context, resourceGroupName string, name string, operationID string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), + "operationId": autorest.Encode("path", operationID), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -12388,40 +12409,39 @@ func (client AppsClient) GetPrivateAccessPreparer(ctx context.Context, resourceG preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateAccess/virtualNetworks", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTraces/current/operationresults/{operationId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetPrivateAccessSender sends the GetPrivateAccess request. The method will close the +// GetNetworkTraceOperationSlotV2Sender sends the GetNetworkTraceOperationSlotV2 request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetPrivateAccessSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetNetworkTraceOperationSlotV2Sender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetPrivateAccessResponder handles the response to the GetPrivateAccess request. The method always +// GetNetworkTraceOperationSlotV2Responder handles the response to the GetNetworkTraceOperationSlotV2 request. The method always // closes the http.Response Body. -func (client AppsClient) GetPrivateAccessResponder(resp *http.Response) (result PrivateAccess, err error) { +func (client AppsClient) GetNetworkTraceOperationSlotV2Responder(resp *http.Response) (result ListNetworkTrace, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetPrivateAccessSlot gets data around private site access enablement and authorized Virtual Networks that can access -// the site. +// GetNetworkTraceOperationV2 gets a named operation for a network trace capturing (or deployment slot, if specified). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - the name of the web app. -// slot - the name of the slot for the web app. -func (client AppsClient) GetPrivateAccessSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result PrivateAccess, err error) { +// name - name of the app. +// operationID - GUID of the operation. +func (client AppsClient) GetNetworkTraceOperationV2(ctx context.Context, resourceGroupName string, name string, operationID string) (result ListNetworkTrace, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetPrivateAccessSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetNetworkTraceOperationV2") defer func() { sc := -1 if result.Response.Response != nil { @@ -12435,36 +12455,36 @@ func (client AppsClient) GetPrivateAccessSlot(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetPrivateAccessSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetNetworkTraceOperationV2", err.Error()) } - req, err := client.GetPrivateAccessSlotPreparer(ctx, resourceGroupName, name, slot) + req, err := client.GetNetworkTraceOperationV2Preparer(ctx, resourceGroupName, name, operationID) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPrivateAccessSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraceOperationV2", nil, "Failure preparing request") return } - resp, err := client.GetPrivateAccessSlotSender(req) + resp, err := client.GetNetworkTraceOperationV2Sender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPrivateAccessSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraceOperationV2", resp, "Failure sending request") return } - result, err = client.GetPrivateAccessSlotResponder(resp) + result, err = client.GetNetworkTraceOperationV2Responder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPrivateAccessSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraceOperationV2", resp, "Failure responding to request") } return } -// GetPrivateAccessSlotPreparer prepares the GetPrivateAccessSlot request. -func (client AppsClient) GetPrivateAccessSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { +// GetNetworkTraceOperationV2Preparer prepares the GetNetworkTraceOperationV2 request. +func (client AppsClient) GetNetworkTraceOperationV2Preparer(ctx context.Context, resourceGroupName string, name string, operationID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), + "operationId": autorest.Encode("path", operationID), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -12476,39 +12496,39 @@ func (client AppsClient) GetPrivateAccessSlotPreparer(ctx context.Context, resou preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/current/operationresults/{operationId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetPrivateAccessSlotSender sends the GetPrivateAccessSlot request. The method will close the +// GetNetworkTraceOperationV2Sender sends the GetNetworkTraceOperationV2 request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetPrivateAccessSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetNetworkTraceOperationV2Sender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetPrivateAccessSlotResponder handles the response to the GetPrivateAccessSlot request. The method always +// GetNetworkTraceOperationV2Responder handles the response to the GetNetworkTraceOperationV2 request. The method always // closes the http.Response Body. -func (client AppsClient) GetPrivateAccessSlotResponder(resp *http.Response) (result PrivateAccess, err error) { +func (client AppsClient) GetNetworkTraceOperationV2Responder(resp *http.Response) (result ListNetworkTrace, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetProcess get process information by its ID for a specific scaled-out instance in a web site. +// GetNetworkTraces gets a named operation for a network trace capturing (or deployment slot, if specified). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - site name. -// processID - pID. -func (client AppsClient) GetProcess(ctx context.Context, resourceGroupName string, name string, processID string) (result ProcessInfo, err error) { +// name - name of the app. +// operationID - GUID of the operation. +func (client AppsClient) GetNetworkTraces(ctx context.Context, resourceGroupName string, name string, operationID string) (result ListNetworkTrace, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetProcess") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetNetworkTraces") defer func() { sc := -1 if result.Response.Response != nil { @@ -12522,35 +12542,35 @@ func (client AppsClient) GetProcess(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetProcess", err.Error()) + return result, validation.NewError("web.AppsClient", "GetNetworkTraces", err.Error()) } - req, err := client.GetProcessPreparer(ctx, resourceGroupName, name, processID) + req, err := client.GetNetworkTracesPreparer(ctx, resourceGroupName, name, operationID) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcess", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraces", nil, "Failure preparing request") return } - resp, err := client.GetProcessSender(req) + resp, err := client.GetNetworkTracesSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcess", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraces", resp, "Failure sending request") return } - result, err = client.GetProcessResponder(resp) + result, err = client.GetNetworkTracesResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcess", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraces", resp, "Failure responding to request") } return } -// GetProcessPreparer prepares the GetProcess request. -func (client AppsClient) GetProcessPreparer(ctx context.Context, resourceGroupName string, name string, processID string) (*http.Request, error) { +// GetNetworkTracesPreparer prepares the GetNetworkTraces request. +func (client AppsClient) GetNetworkTracesPreparer(ctx context.Context, resourceGroupName string, name string, operationID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), - "processId": autorest.Encode("path", processID), + "operationId": autorest.Encode("path", operationID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -12563,39 +12583,41 @@ func (client AppsClient) GetProcessPreparer(ctx context.Context, resourceGroupNa preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/{operationId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetProcessSender sends the GetProcess request. The method will close the +// GetNetworkTracesSender sends the GetNetworkTraces request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetProcessSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetNetworkTracesSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetProcessResponder handles the response to the GetProcess request. The method always +// GetNetworkTracesResponder handles the response to the GetNetworkTraces request. The method always // closes the http.Response Body. -func (client AppsClient) GetProcessResponder(resp *http.Response) (result ProcessInfo, err error) { +func (client AppsClient) GetNetworkTracesResponder(resp *http.Response) (result ListNetworkTrace, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), - autorest.ByUnmarshallingJSON(&result), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetProcessDump get a memory dump of a process by its ID for a specific scaled-out instance in a web site. +// GetNetworkTracesSlot gets a named operation for a network trace capturing (or deployment slot, if specified). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - site name. -// processID - pID. -func (client AppsClient) GetProcessDump(ctx context.Context, resourceGroupName string, name string, processID string) (result ReadCloser, err error) { +// name - name of the app. +// operationID - GUID of the operation. +// slot - name of the deployment slot. If a slot is not specified, the API will get an operation for the +// production slot. +func (client AppsClient) GetNetworkTracesSlot(ctx context.Context, resourceGroupName string, name string, operationID string, slot string) (result ListNetworkTrace, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetProcessDump") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetNetworkTracesSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -12609,36 +12631,37 @@ func (client AppsClient) GetProcessDump(ctx context.Context, resourceGroupName s Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetProcessDump", err.Error()) + return result, validation.NewError("web.AppsClient", "GetNetworkTracesSlot", err.Error()) } - req, err := client.GetProcessDumpPreparer(ctx, resourceGroupName, name, processID) + req, err := client.GetNetworkTracesSlotPreparer(ctx, resourceGroupName, name, operationID, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessDump", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTracesSlot", nil, "Failure preparing request") return } - resp, err := client.GetProcessDumpSender(req) + resp, err := client.GetNetworkTracesSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessDump", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTracesSlot", resp, "Failure sending request") return } - result, err = client.GetProcessDumpResponder(resp) + result, err = client.GetNetworkTracesSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessDump", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTracesSlot", resp, "Failure responding to request") } return } -// GetProcessDumpPreparer prepares the GetProcessDump request. -func (client AppsClient) GetProcessDumpPreparer(ctx context.Context, resourceGroupName string, name string, processID string) (*http.Request, error) { +// GetNetworkTracesSlotPreparer prepares the GetNetworkTracesSlot request. +func (client AppsClient) GetNetworkTracesSlotPreparer(ctx context.Context, resourceGroupName string, name string, operationID string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), - "processId": autorest.Encode("path", processID), + "operationId": autorest.Encode("path", operationID), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -12650,40 +12673,41 @@ func (client AppsClient) GetProcessDumpPreparer(ctx context.Context, resourceGro preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/dump", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/{operationId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetProcessDumpSender sends the GetProcessDump request. The method will close the +// GetNetworkTracesSlotSender sends the GetNetworkTracesSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetProcessDumpSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetNetworkTracesSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetProcessDumpResponder handles the response to the GetProcessDump request. The method always +// GetNetworkTracesSlotResponder handles the response to the GetNetworkTracesSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetProcessDumpResponder(resp *http.Response) (result ReadCloser, err error) { - result.Value = &resp.Body +func (client AppsClient) GetNetworkTracesSlotResponder(resp *http.Response) (result ListNetworkTrace, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound)) + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetProcessDumpSlot get a memory dump of a process by its ID for a specific scaled-out instance in a web site. +// GetNetworkTracesSlotV2 gets a named operation for a network trace capturing (or deployment slot, if specified). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - site name. -// processID - pID. -// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the +// name - name of the app. +// operationID - GUID of the operation. +// slot - name of the deployment slot. If a slot is not specified, the API will get an operation for the // production slot. -func (client AppsClient) GetProcessDumpSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string) (result ReadCloser, err error) { +func (client AppsClient) GetNetworkTracesSlotV2(ctx context.Context, resourceGroupName string, name string, operationID string, slot string) (result ListNetworkTrace, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetProcessDumpSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetNetworkTracesSlotV2") defer func() { sc := -1 if result.Response.Response != nil { @@ -12697,35 +12721,35 @@ func (client AppsClient) GetProcessDumpSlot(ctx context.Context, resourceGroupNa Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetProcessDumpSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetNetworkTracesSlotV2", err.Error()) } - req, err := client.GetProcessDumpSlotPreparer(ctx, resourceGroupName, name, processID, slot) + req, err := client.GetNetworkTracesSlotV2Preparer(ctx, resourceGroupName, name, operationID, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessDumpSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTracesSlotV2", nil, "Failure preparing request") return } - resp, err := client.GetProcessDumpSlotSender(req) + resp, err := client.GetNetworkTracesSlotV2Sender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessDumpSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTracesSlotV2", resp, "Failure sending request") return } - result, err = client.GetProcessDumpSlotResponder(resp) + result, err = client.GetNetworkTracesSlotV2Responder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessDumpSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTracesSlotV2", resp, "Failure responding to request") } return } -// GetProcessDumpSlotPreparer prepares the GetProcessDumpSlot request. -func (client AppsClient) GetProcessDumpSlotPreparer(ctx context.Context, resourceGroupName string, name string, processID string, slot string) (*http.Request, error) { +// GetNetworkTracesSlotV2Preparer prepares the GetNetworkTracesSlotV2 request. +func (client AppsClient) GetNetworkTracesSlotV2Preparer(ctx context.Context, resourceGroupName string, name string, operationID string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), - "processId": autorest.Encode("path", processID), + "operationId": autorest.Encode("path", operationID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -12739,39 +12763,39 @@ func (client AppsClient) GetProcessDumpSlotPreparer(ctx context.Context, resourc preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/dump", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTraces/{operationId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetProcessDumpSlotSender sends the GetProcessDumpSlot request. The method will close the +// GetNetworkTracesSlotV2Sender sends the GetNetworkTracesSlotV2 request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetProcessDumpSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetNetworkTracesSlotV2Sender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetProcessDumpSlotResponder handles the response to the GetProcessDumpSlot request. The method always +// GetNetworkTracesSlotV2Responder handles the response to the GetNetworkTracesSlotV2 request. The method always // closes the http.Response Body. -func (client AppsClient) GetProcessDumpSlotResponder(resp *http.Response) (result ReadCloser, err error) { - result.Value = &resp.Body +func (client AppsClient) GetNetworkTracesSlotV2Responder(resp *http.Response) (result ListNetworkTrace, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound)) + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetProcessModule get process information by its ID for a specific scaled-out instance in a web site. +// GetNetworkTracesV2 gets a named operation for a network trace capturing (or deployment slot, if specified). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - site name. -// processID - pID. -// baseAddress - module base address. -func (client AppsClient) GetProcessModule(ctx context.Context, resourceGroupName string, name string, processID string, baseAddress string) (result ProcessModuleInfo, err error) { +// name - name of the app. +// operationID - GUID of the operation. +func (client AppsClient) GetNetworkTracesV2(ctx context.Context, resourceGroupName string, name string, operationID string) (result ListNetworkTrace, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetProcessModule") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetNetworkTracesV2") defer func() { sc := -1 if result.Response.Response != nil { @@ -12785,36 +12809,35 @@ func (client AppsClient) GetProcessModule(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetProcessModule", err.Error()) + return result, validation.NewError("web.AppsClient", "GetNetworkTracesV2", err.Error()) } - req, err := client.GetProcessModulePreparer(ctx, resourceGroupName, name, processID, baseAddress) + req, err := client.GetNetworkTracesV2Preparer(ctx, resourceGroupName, name, operationID) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessModule", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTracesV2", nil, "Failure preparing request") return } - resp, err := client.GetProcessModuleSender(req) + resp, err := client.GetNetworkTracesV2Sender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessModule", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTracesV2", resp, "Failure sending request") return } - result, err = client.GetProcessModuleResponder(resp) + result, err = client.GetNetworkTracesV2Responder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessModule", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTracesV2", resp, "Failure responding to request") } return } -// GetProcessModulePreparer prepares the GetProcessModule request. -func (client AppsClient) GetProcessModulePreparer(ctx context.Context, resourceGroupName string, name string, processID string, baseAddress string) (*http.Request, error) { +// GetNetworkTracesV2Preparer prepares the GetNetworkTracesV2 request. +func (client AppsClient) GetNetworkTracesV2Preparer(ctx context.Context, resourceGroupName string, name string, operationID string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "baseAddress": autorest.Encode("path", baseAddress), "name": autorest.Encode("path", name), - "processId": autorest.Encode("path", processID), + "operationId": autorest.Encode("path", operationID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -12827,42 +12850,39 @@ func (client AppsClient) GetProcessModulePreparer(ctx context.Context, resourceG preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules/{baseAddress}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/{operationId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetProcessModuleSender sends the GetProcessModule request. The method will close the +// GetNetworkTracesV2Sender sends the GetNetworkTracesV2 request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetProcessModuleSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetNetworkTracesV2Sender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetProcessModuleResponder handles the response to the GetProcessModule request. The method always +// GetNetworkTracesV2Responder handles the response to the GetNetworkTracesV2 request. The method always // closes the http.Response Body. -func (client AppsClient) GetProcessModuleResponder(resp *http.Response) (result ProcessModuleInfo, err error) { +func (client AppsClient) GetNetworkTracesV2Responder(resp *http.Response) (result ListNetworkTrace, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), - autorest.ByUnmarshallingJSON(&result), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetProcessModuleSlot get process information by its ID for a specific scaled-out instance in a web site. +// GetPremierAddOn gets a named add-on of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - site name. -// processID - pID. -// baseAddress - module base address. -// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the -// production slot. -func (client AppsClient) GetProcessModuleSlot(ctx context.Context, resourceGroupName string, name string, processID string, baseAddress string, slot string) (result ProcessModuleInfo, err error) { +// name - name of the app. +// premierAddOnName - add-on name. +func (client AppsClient) GetPremierAddOn(ctx context.Context, resourceGroupName string, name string, premierAddOnName string) (result PremierAddOn, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetProcessModuleSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetPremierAddOn") defer func() { sc := -1 if result.Response.Response != nil { @@ -12876,38 +12896,36 @@ func (client AppsClient) GetProcessModuleSlot(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetProcessModuleSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetPremierAddOn", err.Error()) } - req, err := client.GetProcessModuleSlotPreparer(ctx, resourceGroupName, name, processID, baseAddress, slot) + req, err := client.GetPremierAddOnPreparer(ctx, resourceGroupName, name, premierAddOnName) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessModuleSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPremierAddOn", nil, "Failure preparing request") return } - resp, err := client.GetProcessModuleSlotSender(req) + resp, err := client.GetPremierAddOnSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessModuleSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPremierAddOn", resp, "Failure sending request") return } - result, err = client.GetProcessModuleSlotResponder(resp) + result, err = client.GetPremierAddOnResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessModuleSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPremierAddOn", resp, "Failure responding to request") } return } -// GetProcessModuleSlotPreparer prepares the GetProcessModuleSlot request. -func (client AppsClient) GetProcessModuleSlotPreparer(ctx context.Context, resourceGroupName string, name string, processID string, baseAddress string, slot string) (*http.Request, error) { +// GetPremierAddOnPreparer prepares the GetPremierAddOn request. +func (client AppsClient) GetPremierAddOnPreparer(ctx context.Context, resourceGroupName string, name string, premierAddOnName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "baseAddress": autorest.Encode("path", baseAddress), "name": autorest.Encode("path", name), - "processId": autorest.Encode("path", processID), + "premierAddOnName": autorest.Encode("path", premierAddOnName), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -12919,41 +12937,41 @@ func (client AppsClient) GetProcessModuleSlotPreparer(ctx context.Context, resou preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/modules/{baseAddress}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetProcessModuleSlotSender sends the GetProcessModuleSlot request. The method will close the +// GetPremierAddOnSender sends the GetPremierAddOn request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetProcessModuleSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetPremierAddOnSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetProcessModuleSlotResponder handles the response to the GetProcessModuleSlot request. The method always +// GetPremierAddOnResponder handles the response to the GetPremierAddOn request. The method always // closes the http.Response Body. -func (client AppsClient) GetProcessModuleSlotResponder(resp *http.Response) (result ProcessModuleInfo, err error) { +func (client AppsClient) GetPremierAddOnResponder(resp *http.Response) (result PremierAddOn, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetProcessSlot get process information by its ID for a specific scaled-out instance in a web site. +// GetPremierAddOnSlot gets a named add-on of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - site name. -// processID - pID. -// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the +// name - name of the app. +// premierAddOnName - add-on name. +// slot - name of the deployment slot. If a slot is not specified, the API will get the named add-on for the // production slot. -func (client AppsClient) GetProcessSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string) (result ProcessInfo, err error) { +func (client AppsClient) GetPremierAddOnSlot(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, slot string) (result PremierAddOn, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetProcessSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetPremierAddOnSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -12967,35 +12985,35 @@ func (client AppsClient) GetProcessSlot(ctx context.Context, resourceGroupName s Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetProcessSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetPremierAddOnSlot", err.Error()) } - req, err := client.GetProcessSlotPreparer(ctx, resourceGroupName, name, processID, slot) + req, err := client.GetPremierAddOnSlotPreparer(ctx, resourceGroupName, name, premierAddOnName, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPremierAddOnSlot", nil, "Failure preparing request") return } - resp, err := client.GetProcessSlotSender(req) + resp, err := client.GetPremierAddOnSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPremierAddOnSlot", resp, "Failure sending request") return } - result, err = client.GetProcessSlotResponder(resp) + result, err = client.GetPremierAddOnSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPremierAddOnSlot", resp, "Failure responding to request") } return } -// GetProcessSlotPreparer prepares the GetProcessSlot request. -func (client AppsClient) GetProcessSlotPreparer(ctx context.Context, resourceGroupName string, name string, processID string, slot string) (*http.Request, error) { +// GetPremierAddOnSlotPreparer prepares the GetPremierAddOnSlot request. +func (client AppsClient) GetPremierAddOnSlotPreparer(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), - "processId": autorest.Encode("path", processID), + "premierAddOnName": autorest.Encode("path", premierAddOnName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -13009,41 +13027,39 @@ func (client AppsClient) GetProcessSlotPreparer(ctx context.Context, resourceGro preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetProcessSlotSender sends the GetProcessSlot request. The method will close the +// GetPremierAddOnSlotSender sends the GetPremierAddOnSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetProcessSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetPremierAddOnSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetProcessSlotResponder handles the response to the GetProcessSlot request. The method always +// GetPremierAddOnSlotResponder handles the response to the GetPremierAddOnSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetProcessSlotResponder(resp *http.Response) (result ProcessInfo, err error) { +func (client AppsClient) GetPremierAddOnSlotResponder(resp *http.Response) (result PremierAddOn, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetProcessThread get thread information by Thread ID for a specific process, in a specific scaled-out instance in a -// web site. +// GetPrivateAccess gets data around private site access enablement and authorized Virtual Networks that can access the +// site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - site name. -// processID - pID. -// threadID - tID. -func (client AppsClient) GetProcessThread(ctx context.Context, resourceGroupName string, name string, processID string, threadID string) (result ProcessThreadInfo, err error) { +// name - the name of the web app. +func (client AppsClient) GetPrivateAccess(ctx context.Context, resourceGroupName string, name string) (result PrivateAccess, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetProcessThread") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetPrivateAccess") defer func() { sc := -1 if result.Response.Response != nil { @@ -13057,38 +13073,36 @@ func (client AppsClient) GetProcessThread(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetProcessThread", err.Error()) + return result, validation.NewError("web.AppsClient", "GetPrivateAccess", err.Error()) } - req, err := client.GetProcessThreadPreparer(ctx, resourceGroupName, name, processID, threadID) + req, err := client.GetPrivateAccessPreparer(ctx, resourceGroupName, name) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessThread", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPrivateAccess", nil, "Failure preparing request") return } - resp, err := client.GetProcessThreadSender(req) + resp, err := client.GetPrivateAccessSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessThread", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPrivateAccess", resp, "Failure sending request") return } - result, err = client.GetProcessThreadResponder(resp) + result, err = client.GetPrivateAccessResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessThread", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPrivateAccess", resp, "Failure responding to request") } return } -// GetProcessThreadPreparer prepares the GetProcessThread request. -func (client AppsClient) GetProcessThreadPreparer(ctx context.Context, resourceGroupName string, name string, processID string, threadID string) (*http.Request, error) { +// GetPrivateAccessPreparer prepares the GetPrivateAccess request. +func (client AppsClient) GetPrivateAccessPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), - "processId": autorest.Encode("path", processID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "threadId": autorest.Encode("path", threadID), } const APIVersion = "2018-02-01" @@ -13099,43 +13113,40 @@ func (client AppsClient) GetProcessThreadPreparer(ctx context.Context, resourceG preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/threads/{threadId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateAccess/virtualNetworks", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetProcessThreadSender sends the GetProcessThread request. The method will close the +// GetPrivateAccessSender sends the GetPrivateAccess request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetProcessThreadSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetPrivateAccessSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetProcessThreadResponder handles the response to the GetProcessThread request. The method always +// GetPrivateAccessResponder handles the response to the GetPrivateAccess request. The method always // closes the http.Response Body. -func (client AppsClient) GetProcessThreadResponder(resp *http.Response) (result ProcessThreadInfo, err error) { +func (client AppsClient) GetPrivateAccessResponder(resp *http.Response) (result PrivateAccess, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetProcessThreadSlot get thread information by Thread ID for a specific process, in a specific scaled-out instance -// in a web site. +// GetPrivateAccessSlot gets data around private site access enablement and authorized Virtual Networks that can access +// the site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - site name. -// processID - pID. -// threadID - tID. -// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the -// production slot. -func (client AppsClient) GetProcessThreadSlot(ctx context.Context, resourceGroupName string, name string, processID string, threadID string, slot string) (result ProcessThreadInfo, err error) { +// name - the name of the web app. +// slot - the name of the slot for the web app. +func (client AppsClient) GetPrivateAccessSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result PrivateAccess, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetProcessThreadSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetPrivateAccessSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -13149,39 +13160,37 @@ func (client AppsClient) GetProcessThreadSlot(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetProcessThreadSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetPrivateAccessSlot", err.Error()) } - req, err := client.GetProcessThreadSlotPreparer(ctx, resourceGroupName, name, processID, threadID, slot) + req, err := client.GetPrivateAccessSlotPreparer(ctx, resourceGroupName, name, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessThreadSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPrivateAccessSlot", nil, "Failure preparing request") return } - resp, err := client.GetProcessThreadSlotSender(req) + resp, err := client.GetPrivateAccessSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessThreadSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPrivateAccessSlot", resp, "Failure sending request") return } - result, err = client.GetProcessThreadSlotResponder(resp) + result, err = client.GetPrivateAccessSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessThreadSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPrivateAccessSlot", resp, "Failure responding to request") } return } -// GetProcessThreadSlotPreparer prepares the GetProcessThreadSlot request. -func (client AppsClient) GetProcessThreadSlotPreparer(ctx context.Context, resourceGroupName string, name string, processID string, threadID string, slot string) (*http.Request, error) { +// GetPrivateAccessSlotPreparer prepares the GetPrivateAccessSlot request. +func (client AppsClient) GetPrivateAccessSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), - "processId": autorest.Encode("path", processID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "threadId": autorest.Encode("path", threadID), } const APIVersion = "2018-02-01" @@ -13192,39 +13201,39 @@ func (client AppsClient) GetProcessThreadSlotPreparer(ctx context.Context, resou preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/threads/{threadId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetProcessThreadSlotSender sends the GetProcessThreadSlot request. The method will close the +// GetPrivateAccessSlotSender sends the GetPrivateAccessSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetProcessThreadSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetPrivateAccessSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetProcessThreadSlotResponder handles the response to the GetProcessThreadSlot request. The method always +// GetPrivateAccessSlotResponder handles the response to the GetPrivateAccessSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetProcessThreadSlotResponder(resp *http.Response) (result ProcessThreadInfo, err error) { +func (client AppsClient) GetPrivateAccessSlotResponder(resp *http.Response) (result PrivateAccess, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetPublicCertificate get the named public certificate for an app (or deployment slot, if specified). +// GetProcess get process information by its ID for a specific scaled-out instance in a web site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -// publicCertificateName - public certificate name. -func (client AppsClient) GetPublicCertificate(ctx context.Context, resourceGroupName string, name string, publicCertificateName string) (result PublicCertificate, err error) { +// name - site name. +// processID - pID. +func (client AppsClient) GetProcess(ctx context.Context, resourceGroupName string, name string, processID string) (result ProcessInfo, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetPublicCertificate") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetProcess") defer func() { sc := -1 if result.Response.Response != nil { @@ -13238,37 +13247,37 @@ func (client AppsClient) GetPublicCertificate(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetPublicCertificate", err.Error()) + return result, validation.NewError("web.AppsClient", "GetProcess", err.Error()) } - req, err := client.GetPublicCertificatePreparer(ctx, resourceGroupName, name, publicCertificateName) + req, err := client.GetProcessPreparer(ctx, resourceGroupName, name, processID) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPublicCertificate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcess", nil, "Failure preparing request") return } - resp, err := client.GetPublicCertificateSender(req) + resp, err := client.GetProcessSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPublicCertificate", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcess", resp, "Failure sending request") return } - result, err = client.GetPublicCertificateResponder(resp) + result, err = client.GetProcessResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPublicCertificate", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcess", resp, "Failure responding to request") } return } -// GetPublicCertificatePreparer prepares the GetPublicCertificate request. -func (client AppsClient) GetPublicCertificatePreparer(ctx context.Context, resourceGroupName string, name string, publicCertificateName string) (*http.Request, error) { +// GetProcessPreparer prepares the GetProcess request. +func (client AppsClient) GetProcessPreparer(ctx context.Context, resourceGroupName string, name string, processID string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "name": autorest.Encode("path", name), - "publicCertificateName": autorest.Encode("path", publicCertificateName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "name": autorest.Encode("path", name), + "processId": autorest.Encode("path", processID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2018-02-01" @@ -13279,41 +13288,39 @@ func (client AppsClient) GetPublicCertificatePreparer(ctx context.Context, resou preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetPublicCertificateSender sends the GetPublicCertificate request. The method will close the +// GetProcessSender sends the GetProcess request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetPublicCertificateSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetProcessSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetPublicCertificateResponder handles the response to the GetPublicCertificate request. The method always +// GetProcessResponder handles the response to the GetProcess request. The method always // closes the http.Response Body. -func (client AppsClient) GetPublicCertificateResponder(resp *http.Response) (result PublicCertificate, err error) { +func (client AppsClient) GetProcessResponder(resp *http.Response) (result ProcessInfo, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetPublicCertificateSlot get the named public certificate for an app (or deployment slot, if specified). +// GetProcessDump get a memory dump of a process by its ID for a specific scaled-out instance in a web site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -// slot - name of the deployment slot. If a slot is not specified, the API the named binding for the production -// slot. -// publicCertificateName - public certificate name. -func (client AppsClient) GetPublicCertificateSlot(ctx context.Context, resourceGroupName string, name string, slot string, publicCertificateName string) (result PublicCertificate, err error) { +// name - site name. +// processID - pID. +func (client AppsClient) GetProcessDump(ctx context.Context, resourceGroupName string, name string, processID string) (result ReadCloser, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetPublicCertificateSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetProcessDump") defer func() { sc := -1 if result.Response.Response != nil { @@ -13327,38 +13334,37 @@ func (client AppsClient) GetPublicCertificateSlot(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetPublicCertificateSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetProcessDump", err.Error()) } - req, err := client.GetPublicCertificateSlotPreparer(ctx, resourceGroupName, name, slot, publicCertificateName) + req, err := client.GetProcessDumpPreparer(ctx, resourceGroupName, name, processID) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPublicCertificateSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessDump", nil, "Failure preparing request") return } - resp, err := client.GetPublicCertificateSlotSender(req) + resp, err := client.GetProcessDumpSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPublicCertificateSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessDump", resp, "Failure sending request") return } - result, err = client.GetPublicCertificateSlotResponder(resp) + result, err = client.GetProcessDumpResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPublicCertificateSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessDump", resp, "Failure responding to request") } return } -// GetPublicCertificateSlotPreparer prepares the GetPublicCertificateSlot request. -func (client AppsClient) GetPublicCertificateSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string, publicCertificateName string) (*http.Request, error) { +// GetProcessDumpPreparer prepares the GetProcessDump request. +func (client AppsClient) GetProcessDumpPreparer(ctx context.Context, resourceGroupName string, name string, processID string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "name": autorest.Encode("path", name), - "publicCertificateName": autorest.Encode("path", publicCertificateName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "name": autorest.Encode("path", name), + "processId": autorest.Encode("path", processID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2018-02-01" @@ -13369,39 +13375,40 @@ func (client AppsClient) GetPublicCertificateSlotPreparer(ctx context.Context, r preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/dump", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetPublicCertificateSlotSender sends the GetPublicCertificateSlot request. The method will close the +// GetProcessDumpSender sends the GetProcessDump request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetPublicCertificateSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetProcessDumpSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetPublicCertificateSlotResponder handles the response to the GetPublicCertificateSlot request. The method always +// GetProcessDumpResponder handles the response to the GetProcessDump request. The method always // closes the http.Response Body. -func (client AppsClient) GetPublicCertificateSlotResponder(resp *http.Response) (result PublicCertificate, err error) { +func (client AppsClient) GetProcessDumpResponder(resp *http.Response) (result ReadCloser, err error) { + result.Value = &resp.Body err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound)) result.Response = autorest.Response{Response: resp} return } -// GetRelayServiceConnection gets a hybrid connection configuration by its name. +// GetProcessDumpSlot get a memory dump of a process by its ID for a specific scaled-out instance in a web site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -// entityName - name of the hybrid connection. -func (client AppsClient) GetRelayServiceConnection(ctx context.Context, resourceGroupName string, name string, entityName string) (result RelayServiceConnectionEntity, err error) { +// name - site name. +// processID - pID. +// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the +// production slot. +func (client AppsClient) GetProcessDumpSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string) (result ReadCloser, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetRelayServiceConnection") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetProcessDumpSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -13415,36 +13422,37 @@ func (client AppsClient) GetRelayServiceConnection(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetRelayServiceConnection", err.Error()) + return result, validation.NewError("web.AppsClient", "GetProcessDumpSlot", err.Error()) } - req, err := client.GetRelayServiceConnectionPreparer(ctx, resourceGroupName, name, entityName) + req, err := client.GetProcessDumpSlotPreparer(ctx, resourceGroupName, name, processID, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetRelayServiceConnection", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessDumpSlot", nil, "Failure preparing request") return } - resp, err := client.GetRelayServiceConnectionSender(req) + resp, err := client.GetProcessDumpSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetRelayServiceConnection", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessDumpSlot", resp, "Failure sending request") return } - result, err = client.GetRelayServiceConnectionResponder(resp) + result, err = client.GetProcessDumpSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetRelayServiceConnection", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessDumpSlot", resp, "Failure responding to request") } return } -// GetRelayServiceConnectionPreparer prepares the GetRelayServiceConnection request. -func (client AppsClient) GetRelayServiceConnectionPreparer(ctx context.Context, resourceGroupName string, name string, entityName string) (*http.Request, error) { +// GetProcessDumpSlotPreparer prepares the GetProcessDumpSlot request. +func (client AppsClient) GetProcessDumpSlotPreparer(ctx context.Context, resourceGroupName string, name string, processID string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "entityName": autorest.Encode("path", entityName), "name": autorest.Encode("path", name), + "processId": autorest.Encode("path", processID), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -13456,41 +13464,39 @@ func (client AppsClient) GetRelayServiceConnectionPreparer(ctx context.Context, preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/dump", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetRelayServiceConnectionSender sends the GetRelayServiceConnection request. The method will close the +// GetProcessDumpSlotSender sends the GetProcessDumpSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetRelayServiceConnectionSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetProcessDumpSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetRelayServiceConnectionResponder handles the response to the GetRelayServiceConnection request. The method always +// GetProcessDumpSlotResponder handles the response to the GetProcessDumpSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetRelayServiceConnectionResponder(resp *http.Response) (result RelayServiceConnectionEntity, err error) { +func (client AppsClient) GetProcessDumpSlotResponder(resp *http.Response) (result ReadCloser, err error) { + result.Value = &resp.Body err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound)) result.Response = autorest.Response{Response: resp} return } -// GetRelayServiceConnectionSlot gets a hybrid connection configuration by its name. +// GetProcessModule get process information by its ID for a specific scaled-out instance in a web site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -// entityName - name of the hybrid connection. -// slot - name of the deployment slot. If a slot is not specified, the API will get a hybrid connection for the -// production slot. -func (client AppsClient) GetRelayServiceConnectionSlot(ctx context.Context, resourceGroupName string, name string, entityName string, slot string) (result RelayServiceConnectionEntity, err error) { +// name - site name. +// processID - pID. +// baseAddress - module base address. +func (client AppsClient) GetProcessModule(ctx context.Context, resourceGroupName string, name string, processID string, baseAddress string) (result ProcessModuleInfo, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetRelayServiceConnectionSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetProcessModule") defer func() { sc := -1 if result.Response.Response != nil { @@ -13504,37 +13510,37 @@ func (client AppsClient) GetRelayServiceConnectionSlot(ctx context.Context, reso Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetRelayServiceConnectionSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetProcessModule", err.Error()) } - req, err := client.GetRelayServiceConnectionSlotPreparer(ctx, resourceGroupName, name, entityName, slot) + req, err := client.GetProcessModulePreparer(ctx, resourceGroupName, name, processID, baseAddress) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetRelayServiceConnectionSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessModule", nil, "Failure preparing request") return } - resp, err := client.GetRelayServiceConnectionSlotSender(req) + resp, err := client.GetProcessModuleSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetRelayServiceConnectionSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessModule", resp, "Failure sending request") return } - result, err = client.GetRelayServiceConnectionSlotResponder(resp) + result, err = client.GetProcessModuleResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetRelayServiceConnectionSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessModule", resp, "Failure responding to request") } return } -// GetRelayServiceConnectionSlotPreparer prepares the GetRelayServiceConnectionSlot request. -func (client AppsClient) GetRelayServiceConnectionSlotPreparer(ctx context.Context, resourceGroupName string, name string, entityName string, slot string) (*http.Request, error) { +// GetProcessModulePreparer prepares the GetProcessModule request. +func (client AppsClient) GetProcessModulePreparer(ctx context.Context, resourceGroupName string, name string, processID string, baseAddress string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "entityName": autorest.Encode("path", entityName), + "baseAddress": autorest.Encode("path", baseAddress), "name": autorest.Encode("path", name), + "processId": autorest.Encode("path", processID), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -13546,39 +13552,42 @@ func (client AppsClient) GetRelayServiceConnectionSlotPreparer(ctx context.Conte preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules/{baseAddress}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetRelayServiceConnectionSlotSender sends the GetRelayServiceConnectionSlot request. The method will close the +// GetProcessModuleSender sends the GetProcessModule request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetRelayServiceConnectionSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetProcessModuleSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetRelayServiceConnectionSlotResponder handles the response to the GetRelayServiceConnectionSlot request. The method always +// GetProcessModuleResponder handles the response to the GetProcessModule request. The method always // closes the http.Response Body. -func (client AppsClient) GetRelayServiceConnectionSlotResponder(resp *http.Response) (result RelayServiceConnectionEntity, err error) { +func (client AppsClient) GetProcessModuleResponder(resp *http.Response) (result ProcessModuleInfo, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetSiteExtension get site extension information by its ID for a web site, or a deployment slot. +// GetProcessModuleSlot get process information by its ID for a specific scaled-out instance in a web site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. -// siteExtensionID - site extension name. -func (client AppsClient) GetSiteExtension(ctx context.Context, resourceGroupName string, name string, siteExtensionID string) (result SiteExtensionInfo, err error) { +// processID - pID. +// baseAddress - module base address. +// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the +// production slot. +func (client AppsClient) GetProcessModuleSlot(ctx context.Context, resourceGroupName string, name string, processID string, baseAddress string, slot string) (result ProcessModuleInfo, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetSiteExtension") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetProcessModuleSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -13592,36 +13601,38 @@ func (client AppsClient) GetSiteExtension(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetSiteExtension", err.Error()) + return result, validation.NewError("web.AppsClient", "GetProcessModuleSlot", err.Error()) } - req, err := client.GetSiteExtensionPreparer(ctx, resourceGroupName, name, siteExtensionID) + req, err := client.GetProcessModuleSlotPreparer(ctx, resourceGroupName, name, processID, baseAddress, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSiteExtension", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessModuleSlot", nil, "Failure preparing request") return } - resp, err := client.GetSiteExtensionSender(req) + resp, err := client.GetProcessModuleSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSiteExtension", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessModuleSlot", resp, "Failure sending request") return } - result, err = client.GetSiteExtensionResponder(resp) + result, err = client.GetProcessModuleSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSiteExtension", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessModuleSlot", resp, "Failure responding to request") } return } -// GetSiteExtensionPreparer prepares the GetSiteExtension request. -func (client AppsClient) GetSiteExtensionPreparer(ctx context.Context, resourceGroupName string, name string, siteExtensionID string) (*http.Request, error) { +// GetProcessModuleSlotPreparer prepares the GetProcessModuleSlot request. +func (client AppsClient) GetProcessModuleSlotPreparer(ctx context.Context, resourceGroupName string, name string, processID string, baseAddress string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ + "baseAddress": autorest.Encode("path", baseAddress), "name": autorest.Encode("path", name), + "processId": autorest.Encode("path", processID), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "siteExtensionId": autorest.Encode("path", siteExtensionID), + "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -13633,21 +13644,21 @@ func (client AppsClient) GetSiteExtensionPreparer(ctx context.Context, resourceG preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/modules/{baseAddress}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetSiteExtensionSender sends the GetSiteExtension request. The method will close the +// GetProcessModuleSlotSender sends the GetProcessModuleSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetSiteExtensionSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetProcessModuleSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetSiteExtensionResponder handles the response to the GetSiteExtension request. The method always +// GetProcessModuleSlotResponder handles the response to the GetProcessModuleSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetSiteExtensionResponder(resp *http.Response) (result SiteExtensionInfo, err error) { +func (client AppsClient) GetProcessModuleSlotResponder(resp *http.Response) (result ProcessModuleInfo, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -13658,16 +13669,16 @@ func (client AppsClient) GetSiteExtensionResponder(resp *http.Response) (result return } -// GetSiteExtensionSlot get site extension information by its ID for a web site, or a deployment slot. +// GetProcessSlot get process information by its ID for a specific scaled-out instance in a web site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. -// siteExtensionID - site extension name. -// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the +// processID - pID. +// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the // production slot. -func (client AppsClient) GetSiteExtensionSlot(ctx context.Context, resourceGroupName string, name string, siteExtensionID string, slot string) (result SiteExtensionInfo, err error) { +func (client AppsClient) GetProcessSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string) (result ProcessInfo, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetSiteExtensionSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetProcessSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -13681,36 +13692,36 @@ func (client AppsClient) GetSiteExtensionSlot(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetSiteExtensionSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetProcessSlot", err.Error()) } - req, err := client.GetSiteExtensionSlotPreparer(ctx, resourceGroupName, name, siteExtensionID, slot) + req, err := client.GetProcessSlotPreparer(ctx, resourceGroupName, name, processID, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSiteExtensionSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessSlot", nil, "Failure preparing request") return } - resp, err := client.GetSiteExtensionSlotSender(req) + resp, err := client.GetProcessSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSiteExtensionSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessSlot", resp, "Failure sending request") return } - result, err = client.GetSiteExtensionSlotResponder(resp) + result, err = client.GetProcessSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSiteExtensionSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessSlot", resp, "Failure responding to request") } return } -// GetSiteExtensionSlotPreparer prepares the GetSiteExtensionSlot request. -func (client AppsClient) GetSiteExtensionSlotPreparer(ctx context.Context, resourceGroupName string, name string, siteExtensionID string, slot string) (*http.Request, error) { +// GetProcessSlotPreparer prepares the GetProcessSlot request. +func (client AppsClient) GetProcessSlotPreparer(ctx context.Context, resourceGroupName string, name string, processID string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), + "processId": autorest.Encode("path", processID), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "siteExtensionId": autorest.Encode("path", siteExtensionID), "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -13723,21 +13734,21 @@ func (client AppsClient) GetSiteExtensionSlotPreparer(ctx context.Context, resou preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetSiteExtensionSlotSender sends the GetSiteExtensionSlot request. The method will close the +// GetProcessSlotSender sends the GetProcessSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetSiteExtensionSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetProcessSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetSiteExtensionSlotResponder handles the response to the GetSiteExtensionSlot request. The method always +// GetProcessSlotResponder handles the response to the GetProcessSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetSiteExtensionSlotResponder(resp *http.Response) (result SiteExtensionInfo, err error) { +func (client AppsClient) GetProcessSlotResponder(resp *http.Response) (result ProcessInfo, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -13748,13 +13759,16 @@ func (client AppsClient) GetSiteExtensionSlotResponder(resp *http.Response) (res return } -// GetSitePhpErrorLogFlag gets web app's event logs. +// GetProcessThread get thread information by Thread ID for a specific process, in a specific scaled-out instance in a +// web site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of web app. -func (client AppsClient) GetSitePhpErrorLogFlag(ctx context.Context, resourceGroupName string, name string) (result SitePhpErrorLogFlag, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetSitePhpErrorLogFlag") +// name - site name. +// processID - pID. +// threadID - tID. +func (client AppsClient) GetProcessThread(ctx context.Context, resourceGroupName string, name string, processID string, threadID string) (result ProcessThreadInfo, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetProcessThread") defer func() { sc := -1 if result.Response.Response != nil { @@ -13768,36 +13782,38 @@ func (client AppsClient) GetSitePhpErrorLogFlag(ctx context.Context, resourceGro Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetSitePhpErrorLogFlag", err.Error()) + return result, validation.NewError("web.AppsClient", "GetProcessThread", err.Error()) } - req, err := client.GetSitePhpErrorLogFlagPreparer(ctx, resourceGroupName, name) + req, err := client.GetProcessThreadPreparer(ctx, resourceGroupName, name, processID, threadID) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSitePhpErrorLogFlag", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessThread", nil, "Failure preparing request") return } - resp, err := client.GetSitePhpErrorLogFlagSender(req) + resp, err := client.GetProcessThreadSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSitePhpErrorLogFlag", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessThread", resp, "Failure sending request") return } - result, err = client.GetSitePhpErrorLogFlagResponder(resp) + result, err = client.GetProcessThreadResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSitePhpErrorLogFlag", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessThread", resp, "Failure responding to request") } return } -// GetSitePhpErrorLogFlagPreparer prepares the GetSitePhpErrorLogFlag request. -func (client AppsClient) GetSitePhpErrorLogFlagPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { +// GetProcessThreadPreparer prepares the GetProcessThread request. +func (client AppsClient) GetProcessThreadPreparer(ctx context.Context, resourceGroupName string, name string, processID string, threadID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), + "processId": autorest.Encode("path", processID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "threadId": autorest.Encode("path", threadID), } const APIVersion = "2018-02-01" @@ -13808,39 +13824,43 @@ func (client AppsClient) GetSitePhpErrorLogFlagPreparer(ctx context.Context, res preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/phplogging", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/threads/{threadId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetSitePhpErrorLogFlagSender sends the GetSitePhpErrorLogFlag request. The method will close the +// GetProcessThreadSender sends the GetProcessThread request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetSitePhpErrorLogFlagSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetProcessThreadSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetSitePhpErrorLogFlagResponder handles the response to the GetSitePhpErrorLogFlag request. The method always +// GetProcessThreadResponder handles the response to the GetProcessThread request. The method always // closes the http.Response Body. -func (client AppsClient) GetSitePhpErrorLogFlagResponder(resp *http.Response) (result SitePhpErrorLogFlag, err error) { +func (client AppsClient) GetProcessThreadResponder(resp *http.Response) (result ProcessThreadInfo, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetSitePhpErrorLogFlagSlot gets web app's event logs. +// GetProcessThreadSlot get thread information by Thread ID for a specific process, in a specific scaled-out instance +// in a web site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of web app. -// slot - name of web app slot. If not specified then will default to production slot. -func (client AppsClient) GetSitePhpErrorLogFlagSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result SitePhpErrorLogFlag, err error) { +// name - site name. +// processID - pID. +// threadID - tID. +// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the +// production slot. +func (client AppsClient) GetProcessThreadSlot(ctx context.Context, resourceGroupName string, name string, processID string, threadID string, slot string) (result ProcessThreadInfo, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetSitePhpErrorLogFlagSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetProcessThreadSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -13854,37 +13874,39 @@ func (client AppsClient) GetSitePhpErrorLogFlagSlot(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetSitePhpErrorLogFlagSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetProcessThreadSlot", err.Error()) } - req, err := client.GetSitePhpErrorLogFlagSlotPreparer(ctx, resourceGroupName, name, slot) + req, err := client.GetProcessThreadSlotPreparer(ctx, resourceGroupName, name, processID, threadID, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSitePhpErrorLogFlagSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessThreadSlot", nil, "Failure preparing request") return } - resp, err := client.GetSitePhpErrorLogFlagSlotSender(req) + resp, err := client.GetProcessThreadSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSitePhpErrorLogFlagSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessThreadSlot", resp, "Failure sending request") return } - result, err = client.GetSitePhpErrorLogFlagSlotResponder(resp) + result, err = client.GetProcessThreadSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSitePhpErrorLogFlagSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessThreadSlot", resp, "Failure responding to request") } return } -// GetSitePhpErrorLogFlagSlotPreparer prepares the GetSitePhpErrorLogFlagSlot request. -func (client AppsClient) GetSitePhpErrorLogFlagSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { +// GetProcessThreadSlotPreparer prepares the GetProcessThreadSlot request. +func (client AppsClient) GetProcessThreadSlotPreparer(ctx context.Context, resourceGroupName string, name string, processID string, threadID string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), + "processId": autorest.Encode("path", processID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "threadId": autorest.Encode("path", threadID), } const APIVersion = "2018-02-01" @@ -13895,39 +13917,39 @@ func (client AppsClient) GetSitePhpErrorLogFlagSlotPreparer(ctx context.Context, preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/phplogging", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/threads/{threadId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetSitePhpErrorLogFlagSlotSender sends the GetSitePhpErrorLogFlagSlot request. The method will close the +// GetProcessThreadSlotSender sends the GetProcessThreadSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetSitePhpErrorLogFlagSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetProcessThreadSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetSitePhpErrorLogFlagSlotResponder handles the response to the GetSitePhpErrorLogFlagSlot request. The method always +// GetProcessThreadSlotResponder handles the response to the GetProcessThreadSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetSitePhpErrorLogFlagSlotResponder(resp *http.Response) (result SitePhpErrorLogFlag, err error) { +func (client AppsClient) GetProcessThreadSlotResponder(resp *http.Response) (result ProcessThreadInfo, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetSlot gets the details of a web, mobile, or API app. +// GetPublicCertificate get the named public certificate for an app (or deployment slot, if specified). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// slot - name of the deployment slot. By default, this API returns the production slot. -func (client AppsClient) GetSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result Site, err error) { +// publicCertificateName - public certificate name. +func (client AppsClient) GetPublicCertificate(ctx context.Context, resourceGroupName string, name string, publicCertificateName string) (result PublicCertificate, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetPublicCertificate") defer func() { sc := -1 if result.Response.Response != nil { @@ -13941,37 +13963,37 @@ func (client AppsClient) GetSlot(ctx context.Context, resourceGroupName string, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetPublicCertificate", err.Error()) } - req, err := client.GetSlotPreparer(ctx, resourceGroupName, name, slot) + req, err := client.GetPublicCertificatePreparer(ctx, resourceGroupName, name, publicCertificateName) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPublicCertificate", nil, "Failure preparing request") return } - resp, err := client.GetSlotSender(req) + resp, err := client.GetPublicCertificateSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPublicCertificate", resp, "Failure sending request") return } - result, err = client.GetSlotResponder(resp) + result, err = client.GetPublicCertificateResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPublicCertificate", resp, "Failure responding to request") } return } -// GetSlotPreparer prepares the GetSlot request. -func (client AppsClient) GetSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { +// GetPublicCertificatePreparer prepares the GetPublicCertificate request. +func (client AppsClient) GetPublicCertificatePreparer(ctx context.Context, resourceGroupName string, name string, publicCertificateName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "name": autorest.Encode("path", name), + "publicCertificateName": autorest.Encode("path", publicCertificateName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2018-02-01" @@ -13982,38 +14004,41 @@ func (client AppsClient) GetSlotPreparer(ctx context.Context, resourceGroupName preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetSlotSender sends the GetSlot request. The method will close the +// GetPublicCertificateSender sends the GetPublicCertificate request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetPublicCertificateSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetSlotResponder handles the response to the GetSlot request. The method always +// GetPublicCertificateResponder handles the response to the GetPublicCertificate request. The method always // closes the http.Response Body. -func (client AppsClient) GetSlotResponder(resp *http.Response) (result Site, err error) { +func (client AppsClient) GetPublicCertificateResponder(resp *http.Response) (result PublicCertificate, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetSourceControl gets the source control configuration of an app. +// GetPublicCertificateSlot get the named public certificate for an app (or deployment slot, if specified). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -func (client AppsClient) GetSourceControl(ctx context.Context, resourceGroupName string, name string) (result SiteSourceControl, err error) { +// slot - name of the deployment slot. If a slot is not specified, the API the named binding for the production +// slot. +// publicCertificateName - public certificate name. +func (client AppsClient) GetPublicCertificateSlot(ctx context.Context, resourceGroupName string, name string, slot string, publicCertificateName string) (result PublicCertificate, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetSourceControl") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetPublicCertificateSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -14027,36 +14052,38 @@ func (client AppsClient) GetSourceControl(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetSourceControl", err.Error()) + return result, validation.NewError("web.AppsClient", "GetPublicCertificateSlot", err.Error()) } - req, err := client.GetSourceControlPreparer(ctx, resourceGroupName, name) + req, err := client.GetPublicCertificateSlotPreparer(ctx, resourceGroupName, name, slot, publicCertificateName) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSourceControl", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPublicCertificateSlot", nil, "Failure preparing request") return } - resp, err := client.GetSourceControlSender(req) + resp, err := client.GetPublicCertificateSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSourceControl", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPublicCertificateSlot", resp, "Failure sending request") return } - result, err = client.GetSourceControlResponder(resp) + result, err = client.GetPublicCertificateSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSourceControl", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPublicCertificateSlot", resp, "Failure responding to request") } return } -// GetSourceControlPreparer prepares the GetSourceControl request. -func (client AppsClient) GetSourceControlPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { +// GetPublicCertificateSlotPreparer prepares the GetPublicCertificateSlot request. +func (client AppsClient) GetPublicCertificateSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string, publicCertificateName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "name": autorest.Encode("path", name), + "publicCertificateName": autorest.Encode("path", publicCertificateName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2018-02-01" @@ -14067,40 +14094,39 @@ func (client AppsClient) GetSourceControlPreparer(ctx context.Context, resourceG preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetSourceControlSender sends the GetSourceControl request. The method will close the +// GetPublicCertificateSlotSender sends the GetPublicCertificateSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetSourceControlSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetPublicCertificateSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetSourceControlResponder handles the response to the GetSourceControl request. The method always +// GetPublicCertificateSlotResponder handles the response to the GetPublicCertificateSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetSourceControlResponder(resp *http.Response) (result SiteSourceControl, err error) { +func (client AppsClient) GetPublicCertificateSlotResponder(resp *http.Response) (result PublicCertificate, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetSourceControlSlot gets the source control configuration of an app. +// GetRelayServiceConnection gets a hybrid connection configuration by its name. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// slot - name of the deployment slot. If a slot is not specified, the API will get the source control -// configuration for the production slot. -func (client AppsClient) GetSourceControlSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result SiteSourceControl, err error) { +// entityName - name of the hybrid connection. +func (client AppsClient) GetRelayServiceConnection(ctx context.Context, resourceGroupName string, name string, entityName string) (result RelayServiceConnectionEntity, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetSourceControlSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetRelayServiceConnection") defer func() { sc := -1 if result.Response.Response != nil { @@ -14114,36 +14140,36 @@ func (client AppsClient) GetSourceControlSlot(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetSourceControlSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetRelayServiceConnection", err.Error()) } - req, err := client.GetSourceControlSlotPreparer(ctx, resourceGroupName, name, slot) + req, err := client.GetRelayServiceConnectionPreparer(ctx, resourceGroupName, name, entityName) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSourceControlSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetRelayServiceConnection", nil, "Failure preparing request") return } - resp, err := client.GetSourceControlSlotSender(req) + resp, err := client.GetRelayServiceConnectionSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSourceControlSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetRelayServiceConnection", resp, "Failure sending request") return } - result, err = client.GetSourceControlSlotResponder(resp) + result, err = client.GetRelayServiceConnectionResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSourceControlSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetRelayServiceConnection", resp, "Failure responding to request") } return } -// GetSourceControlSlotPreparer prepares the GetSourceControlSlot request. -func (client AppsClient) GetSourceControlSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { +// GetRelayServiceConnectionPreparer prepares the GetRelayServiceConnection request. +func (client AppsClient) GetRelayServiceConnectionPreparer(ctx context.Context, resourceGroupName string, name string, entityName string) (*http.Request, error) { pathParameters := map[string]interface{}{ + "entityName": autorest.Encode("path", entityName), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -14155,38 +14181,41 @@ func (client AppsClient) GetSourceControlSlotPreparer(ctx context.Context, resou preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetSourceControlSlotSender sends the GetSourceControlSlot request. The method will close the +// GetRelayServiceConnectionSender sends the GetRelayServiceConnection request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetSourceControlSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetRelayServiceConnectionSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetSourceControlSlotResponder handles the response to the GetSourceControlSlot request. The method always +// GetRelayServiceConnectionResponder handles the response to the GetRelayServiceConnection request. The method always // closes the http.Response Body. -func (client AppsClient) GetSourceControlSlotResponder(resp *http.Response) (result SiteSourceControl, err error) { +func (client AppsClient) GetRelayServiceConnectionResponder(resp *http.Response) (result RelayServiceConnectionEntity, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetSwiftVirtualNetworkConnection gets a Swift Virtual Network connection. +// GetRelayServiceConnectionSlot gets a hybrid connection configuration by its name. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -func (client AppsClient) GetSwiftVirtualNetworkConnection(ctx context.Context, resourceGroupName string, name string) (result SwiftVirtualNetwork, err error) { +// entityName - name of the hybrid connection. +// slot - name of the deployment slot. If a slot is not specified, the API will get a hybrid connection for the +// production slot. +func (client AppsClient) GetRelayServiceConnectionSlot(ctx context.Context, resourceGroupName string, name string, entityName string, slot string) (result RelayServiceConnectionEntity, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetSwiftVirtualNetworkConnection") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetRelayServiceConnectionSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -14200,35 +14229,37 @@ func (client AppsClient) GetSwiftVirtualNetworkConnection(ctx context.Context, r Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetSwiftVirtualNetworkConnection", err.Error()) + return result, validation.NewError("web.AppsClient", "GetRelayServiceConnectionSlot", err.Error()) } - req, err := client.GetSwiftVirtualNetworkConnectionPreparer(ctx, resourceGroupName, name) + req, err := client.GetRelayServiceConnectionSlotPreparer(ctx, resourceGroupName, name, entityName, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSwiftVirtualNetworkConnection", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetRelayServiceConnectionSlot", nil, "Failure preparing request") return } - resp, err := client.GetSwiftVirtualNetworkConnectionSender(req) + resp, err := client.GetRelayServiceConnectionSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSwiftVirtualNetworkConnection", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetRelayServiceConnectionSlot", resp, "Failure sending request") return } - result, err = client.GetSwiftVirtualNetworkConnectionResponder(resp) + result, err = client.GetRelayServiceConnectionSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSwiftVirtualNetworkConnection", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetRelayServiceConnectionSlot", resp, "Failure responding to request") } return } -// GetSwiftVirtualNetworkConnectionPreparer prepares the GetSwiftVirtualNetworkConnection request. -func (client AppsClient) GetSwiftVirtualNetworkConnectionPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { +// GetRelayServiceConnectionSlotPreparer prepares the GetRelayServiceConnectionSlot request. +func (client AppsClient) GetRelayServiceConnectionSlotPreparer(ctx context.Context, resourceGroupName string, name string, entityName string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ + "entityName": autorest.Encode("path", entityName), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -14240,21 +14271,21 @@ func (client AppsClient) GetSwiftVirtualNetworkConnectionPreparer(ctx context.Co preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetSwiftVirtualNetworkConnectionSender sends the GetSwiftVirtualNetworkConnection request. The method will close the +// GetRelayServiceConnectionSlotSender sends the GetRelayServiceConnectionSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetSwiftVirtualNetworkConnectionSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetRelayServiceConnectionSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetSwiftVirtualNetworkConnectionResponder handles the response to the GetSwiftVirtualNetworkConnection request. The method always +// GetRelayServiceConnectionSlotResponder handles the response to the GetRelayServiceConnectionSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetSwiftVirtualNetworkConnectionResponder(resp *http.Response) (result SwiftVirtualNetwork, err error) { +func (client AppsClient) GetRelayServiceConnectionSlotResponder(resp *http.Response) (result RelayServiceConnectionEntity, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -14265,15 +14296,14 @@ func (client AppsClient) GetSwiftVirtualNetworkConnectionResponder(resp *http.Re return } -// GetSwiftVirtualNetworkConnectionSlot gets a Swift Virtual Network connection. +// GetSiteExtension get site extension information by its ID for a web site, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -// slot - name of the deployment slot. If a slot is not specified, the API will get a gateway for the -// production slot's Virtual Network. -func (client AppsClient) GetSwiftVirtualNetworkConnectionSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result SwiftVirtualNetwork, err error) { +// name - site name. +// siteExtensionID - site extension name. +func (client AppsClient) GetSiteExtension(ctx context.Context, resourceGroupName string, name string, siteExtensionID string) (result SiteExtensionInfo, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetSwiftVirtualNetworkConnectionSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetSiteExtension") defer func() { sc := -1 if result.Response.Response != nil { @@ -14287,36 +14317,36 @@ func (client AppsClient) GetSwiftVirtualNetworkConnectionSlot(ctx context.Contex Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetSwiftVirtualNetworkConnectionSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetSiteExtension", err.Error()) } - req, err := client.GetSwiftVirtualNetworkConnectionSlotPreparer(ctx, resourceGroupName, name, slot) + req, err := client.GetSiteExtensionPreparer(ctx, resourceGroupName, name, siteExtensionID) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSwiftVirtualNetworkConnectionSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSiteExtension", nil, "Failure preparing request") return } - resp, err := client.GetSwiftVirtualNetworkConnectionSlotSender(req) + resp, err := client.GetSiteExtensionSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSwiftVirtualNetworkConnectionSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSiteExtension", resp, "Failure sending request") return } - result, err = client.GetSwiftVirtualNetworkConnectionSlotResponder(resp) + result, err = client.GetSiteExtensionResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSwiftVirtualNetworkConnectionSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSiteExtension", resp, "Failure responding to request") } return } -// GetSwiftVirtualNetworkConnectionSlotPreparer prepares the GetSwiftVirtualNetworkConnectionSlot request. -func (client AppsClient) GetSwiftVirtualNetworkConnectionSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { +// GetSiteExtensionPreparer prepares the GetSiteExtension request. +func (client AppsClient) GetSiteExtensionPreparer(ctx context.Context, resourceGroupName string, name string, siteExtensionID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), + "siteExtensionId": autorest.Encode("path", siteExtensionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -14328,39 +14358,41 @@ func (client AppsClient) GetSwiftVirtualNetworkConnectionSlotPreparer(ctx contex preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetSwiftVirtualNetworkConnectionSlotSender sends the GetSwiftVirtualNetworkConnectionSlot request. The method will close the +// GetSiteExtensionSender sends the GetSiteExtension request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetSwiftVirtualNetworkConnectionSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetSiteExtensionSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetSwiftVirtualNetworkConnectionSlotResponder handles the response to the GetSwiftVirtualNetworkConnectionSlot request. The method always +// GetSiteExtensionResponder handles the response to the GetSiteExtension request. The method always // closes the http.Response Body. -func (client AppsClient) GetSwiftVirtualNetworkConnectionSlotResponder(resp *http.Response) (result SwiftVirtualNetwork, err error) { +func (client AppsClient) GetSiteExtensionResponder(resp *http.Response) (result SiteExtensionInfo, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetTriggeredWebJob gets a triggered web job by its ID for an app, or a deployment slot. +// GetSiteExtensionSlot get site extension information by its ID for a web site, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. -// webJobName - name of Web Job. -func (client AppsClient) GetTriggeredWebJob(ctx context.Context, resourceGroupName string, name string, webJobName string) (result TriggeredWebJob, err error) { +// siteExtensionID - site extension name. +// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the +// production slot. +func (client AppsClient) GetSiteExtensionSlot(ctx context.Context, resourceGroupName string, name string, siteExtensionID string, slot string) (result SiteExtensionInfo, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetTriggeredWebJob") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetSiteExtensionSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -14374,37 +14406,38 @@ func (client AppsClient) GetTriggeredWebJob(ctx context.Context, resourceGroupNa Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetTriggeredWebJob", err.Error()) + return result, validation.NewError("web.AppsClient", "GetSiteExtensionSlot", err.Error()) } - req, err := client.GetTriggeredWebJobPreparer(ctx, resourceGroupName, name, webJobName) + req, err := client.GetSiteExtensionSlotPreparer(ctx, resourceGroupName, name, siteExtensionID, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetTriggeredWebJob", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSiteExtensionSlot", nil, "Failure preparing request") return } - resp, err := client.GetTriggeredWebJobSender(req) + resp, err := client.GetSiteExtensionSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetTriggeredWebJob", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSiteExtensionSlot", resp, "Failure sending request") return } - result, err = client.GetTriggeredWebJobResponder(resp) + result, err = client.GetSiteExtensionSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetTriggeredWebJob", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSiteExtensionSlot", resp, "Failure responding to request") } return } -// GetTriggeredWebJobPreparer prepares the GetTriggeredWebJob request. -func (client AppsClient) GetTriggeredWebJobPreparer(ctx context.Context, resourceGroupName string, name string, webJobName string) (*http.Request, error) { +// GetSiteExtensionSlotPreparer prepares the GetSiteExtensionSlot request. +func (client AppsClient) GetSiteExtensionSlotPreparer(ctx context.Context, resourceGroupName string, name string, siteExtensionID string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "siteExtensionId": autorest.Encode("path", siteExtensionID), + "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "webJobName": autorest.Encode("path", webJobName), } const APIVersion = "2018-02-01" @@ -14415,21 +14448,21 @@ func (client AppsClient) GetTriggeredWebJobPreparer(ctx context.Context, resourc preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetTriggeredWebJobSender sends the GetTriggeredWebJob request. The method will close the +// GetSiteExtensionSlotSender sends the GetSiteExtensionSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetTriggeredWebJobSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetSiteExtensionSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetTriggeredWebJobResponder handles the response to the GetTriggeredWebJob request. The method always +// GetSiteExtensionSlotResponder handles the response to the GetSiteExtensionSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetTriggeredWebJobResponder(resp *http.Response) (result TriggeredWebJob, err error) { +func (client AppsClient) GetSiteExtensionSlotResponder(resp *http.Response) (result SiteExtensionInfo, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -14440,15 +14473,13 @@ func (client AppsClient) GetTriggeredWebJobResponder(resp *http.Response) (resul return } -// GetTriggeredWebJobHistory gets a triggered web job's history by its ID for an app, , or a deployment slot. +// GetSitePhpErrorLogFlag gets web app's event logs. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - site name. -// webJobName - name of Web Job. -// ID - history ID. -func (client AppsClient) GetTriggeredWebJobHistory(ctx context.Context, resourceGroupName string, name string, webJobName string, ID string) (result TriggeredJobHistory, err error) { +// name - name of web app. +func (client AppsClient) GetSitePhpErrorLogFlag(ctx context.Context, resourceGroupName string, name string) (result SitePhpErrorLogFlag, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetTriggeredWebJobHistory") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetSitePhpErrorLogFlag") defer func() { sc := -1 if result.Response.Response != nil { @@ -14462,38 +14493,36 @@ func (client AppsClient) GetTriggeredWebJobHistory(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetTriggeredWebJobHistory", err.Error()) + return result, validation.NewError("web.AppsClient", "GetSitePhpErrorLogFlag", err.Error()) } - req, err := client.GetTriggeredWebJobHistoryPreparer(ctx, resourceGroupName, name, webJobName, ID) + req, err := client.GetSitePhpErrorLogFlagPreparer(ctx, resourceGroupName, name) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetTriggeredWebJobHistory", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSitePhpErrorLogFlag", nil, "Failure preparing request") return } - resp, err := client.GetTriggeredWebJobHistorySender(req) + resp, err := client.GetSitePhpErrorLogFlagSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetTriggeredWebJobHistory", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSitePhpErrorLogFlag", resp, "Failure sending request") return } - result, err = client.GetTriggeredWebJobHistoryResponder(resp) + result, err = client.GetSitePhpErrorLogFlagResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetTriggeredWebJobHistory", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSitePhpErrorLogFlag", resp, "Failure responding to request") } return } -// GetTriggeredWebJobHistoryPreparer prepares the GetTriggeredWebJobHistory request. -func (client AppsClient) GetTriggeredWebJobHistoryPreparer(ctx context.Context, resourceGroupName string, name string, webJobName string, ID string) (*http.Request, error) { +// GetSitePhpErrorLogFlagPreparer prepares the GetSitePhpErrorLogFlag request. +func (client AppsClient) GetSitePhpErrorLogFlagPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "id": autorest.Encode("path", ID), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "webJobName": autorest.Encode("path", webJobName), } const APIVersion = "2018-02-01" @@ -14504,42 +14533,39 @@ func (client AppsClient) GetTriggeredWebJobHistoryPreparer(ctx context.Context, preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/history/{id}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/phplogging", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetTriggeredWebJobHistorySender sends the GetTriggeredWebJobHistory request. The method will close the +// GetSitePhpErrorLogFlagSender sends the GetSitePhpErrorLogFlag request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetTriggeredWebJobHistorySender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetSitePhpErrorLogFlagSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetTriggeredWebJobHistoryResponder handles the response to the GetTriggeredWebJobHistory request. The method always +// GetSitePhpErrorLogFlagResponder handles the response to the GetSitePhpErrorLogFlag request. The method always // closes the http.Response Body. -func (client AppsClient) GetTriggeredWebJobHistoryResponder(resp *http.Response) (result TriggeredJobHistory, err error) { +func (client AppsClient) GetSitePhpErrorLogFlagResponder(resp *http.Response) (result SitePhpErrorLogFlag, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetTriggeredWebJobHistorySlot gets a triggered web job's history by its ID for an app, , or a deployment slot. +// GetSitePhpErrorLogFlagSlot gets web app's event logs. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - site name. -// webJobName - name of Web Job. -// ID - history ID. -// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the -// production slot. -func (client AppsClient) GetTriggeredWebJobHistorySlot(ctx context.Context, resourceGroupName string, name string, webJobName string, ID string, slot string) (result TriggeredJobHistory, err error) { +// name - name of web app. +// slot - name of web app slot. If not specified then will default to production slot. +func (client AppsClient) GetSitePhpErrorLogFlagSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result SitePhpErrorLogFlag, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetTriggeredWebJobHistorySlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetSitePhpErrorLogFlagSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -14553,39 +14579,37 @@ func (client AppsClient) GetTriggeredWebJobHistorySlot(ctx context.Context, reso Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetTriggeredWebJobHistorySlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetSitePhpErrorLogFlagSlot", err.Error()) } - req, err := client.GetTriggeredWebJobHistorySlotPreparer(ctx, resourceGroupName, name, webJobName, ID, slot) + req, err := client.GetSitePhpErrorLogFlagSlotPreparer(ctx, resourceGroupName, name, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetTriggeredWebJobHistorySlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSitePhpErrorLogFlagSlot", nil, "Failure preparing request") return } - resp, err := client.GetTriggeredWebJobHistorySlotSender(req) + resp, err := client.GetSitePhpErrorLogFlagSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetTriggeredWebJobHistorySlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSitePhpErrorLogFlagSlot", resp, "Failure sending request") return } - result, err = client.GetTriggeredWebJobHistorySlotResponder(resp) + result, err = client.GetSitePhpErrorLogFlagSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetTriggeredWebJobHistorySlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSitePhpErrorLogFlagSlot", resp, "Failure responding to request") } return } -// GetTriggeredWebJobHistorySlotPreparer prepares the GetTriggeredWebJobHistorySlot request. -func (client AppsClient) GetTriggeredWebJobHistorySlotPreparer(ctx context.Context, resourceGroupName string, name string, webJobName string, ID string, slot string) (*http.Request, error) { +// GetSitePhpErrorLogFlagSlotPreparer prepares the GetSitePhpErrorLogFlagSlot request. +func (client AppsClient) GetSitePhpErrorLogFlagSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "id": autorest.Encode("path", ID), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "webJobName": autorest.Encode("path", webJobName), } const APIVersion = "2018-02-01" @@ -14596,41 +14620,39 @@ func (client AppsClient) GetTriggeredWebJobHistorySlotPreparer(ctx context.Conte preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/history/{id}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/phplogging", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetTriggeredWebJobHistorySlotSender sends the GetTriggeredWebJobHistorySlot request. The method will close the +// GetSitePhpErrorLogFlagSlotSender sends the GetSitePhpErrorLogFlagSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetTriggeredWebJobHistorySlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetSitePhpErrorLogFlagSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetTriggeredWebJobHistorySlotResponder handles the response to the GetTriggeredWebJobHistorySlot request. The method always +// GetSitePhpErrorLogFlagSlotResponder handles the response to the GetSitePhpErrorLogFlagSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetTriggeredWebJobHistorySlotResponder(resp *http.Response) (result TriggeredJobHistory, err error) { +func (client AppsClient) GetSitePhpErrorLogFlagSlotResponder(resp *http.Response) (result SitePhpErrorLogFlag, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetTriggeredWebJobSlot gets a triggered web job by its ID for an app, or a deployment slot. +// GetSlot gets the details of a web, mobile, or API app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - site name. -// webJobName - name of Web Job. -// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the -// production slot. -func (client AppsClient) GetTriggeredWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (result TriggeredWebJob, err error) { +// name - name of the app. +// slot - name of the deployment slot. By default, this API returns the production slot. +func (client AppsClient) GetSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result Site, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetTriggeredWebJobSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -14644,38 +14666,37 @@ func (client AppsClient) GetTriggeredWebJobSlot(ctx context.Context, resourceGro Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetTriggeredWebJobSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetSlot", err.Error()) } - req, err := client.GetTriggeredWebJobSlotPreparer(ctx, resourceGroupName, name, webJobName, slot) + req, err := client.GetSlotPreparer(ctx, resourceGroupName, name, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetTriggeredWebJobSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSlot", nil, "Failure preparing request") return } - resp, err := client.GetTriggeredWebJobSlotSender(req) + resp, err := client.GetSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetTriggeredWebJobSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSlot", resp, "Failure sending request") return } - result, err = client.GetTriggeredWebJobSlotResponder(resp) + result, err = client.GetSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetTriggeredWebJobSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSlot", resp, "Failure responding to request") } return } -// GetTriggeredWebJobSlotPreparer prepares the GetTriggeredWebJobSlot request. -func (client AppsClient) GetTriggeredWebJobSlotPreparer(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (*http.Request, error) { +// GetSlotPreparer prepares the GetSlot request. +func (client AppsClient) GetSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "webJobName": autorest.Encode("path", webJobName), } const APIVersion = "2018-02-01" @@ -14686,21 +14707,21 @@ func (client AppsClient) GetTriggeredWebJobSlotPreparer(ctx context.Context, res preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetTriggeredWebJobSlotSender sends the GetTriggeredWebJobSlot request. The method will close the +// GetSlotSender sends the GetSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetTriggeredWebJobSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetTriggeredWebJobSlotResponder handles the response to the GetTriggeredWebJobSlot request. The method always +// GetSlotResponder handles the response to the GetSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetTriggeredWebJobSlotResponder(resp *http.Response) (result TriggeredWebJob, err error) { +func (client AppsClient) GetSlotResponder(resp *http.Response) (result Site, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -14711,14 +14732,13 @@ func (client AppsClient) GetTriggeredWebJobSlotResponder(resp *http.Response) (r return } -// GetVnetConnection gets a virtual network the app (or deployment slot) is connected to by name. +// GetSourceControl gets the source control configuration of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// vnetName - name of the virtual network. -func (client AppsClient) GetVnetConnection(ctx context.Context, resourceGroupName string, name string, vnetName string) (result VnetInfo, err error) { +func (client AppsClient) GetSourceControl(ctx context.Context, resourceGroupName string, name string) (result SiteSourceControl, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetVnetConnection") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetSourceControl") defer func() { sc := -1 if result.Response.Response != nil { @@ -14732,37 +14752,36 @@ func (client AppsClient) GetVnetConnection(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetVnetConnection", err.Error()) + return result, validation.NewError("web.AppsClient", "GetSourceControl", err.Error()) } - req, err := client.GetVnetConnectionPreparer(ctx, resourceGroupName, name, vnetName) + req, err := client.GetSourceControlPreparer(ctx, resourceGroupName, name) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetVnetConnection", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSourceControl", nil, "Failure preparing request") return } - resp, err := client.GetVnetConnectionSender(req) + resp, err := client.GetSourceControlSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetVnetConnection", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSourceControl", resp, "Failure sending request") return } - result, err = client.GetVnetConnectionResponder(resp) + result, err = client.GetSourceControlResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetVnetConnection", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSourceControl", resp, "Failure responding to request") } return } -// GetVnetConnectionPreparer prepares the GetVnetConnection request. -func (client AppsClient) GetVnetConnectionPreparer(ctx context.Context, resourceGroupName string, name string, vnetName string) (*http.Request, error) { +// GetSourceControlPreparer prepares the GetSourceControl request. +func (client AppsClient) GetSourceControlPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vnetName": autorest.Encode("path", vnetName), } const APIVersion = "2018-02-01" @@ -14773,40 +14792,40 @@ func (client AppsClient) GetVnetConnectionPreparer(ctx context.Context, resource preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetVnetConnectionSender sends the GetVnetConnection request. The method will close the +// GetSourceControlSender sends the GetSourceControl request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetVnetConnectionSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetSourceControlSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetVnetConnectionResponder handles the response to the GetVnetConnection request. The method always +// GetSourceControlResponder handles the response to the GetSourceControl request. The method always // closes the http.Response Body. -func (client AppsClient) GetVnetConnectionResponder(resp *http.Response) (result VnetInfo, err error) { +func (client AppsClient) GetSourceControlResponder(resp *http.Response) (result SiteSourceControl, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetVnetConnectionGateway gets an app's Virtual Network gateway. +// GetSourceControlSlot gets the source control configuration of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// vnetName - name of the Virtual Network. -// gatewayName - name of the gateway. Currently, the only supported string is "primary". -func (client AppsClient) GetVnetConnectionGateway(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string) (result VnetGateway, err error) { +// slot - name of the deployment slot. If a slot is not specified, the API will get the source control +// configuration for the production slot. +func (client AppsClient) GetSourceControlSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result SiteSourceControl, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetVnetConnectionGateway") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetSourceControlSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -14820,38 +14839,37 @@ func (client AppsClient) GetVnetConnectionGateway(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetVnetConnectionGateway", err.Error()) + return result, validation.NewError("web.AppsClient", "GetSourceControlSlot", err.Error()) } - req, err := client.GetVnetConnectionGatewayPreparer(ctx, resourceGroupName, name, vnetName, gatewayName) + req, err := client.GetSourceControlSlotPreparer(ctx, resourceGroupName, name, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetVnetConnectionGateway", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSourceControlSlot", nil, "Failure preparing request") return } - resp, err := client.GetVnetConnectionGatewaySender(req) + resp, err := client.GetSourceControlSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetVnetConnectionGateway", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSourceControlSlot", resp, "Failure sending request") return } - result, err = client.GetVnetConnectionGatewayResponder(resp) + result, err = client.GetSourceControlSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetVnetConnectionGateway", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSourceControlSlot", resp, "Failure responding to request") } return } -// GetVnetConnectionGatewayPreparer prepares the GetVnetConnectionGateway request. -func (client AppsClient) GetVnetConnectionGatewayPreparer(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string) (*http.Request, error) { +// GetSourceControlSlotPreparer prepares the GetSourceControlSlot request. +func (client AppsClient) GetSourceControlSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "gatewayName": autorest.Encode("path", gatewayName), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vnetName": autorest.Encode("path", vnetName), } const APIVersion = "2018-02-01" @@ -14862,42 +14880,38 @@ func (client AppsClient) GetVnetConnectionGatewayPreparer(ctx context.Context, r preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetVnetConnectionGatewaySender sends the GetVnetConnectionGateway request. The method will close the +// GetSourceControlSlotSender sends the GetSourceControlSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetVnetConnectionGatewaySender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetSourceControlSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetVnetConnectionGatewayResponder handles the response to the GetVnetConnectionGateway request. The method always +// GetSourceControlSlotResponder handles the response to the GetSourceControlSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetVnetConnectionGatewayResponder(resp *http.Response) (result VnetGateway, err error) { +func (client AppsClient) GetSourceControlSlotResponder(resp *http.Response) (result SiteSourceControl, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetVnetConnectionGatewaySlot gets an app's Virtual Network gateway. +// GetSwiftVirtualNetworkConnection gets a Swift Virtual Network connection. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// vnetName - name of the Virtual Network. -// gatewayName - name of the gateway. Currently, the only supported string is "primary". -// slot - name of the deployment slot. If a slot is not specified, the API will get a gateway for the -// production slot's Virtual Network. -func (client AppsClient) GetVnetConnectionGatewaySlot(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, slot string) (result VnetGateway, err error) { +func (client AppsClient) GetSwiftVirtualNetworkConnection(ctx context.Context, resourceGroupName string, name string) (result SwiftVirtualNetwork, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetVnetConnectionGatewaySlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetSwiftVirtualNetworkConnection") defer func() { sc := -1 if result.Response.Response != nil { @@ -14911,39 +14925,36 @@ func (client AppsClient) GetVnetConnectionGatewaySlot(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetVnetConnectionGatewaySlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetSwiftVirtualNetworkConnection", err.Error()) } - req, err := client.GetVnetConnectionGatewaySlotPreparer(ctx, resourceGroupName, name, vnetName, gatewayName, slot) + req, err := client.GetSwiftVirtualNetworkConnectionPreparer(ctx, resourceGroupName, name) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetVnetConnectionGatewaySlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSwiftVirtualNetworkConnection", nil, "Failure preparing request") return } - resp, err := client.GetVnetConnectionGatewaySlotSender(req) + resp, err := client.GetSwiftVirtualNetworkConnectionSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetVnetConnectionGatewaySlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSwiftVirtualNetworkConnection", resp, "Failure sending request") return } - result, err = client.GetVnetConnectionGatewaySlotResponder(resp) + result, err = client.GetSwiftVirtualNetworkConnectionResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetVnetConnectionGatewaySlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSwiftVirtualNetworkConnection", resp, "Failure responding to request") } return } -// GetVnetConnectionGatewaySlotPreparer prepares the GetVnetConnectionGatewaySlot request. -func (client AppsClient) GetVnetConnectionGatewaySlotPreparer(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, slot string) (*http.Request, error) { +// GetSwiftVirtualNetworkConnectionPreparer prepares the GetSwiftVirtualNetworkConnection request. +func (client AppsClient) GetSwiftVirtualNetworkConnectionPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "gatewayName": autorest.Encode("path", gatewayName), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vnetName": autorest.Encode("path", vnetName), } const APIVersion = "2018-02-01" @@ -14954,41 +14965,40 @@ func (client AppsClient) GetVnetConnectionGatewaySlotPreparer(ctx context.Contex preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetVnetConnectionGatewaySlotSender sends the GetVnetConnectionGatewaySlot request. The method will close the +// GetSwiftVirtualNetworkConnectionSender sends the GetSwiftVirtualNetworkConnection request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetVnetConnectionGatewaySlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetSwiftVirtualNetworkConnectionSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetVnetConnectionGatewaySlotResponder handles the response to the GetVnetConnectionGatewaySlot request. The method always +// GetSwiftVirtualNetworkConnectionResponder handles the response to the GetSwiftVirtualNetworkConnection request. The method always // closes the http.Response Body. -func (client AppsClient) GetVnetConnectionGatewaySlotResponder(resp *http.Response) (result VnetGateway, err error) { +func (client AppsClient) GetSwiftVirtualNetworkConnectionResponder(resp *http.Response) (result SwiftVirtualNetwork, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetVnetConnectionSlot gets a virtual network the app (or deployment slot) is connected to by name. +// GetSwiftVirtualNetworkConnectionSlot gets a Swift Virtual Network connection. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// vnetName - name of the virtual network. -// slot - name of the deployment slot. If a slot is not specified, the API will get the named virtual network -// for the production slot. -func (client AppsClient) GetVnetConnectionSlot(ctx context.Context, resourceGroupName string, name string, vnetName string, slot string) (result VnetInfo, err error) { +// slot - name of the deployment slot. If a slot is not specified, the API will get a gateway for the +// production slot's Virtual Network. +func (client AppsClient) GetSwiftVirtualNetworkConnectionSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result SwiftVirtualNetwork, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetVnetConnectionSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetSwiftVirtualNetworkConnectionSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -15002,38 +15012,37 @@ func (client AppsClient) GetVnetConnectionSlot(ctx context.Context, resourceGrou Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetVnetConnectionSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetSwiftVirtualNetworkConnectionSlot", err.Error()) } - req, err := client.GetVnetConnectionSlotPreparer(ctx, resourceGroupName, name, vnetName, slot) + req, err := client.GetSwiftVirtualNetworkConnectionSlotPreparer(ctx, resourceGroupName, name, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetVnetConnectionSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSwiftVirtualNetworkConnectionSlot", nil, "Failure preparing request") return } - resp, err := client.GetVnetConnectionSlotSender(req) + resp, err := client.GetSwiftVirtualNetworkConnectionSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetVnetConnectionSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSwiftVirtualNetworkConnectionSlot", resp, "Failure sending request") return } - result, err = client.GetVnetConnectionSlotResponder(resp) + result, err = client.GetSwiftVirtualNetworkConnectionSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetVnetConnectionSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSwiftVirtualNetworkConnectionSlot", resp, "Failure responding to request") } return } -// GetVnetConnectionSlotPreparer prepares the GetVnetConnectionSlot request. -func (client AppsClient) GetVnetConnectionSlotPreparer(ctx context.Context, resourceGroupName string, name string, vnetName string, slot string) (*http.Request, error) { +// GetSwiftVirtualNetworkConnectionSlotPreparer prepares the GetSwiftVirtualNetworkConnectionSlot request. +func (client AppsClient) GetSwiftVirtualNetworkConnectionSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vnetName": autorest.Encode("path", vnetName), } const APIVersion = "2018-02-01" @@ -15044,21 +15053,21 @@ func (client AppsClient) GetVnetConnectionSlotPreparer(ctx context.Context, reso preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetVnetConnectionSlotSender sends the GetVnetConnectionSlot request. The method will close the +// GetSwiftVirtualNetworkConnectionSlotSender sends the GetSwiftVirtualNetworkConnectionSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetVnetConnectionSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetSwiftVirtualNetworkConnectionSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetVnetConnectionSlotResponder handles the response to the GetVnetConnectionSlot request. The method always +// GetSwiftVirtualNetworkConnectionSlotResponder handles the response to the GetSwiftVirtualNetworkConnectionSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetVnetConnectionSlotResponder(resp *http.Response) (result VnetInfo, err error) { +func (client AppsClient) GetSwiftVirtualNetworkConnectionSlotResponder(resp *http.Response) (result SwiftVirtualNetwork, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -15069,14 +15078,14 @@ func (client AppsClient) GetVnetConnectionSlotResponder(resp *http.Response) (re return } -// GetWebJob get webjob information for an app, or a deployment slot. +// GetTriggeredWebJob gets a triggered web job by its ID for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. -// webJobName - name of the web job. -func (client AppsClient) GetWebJob(ctx context.Context, resourceGroupName string, name string, webJobName string) (result Job, err error) { +// webJobName - name of Web Job. +func (client AppsClient) GetTriggeredWebJob(ctx context.Context, resourceGroupName string, name string, webJobName string) (result TriggeredWebJob, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetWebJob") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetTriggeredWebJob") defer func() { sc := -1 if result.Response.Response != nil { @@ -15090,32 +15099,32 @@ func (client AppsClient) GetWebJob(ctx context.Context, resourceGroupName string Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetWebJob", err.Error()) + return result, validation.NewError("web.AppsClient", "GetTriggeredWebJob", err.Error()) } - req, err := client.GetWebJobPreparer(ctx, resourceGroupName, name, webJobName) + req, err := client.GetTriggeredWebJobPreparer(ctx, resourceGroupName, name, webJobName) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetWebJob", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetTriggeredWebJob", nil, "Failure preparing request") return } - resp, err := client.GetWebJobSender(req) + resp, err := client.GetTriggeredWebJobSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetWebJob", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetTriggeredWebJob", resp, "Failure sending request") return } - result, err = client.GetWebJobResponder(resp) + result, err = client.GetTriggeredWebJobResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetWebJob", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetTriggeredWebJob", resp, "Failure responding to request") } return } -// GetWebJobPreparer prepares the GetWebJob request. -func (client AppsClient) GetWebJobPreparer(ctx context.Context, resourceGroupName string, name string, webJobName string) (*http.Request, error) { +// GetTriggeredWebJobPreparer prepares the GetTriggeredWebJob request. +func (client AppsClient) GetTriggeredWebJobPreparer(ctx context.Context, resourceGroupName string, name string, webJobName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -15131,41 +15140,40 @@ func (client AppsClient) GetWebJobPreparer(ctx context.Context, resourceGroupNam preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/webjobs/{webJobName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetWebJobSender sends the GetWebJob request. The method will close the +// GetTriggeredWebJobSender sends the GetTriggeredWebJob request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetWebJobSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetTriggeredWebJobSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetWebJobResponder handles the response to the GetWebJob request. The method always +// GetTriggeredWebJobResponder handles the response to the GetTriggeredWebJob request. The method always // closes the http.Response Body. -func (client AppsClient) GetWebJobResponder(resp *http.Response) (result Job, err error) { +func (client AppsClient) GetTriggeredWebJobResponder(resp *http.Response) (result TriggeredWebJob, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetWebJobSlot get webjob information for an app, or a deployment slot. +// GetTriggeredWebJobHistory gets a triggered web job's history by its ID for an app, , or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. -// webJobName - name of the web job. -// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the -// production slot. -func (client AppsClient) GetWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (result Job, err error) { +// webJobName - name of Web Job. +// ID - history ID. +func (client AppsClient) GetTriggeredWebJobHistory(ctx context.Context, resourceGroupName string, name string, webJobName string, ID string) (result TriggeredJobHistory, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetWebJobSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetTriggeredWebJobHistory") defer func() { sc := -1 if result.Response.Response != nil { @@ -15179,36 +15187,36 @@ func (client AppsClient) GetWebJobSlot(ctx context.Context, resourceGroupName st Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetWebJobSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetTriggeredWebJobHistory", err.Error()) } - req, err := client.GetWebJobSlotPreparer(ctx, resourceGroupName, name, webJobName, slot) + req, err := client.GetTriggeredWebJobHistoryPreparer(ctx, resourceGroupName, name, webJobName, ID) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetWebJobSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetTriggeredWebJobHistory", nil, "Failure preparing request") return } - resp, err := client.GetWebJobSlotSender(req) + resp, err := client.GetTriggeredWebJobHistorySender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetWebJobSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetTriggeredWebJobHistory", resp, "Failure sending request") return } - result, err = client.GetWebJobSlotResponder(resp) + result, err = client.GetTriggeredWebJobHistoryResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetWebJobSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetTriggeredWebJobHistory", resp, "Failure responding to request") } return } -// GetWebJobSlotPreparer prepares the GetWebJobSlot request. -func (client AppsClient) GetWebJobSlotPreparer(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (*http.Request, error) { +// GetTriggeredWebJobHistoryPreparer prepares the GetTriggeredWebJobHistory request. +func (client AppsClient) GetTriggeredWebJobHistoryPreparer(ctx context.Context, resourceGroupName string, name string, webJobName string, ID string) (*http.Request, error) { pathParameters := map[string]interface{}{ + "id": autorest.Encode("path", ID), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "webJobName": autorest.Encode("path", webJobName), } @@ -15221,38 +15229,42 @@ func (client AppsClient) GetWebJobSlotPreparer(ctx context.Context, resourceGrou preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/webjobs/{webJobName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/history/{id}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetWebJobSlotSender sends the GetWebJobSlot request. The method will close the +// GetTriggeredWebJobHistorySender sends the GetTriggeredWebJobHistory request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetWebJobSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetTriggeredWebJobHistorySender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetWebJobSlotResponder handles the response to the GetWebJobSlot request. The method always +// GetTriggeredWebJobHistoryResponder handles the response to the GetTriggeredWebJobHistory request. The method always // closes the http.Response Body. -func (client AppsClient) GetWebJobSlotResponder(resp *http.Response) (result Job, err error) { +func (client AppsClient) GetTriggeredWebJobHistoryResponder(resp *http.Response) (result TriggeredJobHistory, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetWebSiteContainerLogs gets the last lines of docker logs for the given site +// GetTriggeredWebJobHistorySlot gets a triggered web job's history by its ID for an app, , or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of web app. -func (client AppsClient) GetWebSiteContainerLogs(ctx context.Context, resourceGroupName string, name string) (result ReadCloser, err error) { +// name - site name. +// webJobName - name of Web Job. +// ID - history ID. +// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the +// production slot. +func (client AppsClient) GetTriggeredWebJobHistorySlot(ctx context.Context, resourceGroupName string, name string, webJobName string, ID string, slot string) (result TriggeredJobHistory, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetWebSiteContainerLogs") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetTriggeredWebJobHistorySlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -15266,36 +15278,39 @@ func (client AppsClient) GetWebSiteContainerLogs(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetWebSiteContainerLogs", err.Error()) + return result, validation.NewError("web.AppsClient", "GetTriggeredWebJobHistorySlot", err.Error()) } - req, err := client.GetWebSiteContainerLogsPreparer(ctx, resourceGroupName, name) + req, err := client.GetTriggeredWebJobHistorySlotPreparer(ctx, resourceGroupName, name, webJobName, ID, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetWebSiteContainerLogs", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetTriggeredWebJobHistorySlot", nil, "Failure preparing request") return } - resp, err := client.GetWebSiteContainerLogsSender(req) + resp, err := client.GetTriggeredWebJobHistorySlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetWebSiteContainerLogs", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetTriggeredWebJobHistorySlot", resp, "Failure sending request") return } - result, err = client.GetWebSiteContainerLogsResponder(resp) + result, err = client.GetTriggeredWebJobHistorySlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetWebSiteContainerLogs", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetTriggeredWebJobHistorySlot", resp, "Failure responding to request") } return } -// GetWebSiteContainerLogsPreparer prepares the GetWebSiteContainerLogs request. -func (client AppsClient) GetWebSiteContainerLogsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { +// GetTriggeredWebJobHistorySlotPreparer prepares the GetTriggeredWebJobHistorySlot request. +func (client AppsClient) GetTriggeredWebJobHistorySlotPreparer(ctx context.Context, resourceGroupName string, name string, webJobName string, ID string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ + "id": autorest.Encode("path", ID), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webJobName": autorest.Encode("path", webJobName), } const APIVersion = "2018-02-01" @@ -15304,40 +15319,43 @@ func (client AppsClient) GetWebSiteContainerLogsPreparer(ctx context.Context, re } preparer := autorest.CreatePreparer( - autorest.AsPost(), + autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/history/{id}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetWebSiteContainerLogsSender sends the GetWebSiteContainerLogs request. The method will close the +// GetTriggeredWebJobHistorySlotSender sends the GetTriggeredWebJobHistorySlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetWebSiteContainerLogsSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetTriggeredWebJobHistorySlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetWebSiteContainerLogsResponder handles the response to the GetWebSiteContainerLogs request. The method always +// GetTriggeredWebJobHistorySlotResponder handles the response to the GetTriggeredWebJobHistorySlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetWebSiteContainerLogsResponder(resp *http.Response) (result ReadCloser, err error) { - result.Value = &resp.Body +func (client AppsClient) GetTriggeredWebJobHistorySlotResponder(resp *http.Response) (result TriggeredJobHistory, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent)) + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetWebSiteContainerLogsSlot gets the last lines of docker logs for the given site +// GetTriggeredWebJobSlot gets a triggered web job by its ID for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of web app. -// slot - name of web app slot. If not specified then will default to production slot. -func (client AppsClient) GetWebSiteContainerLogsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result ReadCloser, err error) { +// name - site name. +// webJobName - name of Web Job. +// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the +// production slot. +func (client AppsClient) GetTriggeredWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (result TriggeredWebJob, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetWebSiteContainerLogsSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetTriggeredWebJobSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -15351,37 +15369,38 @@ func (client AppsClient) GetWebSiteContainerLogsSlot(ctx context.Context, resour Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetWebSiteContainerLogsSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetTriggeredWebJobSlot", err.Error()) } - req, err := client.GetWebSiteContainerLogsSlotPreparer(ctx, resourceGroupName, name, slot) + req, err := client.GetTriggeredWebJobSlotPreparer(ctx, resourceGroupName, name, webJobName, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetWebSiteContainerLogsSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetTriggeredWebJobSlot", nil, "Failure preparing request") return } - resp, err := client.GetWebSiteContainerLogsSlotSender(req) + resp, err := client.GetTriggeredWebJobSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetWebSiteContainerLogsSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetTriggeredWebJobSlot", resp, "Failure sending request") return } - result, err = client.GetWebSiteContainerLogsSlotResponder(resp) + result, err = client.GetTriggeredWebJobSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetWebSiteContainerLogsSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetTriggeredWebJobSlot", resp, "Failure responding to request") } return } -// GetWebSiteContainerLogsSlotPreparer prepares the GetWebSiteContainerLogsSlot request. -func (client AppsClient) GetWebSiteContainerLogsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { +// GetTriggeredWebJobSlotPreparer prepares the GetTriggeredWebJobSlot request. +func (client AppsClient) GetTriggeredWebJobSlotPreparer(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webJobName": autorest.Encode("path", webJobName), } const APIVersion = "2018-02-01" @@ -15390,44 +15409,45 @@ func (client AppsClient) GetWebSiteContainerLogsSlotPreparer(ctx context.Context } preparer := autorest.CreatePreparer( - autorest.AsPost(), + autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetWebSiteContainerLogsSlotSender sends the GetWebSiteContainerLogsSlot request. The method will close the +// GetTriggeredWebJobSlotSender sends the GetTriggeredWebJobSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetWebSiteContainerLogsSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetTriggeredWebJobSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetWebSiteContainerLogsSlotResponder handles the response to the GetWebSiteContainerLogsSlot request. The method always +// GetTriggeredWebJobSlotResponder handles the response to the GetTriggeredWebJobSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetWebSiteContainerLogsSlotResponder(resp *http.Response) (result ReadCloser, err error) { - result.Value = &resp.Body +func (client AppsClient) GetTriggeredWebJobSlotResponder(resp *http.Response) (result TriggeredWebJob, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent)) + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// InstallSiteExtension install site extension on a web site, or a deployment slot. +// GetVnetConnection gets a virtual network the app (or deployment slot) is connected to by name. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - site name. -// siteExtensionID - site extension name. -func (client AppsClient) InstallSiteExtension(ctx context.Context, resourceGroupName string, name string, siteExtensionID string) (result AppsInstallSiteExtensionFuture, err error) { +// name - name of the app. +// vnetName - name of the virtual network. +func (client AppsClient) GetVnetConnection(ctx context.Context, resourceGroupName string, name string, vnetName string) (result VnetInfo, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.InstallSiteExtension") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetVnetConnection") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -15437,31 +15457,37 @@ func (client AppsClient) InstallSiteExtension(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "InstallSiteExtension", err.Error()) + return result, validation.NewError("web.AppsClient", "GetVnetConnection", err.Error()) } - req, err := client.InstallSiteExtensionPreparer(ctx, resourceGroupName, name, siteExtensionID) + req, err := client.GetVnetConnectionPreparer(ctx, resourceGroupName, name, vnetName) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "InstallSiteExtension", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetVnetConnection", nil, "Failure preparing request") return } - result, err = client.InstallSiteExtensionSender(req) + resp, err := client.GetVnetConnectionSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "InstallSiteExtension", result.Response(), "Failure sending request") + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetVnetConnection", resp, "Failure sending request") return } + result, err = client.GetVnetConnectionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetVnetConnection", resp, "Failure responding to request") + } + return } -// InstallSiteExtensionPreparer prepares the InstallSiteExtension request. -func (client AppsClient) InstallSiteExtensionPreparer(ctx context.Context, resourceGroupName string, name string, siteExtensionID string) (*http.Request, error) { +// GetVnetConnectionPreparer prepares the GetVnetConnection request. +func (client AppsClient) GetVnetConnectionPreparer(ctx context.Context, resourceGroupName string, name string, vnetName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "siteExtensionId": autorest.Encode("path", siteExtensionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vnetName": autorest.Encode("path", vnetName), } const APIVersion = "2018-02-01" @@ -15470,53 +15496,46 @@ func (client AppsClient) InstallSiteExtensionPreparer(ctx context.Context, resou } preparer := autorest.CreatePreparer( - autorest.AsPut(), + autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// InstallSiteExtensionSender sends the InstallSiteExtension request. The method will close the +// GetVnetConnectionSender sends the GetVnetConnection request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) InstallSiteExtensionSender(req *http.Request) (future AppsInstallSiteExtensionFuture, err error) { +func (client AppsClient) GetVnetConnectionSender(req *http.Request) (*http.Response, 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 + return autorest.SendWithSender(client, req, sd...) } -// InstallSiteExtensionResponder handles the response to the InstallSiteExtension request. The method always +// GetVnetConnectionResponder handles the response to the GetVnetConnection request. The method always // closes the http.Response Body. -func (client AppsClient) InstallSiteExtensionResponder(resp *http.Response) (result SiteExtensionInfo, err error) { +func (client AppsClient) GetVnetConnectionResponder(resp *http.Response) (result VnetInfo, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusTooManyRequests), + azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// InstallSiteExtensionSlot install site extension on a web site, or a deployment slot. +// GetVnetConnectionGateway gets an app's Virtual Network gateway. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - site name. -// siteExtensionID - site extension name. -// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the -// production slot. -func (client AppsClient) InstallSiteExtensionSlot(ctx context.Context, resourceGroupName string, name string, siteExtensionID string, slot string) (result AppsInstallSiteExtensionSlotFuture, err error) { +// name - name of the app. +// vnetName - name of the Virtual Network. +// gatewayName - name of the gateway. Currently, the only supported string is "primary". +func (client AppsClient) GetVnetConnectionGateway(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string) (result VnetGateway, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.InstallSiteExtensionSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetVnetConnectionGateway") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -15526,32 +15545,38 @@ func (client AppsClient) InstallSiteExtensionSlot(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "InstallSiteExtensionSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetVnetConnectionGateway", err.Error()) } - req, err := client.InstallSiteExtensionSlotPreparer(ctx, resourceGroupName, name, siteExtensionID, slot) + req, err := client.GetVnetConnectionGatewayPreparer(ctx, resourceGroupName, name, vnetName, gatewayName) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "InstallSiteExtensionSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetVnetConnectionGateway", nil, "Failure preparing request") return } - result, err = client.InstallSiteExtensionSlotSender(req) + resp, err := client.GetVnetConnectionGatewaySender(req) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "InstallSiteExtensionSlot", result.Response(), "Failure sending request") + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetVnetConnectionGateway", resp, "Failure sending request") return } + result, err = client.GetVnetConnectionGatewayResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetVnetConnectionGateway", resp, "Failure responding to request") + } + return } -// InstallSiteExtensionSlotPreparer prepares the InstallSiteExtensionSlot request. -func (client AppsClient) InstallSiteExtensionSlotPreparer(ctx context.Context, resourceGroupName string, name string, siteExtensionID string, slot string) (*http.Request, error) { +// GetVnetConnectionGatewayPreparer prepares the GetVnetConnectionGateway request. +func (client AppsClient) GetVnetConnectionGatewayPreparer(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string) (*http.Request, error) { pathParameters := map[string]interface{}{ + "gatewayName": autorest.Encode("path", gatewayName), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "siteExtensionId": autorest.Encode("path", siteExtensionID), - "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vnetName": autorest.Encode("path", vnetName), } const APIVersion = "2018-02-01" @@ -15560,46 +15585,44 @@ func (client AppsClient) InstallSiteExtensionSlotPreparer(ctx context.Context, r } preparer := autorest.CreatePreparer( - autorest.AsPut(), + autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// InstallSiteExtensionSlotSender sends the InstallSiteExtensionSlot request. The method will close the +// GetVnetConnectionGatewaySender sends the GetVnetConnectionGateway request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) InstallSiteExtensionSlotSender(req *http.Request) (future AppsInstallSiteExtensionSlotFuture, err error) { +func (client AppsClient) GetVnetConnectionGatewaySender(req *http.Request) (*http.Response, 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 + return autorest.SendWithSender(client, req, sd...) } -// InstallSiteExtensionSlotResponder handles the response to the InstallSiteExtensionSlot request. The method always +// GetVnetConnectionGatewayResponder handles the response to the GetVnetConnectionGateway request. The method always // closes the http.Response Body. -func (client AppsClient) InstallSiteExtensionSlotResponder(resp *http.Response) (result SiteExtensionInfo, err error) { +func (client AppsClient) GetVnetConnectionGatewayResponder(resp *http.Response) (result VnetGateway, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusTooManyRequests), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// IsCloneable shows whether an app can be cloned to another resource group or subscription. +// GetVnetConnectionGatewaySlot gets an app's Virtual Network gateway. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -func (client AppsClient) IsCloneable(ctx context.Context, resourceGroupName string, name string) (result SiteCloneability, err error) { +// vnetName - name of the Virtual Network. +// gatewayName - name of the gateway. Currently, the only supported string is "primary". +// slot - name of the deployment slot. If a slot is not specified, the API will get a gateway for the +// production slot's Virtual Network. +func (client AppsClient) GetVnetConnectionGatewaySlot(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, slot string) (result VnetGateway, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.IsCloneable") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetVnetConnectionGatewaySlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -15613,36 +15636,39 @@ func (client AppsClient) IsCloneable(ctx context.Context, resourceGroupName stri Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "IsCloneable", err.Error()) + return result, validation.NewError("web.AppsClient", "GetVnetConnectionGatewaySlot", err.Error()) } - req, err := client.IsCloneablePreparer(ctx, resourceGroupName, name) + req, err := client.GetVnetConnectionGatewaySlotPreparer(ctx, resourceGroupName, name, vnetName, gatewayName, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "IsCloneable", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetVnetConnectionGatewaySlot", nil, "Failure preparing request") return } - resp, err := client.IsCloneableSender(req) + resp, err := client.GetVnetConnectionGatewaySlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "IsCloneable", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetVnetConnectionGatewaySlot", resp, "Failure sending request") return } - result, err = client.IsCloneableResponder(resp) + result, err = client.GetVnetConnectionGatewaySlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "IsCloneable", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetVnetConnectionGatewaySlot", resp, "Failure responding to request") } return } -// IsCloneablePreparer prepares the IsCloneable request. -func (client AppsClient) IsCloneablePreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { +// GetVnetConnectionGatewaySlotPreparer prepares the GetVnetConnectionGatewaySlot request. +func (client AppsClient) GetVnetConnectionGatewaySlotPreparer(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ + "gatewayName": autorest.Encode("path", gatewayName), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vnetName": autorest.Encode("path", vnetName), } const APIVersion = "2018-02-01" @@ -15651,41 +15677,43 @@ func (client AppsClient) IsCloneablePreparer(ctx context.Context, resourceGroupN } preparer := autorest.CreatePreparer( - autorest.AsPost(), + autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/iscloneable", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// IsCloneableSender sends the IsCloneable request. The method will close the +// GetVnetConnectionGatewaySlotSender sends the GetVnetConnectionGatewaySlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) IsCloneableSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetVnetConnectionGatewaySlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// IsCloneableResponder handles the response to the IsCloneable request. The method always +// GetVnetConnectionGatewaySlotResponder handles the response to the GetVnetConnectionGatewaySlot request. The method always // closes the http.Response Body. -func (client AppsClient) IsCloneableResponder(resp *http.Response) (result SiteCloneability, err error) { +func (client AppsClient) GetVnetConnectionGatewaySlotResponder(resp *http.Response) (result VnetGateway, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// IsCloneableSlot shows whether an app can be cloned to another resource group or subscription. +// GetVnetConnectionSlot gets a virtual network the app (or deployment slot) is connected to by name. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// slot - name of the deployment slot. By default, this API returns information on the production slot. -func (client AppsClient) IsCloneableSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result SiteCloneability, err error) { +// vnetName - name of the virtual network. +// slot - name of the deployment slot. If a slot is not specified, the API will get the named virtual network +// for the production slot. +func (client AppsClient) GetVnetConnectionSlot(ctx context.Context, resourceGroupName string, name string, vnetName string, slot string) (result VnetInfo, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.IsCloneableSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetVnetConnectionSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -15699,37 +15727,38 @@ func (client AppsClient) IsCloneableSlot(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "IsCloneableSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetVnetConnectionSlot", err.Error()) } - req, err := client.IsCloneableSlotPreparer(ctx, resourceGroupName, name, slot) + req, err := client.GetVnetConnectionSlotPreparer(ctx, resourceGroupName, name, vnetName, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "IsCloneableSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetVnetConnectionSlot", nil, "Failure preparing request") return } - resp, err := client.IsCloneableSlotSender(req) + resp, err := client.GetVnetConnectionSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "IsCloneableSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetVnetConnectionSlot", resp, "Failure sending request") return } - result, err = client.IsCloneableSlotResponder(resp) + result, err = client.GetVnetConnectionSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "IsCloneableSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetVnetConnectionSlot", resp, "Failure responding to request") } return } -// IsCloneableSlotPreparer prepares the IsCloneableSlot request. -func (client AppsClient) IsCloneableSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { +// GetVnetConnectionSlotPreparer prepares the GetVnetConnectionSlot request. +func (client AppsClient) GetVnetConnectionSlotPreparer(ctx context.Context, resourceGroupName string, name string, vnetName string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vnetName": autorest.Encode("path", vnetName), } const APIVersion = "2018-02-01" @@ -15738,23 +15767,23 @@ func (client AppsClient) IsCloneableSlotPreparer(ctx context.Context, resourceGr } preparer := autorest.CreatePreparer( - autorest.AsPost(), + autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/iscloneable", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// IsCloneableSlotSender sends the IsCloneableSlot request. The method will close the +// GetVnetConnectionSlotSender sends the GetVnetConnectionSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) IsCloneableSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetVnetConnectionSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// IsCloneableSlotResponder handles the response to the IsCloneableSlot request. The method always +// GetVnetConnectionSlotResponder handles the response to the GetVnetConnectionSlot request. The method always // closes the http.Response Body. -func (client AppsClient) IsCloneableSlotResponder(resp *http.Response) (result SiteCloneability, err error) { +func (client AppsClient) GetVnetConnectionSlotResponder(resp *http.Response) (result VnetInfo, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -15765,44 +15794,58 @@ func (client AppsClient) IsCloneableSlotResponder(resp *http.Response) (result S return } -// List get all apps for a subscription. -func (client AppsClient) List(ctx context.Context) (result AppCollectionPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.List") - defer func() { +// GetWebJob get webjob information for an app, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// webJobName - name of the web job. +func (client AppsClient) GetWebJob(ctx context.Context, resourceGroupName string, name string, webJobName string) (result Job, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetWebJob") + defer func() { sc := -1 - if result.ac.Response.Response != nil { - sc = result.ac.Response.Response.StatusCode + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetWebJob", err.Error()) + } + + req, err := client.GetWebJobPreparer(ctx, resourceGroupName, name, webJobName) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "List", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetWebJob", nil, "Failure preparing request") return } - resp, err := client.ListSender(req) + resp, err := client.GetWebJobSender(req) if err != nil { - result.ac.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "List", resp, "Failure sending request") + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetWebJob", resp, "Failure sending request") return } - result.ac, err = client.ListResponder(resp) + result, err = client.GetWebJobResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "List", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetWebJob", resp, "Failure responding to request") } return } -// ListPreparer prepares the List request. -func (client AppsClient) ListPreparer(ctx context.Context) (*http.Request, error) { +// GetWebJobPreparer prepares the GetWebJob request. +func (client AppsClient) GetWebJobPreparer(ctx context.Context, resourceGroupName string, name string, webJobName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webJobName": autorest.Encode("path", webJobName), } const APIVersion = "2018-02-01" @@ -15813,21 +15856,21 @@ func (client AppsClient) ListPreparer(ctx context.Context) (*http.Request, error preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/sites", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/webjobs/{webJobName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListSender sends the List request. The method will close the +// GetWebJobSender sends the GetWebJob request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) ListSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetWebJobSender(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 +// GetWebJobResponder handles the response to the GetWebJob request. The method always // closes the http.Response Body. -func (client AppsClient) ListResponder(resp *http.Response) (result AppCollection, err error) { +func (client AppsClient) GetWebJobResponder(resp *http.Response) (result Job, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -15838,50 +15881,16 @@ func (client AppsClient) ListResponder(resp *http.Response) (result AppCollectio return } -// listNextResults retrieves the next set of results, if any. -func (client AppsClient) listNextResults(ctx context.Context, lastResults AppCollection) (result AppCollection, err error) { - req, err := lastResults.appCollectionPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "web.AppsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "web.AppsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client AppsClient) ListComplete(ctx context.Context) (result AppCollectionIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListApplicationSettings gets the application settings of an app. +// GetWebJobSlot get webjob information for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -func (client AppsClient) ListApplicationSettings(ctx context.Context, resourceGroupName string, name string) (result StringDictionary, err error) { +// name - site name. +// webJobName - name of the web job. +// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the +// production slot. +func (client AppsClient) GetWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (result Job, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListApplicationSettings") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetWebJobSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -15895,36 +15904,38 @@ func (client AppsClient) ListApplicationSettings(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "ListApplicationSettings", err.Error()) + return result, validation.NewError("web.AppsClient", "GetWebJobSlot", err.Error()) } - req, err := client.ListApplicationSettingsPreparer(ctx, resourceGroupName, name) + req, err := client.GetWebJobSlotPreparer(ctx, resourceGroupName, name, webJobName, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListApplicationSettings", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetWebJobSlot", nil, "Failure preparing request") return } - resp, err := client.ListApplicationSettingsSender(req) + resp, err := client.GetWebJobSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListApplicationSettings", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetWebJobSlot", resp, "Failure sending request") return } - result, err = client.ListApplicationSettingsResponder(resp) + result, err = client.GetWebJobSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListApplicationSettings", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetWebJobSlot", resp, "Failure responding to request") } return } -// ListApplicationSettingsPreparer prepares the ListApplicationSettings request. -func (client AppsClient) ListApplicationSettingsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { +// GetWebJobSlotPreparer prepares the GetWebJobSlot request. +func (client AppsClient) GetWebJobSlotPreparer(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webJobName": autorest.Encode("path", webJobName), } const APIVersion = "2018-02-01" @@ -15933,23 +15944,23 @@ func (client AppsClient) ListApplicationSettingsPreparer(ctx context.Context, re } preparer := autorest.CreatePreparer( - autorest.AsPost(), + autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/appsettings/list", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/webjobs/{webJobName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListApplicationSettingsSender sends the ListApplicationSettings request. The method will close the +// GetWebJobSlotSender sends the GetWebJobSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) ListApplicationSettingsSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetWebJobSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// ListApplicationSettingsResponder handles the response to the ListApplicationSettings request. The method always +// GetWebJobSlotResponder handles the response to the GetWebJobSlot request. The method always // closes the http.Response Body. -func (client AppsClient) ListApplicationSettingsResponder(resp *http.Response) (result StringDictionary, err error) { +func (client AppsClient) GetWebJobSlotResponder(resp *http.Response) (result Job, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -15960,15 +15971,13 @@ func (client AppsClient) ListApplicationSettingsResponder(resp *http.Response) ( return } -// ListApplicationSettingsSlot gets the application settings of an app. +// GetWebSiteContainerLogs gets the last lines of docker logs for the given site // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -// slot - name of the deployment slot. If a slot is not specified, the API will get the application settings -// for the production slot. -func (client AppsClient) ListApplicationSettingsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result StringDictionary, err error) { +// name - name of web app. +func (client AppsClient) GetWebSiteContainerLogs(ctx context.Context, resourceGroupName string, name string) (result ReadCloser, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListApplicationSettingsSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetWebSiteContainerLogs") defer func() { sc := -1 if result.Response.Response != nil { @@ -15982,36 +15991,35 @@ func (client AppsClient) ListApplicationSettingsSlot(ctx context.Context, resour Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "ListApplicationSettingsSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetWebSiteContainerLogs", err.Error()) } - req, err := client.ListApplicationSettingsSlotPreparer(ctx, resourceGroupName, name, slot) + req, err := client.GetWebSiteContainerLogsPreparer(ctx, resourceGroupName, name) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListApplicationSettingsSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetWebSiteContainerLogs", nil, "Failure preparing request") return } - resp, err := client.ListApplicationSettingsSlotSender(req) + resp, err := client.GetWebSiteContainerLogsSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListApplicationSettingsSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetWebSiteContainerLogs", resp, "Failure sending request") return } - result, err = client.ListApplicationSettingsSlotResponder(resp) + result, err = client.GetWebSiteContainerLogsResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListApplicationSettingsSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetWebSiteContainerLogs", resp, "Failure responding to request") } return } -// ListApplicationSettingsSlotPreparer prepares the ListApplicationSettingsSlot request. -func (client AppsClient) ListApplicationSettingsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { +// GetWebSiteContainerLogsPreparer prepares the GetWebSiteContainerLogs request. +func (client AppsClient) GetWebSiteContainerLogsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -16023,38 +16031,38 @@ func (client AppsClient) ListApplicationSettingsSlotPreparer(ctx context.Context preparer := autorest.CreatePreparer( autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings/list", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListApplicationSettingsSlotSender sends the ListApplicationSettingsSlot request. The method will close the +// GetWebSiteContainerLogsSender sends the GetWebSiteContainerLogs request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) ListApplicationSettingsSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetWebSiteContainerLogsSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// ListApplicationSettingsSlotResponder handles the response to the ListApplicationSettingsSlot request. The method always +// GetWebSiteContainerLogsResponder handles the response to the GetWebSiteContainerLogs request. The method always // closes the http.Response Body. -func (client AppsClient) ListApplicationSettingsSlotResponder(resp *http.Response) (result StringDictionary, err error) { +func (client AppsClient) GetWebSiteContainerLogsResponder(resp *http.Response) (result ReadCloser, err error) { + result.Value = &resp.Body err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent)) result.Response = autorest.Response{Response: resp} return } -// ListAzureStorageAccounts gets the Azure storage account configurations of an app. +// GetWebSiteContainerLogsSlot gets the last lines of docker logs for the given site // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -func (client AppsClient) ListAzureStorageAccounts(ctx context.Context, resourceGroupName string, name string) (result AzureStoragePropertyDictionaryResource, err error) { +// name - name of web app. +// slot - name of web app slot. If not specified then will default to production slot. +func (client AppsClient) GetWebSiteContainerLogsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result ReadCloser, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListAzureStorageAccounts") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetWebSiteContainerLogsSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -16068,35 +16076,36 @@ func (client AppsClient) ListAzureStorageAccounts(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "ListAzureStorageAccounts", err.Error()) + return result, validation.NewError("web.AppsClient", "GetWebSiteContainerLogsSlot", err.Error()) } - req, err := client.ListAzureStorageAccountsPreparer(ctx, resourceGroupName, name) + req, err := client.GetWebSiteContainerLogsSlotPreparer(ctx, resourceGroupName, name, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListAzureStorageAccounts", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetWebSiteContainerLogsSlot", nil, "Failure preparing request") return } - resp, err := client.ListAzureStorageAccountsSender(req) + resp, err := client.GetWebSiteContainerLogsSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListAzureStorageAccounts", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetWebSiteContainerLogsSlot", resp, "Failure sending request") return } - result, err = client.ListAzureStorageAccountsResponder(resp) + result, err = client.GetWebSiteContainerLogsSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListAzureStorageAccounts", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetWebSiteContainerLogsSlot", resp, "Failure responding to request") } return } -// ListAzureStorageAccountsPreparer prepares the ListAzureStorageAccounts request. -func (client AppsClient) ListAzureStorageAccountsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { +// GetWebSiteContainerLogsSlotPreparer prepares the GetWebSiteContainerLogsSlot request. +func (client AppsClient) GetWebSiteContainerLogsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -16108,44 +16117,42 @@ func (client AppsClient) ListAzureStorageAccountsPreparer(ctx context.Context, r preparer := autorest.CreatePreparer( autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/azurestorageaccounts/list", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListAzureStorageAccountsSender sends the ListAzureStorageAccounts request. The method will close the +// GetWebSiteContainerLogsSlotSender sends the GetWebSiteContainerLogsSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) ListAzureStorageAccountsSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetWebSiteContainerLogsSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// ListAzureStorageAccountsResponder handles the response to the ListAzureStorageAccounts request. The method always +// GetWebSiteContainerLogsSlotResponder handles the response to the GetWebSiteContainerLogsSlot request. The method always // closes the http.Response Body. -func (client AppsClient) ListAzureStorageAccountsResponder(resp *http.Response) (result AzureStoragePropertyDictionaryResource, err error) { +func (client AppsClient) GetWebSiteContainerLogsSlotResponder(resp *http.Response) (result ReadCloser, err error) { + result.Value = &resp.Body err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent)) result.Response = autorest.Response{Response: resp} return } -// ListAzureStorageAccountsSlot gets the Azure storage account configurations of an app. +// InstallSiteExtension install site extension on a web site, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -// slot - name of the deployment slot. If a slot is not specified, the API will update the Azure storage -// account configurations for the production slot. -func (client AppsClient) ListAzureStorageAccountsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result AzureStoragePropertyDictionaryResource, err error) { +// name - site name. +// siteExtensionID - site extension name. +func (client AppsClient) InstallSiteExtension(ctx context.Context, resourceGroupName string, name string, siteExtensionID string) (result AppsInstallSiteExtensionFuture, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListAzureStorageAccountsSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.InstallSiteExtension") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.Response() != nil { + sc = result.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -16155,35 +16162,119 @@ func (client AppsClient) ListAzureStorageAccountsSlot(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "ListAzureStorageAccountsSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "InstallSiteExtension", err.Error()) } - req, err := client.ListAzureStorageAccountsSlotPreparer(ctx, resourceGroupName, name, slot) + req, err := client.InstallSiteExtensionPreparer(ctx, resourceGroupName, name, siteExtensionID) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListAzureStorageAccountsSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "InstallSiteExtension", nil, "Failure preparing request") return } - resp, err := client.ListAzureStorageAccountsSlotSender(req) + result, err = client.InstallSiteExtensionSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListAzureStorageAccountsSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "InstallSiteExtension", result.Response(), "Failure sending request") return } - result, err = client.ListAzureStorageAccountsSlotResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListAzureStorageAccountsSlot", resp, "Failure responding to request") - } - return } -// ListAzureStorageAccountsSlotPreparer prepares the ListAzureStorageAccountsSlot request. -func (client AppsClient) ListAzureStorageAccountsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { - pathParameters := map[string]interface{}{ +// InstallSiteExtensionPreparer prepares the InstallSiteExtension request. +func (client AppsClient) InstallSiteExtensionPreparer(ctx context.Context, resourceGroupName string, name string, siteExtensionID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "siteExtensionId": autorest.Encode("path", siteExtensionID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// InstallSiteExtensionSender sends the InstallSiteExtension request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) InstallSiteExtensionSender(req *http.Request) (future AppsInstallSiteExtensionFuture, err error) { + 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 +} + +// InstallSiteExtensionResponder handles the response to the InstallSiteExtension request. The method always +// closes the http.Response Body. +func (client AppsClient) InstallSiteExtensionResponder(resp *http.Response) (result SiteExtensionInfo, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusTooManyRequests), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// InstallSiteExtensionSlot install site extension on a web site, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// siteExtensionID - site extension name. +// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the +// production slot. +func (client AppsClient) InstallSiteExtensionSlot(ctx context.Context, resourceGroupName string, name string, siteExtensionID string, slot string) (result AppsInstallSiteExtensionSlotFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.InstallSiteExtensionSlot") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "InstallSiteExtensionSlot", err.Error()) + } + + req, err := client.InstallSiteExtensionSlotPreparer(ctx, resourceGroupName, name, siteExtensionID, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "InstallSiteExtensionSlot", nil, "Failure preparing request") + return + } + + result, err = client.InstallSiteExtensionSlotSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "InstallSiteExtensionSlot", result.Response(), "Failure sending request") + return + } + + return +} + +// InstallSiteExtensionSlotPreparer prepares the InstallSiteExtensionSlot request. +func (client AppsClient) InstallSiteExtensionSlotPreparer(ctx context.Context, resourceGroupName string, name string, siteExtensionID string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "siteExtensionId": autorest.Encode("path", siteExtensionID), "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -16193,24 +16284,115 @@ func (client AppsClient) ListAzureStorageAccountsSlotPreparer(ctx context.Contex "api-version": APIVersion, } + preparer := autorest.CreatePreparer( + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// InstallSiteExtensionSlotSender sends the InstallSiteExtensionSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) InstallSiteExtensionSlotSender(req *http.Request) (future AppsInstallSiteExtensionSlotFuture, err error) { + 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 +} + +// InstallSiteExtensionSlotResponder handles the response to the InstallSiteExtensionSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) InstallSiteExtensionSlotResponder(resp *http.Response) (result SiteExtensionInfo, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusTooManyRequests), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// IsCloneable shows whether an app can be cloned to another resource group or subscription. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) IsCloneable(ctx context.Context, resourceGroupName string, name string) (result SiteCloneability, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.IsCloneable") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "IsCloneable", err.Error()) + } + + req, err := client.IsCloneablePreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "IsCloneable", nil, "Failure preparing request") + return + } + + resp, err := client.IsCloneableSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "IsCloneable", resp, "Failure sending request") + return + } + + result, err = client.IsCloneableResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "IsCloneable", resp, "Failure responding to request") + } + + return +} + +// IsCloneablePreparer prepares the IsCloneable request. +func (client AppsClient) IsCloneablePreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + preparer := autorest.CreatePreparer( autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/azurestorageaccounts/list", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/iscloneable", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListAzureStorageAccountsSlotSender sends the ListAzureStorageAccountsSlot request. The method will close the +// IsCloneableSender sends the IsCloneable request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) ListAzureStorageAccountsSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) IsCloneableSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// ListAzureStorageAccountsSlotResponder handles the response to the ListAzureStorageAccountsSlot request. The method always +// IsCloneableResponder handles the response to the IsCloneable request. The method always // closes the http.Response Body. -func (client AppsClient) ListAzureStorageAccountsSlotResponder(resp *http.Response) (result AzureStoragePropertyDictionaryResource, err error) { +func (client AppsClient) IsCloneableResponder(resp *http.Response) (result SiteCloneability, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -16221,17 +16403,18 @@ func (client AppsClient) ListAzureStorageAccountsSlotResponder(resp *http.Respon return } -// ListBackups gets existing backups of an app. +// IsCloneableSlot shows whether an app can be cloned to another resource group or subscription. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -func (client AppsClient) ListBackups(ctx context.Context, resourceGroupName string, name string) (result BackupItemCollectionPage, err error) { +// slot - name of the deployment slot. By default, this API returns information on the production slot. +func (client AppsClient) IsCloneableSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result SiteCloneability, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListBackups") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.IsCloneableSlot") defer func() { sc := -1 - if result.bic.Response.Response != nil { - sc = result.bic.Response.Response.StatusCode + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -16241,36 +16424,36 @@ func (client AppsClient) ListBackups(ctx context.Context, resourceGroupName stri Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "ListBackups", err.Error()) + return result, validation.NewError("web.AppsClient", "IsCloneableSlot", err.Error()) } - result.fn = client.listBackupsNextResults - req, err := client.ListBackupsPreparer(ctx, resourceGroupName, name) + req, err := client.IsCloneableSlotPreparer(ctx, resourceGroupName, name, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListBackups", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "IsCloneableSlot", nil, "Failure preparing request") return } - resp, err := client.ListBackupsSender(req) + resp, err := client.IsCloneableSlotSender(req) if err != nil { - result.bic.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListBackups", resp, "Failure sending request") + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "IsCloneableSlot", resp, "Failure sending request") return } - result.bic, err = client.ListBackupsResponder(resp) + result, err = client.IsCloneableSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListBackups", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "IsCloneableSlot", resp, "Failure responding to request") } return } -// ListBackupsPreparer prepares the ListBackups request. -func (client AppsClient) ListBackupsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { +// IsCloneableSlotPreparer prepares the IsCloneableSlot request. +func (client AppsClient) IsCloneableSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -16279,24 +16462,1022 @@ func (client AppsClient) ListBackupsPreparer(ctx context.Context, resourceGroupN "api-version": APIVersion, } + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/iscloneable", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// IsCloneableSlotSender sends the IsCloneableSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) IsCloneableSlotSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// IsCloneableSlotResponder handles the response to the IsCloneableSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) IsCloneableSlotResponder(resp *http.Response) (result SiteCloneability, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List get all apps for a subscription. +func (client AppsClient) List(ctx context.Context) (result AppCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.List") + defer func() { + sc := -1 + if result.ac.Response.Response != nil { + sc = result.ac.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.ac.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "List", resp, "Failure sending request") + return + } + + result.ac, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client AppsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/sites", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListSender(req *http.Request) (*http.Response, error) { + 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 AppsClient) ListResponder(resp *http.Response) (result AppCollection, 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(ctx context.Context, lastResults AppCollection) (result AppCollection, err error) { + req, err := lastResults.appCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListComplete(ctx context.Context) (result AppCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListApplicationSettings gets the application settings of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) ListApplicationSettings(ctx context.Context, resourceGroupName string, name string) (result StringDictionary, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListApplicationSettings") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListApplicationSettings", err.Error()) + } + + req, err := client.ListApplicationSettingsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListApplicationSettings", nil, "Failure preparing request") + return + } + + resp, err := client.ListApplicationSettingsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListApplicationSettings", resp, "Failure sending request") + return + } + + result, err = client.ListApplicationSettingsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListApplicationSettings", resp, "Failure responding to request") + } + + return +} + +// ListApplicationSettingsPreparer prepares the ListApplicationSettings request. +func (client AppsClient) ListApplicationSettingsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/appsettings/list", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListApplicationSettingsSender sends the ListApplicationSettings request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListApplicationSettingsSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListApplicationSettingsResponder handles the response to the ListApplicationSettings request. The method always +// closes the http.Response Body. +func (client AppsClient) ListApplicationSettingsResponder(resp *http.Response) (result StringDictionary, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListApplicationSettingsSlot gets the application settings of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API will get the application settings +// for the production slot. +func (client AppsClient) ListApplicationSettingsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result StringDictionary, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListApplicationSettingsSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListApplicationSettingsSlot", err.Error()) + } + + req, err := client.ListApplicationSettingsSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListApplicationSettingsSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListApplicationSettingsSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListApplicationSettingsSlot", resp, "Failure sending request") + return + } + + result, err = client.ListApplicationSettingsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListApplicationSettingsSlot", resp, "Failure responding to request") + } + + return +} + +// ListApplicationSettingsSlotPreparer prepares the ListApplicationSettingsSlot request. +func (client AppsClient) ListApplicationSettingsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings/list", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListApplicationSettingsSlotSender sends the ListApplicationSettingsSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListApplicationSettingsSlotSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListApplicationSettingsSlotResponder handles the response to the ListApplicationSettingsSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListApplicationSettingsSlotResponder(resp *http.Response) (result StringDictionary, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListAzureStorageAccounts gets the Azure storage account configurations of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) ListAzureStorageAccounts(ctx context.Context, resourceGroupName string, name string) (result AzureStoragePropertyDictionaryResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListAzureStorageAccounts") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListAzureStorageAccounts", err.Error()) + } + + req, err := client.ListAzureStorageAccountsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListAzureStorageAccounts", nil, "Failure preparing request") + return + } + + resp, err := client.ListAzureStorageAccountsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListAzureStorageAccounts", resp, "Failure sending request") + return + } + + result, err = client.ListAzureStorageAccountsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListAzureStorageAccounts", resp, "Failure responding to request") + } + + return +} + +// ListAzureStorageAccountsPreparer prepares the ListAzureStorageAccounts request. +func (client AppsClient) ListAzureStorageAccountsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/azurestorageaccounts/list", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListAzureStorageAccountsSender sends the ListAzureStorageAccounts request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListAzureStorageAccountsSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListAzureStorageAccountsResponder handles the response to the ListAzureStorageAccounts request. The method always +// closes the http.Response Body. +func (client AppsClient) ListAzureStorageAccountsResponder(resp *http.Response) (result AzureStoragePropertyDictionaryResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListAzureStorageAccountsSlot gets the Azure storage account configurations of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API will update the Azure storage +// account configurations for the production slot. +func (client AppsClient) ListAzureStorageAccountsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result AzureStoragePropertyDictionaryResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListAzureStorageAccountsSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListAzureStorageAccountsSlot", err.Error()) + } + + req, err := client.ListAzureStorageAccountsSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListAzureStorageAccountsSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListAzureStorageAccountsSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListAzureStorageAccountsSlot", resp, "Failure sending request") + return + } + + result, err = client.ListAzureStorageAccountsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListAzureStorageAccountsSlot", resp, "Failure responding to request") + } + + return +} + +// ListAzureStorageAccountsSlotPreparer prepares the ListAzureStorageAccountsSlot request. +func (client AppsClient) ListAzureStorageAccountsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/azurestorageaccounts/list", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListAzureStorageAccountsSlotSender sends the ListAzureStorageAccountsSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListAzureStorageAccountsSlotSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListAzureStorageAccountsSlotResponder handles the response to the ListAzureStorageAccountsSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListAzureStorageAccountsSlotResponder(resp *http.Response) (result AzureStoragePropertyDictionaryResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListBackups gets existing backups of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) ListBackups(ctx context.Context, resourceGroupName string, name string) (result BackupItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListBackups") + defer func() { + sc := -1 + if result.bic.Response.Response != nil { + sc = result.bic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListBackups", err.Error()) + } + + result.fn = client.listBackupsNextResults + req, err := client.ListBackupsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListBackups", nil, "Failure preparing request") + return + } + + resp, err := client.ListBackupsSender(req) + if err != nil { + result.bic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListBackups", resp, "Failure sending request") + return + } + + result.bic, err = client.ListBackupsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListBackups", resp, "Failure responding to request") + } + + return +} + +// ListBackupsPreparer prepares the ListBackups request. +func (client AppsClient) ListBackupsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBackupsSender sends the ListBackups request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListBackupsSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListBackupsResponder handles the response to the ListBackups request. The method always +// closes the http.Response Body. +func (client AppsClient) ListBackupsResponder(resp *http.Response) (result BackupItemCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBackupsNextResults retrieves the next set of results, if any. +func (client AppsClient) listBackupsNextResults(ctx context.Context, lastResults BackupItemCollection) (result BackupItemCollection, err error) { + req, err := lastResults.backupItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listBackupsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBackupsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listBackupsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBackupsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listBackupsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBackupsComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListBackupsComplete(ctx context.Context, resourceGroupName string, name string) (result BackupItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListBackups") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListBackups(ctx, resourceGroupName, name) + return +} + +// ListBackupsSlot gets existing backups of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API will get backups of the production +// slot. +func (client AppsClient) ListBackupsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result BackupItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListBackupsSlot") + defer func() { + sc := -1 + if result.bic.Response.Response != nil { + sc = result.bic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListBackupsSlot", err.Error()) + } + + result.fn = client.listBackupsSlotNextResults + req, err := client.ListBackupsSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListBackupsSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListBackupsSlotSender(req) + if err != nil { + result.bic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListBackupsSlot", resp, "Failure sending request") + return + } + + result.bic, err = client.ListBackupsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListBackupsSlot", resp, "Failure responding to request") + } + + return +} + +// ListBackupsSlotPreparer prepares the ListBackupsSlot request. +func (client AppsClient) ListBackupsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBackupsSlotSender sends the ListBackupsSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListBackupsSlotSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListBackupsSlotResponder handles the response to the ListBackupsSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListBackupsSlotResponder(resp *http.Response) (result BackupItemCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBackupsSlotNextResults retrieves the next set of results, if any. +func (client AppsClient) listBackupsSlotNextResults(ctx context.Context, lastResults BackupItemCollection) (result BackupItemCollection, err error) { + req, err := lastResults.backupItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listBackupsSlotNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBackupsSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listBackupsSlotNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBackupsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listBackupsSlotNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBackupsSlotComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListBackupsSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result BackupItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListBackupsSlot") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListBackupsSlot(ctx, resourceGroupName, name, slot) + return +} + +// ListBackupStatusSecrets gets status of a web app backup that may be in progress, including secrets associated with +// the backup, such as the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is +// passed in the request body. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +// backupID - ID of backup. +// request - information on backup request. +func (client AppsClient) ListBackupStatusSecrets(ctx context.Context, resourceGroupName string, name string, backupID string, request BackupRequest) (result BackupItem, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListBackupStatusSecrets") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: request, + Constraints: []validation.Constraint{{Target: "request.BackupRequestProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "request.BackupRequestProperties.StorageAccountURL", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "request.BackupRequestProperties.BackupSchedule", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "request.BackupRequestProperties.BackupSchedule.FrequencyInterval", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "request.BackupRequestProperties.BackupSchedule.KeepAtLeastOneBackup", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "request.BackupRequestProperties.BackupSchedule.RetentionPeriodInDays", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListBackupStatusSecrets", err.Error()) + } + + req, err := client.ListBackupStatusSecretsPreparer(ctx, resourceGroupName, name, backupID, request) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListBackupStatusSecrets", nil, "Failure preparing request") + return + } + + resp, err := client.ListBackupStatusSecretsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListBackupStatusSecrets", resp, "Failure sending request") + return + } + + result, err = client.ListBackupStatusSecretsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListBackupStatusSecrets", resp, "Failure responding to request") + } + + return +} + +// ListBackupStatusSecretsPreparer prepares the ListBackupStatusSecrets request. +func (client AppsClient) ListBackupStatusSecretsPreparer(ctx context.Context, resourceGroupName string, name string, backupID string, request BackupRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "backupId": autorest.Encode("path", backupID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}/list", pathParameters), + autorest.WithJSON(request), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBackupStatusSecretsSender sends the ListBackupStatusSecrets request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListBackupStatusSecretsSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListBackupStatusSecretsResponder handles the response to the ListBackupStatusSecrets request. The method always +// closes the http.Response Body. +func (client AppsClient) ListBackupStatusSecretsResponder(resp *http.Response) (result BackupItem, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListBackupStatusSecretsSlot gets status of a web app backup that may be in progress, including secrets associated +// with the backup, such as the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new +// URL is passed in the request body. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +// backupID - ID of backup. +// request - information on backup request. +// slot - name of web app slot. If not specified then will default to production slot. +func (client AppsClient) ListBackupStatusSecretsSlot(ctx context.Context, resourceGroupName string, name string, backupID string, request BackupRequest, slot string) (result BackupItem, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListBackupStatusSecretsSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: request, + Constraints: []validation.Constraint{{Target: "request.BackupRequestProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "request.BackupRequestProperties.StorageAccountURL", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "request.BackupRequestProperties.BackupSchedule", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "request.BackupRequestProperties.BackupSchedule.FrequencyInterval", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "request.BackupRequestProperties.BackupSchedule.KeepAtLeastOneBackup", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "request.BackupRequestProperties.BackupSchedule.RetentionPeriodInDays", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListBackupStatusSecretsSlot", err.Error()) + } + + req, err := client.ListBackupStatusSecretsSlotPreparer(ctx, resourceGroupName, name, backupID, request, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListBackupStatusSecretsSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListBackupStatusSecretsSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListBackupStatusSecretsSlot", resp, "Failure sending request") + return + } + + result, err = client.ListBackupStatusSecretsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListBackupStatusSecretsSlot", resp, "Failure responding to request") + } + + return +} + +// ListBackupStatusSecretsSlotPreparer prepares the ListBackupStatusSecretsSlot request. +func (client AppsClient) ListBackupStatusSecretsSlotPreparer(ctx context.Context, resourceGroupName string, name string, backupID string, request BackupRequest, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "backupId": autorest.Encode("path", backupID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/list", pathParameters), + autorest.WithJSON(request), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBackupStatusSecretsSlotSender sends the ListBackupStatusSecretsSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListBackupStatusSecretsSlotSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListBackupStatusSecretsSlotResponder handles the response to the ListBackupStatusSecretsSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListBackupStatusSecretsSlotResponder(resp *http.Response) (result BackupItem, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup gets all web, mobile, and API apps in the specified resource group. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// includeSlots - specify true to include deployment slots in results. The default is false, +// which only gives you the production slot of all apps. +func (client AppsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, includeSlots *bool) (result AppCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.ac.Response.Response != nil { + sc = result.ac.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, includeSlots) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.ac.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.ac, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client AppsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, includeSlots *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if includeSlots != nil { + queryParameters["includeSlots"] = autorest.Encode("query", *includeSlots) + } + preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListBackupsSender sends the ListBackups request. The method will close the +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) ListBackupsSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// ListBackupsResponder handles the response to the ListBackups request. The method always +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always // closes the http.Response Body. -func (client AppsClient) ListBackupsResponder(resp *http.Response) (result BackupItemCollection, err error) { +func (client AppsClient) ListByResourceGroupResponder(resp *http.Response) (result AppCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -16307,31 +17488,31 @@ func (client AppsClient) ListBackupsResponder(resp *http.Response) (result Backu return } -// listBackupsNextResults retrieves the next set of results, if any. -func (client AppsClient) listBackupsNextResults(ctx context.Context, lastResults BackupItemCollection) (result BackupItemCollection, err error) { - req, err := lastResults.backupItemCollectionPreparer(ctx) +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client AppsClient) listByResourceGroupNextResults(ctx context.Context, lastResults AppCollection) (result AppCollection, err error) { + req, err := lastResults.appCollectionPreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "web.AppsClient", "listBackupsNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") } if req == nil { return } - resp, err := client.ListBackupsSender(req) + resp, err := client.ListByResourceGroupSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "web.AppsClient", "listBackupsNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") } - result, err = client.ListBackupsResponder(resp) + result, err = client.ListByResourceGroupResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "listBackupsNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") } return } -// ListBackupsComplete enumerates all values, automatically crossing page boundaries as required. -func (client AppsClient) ListBackupsComplete(ctx context.Context, resourceGroupName string, name string) (result BackupItemCollectionIterator, err error) { +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, includeSlots *bool) (result AppCollectionIterator, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListBackups") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListByResourceGroup") defer func() { sc := -1 if result.Response().Response.Response != nil { @@ -16340,23 +17521,21 @@ func (client AppsClient) ListBackupsComplete(ctx context.Context, resourceGroupN tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListBackups(ctx, resourceGroupName, name) + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName, includeSlots) return } -// ListBackupsSlot gets existing backups of an app. +// ListConfigurations list the configurations of an app // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// slot - name of the deployment slot. If a slot is not specified, the API will get backups of the production -// slot. -func (client AppsClient) ListBackupsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result BackupItemCollectionPage, err error) { +func (client AppsClient) ListConfigurations(ctx context.Context, resourceGroupName string, name string) (result SiteConfigResourceCollectionPage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListBackupsSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListConfigurations") defer func() { sc := -1 - if result.bic.Response.Response != nil { - sc = result.bic.Response.Response.StatusCode + if result.scrc.Response.Response != nil { + sc = result.scrc.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -16366,37 +17545,36 @@ func (client AppsClient) ListBackupsSlot(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "ListBackupsSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "ListConfigurations", err.Error()) } - result.fn = client.listBackupsSlotNextResults - req, err := client.ListBackupsSlotPreparer(ctx, resourceGroupName, name, slot) + result.fn = client.listConfigurationsNextResults + req, err := client.ListConfigurationsPreparer(ctx, resourceGroupName, name) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListBackupsSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConfigurations", nil, "Failure preparing request") return } - resp, err := client.ListBackupsSlotSender(req) + resp, err := client.ListConfigurationsSender(req) if err != nil { - result.bic.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListBackupsSlot", resp, "Failure sending request") + result.scrc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConfigurations", resp, "Failure sending request") return } - result.bic, err = client.ListBackupsSlotResponder(resp) + result.scrc, err = client.ListConfigurationsResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListBackupsSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConfigurations", resp, "Failure responding to request") } return } -// ListBackupsSlotPreparer prepares the ListBackupsSlot request. -func (client AppsClient) ListBackupsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { +// ListConfigurationsPreparer prepares the ListConfigurations request. +func (client AppsClient) ListConfigurationsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -16408,21 +17586,21 @@ func (client AppsClient) ListBackupsSlotPreparer(ctx context.Context, resourceGr preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListBackupsSlotSender sends the ListBackupsSlot request. The method will close the +// ListConfigurationsSender sends the ListConfigurations request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) ListBackupsSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) ListConfigurationsSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// ListBackupsSlotResponder handles the response to the ListBackupsSlot request. The method always +// ListConfigurationsResponder handles the response to the ListConfigurations request. The method always // closes the http.Response Body. -func (client AppsClient) ListBackupsSlotResponder(resp *http.Response) (result BackupItemCollection, err error) { +func (client AppsClient) ListConfigurationsResponder(resp *http.Response) (result SiteConfigResourceCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -16433,31 +17611,31 @@ func (client AppsClient) ListBackupsSlotResponder(resp *http.Response) (result B return } -// listBackupsSlotNextResults retrieves the next set of results, if any. -func (client AppsClient) listBackupsSlotNextResults(ctx context.Context, lastResults BackupItemCollection) (result BackupItemCollection, err error) { - req, err := lastResults.backupItemCollectionPreparer(ctx) +// listConfigurationsNextResults retrieves the next set of results, if any. +func (client AppsClient) listConfigurationsNextResults(ctx context.Context, lastResults SiteConfigResourceCollection) (result SiteConfigResourceCollection, err error) { + req, err := lastResults.siteConfigResourceCollectionPreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "web.AppsClient", "listBackupsSlotNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listConfigurationsNextResults", nil, "Failure preparing next results request") } if req == nil { return } - resp, err := client.ListBackupsSlotSender(req) + resp, err := client.ListConfigurationsSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "web.AppsClient", "listBackupsSlotNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listConfigurationsNextResults", resp, "Failure sending next results request") } - result, err = client.ListBackupsSlotResponder(resp) + result, err = client.ListConfigurationsResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "listBackupsSlotNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "listConfigurationsNextResults", resp, "Failure responding to next results request") } return } -// ListBackupsSlotComplete enumerates all values, automatically crossing page boundaries as required. -func (client AppsClient) ListBackupsSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result BackupItemCollectionIterator, err error) { +// ListConfigurationsComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListConfigurationsComplete(ctx context.Context, resourceGroupName string, name string) (result SiteConfigResourceCollectionIterator, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListBackupsSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListConfigurations") defer func() { sc := -1 if result.Response().Response.Response != nil { @@ -16466,25 +17644,22 @@ func (client AppsClient) ListBackupsSlotComplete(ctx context.Context, resourceGr tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListBackupsSlot(ctx, resourceGroupName, name, slot) + result.page, err = client.ListConfigurations(ctx, resourceGroupName, name) return } -// ListBackupStatusSecrets gets status of a web app backup that may be in progress, including secrets associated with -// the backup, such as the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is -// passed in the request body. +// ListConfigurationSnapshotInfo gets a list of web app configuration snapshots identifiers. Each element of the list +// contains a timestamp and the ID of the snapshot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of web app. -// backupID - ID of backup. -// request - information on backup request. -func (client AppsClient) ListBackupStatusSecrets(ctx context.Context, resourceGroupName string, name string, backupID string, request BackupRequest) (result BackupItem, err error) { +// name - name of the app. +func (client AppsClient) ListConfigurationSnapshotInfo(ctx context.Context, resourceGroupName string, name string) (result SiteConfigurationSnapshotInfoCollectionPage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListBackupStatusSecrets") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListConfigurationSnapshotInfo") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.scsic.Response.Response != nil { + sc = result.scsic.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -16493,44 +17668,35 @@ func (client AppsClient) ListBackupStatusSecrets(ctx context.Context, resourceGr {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, - {TargetValue: request, - Constraints: []validation.Constraint{{Target: "request.BackupRequestProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "request.BackupRequestProperties.StorageAccountURL", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "request.BackupRequestProperties.BackupSchedule", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "request.BackupRequestProperties.BackupSchedule.FrequencyInterval", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "request.BackupRequestProperties.BackupSchedule.KeepAtLeastOneBackup", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "request.BackupRequestProperties.BackupSchedule.RetentionPeriodInDays", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "ListBackupStatusSecrets", err.Error()) + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListConfigurationSnapshotInfo", err.Error()) } - req, err := client.ListBackupStatusSecretsPreparer(ctx, resourceGroupName, name, backupID, request) + result.fn = client.listConfigurationSnapshotInfoNextResults + req, err := client.ListConfigurationSnapshotInfoPreparer(ctx, resourceGroupName, name) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListBackupStatusSecrets", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConfigurationSnapshotInfo", nil, "Failure preparing request") return } - resp, err := client.ListBackupStatusSecretsSender(req) + resp, err := client.ListConfigurationSnapshotInfoSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListBackupStatusSecrets", resp, "Failure sending request") + result.scsic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConfigurationSnapshotInfo", resp, "Failure sending request") return } - result, err = client.ListBackupStatusSecretsResponder(resp) + result.scsic, err = client.ListConfigurationSnapshotInfoResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListBackupStatusSecrets", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConfigurationSnapshotInfo", resp, "Failure responding to request") } return } -// ListBackupStatusSecretsPreparer prepares the ListBackupStatusSecrets request. -func (client AppsClient) ListBackupStatusSecretsPreparer(ctx context.Context, resourceGroupName string, name string, backupID string, request BackupRequest) (*http.Request, error) { +// ListConfigurationSnapshotInfoPreparer prepares the ListConfigurationSnapshotInfo request. +func (client AppsClient) ListConfigurationSnapshotInfoPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "backupId": autorest.Encode("path", backupID), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -16542,25 +17708,23 @@ func (client AppsClient) ListBackupStatusSecretsPreparer(ctx context.Context, re } preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), + autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}/list", pathParameters), - autorest.WithJSON(request), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListBackupStatusSecretsSender sends the ListBackupStatusSecrets request. The method will close the +// ListConfigurationSnapshotInfoSender sends the ListConfigurationSnapshotInfo request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) ListBackupStatusSecretsSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) ListConfigurationSnapshotInfoSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// ListBackupStatusSecretsResponder handles the response to the ListBackupStatusSecrets request. The method always +// ListConfigurationSnapshotInfoResponder handles the response to the ListConfigurationSnapshotInfo request. The method always // closes the http.Response Body. -func (client AppsClient) ListBackupStatusSecretsResponder(resp *http.Response) (result BackupItem, err error) { +func (client AppsClient) ListConfigurationSnapshotInfoResponder(resp *http.Response) (result SiteConfigurationSnapshotInfoCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -16571,121 +17735,57 @@ func (client AppsClient) ListBackupStatusSecretsResponder(resp *http.Response) ( return } -// ListBackupStatusSecretsSlot gets status of a web app backup that may be in progress, including secrets associated -// with the backup, such as the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new -// URL is passed in the request body. -// Parameters: -// resourceGroupName - name of the resource group to which the resource belongs. -// name - name of web app. -// backupID - ID of backup. -// request - information on backup request. -// slot - name of web app slot. If not specified then will default to production slot. -func (client AppsClient) ListBackupStatusSecretsSlot(ctx context.Context, resourceGroupName string, name string, backupID string, request BackupRequest, slot string) (result BackupItem, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListBackupStatusSecretsSlot") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, - {TargetValue: request, - Constraints: []validation.Constraint{{Target: "request.BackupRequestProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "request.BackupRequestProperties.StorageAccountURL", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "request.BackupRequestProperties.BackupSchedule", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "request.BackupRequestProperties.BackupSchedule.FrequencyInterval", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "request.BackupRequestProperties.BackupSchedule.KeepAtLeastOneBackup", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "request.BackupRequestProperties.BackupSchedule.RetentionPeriodInDays", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "ListBackupStatusSecretsSlot", err.Error()) - } - - req, err := client.ListBackupStatusSecretsSlotPreparer(ctx, resourceGroupName, name, backupID, request, slot) +// listConfigurationSnapshotInfoNextResults retrieves the next set of results, if any. +func (client AppsClient) listConfigurationSnapshotInfoNextResults(ctx context.Context, lastResults SiteConfigurationSnapshotInfoCollection) (result SiteConfigurationSnapshotInfoCollection, err error) { + req, err := lastResults.siteConfigurationSnapshotInfoCollectionPreparer(ctx) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListBackupStatusSecretsSlot", nil, "Failure preparing request") + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listConfigurationSnapshotInfoNextResults", nil, "Failure preparing next results request") + } + if req == nil { return } - - resp, err := client.ListBackupStatusSecretsSlotSender(req) + resp, err := client.ListConfigurationSnapshotInfoSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListBackupStatusSecretsSlot", resp, "Failure sending request") - return + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listConfigurationSnapshotInfoNextResults", resp, "Failure sending next results request") } - - result, err = client.ListBackupStatusSecretsSlotResponder(resp) + result, err = client.ListConfigurationSnapshotInfoResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListBackupStatusSecretsSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "listConfigurationSnapshotInfoNextResults", resp, "Failure responding to next results request") } - return } -// ListBackupStatusSecretsSlotPreparer prepares the ListBackupStatusSecretsSlot request. -func (client AppsClient) ListBackupStatusSecretsSlotPreparer(ctx context.Context, resourceGroupName string, name string, backupID string, request BackupRequest, slot string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "backupId": autorest.Encode("path", backupID), - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-02-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/list", pathParameters), - autorest.WithJSON(request), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListBackupStatusSecretsSlotSender sends the ListBackupStatusSecretsSlot request. The method will close the -// http.Response Body if it receives an error. -func (client AppsClient) ListBackupStatusSecretsSlotSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListBackupStatusSecretsSlotResponder handles the response to the ListBackupStatusSecretsSlot request. The method always -// closes the http.Response Body. -func (client AppsClient) ListBackupStatusSecretsSlotResponder(resp *http.Response) (result BackupItem, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} +// ListConfigurationSnapshotInfoComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListConfigurationSnapshotInfoComplete(ctx context.Context, resourceGroupName string, name string) (result SiteConfigurationSnapshotInfoCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListConfigurationSnapshotInfo") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListConfigurationSnapshotInfo(ctx, resourceGroupName, name) return } -// ListByResourceGroup gets all web, mobile, and API apps in the specified resource group. +// ListConfigurationSnapshotInfoSlot gets a list of web app configuration snapshots identifiers. Each element of the +// list contains a timestamp and the ID of the snapshot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// includeSlots - specify true to include deployment slots in results. The default is false, -// which only gives you the production slot of all apps. -func (client AppsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, includeSlots *bool) (result AppCollectionPage, err error) { +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API will return configuration for the +// production slot. +func (client AppsClient) ListConfigurationSnapshotInfoSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result SiteConfigurationSnapshotInfoCollectionPage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListByResourceGroup") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListConfigurationSnapshotInfoSlot") defer func() { sc := -1 - if result.ac.Response.Response != nil { - sc = result.ac.Response.Response.StatusCode + if result.scsic.Response.Response != nil { + sc = result.scsic.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -16695,35 +17795,37 @@ func (client AppsClient) ListByResourceGroup(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "ListByResourceGroup", err.Error()) + return result, validation.NewError("web.AppsClient", "ListConfigurationSnapshotInfoSlot", err.Error()) } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, includeSlots) + result.fn = client.listConfigurationSnapshotInfoSlotNextResults + req, err := client.ListConfigurationSnapshotInfoSlotPreparer(ctx, resourceGroupName, name, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListByResourceGroup", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConfigurationSnapshotInfoSlot", nil, "Failure preparing request") return } - resp, err := client.ListByResourceGroupSender(req) + resp, err := client.ListConfigurationSnapshotInfoSlotSender(req) if err != nil { - result.ac.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListByResourceGroup", resp, "Failure sending request") + result.scsic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConfigurationSnapshotInfoSlot", resp, "Failure sending request") return } - result.ac, err = client.ListByResourceGroupResponder(resp) + result.scsic, err = client.ListConfigurationSnapshotInfoSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListByResourceGroup", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConfigurationSnapshotInfoSlot", resp, "Failure responding to request") } return } -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client AppsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, includeSlots *bool) (*http.Request, error) { +// ListConfigurationSnapshotInfoSlotPreparer prepares the ListConfigurationSnapshotInfoSlot request. +func (client AppsClient) ListConfigurationSnapshotInfoSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -16731,28 +17833,25 @@ func (client AppsClient) ListByResourceGroupPreparer(ctx context.Context, resour queryParameters := map[string]interface{}{ "api-version": APIVersion, } - if includeSlots != nil { - queryParameters["includeSlots"] = autorest.Encode("query", *includeSlots) - } preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// ListConfigurationSnapshotInfoSlotSender sends the ListConfigurationSnapshotInfoSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) ListConfigurationSnapshotInfoSlotSender(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 +// ListConfigurationSnapshotInfoSlotResponder handles the response to the ListConfigurationSnapshotInfoSlot request. The method always // closes the http.Response Body. -func (client AppsClient) ListByResourceGroupResponder(resp *http.Response) (result AppCollection, err error) { +func (client AppsClient) ListConfigurationSnapshotInfoSlotResponder(resp *http.Response) (result SiteConfigurationSnapshotInfoCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -16763,31 +17862,31 @@ func (client AppsClient) ListByResourceGroupResponder(resp *http.Response) (resu return } -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client AppsClient) listByResourceGroupNextResults(ctx context.Context, lastResults AppCollection) (result AppCollection, err error) { - req, err := lastResults.appCollectionPreparer(ctx) +// listConfigurationSnapshotInfoSlotNextResults retrieves the next set of results, if any. +func (client AppsClient) listConfigurationSnapshotInfoSlotNextResults(ctx context.Context, lastResults SiteConfigurationSnapshotInfoCollection) (result SiteConfigurationSnapshotInfoCollection, err error) { + req, err := lastResults.siteConfigurationSnapshotInfoCollectionPreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "web.AppsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listConfigurationSnapshotInfoSlotNextResults", nil, "Failure preparing next results request") } if req == nil { return } - resp, err := client.ListByResourceGroupSender(req) + resp, err := client.ListConfigurationSnapshotInfoSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "web.AppsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listConfigurationSnapshotInfoSlotNextResults", resp, "Failure sending next results request") } - result, err = client.ListByResourceGroupResponder(resp) + result, err = client.ListConfigurationSnapshotInfoSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "listConfigurationSnapshotInfoSlotNextResults", resp, "Failure responding to next results request") } return } -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client AppsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, includeSlots *bool) (result AppCollectionIterator, err error) { +// ListConfigurationSnapshotInfoSlotComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListConfigurationSnapshotInfoSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result SiteConfigurationSnapshotInfoCollectionIterator, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListByResourceGroup") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListConfigurationSnapshotInfoSlot") defer func() { sc := -1 if result.Response().Response.Response != nil { @@ -16796,17 +17895,19 @@ func (client AppsClient) ListByResourceGroupComplete(ctx context.Context, resour tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName, includeSlots) + result.page, err = client.ListConfigurationSnapshotInfoSlot(ctx, resourceGroupName, name, slot) return } -// ListConfigurations list the configurations of an app +// ListConfigurationsSlot list the configurations of an app // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -func (client AppsClient) ListConfigurations(ctx context.Context, resourceGroupName string, name string) (result SiteConfigResourceCollectionPage, err error) { +// slot - name of the deployment slot. If a slot is not specified, the API will return configuration for the +// production slot. +func (client AppsClient) ListConfigurationsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result SiteConfigResourceCollectionPage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListConfigurations") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListConfigurationsSlot") defer func() { sc := -1 if result.scrc.Response.Response != nil { @@ -16820,36 +17921,37 @@ func (client AppsClient) ListConfigurations(ctx context.Context, resourceGroupNa Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "ListConfigurations", err.Error()) + return result, validation.NewError("web.AppsClient", "ListConfigurationsSlot", err.Error()) } - result.fn = client.listConfigurationsNextResults - req, err := client.ListConfigurationsPreparer(ctx, resourceGroupName, name) + result.fn = client.listConfigurationsSlotNextResults + req, err := client.ListConfigurationsSlotPreparer(ctx, resourceGroupName, name, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConfigurations", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConfigurationsSlot", nil, "Failure preparing request") return } - resp, err := client.ListConfigurationsSender(req) + resp, err := client.ListConfigurationsSlotSender(req) if err != nil { result.scrc.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConfigurations", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConfigurationsSlot", resp, "Failure sending request") return } - result.scrc, err = client.ListConfigurationsResponder(resp) + result.scrc, err = client.ListConfigurationsSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConfigurations", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConfigurationsSlot", resp, "Failure responding to request") } return } -// ListConfigurationsPreparer prepares the ListConfigurations request. -func (client AppsClient) ListConfigurationsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { +// ListConfigurationsSlotPreparer prepares the ListConfigurationsSlot request. +func (client AppsClient) ListConfigurationsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -16861,21 +17963,21 @@ func (client AppsClient) ListConfigurationsPreparer(ctx context.Context, resourc preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListConfigurationsSender sends the ListConfigurations request. The method will close the +// ListConfigurationsSlotSender sends the ListConfigurationsSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) ListConfigurationsSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) ListConfigurationsSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// ListConfigurationsResponder handles the response to the ListConfigurations request. The method always +// ListConfigurationsSlotResponder handles the response to the ListConfigurationsSlot request. The method always // closes the http.Response Body. -func (client AppsClient) ListConfigurationsResponder(resp *http.Response) (result SiteConfigResourceCollection, err error) { +func (client AppsClient) ListConfigurationsSlotResponder(resp *http.Response) (result SiteConfigResourceCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -16886,31 +17988,31 @@ func (client AppsClient) ListConfigurationsResponder(resp *http.Response) (resul return } -// listConfigurationsNextResults retrieves the next set of results, if any. -func (client AppsClient) listConfigurationsNextResults(ctx context.Context, lastResults SiteConfigResourceCollection) (result SiteConfigResourceCollection, err error) { +// listConfigurationsSlotNextResults retrieves the next set of results, if any. +func (client AppsClient) listConfigurationsSlotNextResults(ctx context.Context, lastResults SiteConfigResourceCollection) (result SiteConfigResourceCollection, err error) { req, err := lastResults.siteConfigResourceCollectionPreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "web.AppsClient", "listConfigurationsNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listConfigurationsSlotNextResults", nil, "Failure preparing next results request") } if req == nil { return } - resp, err := client.ListConfigurationsSender(req) + resp, err := client.ListConfigurationsSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "web.AppsClient", "listConfigurationsNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listConfigurationsSlotNextResults", resp, "Failure sending next results request") } - result, err = client.ListConfigurationsResponder(resp) + result, err = client.ListConfigurationsSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "listConfigurationsNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "listConfigurationsSlotNextResults", resp, "Failure responding to next results request") } return } -// ListConfigurationsComplete enumerates all values, automatically crossing page boundaries as required. -func (client AppsClient) ListConfigurationsComplete(ctx context.Context, resourceGroupName string, name string) (result SiteConfigResourceCollectionIterator, err error) { +// ListConfigurationsSlotComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListConfigurationsSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result SiteConfigResourceCollectionIterator, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListConfigurations") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListConfigurationsSlot") defer func() { sc := -1 if result.Response().Response.Response != nil { @@ -16919,22 +18021,21 @@ func (client AppsClient) ListConfigurationsComplete(ctx context.Context, resourc tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListConfigurations(ctx, resourceGroupName, name) + result.page, err = client.ListConfigurationsSlot(ctx, resourceGroupName, name, slot) return } -// ListConfigurationSnapshotInfo gets a list of web app configuration snapshots identifiers. Each element of the list -// contains a timestamp and the ID of the snapshot. +// ListConnectionStrings gets the connection strings of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -func (client AppsClient) ListConfigurationSnapshotInfo(ctx context.Context, resourceGroupName string, name string) (result SiteConfigurationSnapshotInfoCollectionPage, err error) { +func (client AppsClient) ListConnectionStrings(ctx context.Context, resourceGroupName string, name string) (result ConnectionStringDictionary, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListConfigurationSnapshotInfo") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListConnectionStrings") defer func() { sc := -1 - if result.scsic.Response.Response != nil { - sc = result.scsic.Response.Response.StatusCode + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -16944,33 +18045,32 @@ func (client AppsClient) ListConfigurationSnapshotInfo(ctx context.Context, reso Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "ListConfigurationSnapshotInfo", err.Error()) + return result, validation.NewError("web.AppsClient", "ListConnectionStrings", err.Error()) } - result.fn = client.listConfigurationSnapshotInfoNextResults - req, err := client.ListConfigurationSnapshotInfoPreparer(ctx, resourceGroupName, name) + req, err := client.ListConnectionStringsPreparer(ctx, resourceGroupName, name) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConfigurationSnapshotInfo", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConnectionStrings", nil, "Failure preparing request") return } - resp, err := client.ListConfigurationSnapshotInfoSender(req) + resp, err := client.ListConnectionStringsSender(req) if err != nil { - result.scsic.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConfigurationSnapshotInfo", resp, "Failure sending request") + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConnectionStrings", resp, "Failure sending request") return } - result.scsic, err = client.ListConfigurationSnapshotInfoResponder(resp) + result, err = client.ListConnectionStringsResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConfigurationSnapshotInfo", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConnectionStrings", resp, "Failure responding to request") } return } -// ListConfigurationSnapshotInfoPreparer prepares the ListConfigurationSnapshotInfo request. -func (client AppsClient) ListConfigurationSnapshotInfoPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { +// ListConnectionStringsPreparer prepares the ListConnectionStrings request. +func (client AppsClient) ListConnectionStringsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -16983,23 +18083,23 @@ func (client AppsClient) ListConfigurationSnapshotInfoPreparer(ctx context.Conte } preparer := autorest.CreatePreparer( - autorest.AsGet(), + autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/connectionstrings/list", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListConfigurationSnapshotInfoSender sends the ListConfigurationSnapshotInfo request. The method will close the +// ListConnectionStringsSender sends the ListConnectionStrings request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) ListConfigurationSnapshotInfoSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) ListConnectionStringsSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// ListConfigurationSnapshotInfoResponder handles the response to the ListConfigurationSnapshotInfo request. The method always +// ListConnectionStringsResponder handles the response to the ListConnectionStrings request. The method always // closes the http.Response Body. -func (client AppsClient) ListConfigurationSnapshotInfoResponder(resp *http.Response) (result SiteConfigurationSnapshotInfoCollection, err error) { +func (client AppsClient) ListConnectionStringsResponder(resp *http.Response) (result ConnectionStringDictionary, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -17010,57 +18110,19 @@ func (client AppsClient) ListConfigurationSnapshotInfoResponder(resp *http.Respo return } -// listConfigurationSnapshotInfoNextResults retrieves the next set of results, if any. -func (client AppsClient) listConfigurationSnapshotInfoNextResults(ctx context.Context, lastResults SiteConfigurationSnapshotInfoCollection) (result SiteConfigurationSnapshotInfoCollection, err error) { - req, err := lastResults.siteConfigurationSnapshotInfoCollectionPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "web.AppsClient", "listConfigurationSnapshotInfoNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListConfigurationSnapshotInfoSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "web.AppsClient", "listConfigurationSnapshotInfoNextResults", resp, "Failure sending next results request") - } - result, err = client.ListConfigurationSnapshotInfoResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "listConfigurationSnapshotInfoNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListConfigurationSnapshotInfoComplete enumerates all values, automatically crossing page boundaries as required. -func (client AppsClient) ListConfigurationSnapshotInfoComplete(ctx context.Context, resourceGroupName string, name string) (result SiteConfigurationSnapshotInfoCollectionIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListConfigurationSnapshotInfo") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListConfigurationSnapshotInfo(ctx, resourceGroupName, name) - return -} - -// ListConfigurationSnapshotInfoSlot gets a list of web app configuration snapshots identifiers. Each element of the -// list contains a timestamp and the ID of the snapshot. +// ListConnectionStringsSlot gets the connection strings of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// slot - name of the deployment slot. If a slot is not specified, the API will return configuration for the -// production slot. -func (client AppsClient) ListConfigurationSnapshotInfoSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result SiteConfigurationSnapshotInfoCollectionPage, err error) { +// slot - name of the deployment slot. If a slot is not specified, the API will get the connection settings for +// the production slot. +func (client AppsClient) ListConnectionStringsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result ConnectionStringDictionary, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListConfigurationSnapshotInfoSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListConnectionStringsSlot") defer func() { - sc := -1 - if result.scsic.Response.Response != nil { - sc = result.scsic.Response.Response.StatusCode + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -17070,33 +18132,32 @@ func (client AppsClient) ListConfigurationSnapshotInfoSlot(ctx context.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("web.AppsClient", "ListConfigurationSnapshotInfoSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "ListConnectionStringsSlot", err.Error()) } - result.fn = client.listConfigurationSnapshotInfoSlotNextResults - req, err := client.ListConfigurationSnapshotInfoSlotPreparer(ctx, resourceGroupName, name, slot) + req, err := client.ListConnectionStringsSlotPreparer(ctx, resourceGroupName, name, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConfigurationSnapshotInfoSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConnectionStringsSlot", nil, "Failure preparing request") return } - resp, err := client.ListConfigurationSnapshotInfoSlotSender(req) + resp, err := client.ListConnectionStringsSlotSender(req) if err != nil { - result.scsic.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConfigurationSnapshotInfoSlot", resp, "Failure sending request") + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConnectionStringsSlot", resp, "Failure sending request") return } - result.scsic, err = client.ListConfigurationSnapshotInfoSlotResponder(resp) + result, err = client.ListConnectionStringsSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConfigurationSnapshotInfoSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConnectionStringsSlot", resp, "Failure responding to request") } return } -// ListConfigurationSnapshotInfoSlotPreparer prepares the ListConfigurationSnapshotInfoSlot request. -func (client AppsClient) ListConfigurationSnapshotInfoSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { +// ListConnectionStringsSlotPreparer prepares the ListConnectionStringsSlot request. +func (client AppsClient) ListConnectionStringsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -17110,23 +18171,23 @@ func (client AppsClient) ListConfigurationSnapshotInfoSlotPreparer(ctx context.C } preparer := autorest.CreatePreparer( - autorest.AsGet(), + autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings/list", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListConfigurationSnapshotInfoSlotSender sends the ListConfigurationSnapshotInfoSlot request. The method will close the +// ListConnectionStringsSlotSender sends the ListConnectionStringsSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) ListConfigurationSnapshotInfoSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) ListConnectionStringsSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// ListConfigurationSnapshotInfoSlotResponder handles the response to the ListConfigurationSnapshotInfoSlot request. The method always +// ListConnectionStringsSlotResponder handles the response to the ListConnectionStringsSlot request. The method always // closes the http.Response Body. -func (client AppsClient) ListConfigurationSnapshotInfoSlotResponder(resp *http.Response) (result SiteConfigurationSnapshotInfoCollection, err error) { +func (client AppsClient) ListConnectionStringsSlotResponder(resp *http.Response) (result ConnectionStringDictionary, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -17137,56 +18198,17 @@ func (client AppsClient) ListConfigurationSnapshotInfoSlotResponder(resp *http.R return } -// listConfigurationSnapshotInfoSlotNextResults retrieves the next set of results, if any. -func (client AppsClient) listConfigurationSnapshotInfoSlotNextResults(ctx context.Context, lastResults SiteConfigurationSnapshotInfoCollection) (result SiteConfigurationSnapshotInfoCollection, err error) { - req, err := lastResults.siteConfigurationSnapshotInfoCollectionPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "web.AppsClient", "listConfigurationSnapshotInfoSlotNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListConfigurationSnapshotInfoSlotSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "web.AppsClient", "listConfigurationSnapshotInfoSlotNextResults", resp, "Failure sending next results request") - } - result, err = client.ListConfigurationSnapshotInfoSlotResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "listConfigurationSnapshotInfoSlotNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListConfigurationSnapshotInfoSlotComplete enumerates all values, automatically crossing page boundaries as required. -func (client AppsClient) ListConfigurationSnapshotInfoSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result SiteConfigurationSnapshotInfoCollectionIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListConfigurationSnapshotInfoSlot") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListConfigurationSnapshotInfoSlot(ctx, resourceGroupName, name, slot) - return -} - -// ListConfigurationsSlot list the configurations of an app +// ListContinuousWebJobs list continuous web jobs for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -// slot - name of the deployment slot. If a slot is not specified, the API will return configuration for the -// production slot. -func (client AppsClient) ListConfigurationsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result SiteConfigResourceCollectionPage, err error) { +// name - site name. +func (client AppsClient) ListContinuousWebJobs(ctx context.Context, resourceGroupName string, name string) (result ContinuousWebJobCollectionPage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListConfigurationsSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListContinuousWebJobs") defer func() { sc := -1 - if result.scrc.Response.Response != nil { - sc = result.scrc.Response.Response.StatusCode + if result.cwjc.Response.Response != nil { + sc = result.cwjc.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -17196,37 +18218,36 @@ func (client AppsClient) ListConfigurationsSlot(ctx context.Context, resourceGro Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "ListConfigurationsSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "ListContinuousWebJobs", err.Error()) } - result.fn = client.listConfigurationsSlotNextResults - req, err := client.ListConfigurationsSlotPreparer(ctx, resourceGroupName, name, slot) + result.fn = client.listContinuousWebJobsNextResults + req, err := client.ListContinuousWebJobsPreparer(ctx, resourceGroupName, name) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConfigurationsSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListContinuousWebJobs", nil, "Failure preparing request") return } - resp, err := client.ListConfigurationsSlotSender(req) + resp, err := client.ListContinuousWebJobsSender(req) if err != nil { - result.scrc.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConfigurationsSlot", resp, "Failure sending request") + result.cwjc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListContinuousWebJobs", resp, "Failure sending request") return } - result.scrc, err = client.ListConfigurationsSlotResponder(resp) + result.cwjc, err = client.ListContinuousWebJobsResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConfigurationsSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListContinuousWebJobs", resp, "Failure responding to request") } return } -// ListConfigurationsSlotPreparer prepares the ListConfigurationsSlot request. -func (client AppsClient) ListConfigurationsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { +// ListContinuousWebJobsPreparer prepares the ListContinuousWebJobs request. +func (client AppsClient) ListContinuousWebJobsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -17238,21 +18259,21 @@ func (client AppsClient) ListConfigurationsSlotPreparer(ctx context.Context, res preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListConfigurationsSlotSender sends the ListConfigurationsSlot request. The method will close the +// ListContinuousWebJobsSender sends the ListContinuousWebJobs request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) ListConfigurationsSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) ListContinuousWebJobsSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// ListConfigurationsSlotResponder handles the response to the ListConfigurationsSlot request. The method always +// ListContinuousWebJobsResponder handles the response to the ListContinuousWebJobs request. The method always // closes the http.Response Body. -func (client AppsClient) ListConfigurationsSlotResponder(resp *http.Response) (result SiteConfigResourceCollection, err error) { +func (client AppsClient) ListContinuousWebJobsResponder(resp *http.Response) (result ContinuousWebJobCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -17263,31 +18284,31 @@ func (client AppsClient) ListConfigurationsSlotResponder(resp *http.Response) (r return } -// listConfigurationsSlotNextResults retrieves the next set of results, if any. -func (client AppsClient) listConfigurationsSlotNextResults(ctx context.Context, lastResults SiteConfigResourceCollection) (result SiteConfigResourceCollection, err error) { - req, err := lastResults.siteConfigResourceCollectionPreparer(ctx) +// listContinuousWebJobsNextResults retrieves the next set of results, if any. +func (client AppsClient) listContinuousWebJobsNextResults(ctx context.Context, lastResults ContinuousWebJobCollection) (result ContinuousWebJobCollection, err error) { + req, err := lastResults.continuousWebJobCollectionPreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "web.AppsClient", "listConfigurationsSlotNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listContinuousWebJobsNextResults", nil, "Failure preparing next results request") } if req == nil { return } - resp, err := client.ListConfigurationsSlotSender(req) + resp, err := client.ListContinuousWebJobsSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "web.AppsClient", "listConfigurationsSlotNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listContinuousWebJobsNextResults", resp, "Failure sending next results request") } - result, err = client.ListConfigurationsSlotResponder(resp) + result, err = client.ListContinuousWebJobsResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "listConfigurationsSlotNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "listContinuousWebJobsNextResults", resp, "Failure responding to next results request") } return } -// ListConfigurationsSlotComplete enumerates all values, automatically crossing page boundaries as required. -func (client AppsClient) ListConfigurationsSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result SiteConfigResourceCollectionIterator, err error) { +// ListContinuousWebJobsComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListContinuousWebJobsComplete(ctx context.Context, resourceGroupName string, name string) (result ContinuousWebJobCollectionIterator, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListConfigurationsSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListContinuousWebJobs") defer func() { sc := -1 if result.Response().Response.Response != nil { @@ -17296,21 +18317,23 @@ func (client AppsClient) ListConfigurationsSlotComplete(ctx context.Context, res tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListConfigurationsSlot(ctx, resourceGroupName, name, slot) + result.page, err = client.ListContinuousWebJobs(ctx, resourceGroupName, name) return } -// ListConnectionStrings gets the connection strings of an app. +// ListContinuousWebJobsSlot list continuous web jobs for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -func (client AppsClient) ListConnectionStrings(ctx context.Context, resourceGroupName string, name string) (result ConnectionStringDictionary, err error) { +// name - site name. +// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the +// production slot. +func (client AppsClient) ListContinuousWebJobsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result ContinuousWebJobCollectionPage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListConnectionStrings") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListContinuousWebJobsSlot") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.cwjc.Response.Response != nil { + sc = result.cwjc.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -17320,35 +18343,37 @@ func (client AppsClient) ListConnectionStrings(ctx context.Context, resourceGrou Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "ListConnectionStrings", err.Error()) + return result, validation.NewError("web.AppsClient", "ListContinuousWebJobsSlot", err.Error()) } - req, err := client.ListConnectionStringsPreparer(ctx, resourceGroupName, name) + result.fn = client.listContinuousWebJobsSlotNextResults + req, err := client.ListContinuousWebJobsSlotPreparer(ctx, resourceGroupName, name, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConnectionStrings", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListContinuousWebJobsSlot", nil, "Failure preparing request") return } - resp, err := client.ListConnectionStringsSender(req) + resp, err := client.ListContinuousWebJobsSlotSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConnectionStrings", resp, "Failure sending request") + result.cwjc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListContinuousWebJobsSlot", resp, "Failure sending request") return } - result, err = client.ListConnectionStringsResponder(resp) + result.cwjc, err = client.ListContinuousWebJobsSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConnectionStrings", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListContinuousWebJobsSlot", resp, "Failure responding to request") } return } -// ListConnectionStringsPreparer prepares the ListConnectionStrings request. -func (client AppsClient) ListConnectionStringsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { +// ListContinuousWebJobsSlotPreparer prepares the ListContinuousWebJobsSlot request. +func (client AppsClient) ListContinuousWebJobsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -17358,23 +18383,23 @@ func (client AppsClient) ListConnectionStringsPreparer(ctx context.Context, reso } preparer := autorest.CreatePreparer( - autorest.AsPost(), + autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/connectionstrings/list", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListConnectionStringsSender sends the ListConnectionStrings request. The method will close the +// ListContinuousWebJobsSlotSender sends the ListContinuousWebJobsSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) ListConnectionStringsSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) ListContinuousWebJobsSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// ListConnectionStringsResponder handles the response to the ListConnectionStrings request. The method always +// ListContinuousWebJobsSlotResponder handles the response to the ListContinuousWebJobsSlot request. The method always // closes the http.Response Body. -func (client AppsClient) ListConnectionStringsResponder(resp *http.Response) (result ConnectionStringDictionary, err error) { +func (client AppsClient) ListContinuousWebJobsSlotResponder(resp *http.Response) (result ContinuousWebJobCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -17385,15 +18410,52 @@ func (client AppsClient) ListConnectionStringsResponder(resp *http.Response) (re return } -// ListConnectionStringsSlot gets the connection strings of an app. +// listContinuousWebJobsSlotNextResults retrieves the next set of results, if any. +func (client AppsClient) listContinuousWebJobsSlotNextResults(ctx context.Context, lastResults ContinuousWebJobCollection) (result ContinuousWebJobCollection, err error) { + req, err := lastResults.continuousWebJobCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listContinuousWebJobsSlotNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListContinuousWebJobsSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listContinuousWebJobsSlotNextResults", resp, "Failure sending next results request") + } + result, err = client.ListContinuousWebJobsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listContinuousWebJobsSlotNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListContinuousWebJobsSlotComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListContinuousWebJobsSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result ContinuousWebJobCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListContinuousWebJobsSlot") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListContinuousWebJobsSlot(ctx, resourceGroupName, name, slot) + return +} + +// ListDeploymentLog list deployment log for specific deployment for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// slot - name of the deployment slot. If a slot is not specified, the API will get the connection settings for -// the production slot. -func (client AppsClient) ListConnectionStringsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result ConnectionStringDictionary, err error) { +// ID - the ID of a specific deployment. This is the value of the name property in the JSON response from "GET +// /api/sites/{siteName}/deployments". +func (client AppsClient) ListDeploymentLog(ctx context.Context, resourceGroupName string, name string, ID string) (result Deployment, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListConnectionStringsSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListDeploymentLog") defer func() { sc := -1 if result.Response.Response != nil { @@ -17407,36 +18469,36 @@ func (client AppsClient) ListConnectionStringsSlot(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "ListConnectionStringsSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "ListDeploymentLog", err.Error()) } - req, err := client.ListConnectionStringsSlotPreparer(ctx, resourceGroupName, name, slot) + req, err := client.ListDeploymentLogPreparer(ctx, resourceGroupName, name, ID) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConnectionStringsSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDeploymentLog", nil, "Failure preparing request") return } - resp, err := client.ListConnectionStringsSlotSender(req) + resp, err := client.ListDeploymentLogSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConnectionStringsSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDeploymentLog", resp, "Failure sending request") return } - result, err = client.ListConnectionStringsSlotResponder(resp) + result, err = client.ListDeploymentLogResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConnectionStringsSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDeploymentLog", resp, "Failure responding to request") } return } - -// ListConnectionStringsSlotPreparer prepares the ListConnectionStringsSlot request. -func (client AppsClient) ListConnectionStringsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + +// ListDeploymentLogPreparer prepares the ListDeploymentLog request. +func (client AppsClient) ListDeploymentLogPreparer(ctx context.Context, resourceGroupName string, name string, ID string) (*http.Request, error) { pathParameters := map[string]interface{}{ + "id": autorest.Encode("path", ID), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -17446,23 +18508,23 @@ func (client AppsClient) ListConnectionStringsSlotPreparer(ctx context.Context, } preparer := autorest.CreatePreparer( - autorest.AsPost(), + autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings/list", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}/log", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListConnectionStringsSlotSender sends the ListConnectionStringsSlot request. The method will close the +// ListDeploymentLogSender sends the ListDeploymentLog request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) ListConnectionStringsSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) ListDeploymentLogSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// ListConnectionStringsSlotResponder handles the response to the ListConnectionStringsSlot request. The method always +// ListDeploymentLogResponder handles the response to the ListDeploymentLog request. The method always // closes the http.Response Body. -func (client AppsClient) ListConnectionStringsSlotResponder(resp *http.Response) (result ConnectionStringDictionary, err error) { +func (client AppsClient) ListDeploymentLogResponder(resp *http.Response) (result Deployment, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -17473,17 +18535,21 @@ func (client AppsClient) ListConnectionStringsSlotResponder(resp *http.Response) return } -// ListContinuousWebJobs list continuous web jobs for an app, or a deployment slot. +// ListDeploymentLogSlot list deployment log for specific deployment for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - site name. -func (client AppsClient) ListContinuousWebJobs(ctx context.Context, resourceGroupName string, name string) (result ContinuousWebJobCollectionPage, err error) { +// name - name of the app. +// ID - the ID of a specific deployment. This is the value of the name property in the JSON response from "GET +// /api/sites/{siteName}/deployments". +// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the +// production slot. +func (client AppsClient) ListDeploymentLogSlot(ctx context.Context, resourceGroupName string, name string, ID string, slot string) (result Deployment, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListContinuousWebJobs") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListDeploymentLogSlot") defer func() { sc := -1 - if result.cwjc.Response.Response != nil { - sc = result.cwjc.Response.Response.StatusCode + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -17493,36 +18559,37 @@ func (client AppsClient) ListContinuousWebJobs(ctx context.Context, resourceGrou Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "ListContinuousWebJobs", err.Error()) + return result, validation.NewError("web.AppsClient", "ListDeploymentLogSlot", err.Error()) } - result.fn = client.listContinuousWebJobsNextResults - req, err := client.ListContinuousWebJobsPreparer(ctx, resourceGroupName, name) + req, err := client.ListDeploymentLogSlotPreparer(ctx, resourceGroupName, name, ID, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListContinuousWebJobs", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDeploymentLogSlot", nil, "Failure preparing request") return } - resp, err := client.ListContinuousWebJobsSender(req) + resp, err := client.ListDeploymentLogSlotSender(req) if err != nil { - result.cwjc.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListContinuousWebJobs", resp, "Failure sending request") + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDeploymentLogSlot", resp, "Failure sending request") return } - result.cwjc, err = client.ListContinuousWebJobsResponder(resp) + result, err = client.ListDeploymentLogSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListContinuousWebJobs", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDeploymentLogSlot", resp, "Failure responding to request") } return } -// ListContinuousWebJobsPreparer prepares the ListContinuousWebJobs request. -func (client AppsClient) ListContinuousWebJobsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { +// ListDeploymentLogSlotPreparer prepares the ListDeploymentLogSlot request. +func (client AppsClient) ListDeploymentLogSlotPreparer(ctx context.Context, resourceGroupName string, name string, ID string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ + "id": autorest.Encode("path", ID), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -17534,21 +18601,21 @@ func (client AppsClient) ListContinuousWebJobsPreparer(ctx context.Context, reso preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}/log", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListContinuousWebJobsSender sends the ListContinuousWebJobs request. The method will close the +// ListDeploymentLogSlotSender sends the ListDeploymentLogSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) ListContinuousWebJobsSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) ListDeploymentLogSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// ListContinuousWebJobsResponder handles the response to the ListContinuousWebJobs request. The method always +// ListDeploymentLogSlotResponder handles the response to the ListDeploymentLogSlot request. The method always // closes the http.Response Body. -func (client AppsClient) ListContinuousWebJobsResponder(resp *http.Response) (result ContinuousWebJobCollection, err error) { +func (client AppsClient) ListDeploymentLogSlotResponder(resp *http.Response) (result Deployment, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -17559,56 +18626,17 @@ func (client AppsClient) ListContinuousWebJobsResponder(resp *http.Response) (re return } -// listContinuousWebJobsNextResults retrieves the next set of results, if any. -func (client AppsClient) listContinuousWebJobsNextResults(ctx context.Context, lastResults ContinuousWebJobCollection) (result ContinuousWebJobCollection, err error) { - req, err := lastResults.continuousWebJobCollectionPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "web.AppsClient", "listContinuousWebJobsNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListContinuousWebJobsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "web.AppsClient", "listContinuousWebJobsNextResults", resp, "Failure sending next results request") - } - result, err = client.ListContinuousWebJobsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "listContinuousWebJobsNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListContinuousWebJobsComplete enumerates all values, automatically crossing page boundaries as required. -func (client AppsClient) ListContinuousWebJobsComplete(ctx context.Context, resourceGroupName string, name string) (result ContinuousWebJobCollectionIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListContinuousWebJobs") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListContinuousWebJobs(ctx, resourceGroupName, name) - return -} - -// ListContinuousWebJobsSlot list continuous web jobs for an app, or a deployment slot. +// ListDeployments list deployments for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - site name. -// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the -// production slot. -func (client AppsClient) ListContinuousWebJobsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result ContinuousWebJobCollectionPage, err error) { +// name - name of the app. +func (client AppsClient) ListDeployments(ctx context.Context, resourceGroupName string, name string) (result DeploymentCollectionPage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListContinuousWebJobsSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListDeployments") defer func() { sc := -1 - if result.cwjc.Response.Response != nil { - sc = result.cwjc.Response.Response.StatusCode + if result.dc.Response.Response != nil { + sc = result.dc.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -17618,37 +18646,36 @@ func (client AppsClient) ListContinuousWebJobsSlot(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "ListContinuousWebJobsSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "ListDeployments", err.Error()) } - result.fn = client.listContinuousWebJobsSlotNextResults - req, err := client.ListContinuousWebJobsSlotPreparer(ctx, resourceGroupName, name, slot) + result.fn = client.listDeploymentsNextResults + req, err := client.ListDeploymentsPreparer(ctx, resourceGroupName, name) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListContinuousWebJobsSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDeployments", nil, "Failure preparing request") return } - resp, err := client.ListContinuousWebJobsSlotSender(req) + resp, err := client.ListDeploymentsSender(req) if err != nil { - result.cwjc.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListContinuousWebJobsSlot", resp, "Failure sending request") + result.dc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDeployments", resp, "Failure sending request") return } - result.cwjc, err = client.ListContinuousWebJobsSlotResponder(resp) + result.dc, err = client.ListDeploymentsResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListContinuousWebJobsSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDeployments", resp, "Failure responding to request") } return } -// ListContinuousWebJobsSlotPreparer prepares the ListContinuousWebJobsSlot request. -func (client AppsClient) ListContinuousWebJobsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { +// ListDeploymentsPreparer prepares the ListDeployments request. +func (client AppsClient) ListDeploymentsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -17660,21 +18687,21 @@ func (client AppsClient) ListContinuousWebJobsSlotPreparer(ctx context.Context, preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListContinuousWebJobsSlotSender sends the ListContinuousWebJobsSlot request. The method will close the +// ListDeploymentsSender sends the ListDeployments request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) ListContinuousWebJobsSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) ListDeploymentsSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// ListContinuousWebJobsSlotResponder handles the response to the ListContinuousWebJobsSlot request. The method always +// ListDeploymentsResponder handles the response to the ListDeployments request. The method always // closes the http.Response Body. -func (client AppsClient) ListContinuousWebJobsSlotResponder(resp *http.Response) (result ContinuousWebJobCollection, err error) { +func (client AppsClient) ListDeploymentsResponder(resp *http.Response) (result DeploymentCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -17685,31 +18712,31 @@ func (client AppsClient) ListContinuousWebJobsSlotResponder(resp *http.Response) return } -// listContinuousWebJobsSlotNextResults retrieves the next set of results, if any. -func (client AppsClient) listContinuousWebJobsSlotNextResults(ctx context.Context, lastResults ContinuousWebJobCollection) (result ContinuousWebJobCollection, err error) { - req, err := lastResults.continuousWebJobCollectionPreparer(ctx) +// listDeploymentsNextResults retrieves the next set of results, if any. +func (client AppsClient) listDeploymentsNextResults(ctx context.Context, lastResults DeploymentCollection) (result DeploymentCollection, err error) { + req, err := lastResults.deploymentCollectionPreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "web.AppsClient", "listContinuousWebJobsSlotNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listDeploymentsNextResults", nil, "Failure preparing next results request") } if req == nil { return } - resp, err := client.ListContinuousWebJobsSlotSender(req) + resp, err := client.ListDeploymentsSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "web.AppsClient", "listContinuousWebJobsSlotNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listDeploymentsNextResults", resp, "Failure sending next results request") } - result, err = client.ListContinuousWebJobsSlotResponder(resp) + result, err = client.ListDeploymentsResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "listContinuousWebJobsSlotNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "listDeploymentsNextResults", resp, "Failure responding to next results request") } return } -// ListContinuousWebJobsSlotComplete enumerates all values, automatically crossing page boundaries as required. -func (client AppsClient) ListContinuousWebJobsSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result ContinuousWebJobCollectionIterator, err error) { +// ListDeploymentsComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListDeploymentsComplete(ctx context.Context, resourceGroupName string, name string) (result DeploymentCollectionIterator, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListContinuousWebJobsSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListDeployments") defer func() { sc := -1 if result.Response().Response.Response != nil { @@ -17718,23 +18745,23 @@ func (client AppsClient) ListContinuousWebJobsSlotComplete(ctx context.Context, tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListContinuousWebJobsSlot(ctx, resourceGroupName, name, slot) + result.page, err = client.ListDeployments(ctx, resourceGroupName, name) return } -// ListDeploymentLog list deployment log for specific deployment for an app, or a deployment slot. +// ListDeploymentsSlot list deployments for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// ID - the ID of a specific deployment. This is the value of the name property in the JSON response from "GET -// /api/sites/{siteName}/deployments". -func (client AppsClient) ListDeploymentLog(ctx context.Context, resourceGroupName string, name string, ID string) (result Deployment, err error) { +// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the +// production slot. +func (client AppsClient) ListDeploymentsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result DeploymentCollectionPage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListDeploymentLog") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListDeploymentsSlot") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.dc.Response.Response != nil { + sc = result.dc.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -17744,36 +18771,37 @@ func (client AppsClient) ListDeploymentLog(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "ListDeploymentLog", err.Error()) + return result, validation.NewError("web.AppsClient", "ListDeploymentsSlot", err.Error()) } - req, err := client.ListDeploymentLogPreparer(ctx, resourceGroupName, name, ID) + result.fn = client.listDeploymentsSlotNextResults + req, err := client.ListDeploymentsSlotPreparer(ctx, resourceGroupName, name, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDeploymentLog", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDeploymentsSlot", nil, "Failure preparing request") return } - resp, err := client.ListDeploymentLogSender(req) + resp, err := client.ListDeploymentsSlotSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDeploymentLog", resp, "Failure sending request") + result.dc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDeploymentsSlot", resp, "Failure sending request") return } - result, err = client.ListDeploymentLogResponder(resp) + result.dc, err = client.ListDeploymentsSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDeploymentLog", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDeploymentsSlot", resp, "Failure responding to request") } return } -// ListDeploymentLogPreparer prepares the ListDeploymentLog request. -func (client AppsClient) ListDeploymentLogPreparer(ctx context.Context, resourceGroupName string, name string, ID string) (*http.Request, error) { +// ListDeploymentsSlotPreparer prepares the ListDeploymentsSlot request. +func (client AppsClient) ListDeploymentsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "id": autorest.Encode("path", ID), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -17785,21 +18813,21 @@ func (client AppsClient) ListDeploymentLogPreparer(ctx context.Context, resource preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}/log", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListDeploymentLogSender sends the ListDeploymentLog request. The method will close the +// ListDeploymentsSlotSender sends the ListDeploymentsSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) ListDeploymentLogSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) ListDeploymentsSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// ListDeploymentLogResponder handles the response to the ListDeploymentLog request. The method always +// ListDeploymentsSlotResponder handles the response to the ListDeploymentsSlot request. The method always // closes the http.Response Body. -func (client AppsClient) ListDeploymentLogResponder(resp *http.Response) (result Deployment, err error) { +func (client AppsClient) ListDeploymentsSlotResponder(resp *http.Response) (result DeploymentCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -17810,21 +18838,54 @@ func (client AppsClient) ListDeploymentLogResponder(resp *http.Response) (result return } -// ListDeploymentLogSlot list deployment log for specific deployment for an app, or a deployment slot. +// listDeploymentsSlotNextResults retrieves the next set of results, if any. +func (client AppsClient) listDeploymentsSlotNextResults(ctx context.Context, lastResults DeploymentCollection) (result DeploymentCollection, err error) { + req, err := lastResults.deploymentCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listDeploymentsSlotNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListDeploymentsSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listDeploymentsSlotNextResults", resp, "Failure sending next results request") + } + result, err = client.ListDeploymentsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listDeploymentsSlotNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListDeploymentsSlotComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListDeploymentsSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result DeploymentCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListDeploymentsSlot") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListDeploymentsSlot(ctx, resourceGroupName, name, slot) + return +} + +// ListDomainOwnershipIdentifiers lists ownership identifiers for domain associated with web app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// ID - the ID of a specific deployment. This is the value of the name property in the JSON response from "GET -// /api/sites/{siteName}/deployments". -// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the -// production slot. -func (client AppsClient) ListDeploymentLogSlot(ctx context.Context, resourceGroupName string, name string, ID string, slot string) (result Deployment, err error) { +func (client AppsClient) ListDomainOwnershipIdentifiers(ctx context.Context, resourceGroupName string, name string) (result IdentifierCollectionPage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListDeploymentLogSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListDomainOwnershipIdentifiers") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.ic.Response.Response != nil { + sc = result.ic.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -17834,37 +18895,36 @@ func (client AppsClient) ListDeploymentLogSlot(ctx context.Context, resourceGrou Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "ListDeploymentLogSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "ListDomainOwnershipIdentifiers", err.Error()) } - req, err := client.ListDeploymentLogSlotPreparer(ctx, resourceGroupName, name, ID, slot) + result.fn = client.listDomainOwnershipIdentifiersNextResults + req, err := client.ListDomainOwnershipIdentifiersPreparer(ctx, resourceGroupName, name) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDeploymentLogSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDomainOwnershipIdentifiers", nil, "Failure preparing request") return } - resp, err := client.ListDeploymentLogSlotSender(req) + resp, err := client.ListDomainOwnershipIdentifiersSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDeploymentLogSlot", resp, "Failure sending request") + result.ic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDomainOwnershipIdentifiers", resp, "Failure sending request") return } - result, err = client.ListDeploymentLogSlotResponder(resp) + result.ic, err = client.ListDomainOwnershipIdentifiersResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDeploymentLogSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDomainOwnershipIdentifiers", resp, "Failure responding to request") } return } -// ListDeploymentLogSlotPreparer prepares the ListDeploymentLogSlot request. -func (client AppsClient) ListDeploymentLogSlotPreparer(ctx context.Context, resourceGroupName string, name string, ID string, slot string) (*http.Request, error) { +// ListDomainOwnershipIdentifiersPreparer prepares the ListDomainOwnershipIdentifiers request. +func (client AppsClient) ListDomainOwnershipIdentifiersPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "id": autorest.Encode("path", ID), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -17876,21 +18936,21 @@ func (client AppsClient) ListDeploymentLogSlotPreparer(ctx context.Context, reso preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}/log", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListDeploymentLogSlotSender sends the ListDeploymentLogSlot request. The method will close the +// ListDomainOwnershipIdentifiersSender sends the ListDomainOwnershipIdentifiers request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) ListDeploymentLogSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) ListDomainOwnershipIdentifiersSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// ListDeploymentLogSlotResponder handles the response to the ListDeploymentLogSlot request. The method always +// ListDomainOwnershipIdentifiersResponder handles the response to the ListDomainOwnershipIdentifiers request. The method always // closes the http.Response Body. -func (client AppsClient) ListDeploymentLogSlotResponder(resp *http.Response) (result Deployment, err error) { +func (client AppsClient) ListDomainOwnershipIdentifiersResponder(resp *http.Response) (result IdentifierCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -17901,17 +18961,56 @@ func (client AppsClient) ListDeploymentLogSlotResponder(resp *http.Response) (re return } -// ListDeployments list deployments for an app, or a deployment slot. +// listDomainOwnershipIdentifiersNextResults retrieves the next set of results, if any. +func (client AppsClient) listDomainOwnershipIdentifiersNextResults(ctx context.Context, lastResults IdentifierCollection) (result IdentifierCollection, err error) { + req, err := lastResults.identifierCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listDomainOwnershipIdentifiersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListDomainOwnershipIdentifiersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listDomainOwnershipIdentifiersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListDomainOwnershipIdentifiersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listDomainOwnershipIdentifiersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListDomainOwnershipIdentifiersComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListDomainOwnershipIdentifiersComplete(ctx context.Context, resourceGroupName string, name string) (result IdentifierCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListDomainOwnershipIdentifiers") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListDomainOwnershipIdentifiers(ctx, resourceGroupName, name) + return +} + +// ListDomainOwnershipIdentifiersSlot lists ownership identifiers for domain associated with web app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -func (client AppsClient) ListDeployments(ctx context.Context, resourceGroupName string, name string) (result DeploymentCollectionPage, err error) { +// slot - name of the deployment slot. If a slot is not specified, the API will delete the binding for the +// production slot. +func (client AppsClient) ListDomainOwnershipIdentifiersSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result IdentifierCollectionPage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListDeployments") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListDomainOwnershipIdentifiersSlot") defer func() { sc := -1 - if result.dc.Response.Response != nil { - sc = result.dc.Response.Response.StatusCode + if result.ic.Response.Response != nil { + sc = result.ic.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -17921,36 +19020,37 @@ func (client AppsClient) ListDeployments(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "ListDeployments", err.Error()) + return result, validation.NewError("web.AppsClient", "ListDomainOwnershipIdentifiersSlot", err.Error()) } - result.fn = client.listDeploymentsNextResults - req, err := client.ListDeploymentsPreparer(ctx, resourceGroupName, name) + result.fn = client.listDomainOwnershipIdentifiersSlotNextResults + req, err := client.ListDomainOwnershipIdentifiersSlotPreparer(ctx, resourceGroupName, name, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDeployments", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDomainOwnershipIdentifiersSlot", nil, "Failure preparing request") return } - resp, err := client.ListDeploymentsSender(req) + resp, err := client.ListDomainOwnershipIdentifiersSlotSender(req) if err != nil { - result.dc.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDeployments", resp, "Failure sending request") + result.ic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDomainOwnershipIdentifiersSlot", resp, "Failure sending request") return } - result.dc, err = client.ListDeploymentsResponder(resp) + result.ic, err = client.ListDomainOwnershipIdentifiersSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDeployments", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDomainOwnershipIdentifiersSlot", resp, "Failure responding to request") } return } -// ListDeploymentsPreparer prepares the ListDeployments request. -func (client AppsClient) ListDeploymentsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { +// ListDomainOwnershipIdentifiersSlotPreparer prepares the ListDomainOwnershipIdentifiersSlot request. +func (client AppsClient) ListDomainOwnershipIdentifiersSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -17962,21 +19062,21 @@ func (client AppsClient) ListDeploymentsPreparer(ctx context.Context, resourceGr preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListDeploymentsSender sends the ListDeployments request. The method will close the +// ListDomainOwnershipIdentifiersSlotSender sends the ListDomainOwnershipIdentifiersSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) ListDeploymentsSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) ListDomainOwnershipIdentifiersSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// ListDeploymentsResponder handles the response to the ListDeployments request. The method always +// ListDomainOwnershipIdentifiersSlotResponder handles the response to the ListDomainOwnershipIdentifiersSlot request. The method always // closes the http.Response Body. -func (client AppsClient) ListDeploymentsResponder(resp *http.Response) (result DeploymentCollection, err error) { +func (client AppsClient) ListDomainOwnershipIdentifiersSlotResponder(resp *http.Response) (result IdentifierCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -17987,31 +19087,31 @@ func (client AppsClient) ListDeploymentsResponder(resp *http.Response) (result D return } -// listDeploymentsNextResults retrieves the next set of results, if any. -func (client AppsClient) listDeploymentsNextResults(ctx context.Context, lastResults DeploymentCollection) (result DeploymentCollection, err error) { - req, err := lastResults.deploymentCollectionPreparer(ctx) +// listDomainOwnershipIdentifiersSlotNextResults retrieves the next set of results, if any. +func (client AppsClient) listDomainOwnershipIdentifiersSlotNextResults(ctx context.Context, lastResults IdentifierCollection) (result IdentifierCollection, err error) { + req, err := lastResults.identifierCollectionPreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "web.AppsClient", "listDeploymentsNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listDomainOwnershipIdentifiersSlotNextResults", nil, "Failure preparing next results request") } if req == nil { return } - resp, err := client.ListDeploymentsSender(req) + resp, err := client.ListDomainOwnershipIdentifiersSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "web.AppsClient", "listDeploymentsNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listDomainOwnershipIdentifiersSlotNextResults", resp, "Failure sending next results request") } - result, err = client.ListDeploymentsResponder(resp) + result, err = client.ListDomainOwnershipIdentifiersSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "listDeploymentsNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "listDomainOwnershipIdentifiersSlotNextResults", resp, "Failure responding to next results request") } return } -// ListDeploymentsComplete enumerates all values, automatically crossing page boundaries as required. -func (client AppsClient) ListDeploymentsComplete(ctx context.Context, resourceGroupName string, name string) (result DeploymentCollectionIterator, err error) { +// ListDomainOwnershipIdentifiersSlotComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListDomainOwnershipIdentifiersSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result IdentifierCollectionIterator, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListDeployments") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListDomainOwnershipIdentifiersSlot") defer func() { sc := -1 if result.Response().Response.Response != nil { @@ -18020,23 +19120,22 @@ func (client AppsClient) ListDeploymentsComplete(ctx context.Context, resourceGr tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListDeployments(ctx, resourceGroupName, name) + result.page, err = client.ListDomainOwnershipIdentifiersSlot(ctx, resourceGroupName, name, slot) return } -// ListDeploymentsSlot list deployments for an app, or a deployment slot. +// ListFunctionKeys get function keys for a function in a web site, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the -// production slot. -func (client AppsClient) ListDeploymentsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result DeploymentCollectionPage, err error) { +// name - site name. +// functionName - function name. +func (client AppsClient) ListFunctionKeys(ctx context.Context, resourceGroupName string, name string, functionName string) (result StringDictionary, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListDeploymentsSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListFunctionKeys") defer func() { sc := -1 - if result.dc.Response.Response != nil { - sc = result.dc.Response.Response.StatusCode + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -18046,37 +19145,36 @@ func (client AppsClient) ListDeploymentsSlot(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "ListDeploymentsSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "ListFunctionKeys", err.Error()) } - result.fn = client.listDeploymentsSlotNextResults - req, err := client.ListDeploymentsSlotPreparer(ctx, resourceGroupName, name, slot) + req, err := client.ListFunctionKeysPreparer(ctx, resourceGroupName, name, functionName) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDeploymentsSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListFunctionKeys", nil, "Failure preparing request") return } - resp, err := client.ListDeploymentsSlotSender(req) + resp, err := client.ListFunctionKeysSender(req) if err != nil { - result.dc.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDeploymentsSlot", resp, "Failure sending request") + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListFunctionKeys", resp, "Failure sending request") return } - result.dc, err = client.ListDeploymentsSlotResponder(resp) + result, err = client.ListFunctionKeysResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDeploymentsSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListFunctionKeys", resp, "Failure responding to request") } return } -// ListDeploymentsSlotPreparer prepares the ListDeploymentsSlot request. -func (client AppsClient) ListDeploymentsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { +// ListFunctionKeysPreparer prepares the ListFunctionKeys request. +func (client AppsClient) ListFunctionKeysPreparer(ctx context.Context, resourceGroupName string, name string, functionName string) (*http.Request, error) { pathParameters := map[string]interface{}{ + "functionName": autorest.Encode("path", functionName), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -18086,23 +19184,23 @@ func (client AppsClient) ListDeploymentsSlotPreparer(ctx context.Context, resour } preparer := autorest.CreatePreparer( - autorest.AsGet(), + autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/listkeys", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListDeploymentsSlotSender sends the ListDeploymentsSlot request. The method will close the +// ListFunctionKeysSender sends the ListFunctionKeys request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) ListDeploymentsSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) ListFunctionKeysSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// ListDeploymentsSlotResponder handles the response to the ListDeploymentsSlot request. The method always +// ListFunctionKeysResponder handles the response to the ListFunctionKeys request. The method always // closes the http.Response Body. -func (client AppsClient) ListDeploymentsSlotResponder(resp *http.Response) (result DeploymentCollection, err error) { +func (client AppsClient) ListFunctionKeysResponder(resp *http.Response) (result StringDictionary, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -18113,54 +19211,106 @@ func (client AppsClient) ListDeploymentsSlotResponder(resp *http.Response) (resu return } -// listDeploymentsSlotNextResults retrieves the next set of results, if any. -func (client AppsClient) listDeploymentsSlotNextResults(ctx context.Context, lastResults DeploymentCollection) (result DeploymentCollection, err error) { - req, err := lastResults.deploymentCollectionPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "web.AppsClient", "listDeploymentsSlotNextResults", nil, "Failure preparing next results request") +// ListFunctionKeysSlot get function keys for a function in a web site, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// functionName - function name. +// slot - name of the deployment slot. +func (client AppsClient) ListFunctionKeysSlot(ctx context.Context, resourceGroupName string, name string, functionName string, slot string) (result StringDictionary, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListFunctionKeysSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() } - if req == nil { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListFunctionKeysSlot", err.Error()) + } + + req, err := client.ListFunctionKeysSlotPreparer(ctx, resourceGroupName, name, functionName, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListFunctionKeysSlot", nil, "Failure preparing request") return } - resp, err := client.ListDeploymentsSlotSender(req) + + resp, err := client.ListFunctionKeysSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "web.AppsClient", "listDeploymentsSlotNextResults", resp, "Failure sending next results request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListFunctionKeysSlot", resp, "Failure sending request") + return } - result, err = client.ListDeploymentsSlotResponder(resp) + + result, err = client.ListFunctionKeysSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "listDeploymentsSlotNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListFunctionKeysSlot", resp, "Failure responding to request") } + return } -// ListDeploymentsSlotComplete enumerates all values, automatically crossing page boundaries as required. -func (client AppsClient) ListDeploymentsSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result DeploymentCollectionIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListDeploymentsSlot") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() +// ListFunctionKeysSlotPreparer prepares the ListFunctionKeysSlot request. +func (client AppsClient) ListFunctionKeysSlotPreparer(ctx context.Context, resourceGroupName string, name string, functionName string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "functionName": autorest.Encode("path", functionName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - result.page, err = client.ListDeploymentsSlot(ctx, resourceGroupName, name, slot) + + const APIVersion = "2018-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/listkeys", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListFunctionKeysSlotSender sends the ListFunctionKeysSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListFunctionKeysSlotSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListFunctionKeysSlotResponder handles the response to the ListFunctionKeysSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListFunctionKeysSlotResponder(resp *http.Response) (result StringDictionary, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} return } -// ListDomainOwnershipIdentifiers lists ownership identifiers for domain associated with web app. +// ListFunctions list the functions for a web site, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -func (client AppsClient) ListDomainOwnershipIdentifiers(ctx context.Context, resourceGroupName string, name string) (result IdentifierCollectionPage, err error) { +// name - site name. +func (client AppsClient) ListFunctions(ctx context.Context, resourceGroupName string, name string) (result FunctionEnvelopeCollectionPage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListDomainOwnershipIdentifiers") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListFunctions") defer func() { sc := -1 - if result.ic.Response.Response != nil { - sc = result.ic.Response.Response.StatusCode + if result.fec.Response.Response != nil { + sc = result.fec.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -18170,33 +19320,33 @@ func (client AppsClient) ListDomainOwnershipIdentifiers(ctx context.Context, res Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "ListDomainOwnershipIdentifiers", err.Error()) + return result, validation.NewError("web.AppsClient", "ListFunctions", err.Error()) } - result.fn = client.listDomainOwnershipIdentifiersNextResults - req, err := client.ListDomainOwnershipIdentifiersPreparer(ctx, resourceGroupName, name) + result.fn = client.listFunctionsNextResults + req, err := client.ListFunctionsPreparer(ctx, resourceGroupName, name) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDomainOwnershipIdentifiers", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListFunctions", nil, "Failure preparing request") return } - resp, err := client.ListDomainOwnershipIdentifiersSender(req) + resp, err := client.ListFunctionsSender(req) if err != nil { - result.ic.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDomainOwnershipIdentifiers", resp, "Failure sending request") + result.fec.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListFunctions", resp, "Failure sending request") return } - result.ic, err = client.ListDomainOwnershipIdentifiersResponder(resp) + result.fec, err = client.ListFunctionsResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDomainOwnershipIdentifiers", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListFunctions", resp, "Failure responding to request") } return } -// ListDomainOwnershipIdentifiersPreparer prepares the ListDomainOwnershipIdentifiers request. -func (client AppsClient) ListDomainOwnershipIdentifiersPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { +// ListFunctionsPreparer prepares the ListFunctions request. +func (client AppsClient) ListFunctionsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -18211,56 +19361,56 @@ func (client AppsClient) ListDomainOwnershipIdentifiersPreparer(ctx context.Cont preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListDomainOwnershipIdentifiersSender sends the ListDomainOwnershipIdentifiers request. The method will close the +// ListFunctionsSender sends the ListFunctions request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) ListDomainOwnershipIdentifiersSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) ListFunctionsSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// ListDomainOwnershipIdentifiersResponder handles the response to the ListDomainOwnershipIdentifiers request. The method always +// ListFunctionsResponder handles the response to the ListFunctions request. The method always // closes the http.Response Body. -func (client AppsClient) ListDomainOwnershipIdentifiersResponder(resp *http.Response) (result IdentifierCollection, err error) { +func (client AppsClient) ListFunctionsResponder(resp *http.Response) (result FunctionEnvelopeCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// listDomainOwnershipIdentifiersNextResults retrieves the next set of results, if any. -func (client AppsClient) listDomainOwnershipIdentifiersNextResults(ctx context.Context, lastResults IdentifierCollection) (result IdentifierCollection, err error) { - req, err := lastResults.identifierCollectionPreparer(ctx) +// listFunctionsNextResults retrieves the next set of results, if any. +func (client AppsClient) listFunctionsNextResults(ctx context.Context, lastResults FunctionEnvelopeCollection) (result FunctionEnvelopeCollection, err error) { + req, err := lastResults.functionEnvelopeCollectionPreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "web.AppsClient", "listDomainOwnershipIdentifiersNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listFunctionsNextResults", nil, "Failure preparing next results request") } if req == nil { return } - resp, err := client.ListDomainOwnershipIdentifiersSender(req) + resp, err := client.ListFunctionsSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "web.AppsClient", "listDomainOwnershipIdentifiersNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listFunctionsNextResults", resp, "Failure sending next results request") } - result, err = client.ListDomainOwnershipIdentifiersResponder(resp) + result, err = client.ListFunctionsResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "listDomainOwnershipIdentifiersNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "listFunctionsNextResults", resp, "Failure responding to next results request") } return } -// ListDomainOwnershipIdentifiersComplete enumerates all values, automatically crossing page boundaries as required. -func (client AppsClient) ListDomainOwnershipIdentifiersComplete(ctx context.Context, resourceGroupName string, name string) (result IdentifierCollectionIterator, err error) { +// ListFunctionsComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListFunctionsComplete(ctx context.Context, resourceGroupName string, name string) (result FunctionEnvelopeCollectionIterator, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListDomainOwnershipIdentifiers") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListFunctions") defer func() { sc := -1 if result.Response().Response.Response != nil { @@ -18269,23 +19419,22 @@ func (client AppsClient) ListDomainOwnershipIdentifiersComplete(ctx context.Cont tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListDomainOwnershipIdentifiers(ctx, resourceGroupName, name) + result.page, err = client.ListFunctions(ctx, resourceGroupName, name) return } -// ListDomainOwnershipIdentifiersSlot lists ownership identifiers for domain associated with web app. +// ListFunctionSecrets get function secrets for a function in a web site, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -// slot - name of the deployment slot. If a slot is not specified, the API will delete the binding for the -// production slot. -func (client AppsClient) ListDomainOwnershipIdentifiersSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result IdentifierCollectionPage, err error) { +// name - site name. +// functionName - function name. +func (client AppsClient) ListFunctionSecrets(ctx context.Context, resourceGroupName string, name string, functionName string) (result FunctionSecrets, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListDomainOwnershipIdentifiersSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListFunctionSecrets") defer func() { sc := -1 - if result.ic.Response.Response != nil { - sc = result.ic.Response.Response.StatusCode + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -18295,37 +19444,36 @@ func (client AppsClient) ListDomainOwnershipIdentifiersSlot(ctx context.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("web.AppsClient", "ListDomainOwnershipIdentifiersSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "ListFunctionSecrets", err.Error()) } - result.fn = client.listDomainOwnershipIdentifiersSlotNextResults - req, err := client.ListDomainOwnershipIdentifiersSlotPreparer(ctx, resourceGroupName, name, slot) + req, err := client.ListFunctionSecretsPreparer(ctx, resourceGroupName, name, functionName) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDomainOwnershipIdentifiersSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListFunctionSecrets", nil, "Failure preparing request") return } - resp, err := client.ListDomainOwnershipIdentifiersSlotSender(req) + resp, err := client.ListFunctionSecretsSender(req) if err != nil { - result.ic.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDomainOwnershipIdentifiersSlot", resp, "Failure sending request") + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListFunctionSecrets", resp, "Failure sending request") return } - result.ic, err = client.ListDomainOwnershipIdentifiersSlotResponder(resp) + result, err = client.ListFunctionSecretsResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDomainOwnershipIdentifiersSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListFunctionSecrets", resp, "Failure responding to request") } return } -// ListDomainOwnershipIdentifiersSlotPreparer prepares the ListDomainOwnershipIdentifiersSlot request. -func (client AppsClient) ListDomainOwnershipIdentifiersSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { +// ListFunctionSecretsPreparer prepares the ListFunctionSecrets request. +func (client AppsClient) ListFunctionSecretsPreparer(ctx context.Context, resourceGroupName string, name string, functionName string) (*http.Request, error) { pathParameters := map[string]interface{}{ + "functionName": autorest.Encode("path", functionName), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -18335,23 +19483,23 @@ func (client AppsClient) ListDomainOwnershipIdentifiersSlotPreparer(ctx context. } preparer := autorest.CreatePreparer( - autorest.AsGet(), + autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/listsecrets", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListDomainOwnershipIdentifiersSlotSender sends the ListDomainOwnershipIdentifiersSlot request. The method will close the +// ListFunctionSecretsSender sends the ListFunctionSecrets request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) ListDomainOwnershipIdentifiersSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) ListFunctionSecretsSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// ListDomainOwnershipIdentifiersSlotResponder handles the response to the ListDomainOwnershipIdentifiersSlot request. The method always +// ListFunctionSecretsResponder handles the response to the ListFunctionSecrets request. The method always // closes the http.Response Body. -func (client AppsClient) ListDomainOwnershipIdentifiersSlotResponder(resp *http.Response) (result IdentifierCollection, err error) { +func (client AppsClient) ListFunctionSecretsResponder(resp *http.Response) (result FunctionSecrets, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -18362,54 +19510,19 @@ func (client AppsClient) ListDomainOwnershipIdentifiersSlotResponder(resp *http. return } -// listDomainOwnershipIdentifiersSlotNextResults retrieves the next set of results, if any. -func (client AppsClient) listDomainOwnershipIdentifiersSlotNextResults(ctx context.Context, lastResults IdentifierCollection) (result IdentifierCollection, err error) { - req, err := lastResults.identifierCollectionPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "web.AppsClient", "listDomainOwnershipIdentifiersSlotNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListDomainOwnershipIdentifiersSlotSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "web.AppsClient", "listDomainOwnershipIdentifiersSlotNextResults", resp, "Failure sending next results request") - } - result, err = client.ListDomainOwnershipIdentifiersSlotResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "listDomainOwnershipIdentifiersSlotNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListDomainOwnershipIdentifiersSlotComplete enumerates all values, automatically crossing page boundaries as required. -func (client AppsClient) ListDomainOwnershipIdentifiersSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result IdentifierCollectionIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListDomainOwnershipIdentifiersSlot") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListDomainOwnershipIdentifiersSlot(ctx, resourceGroupName, name, slot) - return -} - -// ListFunctions list the functions for a web site, or a deployment slot. +// ListFunctionSecretsSlot get function secrets for a function in a web site, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. -func (client AppsClient) ListFunctions(ctx context.Context, resourceGroupName string, name string) (result FunctionEnvelopeCollectionPage, err error) { +// functionName - function name. +// slot - name of the deployment slot. +func (client AppsClient) ListFunctionSecretsSlot(ctx context.Context, resourceGroupName string, name string, functionName string, slot string) (result FunctionSecrets, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListFunctions") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListFunctionSecretsSlot") defer func() { sc := -1 - if result.fec.Response.Response != nil { - sc = result.fec.Response.Response.StatusCode + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -18419,36 +19532,37 @@ func (client AppsClient) ListFunctions(ctx context.Context, resourceGroupName st Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "ListFunctions", err.Error()) + return result, validation.NewError("web.AppsClient", "ListFunctionSecretsSlot", err.Error()) } - result.fn = client.listFunctionsNextResults - req, err := client.ListFunctionsPreparer(ctx, resourceGroupName, name) + req, err := client.ListFunctionSecretsSlotPreparer(ctx, resourceGroupName, name, functionName, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListFunctions", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListFunctionSecretsSlot", nil, "Failure preparing request") return } - resp, err := client.ListFunctionsSender(req) + resp, err := client.ListFunctionSecretsSlotSender(req) if err != nil { - result.fec.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListFunctions", resp, "Failure sending request") + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListFunctionSecretsSlot", resp, "Failure sending request") return } - result.fec, err = client.ListFunctionsResponder(resp) + result, err = client.ListFunctionSecretsSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListFunctions", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListFunctionSecretsSlot", resp, "Failure responding to request") } return } -// ListFunctionsPreparer prepares the ListFunctions request. -func (client AppsClient) ListFunctionsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { +// ListFunctionSecretsSlotPreparer prepares the ListFunctionSecretsSlot request. +func (client AppsClient) ListFunctionSecretsSlotPreparer(ctx context.Context, resourceGroupName string, name string, functionName string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ + "functionName": autorest.Encode("path", functionName), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -18458,78 +19572,40 @@ func (client AppsClient) ListFunctionsPreparer(ctx context.Context, resourceGrou } preparer := autorest.CreatePreparer( - autorest.AsGet(), + autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/listsecrets", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListFunctionsSender sends the ListFunctions request. The method will close the +// ListFunctionSecretsSlotSender sends the ListFunctionSecretsSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) ListFunctionsSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) ListFunctionSecretsSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// ListFunctionsResponder handles the response to the ListFunctions request. The method always +// ListFunctionSecretsSlotResponder handles the response to the ListFunctionSecretsSlot request. The method always // closes the http.Response Body. -func (client AppsClient) ListFunctionsResponder(resp *http.Response) (result FunctionEnvelopeCollection, err error) { +func (client AppsClient) ListFunctionSecretsSlotResponder(resp *http.Response) (result FunctionSecrets, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listFunctionsNextResults retrieves the next set of results, if any. -func (client AppsClient) listFunctionsNextResults(ctx context.Context, lastResults FunctionEnvelopeCollection) (result FunctionEnvelopeCollection, err error) { - req, err := lastResults.functionEnvelopeCollectionPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "web.AppsClient", "listFunctionsNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListFunctionsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "web.AppsClient", "listFunctionsNextResults", resp, "Failure sending next results request") - } - result, err = client.ListFunctionsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "listFunctionsNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListFunctionsComplete enumerates all values, automatically crossing page boundaries as required. -func (client AppsClient) ListFunctionsComplete(ctx context.Context, resourceGroupName string, name string) (result FunctionEnvelopeCollectionIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListFunctions") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListFunctions(ctx, resourceGroupName, name) + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} return } -// ListFunctionSecrets get function secrets for a function in a web site, or a deployment slot. +// ListHostKeys get host secrets for a function app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. -// functionName - function name. -func (client AppsClient) ListFunctionSecrets(ctx context.Context, resourceGroupName string, name string, functionName string) (result FunctionSecrets, err error) { +func (client AppsClient) ListHostKeys(ctx context.Context, resourceGroupName string, name string) (result HostKeys, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListFunctionSecrets") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListHostKeys") defer func() { sc := -1 if result.Response.Response != nil { @@ -18543,34 +19619,33 @@ func (client AppsClient) ListFunctionSecrets(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "ListFunctionSecrets", err.Error()) + return result, validation.NewError("web.AppsClient", "ListHostKeys", err.Error()) } - req, err := client.ListFunctionSecretsPreparer(ctx, resourceGroupName, name, functionName) + req, err := client.ListHostKeysPreparer(ctx, resourceGroupName, name) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListFunctionSecrets", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListHostKeys", nil, "Failure preparing request") return } - resp, err := client.ListFunctionSecretsSender(req) + resp, err := client.ListHostKeysSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListFunctionSecrets", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListHostKeys", resp, "Failure sending request") return } - result, err = client.ListFunctionSecretsResponder(resp) + result, err = client.ListHostKeysResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListFunctionSecrets", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListHostKeys", resp, "Failure responding to request") } return } -// ListFunctionSecretsPreparer prepares the ListFunctionSecrets request. -func (client AppsClient) ListFunctionSecretsPreparer(ctx context.Context, resourceGroupName string, name string, functionName string) (*http.Request, error) { +// ListHostKeysPreparer prepares the ListHostKeys request. +func (client AppsClient) ListHostKeysPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "functionName": autorest.Encode("path", functionName), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -18584,21 +19659,21 @@ func (client AppsClient) ListFunctionSecretsPreparer(ctx context.Context, resour preparer := autorest.CreatePreparer( autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/listsecrets", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/listkeys", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListFunctionSecretsSender sends the ListFunctionSecrets request. The method will close the +// ListHostKeysSender sends the ListHostKeys request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) ListFunctionSecretsSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) ListHostKeysSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// ListFunctionSecretsResponder handles the response to the ListFunctionSecrets request. The method always +// ListHostKeysResponder handles the response to the ListHostKeys request. The method always // closes the http.Response Body. -func (client AppsClient) ListFunctionSecretsResponder(resp *http.Response) (result FunctionSecrets, err error) { +func (client AppsClient) ListHostKeysResponder(resp *http.Response) (result HostKeys, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -18609,16 +19684,14 @@ func (client AppsClient) ListFunctionSecretsResponder(resp *http.Response) (resu return } -// ListFunctionSecretsSlot get function secrets for a function in a web site, or a deployment slot. +// ListHostKeysSlot get host secrets for a function app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. -// functionName - function name. -// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the -// production slot. -func (client AppsClient) ListFunctionSecretsSlot(ctx context.Context, resourceGroupName string, name string, functionName string, slot string) (result FunctionSecrets, err error) { +// slot - name of the deployment slot. +func (client AppsClient) ListHostKeysSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result HostKeys, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListFunctionSecretsSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListHostKeysSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -18632,34 +19705,33 @@ func (client AppsClient) ListFunctionSecretsSlot(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "ListFunctionSecretsSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "ListHostKeysSlot", err.Error()) } - req, err := client.ListFunctionSecretsSlotPreparer(ctx, resourceGroupName, name, functionName, slot) + req, err := client.ListHostKeysSlotPreparer(ctx, resourceGroupName, name, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListFunctionSecretsSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListHostKeysSlot", nil, "Failure preparing request") return } - resp, err := client.ListFunctionSecretsSlotSender(req) + resp, err := client.ListHostKeysSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListFunctionSecretsSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListHostKeysSlot", resp, "Failure sending request") return } - result, err = client.ListFunctionSecretsSlotResponder(resp) + result, err = client.ListHostKeysSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListFunctionSecretsSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListHostKeysSlot", resp, "Failure responding to request") } return } -// ListFunctionSecretsSlotPreparer prepares the ListFunctionSecretsSlot request. -func (client AppsClient) ListFunctionSecretsSlotPreparer(ctx context.Context, resourceGroupName string, name string, functionName string, slot string) (*http.Request, error) { +// ListHostKeysSlotPreparer prepares the ListHostKeysSlot request. +func (client AppsClient) ListHostKeysSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "functionName": autorest.Encode("path", functionName), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), "slot": autorest.Encode("path", slot), @@ -18674,21 +19746,21 @@ func (client AppsClient) ListFunctionSecretsSlotPreparer(ctx context.Context, re preparer := autorest.CreatePreparer( autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/listsecrets", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/listkeys", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListFunctionSecretsSlotSender sends the ListFunctionSecretsSlot request. The method will close the +// ListHostKeysSlotSender sends the ListHostKeysSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) ListFunctionSecretsSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) ListHostKeysSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// ListFunctionSecretsSlotResponder handles the response to the ListFunctionSecretsSlot request. The method always +// ListHostKeysSlotResponder handles the response to the ListHostKeysSlot request. The method always // closes the http.Response Body. -func (client AppsClient) ListFunctionSecretsSlotResponder(resp *http.Response) (result FunctionSecrets, err error) { +func (client AppsClient) ListHostKeysSlotResponder(resp *http.Response) (result HostKeys, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -19304,8 +20376,7 @@ func (client AppsClient) ListHybridConnectionsSlotResponder(resp *http.Response) // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. -// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the -// production slot. +// slot - name of the deployment slot. func (client AppsClient) ListInstanceFunctionsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result FunctionEnvelopeCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListInstanceFunctionsSlot") @@ -24584,16 +25655,225 @@ func (client AppsClient) ListSnapshotsSlot(ctx context.Context, resourceGroupNam return } - result.sc, err = client.ListSnapshotsSlotResponder(resp) + result.sc, err = client.ListSnapshotsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSnapshotsSlot", resp, "Failure responding to request") + } + + return +} + +// ListSnapshotsSlotPreparer prepares the ListSnapshotsSlot request. +func (client AppsClient) ListSnapshotsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/snapshots", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSnapshotsSlotSender sends the ListSnapshotsSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListSnapshotsSlotSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListSnapshotsSlotResponder handles the response to the ListSnapshotsSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListSnapshotsSlotResponder(resp *http.Response) (result SnapshotCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listSnapshotsSlotNextResults retrieves the next set of results, if any. +func (client AppsClient) listSnapshotsSlotNextResults(ctx context.Context, lastResults SnapshotCollection) (result SnapshotCollection, err error) { + req, err := lastResults.snapshotCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listSnapshotsSlotNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSnapshotsSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listSnapshotsSlotNextResults", resp, "Failure sending next results request") + } + result, err = client.ListSnapshotsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listSnapshotsSlotNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListSnapshotsSlotComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListSnapshotsSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result SnapshotCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListSnapshotsSlot") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListSnapshotsSlot(ctx, resourceGroupName, name, slot) + return +} + +// ListSyncFunctionTriggers this is to allow calling via powershell and ARM template. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) ListSyncFunctionTriggers(ctx context.Context, resourceGroupName string, name string) (result FunctionSecrets, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListSyncFunctionTriggers") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListSyncFunctionTriggers", err.Error()) + } + + req, err := client.ListSyncFunctionTriggersPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSyncFunctionTriggers", nil, "Failure preparing request") + return + } + + resp, err := client.ListSyncFunctionTriggersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSyncFunctionTriggers", resp, "Failure sending request") + return + } + + result, err = client.ListSyncFunctionTriggersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSyncFunctionTriggers", resp, "Failure responding to request") + } + + return +} + +// ListSyncFunctionTriggersPreparer prepares the ListSyncFunctionTriggers request. +func (client AppsClient) ListSyncFunctionTriggersPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/listsyncfunctiontriggerstatus", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSyncFunctionTriggersSender sends the ListSyncFunctionTriggers request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListSyncFunctionTriggersSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListSyncFunctionTriggersResponder handles the response to the ListSyncFunctionTriggers request. The method always +// closes the http.Response Body. +func (client AppsClient) ListSyncFunctionTriggersResponder(resp *http.Response) (result FunctionSecrets, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListSyncFunctionTriggersSlot this is to allow calling via powershell and ARM template. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. +func (client AppsClient) ListSyncFunctionTriggersSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result FunctionSecrets, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListSyncFunctionTriggersSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListSyncFunctionTriggersSlot", err.Error()) + } + + req, err := client.ListSyncFunctionTriggersSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSyncFunctionTriggersSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListSyncFunctionTriggersSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSyncFunctionTriggersSlot", resp, "Failure sending request") + return + } + + result, err = client.ListSyncFunctionTriggersSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSnapshotsSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSyncFunctionTriggersSlot", resp, "Failure responding to request") } return } -// ListSnapshotsSlotPreparer prepares the ListSnapshotsSlot request. -func (client AppsClient) ListSnapshotsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { +// ListSyncFunctionTriggersSlotPreparer prepares the ListSyncFunctionTriggersSlot request. +func (client AppsClient) ListSyncFunctionTriggersSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -24607,23 +25887,23 @@ func (client AppsClient) ListSnapshotsSlotPreparer(ctx context.Context, resource } preparer := autorest.CreatePreparer( - autorest.AsGet(), + autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/snapshots", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/listsyncfunctiontriggerstatus", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListSnapshotsSlotSender sends the ListSnapshotsSlot request. The method will close the +// ListSyncFunctionTriggersSlotSender sends the ListSyncFunctionTriggersSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) ListSnapshotsSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) ListSyncFunctionTriggersSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// ListSnapshotsSlotResponder handles the response to the ListSnapshotsSlot request. The method always +// ListSyncFunctionTriggersSlotResponder handles the response to the ListSyncFunctionTriggersSlot request. The method always // closes the http.Response Body. -func (client AppsClient) ListSnapshotsSlotResponder(resp *http.Response) (result SnapshotCollection, err error) { +func (client AppsClient) ListSyncFunctionTriggersSlotResponder(resp *http.Response) (result FunctionSecrets, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -24634,54 +25914,17 @@ func (client AppsClient) ListSnapshotsSlotResponder(resp *http.Response) (result return } -// listSnapshotsSlotNextResults retrieves the next set of results, if any. -func (client AppsClient) listSnapshotsSlotNextResults(ctx context.Context, lastResults SnapshotCollection) (result SnapshotCollection, err error) { - req, err := lastResults.snapshotCollectionPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "web.AppsClient", "listSnapshotsSlotNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSnapshotsSlotSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "web.AppsClient", "listSnapshotsSlotNextResults", resp, "Failure sending next results request") - } - result, err = client.ListSnapshotsSlotResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "listSnapshotsSlotNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListSnapshotsSlotComplete enumerates all values, automatically crossing page boundaries as required. -func (client AppsClient) ListSnapshotsSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result SnapshotCollectionIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListSnapshotsSlot") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListSnapshotsSlot(ctx, resourceGroupName, name, slot) - return -} - -// ListSyncFunctionTriggers this is to allow calling via powershell and ARM template. +// ListSyncStatus this is to allow calling via powershell and ARM template. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -func (client AppsClient) ListSyncFunctionTriggers(ctx context.Context, resourceGroupName string, name string) (result FunctionSecrets, err error) { +func (client AppsClient) ListSyncStatus(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListSyncFunctionTriggers") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListSyncStatus") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.Response != nil { + sc = result.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -24691,32 +25934,32 @@ func (client AppsClient) ListSyncFunctionTriggers(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "ListSyncFunctionTriggers", err.Error()) + return result, validation.NewError("web.AppsClient", "ListSyncStatus", err.Error()) } - req, err := client.ListSyncFunctionTriggersPreparer(ctx, resourceGroupName, name) + req, err := client.ListSyncStatusPreparer(ctx, resourceGroupName, name) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSyncFunctionTriggers", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSyncStatus", nil, "Failure preparing request") return } - resp, err := client.ListSyncFunctionTriggersSender(req) + resp, err := client.ListSyncStatusSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSyncFunctionTriggers", resp, "Failure sending request") + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSyncStatus", resp, "Failure sending request") return } - result, err = client.ListSyncFunctionTriggersResponder(resp) + result, err = client.ListSyncStatusResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSyncFunctionTriggers", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSyncStatus", resp, "Failure responding to request") } return } -// ListSyncFunctionTriggersPreparer prepares the ListSyncFunctionTriggers request. -func (client AppsClient) ListSyncFunctionTriggersPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { +// ListSyncStatusPreparer prepares the ListSyncStatus request. +func (client AppsClient) ListSyncStatusPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -24731,44 +25974,42 @@ func (client AppsClient) ListSyncFunctionTriggersPreparer(ctx context.Context, r preparer := autorest.CreatePreparer( autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/listsyncfunctiontriggerstatus", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/listsyncstatus", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListSyncFunctionTriggersSender sends the ListSyncFunctionTriggers request. The method will close the +// ListSyncStatusSender sends the ListSyncStatus request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) ListSyncFunctionTriggersSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) ListSyncStatusSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// ListSyncFunctionTriggersResponder handles the response to the ListSyncFunctionTriggers request. The method always +// ListSyncStatusResponder handles the response to the ListSyncStatus request. The method always // closes the http.Response Body. -func (client AppsClient) ListSyncFunctionTriggersResponder(resp *http.Response) (result FunctionSecrets, err error) { +func (client AppsClient) ListSyncStatusResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} + result.Response = resp return } -// ListSyncFunctionTriggersSlot this is to allow calling via powershell and ARM template. +// ListSyncStatusSlot this is to allow calling via powershell and ARM template. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// slot - name of the deployment slot. If a slot is not specified, the API will restore a backup of the -// production slot. -func (client AppsClient) ListSyncFunctionTriggersSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result FunctionSecrets, err error) { +// slot - name of the deployment slot. +func (client AppsClient) ListSyncStatusSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListSyncFunctionTriggersSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListSyncStatusSlot") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.Response != nil { + sc = result.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -24778,32 +26019,32 @@ func (client AppsClient) ListSyncFunctionTriggersSlot(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "ListSyncFunctionTriggersSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "ListSyncStatusSlot", err.Error()) } - req, err := client.ListSyncFunctionTriggersSlotPreparer(ctx, resourceGroupName, name, slot) + req, err := client.ListSyncStatusSlotPreparer(ctx, resourceGroupName, name, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSyncFunctionTriggersSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSyncStatusSlot", nil, "Failure preparing request") return } - resp, err := client.ListSyncFunctionTriggersSlotSender(req) + resp, err := client.ListSyncStatusSlotSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSyncFunctionTriggersSlot", resp, "Failure sending request") + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSyncStatusSlot", resp, "Failure sending request") return } - result, err = client.ListSyncFunctionTriggersSlotResponder(resp) + result, err = client.ListSyncStatusSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSyncFunctionTriggersSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSyncStatusSlot", resp, "Failure responding to request") } return } -// ListSyncFunctionTriggersSlotPreparer prepares the ListSyncFunctionTriggersSlot request. -func (client AppsClient) ListSyncFunctionTriggersSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { +// ListSyncStatusSlotPreparer prepares the ListSyncStatusSlot request. +func (client AppsClient) ListSyncStatusSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -24819,28 +26060,27 @@ func (client AppsClient) ListSyncFunctionTriggersSlotPreparer(ctx context.Contex preparer := autorest.CreatePreparer( autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/listsyncfunctiontriggerstatus", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/listsyncstatus", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListSyncFunctionTriggersSlotSender sends the ListSyncFunctionTriggersSlot request. The method will close the +// ListSyncStatusSlotSender sends the ListSyncStatusSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) ListSyncFunctionTriggersSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) ListSyncStatusSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// ListSyncFunctionTriggersSlotResponder handles the response to the ListSyncFunctionTriggersSlot request. The method always +// ListSyncStatusSlotResponder handles the response to the ListSyncStatusSlot request. The method always // closes the http.Response Body. -func (client AppsClient) ListSyncFunctionTriggersSlotResponder(resp *http.Response) (result FunctionSecrets, err error) { +func (client AppsClient) ListSyncStatusSlotResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} + result.Response = resp return } @@ -29646,7 +30886,177 @@ func (client AppsClient) SwapSlotWithProductionResponder(resp *http.Response) (r return } -// SyncFunctionTriggers syncs function trigger metadata to the scale controller +// SyncFunctions syncs function trigger metadata to the management database +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) SyncFunctions(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.SyncFunctions") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "SyncFunctions", err.Error()) + } + + req, err := client.SyncFunctionsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "SyncFunctions", nil, "Failure preparing request") + return + } + + resp, err := client.SyncFunctionsSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "SyncFunctions", resp, "Failure sending request") + return + } + + result, err = client.SyncFunctionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "SyncFunctions", resp, "Failure responding to request") + } + + return +} + +// SyncFunctionsPreparer prepares the SyncFunctions request. +func (client AppsClient) SyncFunctionsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/sync", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SyncFunctionsSender sends the SyncFunctions request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) SyncFunctionsSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// SyncFunctionsResponder handles the response to the SyncFunctions request. The method always +// closes the http.Response Body. +func (client AppsClient) SyncFunctionsResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// SyncFunctionsSlot syncs function trigger metadata to the management database +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. +func (client AppsClient) SyncFunctionsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.SyncFunctionsSlot") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "SyncFunctionsSlot", err.Error()) + } + + req, err := client.SyncFunctionsSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "SyncFunctionsSlot", nil, "Failure preparing request") + return + } + + resp, err := client.SyncFunctionsSlotSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "SyncFunctionsSlot", resp, "Failure sending request") + return + } + + result, err = client.SyncFunctionsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "SyncFunctionsSlot", resp, "Failure responding to request") + } + + return +} + +// SyncFunctionsSlotPreparer prepares the SyncFunctionsSlot request. +func (client AppsClient) SyncFunctionsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/sync", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SyncFunctionsSlotSender sends the SyncFunctionsSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) SyncFunctionsSlotSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// SyncFunctionsSlotResponder handles the response to the SyncFunctionsSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) SyncFunctionsSlotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// SyncFunctionTriggers syncs function trigger metadata to the management database // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -29730,12 +31140,11 @@ func (client AppsClient) SyncFunctionTriggersResponder(resp *http.Response) (res return } -// SyncFunctionTriggersSlot syncs function trigger metadata to the scale controller +// SyncFunctionTriggersSlot syncs function trigger metadata to the management database // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// slot - name of the deployment slot. If a slot is not specified, the API will restore a backup of the -// production slot. +// slot - name of the deployment slot. func (client AppsClient) SyncFunctionTriggersSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.SyncFunctionTriggersSlot") diff --git a/services/web/mgmt/2018-02-01/web/models.go b/services/web/mgmt/2018-02-01/web/models.go index b8666162d53b..24b150a12227 100644 --- a/services/web/mgmt/2018-02-01/web/models.go +++ b/services/web/mgmt/2018-02-01/web/models.go @@ -9813,7 +9813,7 @@ type FileSystemHTTPLogsConfig struct { Enabled *bool `json:"enabled,omitempty"` } -// FunctionEnvelope web Job Information. +// FunctionEnvelope function information. type FunctionEnvelope struct { autorest.Response `json:"-"` // FunctionEnvelopeProperties - FunctionEnvelope resource specific properties @@ -10056,6 +10056,8 @@ type FunctionEnvelopeProperties struct { ScriptHref *string `json:"script_href,omitempty"` // ConfigHref - Config URI. ConfigHref *string `json:"config_href,omitempty"` + // TestDataHref - Test data URI. + TestDataHref *string `json:"test_data_href,omitempty"` // SecretsFileHref - Secrets file URI. SecretsFileHref *string `json:"secrets_file_href,omitempty"` // Href - Function URI. @@ -10066,6 +10068,12 @@ type FunctionEnvelopeProperties struct { Files map[string]*string `json:"files"` // TestData - Test data used when testing via the Azure Portal. TestData *string `json:"test_data,omitempty"` + // InvokeURLTemplate - The invocation URL + InvokeURLTemplate *string `json:"invoke_url_template,omitempty"` + // Language - The function language + Language *string `json:"language,omitempty"` + // IsDisabled - Value indicating whether the function is disabled + IsDisabled *bool `json:"isDisabled,omitempty"` } // MarshalJSON is the custom marshaler for FunctionEnvelopeProperties. @@ -10083,6 +10091,9 @@ func (fe FunctionEnvelopeProperties) MarshalJSON() ([]byte, error) { if fe.ConfigHref != nil { objectMap["config_href"] = fe.ConfigHref } + if fe.TestDataHref != nil { + objectMap["test_data_href"] = fe.TestDataHref + } if fe.SecretsFileHref != nil { objectMap["secrets_file_href"] = fe.SecretsFileHref } @@ -10098,6 +10109,15 @@ func (fe FunctionEnvelopeProperties) MarshalJSON() ([]byte, error) { if fe.TestData != nil { objectMap["test_data"] = fe.TestData } + if fe.InvokeURLTemplate != nil { + objectMap["invoke_url_template"] = fe.InvokeURLTemplate + } + if fe.Language != nil { + objectMap["language"] = fe.Language + } + if fe.IsDisabled != nil { + objectMap["isDisabled"] = fe.IsDisabled + } return json.Marshal(objectMap) } @@ -10502,6 +10522,32 @@ type HostingEnvironmentProfile struct { Type *string `json:"type,omitempty"` } +// HostKeys functions host level keys. +type HostKeys struct { + autorest.Response `json:"-"` + // MasterKey - Secret key. + MasterKey *string `json:"masterKey,omitempty"` + // FunctionKeys - Host level function keys. + FunctionKeys map[string]*string `json:"functionKeys"` + // SystemKeys - System keys. + SystemKeys map[string]*string `json:"systemKeys"` +} + +// MarshalJSON is the custom marshaler for HostKeys. +func (hk HostKeys) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if hk.MasterKey != nil { + objectMap["masterKey"] = hk.MasterKey + } + if hk.FunctionKeys != nil { + objectMap["functionKeys"] = hk.FunctionKeys + } + if hk.SystemKeys != nil { + objectMap["systemKeys"] = hk.SystemKeys + } + return json.Marshal(objectMap) +} + // HostName details of a hostname derived from a domain. type HostName struct { // Name - Name of the hostname. @@ -11945,6 +11991,15 @@ func (j JobProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// KeyInfo function key info. +type KeyInfo struct { + autorest.Response `json:"-"` + // Name - Key name + Name *string `json:"name,omitempty"` + // Value - Key value + Value *string `json:"value,omitempty"` +} + // ListCapability ... type ListCapability struct { autorest.Response `json:"-"` diff --git a/services/web/mgmt/2018-02-01/web/webapi/interfaces.go b/services/web/mgmt/2018-02-01/web/webapi/interfaces.go index 10fe2bd43800..fe6234917363 100644 --- a/services/web/mgmt/2018-02-01/web/webapi/interfaces.go +++ b/services/web/mgmt/2018-02-01/web/webapi/interfaces.go @@ -219,8 +219,12 @@ type AppsClientAPI interface { CreateOrUpdateConfigurationSlot(ctx context.Context, resourceGroupName string, name string, siteConfig web.SiteConfigResource, slot string) (result web.SiteConfigResource, err error) CreateOrUpdateDomainOwnershipIdentifier(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, domainOwnershipIdentifier web.Identifier) (result web.Identifier, err error) CreateOrUpdateDomainOwnershipIdentifierSlot(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, domainOwnershipIdentifier web.Identifier, slot string) (result web.Identifier, err error) + CreateOrUpdateFunctionSecret(ctx context.Context, resourceGroupName string, name string, functionName string, keyName string, key web.KeyInfo) (result web.KeyInfo, err error) + CreateOrUpdateFunctionSecretSlot(ctx context.Context, resourceGroupName string, name string, functionName string, keyName string, slot string, key web.KeyInfo) (result web.KeyInfo, err error) CreateOrUpdateHostNameBinding(ctx context.Context, resourceGroupName string, name string, hostName string, hostNameBinding web.HostNameBinding) (result web.HostNameBinding, err error) CreateOrUpdateHostNameBindingSlot(ctx context.Context, resourceGroupName string, name string, hostName string, hostNameBinding web.HostNameBinding, slot string) (result web.HostNameBinding, err error) + CreateOrUpdateHostSecret(ctx context.Context, resourceGroupName string, name string, keyType string, keyName string, key web.KeyInfo) (result web.KeyInfo, err error) + CreateOrUpdateHostSecretSlot(ctx context.Context, resourceGroupName string, name string, keyType string, keyName string, slot string, key web.KeyInfo) (result web.KeyInfo, err error) CreateOrUpdateHybridConnection(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, connectionEnvelope web.HybridConnection) (result web.HybridConnection, err error) CreateOrUpdateHybridConnectionSlot(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, connectionEnvelope web.HybridConnection, slot string) (result web.HybridConnection, err error) CreateOrUpdatePublicCertificate(ctx context.Context, resourceGroupName string, name string, publicCertificateName string, publicCertificate web.PublicCertificate) (result web.PublicCertificate, err error) @@ -248,8 +252,12 @@ type AppsClientAPI interface { DeleteDomainOwnershipIdentifier(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string) (result autorest.Response, err error) DeleteDomainOwnershipIdentifierSlot(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, slot string) (result autorest.Response, err error) DeleteFunction(ctx context.Context, resourceGroupName string, name string, functionName string) (result autorest.Response, err error) + DeleteFunctionSecret(ctx context.Context, resourceGroupName string, name string, functionName string, keyName string) (result autorest.Response, err error) + DeleteFunctionSecretSlot(ctx context.Context, resourceGroupName string, name string, functionName string, keyName string, slot string) (result autorest.Response, err error) DeleteHostNameBinding(ctx context.Context, resourceGroupName string, name string, hostName string) (result autorest.Response, err error) DeleteHostNameBindingSlot(ctx context.Context, resourceGroupName string, name string, slot string, hostName string) (result autorest.Response, err error) + DeleteHostSecret(ctx context.Context, resourceGroupName string, name string, keyType string, keyName string) (result autorest.Response, err error) + DeleteHostSecretSlot(ctx context.Context, resourceGroupName string, name string, keyType string, keyName string, slot string) (result autorest.Response, err error) DeleteHybridConnection(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string) (result autorest.Response, err error) DeleteHybridConnectionSlot(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, slot string) (result autorest.Response, err error) DeleteInstanceFunctionSlot(ctx context.Context, resourceGroupName string, name string, functionName string, slot string) (result autorest.Response, err error) @@ -398,9 +406,13 @@ type AppsClientAPI interface { ListDeploymentsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.DeploymentCollectionPage, err error) ListDomainOwnershipIdentifiers(ctx context.Context, resourceGroupName string, name string) (result web.IdentifierCollectionPage, err error) ListDomainOwnershipIdentifiersSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.IdentifierCollectionPage, err error) + ListFunctionKeys(ctx context.Context, resourceGroupName string, name string, functionName string) (result web.StringDictionary, err error) + ListFunctionKeysSlot(ctx context.Context, resourceGroupName string, name string, functionName string, slot string) (result web.StringDictionary, err error) ListFunctions(ctx context.Context, resourceGroupName string, name string) (result web.FunctionEnvelopeCollectionPage, err error) ListFunctionSecrets(ctx context.Context, resourceGroupName string, name string, functionName string) (result web.FunctionSecrets, err error) ListFunctionSecretsSlot(ctx context.Context, resourceGroupName string, name string, functionName string, slot string) (result web.FunctionSecrets, err error) + ListHostKeys(ctx context.Context, resourceGroupName string, name string) (result web.HostKeys, err error) + ListHostKeysSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.HostKeys, err error) ListHostNameBindings(ctx context.Context, resourceGroupName string, name string) (result web.HostNameBindingCollectionPage, err error) ListHostNameBindingsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.HostNameBindingCollectionPage, err error) ListHybridConnectionKeys(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string) (result web.HybridConnectionKey, err error) @@ -456,6 +468,8 @@ type AppsClientAPI interface { ListSnapshotsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.SnapshotCollectionPage, err error) ListSyncFunctionTriggers(ctx context.Context, resourceGroupName string, name string) (result web.FunctionSecrets, err error) ListSyncFunctionTriggersSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.FunctionSecrets, err error) + ListSyncStatus(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) + ListSyncStatusSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) ListTriggeredWebJobHistory(ctx context.Context, resourceGroupName string, name string, webJobName string) (result web.TriggeredJobHistoryCollectionPage, err error) ListTriggeredWebJobHistorySlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (result web.TriggeredJobHistoryCollectionPage, err error) ListTriggeredWebJobs(ctx context.Context, resourceGroupName string, name string) (result web.TriggeredWebJobCollectionPage, err error) @@ -506,6 +520,8 @@ type AppsClientAPI interface { StopWebSiteNetworkTraceSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) SwapSlotSlot(ctx context.Context, resourceGroupName string, name string, slotSwapEntity web.CsmSlotEntity, slot string) (result web.AppsSwapSlotSlotFuture, err error) SwapSlotWithProduction(ctx context.Context, resourceGroupName string, name string, slotSwapEntity web.CsmSlotEntity) (result web.AppsSwapSlotWithProductionFuture, err error) + SyncFunctions(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) + SyncFunctionsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) SyncFunctionTriggers(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) SyncFunctionTriggersSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) SyncRepository(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) diff --git a/services/web/mgmt/2019-08-01/web/apps.go b/services/web/mgmt/2019-08-01/web/apps.go index 6a7668705ff9..641575ec3c1b 100644 --- a/services/web/mgmt/2019-08-01/web/apps.go +++ b/services/web/mgmt/2019-08-01/web/apps.go @@ -41,7 +41,7 @@ func NewAppsClientWithBaseURI(baseURI string, subscriptionID string) AppsClient return AppsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// AddPremierAddOn updates a named add-on of an app. +// AddPremierAddOn description for Updates a named add-on of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -96,7 +96,7 @@ func (client AppsClient) AddPremierAddOnPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -131,7 +131,7 @@ func (client AppsClient) AddPremierAddOnResponder(resp *http.Response) (result P return } -// AddPremierAddOnSlot updates a named add-on of an app. +// AddPremierAddOnSlot description for Updates a named add-on of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -189,7 +189,7 @@ func (client AppsClient) AddPremierAddOnSlotPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -224,7 +224,7 @@ func (client AppsClient) AddPremierAddOnSlotResponder(resp *http.Response) (resu return } -// AnalyzeCustomHostname analyze a custom hostname. +// AnalyzeCustomHostname description for Analyze a custom hostname. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of web app. @@ -277,7 +277,7 @@ func (client AppsClient) AnalyzeCustomHostnamePreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -313,7 +313,7 @@ func (client AppsClient) AnalyzeCustomHostnameResponder(resp *http.Response) (re return } -// AnalyzeCustomHostnameSlot analyze a custom hostname. +// AnalyzeCustomHostnameSlot description for Analyze a custom hostname. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of web app. @@ -368,7 +368,7 @@ func (client AppsClient) AnalyzeCustomHostnameSlotPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -404,7 +404,8 @@ func (client AppsClient) AnalyzeCustomHostnameSlotResponder(resp *http.Response) return } -// ApplySlotConfigToProduction applies the configuration settings from the target slot onto the current slot. +// ApplySlotConfigToProduction description for Applies the configuration settings from the target slot onto the current +// slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -460,7 +461,7 @@ func (client AppsClient) ApplySlotConfigToProductionPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -494,7 +495,8 @@ func (client AppsClient) ApplySlotConfigToProductionResponder(resp *http.Respons return } -// ApplySlotConfigurationSlot applies the configuration settings from the target slot onto the current slot. +// ApplySlotConfigurationSlot description for Applies the configuration settings from the target slot onto the current +// slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -552,7 +554,7 @@ func (client AppsClient) ApplySlotConfigurationSlotPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -586,7 +588,7 @@ func (client AppsClient) ApplySlotConfigurationSlotResponder(resp *http.Response return } -// Backup creates a backup of an app. +// Backup description for Creates a backup of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -648,7 +650,7 @@ func (client AppsClient) BackupPreparer(ctx context.Context, resourceGroupName s "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -683,7 +685,7 @@ func (client AppsClient) BackupResponder(resp *http.Response) (result BackupItem return } -// BackupSlot creates a backup of an app. +// BackupSlot description for Creates a backup of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -748,7 +750,7 @@ func (client AppsClient) BackupSlotPreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -783,7 +785,209 @@ func (client AppsClient) BackupSlotResponder(resp *http.Response) (result Backup return } -// CreateDeployment create a deployment for an app, or a deployment slot. +// CopyProductionSlot description for Copies a deployment slot to another deployment slot of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// copySlotEntity - JSON object that contains the target slot name and site config properties to override the +// source slot config. See example. +func (client AppsClient) CopyProductionSlot(ctx context.Context, resourceGroupName string, name string, copySlotEntity CsmCopySlotEntity) (result AppsCopyProductionSlotFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CopyProductionSlot") + 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: copySlotEntity, + Constraints: []validation.Constraint{{Target: "copySlotEntity.TargetSlot", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "copySlotEntity.SiteConfig", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "copySlotEntity.SiteConfig.Push", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "copySlotEntity.SiteConfig.Push.PushSettingsProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "copySlotEntity.SiteConfig.Push.PushSettingsProperties.IsPushEnabled", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + {Target: "copySlotEntity.SiteConfig.PreWarmedInstanceCount", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "copySlotEntity.SiteConfig.PreWarmedInstanceCount", Name: validation.InclusiveMaximum, Rule: int64(10), Chain: nil}, + {Target: "copySlotEntity.SiteConfig.PreWarmedInstanceCount", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "CopyProductionSlot", err.Error()) + } + + req, err := client.CopyProductionSlotPreparer(ctx, resourceGroupName, name, copySlotEntity) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CopyProductionSlot", nil, "Failure preparing request") + return + } + + result, err = client.CopyProductionSlotSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CopyProductionSlot", result.Response(), "Failure sending request") + return + } + + return +} + +// CopyProductionSlotPreparer prepares the CopyProductionSlot request. +func (client AppsClient) CopyProductionSlotPreparer(ctx context.Context, resourceGroupName string, name string, copySlotEntity CsmCopySlotEntity) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotcopy", pathParameters), + autorest.WithJSON(copySlotEntity), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CopyProductionSlotSender sends the CopyProductionSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) CopyProductionSlotSender(req *http.Request) (future AppsCopyProductionSlotFuture, 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 +} + +// CopyProductionSlotResponder handles the response to the CopyProductionSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) CopyProductionSlotResponder(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 +} + +// CopySlotSlot description for Copies a deployment slot to another deployment slot of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// copySlotEntity - JSON object that contains the target slot name and site config properties to override the +// source slot config. See example. +// slot - name of the source slot. If a slot is not specified, the production slot is used as the source slot. +func (client AppsClient) CopySlotSlot(ctx context.Context, resourceGroupName string, name string, copySlotEntity CsmCopySlotEntity, slot string) (result AppsCopySlotSlotFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CopySlotSlot") + 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: copySlotEntity, + Constraints: []validation.Constraint{{Target: "copySlotEntity.TargetSlot", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "copySlotEntity.SiteConfig", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "copySlotEntity.SiteConfig.Push", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "copySlotEntity.SiteConfig.Push.PushSettingsProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "copySlotEntity.SiteConfig.Push.PushSettingsProperties.IsPushEnabled", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + {Target: "copySlotEntity.SiteConfig.PreWarmedInstanceCount", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "copySlotEntity.SiteConfig.PreWarmedInstanceCount", Name: validation.InclusiveMaximum, Rule: int64(10), Chain: nil}, + {Target: "copySlotEntity.SiteConfig.PreWarmedInstanceCount", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "CopySlotSlot", err.Error()) + } + + req, err := client.CopySlotSlotPreparer(ctx, resourceGroupName, name, copySlotEntity, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CopySlotSlot", nil, "Failure preparing request") + return + } + + result, err = client.CopySlotSlotSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CopySlotSlot", result.Response(), "Failure sending request") + return + } + + return +} + +// CopySlotSlotPreparer prepares the CopySlotSlot request. +func (client AppsClient) CopySlotSlotPreparer(ctx context.Context, resourceGroupName string, name string, copySlotEntity CsmCopySlotEntity, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotcopy", pathParameters), + autorest.WithJSON(copySlotEntity), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CopySlotSlotSender sends the CopySlotSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) CopySlotSlotSender(req *http.Request) (future AppsCopySlotSlotFuture, 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 +} + +// CopySlotSlotResponder handles the response to the CopySlotSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) CopySlotSlotResponder(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 +} + +// CreateDeployment description for Create a deployment for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -838,7 +1042,7 @@ func (client AppsClient) CreateDeploymentPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -873,7 +1077,7 @@ func (client AppsClient) CreateDeploymentResponder(resp *http.Response) (result return } -// CreateDeploymentSlot create a deployment for an app, or a deployment slot. +// CreateDeploymentSlot description for Create a deployment for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -931,7 +1135,7 @@ func (client AppsClient) CreateDeploymentSlotPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -966,7 +1170,7 @@ func (client AppsClient) CreateDeploymentSlotResponder(resp *http.Response) (res return } -// CreateFunction create function for web site, or a deployment slot. +// CreateFunction description for Create function for web site, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -1015,7 +1219,7 @@ func (client AppsClient) CreateFunctionPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1056,13 +1260,12 @@ func (client AppsClient) CreateFunctionResponder(resp *http.Response) (result Fu return } -// CreateInstanceFunctionSlot create function for web site, or a deployment slot. +// CreateInstanceFunctionSlot description for Create function for web site, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. // functionName - function name. -// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the -// production slot. +// slot - name of the deployment slot. // functionEnvelope - function details. func (client AppsClient) CreateInstanceFunctionSlot(ctx context.Context, resourceGroupName string, name string, functionName string, slot string, functionEnvelope FunctionEnvelope) (result AppsCreateInstanceFunctionSlotFuture, err error) { if tracing.IsEnabled() { @@ -1108,7 +1311,7 @@ func (client AppsClient) CreateInstanceFunctionSlotPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1149,7 +1352,7 @@ func (client AppsClient) CreateInstanceFunctionSlotResponder(resp *http.Response return } -// CreateInstanceMSDeployOperation invoke the MSDeploy web app extension. +// CreateInstanceMSDeployOperation description for Invoke the MSDeploy web app extension. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of web app. @@ -1198,7 +1401,7 @@ func (client AppsClient) CreateInstanceMSDeployOperationPreparer(ctx context.Con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1239,7 +1442,7 @@ func (client AppsClient) CreateInstanceMSDeployOperationResponder(resp *http.Res return } -// CreateInstanceMSDeployOperationSlot invoke the MSDeploy web app extension. +// CreateInstanceMSDeployOperationSlot description for Invoke the MSDeploy web app extension. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of web app. @@ -1290,7 +1493,7 @@ func (client AppsClient) CreateInstanceMSDeployOperationSlotPreparer(ctx context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1331,7 +1534,7 @@ func (client AppsClient) CreateInstanceMSDeployOperationSlotResponder(resp *http return } -// CreateMSDeployOperation invoke the MSDeploy web app extension. +// CreateMSDeployOperation description for Invoke the MSDeploy web app extension. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of web app. @@ -1378,7 +1581,7 @@ func (client AppsClient) CreateMSDeployOperationPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1419,7 +1622,7 @@ func (client AppsClient) CreateMSDeployOperationResponder(resp *http.Response) ( return } -// CreateMSDeployOperationSlot invoke the MSDeploy web app extension. +// CreateMSDeployOperationSlot description for Invoke the MSDeploy web app extension. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of web app. @@ -1468,7 +1671,7 @@ func (client AppsClient) CreateMSDeployOperationSlotPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1509,7 +1712,8 @@ func (client AppsClient) CreateMSDeployOperationSlotResponder(resp *http.Respons return } -// CreateOrUpdate creates a new web, mobile, or API app in an existing resource group, or updates an existing app. +// CreateOrUpdate description for Creates a new web, mobile, or API app in an existing resource group, or updates an +// existing app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - unique name of the app to create or update. To create or update a deployment slot, use the {slot} @@ -1538,9 +1742,9 @@ func (client AppsClient) CreateOrUpdate(ctx context.Context, resourceGroupName s Chain: []validation.Constraint{{Target: "siteEnvelope.SiteProperties.SiteConfig.Push.PushSettingsProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "siteEnvelope.SiteProperties.SiteConfig.Push.PushSettingsProperties.IsPushEnabled", Name: validation.Null, Rule: true, Chain: nil}}}, }}, - {Target: "siteEnvelope.SiteProperties.SiteConfig.ReservedInstanceCount", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "siteEnvelope.SiteProperties.SiteConfig.ReservedInstanceCount", Name: validation.InclusiveMaximum, Rule: int64(10), Chain: nil}, - {Target: "siteEnvelope.SiteProperties.SiteConfig.ReservedInstanceCount", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, + {Target: "siteEnvelope.SiteProperties.SiteConfig.PreWarmedInstanceCount", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteEnvelope.SiteProperties.SiteConfig.PreWarmedInstanceCount", Name: validation.InclusiveMaximum, Rule: int64(10), Chain: nil}, + {Target: "siteEnvelope.SiteProperties.SiteConfig.PreWarmedInstanceCount", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}, }}, {Target: "siteEnvelope.SiteProperties.CloningInfo", Name: validation.Null, Rule: false, @@ -1572,7 +1776,7 @@ func (client AppsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1613,7 +1817,7 @@ func (client AppsClient) CreateOrUpdateResponder(resp *http.Response) (result Si return } -// CreateOrUpdateConfiguration updates the configuration of an app. +// CreateOrUpdateConfiguration description for Updates the configuration of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -1640,9 +1844,9 @@ func (client AppsClient) CreateOrUpdateConfiguration(ctx context.Context, resour Chain: []validation.Constraint{{Target: "siteConfig.SiteConfig.Push.PushSettingsProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "siteConfig.SiteConfig.Push.PushSettingsProperties.IsPushEnabled", Name: validation.Null, Rule: true, Chain: nil}}}, }}, - {Target: "siteConfig.SiteConfig.ReservedInstanceCount", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "siteConfig.SiteConfig.ReservedInstanceCount", Name: validation.InclusiveMaximum, Rule: int64(10), Chain: nil}, - {Target: "siteConfig.SiteConfig.ReservedInstanceCount", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, + {Target: "siteConfig.SiteConfig.PreWarmedInstanceCount", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteConfig.SiteConfig.PreWarmedInstanceCount", Name: validation.InclusiveMaximum, Rule: int64(10), Chain: nil}, + {Target: "siteConfig.SiteConfig.PreWarmedInstanceCount", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}, }}}}}); err != nil { return result, validation.NewError("web.AppsClient", "CreateOrUpdateConfiguration", err.Error()) @@ -1677,7 +1881,7 @@ func (client AppsClient) CreateOrUpdateConfigurationPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1712,7 +1916,7 @@ func (client AppsClient) CreateOrUpdateConfigurationResponder(resp *http.Respons return } -// CreateOrUpdateConfigurationSlot updates the configuration of an app. +// CreateOrUpdateConfigurationSlot description for Updates the configuration of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -1741,9 +1945,9 @@ func (client AppsClient) CreateOrUpdateConfigurationSlot(ctx context.Context, re Chain: []validation.Constraint{{Target: "siteConfig.SiteConfig.Push.PushSettingsProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "siteConfig.SiteConfig.Push.PushSettingsProperties.IsPushEnabled", Name: validation.Null, Rule: true, Chain: nil}}}, }}, - {Target: "siteConfig.SiteConfig.ReservedInstanceCount", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "siteConfig.SiteConfig.ReservedInstanceCount", Name: validation.InclusiveMaximum, Rule: int64(10), Chain: nil}, - {Target: "siteConfig.SiteConfig.ReservedInstanceCount", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, + {Target: "siteConfig.SiteConfig.PreWarmedInstanceCount", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteConfig.SiteConfig.PreWarmedInstanceCount", Name: validation.InclusiveMaximum, Rule: int64(10), Chain: nil}, + {Target: "siteConfig.SiteConfig.PreWarmedInstanceCount", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}, }}}}}); err != nil { return result, validation.NewError("web.AppsClient", "CreateOrUpdateConfigurationSlot", err.Error()) @@ -1779,7 +1983,7 @@ func (client AppsClient) CreateOrUpdateConfigurationSlotPreparer(ctx context.Con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1814,8 +2018,8 @@ func (client AppsClient) CreateOrUpdateConfigurationSlotResponder(resp *http.Res return } -// CreateOrUpdateDomainOwnershipIdentifier creates a domain ownership identifier for web app, or updates an existing -// ownership identifier. +// CreateOrUpdateDomainOwnershipIdentifier description for Creates a domain ownership identifier for web app, or +// updates an existing ownership identifier. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -1870,7 +2074,7 @@ func (client AppsClient) CreateOrUpdateDomainOwnershipIdentifierPreparer(ctx con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1905,8 +2109,8 @@ func (client AppsClient) CreateOrUpdateDomainOwnershipIdentifierResponder(resp * return } -// CreateOrUpdateDomainOwnershipIdentifierSlot creates a domain ownership identifier for web app, or updates an -// existing ownership identifier. +// CreateOrUpdateDomainOwnershipIdentifierSlot description for Creates a domain ownership identifier for web app, or +// updates an existing ownership identifier. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -1964,7 +2168,7 @@ func (client AppsClient) CreateOrUpdateDomainOwnershipIdentifierSlotPreparer(ctx "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1999,7 +2203,7 @@ func (client AppsClient) CreateOrUpdateDomainOwnershipIdentifierSlotResponder(re return } -// CreateOrUpdateHostNameBinding creates a hostname binding for an app. +// CreateOrUpdateHostNameBinding description for Creates a hostname binding for an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -2054,7 +2258,7 @@ func (client AppsClient) CreateOrUpdateHostNameBindingPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -2089,7 +2293,7 @@ func (client AppsClient) CreateOrUpdateHostNameBindingResponder(resp *http.Respo return } -// CreateOrUpdateHostNameBindingSlot creates a hostname binding for an app. +// CreateOrUpdateHostNameBindingSlot description for Creates a hostname binding for an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -2147,7 +2351,7 @@ func (client AppsClient) CreateOrUpdateHostNameBindingSlotPreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -2182,7 +2386,7 @@ func (client AppsClient) CreateOrUpdateHostNameBindingSlotResponder(resp *http.R return } -// CreateOrUpdateHybridConnection creates a new Hybrid Connection using a Service Bus relay. +// CreateOrUpdateHybridConnection description for Creates a new Hybrid Connection using a Service Bus relay. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - the name of the web app. @@ -2239,7 +2443,7 @@ func (client AppsClient) CreateOrUpdateHybridConnectionPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -2274,7 +2478,7 @@ func (client AppsClient) CreateOrUpdateHybridConnectionResponder(resp *http.Resp return } -// CreateOrUpdateHybridConnectionSlot creates a new Hybrid Connection using a Service Bus relay. +// CreateOrUpdateHybridConnectionSlot description for Creates a new Hybrid Connection using a Service Bus relay. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - the name of the web app. @@ -2333,7 +2537,7 @@ func (client AppsClient) CreateOrUpdateHybridConnectionSlotPreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -2368,7 +2572,7 @@ func (client AppsClient) CreateOrUpdateHybridConnectionSlotResponder(resp *http. return } -// CreateOrUpdatePublicCertificate creates a hostname binding for an app. +// CreateOrUpdatePublicCertificate description for Creates a hostname binding for an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -2424,7 +2628,7 @@ func (client AppsClient) CreateOrUpdatePublicCertificatePreparer(ctx context.Con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -2459,7 +2663,7 @@ func (client AppsClient) CreateOrUpdatePublicCertificateResponder(resp *http.Res return } -// CreateOrUpdatePublicCertificateSlot creates a hostname binding for an app. +// CreateOrUpdatePublicCertificateSlot description for Creates a hostname binding for an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -2518,7 +2722,7 @@ func (client AppsClient) CreateOrUpdatePublicCertificateSlotPreparer(ctx context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -2553,8 +2757,8 @@ func (client AppsClient) CreateOrUpdatePublicCertificateSlotResponder(resp *http return } -// CreateOrUpdateRelayServiceConnection creates a new hybrid connection configuration (PUT), or updates an existing one -// (PATCH). +// CreateOrUpdateRelayServiceConnection description for Creates a new hybrid connection configuration (PUT), or updates +// an existing one (PATCH). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -2609,7 +2813,7 @@ func (client AppsClient) CreateOrUpdateRelayServiceConnectionPreparer(ctx contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -2644,8 +2848,8 @@ func (client AppsClient) CreateOrUpdateRelayServiceConnectionResponder(resp *htt return } -// CreateOrUpdateRelayServiceConnectionSlot creates a new hybrid connection configuration (PUT), or updates an existing -// one (PATCH). +// CreateOrUpdateRelayServiceConnectionSlot description for Creates a new hybrid connection configuration (PUT), or +// updates an existing one (PATCH). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -2703,7 +2907,7 @@ func (client AppsClient) CreateOrUpdateRelayServiceConnectionSlotPreparer(ctx co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -2738,7 +2942,8 @@ func (client AppsClient) CreateOrUpdateRelayServiceConnectionSlotResponder(resp return } -// CreateOrUpdateSlot creates a new web, mobile, or API app in an existing resource group, or updates an existing app. +// CreateOrUpdateSlot description for Creates a new web, mobile, or API app in an existing resource group, or updates +// an existing app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - unique name of the app to create or update. To create or update a deployment slot, use the {slot} @@ -2769,9 +2974,9 @@ func (client AppsClient) CreateOrUpdateSlot(ctx context.Context, resourceGroupNa Chain: []validation.Constraint{{Target: "siteEnvelope.SiteProperties.SiteConfig.Push.PushSettingsProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "siteEnvelope.SiteProperties.SiteConfig.Push.PushSettingsProperties.IsPushEnabled", Name: validation.Null, Rule: true, Chain: nil}}}, }}, - {Target: "siteEnvelope.SiteProperties.SiteConfig.ReservedInstanceCount", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "siteEnvelope.SiteProperties.SiteConfig.ReservedInstanceCount", Name: validation.InclusiveMaximum, Rule: int64(10), Chain: nil}, - {Target: "siteEnvelope.SiteProperties.SiteConfig.ReservedInstanceCount", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, + {Target: "siteEnvelope.SiteProperties.SiteConfig.PreWarmedInstanceCount", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteEnvelope.SiteProperties.SiteConfig.PreWarmedInstanceCount", Name: validation.InclusiveMaximum, Rule: int64(10), Chain: nil}, + {Target: "siteEnvelope.SiteProperties.SiteConfig.PreWarmedInstanceCount", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}, }}, {Target: "siteEnvelope.SiteProperties.CloningInfo", Name: validation.Null, Rule: false, @@ -2804,7 +3009,7 @@ func (client AppsClient) CreateOrUpdateSlotPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -2845,7 +3050,7 @@ func (client AppsClient) CreateOrUpdateSlotResponder(resp *http.Response) (resul return } -// CreateOrUpdateSourceControl updates the source control configuration of an app. +// CreateOrUpdateSourceControl description for Updates the source control configuration of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -2892,7 +3097,7 @@ func (client AppsClient) CreateOrUpdateSourceControlPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -2933,7 +3138,7 @@ func (client AppsClient) CreateOrUpdateSourceControlResponder(resp *http.Respons return } -// CreateOrUpdateSourceControlSlot updates the source control configuration of an app. +// CreateOrUpdateSourceControlSlot description for Updates the source control configuration of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -2983,7 +3188,7 @@ func (client AppsClient) CreateOrUpdateSourceControlSlotPreparer(ctx context.Con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -3024,9 +3229,9 @@ func (client AppsClient) CreateOrUpdateSourceControlSlotResponder(resp *http.Res return } -// CreateOrUpdateSwiftVirtualNetworkConnection integrates this Web App with a Virtual Network. This requires that 1) -// "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet has already been -// delegated, and is not +// CreateOrUpdateSwiftVirtualNetworkConnection description for Integrates this Web App with a Virtual Network. This +// requires that 1) "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet has +// already been delegated, and is not // in use by another App Service Plan other than the one this App is in. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. @@ -3080,7 +3285,7 @@ func (client AppsClient) CreateOrUpdateSwiftVirtualNetworkConnectionPreparer(ctx "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -3115,9 +3320,9 @@ func (client AppsClient) CreateOrUpdateSwiftVirtualNetworkConnectionResponder(re return } -// CreateOrUpdateSwiftVirtualNetworkConnectionSlot integrates this Web App with a Virtual Network. This requires that -// 1) "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet has already been -// delegated, and is not +// CreateOrUpdateSwiftVirtualNetworkConnectionSlot description for Integrates this Web App with a Virtual Network. This +// requires that 1) "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet has +// already been delegated, and is not // in use by another App Service Plan other than the one this App is in. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. @@ -3174,7 +3379,7 @@ func (client AppsClient) CreateOrUpdateSwiftVirtualNetworkConnectionSlotPreparer "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -3209,8 +3414,8 @@ func (client AppsClient) CreateOrUpdateSwiftVirtualNetworkConnectionSlotResponde return } -// CreateOrUpdateVnetConnection adds a Virtual Network connection to an app or slot (PUT) or updates the connection -// properties (PATCH). +// CreateOrUpdateVnetConnection description for Adds a Virtual Network connection to an app or slot (PUT) or updates +// the connection properties (PATCH). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -3265,7 +3470,7 @@ func (client AppsClient) CreateOrUpdateVnetConnectionPreparer(ctx context.Contex "vnetName": autorest.Encode("path", vnetName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -3300,7 +3505,8 @@ func (client AppsClient) CreateOrUpdateVnetConnectionResponder(resp *http.Respon return } -// CreateOrUpdateVnetConnectionGateway adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). +// CreateOrUpdateVnetConnectionGateway description for Adds a gateway to a connected Virtual Network (PUT) or updates +// it (PATCH). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -3360,7 +3566,7 @@ func (client AppsClient) CreateOrUpdateVnetConnectionGatewayPreparer(ctx context "vnetName": autorest.Encode("path", vnetName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -3395,7 +3601,8 @@ func (client AppsClient) CreateOrUpdateVnetConnectionGatewayResponder(resp *http return } -// CreateOrUpdateVnetConnectionGatewaySlot adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). +// CreateOrUpdateVnetConnectionGatewaySlot description for Adds a gateway to a connected Virtual Network (PUT) or +// updates it (PATCH). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -3458,7 +3665,7 @@ func (client AppsClient) CreateOrUpdateVnetConnectionGatewaySlotPreparer(ctx con "vnetName": autorest.Encode("path", vnetName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -3493,8 +3700,8 @@ func (client AppsClient) CreateOrUpdateVnetConnectionGatewaySlotResponder(resp * return } -// CreateOrUpdateVnetConnectionSlot adds a Virtual Network connection to an app or slot (PUT) or updates the connection -// properties (PATCH). +// CreateOrUpdateVnetConnectionSlot description for Adds a Virtual Network connection to an app or slot (PUT) or +// updates the connection properties (PATCH). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -3552,7 +3759,7 @@ func (client AppsClient) CreateOrUpdateVnetConnectionSlotPreparer(ctx context.Co "vnetName": autorest.Encode("path", vnetName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -3587,7 +3794,7 @@ func (client AppsClient) CreateOrUpdateVnetConnectionSlotResponder(resp *http.Re return } -// Delete deletes a web, mobile, or API app, or one of the deployment slots. +// Delete description for Deletes a web, mobile, or API app, or one of the deployment slots. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app to delete. @@ -3642,7 +3849,7 @@ func (client AppsClient) DeletePreparer(ctx context.Context, resourceGroupName s "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -3680,7 +3887,7 @@ func (client AppsClient) DeleteResponder(resp *http.Response) (result autorest.R return } -// DeleteBackup deletes a backup of an app by its ID. +// DeleteBackup description for Deletes a backup of an app by its ID. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -3734,7 +3941,7 @@ func (client AppsClient) DeleteBackupPreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -3766,7 +3973,7 @@ func (client AppsClient) DeleteBackupResponder(resp *http.Response) (result auto return } -// DeleteBackupConfiguration deletes the backup configuration of an app. +// DeleteBackupConfiguration description for Deletes the backup configuration of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -3818,7 +4025,7 @@ func (client AppsClient) DeleteBackupConfigurationPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -3850,7 +4057,7 @@ func (client AppsClient) DeleteBackupConfigurationResponder(resp *http.Response) return } -// DeleteBackupConfigurationSlot deletes the backup configuration of an app. +// DeleteBackupConfigurationSlot description for Deletes the backup configuration of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -3905,7 +4112,7 @@ func (client AppsClient) DeleteBackupConfigurationSlotPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -3937,7 +4144,7 @@ func (client AppsClient) DeleteBackupConfigurationSlotResponder(resp *http.Respo return } -// DeleteBackupSlot deletes a backup of an app by its ID. +// DeleteBackupSlot description for Deletes a backup of an app by its ID. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -3994,7 +4201,7 @@ func (client AppsClient) DeleteBackupSlotPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -4026,7 +4233,7 @@ func (client AppsClient) DeleteBackupSlotResponder(resp *http.Response) (result return } -// DeleteContinuousWebJob delete a continuous web job by its ID for an app, or a deployment slot. +// DeleteContinuousWebJob description for Delete a continuous web job by its ID for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -4080,7 +4287,7 @@ func (client AppsClient) DeleteContinuousWebJobPreparer(ctx context.Context, res "webJobName": autorest.Encode("path", webJobName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -4112,7 +4319,7 @@ func (client AppsClient) DeleteContinuousWebJobResponder(resp *http.Response) (r return } -// DeleteContinuousWebJobSlot delete a continuous web job by its ID for an app, or a deployment slot. +// DeleteContinuousWebJobSlot description for Delete a continuous web job by its ID for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -4169,7 +4376,7 @@ func (client AppsClient) DeleteContinuousWebJobSlotPreparer(ctx context.Context, "webJobName": autorest.Encode("path", webJobName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -4201,7 +4408,7 @@ func (client AppsClient) DeleteContinuousWebJobSlotResponder(resp *http.Response return } -// DeleteDeployment delete a deployment by its ID for an app, or a deployment slot. +// DeleteDeployment description for Delete a deployment by its ID for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -4255,7 +4462,7 @@ func (client AppsClient) DeleteDeploymentPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -4287,7 +4494,7 @@ func (client AppsClient) DeleteDeploymentResponder(resp *http.Response) (result return } -// DeleteDeploymentSlot delete a deployment by its ID for an app, or a deployment slot. +// DeleteDeploymentSlot description for Delete a deployment by its ID for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -4344,7 +4551,7 @@ func (client AppsClient) DeleteDeploymentSlotPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -4376,7 +4583,7 @@ func (client AppsClient) DeleteDeploymentSlotResponder(resp *http.Response) (res return } -// DeleteDomainOwnershipIdentifier deletes a domain ownership identifier for a web app. +// DeleteDomainOwnershipIdentifier description for Deletes a domain ownership identifier for a web app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -4430,7 +4637,7 @@ func (client AppsClient) DeleteDomainOwnershipIdentifierPreparer(ctx context.Con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -4462,7 +4669,7 @@ func (client AppsClient) DeleteDomainOwnershipIdentifierResponder(resp *http.Res return } -// DeleteDomainOwnershipIdentifierSlot deletes a domain ownership identifier for a web app. +// DeleteDomainOwnershipIdentifierSlot description for Deletes a domain ownership identifier for a web app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -4519,7 +4726,7 @@ func (client AppsClient) DeleteDomainOwnershipIdentifierSlotPreparer(ctx context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -4551,7 +4758,7 @@ func (client AppsClient) DeleteDomainOwnershipIdentifierSlotResponder(resp *http return } -// DeleteFunction delete a function for web site, or a deployment slot. +// DeleteFunction description for Delete a function for web site, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -4605,7 +4812,7 @@ func (client AppsClient) DeleteFunctionPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -4637,7 +4844,7 @@ func (client AppsClient) DeleteFunctionResponder(resp *http.Response) (result au return } -// DeleteHostNameBinding deletes a hostname binding for an app. +// DeleteHostNameBinding description for Deletes a hostname binding for an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -4691,7 +4898,7 @@ func (client AppsClient) DeleteHostNameBindingPreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -4723,7 +4930,7 @@ func (client AppsClient) DeleteHostNameBindingResponder(resp *http.Response) (re return } -// DeleteHostNameBindingSlot deletes a hostname binding for an app. +// DeleteHostNameBindingSlot description for Deletes a hostname binding for an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -4780,7 +4987,7 @@ func (client AppsClient) DeleteHostNameBindingSlotPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -4812,7 +5019,7 @@ func (client AppsClient) DeleteHostNameBindingSlotResponder(resp *http.Response) return } -// DeleteHybridConnection removes a Hybrid Connection from this site. +// DeleteHybridConnection description for Removes a Hybrid Connection from this site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - the name of the web app. @@ -4868,7 +5075,7 @@ func (client AppsClient) DeleteHybridConnectionPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -4900,7 +5107,7 @@ func (client AppsClient) DeleteHybridConnectionResponder(resp *http.Response) (r return } -// DeleteHybridConnectionSlot removes a Hybrid Connection from this site. +// DeleteHybridConnectionSlot description for Removes a Hybrid Connection from this site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - the name of the web app. @@ -4958,7 +5165,7 @@ func (client AppsClient) DeleteHybridConnectionSlotPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -4990,13 +5197,12 @@ func (client AppsClient) DeleteHybridConnectionSlotResponder(resp *http.Response return } -// DeleteInstanceFunctionSlot delete a function for web site, or a deployment slot. +// DeleteInstanceFunctionSlot description for Delete a function for web site, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. // functionName - function name. -// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the -// production slot. +// slot - name of the deployment slot. func (client AppsClient) DeleteInstanceFunctionSlot(ctx context.Context, resourceGroupName string, name string, functionName string, slot string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteInstanceFunctionSlot") @@ -5047,7 +5253,7 @@ func (client AppsClient) DeleteInstanceFunctionSlotPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -5079,8 +5285,8 @@ func (client AppsClient) DeleteInstanceFunctionSlotResponder(resp *http.Response return } -// DeleteInstanceProcess terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out -// instance in a web site. +// DeleteInstanceProcess description for Terminate a process by its ID for a web site, or a deployment slot, or +// specific scaled-out instance in a web site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -5137,7 +5343,7 @@ func (client AppsClient) DeleteInstanceProcessPreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -5169,8 +5375,8 @@ func (client AppsClient) DeleteInstanceProcessResponder(resp *http.Response) (re return } -// DeleteInstanceProcessSlot terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out -// instance in a web site. +// DeleteInstanceProcessSlot description for Terminate a process by its ID for a web site, or a deployment slot, or +// specific scaled-out instance in a web site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -5230,7 +5436,7 @@ func (client AppsClient) DeleteInstanceProcessSlotPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -5262,7 +5468,7 @@ func (client AppsClient) DeleteInstanceProcessSlotResponder(resp *http.Response) return } -// DeletePremierAddOn delete a premier add-on from an app. +// DeletePremierAddOn description for Delete a premier add-on from an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -5316,7 +5522,7 @@ func (client AppsClient) DeletePremierAddOnPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -5348,7 +5554,7 @@ func (client AppsClient) DeletePremierAddOnResponder(resp *http.Response) (resul return } -// DeletePremierAddOnSlot delete a premier add-on from an app. +// DeletePremierAddOnSlot description for Delete a premier add-on from an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -5405,7 +5611,7 @@ func (client AppsClient) DeletePremierAddOnSlotPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -5437,8 +5643,8 @@ func (client AppsClient) DeletePremierAddOnSlotResponder(resp *http.Response) (r return } -// DeleteProcess terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in -// a web site. +// DeleteProcess description for Terminate a process by its ID for a web site, or a deployment slot, or specific +// scaled-out instance in a web site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -5492,7 +5698,7 @@ func (client AppsClient) DeleteProcessPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -5524,8 +5730,8 @@ func (client AppsClient) DeleteProcessResponder(resp *http.Response) (result aut return } -// DeleteProcessSlot terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out -// instance in a web site. +// DeleteProcessSlot description for Terminate a process by its ID for a web site, or a deployment slot, or specific +// scaled-out instance in a web site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -5582,7 +5788,7 @@ func (client AppsClient) DeleteProcessSlotPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -5614,7 +5820,7 @@ func (client AppsClient) DeleteProcessSlotResponder(resp *http.Response) (result return } -// DeletePublicCertificate deletes a hostname binding for an app. +// DeletePublicCertificate description for Deletes a hostname binding for an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -5668,7 +5874,7 @@ func (client AppsClient) DeletePublicCertificatePreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -5700,7 +5906,7 @@ func (client AppsClient) DeletePublicCertificateResponder(resp *http.Response) ( return } -// DeletePublicCertificateSlot deletes a hostname binding for an app. +// DeletePublicCertificateSlot description for Deletes a hostname binding for an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -5757,7 +5963,7 @@ func (client AppsClient) DeletePublicCertificateSlotPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -5789,7 +5995,7 @@ func (client AppsClient) DeletePublicCertificateSlotResponder(resp *http.Respons return } -// DeleteRelayServiceConnection deletes a relay service connection by its name. +// DeleteRelayServiceConnection description for Deletes a relay service connection by its name. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -5843,7 +6049,7 @@ func (client AppsClient) DeleteRelayServiceConnectionPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -5875,7 +6081,7 @@ func (client AppsClient) DeleteRelayServiceConnectionResponder(resp *http.Respon return } -// DeleteRelayServiceConnectionSlot deletes a relay service connection by its name. +// DeleteRelayServiceConnectionSlot description for Deletes a relay service connection by its name. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -5932,7 +6138,7 @@ func (client AppsClient) DeleteRelayServiceConnectionSlotPreparer(ctx context.Co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -5964,7 +6170,7 @@ func (client AppsClient) DeleteRelayServiceConnectionSlotResponder(resp *http.Re return } -// DeleteSiteExtension remove a site extension from a web site, or a deployment slot. +// DeleteSiteExtension description for Remove a site extension from a web site, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -6018,7 +6224,7 @@ func (client AppsClient) DeleteSiteExtensionPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -6050,7 +6256,7 @@ func (client AppsClient) DeleteSiteExtensionResponder(resp *http.Response) (resu return } -// DeleteSiteExtensionSlot remove a site extension from a web site, or a deployment slot. +// DeleteSiteExtensionSlot description for Remove a site extension from a web site, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -6107,7 +6313,7 @@ func (client AppsClient) DeleteSiteExtensionSlotPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -6139,7 +6345,7 @@ func (client AppsClient) DeleteSiteExtensionSlotResponder(resp *http.Response) ( return } -// DeleteSlot deletes a web, mobile, or API app, or one of the deployment slots. +// DeleteSlot description for Deletes a web, mobile, or API app, or one of the deployment slots. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app to delete. @@ -6196,7 +6402,7 @@ func (client AppsClient) DeleteSlotPreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -6234,7 +6440,7 @@ func (client AppsClient) DeleteSlotResponder(resp *http.Response) (result autore return } -// DeleteSourceControl deletes the source control configuration of an app. +// DeleteSourceControl description for Deletes the source control configuration of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -6286,7 +6492,7 @@ func (client AppsClient) DeleteSourceControlPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -6318,7 +6524,7 @@ func (client AppsClient) DeleteSourceControlResponder(resp *http.Response) (resu return } -// DeleteSourceControlSlot deletes the source control configuration of an app. +// DeleteSourceControlSlot description for Deletes the source control configuration of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -6373,7 +6579,7 @@ func (client AppsClient) DeleteSourceControlSlotPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -6405,7 +6611,8 @@ func (client AppsClient) DeleteSourceControlSlotResponder(resp *http.Response) ( return } -// DeleteSwiftVirtualNetwork deletes a Swift Virtual Network connection from an app (or deployment slot). +// DeleteSwiftVirtualNetwork description for Deletes a Swift Virtual Network connection from an app (or deployment +// slot). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -6457,7 +6664,7 @@ func (client AppsClient) DeleteSwiftVirtualNetworkPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -6489,7 +6696,8 @@ func (client AppsClient) DeleteSwiftVirtualNetworkResponder(resp *http.Response) return } -// DeleteSwiftVirtualNetworkSlot deletes a Swift Virtual Network connection from an app (or deployment slot). +// DeleteSwiftVirtualNetworkSlot description for Deletes a Swift Virtual Network connection from an app (or deployment +// slot). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -6544,7 +6752,7 @@ func (client AppsClient) DeleteSwiftVirtualNetworkSlotPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -6576,7 +6784,7 @@ func (client AppsClient) DeleteSwiftVirtualNetworkSlotResponder(resp *http.Respo return } -// DeleteTriggeredWebJob delete a triggered web job by its ID for an app, or a deployment slot. +// DeleteTriggeredWebJob description for Delete a triggered web job by its ID for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -6630,7 +6838,7 @@ func (client AppsClient) DeleteTriggeredWebJobPreparer(ctx context.Context, reso "webJobName": autorest.Encode("path", webJobName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -6662,13 +6870,13 @@ func (client AppsClient) DeleteTriggeredWebJobResponder(resp *http.Response) (re return } -// DeleteTriggeredWebJobSlot delete a triggered web job by its ID for an app, or a deployment slot. +// DeleteTriggeredWebJobSlot description for Delete a triggered web job by its ID for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. // webJobName - name of Web Job. -// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the -// production slot. +// slot - name of the deployment slot. If a slot is not specified, the API deletes web job for the production +// slot. func (client AppsClient) DeleteTriggeredWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteTriggeredWebJobSlot") @@ -6719,7 +6927,7 @@ func (client AppsClient) DeleteTriggeredWebJobSlotPreparer(ctx context.Context, "webJobName": autorest.Encode("path", webJobName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -6751,7 +6959,8 @@ func (client AppsClient) DeleteTriggeredWebJobSlotResponder(resp *http.Response) return } -// DeleteVnetConnection deletes a connection from an app (or deployment slot to a named virtual network. +// DeleteVnetConnection description for Deletes a connection from an app (or deployment slot to a named virtual +// network. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -6805,7 +7014,7 @@ func (client AppsClient) DeleteVnetConnectionPreparer(ctx context.Context, resou "vnetName": autorest.Encode("path", vnetName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -6837,7 +7046,8 @@ func (client AppsClient) DeleteVnetConnectionResponder(resp *http.Response) (res return } -// DeleteVnetConnectionSlot deletes a connection from an app (or deployment slot to a named virtual network. +// DeleteVnetConnectionSlot description for Deletes a connection from an app (or deployment slot to a named virtual +// network. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -6894,7 +7104,7 @@ func (client AppsClient) DeleteVnetConnectionSlotPreparer(ctx context.Context, r "vnetName": autorest.Encode("path", vnetName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -6926,8 +7136,8 @@ func (client AppsClient) DeleteVnetConnectionSlotResponder(resp *http.Response) return } -// DiscoverBackup discovers an existing app backup that can be restored from a blob in Azure storage. Use this to get -// information about the databases stored in a backup. +// DiscoverBackup description for Discovers an existing app backup that can be restored from a blob in Azure storage. +// Use this to get information about the databases stored in a backup. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -6985,7 +7195,7 @@ func (client AppsClient) DiscoverBackupPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -7020,8 +7230,8 @@ func (client AppsClient) DiscoverBackupResponder(resp *http.Response) (result Re return } -// DiscoverBackupSlot discovers an existing app backup that can be restored from a blob in Azure storage. Use this to -// get information about the databases stored in a backup. +// DiscoverBackupSlot description for Discovers an existing app backup that can be restored from a blob in Azure +// storage. Use this to get information about the databases stored in a backup. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -7082,7 +7292,7 @@ func (client AppsClient) DiscoverBackupSlotPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -7117,7 +7327,8 @@ func (client AppsClient) DiscoverBackupSlotResponder(resp *http.Response) (resul return } -// GenerateNewSitePublishingPassword generates a new publishing password for an app (or deployment slot, if specified). +// GenerateNewSitePublishingPassword description for Generates a new publishing password for an app (or deployment +// slot, if specified). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -7169,7 +7380,7 @@ func (client AppsClient) GenerateNewSitePublishingPasswordPreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -7201,8 +7412,8 @@ func (client AppsClient) GenerateNewSitePublishingPasswordResponder(resp *http.R return } -// GenerateNewSitePublishingPasswordSlot generates a new publishing password for an app (or deployment slot, if -// specified). +// GenerateNewSitePublishingPasswordSlot description for Generates a new publishing password for an app (or deployment +// slot, if specified). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -7257,7 +7468,7 @@ func (client AppsClient) GenerateNewSitePublishingPasswordSlotPreparer(ctx conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -7289,7 +7500,7 @@ func (client AppsClient) GenerateNewSitePublishingPasswordSlotResponder(resp *ht return } -// Get gets the details of a web, mobile, or API app. +// Get description for Gets the details of a web, mobile, or API app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -7341,7 +7552,7 @@ func (client AppsClient) GetPreparer(ctx context.Context, resourceGroupName stri "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -7374,13 +7585,14 @@ func (client AppsClient) GetResponder(resp *http.Response) (result Site, err err return } -// GetAuthSettings gets the Authentication/Authorization settings of an app. +// GetAppSettingKeyVaultReference description for Gets the config reference and status of an app // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -func (client AppsClient) GetAuthSettings(ctx context.Context, resourceGroupName string, name string) (result SiteAuthSettings, err error) { +// appSettingKey - app Setting key name. +func (client AppsClient) GetAppSettingKeyVaultReference(ctx context.Context, resourceGroupName string, name string, appSettingKey string) (result KeyVaultReferenceResource, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetAuthSettings") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetAppSettingKeyVaultReference") defer func() { sc := -1 if result.Response.Response != nil { @@ -7394,61 +7606,62 @@ func (client AppsClient) GetAuthSettings(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetAuthSettings", err.Error()) + return result, validation.NewError("web.AppsClient", "GetAppSettingKeyVaultReference", err.Error()) } - req, err := client.GetAuthSettingsPreparer(ctx, resourceGroupName, name) + req, err := client.GetAppSettingKeyVaultReferencePreparer(ctx, resourceGroupName, name, appSettingKey) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAuthSettings", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAppSettingKeyVaultReference", nil, "Failure preparing request") return } - resp, err := client.GetAuthSettingsSender(req) + resp, err := client.GetAppSettingKeyVaultReferenceSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAuthSettings", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAppSettingKeyVaultReference", resp, "Failure sending request") return } - result, err = client.GetAuthSettingsResponder(resp) + result, err = client.GetAppSettingKeyVaultReferenceResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAuthSettings", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAppSettingKeyVaultReference", resp, "Failure responding to request") } return } -// GetAuthSettingsPreparer prepares the GetAuthSettings request. -func (client AppsClient) GetAuthSettingsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { +// GetAppSettingKeyVaultReferencePreparer prepares the GetAppSettingKeyVaultReference request. +func (client AppsClient) GetAppSettingKeyVaultReferencePreparer(ctx context.Context, resourceGroupName string, name string, appSettingKey string) (*http.Request, error) { pathParameters := map[string]interface{}{ + "appSettingKey": autorest.Encode("path", appSettingKey), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( - autorest.AsPost(), + autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettings/list", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/configreferences/appsettings/{appSettingKey}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetAuthSettingsSender sends the GetAuthSettings request. The method will close the +// GetAppSettingKeyVaultReferenceSender sends the GetAppSettingKeyVaultReference request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetAuthSettingsSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetAppSettingKeyVaultReferenceSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetAuthSettingsResponder handles the response to the GetAuthSettings request. The method always +// GetAppSettingKeyVaultReferenceResponder handles the response to the GetAppSettingKeyVaultReference request. The method always // closes the http.Response Body. -func (client AppsClient) GetAuthSettingsResponder(resp *http.Response) (result SiteAuthSettings, err error) { +func (client AppsClient) GetAppSettingKeyVaultReferenceResponder(resp *http.Response) (result KeyVaultReferenceResource, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -7459,15 +7672,13 @@ func (client AppsClient) GetAuthSettingsResponder(resp *http.Response) (result S return } -// GetAuthSettingsSlot gets the Authentication/Authorization settings of an app. +// GetAppSettingsKeyVaultReferences description for Gets the config reference app settings and status of an app // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// slot - name of the deployment slot. If a slot is not specified, the API will get the settings for the -// production slot. -func (client AppsClient) GetAuthSettingsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result SiteAuthSettings, err error) { +func (client AppsClient) GetAppSettingsKeyVaultReferences(ctx context.Context, resourceGroupName string, name string) (result KeyVaultReferenceCollection, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetAuthSettingsSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetAppSettingsKeyVaultReferences") defer func() { sc := -1 if result.Response.Response != nil { @@ -7481,62 +7692,61 @@ func (client AppsClient) GetAuthSettingsSlot(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetAuthSettingsSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetAppSettingsKeyVaultReferences", err.Error()) } - req, err := client.GetAuthSettingsSlotPreparer(ctx, resourceGroupName, name, slot) + req, err := client.GetAppSettingsKeyVaultReferencesPreparer(ctx, resourceGroupName, name) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAuthSettingsSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAppSettingsKeyVaultReferences", nil, "Failure preparing request") return } - resp, err := client.GetAuthSettingsSlotSender(req) + resp, err := client.GetAppSettingsKeyVaultReferencesSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAuthSettingsSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAppSettingsKeyVaultReferences", resp, "Failure sending request") return } - result, err = client.GetAuthSettingsSlotResponder(resp) + result, err = client.GetAppSettingsKeyVaultReferencesResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAuthSettingsSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAppSettingsKeyVaultReferences", resp, "Failure responding to request") } return } -// GetAuthSettingsSlotPreparer prepares the GetAuthSettingsSlot request. -func (client AppsClient) GetAuthSettingsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { +// GetAppSettingsKeyVaultReferencesPreparer prepares the GetAppSettingsKeyVaultReferences request. +func (client AppsClient) GetAppSettingsKeyVaultReferencesPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( - autorest.AsPost(), + autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings/list", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/configreferences/appsettings", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetAuthSettingsSlotSender sends the GetAuthSettingsSlot request. The method will close the +// GetAppSettingsKeyVaultReferencesSender sends the GetAppSettingsKeyVaultReferences request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetAuthSettingsSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetAppSettingsKeyVaultReferencesSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetAuthSettingsSlotResponder handles the response to the GetAuthSettingsSlot request. The method always +// GetAppSettingsKeyVaultReferencesResponder handles the response to the GetAppSettingsKeyVaultReferences request. The method always // closes the http.Response Body. -func (client AppsClient) GetAuthSettingsSlotResponder(resp *http.Response) (result SiteAuthSettings, err error) { +func (client AppsClient) GetAppSettingsKeyVaultReferencesResponder(resp *http.Response) (result KeyVaultReferenceCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -7547,13 +7757,13 @@ func (client AppsClient) GetAuthSettingsSlotResponder(resp *http.Response) (resu return } -// GetBackupConfiguration gets the backup configuration of an app. +// GetAuthSettings description for Gets the Authentication/Authorization settings of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -func (client AppsClient) GetBackupConfiguration(ctx context.Context, resourceGroupName string, name string) (result BackupRequest, err error) { +func (client AppsClient) GetAuthSettings(ctx context.Context, resourceGroupName string, name string) (result SiteAuthSettings, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetBackupConfiguration") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetAuthSettings") defer func() { sc := -1 if result.Response.Response != nil { @@ -7567,39 +7777,39 @@ func (client AppsClient) GetBackupConfiguration(ctx context.Context, resourceGro Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetBackupConfiguration", err.Error()) + return result, validation.NewError("web.AppsClient", "GetAuthSettings", err.Error()) } - req, err := client.GetBackupConfigurationPreparer(ctx, resourceGroupName, name) + req, err := client.GetAuthSettingsPreparer(ctx, resourceGroupName, name) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupConfiguration", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAuthSettings", nil, "Failure preparing request") return } - resp, err := client.GetBackupConfigurationSender(req) + resp, err := client.GetAuthSettingsSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupConfiguration", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAuthSettings", resp, "Failure sending request") return } - result, err = client.GetBackupConfigurationResponder(resp) + result, err = client.GetAuthSettingsResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupConfiguration", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAuthSettings", resp, "Failure responding to request") } return } -// GetBackupConfigurationPreparer prepares the GetBackupConfiguration request. -func (client AppsClient) GetBackupConfigurationPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { +// GetAuthSettingsPreparer prepares the GetAuthSettings request. +func (client AppsClient) GetAuthSettingsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -7607,21 +7817,21 @@ func (client AppsClient) GetBackupConfigurationPreparer(ctx context.Context, res preparer := autorest.CreatePreparer( autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/backup/list", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettings/list", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetBackupConfigurationSender sends the GetBackupConfiguration request. The method will close the +// GetAuthSettingsSender sends the GetAuthSettings request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetBackupConfigurationSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetAuthSettingsSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetBackupConfigurationResponder handles the response to the GetBackupConfiguration request. The method always +// GetAuthSettingsResponder handles the response to the GetAuthSettings request. The method always // closes the http.Response Body. -func (client AppsClient) GetBackupConfigurationResponder(resp *http.Response) (result BackupRequest, err error) { +func (client AppsClient) GetAuthSettingsResponder(resp *http.Response) (result SiteAuthSettings, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -7632,15 +7842,15 @@ func (client AppsClient) GetBackupConfigurationResponder(resp *http.Response) (r return } -// GetBackupConfigurationSlot gets the backup configuration of an app. +// GetAuthSettingsSlot description for Gets the Authentication/Authorization settings of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// slot - name of the deployment slot. If a slot is not specified, the API will get the backup configuration -// for the production slot. -func (client AppsClient) GetBackupConfigurationSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result BackupRequest, err error) { +// slot - name of the deployment slot. If a slot is not specified, the API will get the settings for the +// production slot. +func (client AppsClient) GetAuthSettingsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result SiteAuthSettings, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetBackupConfigurationSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetAuthSettingsSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -7654,31 +7864,204 @@ func (client AppsClient) GetBackupConfigurationSlot(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetBackupConfigurationSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetAuthSettingsSlot", err.Error()) } - req, err := client.GetBackupConfigurationSlotPreparer(ctx, resourceGroupName, name, slot) + req, err := client.GetAuthSettingsSlotPreparer(ctx, resourceGroupName, name, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupConfigurationSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAuthSettingsSlot", nil, "Failure preparing request") return } - resp, err := client.GetBackupConfigurationSlotSender(req) + resp, err := client.GetAuthSettingsSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupConfigurationSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAuthSettingsSlot", resp, "Failure sending request") return } - result, err = client.GetBackupConfigurationSlotResponder(resp) + result, err = client.GetAuthSettingsSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupConfigurationSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAuthSettingsSlot", resp, "Failure responding to request") } return } -// GetBackupConfigurationSlotPreparer prepares the GetBackupConfigurationSlot request. +// GetAuthSettingsSlotPreparer prepares the GetAuthSettingsSlot request. +func (client AppsClient) GetAuthSettingsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings/list", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetAuthSettingsSlotSender sends the GetAuthSettingsSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetAuthSettingsSlotSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetAuthSettingsSlotResponder handles the response to the GetAuthSettingsSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetAuthSettingsSlotResponder(resp *http.Response) (result SiteAuthSettings, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetBackupConfiguration description for Gets the backup configuration of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) GetBackupConfiguration(ctx context.Context, resourceGroupName string, name string) (result BackupRequest, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetBackupConfiguration") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetBackupConfiguration", err.Error()) + } + + req, err := client.GetBackupConfigurationPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupConfiguration", nil, "Failure preparing request") + return + } + + resp, err := client.GetBackupConfigurationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupConfiguration", resp, "Failure sending request") + return + } + + result, err = client.GetBackupConfigurationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupConfiguration", resp, "Failure responding to request") + } + + return +} + +// GetBackupConfigurationPreparer prepares the GetBackupConfiguration request. +func (client AppsClient) GetBackupConfigurationPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/backup/list", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetBackupConfigurationSender sends the GetBackupConfiguration request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetBackupConfigurationSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetBackupConfigurationResponder handles the response to the GetBackupConfiguration request. The method always +// closes the http.Response Body. +func (client AppsClient) GetBackupConfigurationResponder(resp *http.Response) (result BackupRequest, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetBackupConfigurationSlot description for Gets the backup configuration of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API will get the backup configuration +// for the production slot. +func (client AppsClient) GetBackupConfigurationSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result BackupRequest, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetBackupConfigurationSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetBackupConfigurationSlot", err.Error()) + } + + req, err := client.GetBackupConfigurationSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupConfigurationSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetBackupConfigurationSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupConfigurationSlot", resp, "Failure sending request") + return + } + + result, err = client.GetBackupConfigurationSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupConfigurationSlot", resp, "Failure responding to request") + } + + return +} + +// GetBackupConfigurationSlotPreparer prepares the GetBackupConfigurationSlot request. func (client AppsClient) GetBackupConfigurationSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), @@ -7687,7 +8070,7 @@ func (client AppsClient) GetBackupConfigurationSlotPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -7720,7 +8103,7 @@ func (client AppsClient) GetBackupConfigurationSlotResponder(resp *http.Response return } -// GetBackupStatus gets a backup of an app by its ID. +// GetBackupStatus description for Gets a backup of an app by its ID. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -7774,7 +8157,7 @@ func (client AppsClient) GetBackupStatusPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -7807,7 +8190,7 @@ func (client AppsClient) GetBackupStatusResponder(resp *http.Response) (result B return } -// GetBackupStatusSlot gets a backup of an app by its ID. +// GetBackupStatusSlot description for Gets a backup of an app by its ID. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -7864,7 +8247,7 @@ func (client AppsClient) GetBackupStatusSlotPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -7897,8 +8280,8 @@ func (client AppsClient) GetBackupStatusSlotResponder(resp *http.Response) (resu return } -// GetConfiguration gets the configuration of an app, such as platform version and bitness, default documents, virtual -// applications, Always On, etc. +// GetConfiguration description for Gets the configuration of an app, such as platform version and bitness, default +// documents, virtual applications, Always On, etc. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -7950,7 +8333,7 @@ func (client AppsClient) GetConfigurationPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -7983,8 +8366,8 @@ func (client AppsClient) GetConfigurationResponder(resp *http.Response) (result return } -// GetConfigurationSlot gets the configuration of an app, such as platform version and bitness, default documents, -// virtual applications, Always On, etc. +// GetConfigurationSlot description for Gets the configuration of an app, such as platform version and bitness, default +// documents, virtual applications, Always On, etc. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -8039,7 +8422,7 @@ func (client AppsClient) GetConfigurationSlotPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -8072,7 +8455,7 @@ func (client AppsClient) GetConfigurationSlotResponder(resp *http.Response) (res return } -// GetConfigurationSnapshot gets a snapshot of the configuration of an app at a previous point in time. +// GetConfigurationSnapshot description for Gets a snapshot of the configuration of an app at a previous point in time. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -8126,7 +8509,7 @@ func (client AppsClient) GetConfigurationSnapshotPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -8159,7 +8542,8 @@ func (client AppsClient) GetConfigurationSnapshotResponder(resp *http.Response) return } -// GetConfigurationSnapshotSlot gets a snapshot of the configuration of an app at a previous point in time. +// GetConfigurationSnapshotSlot description for Gets a snapshot of the configuration of an app at a previous point in +// time. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -8216,7 +8600,7 @@ func (client AppsClient) GetConfigurationSnapshotSlotPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -8249,7 +8633,7 @@ func (client AppsClient) GetConfigurationSnapshotSlotResponder(resp *http.Respon return } -// GetContainerLogsZip gets the ZIP archived docker log files for the given site +// GetContainerLogsZip description for Gets the ZIP archived docker log files for the given site // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of web app. @@ -8301,7 +8685,7 @@ func (client AppsClient) GetContainerLogsZipPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -8333,7 +8717,7 @@ func (client AppsClient) GetContainerLogsZipResponder(resp *http.Response) (resu return } -// GetContainerLogsZipSlot gets the ZIP archived docker log files for the given site +// GetContainerLogsZipSlot description for Gets the ZIP archived docker log files for the given site // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of web app. @@ -8387,7 +8771,7 @@ func (client AppsClient) GetContainerLogsZipSlotPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -8419,7 +8803,7 @@ func (client AppsClient) GetContainerLogsZipSlotResponder(resp *http.Response) ( return } -// GetContinuousWebJob gets a continuous web job by its ID for an app, or a deployment slot. +// GetContinuousWebJob description for Gets a continuous web job by its ID for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -8473,7 +8857,7 @@ func (client AppsClient) GetContinuousWebJobPreparer(ctx context.Context, resour "webJobName": autorest.Encode("path", webJobName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -8506,7 +8890,7 @@ func (client AppsClient) GetContinuousWebJobResponder(resp *http.Response) (resu return } -// GetContinuousWebJobSlot gets a continuous web job by its ID for an app, or a deployment slot. +// GetContinuousWebJobSlot description for Gets a continuous web job by its ID for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -8563,7 +8947,7 @@ func (client AppsClient) GetContinuousWebJobSlotPreparer(ctx context.Context, re "webJobName": autorest.Encode("path", webJobName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -8596,7 +8980,7 @@ func (client AppsClient) GetContinuousWebJobSlotResponder(resp *http.Response) ( return } -// GetDeployment get a deployment by its ID for an app, or a deployment slot. +// GetDeployment description for Get a deployment by its ID for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -8650,7 +9034,7 @@ func (client AppsClient) GetDeploymentPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -8683,7 +9067,7 @@ func (client AppsClient) GetDeploymentResponder(resp *http.Response) (result Dep return } -// GetDeploymentSlot get a deployment by its ID for an app, or a deployment slot. +// GetDeploymentSlot description for Get a deployment by its ID for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -8740,7 +9124,7 @@ func (client AppsClient) GetDeploymentSlotPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -8773,7 +9157,7 @@ func (client AppsClient) GetDeploymentSlotResponder(resp *http.Response) (result return } -// GetDiagnosticLogsConfiguration gets the logging configuration of an app. +// GetDiagnosticLogsConfiguration description for Gets the logging configuration of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -8825,7 +9209,7 @@ func (client AppsClient) GetDiagnosticLogsConfigurationPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -8858,7 +9242,7 @@ func (client AppsClient) GetDiagnosticLogsConfigurationResponder(resp *http.Resp return } -// GetDiagnosticLogsConfigurationSlot gets the logging configuration of an app. +// GetDiagnosticLogsConfigurationSlot description for Gets the logging configuration of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -8913,7 +9297,7 @@ func (client AppsClient) GetDiagnosticLogsConfigurationSlotPreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -8946,7 +9330,7 @@ func (client AppsClient) GetDiagnosticLogsConfigurationSlotResponder(resp *http. return } -// GetDomainOwnershipIdentifier get domain ownership identifier for web app. +// GetDomainOwnershipIdentifier description for Get domain ownership identifier for web app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -9000,7 +9384,7 @@ func (client AppsClient) GetDomainOwnershipIdentifierPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -9033,7 +9417,7 @@ func (client AppsClient) GetDomainOwnershipIdentifierResponder(resp *http.Respon return } -// GetDomainOwnershipIdentifierSlot get domain ownership identifier for web app. +// GetDomainOwnershipIdentifierSlot description for Get domain ownership identifier for web app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -9090,7 +9474,7 @@ func (client AppsClient) GetDomainOwnershipIdentifierSlotPreparer(ctx context.Co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -9123,7 +9507,7 @@ func (client AppsClient) GetDomainOwnershipIdentifierSlotResponder(resp *http.Re return } -// GetFunction get function information by its ID for web site, or a deployment slot. +// GetFunction description for Get function information by its ID for web site, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -9177,7 +9561,7 @@ func (client AppsClient) GetFunctionPreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -9210,7 +9594,7 @@ func (client AppsClient) GetFunctionResponder(resp *http.Response) (result Funct return } -// GetFunctionsAdminToken fetch a short lived token that can be exchanged for a master key. +// GetFunctionsAdminToken description for Fetch a short lived token that can be exchanged for a master key. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of web app. @@ -9262,7 +9646,7 @@ func (client AppsClient) GetFunctionsAdminTokenPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -9295,7 +9679,7 @@ func (client AppsClient) GetFunctionsAdminTokenResponder(resp *http.Response) (r return } -// GetFunctionsAdminTokenSlot fetch a short lived token that can be exchanged for a master key. +// GetFunctionsAdminTokenSlot description for Fetch a short lived token that can be exchanged for a master key. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of web app. @@ -9349,7 +9733,7 @@ func (client AppsClient) GetFunctionsAdminTokenSlotPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -9382,7 +9766,7 @@ func (client AppsClient) GetFunctionsAdminTokenSlotResponder(resp *http.Response return } -// GetHostNameBinding get the named hostname binding for an app (or deployment slot, if specified). +// GetHostNameBinding description for Get the named hostname binding for an app (or deployment slot, if specified). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -9436,7 +9820,7 @@ func (client AppsClient) GetHostNameBindingPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -9469,7 +9853,7 @@ func (client AppsClient) GetHostNameBindingResponder(resp *http.Response) (resul return } -// GetHostNameBindingSlot get the named hostname binding for an app (or deployment slot, if specified). +// GetHostNameBindingSlot description for Get the named hostname binding for an app (or deployment slot, if specified). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -9526,7 +9910,7 @@ func (client AppsClient) GetHostNameBindingSlotPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -9559,7 +9943,7 @@ func (client AppsClient) GetHostNameBindingSlotResponder(resp *http.Response) (r return } -// GetHybridConnection retrieves a specific Service Bus Hybrid Connection used by this Web App. +// GetHybridConnection description for Retrieves a specific Service Bus Hybrid Connection used by this Web App. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - the name of the web app. @@ -9615,7 +9999,7 @@ func (client AppsClient) GetHybridConnectionPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -9648,7 +10032,7 @@ func (client AppsClient) GetHybridConnectionResponder(resp *http.Response) (resu return } -// GetHybridConnectionSlot retrieves a specific Service Bus Hybrid Connection used by this Web App. +// GetHybridConnectionSlot description for Retrieves a specific Service Bus Hybrid Connection used by this Web App. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - the name of the web app. @@ -9706,7 +10090,7 @@ func (client AppsClient) GetHybridConnectionSlotPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -9739,13 +10123,12 @@ func (client AppsClient) GetHybridConnectionSlotResponder(resp *http.Response) ( return } -// GetInstanceFunctionSlot get function information by its ID for web site, or a deployment slot. +// GetInstanceFunctionSlot description for Get function information by its ID for web site, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. // functionName - function name. -// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the -// production slot. +// slot - name of the deployment slot. func (client AppsClient) GetInstanceFunctionSlot(ctx context.Context, resourceGroupName string, name string, functionName string, slot string) (result FunctionEnvelope, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceFunctionSlot") @@ -9796,7 +10179,7 @@ func (client AppsClient) GetInstanceFunctionSlotPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -9829,14 +10212,13 @@ func (client AppsClient) GetInstanceFunctionSlotResponder(resp *http.Response) ( return } -// GetInstanceMSDeployLog get the MSDeploy Log for the last MSDeploy operation. +// GetInstanceInfo description for Gets all scale-out instances of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of web app. -// instanceID - ID of web app instance. -func (client AppsClient) GetInstanceMSDeployLog(ctx context.Context, resourceGroupName string, name string, instanceID string) (result MSDeployLog, err error) { +// name - name of the app. +func (client AppsClient) GetInstanceInfo(ctx context.Context, resourceGroupName string, name string, instanceID string) (result SiteInstanceStatus, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceMSDeployLog") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceInfo") defer func() { sc := -1 if result.Response.Response != nil { @@ -9850,32 +10232,32 @@ func (client AppsClient) GetInstanceMSDeployLog(ctx context.Context, resourceGro Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetInstanceMSDeployLog", err.Error()) + return result, validation.NewError("web.AppsClient", "GetInstanceInfo", err.Error()) } - req, err := client.GetInstanceMSDeployLogPreparer(ctx, resourceGroupName, name, instanceID) + req, err := client.GetInstanceInfoPreparer(ctx, resourceGroupName, name, instanceID) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMSDeployLog", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceInfo", nil, "Failure preparing request") return } - resp, err := client.GetInstanceMSDeployLogSender(req) + resp, err := client.GetInstanceInfoSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMSDeployLog", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceInfo", resp, "Failure sending request") return } - result, err = client.GetInstanceMSDeployLogResponder(resp) + result, err = client.GetInstanceInfoResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMSDeployLog", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceInfo", resp, "Failure responding to request") } return } -// GetInstanceMSDeployLogPreparer prepares the GetInstanceMSDeployLog request. -func (client AppsClient) GetInstanceMSDeployLogPreparer(ctx context.Context, resourceGroupName string, name string, instanceID string) (*http.Request, error) { +// GetInstanceInfoPreparer prepares the GetInstanceInfo request. +func (client AppsClient) GetInstanceInfoPreparer(ctx context.Context, resourceGroupName string, name string, instanceID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "instanceId": autorest.Encode("path", instanceID), "name": autorest.Encode("path", name), @@ -9883,7 +10265,7 @@ func (client AppsClient) GetInstanceMSDeployLogPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -9891,40 +10273,39 @@ func (client AppsClient) GetInstanceMSDeployLogPreparer(ctx context.Context, res preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy/log", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetInstanceMSDeployLogSender sends the GetInstanceMSDeployLog request. The method will close the +// GetInstanceInfoSender sends the GetInstanceInfo request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetInstanceMSDeployLogSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetInstanceInfoSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetInstanceMSDeployLogResponder handles the response to the GetInstanceMSDeployLog request. The method always +// GetInstanceInfoResponder handles the response to the GetInstanceInfo request. The method always // closes the http.Response Body. -func (client AppsClient) GetInstanceMSDeployLogResponder(resp *http.Response) (result MSDeployLog, err error) { +func (client AppsClient) GetInstanceInfoResponder(resp *http.Response) (result SiteInstanceStatus, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetInstanceMSDeployLogSlot get the MSDeploy Log for the last MSDeploy operation. +// GetInstanceInfoSlot description for Gets all scale-out instances of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - name of web app. -// slot - name of web app slot. If not specified then will default to production slot. -// instanceID - ID of web app instance. -func (client AppsClient) GetInstanceMSDeployLogSlot(ctx context.Context, resourceGroupName string, name string, slot string, instanceID string) (result MSDeployLog, err error) { +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API gets the production slot instances. +func (client AppsClient) GetInstanceInfoSlot(ctx context.Context, resourceGroupName string, name string, instanceID string, slot string) (result SiteInstanceStatus, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceMSDeployLogSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceInfoSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -9938,32 +10319,32 @@ func (client AppsClient) GetInstanceMSDeployLogSlot(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetInstanceMSDeployLogSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetInstanceInfoSlot", err.Error()) } - req, err := client.GetInstanceMSDeployLogSlotPreparer(ctx, resourceGroupName, name, slot, instanceID) + req, err := client.GetInstanceInfoSlotPreparer(ctx, resourceGroupName, name, instanceID, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMSDeployLogSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceInfoSlot", nil, "Failure preparing request") return } - resp, err := client.GetInstanceMSDeployLogSlotSender(req) + resp, err := client.GetInstanceInfoSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMSDeployLogSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceInfoSlot", resp, "Failure sending request") return } - result, err = client.GetInstanceMSDeployLogSlotResponder(resp) + result, err = client.GetInstanceInfoSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMSDeployLogSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceInfoSlot", resp, "Failure responding to request") } return } -// GetInstanceMSDeployLogSlotPreparer prepares the GetInstanceMSDeployLogSlot request. -func (client AppsClient) GetInstanceMSDeployLogSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string, instanceID string) (*http.Request, error) { +// GetInstanceInfoSlotPreparer prepares the GetInstanceInfoSlot request. +func (client AppsClient) GetInstanceInfoSlotPreparer(ctx context.Context, resourceGroupName string, name string, instanceID string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "instanceId": autorest.Encode("path", instanceID), "name": autorest.Encode("path", name), @@ -9972,7 +10353,7 @@ func (client AppsClient) GetInstanceMSDeployLogSlotPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -9980,39 +10361,39 @@ func (client AppsClient) GetInstanceMSDeployLogSlotPreparer(ctx context.Context, preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy/log", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetInstanceMSDeployLogSlotSender sends the GetInstanceMSDeployLogSlot request. The method will close the +// GetInstanceInfoSlotSender sends the GetInstanceInfoSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetInstanceMSDeployLogSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetInstanceInfoSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetInstanceMSDeployLogSlotResponder handles the response to the GetInstanceMSDeployLogSlot request. The method always +// GetInstanceInfoSlotResponder handles the response to the GetInstanceInfoSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetInstanceMSDeployLogSlotResponder(resp *http.Response) (result MSDeployLog, err error) { +func (client AppsClient) GetInstanceInfoSlotResponder(resp *http.Response) (result SiteInstanceStatus, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetInstanceMsDeployStatus get the status of the last MSDeploy operation. +// GetInstanceMSDeployLog description for Get the MSDeploy Log for the last MSDeploy operation. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of web app. // instanceID - ID of web app instance. -func (client AppsClient) GetInstanceMsDeployStatus(ctx context.Context, resourceGroupName string, name string, instanceID string) (result MSDeployStatus, err error) { +func (client AppsClient) GetInstanceMSDeployLog(ctx context.Context, resourceGroupName string, name string, instanceID string) (result MSDeployLog, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceMsDeployStatus") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceMSDeployLog") defer func() { sc := -1 if result.Response.Response != nil { @@ -10026,32 +10407,32 @@ func (client AppsClient) GetInstanceMsDeployStatus(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetInstanceMsDeployStatus", err.Error()) + return result, validation.NewError("web.AppsClient", "GetInstanceMSDeployLog", err.Error()) } - req, err := client.GetInstanceMsDeployStatusPreparer(ctx, resourceGroupName, name, instanceID) + req, err := client.GetInstanceMSDeployLogPreparer(ctx, resourceGroupName, name, instanceID) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMsDeployStatus", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMSDeployLog", nil, "Failure preparing request") return } - resp, err := client.GetInstanceMsDeployStatusSender(req) + resp, err := client.GetInstanceMSDeployLogSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMsDeployStatus", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMSDeployLog", resp, "Failure sending request") return } - result, err = client.GetInstanceMsDeployStatusResponder(resp) + result, err = client.GetInstanceMSDeployLogResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMsDeployStatus", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMSDeployLog", resp, "Failure responding to request") } return } -// GetInstanceMsDeployStatusPreparer prepares the GetInstanceMsDeployStatus request. -func (client AppsClient) GetInstanceMsDeployStatusPreparer(ctx context.Context, resourceGroupName string, name string, instanceID string) (*http.Request, error) { +// GetInstanceMSDeployLogPreparer prepares the GetInstanceMSDeployLog request. +func (client AppsClient) GetInstanceMSDeployLogPreparer(ctx context.Context, resourceGroupName string, name string, instanceID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "instanceId": autorest.Encode("path", instanceID), "name": autorest.Encode("path", name), @@ -10059,7 +10440,7 @@ func (client AppsClient) GetInstanceMsDeployStatusPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -10067,40 +10448,40 @@ func (client AppsClient) GetInstanceMsDeployStatusPreparer(ctx context.Context, preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy/log", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetInstanceMsDeployStatusSender sends the GetInstanceMsDeployStatus request. The method will close the +// GetInstanceMSDeployLogSender sends the GetInstanceMSDeployLog request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetInstanceMsDeployStatusSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetInstanceMSDeployLogSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetInstanceMsDeployStatusResponder handles the response to the GetInstanceMsDeployStatus request. The method always +// GetInstanceMSDeployLogResponder handles the response to the GetInstanceMSDeployLog request. The method always // closes the http.Response Body. -func (client AppsClient) GetInstanceMsDeployStatusResponder(resp *http.Response) (result MSDeployStatus, err error) { +func (client AppsClient) GetInstanceMSDeployLogResponder(resp *http.Response) (result MSDeployLog, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetInstanceMsDeployStatusSlot get the status of the last MSDeploy operation. +// GetInstanceMSDeployLogSlot description for Get the MSDeploy Log for the last MSDeploy operation. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of web app. // slot - name of web app slot. If not specified then will default to production slot. // instanceID - ID of web app instance. -func (client AppsClient) GetInstanceMsDeployStatusSlot(ctx context.Context, resourceGroupName string, name string, slot string, instanceID string) (result MSDeployStatus, err error) { +func (client AppsClient) GetInstanceMSDeployLogSlot(ctx context.Context, resourceGroupName string, name string, slot string, instanceID string) (result MSDeployLog, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceMsDeployStatusSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceMSDeployLogSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -10114,7 +10495,183 @@ func (client AppsClient) GetInstanceMsDeployStatusSlot(ctx context.Context, reso Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetInstanceMsDeployStatusSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetInstanceMSDeployLogSlot", err.Error()) + } + + req, err := client.GetInstanceMSDeployLogSlotPreparer(ctx, resourceGroupName, name, slot, instanceID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMSDeployLogSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetInstanceMSDeployLogSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMSDeployLogSlot", resp, "Failure sending request") + return + } + + result, err = client.GetInstanceMSDeployLogSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMSDeployLogSlot", resp, "Failure responding to request") + } + + return +} + +// GetInstanceMSDeployLogSlotPreparer prepares the GetInstanceMSDeployLogSlot request. +func (client AppsClient) GetInstanceMSDeployLogSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string, instanceID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy/log", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetInstanceMSDeployLogSlotSender sends the GetInstanceMSDeployLogSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetInstanceMSDeployLogSlotSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetInstanceMSDeployLogSlotResponder handles the response to the GetInstanceMSDeployLogSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetInstanceMSDeployLogSlotResponder(resp *http.Response) (result MSDeployLog, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetInstanceMsDeployStatus description for Get the status of the last MSDeploy operation. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +// instanceID - ID of web app instance. +func (client AppsClient) GetInstanceMsDeployStatus(ctx context.Context, resourceGroupName string, name string, instanceID string) (result MSDeployStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceMsDeployStatus") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetInstanceMsDeployStatus", err.Error()) + } + + req, err := client.GetInstanceMsDeployStatusPreparer(ctx, resourceGroupName, name, instanceID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMsDeployStatus", nil, "Failure preparing request") + return + } + + resp, err := client.GetInstanceMsDeployStatusSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMsDeployStatus", resp, "Failure sending request") + return + } + + result, err = client.GetInstanceMsDeployStatusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMsDeployStatus", resp, "Failure responding to request") + } + + return +} + +// GetInstanceMsDeployStatusPreparer prepares the GetInstanceMsDeployStatus request. +func (client AppsClient) GetInstanceMsDeployStatusPreparer(ctx context.Context, resourceGroupName string, name string, instanceID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetInstanceMsDeployStatusSender sends the GetInstanceMsDeployStatus request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetInstanceMsDeployStatusSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetInstanceMsDeployStatusResponder handles the response to the GetInstanceMsDeployStatus request. The method always +// closes the http.Response Body. +func (client AppsClient) GetInstanceMsDeployStatusResponder(resp *http.Response) (result MSDeployStatus, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetInstanceMsDeployStatusSlot description for Get the status of the last MSDeploy operation. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +// slot - name of web app slot. If not specified then will default to production slot. +// instanceID - ID of web app instance. +func (client AppsClient) GetInstanceMsDeployStatusSlot(ctx context.Context, resourceGroupName string, name string, slot string, instanceID string) (result MSDeployStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceMsDeployStatusSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetInstanceMsDeployStatusSlot", err.Error()) } req, err := client.GetInstanceMsDeployStatusSlotPreparer(ctx, resourceGroupName, name, slot, instanceID) @@ -10148,7 +10705,7 @@ func (client AppsClient) GetInstanceMsDeployStatusSlotPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -10181,7 +10738,8 @@ func (client AppsClient) GetInstanceMsDeployStatusSlotResponder(resp *http.Respo return } -// GetInstanceProcess get process information by its ID for a specific scaled-out instance in a web site. +// GetInstanceProcess description for Get process information by its ID for a specific scaled-out instance in a web +// site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -10238,7 +10796,7 @@ func (client AppsClient) GetInstanceProcessPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -10271,7 +10829,8 @@ func (client AppsClient) GetInstanceProcessResponder(resp *http.Response) (resul return } -// GetInstanceProcessDump get a memory dump of a process by its ID for a specific scaled-out instance in a web site. +// GetInstanceProcessDump description for Get a memory dump of a process by its ID for a specific scaled-out instance +// in a web site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -10328,7 +10887,7 @@ func (client AppsClient) GetInstanceProcessDumpPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -10360,8 +10919,8 @@ func (client AppsClient) GetInstanceProcessDumpResponder(resp *http.Response) (r return } -// GetInstanceProcessDumpSlot get a memory dump of a process by its ID for a specific scaled-out instance in a web -// site. +// GetInstanceProcessDumpSlot description for Get a memory dump of a process by its ID for a specific scaled-out +// instance in a web site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -10421,7 +10980,7 @@ func (client AppsClient) GetInstanceProcessDumpSlotPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -10453,7 +11012,8 @@ func (client AppsClient) GetInstanceProcessDumpSlotResponder(resp *http.Response return } -// GetInstanceProcessModule get process information by its ID for a specific scaled-out instance in a web site. +// GetInstanceProcessModule description for Get process information by its ID for a specific scaled-out instance in a +// web site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -10512,7 +11072,7 @@ func (client AppsClient) GetInstanceProcessModulePreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -10545,7 +11105,8 @@ func (client AppsClient) GetInstanceProcessModuleResponder(resp *http.Response) return } -// GetInstanceProcessModuleSlot get process information by its ID for a specific scaled-out instance in a web site. +// GetInstanceProcessModuleSlot description for Get process information by its ID for a specific scaled-out instance in +// a web site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -10607,7 +11168,7 @@ func (client AppsClient) GetInstanceProcessModuleSlotPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -10640,7 +11201,8 @@ func (client AppsClient) GetInstanceProcessModuleSlotResponder(resp *http.Respon return } -// GetInstanceProcessSlot get process information by its ID for a specific scaled-out instance in a web site. +// GetInstanceProcessSlot description for Get process information by its ID for a specific scaled-out instance in a web +// site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -10700,7 +11262,7 @@ func (client AppsClient) GetInstanceProcessSlotPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -10733,18 +11295,14 @@ func (client AppsClient) GetInstanceProcessSlotResponder(resp *http.Response) (r return } -// GetInstanceProcessThread get thread information by Thread ID for a specific process, in a specific scaled-out -// instance in a web site. +// GetMigrateMySQLStatus description for Returns the status of MySql in app migration, if one is active, and whether or +// not MySql in app is enabled // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - site name. -// processID - pID. -// threadID - tID. -// instanceID - ID of a specific scaled-out instance. This is the value of the name property in the JSON -// response from "GET api/sites/{siteName}/instances". -func (client AppsClient) GetInstanceProcessThread(ctx context.Context, resourceGroupName string, name string, processID string, threadID string, instanceID string) (result ProcessThreadInfo, err error) { +// name - name of web app. +func (client AppsClient) GetMigrateMySQLStatus(ctx context.Context, resourceGroupName string, name string) (result MigrateMySQLStatus, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceProcessThread") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetMigrateMySQLStatus") defer func() { sc := -1 if result.Response.Response != nil { @@ -10758,42 +11316,39 @@ func (client AppsClient) GetInstanceProcessThread(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetInstanceProcessThread", err.Error()) + return result, validation.NewError("web.AppsClient", "GetMigrateMySQLStatus", err.Error()) } - req, err := client.GetInstanceProcessThreadPreparer(ctx, resourceGroupName, name, processID, threadID, instanceID) + req, err := client.GetMigrateMySQLStatusPreparer(ctx, resourceGroupName, name) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessThread", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMigrateMySQLStatus", nil, "Failure preparing request") return } - resp, err := client.GetInstanceProcessThreadSender(req) + resp, err := client.GetMigrateMySQLStatusSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessThread", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMigrateMySQLStatus", resp, "Failure sending request") return } - result, err = client.GetInstanceProcessThreadResponder(resp) + result, err = client.GetMigrateMySQLStatusResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessThread", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMigrateMySQLStatus", resp, "Failure responding to request") } return } -// GetInstanceProcessThreadPreparer prepares the GetInstanceProcessThread request. -func (client AppsClient) GetInstanceProcessThreadPreparer(ctx context.Context, resourceGroupName string, name string, processID string, threadID string, instanceID string) (*http.Request, error) { +// GetMigrateMySQLStatusPreparer prepares the GetMigrateMySQLStatus request. +func (client AppsClient) GetMigrateMySQLStatusPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), "name": autorest.Encode("path", name), - "processId": autorest.Encode("path", processID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "threadId": autorest.Encode("path", threadID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -10801,45 +11356,40 @@ func (client AppsClient) GetInstanceProcessThreadPreparer(ctx context.Context, r preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/threads/{threadId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql/status", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetInstanceProcessThreadSender sends the GetInstanceProcessThread request. The method will close the +// GetMigrateMySQLStatusSender sends the GetMigrateMySQLStatus request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetInstanceProcessThreadSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetMigrateMySQLStatusSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetInstanceProcessThreadResponder handles the response to the GetInstanceProcessThread request. The method always +// GetMigrateMySQLStatusResponder handles the response to the GetMigrateMySQLStatus request. The method always // closes the http.Response Body. -func (client AppsClient) GetInstanceProcessThreadResponder(resp *http.Response) (result ProcessThreadInfo, err error) { +func (client AppsClient) GetMigrateMySQLStatusResponder(resp *http.Response) (result MigrateMySQLStatus, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetInstanceProcessThreadSlot get thread information by Thread ID for a specific process, in a specific scaled-out -// instance in a web site. +// GetMigrateMySQLStatusSlot description for Returns the status of MySql in app migration, if one is active, and +// whether or not MySql in app is enabled // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - site name. -// processID - pID. -// threadID - tID. -// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the -// production slot. -// instanceID - ID of a specific scaled-out instance. This is the value of the name property in the JSON -// response from "GET api/sites/{siteName}/instances". -func (client AppsClient) GetInstanceProcessThreadSlot(ctx context.Context, resourceGroupName string, name string, processID string, threadID string, slot string, instanceID string) (result ProcessThreadInfo, err error) { +// name - name of web app. +// slot - name of the deployment slot. +func (client AppsClient) GetMigrateMySQLStatusSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result MigrateMySQLStatus, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceProcessThreadSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetMigrateMySQLStatusSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -10853,43 +11403,40 @@ func (client AppsClient) GetInstanceProcessThreadSlot(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetInstanceProcessThreadSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetMigrateMySQLStatusSlot", err.Error()) } - req, err := client.GetInstanceProcessThreadSlotPreparer(ctx, resourceGroupName, name, processID, threadID, slot, instanceID) + req, err := client.GetMigrateMySQLStatusSlotPreparer(ctx, resourceGroupName, name, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessThreadSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMigrateMySQLStatusSlot", nil, "Failure preparing request") return } - resp, err := client.GetInstanceProcessThreadSlotSender(req) + resp, err := client.GetMigrateMySQLStatusSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessThreadSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMigrateMySQLStatusSlot", resp, "Failure sending request") return } - result, err = client.GetInstanceProcessThreadSlotResponder(resp) + result, err = client.GetMigrateMySQLStatusSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessThreadSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMigrateMySQLStatusSlot", resp, "Failure responding to request") } return } -// GetInstanceProcessThreadSlotPreparer prepares the GetInstanceProcessThreadSlot request. -func (client AppsClient) GetInstanceProcessThreadSlotPreparer(ctx context.Context, resourceGroupName string, name string, processID string, threadID string, slot string, instanceID string) (*http.Request, error) { +// GetMigrateMySQLStatusSlotPreparer prepares the GetMigrateMySQLStatusSlot request. +func (client AppsClient) GetMigrateMySQLStatusSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), "name": autorest.Encode("path", name), - "processId": autorest.Encode("path", processID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "threadId": autorest.Encode("path", threadID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -10897,39 +11444,38 @@ func (client AppsClient) GetInstanceProcessThreadSlotPreparer(ctx context.Contex preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/threads/{threadId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/migratemysql/status", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetInstanceProcessThreadSlotSender sends the GetInstanceProcessThreadSlot request. The method will close the +// GetMigrateMySQLStatusSlotSender sends the GetMigrateMySQLStatusSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetInstanceProcessThreadSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetMigrateMySQLStatusSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetInstanceProcessThreadSlotResponder handles the response to the GetInstanceProcessThreadSlot request. The method always +// GetMigrateMySQLStatusSlotResponder handles the response to the GetMigrateMySQLStatusSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetInstanceProcessThreadSlotResponder(resp *http.Response) (result ProcessThreadInfo, err error) { +func (client AppsClient) GetMigrateMySQLStatusSlotResponder(resp *http.Response) (result MigrateMySQLStatus, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetMigrateMySQLStatus returns the status of MySql in app migration, if one is active, and whether or not MySql in -// app is enabled +// GetMSDeployLog description for Get the MSDeploy Log for the last MSDeploy operation. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of web app. -func (client AppsClient) GetMigrateMySQLStatus(ctx context.Context, resourceGroupName string, name string) (result MigrateMySQLStatus, err error) { +func (client AppsClient) GetMSDeployLog(ctx context.Context, resourceGroupName string, name string) (result MSDeployLog, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetMigrateMySQLStatus") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetMSDeployLog") defer func() { sc := -1 if result.Response.Response != nil { @@ -10943,198 +11489,25 @@ func (client AppsClient) GetMigrateMySQLStatus(ctx context.Context, resourceGrou Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetMigrateMySQLStatus", err.Error()) + return result, validation.NewError("web.AppsClient", "GetMSDeployLog", err.Error()) } - req, err := client.GetMigrateMySQLStatusPreparer(ctx, resourceGroupName, name) + req, err := client.GetMSDeployLogPreparer(ctx, resourceGroupName, name) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMigrateMySQLStatus", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMSDeployLog", nil, "Failure preparing request") return } - resp, err := client.GetMigrateMySQLStatusSender(req) + resp, err := client.GetMSDeployLogSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMigrateMySQLStatus", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMSDeployLog", resp, "Failure sending request") return } - result, err = client.GetMigrateMySQLStatusResponder(resp) + result, err = client.GetMSDeployLogResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMigrateMySQLStatus", resp, "Failure responding to request") - } - - return -} - -// GetMigrateMySQLStatusPreparer prepares the GetMigrateMySQLStatus request. -func (client AppsClient) GetMigrateMySQLStatusPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-02-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql/status", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetMigrateMySQLStatusSender sends the GetMigrateMySQLStatus request. The method will close the -// http.Response Body if it receives an error. -func (client AppsClient) GetMigrateMySQLStatusSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// GetMigrateMySQLStatusResponder handles the response to the GetMigrateMySQLStatus request. The method always -// closes the http.Response Body. -func (client AppsClient) GetMigrateMySQLStatusResponder(resp *http.Response) (result MigrateMySQLStatus, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetMigrateMySQLStatusSlot returns the status of MySql in app migration, if one is active, and whether or not MySql -// in app is enabled -// Parameters: -// resourceGroupName - name of the resource group to which the resource belongs. -// name - name of web app. -// slot - name of the deployment slot. -func (client AppsClient) GetMigrateMySQLStatusSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result MigrateMySQLStatus, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetMigrateMySQLStatusSlot") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetMigrateMySQLStatusSlot", err.Error()) - } - - req, err := client.GetMigrateMySQLStatusSlotPreparer(ctx, resourceGroupName, name, slot) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMigrateMySQLStatusSlot", nil, "Failure preparing request") - return - } - - resp, err := client.GetMigrateMySQLStatusSlotSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMigrateMySQLStatusSlot", resp, "Failure sending request") - return - } - - result, err = client.GetMigrateMySQLStatusSlotResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMigrateMySQLStatusSlot", resp, "Failure responding to request") - } - - return -} - -// GetMigrateMySQLStatusSlotPreparer prepares the GetMigrateMySQLStatusSlot request. -func (client AppsClient) GetMigrateMySQLStatusSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-02-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/migratemysql/status", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetMigrateMySQLStatusSlotSender sends the GetMigrateMySQLStatusSlot request. The method will close the -// http.Response Body if it receives an error. -func (client AppsClient) GetMigrateMySQLStatusSlotSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// GetMigrateMySQLStatusSlotResponder handles the response to the GetMigrateMySQLStatusSlot request. The method always -// closes the http.Response Body. -func (client AppsClient) GetMigrateMySQLStatusSlotResponder(resp *http.Response) (result MigrateMySQLStatus, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetMSDeployLog get the MSDeploy Log for the last MSDeploy operation. -// Parameters: -// resourceGroupName - name of the resource group to which the resource belongs. -// name - name of web app. -func (client AppsClient) GetMSDeployLog(ctx context.Context, resourceGroupName string, name string) (result MSDeployLog, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetMSDeployLog") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetMSDeployLog", err.Error()) - } - - req, err := client.GetMSDeployLogPreparer(ctx, resourceGroupName, name) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMSDeployLog", nil, "Failure preparing request") - return - } - - resp, err := client.GetMSDeployLogSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMSDeployLog", resp, "Failure sending request") - return - } - - result, err = client.GetMSDeployLogResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMSDeployLog", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMSDeployLog", resp, "Failure responding to request") } return @@ -11148,7 +11521,7 @@ func (client AppsClient) GetMSDeployLogPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -11181,7 +11554,7 @@ func (client AppsClient) GetMSDeployLogResponder(resp *http.Response) (result MS return } -// GetMSDeployLogSlot get the MSDeploy Log for the last MSDeploy operation. +// GetMSDeployLogSlot description for Get the MSDeploy Log for the last MSDeploy operation. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of web app. @@ -11235,7 +11608,7 @@ func (client AppsClient) GetMSDeployLogSlotPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -11268,7 +11641,7 @@ func (client AppsClient) GetMSDeployLogSlotResponder(resp *http.Response) (resul return } -// GetMSDeployStatus get the status of the last MSDeploy operation. +// GetMSDeployStatus description for Get the status of the last MSDeploy operation. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of web app. @@ -11320,7 +11693,7 @@ func (client AppsClient) GetMSDeployStatusPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -11353,7 +11726,7 @@ func (client AppsClient) GetMSDeployStatusResponder(resp *http.Response) (result return } -// GetMSDeployStatusSlot get the status of the last MSDeploy operation. +// GetMSDeployStatusSlot description for Get the status of the last MSDeploy operation. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of web app. @@ -11407,7 +11780,7 @@ func (client AppsClient) GetMSDeployStatusSlotPreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -11440,7 +11813,8 @@ func (client AppsClient) GetMSDeployStatusSlotResponder(resp *http.Response) (re return } -// GetNetworkTraceOperation gets a named operation for a network trace capturing (or deployment slot, if specified). +// GetNetworkTraceOperation description for Gets a named operation for a network trace capturing (or deployment slot, +// if specified). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -11494,7 +11868,7 @@ func (client AppsClient) GetNetworkTraceOperationPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -11527,8 +11901,8 @@ func (client AppsClient) GetNetworkTraceOperationResponder(resp *http.Response) return } -// GetNetworkTraceOperationSlot gets a named operation for a network trace capturing (or deployment slot, if -// specified). +// GetNetworkTraceOperationSlot description for Gets a named operation for a network trace capturing (or deployment +// slot, if specified). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -11585,7 +11959,7 @@ func (client AppsClient) GetNetworkTraceOperationSlotPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -11618,8 +11992,8 @@ func (client AppsClient) GetNetworkTraceOperationSlotResponder(resp *http.Respon return } -// GetNetworkTraceOperationSlotV2 gets a named operation for a network trace capturing (or deployment slot, if -// specified). +// GetNetworkTraceOperationSlotV2 description for Gets a named operation for a network trace capturing (or deployment +// slot, if specified). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -11676,7 +12050,7 @@ func (client AppsClient) GetNetworkTraceOperationSlotV2Preparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -11709,7 +12083,8 @@ func (client AppsClient) GetNetworkTraceOperationSlotV2Responder(resp *http.Resp return } -// GetNetworkTraceOperationV2 gets a named operation for a network trace capturing (or deployment slot, if specified). +// GetNetworkTraceOperationV2 description for Gets a named operation for a network trace capturing (or deployment slot, +// if specified). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -11763,7 +12138,7 @@ func (client AppsClient) GetNetworkTraceOperationV2Preparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -11796,7 +12171,8 @@ func (client AppsClient) GetNetworkTraceOperationV2Responder(resp *http.Response return } -// GetNetworkTraces gets a named operation for a network trace capturing (or deployment slot, if specified). +// GetNetworkTraces description for Gets a named operation for a network trace capturing (or deployment slot, if +// specified). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -11850,7 +12226,7 @@ func (client AppsClient) GetNetworkTracesPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -11883,7 +12259,8 @@ func (client AppsClient) GetNetworkTracesResponder(resp *http.Response) (result return } -// GetNetworkTracesSlot gets a named operation for a network trace capturing (or deployment slot, if specified). +// GetNetworkTracesSlot description for Gets a named operation for a network trace capturing (or deployment slot, if +// specified). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -11940,7 +12317,7 @@ func (client AppsClient) GetNetworkTracesSlotPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -11973,7 +12350,8 @@ func (client AppsClient) GetNetworkTracesSlotResponder(resp *http.Response) (res return } -// GetNetworkTracesSlotV2 gets a named operation for a network trace capturing (or deployment slot, if specified). +// GetNetworkTracesSlotV2 description for Gets a named operation for a network trace capturing (or deployment slot, if +// specified). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -12030,7 +12408,7 @@ func (client AppsClient) GetNetworkTracesSlotV2Preparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -12063,7 +12441,8 @@ func (client AppsClient) GetNetworkTracesSlotV2Responder(resp *http.Response) (r return } -// GetNetworkTracesV2 gets a named operation for a network trace capturing (or deployment slot, if specified). +// GetNetworkTracesV2 description for Gets a named operation for a network trace capturing (or deployment slot, if +// specified). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -12117,7 +12496,7 @@ func (client AppsClient) GetNetworkTracesV2Preparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -12150,7 +12529,7 @@ func (client AppsClient) GetNetworkTracesV2Responder(resp *http.Response) (resul return } -// GetPremierAddOn gets a named add-on of an app. +// GetPremierAddOn description for Gets a named add-on of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -12204,7 +12583,7 @@ func (client AppsClient) GetPremierAddOnPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -12237,7 +12616,7 @@ func (client AppsClient) GetPremierAddOnResponder(resp *http.Response) (result P return } -// GetPremierAddOnSlot gets a named add-on of an app. +// GetPremierAddOnSlot description for Gets a named add-on of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -12294,7 +12673,7 @@ func (client AppsClient) GetPremierAddOnSlotPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -12327,8 +12706,8 @@ func (client AppsClient) GetPremierAddOnSlotResponder(resp *http.Response) (resu return } -// GetPrivateAccess gets data around private site access enablement and authorized Virtual Networks that can access the -// site. +// GetPrivateAccess description for Gets data around private site access enablement and authorized Virtual Networks +// that can access the site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - the name of the web app. @@ -12380,7 +12759,7 @@ func (client AppsClient) GetPrivateAccessPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -12413,8 +12792,8 @@ func (client AppsClient) GetPrivateAccessResponder(resp *http.Response) (result return } -// GetPrivateAccessSlot gets data around private site access enablement and authorized Virtual Networks that can access -// the site. +// GetPrivateAccessSlot description for Gets data around private site access enablement and authorized Virtual Networks +// that can access the site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - the name of the web app. @@ -12468,7 +12847,7 @@ func (client AppsClient) GetPrivateAccessSlotPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -12501,7 +12880,7 @@ func (client AppsClient) GetPrivateAccessSlotResponder(resp *http.Response) (res return } -// GetProcess get process information by its ID for a specific scaled-out instance in a web site. +// GetProcess description for Get process information by its ID for a specific scaled-out instance in a web site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -12555,7 +12934,7 @@ func (client AppsClient) GetProcessPreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -12588,7 +12967,8 @@ func (client AppsClient) GetProcessResponder(resp *http.Response) (result Proces return } -// GetProcessDump get a memory dump of a process by its ID for a specific scaled-out instance in a web site. +// GetProcessDump description for Get a memory dump of a process by its ID for a specific scaled-out instance in a web +// site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -12642,7 +13022,7 @@ func (client AppsClient) GetProcessDumpPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -12674,7 +13054,8 @@ func (client AppsClient) GetProcessDumpResponder(resp *http.Response) (result Re return } -// GetProcessDumpSlot get a memory dump of a process by its ID for a specific scaled-out instance in a web site. +// GetProcessDumpSlot description for Get a memory dump of a process by its ID for a specific scaled-out instance in a +// web site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -12731,7 +13112,7 @@ func (client AppsClient) GetProcessDumpSlotPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -12763,7 +13144,7 @@ func (client AppsClient) GetProcessDumpSlotResponder(resp *http.Response) (resul return } -// GetProcessModule get process information by its ID for a specific scaled-out instance in a web site. +// GetProcessModule description for Get process information by its ID for a specific scaled-out instance in a web site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -12819,7 +13200,7 @@ func (client AppsClient) GetProcessModulePreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -12852,7 +13233,8 @@ func (client AppsClient) GetProcessModuleResponder(resp *http.Response) (result return } -// GetProcessModuleSlot get process information by its ID for a specific scaled-out instance in a web site. +// GetProcessModuleSlot description for Get process information by its ID for a specific scaled-out instance in a web +// site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -12911,7 +13293,7 @@ func (client AppsClient) GetProcessModuleSlotPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -12944,7 +13326,7 @@ func (client AppsClient) GetProcessModuleSlotResponder(resp *http.Response) (res return } -// GetProcessSlot get process information by its ID for a specific scaled-out instance in a web site. +// GetProcessSlot description for Get process information by its ID for a specific scaled-out instance in a web site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -13001,7 +13383,7 @@ func (client AppsClient) GetProcessSlotPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -13034,16 +13416,14 @@ func (client AppsClient) GetProcessSlotResponder(resp *http.Response) (result Pr return } -// GetProcessThread get thread information by Thread ID for a specific process, in a specific scaled-out instance in a -// web site. +// GetPublicCertificate description for Get the named public certificate for an app (or deployment slot, if specified). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - site name. -// processID - pID. -// threadID - tID. -func (client AppsClient) GetProcessThread(ctx context.Context, resourceGroupName string, name string, processID string, threadID string) (result ProcessThreadInfo, err error) { +// name - name of the app. +// publicCertificateName - public certificate name. +func (client AppsClient) GetPublicCertificate(ctx context.Context, resourceGroupName string, name string, publicCertificateName string) (result PublicCertificate, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetProcessThread") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetPublicCertificate") defer func() { sc := -1 if result.Response.Response != nil { @@ -13057,41 +13437,40 @@ func (client AppsClient) GetProcessThread(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetProcessThread", err.Error()) + return result, validation.NewError("web.AppsClient", "GetPublicCertificate", err.Error()) } - req, err := client.GetProcessThreadPreparer(ctx, resourceGroupName, name, processID, threadID) + req, err := client.GetPublicCertificatePreparer(ctx, resourceGroupName, name, publicCertificateName) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessThread", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPublicCertificate", nil, "Failure preparing request") return } - resp, err := client.GetProcessThreadSender(req) + resp, err := client.GetPublicCertificateSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessThread", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPublicCertificate", resp, "Failure sending request") return } - result, err = client.GetProcessThreadResponder(resp) + result, err = client.GetPublicCertificateResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessThread", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPublicCertificate", resp, "Failure responding to request") } return } -// GetProcessThreadPreparer prepares the GetProcessThread request. -func (client AppsClient) GetProcessThreadPreparer(ctx context.Context, resourceGroupName string, name string, processID string, threadID string) (*http.Request, error) { +// GetPublicCertificatePreparer prepares the GetPublicCertificate request. +func (client AppsClient) GetPublicCertificatePreparer(ctx context.Context, resourceGroupName string, name string, publicCertificateName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "name": autorest.Encode("path", name), - "processId": autorest.Encode("path", processID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "threadId": autorest.Encode("path", threadID), + "name": autorest.Encode("path", name), + "publicCertificateName": autorest.Encode("path", publicCertificateName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -13099,43 +13478,42 @@ func (client AppsClient) GetProcessThreadPreparer(ctx context.Context, resourceG preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/threads/{threadId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetProcessThreadSender sends the GetProcessThread request. The method will close the +// GetPublicCertificateSender sends the GetPublicCertificate request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetProcessThreadSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetPublicCertificateSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetProcessThreadResponder handles the response to the GetProcessThread request. The method always +// GetPublicCertificateResponder handles the response to the GetPublicCertificate request. The method always // closes the http.Response Body. -func (client AppsClient) GetProcessThreadResponder(resp *http.Response) (result ProcessThreadInfo, err error) { +func (client AppsClient) GetPublicCertificateResponder(resp *http.Response) (result PublicCertificate, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetProcessThreadSlot get thread information by Thread ID for a specific process, in a specific scaled-out instance -// in a web site. +// GetPublicCertificateSlot description for Get the named public certificate for an app (or deployment slot, if +// specified). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - site name. -// processID - pID. -// threadID - tID. -// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the -// production slot. -func (client AppsClient) GetProcessThreadSlot(ctx context.Context, resourceGroupName string, name string, processID string, threadID string, slot string) (result ProcessThreadInfo, err error) { +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API the named binding for the production +// slot. +// publicCertificateName - public certificate name. +func (client AppsClient) GetPublicCertificateSlot(ctx context.Context, resourceGroupName string, name string, slot string, publicCertificateName string) (result PublicCertificate, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetProcessThreadSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetPublicCertificateSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -13149,42 +13527,41 @@ func (client AppsClient) GetProcessThreadSlot(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetProcessThreadSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "GetPublicCertificateSlot", err.Error()) } - req, err := client.GetProcessThreadSlotPreparer(ctx, resourceGroupName, name, processID, threadID, slot) + req, err := client.GetPublicCertificateSlotPreparer(ctx, resourceGroupName, name, slot, publicCertificateName) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessThreadSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPublicCertificateSlot", nil, "Failure preparing request") return } - resp, err := client.GetProcessThreadSlotSender(req) + resp, err := client.GetPublicCertificateSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessThreadSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPublicCertificateSlot", resp, "Failure sending request") return } - result, err = client.GetProcessThreadSlotResponder(resp) + result, err = client.GetPublicCertificateSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessThreadSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPublicCertificateSlot", resp, "Failure responding to request") } return } -// GetProcessThreadSlotPreparer prepares the GetProcessThreadSlot request. -func (client AppsClient) GetProcessThreadSlotPreparer(ctx context.Context, resourceGroupName string, name string, processID string, threadID string, slot string) (*http.Request, error) { +// GetPublicCertificateSlotPreparer prepares the GetPublicCertificateSlot request. +func (client AppsClient) GetPublicCertificateSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string, publicCertificateName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "name": autorest.Encode("path", name), - "processId": autorest.Encode("path", processID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "threadId": autorest.Encode("path", threadID), + "name": autorest.Encode("path", name), + "publicCertificateName": autorest.Encode("path", publicCertificateName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -13192,39 +13569,39 @@ func (client AppsClient) GetProcessThreadSlotPreparer(ctx context.Context, resou preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/threads/{threadId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetProcessThreadSlotSender sends the GetProcessThreadSlot request. The method will close the +// GetPublicCertificateSlotSender sends the GetPublicCertificateSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) GetProcessThreadSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) GetPublicCertificateSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// GetProcessThreadSlotResponder handles the response to the GetProcessThreadSlot request. The method always +// GetPublicCertificateSlotResponder handles the response to the GetPublicCertificateSlot request. The method always // closes the http.Response Body. -func (client AppsClient) GetProcessThreadSlotResponder(resp *http.Response) (result ProcessThreadInfo, err error) { +func (client AppsClient) GetPublicCertificateSlotResponder(resp *http.Response) (result PublicCertificate, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetPublicCertificate get the named public certificate for an app (or deployment slot, if specified). +// GetRelayServiceConnection description for Gets a hybrid connection configuration by its name. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// publicCertificateName - public certificate name. -func (client AppsClient) GetPublicCertificate(ctx context.Context, resourceGroupName string, name string, publicCertificateName string) (result PublicCertificate, err error) { +// entityName - name of the hybrid connection. +func (client AppsClient) GetRelayServiceConnection(ctx context.Context, resourceGroupName string, name string, entityName string) (result RelayServiceConnectionEntity, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetPublicCertificate") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetRelayServiceConnection") defer func() { sc := -1 if result.Response.Response != nil { @@ -13238,189 +13615,12 @@ func (client AppsClient) GetPublicCertificate(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetPublicCertificate", err.Error()) + return result, validation.NewError("web.AppsClient", "GetRelayServiceConnection", err.Error()) } - req, err := client.GetPublicCertificatePreparer(ctx, resourceGroupName, name, publicCertificateName) + req, err := client.GetRelayServiceConnectionPreparer(ctx, resourceGroupName, name, entityName) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPublicCertificate", nil, "Failure preparing request") - return - } - - resp, err := client.GetPublicCertificateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPublicCertificate", resp, "Failure sending request") - return - } - - result, err = client.GetPublicCertificateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPublicCertificate", resp, "Failure responding to request") - } - - return -} - -// GetPublicCertificatePreparer prepares the GetPublicCertificate request. -func (client AppsClient) GetPublicCertificatePreparer(ctx context.Context, resourceGroupName string, name string, publicCertificateName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "name": autorest.Encode("path", name), - "publicCertificateName": autorest.Encode("path", publicCertificateName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-02-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetPublicCertificateSender sends the GetPublicCertificate request. The method will close the -// http.Response Body if it receives an error. -func (client AppsClient) GetPublicCertificateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// GetPublicCertificateResponder handles the response to the GetPublicCertificate request. The method always -// closes the http.Response Body. -func (client AppsClient) GetPublicCertificateResponder(resp *http.Response) (result PublicCertificate, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetPublicCertificateSlot get the named public certificate for an app (or deployment slot, if specified). -// Parameters: -// resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -// slot - name of the deployment slot. If a slot is not specified, the API the named binding for the production -// slot. -// publicCertificateName - public certificate name. -func (client AppsClient) GetPublicCertificateSlot(ctx context.Context, resourceGroupName string, name string, slot string, publicCertificateName string) (result PublicCertificate, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetPublicCertificateSlot") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetPublicCertificateSlot", err.Error()) - } - - req, err := client.GetPublicCertificateSlotPreparer(ctx, resourceGroupName, name, slot, publicCertificateName) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPublicCertificateSlot", nil, "Failure preparing request") - return - } - - resp, err := client.GetPublicCertificateSlotSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPublicCertificateSlot", resp, "Failure sending request") - return - } - - result, err = client.GetPublicCertificateSlotResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPublicCertificateSlot", resp, "Failure responding to request") - } - - return -} - -// GetPublicCertificateSlotPreparer prepares the GetPublicCertificateSlot request. -func (client AppsClient) GetPublicCertificateSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string, publicCertificateName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "name": autorest.Encode("path", name), - "publicCertificateName": autorest.Encode("path", publicCertificateName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-02-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetPublicCertificateSlotSender sends the GetPublicCertificateSlot request. The method will close the -// http.Response Body if it receives an error. -func (client AppsClient) GetPublicCertificateSlotSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// GetPublicCertificateSlotResponder handles the response to the GetPublicCertificateSlot request. The method always -// closes the http.Response Body. -func (client AppsClient) GetPublicCertificateSlotResponder(resp *http.Response) (result PublicCertificate, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetRelayServiceConnection gets a hybrid connection configuration by its name. -// Parameters: -// resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -// entityName - name of the hybrid connection. -func (client AppsClient) GetRelayServiceConnection(ctx context.Context, resourceGroupName string, name string, entityName string) (result RelayServiceConnectionEntity, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetRelayServiceConnection") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "GetRelayServiceConnection", err.Error()) - } - - req, err := client.GetRelayServiceConnectionPreparer(ctx, resourceGroupName, name, entityName) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "GetRelayServiceConnection", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetRelayServiceConnection", nil, "Failure preparing request") return } @@ -13448,7 +13648,7 @@ func (client AppsClient) GetRelayServiceConnectionPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -13481,7 +13681,7 @@ func (client AppsClient) GetRelayServiceConnectionResponder(resp *http.Response) return } -// GetRelayServiceConnectionSlot gets a hybrid connection configuration by its name. +// GetRelayServiceConnectionSlot description for Gets a hybrid connection configuration by its name. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -13538,7 +13738,7 @@ func (client AppsClient) GetRelayServiceConnectionSlotPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -13571,7 +13771,7 @@ func (client AppsClient) GetRelayServiceConnectionSlotResponder(resp *http.Respo return } -// GetSiteExtension get site extension information by its ID for a web site, or a deployment slot. +// GetSiteExtension description for Get site extension information by its ID for a web site, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -13625,7 +13825,7 @@ func (client AppsClient) GetSiteExtensionPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -13658,13 +13858,12 @@ func (client AppsClient) GetSiteExtensionResponder(resp *http.Response) (result return } -// GetSiteExtensionSlot get site extension information by its ID for a web site, or a deployment slot. +// GetSiteExtensionSlot description for Get site extension information by its ID for a web site, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. // siteExtensionID - site extension name. -// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the -// production slot. +// slot - name of the deployment slot. If a slot is not specified, the API uses the production slot. func (client AppsClient) GetSiteExtensionSlot(ctx context.Context, resourceGroupName string, name string, siteExtensionID string, slot string) (result SiteExtensionInfo, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetSiteExtensionSlot") @@ -13715,7 +13914,7 @@ func (client AppsClient) GetSiteExtensionSlotPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -13748,7 +13947,7 @@ func (client AppsClient) GetSiteExtensionSlotResponder(resp *http.Response) (res return } -// GetSitePhpErrorLogFlag gets web app's event logs. +// GetSitePhpErrorLogFlag description for Gets web app's event logs. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of web app. @@ -13800,7 +13999,7 @@ func (client AppsClient) GetSitePhpErrorLogFlagPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -13833,7 +14032,7 @@ func (client AppsClient) GetSitePhpErrorLogFlagResponder(resp *http.Response) (r return } -// GetSitePhpErrorLogFlagSlot gets web app's event logs. +// GetSitePhpErrorLogFlagSlot description for Gets web app's event logs. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of web app. @@ -13887,7 +14086,7 @@ func (client AppsClient) GetSitePhpErrorLogFlagSlotPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -13920,7 +14119,7 @@ func (client AppsClient) GetSitePhpErrorLogFlagSlotResponder(resp *http.Response return } -// GetSlot gets the details of a web, mobile, or API app. +// GetSlot description for Gets the details of a web, mobile, or API app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -13974,7 +14173,7 @@ func (client AppsClient) GetSlotPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -14007,7 +14206,7 @@ func (client AppsClient) GetSlotResponder(resp *http.Response) (result Site, err return } -// GetSourceControl gets the source control configuration of an app. +// GetSourceControl description for Gets the source control configuration of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -14059,7 +14258,7 @@ func (client AppsClient) GetSourceControlPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -14092,7 +14291,7 @@ func (client AppsClient) GetSourceControlResponder(resp *http.Response) (result return } -// GetSourceControlSlot gets the source control configuration of an app. +// GetSourceControlSlot description for Gets the source control configuration of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -14147,7 +14346,7 @@ func (client AppsClient) GetSourceControlSlotPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -14180,7 +14379,7 @@ func (client AppsClient) GetSourceControlSlotResponder(resp *http.Response) (res return } -// GetSwiftVirtualNetworkConnection gets a Swift Virtual Network connection. +// GetSwiftVirtualNetworkConnection description for Gets a Swift Virtual Network connection. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -14232,7 +14431,7 @@ func (client AppsClient) GetSwiftVirtualNetworkConnectionPreparer(ctx context.Co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -14265,7 +14464,7 @@ func (client AppsClient) GetSwiftVirtualNetworkConnectionResponder(resp *http.Re return } -// GetSwiftVirtualNetworkConnectionSlot gets a Swift Virtual Network connection. +// GetSwiftVirtualNetworkConnectionSlot description for Gets a Swift Virtual Network connection. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -14320,7 +14519,7 @@ func (client AppsClient) GetSwiftVirtualNetworkConnectionSlotPreparer(ctx contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -14353,7 +14552,7 @@ func (client AppsClient) GetSwiftVirtualNetworkConnectionSlotResponder(resp *htt return } -// GetTriggeredWebJob gets a triggered web job by its ID for an app, or a deployment slot. +// GetTriggeredWebJob description for Gets a triggered web job by its ID for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -14407,7 +14606,7 @@ func (client AppsClient) GetTriggeredWebJobPreparer(ctx context.Context, resourc "webJobName": autorest.Encode("path", webJobName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -14440,7 +14639,8 @@ func (client AppsClient) GetTriggeredWebJobResponder(resp *http.Response) (resul return } -// GetTriggeredWebJobHistory gets a triggered web job's history by its ID for an app, , or a deployment slot. +// GetTriggeredWebJobHistory description for Gets a triggered web job's history by its ID for an app, , or a deployment +// slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -14496,7 +14696,7 @@ func (client AppsClient) GetTriggeredWebJobHistoryPreparer(ctx context.Context, "webJobName": autorest.Encode("path", webJobName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -14529,14 +14729,14 @@ func (client AppsClient) GetTriggeredWebJobHistoryResponder(resp *http.Response) return } -// GetTriggeredWebJobHistorySlot gets a triggered web job's history by its ID for an app, , or a deployment slot. +// GetTriggeredWebJobHistorySlot description for Gets a triggered web job's history by its ID for an app, , or a +// deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. // webJobName - name of Web Job. // ID - history ID. -// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the -// production slot. +// slot - name of the deployment slot. If a slot is not specified, the API uses the production slot. func (client AppsClient) GetTriggeredWebJobHistorySlot(ctx context.Context, resourceGroupName string, name string, webJobName string, ID string, slot string) (result TriggeredJobHistory, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetTriggeredWebJobHistorySlot") @@ -14588,7 +14788,7 @@ func (client AppsClient) GetTriggeredWebJobHistorySlotPreparer(ctx context.Conte "webJobName": autorest.Encode("path", webJobName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -14621,13 +14821,12 @@ func (client AppsClient) GetTriggeredWebJobHistorySlotResponder(resp *http.Respo return } -// GetTriggeredWebJobSlot gets a triggered web job by its ID for an app, or a deployment slot. +// GetTriggeredWebJobSlot description for Gets a triggered web job by its ID for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. // webJobName - name of Web Job. -// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the -// production slot. +// slot - name of the deployment slot. If a slot is not specified, the API uses the production slot. func (client AppsClient) GetTriggeredWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (result TriggeredWebJob, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetTriggeredWebJobSlot") @@ -14678,7 +14877,7 @@ func (client AppsClient) GetTriggeredWebJobSlotPreparer(ctx context.Context, res "webJobName": autorest.Encode("path", webJobName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -14711,7 +14910,7 @@ func (client AppsClient) GetTriggeredWebJobSlotResponder(resp *http.Response) (r return } -// GetVnetConnection gets a virtual network the app (or deployment slot) is connected to by name. +// GetVnetConnection description for Gets a virtual network the app (or deployment slot) is connected to by name. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -14765,7 +14964,7 @@ func (client AppsClient) GetVnetConnectionPreparer(ctx context.Context, resource "vnetName": autorest.Encode("path", vnetName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -14798,7 +14997,7 @@ func (client AppsClient) GetVnetConnectionResponder(resp *http.Response) (result return } -// GetVnetConnectionGateway gets an app's Virtual Network gateway. +// GetVnetConnectionGateway description for Gets an app's Virtual Network gateway. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -14854,7 +15053,7 @@ func (client AppsClient) GetVnetConnectionGatewayPreparer(ctx context.Context, r "vnetName": autorest.Encode("path", vnetName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -14887,7 +15086,7 @@ func (client AppsClient) GetVnetConnectionGatewayResponder(resp *http.Response) return } -// GetVnetConnectionGatewaySlot gets an app's Virtual Network gateway. +// GetVnetConnectionGatewaySlot description for Gets an app's Virtual Network gateway. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -14946,7 +15145,7 @@ func (client AppsClient) GetVnetConnectionGatewaySlotPreparer(ctx context.Contex "vnetName": autorest.Encode("path", vnetName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -14979,7 +15178,7 @@ func (client AppsClient) GetVnetConnectionGatewaySlotResponder(resp *http.Respon return } -// GetVnetConnectionSlot gets a virtual network the app (or deployment slot) is connected to by name. +// GetVnetConnectionSlot description for Gets a virtual network the app (or deployment slot) is connected to by name. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -15036,7 +15235,7 @@ func (client AppsClient) GetVnetConnectionSlotPreparer(ctx context.Context, reso "vnetName": autorest.Encode("path", vnetName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -15069,7 +15268,7 @@ func (client AppsClient) GetVnetConnectionSlotResponder(resp *http.Response) (re return } -// GetWebJob get webjob information for an app, or a deployment slot. +// GetWebJob description for Get webjob information for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -15123,7 +15322,7 @@ func (client AppsClient) GetWebJobPreparer(ctx context.Context, resourceGroupNam "webJobName": autorest.Encode("path", webJobName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -15156,7 +15355,7 @@ func (client AppsClient) GetWebJobResponder(resp *http.Response) (result Job, er return } -// GetWebJobSlot get webjob information for an app, or a deployment slot. +// GetWebJobSlot description for Get webjob information for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -15213,7 +15412,7 @@ func (client AppsClient) GetWebJobSlotPreparer(ctx context.Context, resourceGrou "webJobName": autorest.Encode("path", webJobName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -15246,7 +15445,7 @@ func (client AppsClient) GetWebJobSlotResponder(resp *http.Response) (result Job return } -// GetWebSiteContainerLogs gets the last lines of docker logs for the given site +// GetWebSiteContainerLogs description for Gets the last lines of docker logs for the given site // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of web app. @@ -15298,7 +15497,7 @@ func (client AppsClient) GetWebSiteContainerLogsPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -15330,7 +15529,7 @@ func (client AppsClient) GetWebSiteContainerLogsResponder(resp *http.Response) ( return } -// GetWebSiteContainerLogsSlot gets the last lines of docker logs for the given site +// GetWebSiteContainerLogsSlot description for Gets the last lines of docker logs for the given site // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of web app. @@ -15384,7 +15583,7 @@ func (client AppsClient) GetWebSiteContainerLogsSlotPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -15416,7 +15615,7 @@ func (client AppsClient) GetWebSiteContainerLogsSlotResponder(resp *http.Respons return } -// InstallSiteExtension install site extension on a web site, or a deployment slot. +// InstallSiteExtension description for Install site extension on a web site, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -15464,7 +15663,7 @@ func (client AppsClient) InstallSiteExtensionPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -15503,13 +15702,12 @@ func (client AppsClient) InstallSiteExtensionResponder(resp *http.Response) (res return } -// InstallSiteExtensionSlot install site extension on a web site, or a deployment slot. +// InstallSiteExtensionSlot description for Install site extension on a web site, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. // siteExtensionID - site extension name. -// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the -// production slot. +// slot - name of the deployment slot. If a slot is not specified, the API uses the production slot. func (client AppsClient) InstallSiteExtensionSlot(ctx context.Context, resourceGroupName string, name string, siteExtensionID string, slot string) (result AppsInstallSiteExtensionSlotFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.InstallSiteExtensionSlot") @@ -15554,7 +15752,7 @@ func (client AppsClient) InstallSiteExtensionSlotPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -15593,7 +15791,7 @@ func (client AppsClient) InstallSiteExtensionSlotResponder(resp *http.Response) return } -// IsCloneable shows whether an app can be cloned to another resource group or subscription. +// IsCloneable description for Shows whether an app can be cloned to another resource group or subscription. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -15645,7 +15843,7 @@ func (client AppsClient) IsCloneablePreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -15678,7 +15876,7 @@ func (client AppsClient) IsCloneableResponder(resp *http.Response) (result SiteC return } -// IsCloneableSlot shows whether an app can be cloned to another resource group or subscription. +// IsCloneableSlot description for Shows whether an app can be cloned to another resource group or subscription. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -15732,7 +15930,7 @@ func (client AppsClient) IsCloneableSlotPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -15765,7 +15963,7 @@ func (client AppsClient) IsCloneableSlotResponder(resp *http.Response) (result S return } -// List get all apps for a subscription. +// List description for Get all apps for a subscription. func (client AppsClient) List(ctx context.Context) (result AppCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.List") @@ -15805,7 +16003,7 @@ func (client AppsClient) ListPreparer(ctx context.Context) (*http.Request, error "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -15875,7 +16073,7 @@ func (client AppsClient) ListComplete(ctx context.Context) (result AppCollection return } -// ListApplicationSettings gets the application settings of an app. +// ListApplicationSettings description for Gets the application settings of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -15927,7 +16125,7 @@ func (client AppsClient) ListApplicationSettingsPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -15960,7 +16158,7 @@ func (client AppsClient) ListApplicationSettingsResponder(resp *http.Response) ( return } -// ListApplicationSettingsSlot gets the application settings of an app. +// ListApplicationSettingsSlot description for Gets the application settings of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -16015,7 +16213,7 @@ func (client AppsClient) ListApplicationSettingsSlotPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -16048,7 +16246,7 @@ func (client AppsClient) ListApplicationSettingsSlotResponder(resp *http.Respons return } -// ListAzureStorageAccounts gets the Azure storage account configurations of an app. +// ListAzureStorageAccounts description for Gets the Azure storage account configurations of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -16100,7 +16298,7 @@ func (client AppsClient) ListAzureStorageAccountsPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -16133,7 +16331,7 @@ func (client AppsClient) ListAzureStorageAccountsResponder(resp *http.Response) return } -// ListAzureStorageAccountsSlot gets the Azure storage account configurations of an app. +// ListAzureStorageAccountsSlot description for Gets the Azure storage account configurations of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -16188,7 +16386,7 @@ func (client AppsClient) ListAzureStorageAccountsSlotPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -16221,7 +16419,7 @@ func (client AppsClient) ListAzureStorageAccountsSlotResponder(resp *http.Respon return } -// ListBackups gets existing backups of an app. +// ListBackups description for Gets existing backups of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -16274,7 +16472,7 @@ func (client AppsClient) ListBackupsPreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -16344,7 +16542,7 @@ func (client AppsClient) ListBackupsComplete(ctx context.Context, resourceGroupN return } -// ListBackupsSlot gets existing backups of an app. +// ListBackupsSlot description for Gets existing backups of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -16400,7 +16598,7 @@ func (client AppsClient) ListBackupsSlotPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -16470,9 +16668,9 @@ func (client AppsClient) ListBackupsSlotComplete(ctx context.Context, resourceGr return } -// ListBackupStatusSecrets gets status of a web app backup that may be in progress, including secrets associated with -// the backup, such as the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is -// passed in the request body. +// ListBackupStatusSecrets description for Gets status of a web app backup that may be in progress, including secrets +// associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup +// if a new URL is passed in the request body. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of web app. @@ -16536,7 +16734,7 @@ func (client AppsClient) ListBackupStatusSecretsPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -16571,9 +16769,9 @@ func (client AppsClient) ListBackupStatusSecretsResponder(resp *http.Response) ( return } -// ListBackupStatusSecretsSlot gets status of a web app backup that may be in progress, including secrets associated -// with the backup, such as the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new -// URL is passed in the request body. +// ListBackupStatusSecretsSlot description for Gets status of a web app backup that may be in progress, including +// secrets associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the SAS URL for +// the backup if a new URL is passed in the request body. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of web app. @@ -16639,7 +16837,7 @@ func (client AppsClient) ListBackupStatusSecretsSlotPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -16674,7 +16872,7 @@ func (client AppsClient) ListBackupStatusSecretsSlotResponder(resp *http.Respons return } -// ListByResourceGroup gets all web, mobile, and API apps in the specified resource group. +// ListByResourceGroup description for Gets all web, mobile, and API apps in the specified resource group. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // includeSlots - specify true to include deployment slots in results. The default is false, @@ -16727,7 +16925,7 @@ func (client AppsClient) ListByResourceGroupPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -16800,7 +16998,7 @@ func (client AppsClient) ListByResourceGroupComplete(ctx context.Context, resour return } -// ListConfigurations list the configurations of an app +// ListConfigurations description for List the configurations of an app // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -16853,7 +17051,7 @@ func (client AppsClient) ListConfigurationsPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -16923,8 +17121,8 @@ func (client AppsClient) ListConfigurationsComplete(ctx context.Context, resourc return } -// ListConfigurationSnapshotInfo gets a list of web app configuration snapshots identifiers. Each element of the list -// contains a timestamp and the ID of the snapshot. +// ListConfigurationSnapshotInfo description for Gets a list of web app configuration snapshots identifiers. Each +// element of the list contains a timestamp and the ID of the snapshot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -16977,7 +17175,7 @@ func (client AppsClient) ListConfigurationSnapshotInfoPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -17047,8 +17245,8 @@ func (client AppsClient) ListConfigurationSnapshotInfoComplete(ctx context.Conte return } -// ListConfigurationSnapshotInfoSlot gets a list of web app configuration snapshots identifiers. Each element of the -// list contains a timestamp and the ID of the snapshot. +// ListConfigurationSnapshotInfoSlot description for Gets a list of web app configuration snapshots identifiers. Each +// element of the list contains a timestamp and the ID of the snapshot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -17104,7 +17302,7 @@ func (client AppsClient) ListConfigurationSnapshotInfoSlotPreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -17174,7 +17372,7 @@ func (client AppsClient) ListConfigurationSnapshotInfoSlotComplete(ctx context.C return } -// ListConfigurationsSlot list the configurations of an app +// ListConfigurationsSlot description for List the configurations of an app // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -17230,7 +17428,7 @@ func (client AppsClient) ListConfigurationsSlotPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -17300,7 +17498,7 @@ func (client AppsClient) ListConfigurationsSlotComplete(ctx context.Context, res return } -// ListConnectionStrings gets the connection strings of an app. +// ListConnectionStrings description for Gets the connection strings of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -17352,7 +17550,7 @@ func (client AppsClient) ListConnectionStringsPreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -17385,7 +17583,7 @@ func (client AppsClient) ListConnectionStringsResponder(resp *http.Response) (re return } -// ListConnectionStringsSlot gets the connection strings of an app. +// ListConnectionStringsSlot description for Gets the connection strings of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -17440,7 +17638,7 @@ func (client AppsClient) ListConnectionStringsSlotPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -17473,7 +17671,7 @@ func (client AppsClient) ListConnectionStringsSlotResponder(resp *http.Response) return } -// ListContinuousWebJobs list continuous web jobs for an app, or a deployment slot. +// ListContinuousWebJobs description for List continuous web jobs for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -17526,7 +17724,7 @@ func (client AppsClient) ListContinuousWebJobsPreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -17596,7 +17794,7 @@ func (client AppsClient) ListContinuousWebJobsComplete(ctx context.Context, reso return } -// ListContinuousWebJobsSlot list continuous web jobs for an app, or a deployment slot. +// ListContinuousWebJobsSlot description for List continuous web jobs for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -17652,7 +17850,7 @@ func (client AppsClient) ListContinuousWebJobsSlotPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -17722,7 +17920,7 @@ func (client AppsClient) ListContinuousWebJobsSlotComplete(ctx context.Context, return } -// ListDeploymentLog list deployment log for specific deployment for an app, or a deployment slot. +// ListDeploymentLog description for List deployment log for specific deployment for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -17777,7 +17975,7 @@ func (client AppsClient) ListDeploymentLogPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -17810,7 +18008,7 @@ func (client AppsClient) ListDeploymentLogResponder(resp *http.Response) (result return } -// ListDeploymentLogSlot list deployment log for specific deployment for an app, or a deployment slot. +// ListDeploymentLogSlot description for List deployment log for specific deployment for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -17868,7 +18066,7 @@ func (client AppsClient) ListDeploymentLogSlotPreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -17901,7 +18099,7 @@ func (client AppsClient) ListDeploymentLogSlotResponder(resp *http.Response) (re return } -// ListDeployments list deployments for an app, or a deployment slot. +// ListDeployments description for List deployments for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -17954,7 +18152,7 @@ func (client AppsClient) ListDeploymentsPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -18024,7 +18222,7 @@ func (client AppsClient) ListDeploymentsComplete(ctx context.Context, resourceGr return } -// ListDeploymentsSlot list deployments for an app, or a deployment slot. +// ListDeploymentsSlot description for List deployments for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -18080,7 +18278,7 @@ func (client AppsClient) ListDeploymentsSlotPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -18150,7 +18348,7 @@ func (client AppsClient) ListDeploymentsSlotComplete(ctx context.Context, resour return } -// ListDomainOwnershipIdentifiers lists ownership identifiers for domain associated with web app. +// ListDomainOwnershipIdentifiers description for Lists ownership identifiers for domain associated with web app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -18203,7 +18401,7 @@ func (client AppsClient) ListDomainOwnershipIdentifiersPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -18273,7 +18471,7 @@ func (client AppsClient) ListDomainOwnershipIdentifiersComplete(ctx context.Cont return } -// ListDomainOwnershipIdentifiersSlot lists ownership identifiers for domain associated with web app. +// ListDomainOwnershipIdentifiersSlot description for Lists ownership identifiers for domain associated with web app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -18329,7 +18527,7 @@ func (client AppsClient) ListDomainOwnershipIdentifiersSlotPreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -18399,7 +18597,7 @@ func (client AppsClient) ListDomainOwnershipIdentifiersSlotComplete(ctx context. return } -// ListFunctions list the functions for a web site, or a deployment slot. +// ListFunctions description for List the functions for a web site, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -18452,7 +18650,7 @@ func (client AppsClient) ListFunctionsPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -18522,7 +18720,7 @@ func (client AppsClient) ListFunctionsComplete(ctx context.Context, resourceGrou return } -// ListFunctionSecrets get function secrets for a function in a web site, or a deployment slot. +// ListFunctionSecrets description for Get function secrets for a function in a web site, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -18576,7 +18774,7 @@ func (client AppsClient) ListFunctionSecretsPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -18609,13 +18807,12 @@ func (client AppsClient) ListFunctionSecretsResponder(resp *http.Response) (resu return } -// ListFunctionSecretsSlot get function secrets for a function in a web site, or a deployment slot. +// ListFunctionSecretsSlot description for Get function secrets for a function in a web site, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. // functionName - function name. -// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the -// production slot. +// slot - name of the deployment slot. func (client AppsClient) ListFunctionSecretsSlot(ctx context.Context, resourceGroupName string, name string, functionName string, slot string) (result FunctionSecrets, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListFunctionSecretsSlot") @@ -18666,7 +18863,7 @@ func (client AppsClient) ListFunctionSecretsSlotPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -18699,7 +18896,7 @@ func (client AppsClient) ListFunctionSecretsSlotResponder(resp *http.Response) ( return } -// ListHostNameBindings get hostname bindings for an app or a deployment slot. +// ListHostNameBindings description for Get hostname bindings for an app or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -18752,7 +18949,7 @@ func (client AppsClient) ListHostNameBindingsPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -18822,7 +19019,7 @@ func (client AppsClient) ListHostNameBindingsComplete(ctx context.Context, resou return } -// ListHostNameBindingsSlot get hostname bindings for an app or a deployment slot. +// ListHostNameBindingsSlot description for Get hostname bindings for an app or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -18878,7 +19075,7 @@ func (client AppsClient) ListHostNameBindingsSlotPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -18948,15 +19145,13 @@ func (client AppsClient) ListHostNameBindingsSlotComplete(ctx context.Context, r return } -// ListHybridConnectionKeys gets the send key name and value for a Hybrid Connection. +// ListHybridConnections description for Retrieves all Service Bus Hybrid Connections used by this Web App. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - the name of the web app. -// namespaceName - the namespace for this hybrid connection. -// relayName - the relay name for this hybrid connection. -func (client AppsClient) ListHybridConnectionKeys(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string) (result HybridConnectionKey, err error) { +func (client AppsClient) ListHybridConnections(ctx context.Context, resourceGroupName string, name string) (result HybridConnection, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListHybridConnectionKeys") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListHybridConnections") defer func() { sc := -1 if result.Response.Response != nil { @@ -18970,63 +19165,61 @@ func (client AppsClient) ListHybridConnectionKeys(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "ListHybridConnectionKeys", err.Error()) + return result, validation.NewError("web.AppsClient", "ListHybridConnections", err.Error()) } - req, err := client.ListHybridConnectionKeysPreparer(ctx, resourceGroupName, name, namespaceName, relayName) + req, err := client.ListHybridConnectionsPreparer(ctx, resourceGroupName, name) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListHybridConnectionKeys", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListHybridConnections", nil, "Failure preparing request") return } - resp, err := client.ListHybridConnectionKeysSender(req) + resp, err := client.ListHybridConnectionsSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListHybridConnectionKeys", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListHybridConnections", resp, "Failure sending request") return } - result, err = client.ListHybridConnectionKeysResponder(resp) + result, err = client.ListHybridConnectionsResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListHybridConnectionKeys", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListHybridConnections", resp, "Failure responding to request") } return } -// ListHybridConnectionKeysPreparer prepares the ListHybridConnectionKeys request. -func (client AppsClient) ListHybridConnectionKeysPreparer(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string) (*http.Request, error) { +// ListHybridConnectionsPreparer prepares the ListHybridConnections request. +func (client AppsClient) ListHybridConnectionsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), - "namespaceName": autorest.Encode("path", namespaceName), - "relayName": autorest.Encode("path", relayName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( - autorest.AsPost(), + autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/listKeys", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionRelays", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListHybridConnectionKeysSender sends the ListHybridConnectionKeys request. The method will close the +// ListHybridConnectionsSender sends the ListHybridConnections request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) ListHybridConnectionKeysSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) ListHybridConnectionsSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// ListHybridConnectionKeysResponder handles the response to the ListHybridConnectionKeys request. The method always +// ListHybridConnectionsResponder handles the response to the ListHybridConnections request. The method always // closes the http.Response Body. -func (client AppsClient) ListHybridConnectionKeysResponder(resp *http.Response) (result HybridConnectionKey, err error) { +func (client AppsClient) ListHybridConnectionsResponder(resp *http.Response) (result HybridConnection, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -19037,16 +19230,14 @@ func (client AppsClient) ListHybridConnectionKeysResponder(resp *http.Response) return } -// ListHybridConnectionKeysSlot gets the send key name and value for a Hybrid Connection. +// ListHybridConnectionsSlot description for Retrieves all Service Bus Hybrid Connections used by this Web App. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - the name of the web app. -// namespaceName - the namespace for this hybrid connection. -// relayName - the relay name for this hybrid connection. // slot - the name of the slot for the web app. -func (client AppsClient) ListHybridConnectionKeysSlot(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, slot string) (result HybridConnectionKey, err error) { +func (client AppsClient) ListHybridConnectionsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result HybridConnection, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListHybridConnectionKeysSlot") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListHybridConnectionsSlot") defer func() { sc := -1 if result.Response.Response != nil { @@ -19060,64 +19251,62 @@ func (client AppsClient) ListHybridConnectionKeysSlot(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "ListHybridConnectionKeysSlot", err.Error()) + return result, validation.NewError("web.AppsClient", "ListHybridConnectionsSlot", err.Error()) } - req, err := client.ListHybridConnectionKeysSlotPreparer(ctx, resourceGroupName, name, namespaceName, relayName, slot) + req, err := client.ListHybridConnectionsSlotPreparer(ctx, resourceGroupName, name, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListHybridConnectionKeysSlot", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListHybridConnectionsSlot", nil, "Failure preparing request") return } - resp, err := client.ListHybridConnectionKeysSlotSender(req) + resp, err := client.ListHybridConnectionsSlotSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListHybridConnectionKeysSlot", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListHybridConnectionsSlot", resp, "Failure sending request") return } - result, err = client.ListHybridConnectionKeysSlotResponder(resp) + result, err = client.ListHybridConnectionsSlotResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListHybridConnectionKeysSlot", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListHybridConnectionsSlot", resp, "Failure responding to request") } return } -// ListHybridConnectionKeysSlotPreparer prepares the ListHybridConnectionKeysSlot request. -func (client AppsClient) ListHybridConnectionKeysSlotPreparer(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, slot string) (*http.Request, error) { +// ListHybridConnectionsSlotPreparer prepares the ListHybridConnectionsSlot request. +func (client AppsClient) ListHybridConnectionsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), - "namespaceName": autorest.Encode("path", namespaceName), - "relayName": autorest.Encode("path", relayName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "slot": autorest.Encode("path", slot), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( - autorest.AsPost(), + autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/listKeys", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionRelays", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListHybridConnectionKeysSlotSender sends the ListHybridConnectionKeysSlot request. The method will close the +// ListHybridConnectionsSlotSender sends the ListHybridConnectionsSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) ListHybridConnectionKeysSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) ListHybridConnectionsSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// ListHybridConnectionKeysSlotResponder handles the response to the ListHybridConnectionKeysSlot request. The method always +// ListHybridConnectionsSlotResponder handles the response to the ListHybridConnectionsSlot request. The method always // closes the http.Response Body. -func (client AppsClient) ListHybridConnectionKeysSlotResponder(resp *http.Response) (result HybridConnectionKey, err error) { +func (client AppsClient) ListHybridConnectionsSlotResponder(resp *http.Response) (result HybridConnection, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -19128,17 +19317,18 @@ func (client AppsClient) ListHybridConnectionKeysSlotResponder(resp *http.Respon return } -// ListHybridConnections retrieves all Service Bus Hybrid Connections used by this Web App. +// ListInstanceFunctionsSlot description for List the functions for a web site, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. -// name - the name of the web app. -func (client AppsClient) ListHybridConnections(ctx context.Context, resourceGroupName string, name string) (result HybridConnection, err error) { +// name - site name. +// slot - name of the deployment slot. +func (client AppsClient) ListInstanceFunctionsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result FunctionEnvelopeCollectionPage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListHybridConnections") + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListInstanceFunctionsSlot") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.fec.Response.Response != nil { + sc = result.fec.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -19148,198 +19338,24 @@ func (client AppsClient) ListHybridConnections(ctx context.Context, resourceGrou Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "ListHybridConnections", err.Error()) + return result, validation.NewError("web.AppsClient", "ListInstanceFunctionsSlot", err.Error()) } - req, err := client.ListHybridConnectionsPreparer(ctx, resourceGroupName, name) + result.fn = client.listInstanceFunctionsSlotNextResults + req, err := client.ListInstanceFunctionsSlotPreparer(ctx, resourceGroupName, name, slot) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListHybridConnections", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListInstanceFunctionsSlot", nil, "Failure preparing request") return } - resp, err := client.ListHybridConnectionsSender(req) + resp, err := client.ListInstanceFunctionsSlotSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListHybridConnections", resp, "Failure sending request") + result.fec.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListInstanceFunctionsSlot", resp, "Failure sending request") return } - result, err = client.ListHybridConnectionsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListHybridConnections", resp, "Failure responding to request") - } - - return -} - -// ListHybridConnectionsPreparer prepares the ListHybridConnections request. -func (client AppsClient) ListHybridConnectionsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-02-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionRelays", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListHybridConnectionsSender sends the ListHybridConnections request. The method will close the -// http.Response Body if it receives an error. -func (client AppsClient) ListHybridConnectionsSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListHybridConnectionsResponder handles the response to the ListHybridConnections request. The method always -// closes the http.Response Body. -func (client AppsClient) ListHybridConnectionsResponder(resp *http.Response) (result HybridConnection, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListHybridConnectionsSlot retrieves all Service Bus Hybrid Connections used by this Web App. -// Parameters: -// resourceGroupName - name of the resource group to which the resource belongs. -// name - the name of the web app. -// slot - the name of the slot for the web app. -func (client AppsClient) ListHybridConnectionsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result HybridConnection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListHybridConnectionsSlot") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "ListHybridConnectionsSlot", err.Error()) - } - - req, err := client.ListHybridConnectionsSlotPreparer(ctx, resourceGroupName, name, slot) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListHybridConnectionsSlot", nil, "Failure preparing request") - return - } - - resp, err := client.ListHybridConnectionsSlotSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListHybridConnectionsSlot", resp, "Failure sending request") - return - } - - result, err = client.ListHybridConnectionsSlotResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListHybridConnectionsSlot", resp, "Failure responding to request") - } - - return -} - -// ListHybridConnectionsSlotPreparer prepares the ListHybridConnectionsSlot request. -func (client AppsClient) ListHybridConnectionsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-02-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionRelays", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListHybridConnectionsSlotSender sends the ListHybridConnectionsSlot request. The method will close the -// http.Response Body if it receives an error. -func (client AppsClient) ListHybridConnectionsSlotSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListHybridConnectionsSlotResponder handles the response to the ListHybridConnectionsSlot request. The method always -// closes the http.Response Body. -func (client AppsClient) ListHybridConnectionsSlotResponder(resp *http.Response) (result HybridConnection, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListInstanceFunctionsSlot list the functions for a web site, or a deployment slot. -// Parameters: -// resourceGroupName - name of the resource group to which the resource belongs. -// name - site name. -// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the -// production slot. -func (client AppsClient) ListInstanceFunctionsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result FunctionEnvelopeCollectionPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListInstanceFunctionsSlot") - defer func() { - sc := -1 - if result.fec.Response.Response != nil { - sc = result.fec.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "ListInstanceFunctionsSlot", err.Error()) - } - - result.fn = client.listInstanceFunctionsSlotNextResults - req, err := client.ListInstanceFunctionsSlotPreparer(ctx, resourceGroupName, name, slot) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListInstanceFunctionsSlot", nil, "Failure preparing request") - return - } - - resp, err := client.ListInstanceFunctionsSlotSender(req) - if err != nil { - result.fec.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListInstanceFunctionsSlot", resp, "Failure sending request") - return - } - - result.fec, err = client.ListInstanceFunctionsSlotResponder(resp) + result.fec, err = client.ListInstanceFunctionsSlotResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "web.AppsClient", "ListInstanceFunctionsSlot", resp, "Failure responding to request") } @@ -19356,7 +19372,7 @@ func (client AppsClient) ListInstanceFunctionsSlotPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -19426,7 +19442,7 @@ func (client AppsClient) ListInstanceFunctionsSlotComplete(ctx context.Context, return } -// ListInstanceIdentifiers gets all scale-out instances of an app. +// ListInstanceIdentifiers description for Gets all scale-out instances of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -19479,7 +19495,7 @@ func (client AppsClient) ListInstanceIdentifiersPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -19549,7 +19565,7 @@ func (client AppsClient) ListInstanceIdentifiersComplete(ctx context.Context, re return } -// ListInstanceIdentifiersSlot gets all scale-out instances of an app. +// ListInstanceIdentifiersSlot description for Gets all scale-out instances of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -19604,7 +19620,7 @@ func (client AppsClient) ListInstanceIdentifiersSlotPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -19674,8 +19690,8 @@ func (client AppsClient) ListInstanceIdentifiersSlotComplete(ctx context.Context return } -// ListInstanceProcesses get list of processes for a web site, or a deployment slot, or for a specific scaled-out -// instance in a web site. +// ListInstanceProcesses description for Get list of processes for a web site, or a deployment slot, or for a specific +// scaled-out instance in a web site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -19731,7 +19747,7 @@ func (client AppsClient) ListInstanceProcessesPreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -19801,8 +19817,8 @@ func (client AppsClient) ListInstanceProcessesComplete(ctx context.Context, reso return } -// ListInstanceProcessesSlot get list of processes for a web site, or a deployment slot, or for a specific scaled-out -// instance in a web site. +// ListInstanceProcessesSlot description for Get list of processes for a web site, or a deployment slot, or for a +// specific scaled-out instance in a web site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -19861,7 +19877,7 @@ func (client AppsClient) ListInstanceProcessesSlotPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -19931,8 +19947,8 @@ func (client AppsClient) ListInstanceProcessesSlotComplete(ctx context.Context, return } -// ListInstanceProcessModules list module information for a process by its ID for a specific scaled-out instance in a -// web site. +// ListInstanceProcessModules description for List module information for a process by its ID for a specific scaled-out +// instance in a web site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -19990,7 +20006,7 @@ func (client AppsClient) ListInstanceProcessModulesPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -20060,8 +20076,8 @@ func (client AppsClient) ListInstanceProcessModulesComplete(ctx context.Context, return } -// ListInstanceProcessModulesSlot list module information for a process by its ID for a specific scaled-out instance in -// a web site. +// ListInstanceProcessModulesSlot description for List module information for a process by its ID for a specific +// scaled-out instance in a web site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -20122,7 +20138,7 @@ func (client AppsClient) ListInstanceProcessModulesSlotPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -20192,7 +20208,8 @@ func (client AppsClient) ListInstanceProcessModulesSlotComplete(ctx context.Cont return } -// ListInstanceProcessThreads list the threads in a process by its ID for a specific scaled-out instance in a web site. +// ListInstanceProcessThreads description for List the threads in a process by its ID for a specific scaled-out +// instance in a web site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -20250,7 +20267,7 @@ func (client AppsClient) ListInstanceProcessThreadsPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -20320,8 +20337,8 @@ func (client AppsClient) ListInstanceProcessThreadsComplete(ctx context.Context, return } -// ListInstanceProcessThreadsSlot list the threads in a process by its ID for a specific scaled-out instance in a web -// site. +// ListInstanceProcessThreadsSlot description for List the threads in a process by its ID for a specific scaled-out +// instance in a web site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -20382,7 +20399,7 @@ func (client AppsClient) ListInstanceProcessThreadsSlotPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -20452,7 +20469,7 @@ func (client AppsClient) ListInstanceProcessThreadsSlotComplete(ctx context.Cont return } -// ListMetadata gets the metadata of an app. +// ListMetadata description for Gets the metadata of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -20504,7 +20521,7 @@ func (client AppsClient) ListMetadataPreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -20537,7 +20554,7 @@ func (client AppsClient) ListMetadataResponder(resp *http.Response) (result Stri return } -// ListMetadataSlot gets the metadata of an app. +// ListMetadataSlot description for Gets the metadata of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -20583,483 +20600,8 @@ func (client AppsClient) ListMetadataSlot(ctx context.Context, resourceGroupName return } -// ListMetadataSlotPreparer prepares the ListMetadataSlot request. -func (client AppsClient) ListMetadataSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-02-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/metadata/list", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListMetadataSlotSender sends the ListMetadataSlot request. The method will close the -// http.Response Body if it receives an error. -func (client AppsClient) ListMetadataSlotSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListMetadataSlotResponder handles the response to the ListMetadataSlot request. The method always -// closes the http.Response Body. -func (client AppsClient) ListMetadataSlotResponder(resp *http.Response) (result StringDictionary, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListMetricDefinitions gets all metric definitions of an app (or deployment slot, if specified). -// Parameters: -// resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -func (client AppsClient) ListMetricDefinitions(ctx context.Context, resourceGroupName string, name string) (result ResourceMetricDefinitionCollectionPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListMetricDefinitions") - defer func() { - sc := -1 - if result.rmdc.Response.Response != nil { - sc = result.rmdc.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "ListMetricDefinitions", err.Error()) - } - - result.fn = client.listMetricDefinitionsNextResults - req, err := client.ListMetricDefinitionsPreparer(ctx, resourceGroupName, name) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListMetricDefinitions", nil, "Failure preparing request") - return - } - - resp, err := client.ListMetricDefinitionsSender(req) - if err != nil { - result.rmdc.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListMetricDefinitions", resp, "Failure sending request") - return - } - - result.rmdc, err = client.ListMetricDefinitionsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListMetricDefinitions", resp, "Failure responding to request") - } - - return -} - -// ListMetricDefinitionsPreparer prepares the ListMetricDefinitions request. -func (client AppsClient) ListMetricDefinitionsPreparer(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-02-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/metricdefinitions", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListMetricDefinitionsSender sends the ListMetricDefinitions request. The method will close the -// http.Response Body if it receives an error. -func (client AppsClient) ListMetricDefinitionsSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListMetricDefinitionsResponder handles the response to the ListMetricDefinitions request. The method always -// closes the http.Response Body. -func (client AppsClient) ListMetricDefinitionsResponder(resp *http.Response) (result ResourceMetricDefinitionCollection, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listMetricDefinitionsNextResults retrieves the next set of results, if any. -func (client AppsClient) listMetricDefinitionsNextResults(ctx context.Context, lastResults ResourceMetricDefinitionCollection) (result ResourceMetricDefinitionCollection, err error) { - req, err := lastResults.resourceMetricDefinitionCollectionPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "web.AppsClient", "listMetricDefinitionsNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListMetricDefinitionsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "web.AppsClient", "listMetricDefinitionsNextResults", resp, "Failure sending next results request") - } - result, err = client.ListMetricDefinitionsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "listMetricDefinitionsNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListMetricDefinitionsComplete enumerates all values, automatically crossing page boundaries as required. -func (client AppsClient) ListMetricDefinitionsComplete(ctx context.Context, resourceGroupName string, name string) (result ResourceMetricDefinitionCollectionIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListMetricDefinitions") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListMetricDefinitions(ctx, resourceGroupName, name) - return -} - -// ListMetricDefinitionsSlot gets all metric definitions of an app (or deployment slot, if specified). -// Parameters: -// resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -// slot - name of the deployment slot. If a slot is not specified, the API will get metric definitions of the -// production slot. -func (client AppsClient) ListMetricDefinitionsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result ResourceMetricDefinitionCollectionPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListMetricDefinitionsSlot") - defer func() { - sc := -1 - if result.rmdc.Response.Response != nil { - sc = result.rmdc.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "ListMetricDefinitionsSlot", err.Error()) - } - - result.fn = client.listMetricDefinitionsSlotNextResults - req, err := client.ListMetricDefinitionsSlotPreparer(ctx, resourceGroupName, name, slot) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListMetricDefinitionsSlot", nil, "Failure preparing request") - return - } - - resp, err := client.ListMetricDefinitionsSlotSender(req) - if err != nil { - result.rmdc.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListMetricDefinitionsSlot", resp, "Failure sending request") - return - } - - result.rmdc, err = client.ListMetricDefinitionsSlotResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListMetricDefinitionsSlot", resp, "Failure responding to request") - } - - return -} - -// ListMetricDefinitionsSlotPreparer prepares the ListMetricDefinitionsSlot request. -func (client AppsClient) ListMetricDefinitionsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-02-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/metricdefinitions", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListMetricDefinitionsSlotSender sends the ListMetricDefinitionsSlot request. The method will close the -// http.Response Body if it receives an error. -func (client AppsClient) ListMetricDefinitionsSlotSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListMetricDefinitionsSlotResponder handles the response to the ListMetricDefinitionsSlot request. The method always -// closes the http.Response Body. -func (client AppsClient) ListMetricDefinitionsSlotResponder(resp *http.Response) (result ResourceMetricDefinitionCollection, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listMetricDefinitionsSlotNextResults retrieves the next set of results, if any. -func (client AppsClient) listMetricDefinitionsSlotNextResults(ctx context.Context, lastResults ResourceMetricDefinitionCollection) (result ResourceMetricDefinitionCollection, err error) { - req, err := lastResults.resourceMetricDefinitionCollectionPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "web.AppsClient", "listMetricDefinitionsSlotNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListMetricDefinitionsSlotSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "web.AppsClient", "listMetricDefinitionsSlotNextResults", resp, "Failure sending next results request") - } - result, err = client.ListMetricDefinitionsSlotResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "listMetricDefinitionsSlotNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListMetricDefinitionsSlotComplete enumerates all values, automatically crossing page boundaries as required. -func (client AppsClient) ListMetricDefinitionsSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result ResourceMetricDefinitionCollectionIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListMetricDefinitionsSlot") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListMetricDefinitionsSlot(ctx, resourceGroupName, name, slot) - return -} - -// ListMetrics gets performance metrics of an app (or deployment slot, if specified). -// Parameters: -// resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -// details - specify "true" to include metric details in the response. It is "false" by default. -// filter - return only metrics specified in the filter (using OData syntax). For example: $filter=(name.value -// eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq -// 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. -func (client AppsClient) ListMetrics(ctx context.Context, resourceGroupName string, name string, details *bool, filter string) (result ResourceMetricCollectionPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListMetrics") - defer func() { - sc := -1 - if result.rmc.Response.Response != nil { - sc = result.rmc.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "ListMetrics", err.Error()) - } - - result.fn = client.listMetricsNextResults - req, err := client.ListMetricsPreparer(ctx, resourceGroupName, name, details, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListMetrics", nil, "Failure preparing request") - return - } - - resp, err := client.ListMetricsSender(req) - if err != nil { - result.rmc.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListMetrics", resp, "Failure sending request") - return - } - - result.rmc, err = client.ListMetricsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListMetrics", resp, "Failure responding to request") - } - - return -} - -// ListMetricsPreparer prepares the ListMetrics request. -func (client AppsClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, name string, details *bool, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-02-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if details != nil { - queryParameters["details"] = autorest.Encode("query", *details) - } - if len(filter) > 0 { - queryParameters["$filter"] = filter - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/metrics", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListMetricsSender sends the ListMetrics request. The method will close the -// http.Response Body if it receives an error. -func (client AppsClient) ListMetricsSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListMetricsResponder handles the response to the ListMetrics request. The method always -// closes the http.Response Body. -func (client AppsClient) ListMetricsResponder(resp *http.Response) (result ResourceMetricCollection, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listMetricsNextResults retrieves the next set of results, if any. -func (client AppsClient) listMetricsNextResults(ctx context.Context, lastResults ResourceMetricCollection) (result ResourceMetricCollection, err error) { - req, err := lastResults.resourceMetricCollectionPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "web.AppsClient", "listMetricsNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListMetricsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "web.AppsClient", "listMetricsNextResults", resp, "Failure sending next results request") - } - result, err = client.ListMetricsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "listMetricsNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListMetricsComplete enumerates all values, automatically crossing page boundaries as required. -func (client AppsClient) ListMetricsComplete(ctx context.Context, resourceGroupName string, name string, details *bool, filter string) (result ResourceMetricCollectionIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListMetrics") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListMetrics(ctx, resourceGroupName, name, details, filter) - return -} - -// ListMetricsSlot gets performance metrics of an app (or deployment slot, if specified). -// Parameters: -// resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the app. -// slot - name of the deployment slot. If a slot is not specified, the API will get metrics of the production -// slot. -// details - specify "true" to include metric details in the response. It is "false" by default. -// filter - return only metrics specified in the filter (using OData syntax). For example: $filter=(name.value -// eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq -// 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. -func (client AppsClient) ListMetricsSlot(ctx context.Context, resourceGroupName string, name string, slot string, details *bool, filter string) (result ResourceMetricCollectionPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListMetricsSlot") - defer func() { - sc := -1 - if result.rmc.Response.Response != nil { - sc = result.rmc.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppsClient", "ListMetricsSlot", err.Error()) - } - - result.fn = client.listMetricsSlotNextResults - req, err := client.ListMetricsSlotPreparer(ctx, resourceGroupName, name, slot, details, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListMetricsSlot", nil, "Failure preparing request") - return - } - - resp, err := client.ListMetricsSlotSender(req) - if err != nil { - result.rmc.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListMetricsSlot", resp, "Failure sending request") - return - } - - result.rmc, err = client.ListMetricsSlotResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "ListMetricsSlot", resp, "Failure responding to request") - } - - return -} - -// ListMetricsSlotPreparer prepares the ListMetricsSlot request. -func (client AppsClient) ListMetricsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string, details *bool, filter string) (*http.Request, error) { +// ListMetadataSlotPreparer prepares the ListMetadataSlot request. +func (client AppsClient) ListMetadataSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -21067,35 +20609,29 @@ func (client AppsClient) ListMetricsSlotPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } - if details != nil { - queryParameters["details"] = autorest.Encode("query", *details) - } - if len(filter) > 0 { - queryParameters["$filter"] = filter - } preparer := autorest.CreatePreparer( - autorest.AsGet(), + autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/metrics", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/metadata/list", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListMetricsSlotSender sends the ListMetricsSlot request. The method will close the +// ListMetadataSlotSender sends the ListMetadataSlot request. The method will close the // http.Response Body if it receives an error. -func (client AppsClient) ListMetricsSlotSender(req *http.Request) (*http.Response, error) { +func (client AppsClient) ListMetadataSlotSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// ListMetricsSlotResponder handles the response to the ListMetricsSlot request. The method always +// ListMetadataSlotResponder handles the response to the ListMetadataSlot request. The method always // closes the http.Response Body. -func (client AppsClient) ListMetricsSlotResponder(resp *http.Response) (result ResourceMetricCollection, err error) { +func (client AppsClient) ListMetadataSlotResponder(resp *http.Response) (result StringDictionary, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -21106,44 +20642,7 @@ func (client AppsClient) ListMetricsSlotResponder(resp *http.Response) (result R return } -// listMetricsSlotNextResults retrieves the next set of results, if any. -func (client AppsClient) listMetricsSlotNextResults(ctx context.Context, lastResults ResourceMetricCollection) (result ResourceMetricCollection, err error) { - req, err := lastResults.resourceMetricCollectionPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "web.AppsClient", "listMetricsSlotNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListMetricsSlotSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "web.AppsClient", "listMetricsSlotNextResults", resp, "Failure sending next results request") - } - result, err = client.ListMetricsSlotResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppsClient", "listMetricsSlotNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListMetricsSlotComplete enumerates all values, automatically crossing page boundaries as required. -func (client AppsClient) ListMetricsSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string, details *bool, filter string) (result ResourceMetricCollectionIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListMetricsSlot") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListMetricsSlot(ctx, resourceGroupName, name, slot, details, filter) - return -} - -// ListNetworkFeatures gets all network features used by the app (or deployment slot, if specified). +// ListNetworkFeatures description for Gets all network features used by the app (or deployment slot, if specified). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -21197,7 +20696,7 @@ func (client AppsClient) ListNetworkFeaturesPreparer(ctx context.Context, resour "view": autorest.Encode("path", view), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -21230,7 +20729,8 @@ func (client AppsClient) ListNetworkFeaturesResponder(resp *http.Response) (resu return } -// ListNetworkFeaturesSlot gets all network features used by the app (or deployment slot, if specified). +// ListNetworkFeaturesSlot description for Gets all network features used by the app (or deployment slot, if +// specified). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -21287,7 +20787,7 @@ func (client AppsClient) ListNetworkFeaturesSlotPreparer(ctx context.Context, re "view": autorest.Encode("path", view), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -21320,7 +20820,7 @@ func (client AppsClient) ListNetworkFeaturesSlotResponder(resp *http.Response) ( return } -// ListPerfMonCounters gets perfmon counters for web app. +// ListPerfMonCounters description for Gets perfmon counters for web app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of web app. @@ -21376,7 +20876,7 @@ func (client AppsClient) ListPerfMonCountersPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -21449,7 +20949,7 @@ func (client AppsClient) ListPerfMonCountersComplete(ctx context.Context, resour return } -// ListPerfMonCountersSlot gets perfmon counters for web app. +// ListPerfMonCountersSlot description for Gets perfmon counters for web app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of web app. @@ -21507,7 +21007,7 @@ func (client AppsClient) ListPerfMonCountersSlotPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -21580,7 +21080,7 @@ func (client AppsClient) ListPerfMonCountersSlotComplete(ctx context.Context, re return } -// ListPremierAddOns gets the premier add-ons of an app. +// ListPremierAddOns description for Gets the premier add-ons of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -21632,7 +21132,7 @@ func (client AppsClient) ListPremierAddOnsPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -21665,7 +21165,7 @@ func (client AppsClient) ListPremierAddOnsResponder(resp *http.Response) (result return } -// ListPremierAddOnsSlot gets the premier add-ons of an app. +// ListPremierAddOnsSlot description for Gets the premier add-ons of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -21720,7 +21220,7 @@ func (client AppsClient) ListPremierAddOnsSlotPreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -21753,8 +21253,8 @@ func (client AppsClient) ListPremierAddOnsSlotResponder(resp *http.Response) (re return } -// ListProcesses get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a -// web site. +// ListProcesses description for Get list of processes for a web site, or a deployment slot, or for a specific +// scaled-out instance in a web site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -21807,7 +21307,7 @@ func (client AppsClient) ListProcessesPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -21877,8 +21377,8 @@ func (client AppsClient) ListProcessesComplete(ctx context.Context, resourceGrou return } -// ListProcessesSlot get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance -// in a web site. +// ListProcessesSlot description for Get list of processes for a web site, or a deployment slot, or for a specific +// scaled-out instance in a web site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -21934,7 +21434,7 @@ func (client AppsClient) ListProcessesSlotPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -22004,7 +21504,8 @@ func (client AppsClient) ListProcessesSlotComplete(ctx context.Context, resource return } -// ListProcessModules list module information for a process by its ID for a specific scaled-out instance in a web site. +// ListProcessModules description for List module information for a process by its ID for a specific scaled-out +// instance in a web site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -22059,7 +21560,7 @@ func (client AppsClient) ListProcessModulesPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -22129,8 +21630,8 @@ func (client AppsClient) ListProcessModulesComplete(ctx context.Context, resourc return } -// ListProcessModulesSlot list module information for a process by its ID for a specific scaled-out instance in a web -// site. +// ListProcessModulesSlot description for List module information for a process by its ID for a specific scaled-out +// instance in a web site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -22188,7 +21689,7 @@ func (client AppsClient) ListProcessModulesSlotPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -22258,7 +21759,8 @@ func (client AppsClient) ListProcessModulesSlotComplete(ctx context.Context, res return } -// ListProcessThreads list the threads in a process by its ID for a specific scaled-out instance in a web site. +// ListProcessThreads description for List the threads in a process by its ID for a specific scaled-out instance in a +// web site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -22313,7 +21815,7 @@ func (client AppsClient) ListProcessThreadsPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -22383,7 +21885,8 @@ func (client AppsClient) ListProcessThreadsComplete(ctx context.Context, resourc return } -// ListProcessThreadsSlot list the threads in a process by its ID for a specific scaled-out instance in a web site. +// ListProcessThreadsSlot description for List the threads in a process by its ID for a specific scaled-out instance in +// a web site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -22441,7 +21944,7 @@ func (client AppsClient) ListProcessThreadsSlotPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -22511,7 +22014,7 @@ func (client AppsClient) ListProcessThreadsSlotComplete(ctx context.Context, res return } -// ListPublicCertificates get public certificates for an app or a deployment slot. +// ListPublicCertificates description for Get public certificates for an app or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -22564,7 +22067,7 @@ func (client AppsClient) ListPublicCertificatesPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -22634,7 +22137,7 @@ func (client AppsClient) ListPublicCertificatesComplete(ctx context.Context, res return } -// ListPublicCertificatesSlot get public certificates for an app or a deployment slot. +// ListPublicCertificatesSlot description for Get public certificates for an app or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -22690,7 +22193,7 @@ func (client AppsClient) ListPublicCertificatesSlotPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -22760,7 +22263,7 @@ func (client AppsClient) ListPublicCertificatesSlotComplete(ctx context.Context, return } -// ListPublishingCredentials gets the Git/FTP publishing credentials of an app. +// ListPublishingCredentials description for Gets the Git/FTP publishing credentials of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -22806,7 +22309,7 @@ func (client AppsClient) ListPublishingCredentialsPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -22845,7 +22348,7 @@ func (client AppsClient) ListPublishingCredentialsResponder(resp *http.Response) return } -// ListPublishingCredentialsSlot gets the Git/FTP publishing credentials of an app. +// ListPublishingCredentialsSlot description for Gets the Git/FTP publishing credentials of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -22894,7 +22397,7 @@ func (client AppsClient) ListPublishingCredentialsSlotPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -22933,7 +22436,8 @@ func (client AppsClient) ListPublishingCredentialsSlotResponder(resp *http.Respo return } -// ListPublishingProfileXMLWithSecrets gets the publishing profile for an app (or deployment slot, if specified). +// ListPublishingProfileXMLWithSecrets description for Gets the publishing profile for an app (or deployment slot, if +// specified). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -22987,7 +22491,7 @@ func (client AppsClient) ListPublishingProfileXMLWithSecretsPreparer(ctx context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -23021,7 +22525,8 @@ func (client AppsClient) ListPublishingProfileXMLWithSecretsResponder(resp *http return } -// ListPublishingProfileXMLWithSecretsSlot gets the publishing profile for an app (or deployment slot, if specified). +// ListPublishingProfileXMLWithSecretsSlot description for Gets the publishing profile for an app (or deployment slot, +// if specified). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -23078,7 +22583,7 @@ func (client AppsClient) ListPublishingProfileXMLWithSecretsSlotPreparer(ctx con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -23112,7 +22617,8 @@ func (client AppsClient) ListPublishingProfileXMLWithSecretsSlotResponder(resp * return } -// ListRelayServiceConnections gets hybrid connections configured for an app (or deployment slot, if specified). +// ListRelayServiceConnections description for Gets hybrid connections configured for an app (or deployment slot, if +// specified). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -23164,7 +22670,7 @@ func (client AppsClient) ListRelayServiceConnectionsPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -23197,7 +22703,8 @@ func (client AppsClient) ListRelayServiceConnectionsResponder(resp *http.Respons return } -// ListRelayServiceConnectionsSlot gets hybrid connections configured for an app (or deployment slot, if specified). +// ListRelayServiceConnectionsSlot description for Gets hybrid connections configured for an app (or deployment slot, +// if specified). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -23252,7 +22759,7 @@ func (client AppsClient) ListRelayServiceConnectionsSlotPreparer(ctx context.Con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -23285,7 +22792,256 @@ func (client AppsClient) ListRelayServiceConnectionsSlotResponder(resp *http.Res return } -// ListSiteExtensions get list of siteextensions for a web site, or a deployment slot. +// ListSiteBackups description for Gets existing backups of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) ListSiteBackups(ctx context.Context, resourceGroupName string, name string) (result BackupItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListSiteBackups") + defer func() { + sc := -1 + if result.bic.Response.Response != nil { + sc = result.bic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListSiteBackups", err.Error()) + } + + result.fn = client.listSiteBackupsNextResults + req, err := client.ListSiteBackupsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSiteBackups", nil, "Failure preparing request") + return + } + + resp, err := client.ListSiteBackupsSender(req) + if err != nil { + result.bic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSiteBackups", resp, "Failure sending request") + return + } + + result.bic, err = client.ListSiteBackupsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSiteBackups", resp, "Failure responding to request") + } + + return +} + +// ListSiteBackupsPreparer prepares the ListSiteBackups request. +func (client AppsClient) ListSiteBackupsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/listbackups", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSiteBackupsSender sends the ListSiteBackups request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListSiteBackupsSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListSiteBackupsResponder handles the response to the ListSiteBackups request. The method always +// closes the http.Response Body. +func (client AppsClient) ListSiteBackupsResponder(resp *http.Response) (result BackupItemCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listSiteBackupsNextResults retrieves the next set of results, if any. +func (client AppsClient) listSiteBackupsNextResults(ctx context.Context, lastResults BackupItemCollection) (result BackupItemCollection, err error) { + req, err := lastResults.backupItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listSiteBackupsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSiteBackupsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listSiteBackupsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListSiteBackupsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listSiteBackupsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListSiteBackupsComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListSiteBackupsComplete(ctx context.Context, resourceGroupName string, name string) (result BackupItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListSiteBackups") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListSiteBackups(ctx, resourceGroupName, name) + return +} + +// ListSiteBackupsSlot description for Gets existing backups of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API will get backups of the production +// slot. +func (client AppsClient) ListSiteBackupsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result BackupItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListSiteBackupsSlot") + defer func() { + sc := -1 + if result.bic.Response.Response != nil { + sc = result.bic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListSiteBackupsSlot", err.Error()) + } + + result.fn = client.listSiteBackupsSlotNextResults + req, err := client.ListSiteBackupsSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSiteBackupsSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListSiteBackupsSlotSender(req) + if err != nil { + result.bic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSiteBackupsSlot", resp, "Failure sending request") + return + } + + result.bic, err = client.ListSiteBackupsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSiteBackupsSlot", resp, "Failure responding to request") + } + + return +} + +// ListSiteBackupsSlotPreparer prepares the ListSiteBackupsSlot request. +func (client AppsClient) ListSiteBackupsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/listbackups", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSiteBackupsSlotSender sends the ListSiteBackupsSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListSiteBackupsSlotSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListSiteBackupsSlotResponder handles the response to the ListSiteBackupsSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListSiteBackupsSlotResponder(resp *http.Response) (result BackupItemCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listSiteBackupsSlotNextResults retrieves the next set of results, if any. +func (client AppsClient) listSiteBackupsSlotNextResults(ctx context.Context, lastResults BackupItemCollection) (result BackupItemCollection, err error) { + req, err := lastResults.backupItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listSiteBackupsSlotNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSiteBackupsSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listSiteBackupsSlotNextResults", resp, "Failure sending next results request") + } + result, err = client.ListSiteBackupsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listSiteBackupsSlotNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListSiteBackupsSlotComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListSiteBackupsSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result BackupItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListSiteBackupsSlot") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListSiteBackupsSlot(ctx, resourceGroupName, name, slot) + return +} + +// ListSiteExtensions description for Get list of siteextensions for a web site, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -23338,7 +23094,7 @@ func (client AppsClient) ListSiteExtensionsPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -23408,12 +23164,11 @@ func (client AppsClient) ListSiteExtensionsComplete(ctx context.Context, resourc return } -// ListSiteExtensionsSlot get list of siteextensions for a web site, or a deployment slot. +// ListSiteExtensionsSlot description for Get list of siteextensions for a web site, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. -// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the -// production slot. +// slot - name of the deployment slot. If a slot is not specified, the API uses the production slot. func (client AppsClient) ListSiteExtensionsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result SiteExtensionInfoCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListSiteExtensionsSlot") @@ -23464,7 +23219,7 @@ func (client AppsClient) ListSiteExtensionsSlotPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -23534,7 +23289,7 @@ func (client AppsClient) ListSiteExtensionsSlotComplete(ctx context.Context, res return } -// ListSitePushSettings gets the Push settings associated with web app. +// ListSitePushSettings description for Gets the Push settings associated with web app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of web app. @@ -23586,7 +23341,7 @@ func (client AppsClient) ListSitePushSettingsPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -23619,7 +23374,7 @@ func (client AppsClient) ListSitePushSettingsResponder(resp *http.Response) (res return } -// ListSitePushSettingsSlot gets the Push settings associated with web app. +// ListSitePushSettingsSlot description for Gets the Push settings associated with web app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of web app. @@ -23673,7 +23428,7 @@ func (client AppsClient) ListSitePushSettingsSlotPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -23706,8 +23461,8 @@ func (client AppsClient) ListSitePushSettingsSlotResponder(resp *http.Response) return } -// ListSlotConfigurationNames gets the names of app settings and connection strings that stick to the slot (not -// swapped). +// ListSlotConfigurationNames description for Gets the names of app settings and connection strings that stick to the +// slot (not swapped). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -23759,7 +23514,7 @@ func (client AppsClient) ListSlotConfigurationNamesPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -23792,7 +23547,8 @@ func (client AppsClient) ListSlotConfigurationNamesResponder(resp *http.Response return } -// ListSlotDifferencesFromProduction get the difference in configuration settings between two web app slots. +// ListSlotDifferencesFromProduction description for Get the difference in configuration settings between two web app +// slots. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -23849,7 +23605,7 @@ func (client AppsClient) ListSlotDifferencesFromProductionPreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -23921,7 +23677,7 @@ func (client AppsClient) ListSlotDifferencesFromProductionComplete(ctx context.C return } -// ListSlotDifferencesSlot get the difference in configuration settings between two web app slots. +// ListSlotDifferencesSlot description for Get the difference in configuration settings between two web app slots. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -23980,7 +23736,7 @@ func (client AppsClient) ListSlotDifferencesSlotPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -24052,7 +23808,7 @@ func (client AppsClient) ListSlotDifferencesSlotComplete(ctx context.Context, re return } -// ListSlots gets an app's deployment slots. +// ListSlots description for Gets an app's deployment slots. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -24105,7 +23861,7 @@ func (client AppsClient) ListSlotsPreparer(ctx context.Context, resourceGroupNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -24175,7 +23931,7 @@ func (client AppsClient) ListSlotsComplete(ctx context.Context, resourceGroupNam return } -// ListSnapshots returns all Snapshots to the user. +// ListSnapshots description for Returns all Snapshots to the user. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - website Name. @@ -24228,7 +23984,7 @@ func (client AppsClient) ListSnapshotsPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -24298,7 +24054,7 @@ func (client AppsClient) ListSnapshotsComplete(ctx context.Context, resourceGrou return } -// ListSnapshotsFromDRSecondary returns all Snapshots to the user from DRSecondary endpoint. +// ListSnapshotsFromDRSecondary description for Returns all Snapshots to the user from DRSecondary endpoint. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - website Name. @@ -24351,7 +24107,7 @@ func (client AppsClient) ListSnapshotsFromDRSecondaryPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -24421,7 +24177,7 @@ func (client AppsClient) ListSnapshotsFromDRSecondaryComplete(ctx context.Contex return } -// ListSnapshotsFromDRSecondarySlot returns all Snapshots to the user from DRSecondary endpoint. +// ListSnapshotsFromDRSecondarySlot description for Returns all Snapshots to the user from DRSecondary endpoint. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - website Name. @@ -24476,7 +24232,7 @@ func (client AppsClient) ListSnapshotsFromDRSecondarySlotPreparer(ctx context.Co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -24546,7 +24302,7 @@ func (client AppsClient) ListSnapshotsFromDRSecondarySlotComplete(ctx context.Co return } -// ListSnapshotsSlot returns all Snapshots to the user. +// ListSnapshotsSlot description for Returns all Snapshots to the user. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - website Name. @@ -24601,7 +24357,7 @@ func (client AppsClient) ListSnapshotsSlotPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -24671,7 +24427,7 @@ func (client AppsClient) ListSnapshotsSlotComplete(ctx context.Context, resource return } -// ListSyncFunctionTriggers this is to allow calling via powershell and ARM template. +// ListSyncFunctionTriggers description for This is to allow calling via powershell and ARM template. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -24723,7 +24479,7 @@ func (client AppsClient) ListSyncFunctionTriggersPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -24756,12 +24512,11 @@ func (client AppsClient) ListSyncFunctionTriggersResponder(resp *http.Response) return } -// ListSyncFunctionTriggersSlot this is to allow calling via powershell and ARM template. +// ListSyncFunctionTriggersSlot description for This is to allow calling via powershell and ARM template. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// slot - name of the deployment slot. If a slot is not specified, the API will restore a backup of the -// production slot. +// slot - name of the deployment slot. func (client AppsClient) ListSyncFunctionTriggersSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result FunctionSecrets, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListSyncFunctionTriggersSlot") @@ -24811,7 +24566,7 @@ func (client AppsClient) ListSyncFunctionTriggersSlotPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -24844,7 +24599,7 @@ func (client AppsClient) ListSyncFunctionTriggersSlotResponder(resp *http.Respon return } -// ListTriggeredWebJobHistory list a triggered web job's history for an app, or a deployment slot. +// ListTriggeredWebJobHistory description for List a triggered web job's history for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -24899,7 +24654,7 @@ func (client AppsClient) ListTriggeredWebJobHistoryPreparer(ctx context.Context, "webJobName": autorest.Encode("path", webJobName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -24969,13 +24724,12 @@ func (client AppsClient) ListTriggeredWebJobHistoryComplete(ctx context.Context, return } -// ListTriggeredWebJobHistorySlot list a triggered web job's history for an app, or a deployment slot. +// ListTriggeredWebJobHistorySlot description for List a triggered web job's history for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. // webJobName - name of Web Job. -// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the -// production slot. +// slot - name of the deployment slot. If a slot is not specified, the API uses the production slot. func (client AppsClient) ListTriggeredWebJobHistorySlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (result TriggeredJobHistoryCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListTriggeredWebJobHistorySlot") @@ -25027,7 +24781,7 @@ func (client AppsClient) ListTriggeredWebJobHistorySlotPreparer(ctx context.Cont "webJobName": autorest.Encode("path", webJobName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -25097,7 +24851,7 @@ func (client AppsClient) ListTriggeredWebJobHistorySlotComplete(ctx context.Cont return } -// ListTriggeredWebJobs list triggered web jobs for an app, or a deployment slot. +// ListTriggeredWebJobs description for List triggered web jobs for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -25150,7 +24904,7 @@ func (client AppsClient) ListTriggeredWebJobsPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -25220,7 +24974,7 @@ func (client AppsClient) ListTriggeredWebJobsComplete(ctx context.Context, resou return } -// ListTriggeredWebJobsSlot list triggered web jobs for an app, or a deployment slot. +// ListTriggeredWebJobsSlot description for List triggered web jobs for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -25276,7 +25030,7 @@ func (client AppsClient) ListTriggeredWebJobsSlotPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -25346,7 +25100,7 @@ func (client AppsClient) ListTriggeredWebJobsSlotComplete(ctx context.Context, r return } -// ListUsages gets the quota usage information of an app (or deployment slot, if specified). +// ListUsages description for Gets the quota usage information of an app (or deployment slot, if specified). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -25402,7 +25156,7 @@ func (client AppsClient) ListUsagesPreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -25475,7 +25229,7 @@ func (client AppsClient) ListUsagesComplete(ctx context.Context, resourceGroupNa return } -// ListUsagesSlot gets the quota usage information of an app (or deployment slot, if specified). +// ListUsagesSlot description for Gets the quota usage information of an app (or deployment slot, if specified). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -25534,7 +25288,7 @@ func (client AppsClient) ListUsagesSlotPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -25607,7 +25361,7 @@ func (client AppsClient) ListUsagesSlotComplete(ctx context.Context, resourceGro return } -// ListVnetConnections gets the virtual networks the app (or deployment slot) is connected to. +// ListVnetConnections description for Gets the virtual networks the app (or deployment slot) is connected to. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -25659,7 +25413,7 @@ func (client AppsClient) ListVnetConnectionsPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -25692,7 +25446,7 @@ func (client AppsClient) ListVnetConnectionsResponder(resp *http.Response) (resu return } -// ListVnetConnectionsSlot gets the virtual networks the app (or deployment slot) is connected to. +// ListVnetConnectionsSlot description for Gets the virtual networks the app (or deployment slot) is connected to. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -25747,7 +25501,7 @@ func (client AppsClient) ListVnetConnectionsSlotPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -25780,7 +25534,7 @@ func (client AppsClient) ListVnetConnectionsSlotResponder(resp *http.Response) ( return } -// ListWebJobs list webjobs for an app, or a deployment slot. +// ListWebJobs description for List webjobs for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -25833,7 +25587,7 @@ func (client AppsClient) ListWebJobsPreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -25903,7 +25657,7 @@ func (client AppsClient) ListWebJobsComplete(ctx context.Context, resourceGroupN return } -// ListWebJobsSlot list webjobs for an app, or a deployment slot. +// ListWebJobsSlot description for List webjobs for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -25959,7 +25713,7 @@ func (client AppsClient) ListWebJobsSlotPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -26029,7 +25783,7 @@ func (client AppsClient) ListWebJobsSlotComplete(ctx context.Context, resourceGr return } -// MigrateMySQL migrates a local (in-app) MySql database to a remote MySql database. +// MigrateMySQL description for Migrates a local (in-app) MySql database to a remote MySql database. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of web app. @@ -26079,7 +25833,7 @@ func (client AppsClient) MigrateMySQLPreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -26120,7 +25874,7 @@ func (client AppsClient) MigrateMySQLResponder(resp *http.Response) (result Oper return } -// MigrateStorage restores a web app. +// MigrateStorage description for Restores a web app. // Parameters: // subscriptionName - azure subscription. // resourceGroupName - name of the resource group to which the resource belongs. @@ -26173,7 +25927,7 @@ func (client AppsClient) MigrateStoragePreparer(ctx context.Context, subscriptio "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, "subscriptionName": autorest.Encode("query", subscriptionName), @@ -26215,8 +25969,8 @@ func (client AppsClient) MigrateStorageResponder(resp *http.Response) (result St return } -// PutPrivateAccessVnet sets data around private site access enablement and authorized Virtual Networks that can access -// the site. +// PutPrivateAccessVnet description for Sets data around private site access enablement and authorized Virtual Networks +// that can access the site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - the name of the web app. @@ -26269,7 +26023,7 @@ func (client AppsClient) PutPrivateAccessVnetPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -26304,8 +26058,8 @@ func (client AppsClient) PutPrivateAccessVnetResponder(resp *http.Response) (res return } -// PutPrivateAccessVnetSlot sets data around private site access enablement and authorized Virtual Networks that can -// access the site. +// PutPrivateAccessVnetSlot description for Sets data around private site access enablement and authorized Virtual +// Networks that can access the site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - the name of the web app. @@ -26360,7 +26114,7 @@ func (client AppsClient) PutPrivateAccessVnetSlotPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -26395,7 +26149,7 @@ func (client AppsClient) PutPrivateAccessVnetSlotResponder(resp *http.Response) return } -// RecoverSiteConfigurationSnapshot reverts the configuration of an app to a previous snapshot. +// RecoverSiteConfigurationSnapshot description for Reverts the configuration of an app to a previous snapshot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -26449,7 +26203,7 @@ func (client AppsClient) RecoverSiteConfigurationSnapshotPreparer(ctx context.Co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -26481,7 +26235,7 @@ func (client AppsClient) RecoverSiteConfigurationSnapshotResponder(resp *http.Re return } -// RecoverSiteConfigurationSnapshotSlot reverts the configuration of an app to a previous snapshot. +// RecoverSiteConfigurationSnapshotSlot description for Reverts the configuration of an app to a previous snapshot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -26538,7 +26292,7 @@ func (client AppsClient) RecoverSiteConfigurationSnapshotSlotPreparer(ctx contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -26570,8 +26324,8 @@ func (client AppsClient) RecoverSiteConfigurationSnapshotSlotResponder(resp *htt return } -// ResetProductionSlotConfig resets the configuration settings of the current slot if they were previously modified by -// calling the API with POST. +// ResetProductionSlotConfig description for Resets the configuration settings of the current slot if they were +// previously modified by calling the API with POST. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -26623,7 +26377,7 @@ func (client AppsClient) ResetProductionSlotConfigPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -26655,8 +26409,8 @@ func (client AppsClient) ResetProductionSlotConfigResponder(resp *http.Response) return } -// ResetSlotConfigurationSlot resets the configuration settings of the current slot if they were previously modified by -// calling the API with POST. +// ResetSlotConfigurationSlot description for Resets the configuration settings of the current slot if they were +// previously modified by calling the API with POST. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -26711,7 +26465,7 @@ func (client AppsClient) ResetSlotConfigurationSlotPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -26743,7 +26497,7 @@ func (client AppsClient) ResetSlotConfigurationSlotResponder(resp *http.Response return } -// Restart restarts an app (or deployment slot, if specified). +// Restart description for Restarts an app (or deployment slot, if specified). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -26799,7 +26553,7 @@ func (client AppsClient) RestartPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -26837,7 +26591,7 @@ func (client AppsClient) RestartResponder(resp *http.Response) (result autorest. return } -// RestartSlot restarts an app (or deployment slot, if specified). +// RestartSlot description for Restarts an app (or deployment slot, if specified). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -26895,7 +26649,7 @@ func (client AppsClient) RestartSlotPreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -26933,7 +26687,7 @@ func (client AppsClient) RestartSlotResponder(resp *http.Response) (result autor return } -// Restore restores a specific backup to another app (or deployment slot, if specified). +// Restore description for Restores a specific backup to another app (or deployment slot, if specified). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -26987,7 +26741,7 @@ func (client AppsClient) RestorePreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -27027,7 +26781,7 @@ func (client AppsClient) RestoreResponder(resp *http.Response) (result autorest. return } -// RestoreFromBackupBlob restores an app from a backup blob in Azure Storage. +// RestoreFromBackupBlob description for Restores an app from a backup blob in Azure Storage. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -27079,7 +26833,7 @@ func (client AppsClient) RestoreFromBackupBlobPreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -27119,7 +26873,7 @@ func (client AppsClient) RestoreFromBackupBlobResponder(resp *http.Response) (re return } -// RestoreFromBackupBlobSlot restores an app from a backup blob in Azure Storage. +// RestoreFromBackupBlobSlot description for Restores an app from a backup blob in Azure Storage. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -27174,7 +26928,7 @@ func (client AppsClient) RestoreFromBackupBlobSlotPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -27214,7 +26968,7 @@ func (client AppsClient) RestoreFromBackupBlobSlotResponder(resp *http.Response) return } -// RestoreFromDeletedApp restores a deleted web app to this web app. +// RestoreFromDeletedApp description for Restores a deleted web app to this web app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of web app. @@ -27261,7 +27015,7 @@ func (client AppsClient) RestoreFromDeletedAppPreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -27301,7 +27055,7 @@ func (client AppsClient) RestoreFromDeletedAppResponder(resp *http.Response) (re return } -// RestoreFromDeletedAppSlot restores a deleted web app to this web app. +// RestoreFromDeletedAppSlot description for Restores a deleted web app to this web app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of web app. @@ -27350,7 +27104,7 @@ func (client AppsClient) RestoreFromDeletedAppSlotPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -27390,7 +27144,7 @@ func (client AppsClient) RestoreFromDeletedAppSlotResponder(resp *http.Response) return } -// RestoreSlot restores a specific backup to another app (or deployment slot, if specified). +// RestoreSlot description for Restores a specific backup to another app (or deployment slot, if specified). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -27447,7 +27201,7 @@ func (client AppsClient) RestoreSlotPreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -27487,7 +27241,7 @@ func (client AppsClient) RestoreSlotResponder(resp *http.Response) (result autor return } -// RestoreSnapshot restores a web app from a snapshot. +// RestoreSnapshot description for Restores a web app from a snapshot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of web app. @@ -27538,7 +27292,7 @@ func (client AppsClient) RestoreSnapshotPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -27578,7 +27332,7 @@ func (client AppsClient) RestoreSnapshotResponder(resp *http.Response) (result a return } -// RestoreSnapshotSlot restores a web app from a snapshot. +// RestoreSnapshotSlot description for Restores a web app from a snapshot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of web app. @@ -27631,7 +27385,7 @@ func (client AppsClient) RestoreSnapshotSlotPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -27671,7 +27425,7 @@ func (client AppsClient) RestoreSnapshotSlotResponder(resp *http.Response) (resu return } -// RunTriggeredWebJob run a triggered web job for an app, or a deployment slot. +// RunTriggeredWebJob description for Run a triggered web job for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -27725,7 +27479,7 @@ func (client AppsClient) RunTriggeredWebJobPreparer(ctx context.Context, resourc "webJobName": autorest.Encode("path", webJobName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -27757,13 +27511,12 @@ func (client AppsClient) RunTriggeredWebJobResponder(resp *http.Response) (resul return } -// RunTriggeredWebJobSlot run a triggered web job for an app, or a deployment slot. +// RunTriggeredWebJobSlot description for Run a triggered web job for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. // webJobName - name of Web Job. -// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the -// production slot. +// slot - name of the deployment slot. If a slot is not specified, the API uses the production slot. func (client AppsClient) RunTriggeredWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.RunTriggeredWebJobSlot") @@ -27814,7 +27567,7 @@ func (client AppsClient) RunTriggeredWebJobSlotPreparer(ctx context.Context, res "webJobName": autorest.Encode("path", webJobName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -27846,7 +27599,7 @@ func (client AppsClient) RunTriggeredWebJobSlotResponder(resp *http.Response) (r return } -// Start starts an app (or deployment slot, if specified). +// Start description for Starts an app (or deployment slot, if specified). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -27898,7 +27651,7 @@ func (client AppsClient) StartPreparer(ctx context.Context, resourceGroupName st "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -27930,7 +27683,7 @@ func (client AppsClient) StartResponder(resp *http.Response) (result autorest.Re return } -// StartContinuousWebJob start a continuous web job for an app, or a deployment slot. +// StartContinuousWebJob description for Start a continuous web job for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -27984,7 +27737,7 @@ func (client AppsClient) StartContinuousWebJobPreparer(ctx context.Context, reso "webJobName": autorest.Encode("path", webJobName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -28016,7 +27769,7 @@ func (client AppsClient) StartContinuousWebJobResponder(resp *http.Response) (re return } -// StartContinuousWebJobSlot start a continuous web job for an app, or a deployment slot. +// StartContinuousWebJobSlot description for Start a continuous web job for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -28073,7 +27826,7 @@ func (client AppsClient) StartContinuousWebJobSlotPreparer(ctx context.Context, "webJobName": autorest.Encode("path", webJobName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -28105,7 +27858,7 @@ func (client AppsClient) StartContinuousWebJobSlotResponder(resp *http.Response) return } -// StartNetworkTrace start capturing network packets for the site. +// StartNetworkTrace description for Start capturing network packets for the site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - the name of the web app. @@ -28154,7 +27907,7 @@ func (client AppsClient) StartNetworkTracePreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -28202,7 +27955,7 @@ func (client AppsClient) StartNetworkTraceResponder(resp *http.Response) (result return } -// StartNetworkTraceSlot start capturing network packets for the site. +// StartNetworkTraceSlot description for Start capturing network packets for the site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - the name of the web app. @@ -28253,7 +28006,7 @@ func (client AppsClient) StartNetworkTraceSlotPreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -28301,7 +28054,7 @@ func (client AppsClient) StartNetworkTraceSlotResponder(resp *http.Response) (re return } -// StartSlot starts an app (or deployment slot, if specified). +// StartSlot description for Starts an app (or deployment slot, if specified). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -28355,7 +28108,7 @@ func (client AppsClient) StartSlotPreparer(ctx context.Context, resourceGroupNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -28387,7 +28140,7 @@ func (client AppsClient) StartSlotResponder(resp *http.Response) (result autores return } -// StartWebSiteNetworkTrace start capturing network packets for the site (To be deprecated). +// StartWebSiteNetworkTrace description for Start capturing network packets for the site (To be deprecated). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - the name of the web app. @@ -28442,7 +28195,7 @@ func (client AppsClient) StartWebSiteNetworkTracePreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -28484,7 +28237,7 @@ func (client AppsClient) StartWebSiteNetworkTraceResponder(resp *http.Response) return } -// StartWebSiteNetworkTraceOperation start capturing network packets for the site. +// StartWebSiteNetworkTraceOperation description for Start capturing network packets for the site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - the name of the web app. @@ -28533,7 +28286,7 @@ func (client AppsClient) StartWebSiteNetworkTraceOperationPreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -28581,7 +28334,7 @@ func (client AppsClient) StartWebSiteNetworkTraceOperationResponder(resp *http.R return } -// StartWebSiteNetworkTraceOperationSlot start capturing network packets for the site. +// StartWebSiteNetworkTraceOperationSlot description for Start capturing network packets for the site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - the name of the web app. @@ -28632,7 +28385,7 @@ func (client AppsClient) StartWebSiteNetworkTraceOperationSlotPreparer(ctx conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -28680,7 +28433,7 @@ func (client AppsClient) StartWebSiteNetworkTraceOperationSlotResponder(resp *ht return } -// StartWebSiteNetworkTraceSlot start capturing network packets for the site (To be deprecated). +// StartWebSiteNetworkTraceSlot description for Start capturing network packets for the site (To be deprecated). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - the name of the web app. @@ -28737,7 +28490,7 @@ func (client AppsClient) StartWebSiteNetworkTraceSlotPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -28779,7 +28532,7 @@ func (client AppsClient) StartWebSiteNetworkTraceSlotResponder(resp *http.Respon return } -// Stop stops an app (or deployment slot, if specified). +// Stop description for Stops an app (or deployment slot, if specified). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -28831,7 +28584,7 @@ func (client AppsClient) StopPreparer(ctx context.Context, resourceGroupName str "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -28863,7 +28616,7 @@ func (client AppsClient) StopResponder(resp *http.Response) (result autorest.Res return } -// StopContinuousWebJob stop a continuous web job for an app, or a deployment slot. +// StopContinuousWebJob description for Stop a continuous web job for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -28917,7 +28670,7 @@ func (client AppsClient) StopContinuousWebJobPreparer(ctx context.Context, resou "webJobName": autorest.Encode("path", webJobName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -28949,7 +28702,7 @@ func (client AppsClient) StopContinuousWebJobResponder(resp *http.Response) (res return } -// StopContinuousWebJobSlot stop a continuous web job for an app, or a deployment slot. +// StopContinuousWebJobSlot description for Stop a continuous web job for an app, or a deployment slot. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site name. @@ -29006,7 +28759,7 @@ func (client AppsClient) StopContinuousWebJobSlotPreparer(ctx context.Context, r "webJobName": autorest.Encode("path", webJobName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -29038,7 +28791,7 @@ func (client AppsClient) StopContinuousWebJobSlotResponder(resp *http.Response) return } -// StopNetworkTrace stop ongoing capturing network packets for the site. +// StopNetworkTrace description for Stop ongoing capturing network packets for the site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - the name of the web app. @@ -29090,7 +28843,7 @@ func (client AppsClient) StopNetworkTracePreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -29122,7 +28875,7 @@ func (client AppsClient) StopNetworkTraceResponder(resp *http.Response) (result return } -// StopNetworkTraceSlot stop ongoing capturing network packets for the site. +// StopNetworkTraceSlot description for Stop ongoing capturing network packets for the site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - the name of the web app. @@ -29176,7 +28929,7 @@ func (client AppsClient) StopNetworkTraceSlotPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -29208,7 +28961,7 @@ func (client AppsClient) StopNetworkTraceSlotResponder(resp *http.Response) (res return } -// StopSlot stops an app (or deployment slot, if specified). +// StopSlot description for Stops an app (or deployment slot, if specified). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -29262,7 +29015,7 @@ func (client AppsClient) StopSlotPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -29294,7 +29047,7 @@ func (client AppsClient) StopSlotResponder(resp *http.Response) (result autorest return } -// StopWebSiteNetworkTrace stop ongoing capturing network packets for the site. +// StopWebSiteNetworkTrace description for Stop ongoing capturing network packets for the site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - the name of the web app. @@ -29346,7 +29099,7 @@ func (client AppsClient) StopWebSiteNetworkTracePreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -29378,7 +29131,7 @@ func (client AppsClient) StopWebSiteNetworkTraceResponder(resp *http.Response) ( return } -// StopWebSiteNetworkTraceSlot stop ongoing capturing network packets for the site. +// StopWebSiteNetworkTraceSlot description for Stop ongoing capturing network packets for the site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - the name of the web app. @@ -29432,7 +29185,7 @@ func (client AppsClient) StopWebSiteNetworkTraceSlotPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -29464,7 +29217,7 @@ func (client AppsClient) StopWebSiteNetworkTraceSlotResponder(resp *http.Respons return } -// SwapSlotSlot swaps two deployment slots of an app. +// SwapSlotSlot description for Swaps two deployment slots of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -29516,7 +29269,7 @@ func (client AppsClient) SwapSlotSlotPreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -29556,7 +29309,7 @@ func (client AppsClient) SwapSlotSlotResponder(resp *http.Response) (result auto return } -// SwapSlotWithProduction swaps two deployment slots of an app. +// SwapSlotWithProduction description for Swaps two deployment slots of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -29606,7 +29359,7 @@ func (client AppsClient) SwapSlotWithProductionPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -29646,7 +29399,7 @@ func (client AppsClient) SwapSlotWithProductionResponder(resp *http.Response) (r return } -// SyncFunctionTriggers syncs function trigger metadata to the scale controller +// SyncFunctionTriggers description for Syncs function trigger metadata to the scale controller // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -29698,7 +29451,7 @@ func (client AppsClient) SyncFunctionTriggersPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -29730,12 +29483,11 @@ func (client AppsClient) SyncFunctionTriggersResponder(resp *http.Response) (res return } -// SyncFunctionTriggersSlot syncs function trigger metadata to the scale controller +// SyncFunctionTriggersSlot description for Syncs function trigger metadata to the scale controller // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. -// slot - name of the deployment slot. If a slot is not specified, the API will restore a backup of the -// production slot. +// slot - name of the deployment slot. func (client AppsClient) SyncFunctionTriggersSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.SyncFunctionTriggersSlot") @@ -29785,7 +29537,7 @@ func (client AppsClient) SyncFunctionTriggersSlotPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -29817,7 +29569,7 @@ func (client AppsClient) SyncFunctionTriggersSlotResponder(resp *http.Response) return } -// SyncRepository sync web app repository. +// SyncRepository description for Sync web app repository. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of web app. @@ -29869,7 +29621,7 @@ func (client AppsClient) SyncRepositoryPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -29901,7 +29653,7 @@ func (client AppsClient) SyncRepositoryResponder(resp *http.Response) (result au return } -// SyncRepositorySlot sync web app repository. +// SyncRepositorySlot description for Sync web app repository. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of web app. @@ -29955,7 +29707,7 @@ func (client AppsClient) SyncRepositorySlotPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -29987,7 +29739,8 @@ func (client AppsClient) SyncRepositorySlotResponder(resp *http.Response) (resul return } -// Update creates a new web, mobile, or API app in an existing resource group, or updates an existing app. +// Update description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing +// app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - unique name of the app to create or update. To create or update a deployment slot, use the {slot} @@ -30041,7 +29794,7 @@ func (client AppsClient) UpdatePreparer(ctx context.Context, resourceGroupName s "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -30076,7 +29829,7 @@ func (client AppsClient) UpdateResponder(resp *http.Response) (result Site, err return } -// UpdateApplicationSettings replaces the application settings of an app. +// UpdateApplicationSettings description for Replaces the application settings of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -30129,7 +29882,7 @@ func (client AppsClient) UpdateApplicationSettingsPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -30164,7 +29917,7 @@ func (client AppsClient) UpdateApplicationSettingsResponder(resp *http.Response) return } -// UpdateApplicationSettingsSlot replaces the application settings of an app. +// UpdateApplicationSettingsSlot description for Replaces the application settings of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -30220,7 +29973,7 @@ func (client AppsClient) UpdateApplicationSettingsSlotPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -30255,7 +30008,7 @@ func (client AppsClient) UpdateApplicationSettingsSlotResponder(resp *http.Respo return } -// UpdateAuthSettings updates the Authentication / Authorization settings associated with web app. +// UpdateAuthSettings description for Updates the Authentication / Authorization settings associated with web app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of web app. @@ -30308,7 +30061,7 @@ func (client AppsClient) UpdateAuthSettingsPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -30343,7 +30096,7 @@ func (client AppsClient) UpdateAuthSettingsResponder(resp *http.Response) (resul return } -// UpdateAuthSettingsSlot updates the Authentication / Authorization settings associated with web app. +// UpdateAuthSettingsSlot description for Updates the Authentication / Authorization settings associated with web app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of web app. @@ -30398,7 +30151,7 @@ func (client AppsClient) UpdateAuthSettingsSlotPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -30433,7 +30186,7 @@ func (client AppsClient) UpdateAuthSettingsSlotResponder(resp *http.Response) (r return } -// UpdateAzureStorageAccounts updates the Azure storage account configurations of an app. +// UpdateAzureStorageAccounts description for Updates the Azure storage account configurations of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -30486,7 +30239,7 @@ func (client AppsClient) UpdateAzureStorageAccountsPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -30521,7 +30274,7 @@ func (client AppsClient) UpdateAzureStorageAccountsResponder(resp *http.Response return } -// UpdateAzureStorageAccountsSlot updates the Azure storage account configurations of an app. +// UpdateAzureStorageAccountsSlot description for Updates the Azure storage account configurations of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -30577,7 +30330,7 @@ func (client AppsClient) UpdateAzureStorageAccountsSlotPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -30612,7 +30365,7 @@ func (client AppsClient) UpdateAzureStorageAccountsSlotResponder(resp *http.Resp return } -// UpdateBackupConfiguration updates the backup configuration of an app. +// UpdateBackupConfiguration description for Updates the backup configuration of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -30674,7 +30427,7 @@ func (client AppsClient) UpdateBackupConfigurationPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -30709,7 +30462,7 @@ func (client AppsClient) UpdateBackupConfigurationResponder(resp *http.Response) return } -// UpdateBackupConfigurationSlot updates the backup configuration of an app. +// UpdateBackupConfigurationSlot description for Updates the backup configuration of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -30774,7 +30527,7 @@ func (client AppsClient) UpdateBackupConfigurationSlotPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -30809,7 +30562,7 @@ func (client AppsClient) UpdateBackupConfigurationSlotResponder(resp *http.Respo return } -// UpdateConfiguration updates the configuration of an app. +// UpdateConfiguration description for Updates the configuration of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -30862,7 +30615,7 @@ func (client AppsClient) UpdateConfigurationPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -30897,7 +30650,7 @@ func (client AppsClient) UpdateConfigurationResponder(resp *http.Response) (resu return } -// UpdateConfigurationSlot updates the configuration of an app. +// UpdateConfigurationSlot description for Updates the configuration of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -30953,7 +30706,7 @@ func (client AppsClient) UpdateConfigurationSlotPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -30988,7 +30741,7 @@ func (client AppsClient) UpdateConfigurationSlotResponder(resp *http.Response) ( return } -// UpdateConnectionStrings replaces the connection strings of an app. +// UpdateConnectionStrings description for Replaces the connection strings of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -31041,7 +30794,7 @@ func (client AppsClient) UpdateConnectionStringsPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -31076,7 +30829,7 @@ func (client AppsClient) UpdateConnectionStringsResponder(resp *http.Response) ( return } -// UpdateConnectionStringsSlot replaces the connection strings of an app. +// UpdateConnectionStringsSlot description for Replaces the connection strings of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -31132,7 +30885,7 @@ func (client AppsClient) UpdateConnectionStringsSlotPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -31167,7 +30920,7 @@ func (client AppsClient) UpdateConnectionStringsSlotResponder(resp *http.Respons return } -// UpdateDiagnosticLogsConfig updates the logging configuration of an app. +// UpdateDiagnosticLogsConfig description for Updates the logging configuration of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -31236,7 +30989,7 @@ func (client AppsClient) UpdateDiagnosticLogsConfigPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -31271,7 +31024,7 @@ func (client AppsClient) UpdateDiagnosticLogsConfigResponder(resp *http.Response return } -// UpdateDiagnosticLogsConfigSlot updates the logging configuration of an app. +// UpdateDiagnosticLogsConfigSlot description for Updates the logging configuration of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -31343,7 +31096,7 @@ func (client AppsClient) UpdateDiagnosticLogsConfigSlotPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -31378,8 +31131,8 @@ func (client AppsClient) UpdateDiagnosticLogsConfigSlotResponder(resp *http.Resp return } -// UpdateDomainOwnershipIdentifier creates a domain ownership identifier for web app, or updates an existing ownership -// identifier. +// UpdateDomainOwnershipIdentifier description for Creates a domain ownership identifier for web app, or updates an +// existing ownership identifier. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -31434,7 +31187,7 @@ func (client AppsClient) UpdateDomainOwnershipIdentifierPreparer(ctx context.Con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -31469,8 +31222,8 @@ func (client AppsClient) UpdateDomainOwnershipIdentifierResponder(resp *http.Res return } -// UpdateDomainOwnershipIdentifierSlot creates a domain ownership identifier for web app, or updates an existing -// ownership identifier. +// UpdateDomainOwnershipIdentifierSlot description for Creates a domain ownership identifier for web app, or updates an +// existing ownership identifier. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -31528,7 +31281,7 @@ func (client AppsClient) UpdateDomainOwnershipIdentifierSlotPreparer(ctx context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -31563,7 +31316,7 @@ func (client AppsClient) UpdateDomainOwnershipIdentifierSlotResponder(resp *http return } -// UpdateHybridConnection creates a new Hybrid Connection using a Service Bus relay. +// UpdateHybridConnection description for Creates a new Hybrid Connection using a Service Bus relay. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - the name of the web app. @@ -31620,7 +31373,7 @@ func (client AppsClient) UpdateHybridConnectionPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -31655,7 +31408,7 @@ func (client AppsClient) UpdateHybridConnectionResponder(resp *http.Response) (r return } -// UpdateHybridConnectionSlot creates a new Hybrid Connection using a Service Bus relay. +// UpdateHybridConnectionSlot description for Creates a new Hybrid Connection using a Service Bus relay. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - the name of the web app. @@ -31714,7 +31467,7 @@ func (client AppsClient) UpdateHybridConnectionSlotPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -31749,7 +31502,7 @@ func (client AppsClient) UpdateHybridConnectionSlotResponder(resp *http.Response return } -// UpdateMetadata replaces the metadata of an app. +// UpdateMetadata description for Replaces the metadata of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -31802,7 +31555,7 @@ func (client AppsClient) UpdateMetadataPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -31837,7 +31590,7 @@ func (client AppsClient) UpdateMetadataResponder(resp *http.Response) (result St return } -// UpdateMetadataSlot replaces the metadata of an app. +// UpdateMetadataSlot description for Replaces the metadata of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -31893,7 +31646,7 @@ func (client AppsClient) UpdateMetadataSlotPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -31928,7 +31681,7 @@ func (client AppsClient) UpdateMetadataSlotResponder(resp *http.Response) (resul return } -// UpdatePremierAddOn updates a named add-on of an app. +// UpdatePremierAddOn description for Updates a named add-on of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -31983,7 +31736,7 @@ func (client AppsClient) UpdatePremierAddOnPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -32018,7 +31771,7 @@ func (client AppsClient) UpdatePremierAddOnResponder(resp *http.Response) (resul return } -// UpdatePremierAddOnSlot updates a named add-on of an app. +// UpdatePremierAddOnSlot description for Updates a named add-on of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -32076,7 +31829,7 @@ func (client AppsClient) UpdatePremierAddOnSlotPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -32111,8 +31864,8 @@ func (client AppsClient) UpdatePremierAddOnSlotResponder(resp *http.Response) (r return } -// UpdateRelayServiceConnection creates a new hybrid connection configuration (PUT), or updates an existing one -// (PATCH). +// UpdateRelayServiceConnection description for Creates a new hybrid connection configuration (PUT), or updates an +// existing one (PATCH). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -32167,7 +31920,7 @@ func (client AppsClient) UpdateRelayServiceConnectionPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -32202,8 +31955,8 @@ func (client AppsClient) UpdateRelayServiceConnectionResponder(resp *http.Respon return } -// UpdateRelayServiceConnectionSlot creates a new hybrid connection configuration (PUT), or updates an existing one -// (PATCH). +// UpdateRelayServiceConnectionSlot description for Creates a new hybrid connection configuration (PUT), or updates an +// existing one (PATCH). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -32261,7 +32014,7 @@ func (client AppsClient) UpdateRelayServiceConnectionSlotPreparer(ctx context.Co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -32296,7 +32049,7 @@ func (client AppsClient) UpdateRelayServiceConnectionSlotResponder(resp *http.Re return } -// UpdateSitePushSettings updates the Push settings associated with web app. +// UpdateSitePushSettings description for Updates the Push settings associated with web app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of web app. @@ -32352,7 +32105,7 @@ func (client AppsClient) UpdateSitePushSettingsPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -32387,7 +32140,7 @@ func (client AppsClient) UpdateSitePushSettingsResponder(resp *http.Response) (r return } -// UpdateSitePushSettingsSlot updates the Push settings associated with web app. +// UpdateSitePushSettingsSlot description for Updates the Push settings associated with web app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of web app. @@ -32445,7 +32198,7 @@ func (client AppsClient) UpdateSitePushSettingsSlotPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -32480,7 +32233,8 @@ func (client AppsClient) UpdateSitePushSettingsSlotResponder(resp *http.Response return } -// UpdateSlot creates a new web, mobile, or API app in an existing resource group, or updates an existing app. +// UpdateSlot description for Creates a new web, mobile, or API app in an existing resource group, or updates an +// existing app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - unique name of the app to create or update. To create or update a deployment slot, use the {slot} @@ -32537,7 +32291,7 @@ func (client AppsClient) UpdateSlotPreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -32572,8 +32326,8 @@ func (client AppsClient) UpdateSlotResponder(resp *http.Response) (result Site, return } -// UpdateSlotConfigurationNames updates the names of application settings and connection string that remain with the -// slot during swap operation. +// UpdateSlotConfigurationNames description for Updates the names of application settings and connection string that +// remain with the slot during swap operation. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -32626,7 +32380,7 @@ func (client AppsClient) UpdateSlotConfigurationNamesPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -32661,7 +32415,7 @@ func (client AppsClient) UpdateSlotConfigurationNamesResponder(resp *http.Respon return } -// UpdateSourceControl updates the source control configuration of an app. +// UpdateSourceControl description for Updates the source control configuration of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -32714,7 +32468,7 @@ func (client AppsClient) UpdateSourceControlPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -32749,7 +32503,7 @@ func (client AppsClient) UpdateSourceControlResponder(resp *http.Response) (resu return } -// UpdateSourceControlSlot updates the source control configuration of an app. +// UpdateSourceControlSlot description for Updates the source control configuration of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -32805,7 +32559,7 @@ func (client AppsClient) UpdateSourceControlSlotPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -32840,9 +32594,9 @@ func (client AppsClient) UpdateSourceControlSlotResponder(resp *http.Response) ( return } -// UpdateSwiftVirtualNetworkConnection integrates this Web App with a Virtual Network. This requires that 1) -// "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet has already been -// delegated, and is not +// UpdateSwiftVirtualNetworkConnection description for Integrates this Web App with a Virtual Network. This requires +// that 1) "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet has already +// been delegated, and is not // in use by another App Service Plan other than the one this App is in. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. @@ -32896,7 +32650,7 @@ func (client AppsClient) UpdateSwiftVirtualNetworkConnectionPreparer(ctx context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -32931,9 +32685,9 @@ func (client AppsClient) UpdateSwiftVirtualNetworkConnectionResponder(resp *http return } -// UpdateSwiftVirtualNetworkConnectionSlot integrates this Web App with a Virtual Network. This requires that 1) -// "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet has already been -// delegated, and is not +// UpdateSwiftVirtualNetworkConnectionSlot description for Integrates this Web App with a Virtual Network. This +// requires that 1) "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet has +// already been delegated, and is not // in use by another App Service Plan other than the one this App is in. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. @@ -32990,7 +32744,7 @@ func (client AppsClient) UpdateSwiftVirtualNetworkConnectionSlotPreparer(ctx con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -33025,8 +32779,8 @@ func (client AppsClient) UpdateSwiftVirtualNetworkConnectionSlotResponder(resp * return } -// UpdateVnetConnection adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties -// (PATCH). +// UpdateVnetConnection description for Adds a Virtual Network connection to an app or slot (PUT) or updates the +// connection properties (PATCH). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -33081,7 +32835,7 @@ func (client AppsClient) UpdateVnetConnectionPreparer(ctx context.Context, resou "vnetName": autorest.Encode("path", vnetName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -33116,7 +32870,8 @@ func (client AppsClient) UpdateVnetConnectionResponder(resp *http.Response) (res return } -// UpdateVnetConnectionGateway adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). +// UpdateVnetConnectionGateway description for Adds a gateway to a connected Virtual Network (PUT) or updates it +// (PATCH). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -33173,7 +32928,7 @@ func (client AppsClient) UpdateVnetConnectionGatewayPreparer(ctx context.Context "vnetName": autorest.Encode("path", vnetName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -33208,7 +32963,8 @@ func (client AppsClient) UpdateVnetConnectionGatewayResponder(resp *http.Respons return } -// UpdateVnetConnectionGatewaySlot adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). +// UpdateVnetConnectionGatewaySlot description for Adds a gateway to a connected Virtual Network (PUT) or updates it +// (PATCH). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -33268,7 +33024,7 @@ func (client AppsClient) UpdateVnetConnectionGatewaySlotPreparer(ctx context.Con "vnetName": autorest.Encode("path", vnetName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -33303,8 +33059,8 @@ func (client AppsClient) UpdateVnetConnectionGatewaySlotResponder(resp *http.Res return } -// UpdateVnetConnectionSlot adds a Virtual Network connection to an app or slot (PUT) or updates the connection -// properties (PATCH). +// UpdateVnetConnectionSlot description for Adds a Virtual Network connection to an app or slot (PUT) or updates the +// connection properties (PATCH). // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the app. @@ -33362,7 +33118,7 @@ func (client AppsClient) UpdateVnetConnectionSlotPreparer(ctx context.Context, r "vnetName": autorest.Encode("path", vnetName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/web/mgmt/2019-08-01/web/appservicecertificateorders.go b/services/web/mgmt/2019-08-01/web/appservicecertificateorders.go index 59cb8291e90d..1c93771c1c02 100644 --- a/services/web/mgmt/2019-08-01/web/appservicecertificateorders.go +++ b/services/web/mgmt/2019-08-01/web/appservicecertificateorders.go @@ -41,7 +41,7 @@ func NewAppServiceCertificateOrdersClientWithBaseURI(baseURI string, subscriptio return AppServiceCertificateOrdersClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate create or update a certificate purchase order. +// CreateOrUpdate description for Create or update a certificate purchase order. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // certificateOrderName - name of the certificate order. @@ -95,7 +95,7 @@ func (client AppServiceCertificateOrdersClient) CreateOrUpdatePreparer(ctx conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -136,7 +136,7 @@ func (client AppServiceCertificateOrdersClient) CreateOrUpdateResponder(resp *ht return } -// CreateOrUpdateCertificate creates or updates a certificate and associates with key vault secret. +// CreateOrUpdateCertificate description for Creates or updates a certificate and associates with key vault secret. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // certificateOrderName - name of the certificate order. @@ -185,7 +185,7 @@ func (client AppServiceCertificateOrdersClient) CreateOrUpdateCertificatePrepare "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -226,7 +226,7 @@ func (client AppServiceCertificateOrdersClient) CreateOrUpdateCertificateRespond return } -// Delete delete an existing certificate order. +// Delete description for Delete an existing certificate order. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // certificateOrderName - name of the certificate order. @@ -278,7 +278,7 @@ func (client AppServiceCertificateOrdersClient) DeletePreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -310,7 +310,7 @@ func (client AppServiceCertificateOrdersClient) DeleteResponder(resp *http.Respo return } -// DeleteCertificate delete the certificate associated with a certificate order. +// DeleteCertificate description for Delete the certificate associated with a certificate order. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // certificateOrderName - name of the certificate order. @@ -364,7 +364,7 @@ func (client AppServiceCertificateOrdersClient) DeleteCertificatePreparer(ctx co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -396,7 +396,7 @@ func (client AppServiceCertificateOrdersClient) DeleteCertificateResponder(resp return } -// Get get a certificate order. +// Get description for Get a certificate order. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // certificateOrderName - name of the certificate order.. @@ -448,7 +448,7 @@ func (client AppServiceCertificateOrdersClient) GetPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -481,7 +481,7 @@ func (client AppServiceCertificateOrdersClient) GetResponder(resp *http.Response return } -// GetCertificate get the certificate associated with a certificate order. +// GetCertificate description for Get the certificate associated with a certificate order. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // certificateOrderName - name of the certificate order. @@ -535,7 +535,7 @@ func (client AppServiceCertificateOrdersClient) GetCertificatePreparer(ctx conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -568,7 +568,7 @@ func (client AppServiceCertificateOrdersClient) GetCertificateResponder(resp *ht return } -// List list all certificate orders in a subscription. +// List description for List all certificate orders in a subscription. func (client AppServiceCertificateOrdersClient) List(ctx context.Context) (result AppServiceCertificateOrderCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceCertificateOrdersClient.List") @@ -608,7 +608,7 @@ func (client AppServiceCertificateOrdersClient) ListPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -678,7 +678,7 @@ func (client AppServiceCertificateOrdersClient) ListComplete(ctx context.Context return } -// ListByResourceGroup get certificate orders in a resource group. +// ListByResourceGroup description for Get certificate orders in a resource group. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. func (client AppServiceCertificateOrdersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result AppServiceCertificateOrderCollectionPage, err error) { @@ -729,7 +729,7 @@ func (client AppServiceCertificateOrdersClient) ListByResourceGroupPreparer(ctx "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -799,7 +799,7 @@ func (client AppServiceCertificateOrdersClient) ListByResourceGroupComplete(ctx return } -// ListCertificates list all certificates associated with a certificate order. +// ListCertificates description for List all certificates associated with a certificate order. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // certificateOrderName - name of the certificate order. @@ -852,7 +852,7 @@ func (client AppServiceCertificateOrdersClient) ListCertificatesPreparer(ctx con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -922,7 +922,7 @@ func (client AppServiceCertificateOrdersClient) ListCertificatesComplete(ctx con return } -// Reissue reissue an existing certificate order. +// Reissue description for Reissue an existing certificate order. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // certificateOrderName - name of the certificate order. @@ -975,7 +975,7 @@ func (client AppServiceCertificateOrdersClient) ReissuePreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1009,7 +1009,7 @@ func (client AppServiceCertificateOrdersClient) ReissueResponder(resp *http.Resp return } -// Renew renew an existing certificate order. +// Renew description for Renew an existing certificate order. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // certificateOrderName - name of the certificate order. @@ -1062,7 +1062,7 @@ func (client AppServiceCertificateOrdersClient) RenewPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1096,7 +1096,7 @@ func (client AppServiceCertificateOrdersClient) RenewResponder(resp *http.Respon return } -// ResendEmail resend certificate email. +// ResendEmail description for Resend certificate email. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // certificateOrderName - name of the certificate order. @@ -1148,7 +1148,7 @@ func (client AppServiceCertificateOrdersClient) ResendEmailPreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1180,7 +1180,7 @@ func (client AppServiceCertificateOrdersClient) ResendEmailResponder(resp *http. return } -// ResendRequestEmails verify domain ownership for this certificate order. +// ResendRequestEmails description for Verify domain ownership for this certificate order. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // certificateOrderName - name of the certificate order. @@ -1233,7 +1233,7 @@ func (client AppServiceCertificateOrdersClient) ResendRequestEmailsPreparer(ctx "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1267,7 +1267,7 @@ func (client AppServiceCertificateOrdersClient) ResendRequestEmailsResponder(res return } -// RetrieveCertificateActions retrieve the list of certificate actions. +// RetrieveCertificateActions description for Retrieve the list of certificate actions. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the certificate order. @@ -1319,7 +1319,7 @@ func (client AppServiceCertificateOrdersClient) RetrieveCertificateActionsPrepar "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1352,7 +1352,7 @@ func (client AppServiceCertificateOrdersClient) RetrieveCertificateActionsRespon return } -// RetrieveCertificateEmailHistory retrieve email history. +// RetrieveCertificateEmailHistory description for Retrieve email history. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the certificate order. @@ -1404,7 +1404,7 @@ func (client AppServiceCertificateOrdersClient) RetrieveCertificateEmailHistoryP "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1437,7 +1437,7 @@ func (client AppServiceCertificateOrdersClient) RetrieveCertificateEmailHistoryR return } -// RetrieveSiteSeal verify domain ownership for this certificate order. +// RetrieveSiteSeal description for Verify domain ownership for this certificate order. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // certificateOrderName - name of the certificate order. @@ -1490,7 +1490,7 @@ func (client AppServiceCertificateOrdersClient) RetrieveSiteSealPreparer(ctx con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1525,7 +1525,7 @@ func (client AppServiceCertificateOrdersClient) RetrieveSiteSealResponder(resp * return } -// Update create or update a certificate purchase order. +// Update description for Create or update a certificate purchase order. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // certificateOrderName - name of the certificate order. @@ -1578,7 +1578,7 @@ func (client AppServiceCertificateOrdersClient) UpdatePreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1613,7 +1613,7 @@ func (client AppServiceCertificateOrdersClient) UpdateResponder(resp *http.Respo return } -// UpdateCertificate creates or updates a certificate and associates with key vault secret. +// UpdateCertificate description for Creates or updates a certificate and associates with key vault secret. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // certificateOrderName - name of the certificate order. @@ -1668,7 +1668,7 @@ func (client AppServiceCertificateOrdersClient) UpdateCertificatePreparer(ctx co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1703,7 +1703,7 @@ func (client AppServiceCertificateOrdersClient) UpdateCertificateResponder(resp return } -// ValidatePurchaseInformation validate information for a certificate order. +// ValidatePurchaseInformation description for Validate information for a certificate order. // Parameters: // appServiceCertificateOrder - information for a certificate order. func (client AppServiceCertificateOrdersClient) ValidatePurchaseInformation(ctx context.Context, appServiceCertificateOrder AppServiceCertificateOrder) (result autorest.Response, err error) { @@ -1755,7 +1755,7 @@ func (client AppServiceCertificateOrdersClient) ValidatePurchaseInformationPrepa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1789,7 +1789,7 @@ func (client AppServiceCertificateOrdersClient) ValidatePurchaseInformationRespo return } -// VerifyDomainOwnership verify domain ownership for this certificate order. +// VerifyDomainOwnership description for Verify domain ownership for this certificate order. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // certificateOrderName - name of the certificate order. @@ -1841,7 +1841,7 @@ func (client AppServiceCertificateOrdersClient) VerifyDomainOwnershipPreparer(ct "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/web/mgmt/2019-08-01/web/appserviceenvironments.go b/services/web/mgmt/2019-08-01/web/appserviceenvironments.go index e8f8bafdb05c..39ee38393b90 100644 --- a/services/web/mgmt/2019-08-01/web/appserviceenvironments.go +++ b/services/web/mgmt/2019-08-01/web/appserviceenvironments.go @@ -41,7 +41,7 @@ func NewAppServiceEnvironmentsClientWithBaseURI(baseURI string, subscriptionID s return AppServiceEnvironmentsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// ChangeVnet move an App Service Environment to a different VNET. +// ChangeVnet description for Move an App Service Environment to a different VNET. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service Environment. @@ -88,7 +88,7 @@ func (client AppServiceEnvironmentsClient) ChangeVnetPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -173,7 +173,7 @@ func (client AppServiceEnvironmentsClient) ChangeVnetComplete(ctx context.Contex return } -// CreateOrUpdate create or update an App Service Environment. +// CreateOrUpdate description for Create or update an App Service Environment. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service Environment. @@ -227,7 +227,7 @@ func (client AppServiceEnvironmentsClient) CreateOrUpdatePreparer(ctx context.Co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -261,14 +261,14 @@ func (client AppServiceEnvironmentsClient) CreateOrUpdateResponder(resp *http.Re err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusBadRequest, http.StatusNotFound, http.StatusConflict), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// CreateOrUpdateMultiRolePool create or update a multi-role pool. +// CreateOrUpdateMultiRolePool description for Create or update a multi-role pool. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service Environment. @@ -315,7 +315,7 @@ func (client AppServiceEnvironmentsClient) CreateOrUpdateMultiRolePoolPreparer(c "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -349,14 +349,14 @@ func (client AppServiceEnvironmentsClient) CreateOrUpdateMultiRolePoolResponder( err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusBadRequest, http.StatusNotFound, http.StatusConflict), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// CreateOrUpdateWorkerPool create or update a worker pool. +// CreateOrUpdateWorkerPool description for Create or update a worker pool. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service Environment. @@ -405,7 +405,7 @@ func (client AppServiceEnvironmentsClient) CreateOrUpdateWorkerPoolPreparer(ctx "workerPoolName": autorest.Encode("path", workerPoolName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -439,14 +439,14 @@ func (client AppServiceEnvironmentsClient) CreateOrUpdateWorkerPoolResponder(res err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusBadRequest, http.StatusNotFound, http.StatusConflict), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// Delete delete an App Service Environment. +// Delete description for Delete an App Service Environment. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service Environment. @@ -494,7 +494,7 @@ func (client AppServiceEnvironmentsClient) DeletePreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -529,13 +529,13 @@ func (client AppServiceEnvironmentsClient) DeleteResponder(resp *http.Response) err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent, http.StatusBadRequest, http.StatusNotFound, http.StatusConflict), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp return } -// Get get the properties of an App Service Environment. +// Get description for Get the properties of an App Service Environment. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service Environment. @@ -587,7 +587,7 @@ func (client AppServiceEnvironmentsClient) GetPreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -620,7 +620,7 @@ func (client AppServiceEnvironmentsClient) GetResponder(resp *http.Response) (re return } -// GetDiagnosticsItem get a diagnostics item for an App Service Environment. +// GetDiagnosticsItem description for Get a diagnostics item for an App Service Environment. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service Environment. @@ -674,7 +674,7 @@ func (client AppServiceEnvironmentsClient) GetDiagnosticsItemPreparer(ctx contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -707,8 +707,8 @@ func (client AppServiceEnvironmentsClient) GetDiagnosticsItemResponder(resp *htt return } -// GetInboundNetworkDependenciesEndpoints get the network endpoints of all inbound dependencies of an App Service -// Environment. +// GetInboundNetworkDependenciesEndpoints description for Get the network endpoints of all inbound dependencies of an +// App Service Environment. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service Environment. @@ -761,7 +761,7 @@ func (client AppServiceEnvironmentsClient) GetInboundNetworkDependenciesEndpoint "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -831,7 +831,7 @@ func (client AppServiceEnvironmentsClient) GetInboundNetworkDependenciesEndpoint return } -// GetMultiRolePool get properties of a multi-role pool. +// GetMultiRolePool description for Get properties of a multi-role pool. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service Environment. @@ -883,7 +883,7 @@ func (client AppServiceEnvironmentsClient) GetMultiRolePoolPreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -916,8 +916,8 @@ func (client AppServiceEnvironmentsClient) GetMultiRolePoolResponder(resp *http. return } -// GetOutboundNetworkDependenciesEndpoints get the network endpoints of all outbound dependencies of an App Service -// Environment. +// GetOutboundNetworkDependenciesEndpoints description for Get the network endpoints of all outbound dependencies of an +// App Service Environment. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service Environment. @@ -970,7 +970,7 @@ func (client AppServiceEnvironmentsClient) GetOutboundNetworkDependenciesEndpoin "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1040,7 +1040,92 @@ func (client AppServiceEnvironmentsClient) GetOutboundNetworkDependenciesEndpoin return } -// GetWorkerPool get properties of a worker pool. +// GetVipInfo description for Get IP addresses assigned to an App Service Environment. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service Environment. +func (client AppServiceEnvironmentsClient) GetVipInfo(ctx context.Context, resourceGroupName string, name string) (result AddressResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.GetVipInfo") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "GetVipInfo", err.Error()) + } + + req, err := client.GetVipInfoPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetVipInfo", nil, "Failure preparing request") + return + } + + resp, err := client.GetVipInfoSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetVipInfo", resp, "Failure sending request") + return + } + + result, err = client.GetVipInfoResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetVipInfo", resp, "Failure responding to request") + } + + return +} + +// GetVipInfoPreparer prepares the GetVipInfo request. +func (client AppServiceEnvironmentsClient) GetVipInfoPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/capacities/virtualip", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetVipInfoSender sends the GetVipInfo request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) GetVipInfoSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetVipInfoResponder handles the response to the GetVipInfo request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) GetVipInfoResponder(resp *http.Response) (result AddressResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetWorkerPool description for Get properties of a worker pool. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service Environment. @@ -1094,7 +1179,7 @@ func (client AppServiceEnvironmentsClient) GetWorkerPoolPreparer(ctx context.Con "workerPoolName": autorest.Encode("path", workerPoolName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1127,7 +1212,7 @@ func (client AppServiceEnvironmentsClient) GetWorkerPoolResponder(resp *http.Res return } -// List get all App Service Environments for a subscription. +// List description for Get all App Service Environments for a subscription. func (client AppServiceEnvironmentsClient) List(ctx context.Context) (result AppServiceEnvironmentCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.List") @@ -1167,7 +1252,7 @@ func (client AppServiceEnvironmentsClient) ListPreparer(ctx context.Context) (*h "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1237,7 +1322,7 @@ func (client AppServiceEnvironmentsClient) ListComplete(ctx context.Context) (re return } -// ListAppServicePlans get all App Service plans in an App Service Environment. +// ListAppServicePlans description for Get all App Service plans in an App Service Environment. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service Environment. @@ -1290,7 +1375,7 @@ func (client AppServiceEnvironmentsClient) ListAppServicePlansPreparer(ctx conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1360,7 +1445,7 @@ func (client AppServiceEnvironmentsClient) ListAppServicePlansComplete(ctx conte return } -// ListByResourceGroup get all App Service Environments in a resource group. +// ListByResourceGroup description for Get all App Service Environments in a resource group. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. func (client AppServiceEnvironmentsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result AppServiceEnvironmentCollectionPage, err error) { @@ -1411,7 +1496,7 @@ func (client AppServiceEnvironmentsClient) ListByResourceGroupPreparer(ctx conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1481,7 +1566,7 @@ func (client AppServiceEnvironmentsClient) ListByResourceGroupComplete(ctx conte return } -// ListCapacities get the used, available, and total worker capacity an App Service Environment. +// ListCapacities description for Get the used, available, and total worker capacity an App Service Environment. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service Environment. @@ -1534,7 +1619,7 @@ func (client AppServiceEnvironmentsClient) ListCapacitiesPreparer(ctx context.Co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1604,7 +1689,7 @@ func (client AppServiceEnvironmentsClient) ListCapacitiesComplete(ctx context.Co return } -// ListDiagnostics get diagnostic information for an App Service Environment. +// ListDiagnostics description for Get diagnostic information for an App Service Environment. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service Environment. @@ -1656,7 +1741,7 @@ func (client AppServiceEnvironmentsClient) ListDiagnosticsPreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1689,17 +1774,18 @@ func (client AppServiceEnvironmentsClient) ListDiagnosticsResponder(resp *http.R return } -// ListMetricDefinitions get global metric definitions of an App Service Environment. +// ListMultiRoleMetricDefinitions description for Get metric definitions for a multi-role pool of an App Service +// Environment. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service Environment. -func (client AppServiceEnvironmentsClient) ListMetricDefinitions(ctx context.Context, resourceGroupName string, name string) (result MetricDefinition, err error) { +func (client AppServiceEnvironmentsClient) ListMultiRoleMetricDefinitions(ctx context.Context, resourceGroupName string, name string) (result ResourceMetricDefinitionCollectionPage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListMetricDefinitions") + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListMultiRoleMetricDefinitions") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.rmdc.Response.Response != nil { + sc = result.rmdc.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1709,39 +1795,40 @@ func (client AppServiceEnvironmentsClient) ListMetricDefinitions(ctx context.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("web.AppServiceEnvironmentsClient", "ListMetricDefinitions", err.Error()) + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListMultiRoleMetricDefinitions", err.Error()) } - req, err := client.ListMetricDefinitionsPreparer(ctx, resourceGroupName, name) + result.fn = client.listMultiRoleMetricDefinitionsNextResults + req, err := client.ListMultiRoleMetricDefinitionsPreparer(ctx, resourceGroupName, name) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMetricDefinitions", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRoleMetricDefinitions", nil, "Failure preparing request") return } - resp, err := client.ListMetricDefinitionsSender(req) + resp, err := client.ListMultiRoleMetricDefinitionsSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMetricDefinitions", resp, "Failure sending request") + result.rmdc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRoleMetricDefinitions", resp, "Failure sending request") return } - result, err = client.ListMetricDefinitionsResponder(resp) + result.rmdc, err = client.ListMultiRoleMetricDefinitionsResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMetricDefinitions", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRoleMetricDefinitions", resp, "Failure responding to request") } return } -// ListMetricDefinitionsPreparer prepares the ListMetricDefinitions request. -func (client AppServiceEnvironmentsClient) ListMetricDefinitionsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { +// ListMultiRoleMetricDefinitionsPreparer prepares the ListMultiRoleMetricDefinitions request. +func (client AppServiceEnvironmentsClient) ListMultiRoleMetricDefinitionsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1749,21 +1836,21 @@ func (client AppServiceEnvironmentsClient) ListMetricDefinitionsPreparer(ctx con preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/metricdefinitions", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/metricdefinitions", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListMetricDefinitionsSender sends the ListMetricDefinitions request. The method will close the +// ListMultiRoleMetricDefinitionsSender sends the ListMultiRoleMetricDefinitions request. The method will close the // http.Response Body if it receives an error. -func (client AppServiceEnvironmentsClient) ListMetricDefinitionsSender(req *http.Request) (*http.Response, error) { +func (client AppServiceEnvironmentsClient) ListMultiRoleMetricDefinitionsSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// ListMetricDefinitionsResponder handles the response to the ListMetricDefinitions request. The method always +// ListMultiRoleMetricDefinitionsResponder handles the response to the ListMultiRoleMetricDefinitions request. The method always // closes the http.Response Body. -func (client AppServiceEnvironmentsClient) ListMetricDefinitionsResponder(resp *http.Response) (result MetricDefinition, err error) { +func (client AppServiceEnvironmentsClient) ListMultiRoleMetricDefinitionsResponder(resp *http.Response) (result ResourceMetricDefinitionCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -1774,21 +1861,56 @@ func (client AppServiceEnvironmentsClient) ListMetricDefinitionsResponder(resp * return } -// ListMetrics get global metrics of an App Service Environment. +// listMultiRoleMetricDefinitionsNextResults retrieves the next set of results, if any. +func (client AppServiceEnvironmentsClient) listMultiRoleMetricDefinitionsNextResults(ctx context.Context, lastResults ResourceMetricDefinitionCollection) (result ResourceMetricDefinitionCollection, err error) { + req, err := lastResults.resourceMetricDefinitionCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listMultiRoleMetricDefinitionsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListMultiRoleMetricDefinitionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listMultiRoleMetricDefinitionsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListMultiRoleMetricDefinitionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listMultiRoleMetricDefinitionsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListMultiRoleMetricDefinitionsComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppServiceEnvironmentsClient) ListMultiRoleMetricDefinitionsComplete(ctx context.Context, resourceGroupName string, name string) (result ResourceMetricDefinitionCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListMultiRoleMetricDefinitions") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListMultiRoleMetricDefinitions(ctx, resourceGroupName, name) + return +} + +// ListMultiRolePoolInstanceMetricDefinitions description for Get metric definitions for a specific instance of a +// multi-role pool of an App Service Environment. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service Environment. -// details - specify true to include instance details. The default is false. -// filter - return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: -// $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and -// endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. -func (client AppServiceEnvironmentsClient) ListMetrics(ctx context.Context, resourceGroupName string, name string, details *bool, filter string) (result ResourceMetricCollectionPage, err error) { +// instance - name of the instance in the multi-role pool. +func (client AppServiceEnvironmentsClient) ListMultiRolePoolInstanceMetricDefinitions(ctx context.Context, resourceGroupName string, name string, instance string) (result ResourceMetricDefinitionCollectionPage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListMetrics") + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListMultiRolePoolInstanceMetricDefinitions") defer func() { sc := -1 - if result.rmc.Response.Response != nil { - sc = result.rmc.Response.Response.StatusCode + if result.rmdc.Response.Response != nil { + sc = result.rmdc.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1798,68 +1920,63 @@ func (client AppServiceEnvironmentsClient) ListMetrics(ctx context.Context, reso Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListMetrics", err.Error()) + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListMultiRolePoolInstanceMetricDefinitions", err.Error()) } - result.fn = client.listMetricsNextResults - req, err := client.ListMetricsPreparer(ctx, resourceGroupName, name, details, filter) + result.fn = client.listMultiRolePoolInstanceMetricDefinitionsNextResults + req, err := client.ListMultiRolePoolInstanceMetricDefinitionsPreparer(ctx, resourceGroupName, name, instance) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMetrics", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRolePoolInstanceMetricDefinitions", nil, "Failure preparing request") return } - resp, err := client.ListMetricsSender(req) + resp, err := client.ListMultiRolePoolInstanceMetricDefinitionsSender(req) if err != nil { - result.rmc.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMetrics", resp, "Failure sending request") + result.rmdc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRolePoolInstanceMetricDefinitions", resp, "Failure sending request") return } - result.rmc, err = client.ListMetricsResponder(resp) + result.rmdc, err = client.ListMultiRolePoolInstanceMetricDefinitionsResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMetrics", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRolePoolInstanceMetricDefinitions", resp, "Failure responding to request") } return } -// ListMetricsPreparer prepares the ListMetrics request. -func (client AppServiceEnvironmentsClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, name string, details *bool, filter string) (*http.Request, error) { +// ListMultiRolePoolInstanceMetricDefinitionsPreparer prepares the ListMultiRolePoolInstanceMetricDefinitions request. +func (client AppServiceEnvironmentsClient) ListMultiRolePoolInstanceMetricDefinitionsPreparer(ctx context.Context, resourceGroupName string, name string, instance string) (*http.Request, error) { pathParameters := map[string]interface{}{ + "instance": autorest.Encode("path", instance), "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } - if details != nil { - queryParameters["details"] = autorest.Encode("query", *details) - } - if len(filter) > 0 { - queryParameters["$filter"] = filter - } preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/metrics", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/instances/{instance}/metricdefinitions", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListMetricsSender sends the ListMetrics request. The method will close the +// ListMultiRolePoolInstanceMetricDefinitionsSender sends the ListMultiRolePoolInstanceMetricDefinitions request. The method will close the // http.Response Body if it receives an error. -func (client AppServiceEnvironmentsClient) ListMetricsSender(req *http.Request) (*http.Response, error) { +func (client AppServiceEnvironmentsClient) ListMultiRolePoolInstanceMetricDefinitionsSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// ListMetricsResponder handles the response to the ListMetrics request. The method always +// ListMultiRolePoolInstanceMetricDefinitionsResponder handles the response to the ListMultiRolePoolInstanceMetricDefinitions request. The method always // closes the http.Response Body. -func (client AppServiceEnvironmentsClient) ListMetricsResponder(resp *http.Response) (result ResourceMetricCollection, err error) { +func (client AppServiceEnvironmentsClient) ListMultiRolePoolInstanceMetricDefinitionsResponder(resp *http.Response) (result ResourceMetricDefinitionCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -1870,31 +1987,31 @@ func (client AppServiceEnvironmentsClient) ListMetricsResponder(resp *http.Respo return } -// listMetricsNextResults retrieves the next set of results, if any. -func (client AppServiceEnvironmentsClient) listMetricsNextResults(ctx context.Context, lastResults ResourceMetricCollection) (result ResourceMetricCollection, err error) { - req, err := lastResults.resourceMetricCollectionPreparer(ctx) +// listMultiRolePoolInstanceMetricDefinitionsNextResults retrieves the next set of results, if any. +func (client AppServiceEnvironmentsClient) listMultiRolePoolInstanceMetricDefinitionsNextResults(ctx context.Context, lastResults ResourceMetricDefinitionCollection) (result ResourceMetricDefinitionCollection, err error) { + req, err := lastResults.resourceMetricDefinitionCollectionPreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listMetricsNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listMultiRolePoolInstanceMetricDefinitionsNextResults", nil, "Failure preparing next results request") } if req == nil { return } - resp, err := client.ListMetricsSender(req) + resp, err := client.ListMultiRolePoolInstanceMetricDefinitionsSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listMetricsNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listMultiRolePoolInstanceMetricDefinitionsNextResults", resp, "Failure sending next results request") } - result, err = client.ListMetricsResponder(resp) + result, err = client.ListMultiRolePoolInstanceMetricDefinitionsResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listMetricsNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listMultiRolePoolInstanceMetricDefinitionsNextResults", resp, "Failure responding to next results request") } return } -// ListMetricsComplete enumerates all values, automatically crossing page boundaries as required. -func (client AppServiceEnvironmentsClient) ListMetricsComplete(ctx context.Context, resourceGroupName string, name string, details *bool, filter string) (result ResourceMetricCollectionIterator, err error) { +// ListMultiRolePoolInstanceMetricDefinitionsComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppServiceEnvironmentsClient) ListMultiRolePoolInstanceMetricDefinitionsComplete(ctx context.Context, resourceGroupName string, name string, instance string) (result ResourceMetricDefinitionCollectionIterator, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListMetrics") + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListMultiRolePoolInstanceMetricDefinitions") defer func() { sc := -1 if result.Response().Response.Response != nil { @@ -1903,21 +2020,21 @@ func (client AppServiceEnvironmentsClient) ListMetricsComplete(ctx context.Conte tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListMetrics(ctx, resourceGroupName, name, details, filter) + result.page, err = client.ListMultiRolePoolInstanceMetricDefinitions(ctx, resourceGroupName, name, instance) return } -// ListMultiRoleMetricDefinitions get metric definitions for a multi-role pool of an App Service Environment. +// ListMultiRolePools description for Get all multi-role pools. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service Environment. -func (client AppServiceEnvironmentsClient) ListMultiRoleMetricDefinitions(ctx context.Context, resourceGroupName string, name string) (result ResourceMetricDefinitionCollectionPage, err error) { +func (client AppServiceEnvironmentsClient) ListMultiRolePools(ctx context.Context, resourceGroupName string, name string) (result WorkerPoolCollectionPage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListMultiRoleMetricDefinitions") + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListMultiRolePools") defer func() { sc := -1 - if result.rmdc.Response.Response != nil { - sc = result.rmdc.Response.Response.StatusCode + if result.wpc.Response.Response != nil { + sc = result.wpc.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1927,40 +2044,40 @@ func (client AppServiceEnvironmentsClient) ListMultiRoleMetricDefinitions(ctx co Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListMultiRoleMetricDefinitions", err.Error()) + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListMultiRolePools", err.Error()) } - result.fn = client.listMultiRoleMetricDefinitionsNextResults - req, err := client.ListMultiRoleMetricDefinitionsPreparer(ctx, resourceGroupName, name) + result.fn = client.listMultiRolePoolsNextResults + req, err := client.ListMultiRolePoolsPreparer(ctx, resourceGroupName, name) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRoleMetricDefinitions", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRolePools", nil, "Failure preparing request") return } - resp, err := client.ListMultiRoleMetricDefinitionsSender(req) + resp, err := client.ListMultiRolePoolsSender(req) if err != nil { - result.rmdc.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRoleMetricDefinitions", resp, "Failure sending request") + result.wpc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRolePools", resp, "Failure sending request") return } - result.rmdc, err = client.ListMultiRoleMetricDefinitionsResponder(resp) + result.wpc, err = client.ListMultiRolePoolsResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRoleMetricDefinitions", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRolePools", resp, "Failure responding to request") } return } -// ListMultiRoleMetricDefinitionsPreparer prepares the ListMultiRoleMetricDefinitions request. -func (client AppServiceEnvironmentsClient) ListMultiRoleMetricDefinitionsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { +// ListMultiRolePoolsPreparer prepares the ListMultiRolePools request. +func (client AppServiceEnvironmentsClient) ListMultiRolePoolsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1968,21 +2085,21 @@ func (client AppServiceEnvironmentsClient) ListMultiRoleMetricDefinitionsPrepare preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/metricdefinitions", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListMultiRoleMetricDefinitionsSender sends the ListMultiRoleMetricDefinitions request. The method will close the +// ListMultiRolePoolsSender sends the ListMultiRolePools request. The method will close the // http.Response Body if it receives an error. -func (client AppServiceEnvironmentsClient) ListMultiRoleMetricDefinitionsSender(req *http.Request) (*http.Response, error) { +func (client AppServiceEnvironmentsClient) ListMultiRolePoolsSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// ListMultiRoleMetricDefinitionsResponder handles the response to the ListMultiRoleMetricDefinitions request. The method always +// ListMultiRolePoolsResponder handles the response to the ListMultiRolePools request. The method always // closes the http.Response Body. -func (client AppServiceEnvironmentsClient) ListMultiRoleMetricDefinitionsResponder(resp *http.Response) (result ResourceMetricDefinitionCollection, err error) { +func (client AppServiceEnvironmentsClient) ListMultiRolePoolsResponder(resp *http.Response) (result WorkerPoolCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -1993,31 +2110,31 @@ func (client AppServiceEnvironmentsClient) ListMultiRoleMetricDefinitionsRespond return } -// listMultiRoleMetricDefinitionsNextResults retrieves the next set of results, if any. -func (client AppServiceEnvironmentsClient) listMultiRoleMetricDefinitionsNextResults(ctx context.Context, lastResults ResourceMetricDefinitionCollection) (result ResourceMetricDefinitionCollection, err error) { - req, err := lastResults.resourceMetricDefinitionCollectionPreparer(ctx) +// listMultiRolePoolsNextResults retrieves the next set of results, if any. +func (client AppServiceEnvironmentsClient) listMultiRolePoolsNextResults(ctx context.Context, lastResults WorkerPoolCollection) (result WorkerPoolCollection, err error) { + req, err := lastResults.workerPoolCollectionPreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listMultiRoleMetricDefinitionsNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listMultiRolePoolsNextResults", nil, "Failure preparing next results request") } if req == nil { return } - resp, err := client.ListMultiRoleMetricDefinitionsSender(req) + resp, err := client.ListMultiRolePoolsSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listMultiRoleMetricDefinitionsNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listMultiRolePoolsNextResults", resp, "Failure sending next results request") } - result, err = client.ListMultiRoleMetricDefinitionsResponder(resp) + result, err = client.ListMultiRolePoolsResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listMultiRoleMetricDefinitionsNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listMultiRolePoolsNextResults", resp, "Failure responding to next results request") } return } -// ListMultiRoleMetricDefinitionsComplete enumerates all values, automatically crossing page boundaries as required. -func (client AppServiceEnvironmentsClient) ListMultiRoleMetricDefinitionsComplete(ctx context.Context, resourceGroupName string, name string) (result ResourceMetricDefinitionCollectionIterator, err error) { +// ListMultiRolePoolsComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppServiceEnvironmentsClient) ListMultiRolePoolsComplete(ctx context.Context, resourceGroupName string, name string) (result WorkerPoolCollectionIterator, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListMultiRoleMetricDefinitions") + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListMultiRolePools") defer func() { sc := -1 if result.Response().Response.Response != nil { @@ -2026,28 +2143,21 @@ func (client AppServiceEnvironmentsClient) ListMultiRoleMetricDefinitionsComplet tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListMultiRoleMetricDefinitions(ctx, resourceGroupName, name) + result.page, err = client.ListMultiRolePools(ctx, resourceGroupName, name) return } -// ListMultiRoleMetrics get metrics for a multi-role pool of an App Service Environment. +// ListMultiRolePoolSkus description for Get available SKUs for scaling a multi-role pool. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service Environment. -// startTime - beginning time of the metrics query. -// endTime - end time of the metrics query. -// timeGrain - time granularity of the metrics query. -// details - specify true to include instance details. The default is false. -// filter - return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: -// $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and -// endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. -func (client AppServiceEnvironmentsClient) ListMultiRoleMetrics(ctx context.Context, resourceGroupName string, name string, startTime string, endTime string, timeGrain string, details *bool, filter string) (result ResourceMetricCollectionPage, err error) { +func (client AppServiceEnvironmentsClient) ListMultiRolePoolSkus(ctx context.Context, resourceGroupName string, name string) (result SkuInfoCollectionPage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListMultiRoleMetrics") + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListMultiRolePoolSkus") defer func() { sc := -1 - if result.rmc.Response.Response != nil { - sc = result.rmc.Response.Response.StatusCode + if result.sic.Response.Response != nil { + sc = result.sic.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -2057,543 +2167,26 @@ func (client AppServiceEnvironmentsClient) ListMultiRoleMetrics(ctx context.Cont Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListMultiRoleMetrics", err.Error()) + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListMultiRolePoolSkus", err.Error()) } - result.fn = client.listMultiRoleMetricsNextResults - req, err := client.ListMultiRoleMetricsPreparer(ctx, resourceGroupName, name, startTime, endTime, timeGrain, details, filter) + result.fn = client.listMultiRolePoolSkusNextResults + req, err := client.ListMultiRolePoolSkusPreparer(ctx, resourceGroupName, name) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRoleMetrics", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRolePoolSkus", nil, "Failure preparing request") return } - resp, err := client.ListMultiRoleMetricsSender(req) + resp, err := client.ListMultiRolePoolSkusSender(req) if err != nil { - result.rmc.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRoleMetrics", resp, "Failure sending request") + result.sic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRolePoolSkus", resp, "Failure sending request") return } - result.rmc, err = client.ListMultiRoleMetricsResponder(resp) + result.sic, err = client.ListMultiRolePoolSkusResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRoleMetrics", resp, "Failure responding to request") - } - - return -} - -// ListMultiRoleMetricsPreparer prepares the ListMultiRoleMetrics request. -func (client AppServiceEnvironmentsClient) ListMultiRoleMetricsPreparer(ctx context.Context, resourceGroupName string, name string, startTime string, endTime string, timeGrain string, details *bool, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-02-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(startTime) > 0 { - queryParameters["startTime"] = autorest.Encode("query", startTime) - } - if len(endTime) > 0 { - queryParameters["endTime"] = autorest.Encode("query", endTime) - } - if len(timeGrain) > 0 { - queryParameters["timeGrain"] = autorest.Encode("query", timeGrain) - } - if details != nil { - queryParameters["details"] = autorest.Encode("query", *details) - } - if len(filter) > 0 { - queryParameters["$filter"] = filter - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/metrics", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListMultiRoleMetricsSender sends the ListMultiRoleMetrics request. The method will close the -// http.Response Body if it receives an error. -func (client AppServiceEnvironmentsClient) ListMultiRoleMetricsSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListMultiRoleMetricsResponder handles the response to the ListMultiRoleMetrics request. The method always -// closes the http.Response Body. -func (client AppServiceEnvironmentsClient) ListMultiRoleMetricsResponder(resp *http.Response) (result ResourceMetricCollection, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listMultiRoleMetricsNextResults retrieves the next set of results, if any. -func (client AppServiceEnvironmentsClient) listMultiRoleMetricsNextResults(ctx context.Context, lastResults ResourceMetricCollection) (result ResourceMetricCollection, err error) { - req, err := lastResults.resourceMetricCollectionPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listMultiRoleMetricsNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListMultiRoleMetricsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listMultiRoleMetricsNextResults", resp, "Failure sending next results request") - } - result, err = client.ListMultiRoleMetricsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listMultiRoleMetricsNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListMultiRoleMetricsComplete enumerates all values, automatically crossing page boundaries as required. -func (client AppServiceEnvironmentsClient) ListMultiRoleMetricsComplete(ctx context.Context, resourceGroupName string, name string, startTime string, endTime string, timeGrain string, details *bool, filter string) (result ResourceMetricCollectionIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListMultiRoleMetrics") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListMultiRoleMetrics(ctx, resourceGroupName, name, startTime, endTime, timeGrain, details, filter) - return -} - -// ListMultiRolePoolInstanceMetricDefinitions get metric definitions for a specific instance of a multi-role pool of an -// App Service Environment. -// Parameters: -// resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the App Service Environment. -// instance - name of the instance in the multi-role pool. -func (client AppServiceEnvironmentsClient) ListMultiRolePoolInstanceMetricDefinitions(ctx context.Context, resourceGroupName string, name string, instance string) (result ResourceMetricDefinitionCollectionPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListMultiRolePoolInstanceMetricDefinitions") - defer func() { - sc := -1 - if result.rmdc.Response.Response != nil { - sc = result.rmdc.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListMultiRolePoolInstanceMetricDefinitions", err.Error()) - } - - result.fn = client.listMultiRolePoolInstanceMetricDefinitionsNextResults - req, err := client.ListMultiRolePoolInstanceMetricDefinitionsPreparer(ctx, resourceGroupName, name, instance) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRolePoolInstanceMetricDefinitions", nil, "Failure preparing request") - return - } - - resp, err := client.ListMultiRolePoolInstanceMetricDefinitionsSender(req) - if err != nil { - result.rmdc.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRolePoolInstanceMetricDefinitions", resp, "Failure sending request") - return - } - - result.rmdc, err = client.ListMultiRolePoolInstanceMetricDefinitionsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRolePoolInstanceMetricDefinitions", resp, "Failure responding to request") - } - - return -} - -// ListMultiRolePoolInstanceMetricDefinitionsPreparer prepares the ListMultiRolePoolInstanceMetricDefinitions request. -func (client AppServiceEnvironmentsClient) ListMultiRolePoolInstanceMetricDefinitionsPreparer(ctx context.Context, resourceGroupName string, name string, instance string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instance": autorest.Encode("path", instance), - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-02-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/instances/{instance}/metricdefinitions", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListMultiRolePoolInstanceMetricDefinitionsSender sends the ListMultiRolePoolInstanceMetricDefinitions request. The method will close the -// http.Response Body if it receives an error. -func (client AppServiceEnvironmentsClient) ListMultiRolePoolInstanceMetricDefinitionsSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListMultiRolePoolInstanceMetricDefinitionsResponder handles the response to the ListMultiRolePoolInstanceMetricDefinitions request. The method always -// closes the http.Response Body. -func (client AppServiceEnvironmentsClient) ListMultiRolePoolInstanceMetricDefinitionsResponder(resp *http.Response) (result ResourceMetricDefinitionCollection, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listMultiRolePoolInstanceMetricDefinitionsNextResults retrieves the next set of results, if any. -func (client AppServiceEnvironmentsClient) listMultiRolePoolInstanceMetricDefinitionsNextResults(ctx context.Context, lastResults ResourceMetricDefinitionCollection) (result ResourceMetricDefinitionCollection, err error) { - req, err := lastResults.resourceMetricDefinitionCollectionPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listMultiRolePoolInstanceMetricDefinitionsNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListMultiRolePoolInstanceMetricDefinitionsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listMultiRolePoolInstanceMetricDefinitionsNextResults", resp, "Failure sending next results request") - } - result, err = client.ListMultiRolePoolInstanceMetricDefinitionsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listMultiRolePoolInstanceMetricDefinitionsNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListMultiRolePoolInstanceMetricDefinitionsComplete enumerates all values, automatically crossing page boundaries as required. -func (client AppServiceEnvironmentsClient) ListMultiRolePoolInstanceMetricDefinitionsComplete(ctx context.Context, resourceGroupName string, name string, instance string) (result ResourceMetricDefinitionCollectionIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListMultiRolePoolInstanceMetricDefinitions") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListMultiRolePoolInstanceMetricDefinitions(ctx, resourceGroupName, name, instance) - return -} - -// ListMultiRolePoolInstanceMetrics get metrics for a specific instance of a multi-role pool of an App Service -// Environment. -// Parameters: -// resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the App Service Environment. -// instance - name of the instance in the multi-role pool. -// details - specify true to include instance details. The default is false. -func (client AppServiceEnvironmentsClient) ListMultiRolePoolInstanceMetrics(ctx context.Context, resourceGroupName string, name string, instance string, details *bool) (result ResourceMetricCollectionPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListMultiRolePoolInstanceMetrics") - defer func() { - sc := -1 - if result.rmc.Response.Response != nil { - sc = result.rmc.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListMultiRolePoolInstanceMetrics", err.Error()) - } - - result.fn = client.listMultiRolePoolInstanceMetricsNextResults - req, err := client.ListMultiRolePoolInstanceMetricsPreparer(ctx, resourceGroupName, name, instance, details) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRolePoolInstanceMetrics", nil, "Failure preparing request") - return - } - - resp, err := client.ListMultiRolePoolInstanceMetricsSender(req) - if err != nil { - result.rmc.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRolePoolInstanceMetrics", resp, "Failure sending request") - return - } - - result.rmc, err = client.ListMultiRolePoolInstanceMetricsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRolePoolInstanceMetrics", resp, "Failure responding to request") - } - - return -} - -// ListMultiRolePoolInstanceMetricsPreparer prepares the ListMultiRolePoolInstanceMetrics request. -func (client AppServiceEnvironmentsClient) ListMultiRolePoolInstanceMetricsPreparer(ctx context.Context, resourceGroupName string, name string, instance string, details *bool) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instance": autorest.Encode("path", instance), - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-02-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if details != nil { - queryParameters["details"] = autorest.Encode("query", *details) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/instances/{instance}/metrics", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListMultiRolePoolInstanceMetricsSender sends the ListMultiRolePoolInstanceMetrics request. The method will close the -// http.Response Body if it receives an error. -func (client AppServiceEnvironmentsClient) ListMultiRolePoolInstanceMetricsSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListMultiRolePoolInstanceMetricsResponder handles the response to the ListMultiRolePoolInstanceMetrics request. The method always -// closes the http.Response Body. -func (client AppServiceEnvironmentsClient) ListMultiRolePoolInstanceMetricsResponder(resp *http.Response) (result ResourceMetricCollection, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listMultiRolePoolInstanceMetricsNextResults retrieves the next set of results, if any. -func (client AppServiceEnvironmentsClient) listMultiRolePoolInstanceMetricsNextResults(ctx context.Context, lastResults ResourceMetricCollection) (result ResourceMetricCollection, err error) { - req, err := lastResults.resourceMetricCollectionPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listMultiRolePoolInstanceMetricsNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListMultiRolePoolInstanceMetricsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listMultiRolePoolInstanceMetricsNextResults", resp, "Failure sending next results request") - } - result, err = client.ListMultiRolePoolInstanceMetricsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listMultiRolePoolInstanceMetricsNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListMultiRolePoolInstanceMetricsComplete enumerates all values, automatically crossing page boundaries as required. -func (client AppServiceEnvironmentsClient) ListMultiRolePoolInstanceMetricsComplete(ctx context.Context, resourceGroupName string, name string, instance string, details *bool) (result ResourceMetricCollectionIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListMultiRolePoolInstanceMetrics") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListMultiRolePoolInstanceMetrics(ctx, resourceGroupName, name, instance, details) - return -} - -// ListMultiRolePools get all multi-role pools. -// Parameters: -// resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the App Service Environment. -func (client AppServiceEnvironmentsClient) ListMultiRolePools(ctx context.Context, resourceGroupName string, name string) (result WorkerPoolCollectionPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListMultiRolePools") - defer func() { - sc := -1 - if result.wpc.Response.Response != nil { - sc = result.wpc.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListMultiRolePools", err.Error()) - } - - result.fn = client.listMultiRolePoolsNextResults - req, err := client.ListMultiRolePoolsPreparer(ctx, resourceGroupName, name) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRolePools", nil, "Failure preparing request") - return - } - - resp, err := client.ListMultiRolePoolsSender(req) - if err != nil { - result.wpc.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRolePools", resp, "Failure sending request") - return - } - - result.wpc, err = client.ListMultiRolePoolsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRolePools", resp, "Failure responding to request") - } - - return -} - -// ListMultiRolePoolsPreparer prepares the ListMultiRolePools request. -func (client AppServiceEnvironmentsClient) ListMultiRolePoolsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-02-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListMultiRolePoolsSender sends the ListMultiRolePools request. The method will close the -// http.Response Body if it receives an error. -func (client AppServiceEnvironmentsClient) ListMultiRolePoolsSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListMultiRolePoolsResponder handles the response to the ListMultiRolePools request. The method always -// closes the http.Response Body. -func (client AppServiceEnvironmentsClient) ListMultiRolePoolsResponder(resp *http.Response) (result WorkerPoolCollection, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listMultiRolePoolsNextResults retrieves the next set of results, if any. -func (client AppServiceEnvironmentsClient) listMultiRolePoolsNextResults(ctx context.Context, lastResults WorkerPoolCollection) (result WorkerPoolCollection, err error) { - req, err := lastResults.workerPoolCollectionPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listMultiRolePoolsNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListMultiRolePoolsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listMultiRolePoolsNextResults", resp, "Failure sending next results request") - } - result, err = client.ListMultiRolePoolsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listMultiRolePoolsNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListMultiRolePoolsComplete enumerates all values, automatically crossing page boundaries as required. -func (client AppServiceEnvironmentsClient) ListMultiRolePoolsComplete(ctx context.Context, resourceGroupName string, name string) (result WorkerPoolCollectionIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListMultiRolePools") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListMultiRolePools(ctx, resourceGroupName, name) - return -} - -// ListMultiRolePoolSkus get available SKUs for scaling a multi-role pool. -// Parameters: -// resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the App Service Environment. -func (client AppServiceEnvironmentsClient) ListMultiRolePoolSkus(ctx context.Context, resourceGroupName string, name string) (result SkuInfoCollectionPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListMultiRolePoolSkus") - defer func() { - sc := -1 - if result.sic.Response.Response != nil { - sc = result.sic.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListMultiRolePoolSkus", err.Error()) - } - - result.fn = client.listMultiRolePoolSkusNextResults - req, err := client.ListMultiRolePoolSkusPreparer(ctx, resourceGroupName, name) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRolePoolSkus", nil, "Failure preparing request") - return - } - - resp, err := client.ListMultiRolePoolSkusSender(req) - if err != nil { - result.sic.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRolePoolSkus", resp, "Failure sending request") - return - } - - result.sic, err = client.ListMultiRolePoolSkusResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRolePoolSkus", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRolePoolSkus", resp, "Failure responding to request") } return @@ -2607,7 +2200,7 @@ func (client AppServiceEnvironmentsClient) ListMultiRolePoolSkusPreparer(ctx con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -2677,7 +2270,7 @@ func (client AppServiceEnvironmentsClient) ListMultiRolePoolSkusComplete(ctx con return } -// ListMultiRoleUsages get usage metrics for a multi-role pool of an App Service Environment. +// ListMultiRoleUsages description for Get usage metrics for a multi-role pool of an App Service Environment. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service Environment. @@ -2730,7 +2323,7 @@ func (client AppServiceEnvironmentsClient) ListMultiRoleUsagesPreparer(ctx conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -2800,7 +2393,7 @@ func (client AppServiceEnvironmentsClient) ListMultiRoleUsagesComplete(ctx conte return } -// ListOperations list all currently running operations on the App Service Environment. +// ListOperations description for List all currently running operations on the App Service Environment. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service Environment. @@ -2852,7 +2445,7 @@ func (client AppServiceEnvironmentsClient) ListOperationsPreparer(ctx context.Co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -2885,7 +2478,7 @@ func (client AppServiceEnvironmentsClient) ListOperationsResponder(resp *http.Re return } -// ListUsages get global usage metrics of an App Service Environment. +// ListUsages description for Get global usage metrics of an App Service Environment. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service Environment. @@ -2914,181 +2507,59 @@ func (client AppServiceEnvironmentsClient) ListUsages(ctx context.Context, resou result.fn = client.listUsagesNextResults req, err := client.ListUsagesPreparer(ctx, resourceGroupName, name, filter) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListUsages", nil, "Failure preparing request") - return - } - - resp, err := client.ListUsagesSender(req) - if err != nil { - result.cuqc.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListUsages", resp, "Failure sending request") - return - } - - result.cuqc, err = client.ListUsagesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListUsages", resp, "Failure responding to request") - } - - return -} - -// ListUsagesPreparer prepares the ListUsages request. -func (client AppServiceEnvironmentsClient) ListUsagesPreparer(ctx context.Context, resourceGroupName string, name string, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-02-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = filter - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/usages", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListUsagesSender sends the ListUsages request. The method will close the -// http.Response Body if it receives an error. -func (client AppServiceEnvironmentsClient) ListUsagesSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListUsagesResponder handles the response to the ListUsages request. The method always -// closes the http.Response Body. -func (client AppServiceEnvironmentsClient) ListUsagesResponder(resp *http.Response) (result CsmUsageQuotaCollection, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listUsagesNextResults retrieves the next set of results, if any. -func (client AppServiceEnvironmentsClient) listUsagesNextResults(ctx context.Context, lastResults CsmUsageQuotaCollection) (result CsmUsageQuotaCollection, err error) { - req, err := lastResults.csmUsageQuotaCollectionPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listUsagesNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListUsagesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listUsagesNextResults", resp, "Failure sending next results request") - } - result, err = client.ListUsagesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listUsagesNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListUsagesComplete enumerates all values, automatically crossing page boundaries as required. -func (client AppServiceEnvironmentsClient) ListUsagesComplete(ctx context.Context, resourceGroupName string, name string, filter string) (result CsmUsageQuotaCollectionIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListUsages") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListUsages(ctx, resourceGroupName, name, filter) - return -} - -// ListVips get IP addresses assigned to an App Service Environment. -// Parameters: -// resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the App Service Environment. -func (client AppServiceEnvironmentsClient) ListVips(ctx context.Context, resourceGroupName string, name string) (result AddressResponse, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListVips") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListVips", err.Error()) - } - - req, err := client.ListVipsPreparer(ctx, resourceGroupName, name) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListVips", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListUsages", nil, "Failure preparing request") return } - resp, err := client.ListVipsSender(req) + resp, err := client.ListUsagesSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListVips", resp, "Failure sending request") + result.cuqc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListUsages", resp, "Failure sending request") return } - result, err = client.ListVipsResponder(resp) + result.cuqc, err = client.ListUsagesResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListVips", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListUsages", resp, "Failure responding to request") } return } -// ListVipsPreparer prepares the ListVips request. -func (client AppServiceEnvironmentsClient) ListVipsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { +// ListUsagesPreparer prepares the ListUsages request. +func (client AppServiceEnvironmentsClient) ListUsagesPreparer(ctx context.Context, resourceGroupName string, name string, filter string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if len(filter) > 0 { + queryParameters["$filter"] = filter + } preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/capacities/virtualip", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/usages", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListVipsSender sends the ListVips request. The method will close the +// ListUsagesSender sends the ListUsages request. The method will close the // http.Response Body if it receives an error. -func (client AppServiceEnvironmentsClient) ListVipsSender(req *http.Request) (*http.Response, error) { +func (client AppServiceEnvironmentsClient) ListUsagesSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } -// ListVipsResponder handles the response to the ListVips request. The method always +// ListUsagesResponder handles the response to the ListUsages request. The method always // closes the http.Response Body. -func (client AppServiceEnvironmentsClient) ListVipsResponder(resp *http.Response) (result AddressResponse, err error) { +func (client AppServiceEnvironmentsClient) ListUsagesResponder(resp *http.Response) (result CsmUsageQuotaCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -3099,7 +2570,44 @@ func (client AppServiceEnvironmentsClient) ListVipsResponder(resp *http.Response return } -// ListWebApps get all apps in an App Service Environment. +// listUsagesNextResults retrieves the next set of results, if any. +func (client AppServiceEnvironmentsClient) listUsagesNextResults(ctx context.Context, lastResults CsmUsageQuotaCollection) (result CsmUsageQuotaCollection, err error) { + req, err := lastResults.csmUsageQuotaCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listUsagesNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListUsagesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listUsagesNextResults", resp, "Failure sending next results request") + } + result, err = client.ListUsagesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listUsagesNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListUsagesComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppServiceEnvironmentsClient) ListUsagesComplete(ctx context.Context, resourceGroupName string, name string, filter string) (result CsmUsageQuotaCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListUsages") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListUsages(ctx, resourceGroupName, name, filter) + return +} + +// ListWebApps description for Get all apps in an App Service Environment. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service Environment. @@ -3153,7 +2661,7 @@ func (client AppServiceEnvironmentsClient) ListWebAppsPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -3226,7 +2734,8 @@ func (client AppServiceEnvironmentsClient) ListWebAppsComplete(ctx context.Conte return } -// ListWebWorkerMetricDefinitions get metric definitions for a worker pool of an App Service Environment. +// ListWebWorkerMetricDefinitions description for Get metric definitions for a worker pool of an App Service +// Environment. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service Environment. @@ -3281,7 +2790,7 @@ func (client AppServiceEnvironmentsClient) ListWebWorkerMetricDefinitionsPrepare "workerPoolName": autorest.Encode("path", workerPoolName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -3351,142 +2860,7 @@ func (client AppServiceEnvironmentsClient) ListWebWorkerMetricDefinitionsComplet return } -// ListWebWorkerMetrics get metrics for a worker pool of a AppServiceEnvironment (App Service Environment). -// Parameters: -// resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the App Service Environment. -// workerPoolName - name of worker pool -// details - specify true to include instance details. The default is false. -// filter - return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: -// $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and -// endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. -func (client AppServiceEnvironmentsClient) ListWebWorkerMetrics(ctx context.Context, resourceGroupName string, name string, workerPoolName string, details *bool, filter string) (result ResourceMetricCollectionPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListWebWorkerMetrics") - defer func() { - sc := -1 - if result.rmc.Response.Response != nil { - sc = result.rmc.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListWebWorkerMetrics", err.Error()) - } - - result.fn = client.listWebWorkerMetricsNextResults - req, err := client.ListWebWorkerMetricsPreparer(ctx, resourceGroupName, name, workerPoolName, details, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListWebWorkerMetrics", nil, "Failure preparing request") - return - } - - resp, err := client.ListWebWorkerMetricsSender(req) - if err != nil { - result.rmc.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListWebWorkerMetrics", resp, "Failure sending request") - return - } - - result.rmc, err = client.ListWebWorkerMetricsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListWebWorkerMetrics", resp, "Failure responding to request") - } - - return -} - -// ListWebWorkerMetricsPreparer prepares the ListWebWorkerMetrics request. -func (client AppServiceEnvironmentsClient) ListWebWorkerMetricsPreparer(ctx context.Context, resourceGroupName string, name string, workerPoolName string, details *bool, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workerPoolName": autorest.Encode("path", workerPoolName), - } - - const APIVersion = "2018-02-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if details != nil { - queryParameters["details"] = autorest.Encode("query", *details) - } - if len(filter) > 0 { - queryParameters["$filter"] = filter - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/metrics", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListWebWorkerMetricsSender sends the ListWebWorkerMetrics request. The method will close the -// http.Response Body if it receives an error. -func (client AppServiceEnvironmentsClient) ListWebWorkerMetricsSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListWebWorkerMetricsResponder handles the response to the ListWebWorkerMetrics request. The method always -// closes the http.Response Body. -func (client AppServiceEnvironmentsClient) ListWebWorkerMetricsResponder(resp *http.Response) (result ResourceMetricCollection, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listWebWorkerMetricsNextResults retrieves the next set of results, if any. -func (client AppServiceEnvironmentsClient) listWebWorkerMetricsNextResults(ctx context.Context, lastResults ResourceMetricCollection) (result ResourceMetricCollection, err error) { - req, err := lastResults.resourceMetricCollectionPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listWebWorkerMetricsNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListWebWorkerMetricsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listWebWorkerMetricsNextResults", resp, "Failure sending next results request") - } - result, err = client.ListWebWorkerMetricsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listWebWorkerMetricsNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListWebWorkerMetricsComplete enumerates all values, automatically crossing page boundaries as required. -func (client AppServiceEnvironmentsClient) ListWebWorkerMetricsComplete(ctx context.Context, resourceGroupName string, name string, workerPoolName string, details *bool, filter string) (result ResourceMetricCollectionIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListWebWorkerMetrics") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListWebWorkerMetrics(ctx, resourceGroupName, name, workerPoolName, details, filter) - return -} - -// ListWebWorkerUsages get usage metrics for a worker pool of an App Service Environment. +// ListWebWorkerUsages description for Get usage metrics for a worker pool of an App Service Environment. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service Environment. @@ -3541,7 +2915,7 @@ func (client AppServiceEnvironmentsClient) ListWebWorkerUsagesPreparer(ctx conte "workerPoolName": autorest.Encode("path", workerPoolName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -3611,8 +2985,8 @@ func (client AppServiceEnvironmentsClient) ListWebWorkerUsagesComplete(ctx conte return } -// ListWorkerPoolInstanceMetricDefinitions get metric definitions for a specific instance of a worker pool of an App -// Service Environment. +// ListWorkerPoolInstanceMetricDefinitions description for Get metric definitions for a specific instance of a worker +// pool of an App Service Environment. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service Environment. @@ -3669,7 +3043,7 @@ func (client AppServiceEnvironmentsClient) ListWorkerPoolInstanceMetricDefinitio "workerPoolName": autorest.Encode("path", workerPoolName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -3739,144 +3113,7 @@ func (client AppServiceEnvironmentsClient) ListWorkerPoolInstanceMetricDefinitio return } -// ListWorkerPoolInstanceMetrics get metrics for a specific instance of a worker pool of an App Service Environment. -// Parameters: -// resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the App Service Environment. -// workerPoolName - name of the worker pool. -// instance - name of the instance in the worker pool. -// details - specify true to include instance details. The default is false. -// filter - return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: -// $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and -// endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. -func (client AppServiceEnvironmentsClient) ListWorkerPoolInstanceMetrics(ctx context.Context, resourceGroupName string, name string, workerPoolName string, instance string, details *bool, filter string) (result ResourceMetricCollectionPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListWorkerPoolInstanceMetrics") - defer func() { - sc := -1 - if result.rmc.Response.Response != nil { - sc = result.rmc.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListWorkerPoolInstanceMetrics", err.Error()) - } - - result.fn = client.listWorkerPoolInstanceMetricsNextResults - req, err := client.ListWorkerPoolInstanceMetricsPreparer(ctx, resourceGroupName, name, workerPoolName, instance, details, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListWorkerPoolInstanceMetrics", nil, "Failure preparing request") - return - } - - resp, err := client.ListWorkerPoolInstanceMetricsSender(req) - if err != nil { - result.rmc.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListWorkerPoolInstanceMetrics", resp, "Failure sending request") - return - } - - result.rmc, err = client.ListWorkerPoolInstanceMetricsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListWorkerPoolInstanceMetrics", resp, "Failure responding to request") - } - - return -} - -// ListWorkerPoolInstanceMetricsPreparer prepares the ListWorkerPoolInstanceMetrics request. -func (client AppServiceEnvironmentsClient) ListWorkerPoolInstanceMetricsPreparer(ctx context.Context, resourceGroupName string, name string, workerPoolName string, instance string, details *bool, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instance": autorest.Encode("path", instance), - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workerPoolName": autorest.Encode("path", workerPoolName), - } - - const APIVersion = "2018-02-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if details != nil { - queryParameters["details"] = autorest.Encode("query", *details) - } - if len(filter) > 0 { - queryParameters["$filter"] = filter - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/instances/{instance}/metrics", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListWorkerPoolInstanceMetricsSender sends the ListWorkerPoolInstanceMetrics request. The method will close the -// http.Response Body if it receives an error. -func (client AppServiceEnvironmentsClient) ListWorkerPoolInstanceMetricsSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListWorkerPoolInstanceMetricsResponder handles the response to the ListWorkerPoolInstanceMetrics request. The method always -// closes the http.Response Body. -func (client AppServiceEnvironmentsClient) ListWorkerPoolInstanceMetricsResponder(resp *http.Response) (result ResourceMetricCollection, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listWorkerPoolInstanceMetricsNextResults retrieves the next set of results, if any. -func (client AppServiceEnvironmentsClient) listWorkerPoolInstanceMetricsNextResults(ctx context.Context, lastResults ResourceMetricCollection) (result ResourceMetricCollection, err error) { - req, err := lastResults.resourceMetricCollectionPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listWorkerPoolInstanceMetricsNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListWorkerPoolInstanceMetricsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listWorkerPoolInstanceMetricsNextResults", resp, "Failure sending next results request") - } - result, err = client.ListWorkerPoolInstanceMetricsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listWorkerPoolInstanceMetricsNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListWorkerPoolInstanceMetricsComplete enumerates all values, automatically crossing page boundaries as required. -func (client AppServiceEnvironmentsClient) ListWorkerPoolInstanceMetricsComplete(ctx context.Context, resourceGroupName string, name string, workerPoolName string, instance string, details *bool, filter string) (result ResourceMetricCollectionIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListWorkerPoolInstanceMetrics") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListWorkerPoolInstanceMetrics(ctx, resourceGroupName, name, workerPoolName, instance, details, filter) - return -} - -// ListWorkerPools get all worker pools of an App Service Environment. +// ListWorkerPools description for Get all worker pools of an App Service Environment. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service Environment. @@ -3929,7 +3166,7 @@ func (client AppServiceEnvironmentsClient) ListWorkerPoolsPreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -3999,7 +3236,7 @@ func (client AppServiceEnvironmentsClient) ListWorkerPoolsComplete(ctx context.C return } -// ListWorkerPoolSkus get available SKUs for scaling a worker pool. +// ListWorkerPoolSkus description for Get available SKUs for scaling a worker pool. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service Environment. @@ -4054,7 +3291,7 @@ func (client AppServiceEnvironmentsClient) ListWorkerPoolSkusPreparer(ctx contex "workerPoolName": autorest.Encode("path", workerPoolName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -4124,7 +3361,7 @@ func (client AppServiceEnvironmentsClient) ListWorkerPoolSkusComplete(ctx contex return } -// Reboot reboot all machines in an App Service Environment. +// Reboot description for Reboot all machines in an App Service Environment. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service Environment. @@ -4176,7 +3413,7 @@ func (client AppServiceEnvironmentsClient) RebootPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -4202,13 +3439,13 @@ func (client AppServiceEnvironmentsClient) RebootResponder(resp *http.Response) err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusBadRequest, http.StatusNotFound, http.StatusConflict), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp return } -// Resume resume an App Service Environment. +// Resume description for Resume an App Service Environment. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service Environment. @@ -4254,7 +3491,7 @@ func (client AppServiceEnvironmentsClient) ResumePreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -4335,7 +3572,7 @@ func (client AppServiceEnvironmentsClient) ResumeComplete(ctx context.Context, r return } -// Suspend suspend an App Service Environment. +// Suspend description for Suspend an App Service Environment. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service Environment. @@ -4381,7 +3618,7 @@ func (client AppServiceEnvironmentsClient) SuspendPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -4462,7 +3699,7 @@ func (client AppServiceEnvironmentsClient) SuspendComplete(ctx context.Context, return } -// Update create or update an App Service Environment. +// Update description for Create or update an App Service Environment. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service Environment. @@ -4515,7 +3752,7 @@ func (client AppServiceEnvironmentsClient) UpdatePreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -4543,14 +3780,14 @@ func (client AppServiceEnvironmentsClient) UpdateResponder(resp *http.Response) err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusBadRequest, http.StatusNotFound, http.StatusConflict), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// UpdateMultiRolePool create or update a multi-role pool. +// UpdateMultiRolePool description for Create or update a multi-role pool. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service Environment. @@ -4603,7 +3840,7 @@ func (client AppServiceEnvironmentsClient) UpdateMultiRolePoolPreparer(ctx conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -4631,14 +3868,14 @@ func (client AppServiceEnvironmentsClient) UpdateMultiRolePoolResponder(resp *ht err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusBadRequest, http.StatusNotFound, http.StatusConflict), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// UpdateWorkerPool create or update a worker pool. +// UpdateWorkerPool description for Create or update a worker pool. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service Environment. @@ -4693,7 +3930,7 @@ func (client AppServiceEnvironmentsClient) UpdateWorkerPoolPreparer(ctx context. "workerPoolName": autorest.Encode("path", workerPoolName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -4721,7 +3958,7 @@ func (client AppServiceEnvironmentsClient) UpdateWorkerPoolResponder(resp *http. err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusBadRequest, http.StatusNotFound, http.StatusConflict), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} diff --git a/services/web/mgmt/2019-08-01/web/appserviceplans.go b/services/web/mgmt/2019-08-01/web/appserviceplans.go index 3324503f3dab..24b03add793b 100644 --- a/services/web/mgmt/2019-08-01/web/appserviceplans.go +++ b/services/web/mgmt/2019-08-01/web/appserviceplans.go @@ -41,7 +41,7 @@ func NewAppServicePlansClientWithBaseURI(baseURI string, subscriptionID string) return AppServicePlansClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate creates or updates an App Service Plan. +// CreateOrUpdate description for Creates or updates an App Service Plan. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service plan. @@ -88,7 +88,7 @@ func (client AppServicePlansClient) CreateOrUpdatePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -122,14 +122,14 @@ func (client AppServicePlansClient) CreateOrUpdateResponder(resp *http.Response) err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// CreateOrUpdateVnetRoute create or update a Virtual Network route in an App Service plan. +// CreateOrUpdateVnetRoute description for Create or update a Virtual Network route in an App Service plan. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service plan. @@ -186,7 +186,7 @@ func (client AppServicePlansClient) CreateOrUpdateVnetRoutePreparer(ctx context. "vnetName": autorest.Encode("path", vnetName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -221,7 +221,7 @@ func (client AppServicePlansClient) CreateOrUpdateVnetRouteResponder(resp *http. return } -// Delete delete an App Service plan. +// Delete description for Delete an App Service plan. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service plan. @@ -273,7 +273,7 @@ func (client AppServicePlansClient) DeletePreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -305,7 +305,7 @@ func (client AppServicePlansClient) DeleteResponder(resp *http.Response) (result return } -// DeleteHybridConnection delete a Hybrid Connection in use in an App Service plan. +// DeleteHybridConnection description for Delete a Hybrid Connection in use in an App Service plan. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service plan. @@ -361,7 +361,7 @@ func (client AppServicePlansClient) DeleteHybridConnectionPreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -393,7 +393,7 @@ func (client AppServicePlansClient) DeleteHybridConnectionResponder(resp *http.R return } -// DeleteVnetRoute delete a Virtual Network route in an App Service plan. +// DeleteVnetRoute description for Delete a Virtual Network route in an App Service plan. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service plan. @@ -449,7 +449,7 @@ func (client AppServicePlansClient) DeleteVnetRoutePreparer(ctx context.Context, "vnetName": autorest.Encode("path", vnetName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -481,7 +481,7 @@ func (client AppServicePlansClient) DeleteVnetRouteResponder(resp *http.Response return } -// Get get an App Service plan. +// Get description for Get an App Service plan. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service plan. @@ -533,7 +533,7 @@ func (client AppServicePlansClient) GetPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -566,7 +566,7 @@ func (client AppServicePlansClient) GetResponder(resp *http.Response) (result Ap return } -// GetHybridConnection retrieve a Hybrid Connection in use in an App Service plan. +// GetHybridConnection description for Retrieve a Hybrid Connection in use in an App Service plan. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service plan. @@ -622,7 +622,7 @@ func (client AppServicePlansClient) GetHybridConnectionPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -655,7 +655,8 @@ func (client AppServicePlansClient) GetHybridConnectionResponder(resp *http.Resp return } -// GetHybridConnectionPlanLimit get the maximum number of Hybrid Connections allowed in an App Service plan. +// GetHybridConnectionPlanLimit description for Get the maximum number of Hybrid Connections allowed in an App Service +// plan. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service plan. @@ -707,7 +708,7 @@ func (client AppServicePlansClient) GetHybridConnectionPlanLimitPreparer(ctx con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -740,7 +741,7 @@ func (client AppServicePlansClient) GetHybridConnectionPlanLimitResponder(resp * return } -// GetRouteForVnet get a Virtual Network route in an App Service plan. +// GetRouteForVnet description for Get a Virtual Network route in an App Service plan. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service plan. @@ -796,7 +797,7 @@ func (client AppServicePlansClient) GetRouteForVnetPreparer(ctx context.Context, "vnetName": autorest.Encode("path", vnetName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -829,7 +830,7 @@ func (client AppServicePlansClient) GetRouteForVnetResponder(resp *http.Response return } -// GetServerFarmSkus gets all selectable SKUs for a given App Service Plan +// GetServerFarmSkus description for Gets all selectable SKUs for a given App Service Plan // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of App Service Plan @@ -881,7 +882,7 @@ func (client AppServicePlansClient) GetServerFarmSkusPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -914,7 +915,7 @@ func (client AppServicePlansClient) GetServerFarmSkusResponder(resp *http.Respon return } -// GetVnetFromServerFarm get a Virtual Network associated with an App Service plan. +// GetVnetFromServerFarm description for Get a Virtual Network associated with an App Service plan. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service plan. @@ -968,7 +969,7 @@ func (client AppServicePlansClient) GetVnetFromServerFarmPreparer(ctx context.Co "vnetName": autorest.Encode("path", vnetName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1001,7 +1002,7 @@ func (client AppServicePlansClient) GetVnetFromServerFarmResponder(resp *http.Re return } -// GetVnetGateway get a Virtual Network gateway. +// GetVnetGateway description for Get a Virtual Network gateway. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service plan. @@ -1057,7 +1058,7 @@ func (client AppServicePlansClient) GetVnetGatewayPreparer(ctx context.Context, "vnetName": autorest.Encode("path", vnetName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1090,7 +1091,7 @@ func (client AppServicePlansClient) GetVnetGatewayResponder(resp *http.Response) return } -// List get all App Service plans for a subscription. +// List description for Get all App Service plans for a subscription. // Parameters: // detailed - specify true to return all App Service plan properties. The default is // false, which returns a subset of the properties. @@ -1134,7 +1135,7 @@ func (client AppServicePlansClient) ListPreparer(ctx context.Context, detailed * "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1207,7 +1208,7 @@ func (client AppServicePlansClient) ListComplete(ctx context.Context, detailed * return } -// ListByResourceGroup get all App Service plans in a resource group. +// ListByResourceGroup description for Get all App Service plans in a resource group. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. func (client AppServicePlansClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result AppServicePlanCollectionPage, err error) { @@ -1258,7 +1259,7 @@ func (client AppServicePlansClient) ListByResourceGroupPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1328,7 +1329,7 @@ func (client AppServicePlansClient) ListByResourceGroupComplete(ctx context.Cont return } -// ListCapabilities list all capabilities of an App Service plan. +// ListCapabilities description for List all capabilities of an App Service plan. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service plan. @@ -1380,7 +1381,7 @@ func (client AppServicePlansClient) ListCapabilitiesPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1413,7 +1414,7 @@ func (client AppServicePlansClient) ListCapabilitiesResponder(resp *http.Respons return } -// ListHybridConnectionKeys get the send key name and value of a Hybrid Connection. +// ListHybridConnectionKeys description for Get the send key name and value of a Hybrid Connection. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service plan. @@ -1469,7 +1470,7 @@ func (client AppServicePlansClient) ListHybridConnectionKeysPreparer(ctx context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1502,7 +1503,7 @@ func (client AppServicePlansClient) ListHybridConnectionKeysResponder(resp *http return } -// ListHybridConnections retrieve all Hybrid Connections in use in an App Service plan. +// ListHybridConnections description for Retrieve all Hybrid Connections in use in an App Service plan. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service plan. @@ -1555,7 +1556,7 @@ func (client AppServicePlansClient) ListHybridConnectionsPreparer(ctx context.Co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1625,263 +1626,7 @@ func (client AppServicePlansClient) ListHybridConnectionsComplete(ctx context.Co return } -// ListMetricDefintions get metrics that can be queried for an App Service plan, and their definitions. -// Parameters: -// resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the App Service plan. -func (client AppServicePlansClient) ListMetricDefintions(ctx context.Context, resourceGroupName string, name string) (result ResourceMetricDefinitionCollectionPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppServicePlansClient.ListMetricDefintions") - defer func() { - sc := -1 - if result.rmdc.Response.Response != nil { - sc = result.rmdc.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppServicePlansClient", "ListMetricDefintions", err.Error()) - } - - result.fn = client.listMetricDefintionsNextResults - req, err := client.ListMetricDefintionsPreparer(ctx, resourceGroupName, name) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "ListMetricDefintions", nil, "Failure preparing request") - return - } - - resp, err := client.ListMetricDefintionsSender(req) - if err != nil { - result.rmdc.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "ListMetricDefintions", resp, "Failure sending request") - return - } - - result.rmdc, err = client.ListMetricDefintionsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "ListMetricDefintions", resp, "Failure responding to request") - } - - return -} - -// ListMetricDefintionsPreparer prepares the ListMetricDefintions request. -func (client AppServicePlansClient) ListMetricDefintionsPreparer(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-02-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/metricdefinitions", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListMetricDefintionsSender sends the ListMetricDefintions request. The method will close the -// http.Response Body if it receives an error. -func (client AppServicePlansClient) ListMetricDefintionsSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListMetricDefintionsResponder handles the response to the ListMetricDefintions request. The method always -// closes the http.Response Body. -func (client AppServicePlansClient) ListMetricDefintionsResponder(resp *http.Response) (result ResourceMetricDefinitionCollection, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listMetricDefintionsNextResults retrieves the next set of results, if any. -func (client AppServicePlansClient) listMetricDefintionsNextResults(ctx context.Context, lastResults ResourceMetricDefinitionCollection) (result ResourceMetricDefinitionCollection, err error) { - req, err := lastResults.resourceMetricDefinitionCollectionPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "web.AppServicePlansClient", "listMetricDefintionsNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListMetricDefintionsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "web.AppServicePlansClient", "listMetricDefintionsNextResults", resp, "Failure sending next results request") - } - result, err = client.ListMetricDefintionsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "listMetricDefintionsNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListMetricDefintionsComplete enumerates all values, automatically crossing page boundaries as required. -func (client AppServicePlansClient) ListMetricDefintionsComplete(ctx context.Context, resourceGroupName string, name string) (result ResourceMetricDefinitionCollectionIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppServicePlansClient.ListMetricDefintions") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListMetricDefintions(ctx, resourceGroupName, name) - return -} - -// ListMetrics get metrics for an App Service plan. -// Parameters: -// resourceGroupName - name of the resource group to which the resource belongs. -// name - name of the App Service plan. -// details - specify true to include instance details. The default is false. -// filter - return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: -// $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and -// endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. -func (client AppServicePlansClient) ListMetrics(ctx context.Context, resourceGroupName string, name string, details *bool, filter string) (result ResourceMetricCollectionPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppServicePlansClient.ListMetrics") - defer func() { - sc := -1 - if result.rmc.Response.Response != nil { - sc = result.rmc.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.AppServicePlansClient", "ListMetrics", err.Error()) - } - - result.fn = client.listMetricsNextResults - req, err := client.ListMetricsPreparer(ctx, resourceGroupName, name, details, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "ListMetrics", nil, "Failure preparing request") - return - } - - resp, err := client.ListMetricsSender(req) - if err != nil { - result.rmc.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "ListMetrics", resp, "Failure sending request") - return - } - - result.rmc, err = client.ListMetricsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "ListMetrics", resp, "Failure responding to request") - } - - return -} - -// ListMetricsPreparer prepares the ListMetrics request. -func (client AppServicePlansClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, name string, details *bool, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-02-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if details != nil { - queryParameters["details"] = autorest.Encode("query", *details) - } - if len(filter) > 0 { - queryParameters["$filter"] = filter - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/metrics", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListMetricsSender sends the ListMetrics request. The method will close the -// http.Response Body if it receives an error. -func (client AppServicePlansClient) ListMetricsSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListMetricsResponder handles the response to the ListMetrics request. The method always -// closes the http.Response Body. -func (client AppServicePlansClient) ListMetricsResponder(resp *http.Response) (result ResourceMetricCollection, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listMetricsNextResults retrieves the next set of results, if any. -func (client AppServicePlansClient) listMetricsNextResults(ctx context.Context, lastResults ResourceMetricCollection) (result ResourceMetricCollection, err error) { - req, err := lastResults.resourceMetricCollectionPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "web.AppServicePlansClient", "listMetricsNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListMetricsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "web.AppServicePlansClient", "listMetricsNextResults", resp, "Failure sending next results request") - } - result, err = client.ListMetricsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "listMetricsNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListMetricsComplete enumerates all values, automatically crossing page boundaries as required. -func (client AppServicePlansClient) ListMetricsComplete(ctx context.Context, resourceGroupName string, name string, details *bool, filter string) (result ResourceMetricCollectionIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AppServicePlansClient.ListMetrics") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListMetrics(ctx, resourceGroupName, name, details, filter) - return -} - -// ListRoutesForVnet get all routes that are associated with a Virtual Network in an App Service plan. +// ListRoutesForVnet description for Get all routes that are associated with a Virtual Network in an App Service plan. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service plan. @@ -1935,7 +1680,7 @@ func (client AppServicePlansClient) ListRoutesForVnetPreparer(ctx context.Contex "vnetName": autorest.Encode("path", vnetName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1968,7 +1713,7 @@ func (client AppServicePlansClient) ListRoutesForVnetResponder(resp *http.Respon return } -// ListUsages gets server farm usage information +// ListUsages description for Gets server farm usage information // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of App Service Plan @@ -2023,7 +1768,7 @@ func (client AppServicePlansClient) ListUsagesPreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -2096,7 +1841,7 @@ func (client AppServicePlansClient) ListUsagesComplete(ctx context.Context, reso return } -// ListVnets get all Virtual Networks associated with an App Service plan. +// ListVnets description for Get all Virtual Networks associated with an App Service plan. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service plan. @@ -2148,7 +1893,7 @@ func (client AppServicePlansClient) ListVnetsPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -2181,7 +1926,7 @@ func (client AppServicePlansClient) ListVnetsResponder(resp *http.Response) (res return } -// ListWebApps get all apps associated with an App Service plan. +// ListWebApps description for Get all apps associated with an App Service plan. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service plan. @@ -2239,7 +1984,7 @@ func (client AppServicePlansClient) ListWebAppsPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -2318,7 +2063,7 @@ func (client AppServicePlansClient) ListWebAppsComplete(ctx context.Context, res return } -// ListWebAppsByHybridConnection get all apps that use a Hybrid Connection in an App Service Plan. +// ListWebAppsByHybridConnection description for Get all apps that use a Hybrid Connection in an App Service Plan. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service plan. @@ -2375,7 +2120,7 @@ func (client AppServicePlansClient) ListWebAppsByHybridConnectionPreparer(ctx co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -2445,7 +2190,7 @@ func (client AppServicePlansClient) ListWebAppsByHybridConnectionComplete(ctx co return } -// RebootWorker reboot a worker machine in an App Service plan. +// RebootWorker description for Reboot a worker machine in an App Service plan. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service plan. @@ -2499,7 +2244,7 @@ func (client AppServicePlansClient) RebootWorkerPreparer(ctx context.Context, re "workerName": autorest.Encode("path", workerName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -2531,7 +2276,7 @@ func (client AppServicePlansClient) RebootWorkerResponder(resp *http.Response) ( return } -// RestartWebApps restart all apps in an App Service plan. +// RestartWebApps description for Restart all apps in an App Service plan. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service plan. @@ -2586,7 +2331,7 @@ func (client AppServicePlansClient) RestartWebAppsPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -2621,7 +2366,7 @@ func (client AppServicePlansClient) RestartWebAppsResponder(resp *http.Response) return } -// Update creates or updates an App Service Plan. +// Update description for Creates or updates an App Service Plan. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service plan. @@ -2674,7 +2419,7 @@ func (client AppServicePlansClient) UpdatePreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -2709,7 +2454,7 @@ func (client AppServicePlansClient) UpdateResponder(resp *http.Response) (result return } -// UpdateVnetGateway update a Virtual Network gateway. +// UpdateVnetGateway description for Update a Virtual Network gateway. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service plan. @@ -2769,7 +2514,7 @@ func (client AppServicePlansClient) UpdateVnetGatewayPreparer(ctx context.Contex "vnetName": autorest.Encode("path", vnetName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -2804,7 +2549,7 @@ func (client AppServicePlansClient) UpdateVnetGatewayResponder(resp *http.Respon return } -// UpdateVnetRoute create or update a Virtual Network route in an App Service plan. +// UpdateVnetRoute description for Create or update a Virtual Network route in an App Service plan. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service plan. @@ -2861,7 +2606,7 @@ func (client AppServicePlansClient) UpdateVnetRoutePreparer(ctx context.Context, "vnetName": autorest.Encode("path", vnetName), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/web/mgmt/2019-08-01/web/certificateregistrationprovider.go b/services/web/mgmt/2019-08-01/web/certificateregistrationprovider.go index 20728a9f2286..907ccd3ed5da 100644 --- a/services/web/mgmt/2019-08-01/web/certificateregistrationprovider.go +++ b/services/web/mgmt/2019-08-01/web/certificateregistrationprovider.go @@ -41,7 +41,8 @@ func NewCertificateRegistrationProviderClientWithBaseURI(baseURI string, subscri return CertificateRegistrationProviderClient{NewWithBaseURI(baseURI, subscriptionID)} } -// ListOperations implements Csm operations Api to exposes the list of available Csm Apis under the resource provider +// ListOperations description for Implements Csm operations Api to exposes the list of available Csm Apis under the +// resource provider func (client CertificateRegistrationProviderClient) ListOperations(ctx context.Context) (result CsmOperationCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/CertificateRegistrationProviderClient.ListOperations") @@ -77,7 +78,7 @@ func (client CertificateRegistrationProviderClient) ListOperations(ctx context.C // ListOperationsPreparer prepares the ListOperations request. func (client CertificateRegistrationProviderClient) ListOperationsPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/web/mgmt/2019-08-01/web/certificates.go b/services/web/mgmt/2019-08-01/web/certificates.go index b1640960c58c..9ebfaaa94d97 100644 --- a/services/web/mgmt/2019-08-01/web/certificates.go +++ b/services/web/mgmt/2019-08-01/web/certificates.go @@ -41,7 +41,7 @@ func NewCertificatesClientWithBaseURI(baseURI string, subscriptionID string) Cer return CertificatesClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate create or update a certificate. +// CreateOrUpdate description for Create or update a certificate. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the certificate. @@ -97,7 +97,7 @@ func (client CertificatesClient) CreateOrUpdatePreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -132,7 +132,7 @@ func (client CertificatesClient) CreateOrUpdateResponder(resp *http.Response) (r return } -// Delete delete a certificate. +// Delete description for Delete a certificate. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the certificate. @@ -184,7 +184,7 @@ func (client CertificatesClient) DeletePreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -216,7 +216,7 @@ func (client CertificatesClient) DeleteResponder(resp *http.Response) (result au return } -// Get get a certificate. +// Get description for Get a certificate. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the certificate. @@ -268,7 +268,7 @@ func (client CertificatesClient) GetPreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -301,7 +301,7 @@ func (client CertificatesClient) GetResponder(resp *http.Response) (result Certi return } -// List get all certificates for a subscription. +// List description for Get all certificates for a subscription. func (client CertificatesClient) List(ctx context.Context) (result CertificateCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/CertificatesClient.List") @@ -341,7 +341,7 @@ func (client CertificatesClient) ListPreparer(ctx context.Context) (*http.Reques "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -411,7 +411,7 @@ func (client CertificatesClient) ListComplete(ctx context.Context) (result Certi return } -// ListByResourceGroup get all certificates in a resource group. +// ListByResourceGroup description for Get all certificates in a resource group. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. func (client CertificatesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result CertificateCollectionPage, err error) { @@ -462,7 +462,7 @@ func (client CertificatesClient) ListByResourceGroupPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -532,7 +532,7 @@ func (client CertificatesClient) ListByResourceGroupComplete(ctx context.Context return } -// Update create or update a certificate. +// Update description for Create or update a certificate. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the certificate. @@ -585,7 +585,7 @@ func (client CertificatesClient) UpdatePreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/web/mgmt/2019-08-01/web/client.go b/services/web/mgmt/2019-08-01/web/client.go index f78f9c228a0a..d00bd9328522 100644 --- a/services/web/mgmt/2019-08-01/web/client.go +++ b/services/web/mgmt/2019-08-01/web/client.go @@ -1,4 +1,4 @@ -// Package web implements the Azure ARM Web service API version 2018-02-01. +// Package web implements the Azure ARM Web service API version 2019-08-01. // // WebSite Management Client package web @@ -55,7 +55,7 @@ func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { } } -// CheckNameAvailability check if a resource name is available. +// CheckNameAvailability description for Check if a resource name is available. // Parameters: // request - name availability request. func (client BaseClient) CheckNameAvailability(ctx context.Context, request ResourceNameAvailabilityRequest) (result ResourceNameAvailability, err error) { @@ -102,7 +102,7 @@ func (client BaseClient) CheckNameAvailabilityPreparer(ctx context.Context, requ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -137,7 +137,7 @@ func (client BaseClient) CheckNameAvailabilityResponder(resp *http.Response) (re return } -// GetPublishingUser gets publishing user +// GetPublishingUser description for Gets publishing user func (client BaseClient) GetPublishingUser(ctx context.Context) (result User, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPublishingUser") @@ -172,7 +172,7 @@ func (client BaseClient) GetPublishingUser(ctx context.Context) (result User, er // GetPublishingUserPreparer prepares the GetPublishingUser request. func (client BaseClient) GetPublishingUserPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -205,7 +205,7 @@ func (client BaseClient) GetPublishingUserResponder(resp *http.Response) (result return } -// GetSourceControl gets source control token +// GetSourceControl description for Gets source control token // Parameters: // sourceControlType - type of source control func (client BaseClient) GetSourceControl(ctx context.Context, sourceControlType string) (result SourceControl, err error) { @@ -246,7 +246,7 @@ func (client BaseClient) GetSourceControlPreparer(ctx context.Context, sourceCon "sourceControlType": autorest.Encode("path", sourceControlType), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -279,7 +279,7 @@ func (client BaseClient) GetSourceControlResponder(resp *http.Response) (result return } -// GetSubscriptionDeploymentLocations gets list of available geo regions plus ministamps +// GetSubscriptionDeploymentLocations description for Gets list of available geo regions plus ministamps func (client BaseClient) GetSubscriptionDeploymentLocations(ctx context.Context) (result DeploymentLocations, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetSubscriptionDeploymentLocations") @@ -318,7 +318,7 @@ func (client BaseClient) GetSubscriptionDeploymentLocationsPreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -351,7 +351,7 @@ func (client BaseClient) GetSubscriptionDeploymentLocationsResponder(resp *http. return } -// ListBillingMeters gets a list of meters for a given location. +// ListBillingMeters description for Gets a list of meters for a given location. // Parameters: // billingLocation - azure Location of billable resource // osType - app Service OS type meters used for @@ -394,7 +394,7 @@ func (client BaseClient) ListBillingMetersPreparer(ctx context.Context, billingL "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -470,7 +470,7 @@ func (client BaseClient) ListBillingMetersComplete(ctx context.Context, billingL return } -// ListGeoRegions get a list of available geographical regions. +// ListGeoRegions description for Get a list of available geographical regions. // Parameters: // sku - name of SKU used to filter the regions. // linuxWorkersEnabled - specify true if you want to filter to only regions that support Linux @@ -518,7 +518,7 @@ func (client BaseClient) ListGeoRegionsPreparer(ctx context.Context, sku SkuName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -600,7 +600,7 @@ func (client BaseClient) ListGeoRegionsComplete(ctx context.Context, sku SkuName return } -// ListPremierAddOnOffers list all premier add-on offers. +// ListPremierAddOnOffers description for List all premier add-on offers. func (client BaseClient) ListPremierAddOnOffers(ctx context.Context) (result PremierAddOnOfferCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListPremierAddOnOffers") @@ -640,7 +640,7 @@ func (client BaseClient) ListPremierAddOnOffersPreparer(ctx context.Context) (*h "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -710,7 +710,7 @@ func (client BaseClient) ListPremierAddOnOffersComplete(ctx context.Context) (re return } -// ListSiteIdentifiersAssignedToHostName list all apps that are assigned to a hostname. +// ListSiteIdentifiersAssignedToHostName description for List all apps that are assigned to a hostname. // Parameters: // nameIdentifier - hostname information. func (client BaseClient) ListSiteIdentifiersAssignedToHostName(ctx context.Context, nameIdentifier NameIdentifier) (result IdentifierCollectionPage, err error) { @@ -752,7 +752,7 @@ func (client BaseClient) ListSiteIdentifiersAssignedToHostNamePreparer(ctx conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -824,7 +824,7 @@ func (client BaseClient) ListSiteIdentifiersAssignedToHostNameComplete(ctx conte return } -// ListSkus list all SKUs. +// ListSkus description for List all SKUs. func (client BaseClient) ListSkus(ctx context.Context) (result SkuInfos, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListSkus") @@ -863,7 +863,7 @@ func (client BaseClient) ListSkusPreparer(ctx context.Context) (*http.Request, e "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -896,7 +896,7 @@ func (client BaseClient) ListSkusResponder(resp *http.Response) (result SkuInfos return } -// ListSourceControls gets the source controls available for Azure websites. +// ListSourceControls description for Gets the source controls available for Azure websites. func (client BaseClient) ListSourceControls(ctx context.Context) (result SourceControlCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListSourceControls") @@ -932,7 +932,7 @@ func (client BaseClient) ListSourceControls(ctx context.Context) (result SourceC // ListSourceControlsPreparer prepares the ListSourceControls request. func (client BaseClient) ListSourceControlsPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1002,7 +1002,7 @@ func (client BaseClient) ListSourceControlsComplete(ctx context.Context) (result return } -// Move move resources between resource groups. +// Move description for Move resources between resource groups. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // moveResourceEnvelope - object that represents the resource to move. @@ -1059,7 +1059,7 @@ func (client BaseClient) MovePreparer(ctx context.Context, resourceGroupName str "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1093,7 +1093,7 @@ func (client BaseClient) MoveResponder(resp *http.Response) (result autorest.Res return } -// UpdatePublishingUser updates publishing user +// UpdatePublishingUser description for Updates publishing user // Parameters: // userDetails - details of publishing user func (client BaseClient) UpdatePublishingUser(ctx context.Context, userDetails User) (result User, err error) { @@ -1137,7 +1137,7 @@ func (client BaseClient) UpdatePublishingUser(ctx context.Context, userDetails U // UpdatePublishingUserPreparer prepares the UpdatePublishingUser request. func (client BaseClient) UpdatePublishingUserPreparer(ctx context.Context, userDetails User) (*http.Request, error) { - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1172,7 +1172,7 @@ func (client BaseClient) UpdatePublishingUserResponder(resp *http.Response) (res return } -// UpdateSourceControl updates source control token +// UpdateSourceControl description for Updates source control token // Parameters: // sourceControlType - type of source control // requestMessage - source control token information @@ -1214,7 +1214,7 @@ func (client BaseClient) UpdateSourceControlPreparer(ctx context.Context, source "sourceControlType": autorest.Encode("path", sourceControlType), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1249,7 +1249,7 @@ func (client BaseClient) UpdateSourceControlResponder(resp *http.Response) (resu return } -// Validate validate if a resource can be created. +// Validate description for Validate if a resource can be created. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // validateRequest - request with the resources to validate. @@ -1307,7 +1307,7 @@ func (client BaseClient) ValidatePreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1342,92 +1342,7 @@ func (client BaseClient) ValidateResponder(resp *http.Response) (result Validate return } -// ValidateContainerSettings validate if the container settings are correct. -// Parameters: -// resourceGroupName - name of the resource group to which the resource belongs. -func (client BaseClient) ValidateContainerSettings(ctx context.Context, validateContainerSettingsRequest ValidateContainerSettingsRequest, resourceGroupName string) (result SetObject, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ValidateContainerSettings") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("web.BaseClient", "ValidateContainerSettings", err.Error()) - } - - req, err := client.ValidateContainerSettingsPreparer(ctx, validateContainerSettingsRequest, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "web.BaseClient", "ValidateContainerSettings", nil, "Failure preparing request") - return - } - - resp, err := client.ValidateContainerSettingsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "web.BaseClient", "ValidateContainerSettings", resp, "Failure sending request") - return - } - - result, err = client.ValidateContainerSettingsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.BaseClient", "ValidateContainerSettings", resp, "Failure responding to request") - } - - return -} - -// ValidateContainerSettingsPreparer prepares the ValidateContainerSettings request. -func (client BaseClient) ValidateContainerSettingsPreparer(ctx context.Context, validateContainerSettingsRequest ValidateContainerSettingsRequest, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-02-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/validateContainerSettings", pathParameters), - autorest.WithJSON(validateContainerSettingsRequest), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ValidateContainerSettingsSender sends the ValidateContainerSettings request. The method will close the -// http.Response Body if it receives an error. -func (client BaseClient) ValidateContainerSettingsSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ValidateContainerSettingsResponder handles the response to the ValidateContainerSettings request. The method always -// closes the http.Response Body. -func (client BaseClient) ValidateContainerSettingsResponder(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 -} - -// ValidateMove validate whether a resource can be moved. +// ValidateMove description for Validate whether a resource can be moved. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // moveResourceEnvelope - object that represents the resource to move. @@ -1484,7 +1399,7 @@ func (client BaseClient) ValidateMovePreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1518,8 +1433,8 @@ func (client BaseClient) ValidateMoveResponder(resp *http.Response) (result auto return } -// VerifyHostingEnvironmentVnet verifies if this VNET is compatible with an App Service Environment by analyzing the -// Network Security Group rules. +// VerifyHostingEnvironmentVnet description for Verifies if this VNET is compatible with an App Service Environment by +// analyzing the Network Security Group rules. // Parameters: // parameters - VNET information func (client BaseClient) VerifyHostingEnvironmentVnet(ctx context.Context, parameters VnetParameters) (result VnetValidationFailureDetails, err error) { @@ -1560,7 +1475,7 @@ func (client BaseClient) VerifyHostingEnvironmentVnetPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/web/mgmt/2019-08-01/web/deletedwebapps.go b/services/web/mgmt/2019-08-01/web/deletedwebapps.go index 46a014df4b9e..2d9a5c49caed 100644 --- a/services/web/mgmt/2019-08-01/web/deletedwebapps.go +++ b/services/web/mgmt/2019-08-01/web/deletedwebapps.go @@ -40,7 +40,7 @@ func NewDeletedWebAppsClientWithBaseURI(baseURI string, subscriptionID string) D return DeletedWebAppsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// GetDeletedWebAppByLocation get deleted app for a subscription at location. +// GetDeletedWebAppByLocation description for Get deleted app for a subscription at location. // Parameters: // deletedSiteID - the numeric ID of the deleted app, e.g. 12345 func (client DeletedWebAppsClient) GetDeletedWebAppByLocation(ctx context.Context, location string, deletedSiteID string) (result DeletedSite, err error) { @@ -83,7 +83,7 @@ func (client DeletedWebAppsClient) GetDeletedWebAppByLocationPreparer(ctx contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -116,7 +116,7 @@ func (client DeletedWebAppsClient) GetDeletedWebAppByLocationResponder(resp *htt return } -// List get all deleted apps for a subscription. +// List description for Get all deleted apps for a subscription. func (client DeletedWebAppsClient) List(ctx context.Context) (result DeletedWebAppCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/DeletedWebAppsClient.List") @@ -156,7 +156,7 @@ func (client DeletedWebAppsClient) ListPreparer(ctx context.Context) (*http.Requ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -226,7 +226,7 @@ func (client DeletedWebAppsClient) ListComplete(ctx context.Context) (result Del return } -// ListByLocation get all deleted apps for a subscription at location +// ListByLocation description for Get all deleted apps for a subscription at location func (client DeletedWebAppsClient) ListByLocation(ctx context.Context, location string) (result DeletedWebAppCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/DeletedWebAppsClient.ListByLocation") @@ -267,7 +267,7 @@ func (client DeletedWebAppsClient) ListByLocationPreparer(ctx context.Context, l "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/web/mgmt/2019-08-01/web/diagnostics.go b/services/web/mgmt/2019-08-01/web/diagnostics.go index b6c4d90884b1..6ae727b35a28 100644 --- a/services/web/mgmt/2019-08-01/web/diagnostics.go +++ b/services/web/mgmt/2019-08-01/web/diagnostics.go @@ -42,7 +42,7 @@ func NewDiagnosticsClientWithBaseURI(baseURI string, subscriptionID string) Diag return DiagnosticsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// ExecuteSiteAnalysis execute Analysis +// ExecuteSiteAnalysis description for Execute Analysis // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // siteName - site Name @@ -104,7 +104,7 @@ func (client DiagnosticsClient) ExecuteSiteAnalysisPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -146,7 +146,7 @@ func (client DiagnosticsClient) ExecuteSiteAnalysisResponder(resp *http.Response return } -// ExecuteSiteAnalysisSlot execute Analysis +// ExecuteSiteAnalysisSlot description for Execute Analysis // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // siteName - site Name @@ -210,7 +210,7 @@ func (client DiagnosticsClient) ExecuteSiteAnalysisSlotPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -252,7 +252,7 @@ func (client DiagnosticsClient) ExecuteSiteAnalysisSlotResponder(resp *http.Resp return } -// ExecuteSiteDetector execute Detector +// ExecuteSiteDetector description for Execute Detector // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // siteName - site Name @@ -314,7 +314,7 @@ func (client DiagnosticsClient) ExecuteSiteDetectorPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -356,7 +356,7 @@ func (client DiagnosticsClient) ExecuteSiteDetectorResponder(resp *http.Response return } -// ExecuteSiteDetectorSlot execute Detector +// ExecuteSiteDetectorSlot description for Execute Detector // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // siteName - site Name @@ -420,7 +420,7 @@ func (client DiagnosticsClient) ExecuteSiteDetectorSlotPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -462,7 +462,7 @@ func (client DiagnosticsClient) ExecuteSiteDetectorSlotResponder(resp *http.Resp return } -// GetHostingEnvironmentDetectorResponse get Hosting Environment Detector Response +// GetHostingEnvironmentDetectorResponse description for Get Hosting Environment Detector Response // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - app Service Environment Name @@ -522,7 +522,7 @@ func (client DiagnosticsClient) GetHostingEnvironmentDetectorResponsePreparer(ct "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -564,13 +564,13 @@ func (client DiagnosticsClient) GetHostingEnvironmentDetectorResponseResponder(r return } -// GetSiteAnalysis get Site Analysis +// GetSiteAnalysis description for Get Site Analysis // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // siteName - site Name // diagnosticCategory - diagnostic Category // analysisName - analysis Name -func (client DiagnosticsClient) GetSiteAnalysis(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, analysisName string) (result DiagnosticAnalysis, err error) { +func (client DiagnosticsClient) GetSiteAnalysis(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, analysisName string) (result AnalysisDefinition, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticsClient.GetSiteAnalysis") defer func() { @@ -620,7 +620,7 @@ func (client DiagnosticsClient) GetSiteAnalysisPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -642,7 +642,7 @@ func (client DiagnosticsClient) GetSiteAnalysisSender(req *http.Request) (*http. // GetSiteAnalysisResponder handles the response to the GetSiteAnalysis request. The method always // closes the http.Response Body. -func (client DiagnosticsClient) GetSiteAnalysisResponder(resp *http.Response) (result DiagnosticAnalysis, err error) { +func (client DiagnosticsClient) GetSiteAnalysisResponder(resp *http.Response) (result AnalysisDefinition, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -653,14 +653,14 @@ func (client DiagnosticsClient) GetSiteAnalysisResponder(resp *http.Response) (r return } -// GetSiteAnalysisSlot get Site Analysis +// GetSiteAnalysisSlot description for Get Site Analysis // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // siteName - site Name // diagnosticCategory - diagnostic Category // analysisName - analysis Name // slot - slot - optional -func (client DiagnosticsClient) GetSiteAnalysisSlot(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, analysisName string, slot string) (result DiagnosticAnalysis, err error) { +func (client DiagnosticsClient) GetSiteAnalysisSlot(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, analysisName string, slot string) (result AnalysisDefinition, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticsClient.GetSiteAnalysisSlot") defer func() { @@ -711,7 +711,7 @@ func (client DiagnosticsClient) GetSiteAnalysisSlotPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -733,7 +733,7 @@ func (client DiagnosticsClient) GetSiteAnalysisSlotSender(req *http.Request) (*h // GetSiteAnalysisSlotResponder handles the response to the GetSiteAnalysisSlot request. The method always // closes the http.Response Body. -func (client DiagnosticsClient) GetSiteAnalysisSlotResponder(resp *http.Response) (result DiagnosticAnalysis, err error) { +func (client DiagnosticsClient) GetSiteAnalysisSlotResponder(resp *http.Response) (result AnalysisDefinition, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -744,19 +744,19 @@ func (client DiagnosticsClient) GetSiteAnalysisSlotResponder(resp *http.Response return } -// GetSiteDetector get Detector +// GetSiteDetector description for Get Detector // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // siteName - site Name // diagnosticCategory - diagnostic Category // detectorName - detector Name -func (client DiagnosticsClient) GetSiteDetector(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, detectorName string) (result DiagnosticDetectorCollectionPage, err error) { +func (client DiagnosticsClient) GetSiteDetector(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, detectorName string) (result DetectorDefinition, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticsClient.GetSiteDetector") defer func() { sc := -1 - if result.ddc.Response.Response != nil { - sc = result.ddc.Response.Response.StatusCode + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -769,7 +769,6 @@ func (client DiagnosticsClient) GetSiteDetector(ctx context.Context, resourceGro return result, validation.NewError("web.DiagnosticsClient", "GetSiteDetector", err.Error()) } - result.fn = client.getSiteDetectorNextResults req, err := client.GetSiteDetectorPreparer(ctx, resourceGroupName, siteName, diagnosticCategory, detectorName) if err != nil { err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "GetSiteDetector", nil, "Failure preparing request") @@ -778,12 +777,12 @@ func (client DiagnosticsClient) GetSiteDetector(ctx context.Context, resourceGro resp, err := client.GetSiteDetectorSender(req) if err != nil { - result.ddc.Response = autorest.Response{Response: resp} + result.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "GetSiteDetector", resp, "Failure sending request") return } - result.ddc, err = client.GetSiteDetectorResponder(resp) + result, err = client.GetSiteDetectorResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "GetSiteDetector", resp, "Failure responding to request") } @@ -801,7 +800,7 @@ func (client DiagnosticsClient) GetSiteDetectorPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -823,7 +822,7 @@ func (client DiagnosticsClient) GetSiteDetectorSender(req *http.Request) (*http. // GetSiteDetectorResponder handles the response to the GetSiteDetector request. The method always // closes the http.Response Body. -func (client DiagnosticsClient) GetSiteDetectorResponder(resp *http.Response) (result DiagnosticDetectorCollection, err error) { +func (client DiagnosticsClient) GetSiteDetectorResponder(resp *http.Response) (result DetectorDefinition, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -834,44 +833,7 @@ func (client DiagnosticsClient) GetSiteDetectorResponder(resp *http.Response) (r return } -// getSiteDetectorNextResults retrieves the next set of results, if any. -func (client DiagnosticsClient) getSiteDetectorNextResults(ctx context.Context, lastResults DiagnosticDetectorCollection) (result DiagnosticDetectorCollection, err error) { - req, err := lastResults.diagnosticDetectorCollectionPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "web.DiagnosticsClient", "getSiteDetectorNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.GetSiteDetectorSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "web.DiagnosticsClient", "getSiteDetectorNextResults", resp, "Failure sending next results request") - } - result, err = client.GetSiteDetectorResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "getSiteDetectorNextResults", resp, "Failure responding to next results request") - } - return -} - -// GetSiteDetectorComplete enumerates all values, automatically crossing page boundaries as required. -func (client DiagnosticsClient) GetSiteDetectorComplete(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, detectorName string) (result DiagnosticDetectorCollectionIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticsClient.GetSiteDetector") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.GetSiteDetector(ctx, resourceGroupName, siteName, diagnosticCategory, detectorName) - return -} - -// GetSiteDetectorResponse get site detector response +// GetSiteDetectorResponse description for Get site detector response // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // siteName - site Name @@ -931,7 +893,7 @@ func (client DiagnosticsClient) GetSiteDetectorResponsePreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -973,7 +935,7 @@ func (client DiagnosticsClient) GetSiteDetectorResponseResponder(resp *http.Resp return } -// GetSiteDetectorResponseSlot get site detector response +// GetSiteDetectorResponseSlot description for Get site detector response // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // siteName - site Name @@ -1035,7 +997,7 @@ func (client DiagnosticsClient) GetSiteDetectorResponseSlotPreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1077,20 +1039,20 @@ func (client DiagnosticsClient) GetSiteDetectorResponseSlotResponder(resp *http. return } -// GetSiteDetectorSlot get Detector +// GetSiteDetectorSlot description for Get Detector // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // siteName - site Name // diagnosticCategory - diagnostic Category // detectorName - detector Name // slot - slot Name -func (client DiagnosticsClient) GetSiteDetectorSlot(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, detectorName string, slot string) (result DiagnosticDetectorCollectionPage, err error) { +func (client DiagnosticsClient) GetSiteDetectorSlot(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, detectorName string, slot string) (result DetectorDefinition, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticsClient.GetSiteDetectorSlot") defer func() { sc := -1 - if result.ddc.Response.Response != nil { - sc = result.ddc.Response.Response.StatusCode + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1103,7 +1065,6 @@ func (client DiagnosticsClient) GetSiteDetectorSlot(ctx context.Context, resourc return result, validation.NewError("web.DiagnosticsClient", "GetSiteDetectorSlot", err.Error()) } - result.fn = client.getSiteDetectorSlotNextResults req, err := client.GetSiteDetectorSlotPreparer(ctx, resourceGroupName, siteName, diagnosticCategory, detectorName, slot) if err != nil { err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "GetSiteDetectorSlot", nil, "Failure preparing request") @@ -1112,12 +1073,12 @@ func (client DiagnosticsClient) GetSiteDetectorSlot(ctx context.Context, resourc resp, err := client.GetSiteDetectorSlotSender(req) if err != nil { - result.ddc.Response = autorest.Response{Response: resp} + result.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "GetSiteDetectorSlot", resp, "Failure sending request") return } - result.ddc, err = client.GetSiteDetectorSlotResponder(resp) + result, err = client.GetSiteDetectorSlotResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "GetSiteDetectorSlot", resp, "Failure responding to request") } @@ -1136,7 +1097,7 @@ func (client DiagnosticsClient) GetSiteDetectorSlotPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1158,7 +1119,7 @@ func (client DiagnosticsClient) GetSiteDetectorSlotSender(req *http.Request) (*h // GetSiteDetectorSlotResponder handles the response to the GetSiteDetectorSlot request. The method always // closes the http.Response Body. -func (client DiagnosticsClient) GetSiteDetectorSlotResponder(resp *http.Response) (result DiagnosticDetectorCollection, err error) { +func (client DiagnosticsClient) GetSiteDetectorSlotResponder(resp *http.Response) (result DetectorDefinition, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -1169,44 +1130,7 @@ func (client DiagnosticsClient) GetSiteDetectorSlotResponder(resp *http.Response return } -// getSiteDetectorSlotNextResults retrieves the next set of results, if any. -func (client DiagnosticsClient) getSiteDetectorSlotNextResults(ctx context.Context, lastResults DiagnosticDetectorCollection) (result DiagnosticDetectorCollection, err error) { - req, err := lastResults.diagnosticDetectorCollectionPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "web.DiagnosticsClient", "getSiteDetectorSlotNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.GetSiteDetectorSlotSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "web.DiagnosticsClient", "getSiteDetectorSlotNextResults", resp, "Failure sending next results request") - } - result, err = client.GetSiteDetectorSlotResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "getSiteDetectorSlotNextResults", resp, "Failure responding to next results request") - } - return -} - -// GetSiteDetectorSlotComplete enumerates all values, automatically crossing page boundaries as required. -func (client DiagnosticsClient) GetSiteDetectorSlotComplete(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, detectorName string, slot string) (result DiagnosticDetectorCollectionIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticsClient.GetSiteDetectorSlot") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.GetSiteDetectorSlot(ctx, resourceGroupName, siteName, diagnosticCategory, detectorName, slot) - return -} - -// GetSiteDiagnosticCategory get Diagnostics Category +// GetSiteDiagnosticCategory description for Get Diagnostics Category // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // siteName - site Name @@ -1260,7 +1184,7 @@ func (client DiagnosticsClient) GetSiteDiagnosticCategoryPreparer(ctx context.Co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1293,7 +1217,7 @@ func (client DiagnosticsClient) GetSiteDiagnosticCategoryResponder(resp *http.Re return } -// GetSiteDiagnosticCategorySlot get Diagnostics Category +// GetSiteDiagnosticCategorySlot description for Get Diagnostics Category // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // siteName - site Name @@ -1349,7 +1273,7 @@ func (client DiagnosticsClient) GetSiteDiagnosticCategorySlotPreparer(ctx contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1382,7 +1306,7 @@ func (client DiagnosticsClient) GetSiteDiagnosticCategorySlotResponder(resp *htt return } -// ListHostingEnvironmentDetectorResponses list Hosting Environment Detector Responses +// ListHostingEnvironmentDetectorResponses description for List Hosting Environment Detector Responses // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - site Name @@ -1435,7 +1359,7 @@ func (client DiagnosticsClient) ListHostingEnvironmentDetectorResponsesPreparer( "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1505,7 +1429,7 @@ func (client DiagnosticsClient) ListHostingEnvironmentDetectorResponsesComplete( return } -// ListSiteAnalyses get Site Analyses +// ListSiteAnalyses description for Get Site Analyses // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // siteName - site Name @@ -1560,7 +1484,7 @@ func (client DiagnosticsClient) ListSiteAnalysesPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1630,7 +1554,7 @@ func (client DiagnosticsClient) ListSiteAnalysesComplete(ctx context.Context, re return } -// ListSiteAnalysesSlot get Site Analyses +// ListSiteAnalysesSlot description for Get Site Analyses // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // siteName - site Name @@ -1687,7 +1611,7 @@ func (client DiagnosticsClient) ListSiteAnalysesSlotPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1757,7 +1681,7 @@ func (client DiagnosticsClient) ListSiteAnalysesSlotComplete(ctx context.Context return } -// ListSiteDetectorResponses list Site Detector Responses +// ListSiteDetectorResponses description for List Site Detector Responses // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // siteName - site Name @@ -1810,7 +1734,7 @@ func (client DiagnosticsClient) ListSiteDetectorResponsesPreparer(ctx context.Co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1880,7 +1804,7 @@ func (client DiagnosticsClient) ListSiteDetectorResponsesComplete(ctx context.Co return } -// ListSiteDetectorResponsesSlot list Site Detector Responses +// ListSiteDetectorResponsesSlot description for List Site Detector Responses // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // siteName - site Name @@ -1935,7 +1859,7 @@ func (client DiagnosticsClient) ListSiteDetectorResponsesSlotPreparer(ctx contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -2005,7 +1929,7 @@ func (client DiagnosticsClient) ListSiteDetectorResponsesSlotComplete(ctx contex return } -// ListSiteDetectors get Detectors +// ListSiteDetectors description for Get Detectors // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // siteName - site Name @@ -2060,7 +1984,7 @@ func (client DiagnosticsClient) ListSiteDetectorsPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -2130,7 +2054,7 @@ func (client DiagnosticsClient) ListSiteDetectorsComplete(ctx context.Context, r return } -// ListSiteDetectorsSlot get Detectors +// ListSiteDetectorsSlot description for Get Detectors // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // siteName - site Name @@ -2187,7 +2111,7 @@ func (client DiagnosticsClient) ListSiteDetectorsSlotPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -2257,7 +2181,7 @@ func (client DiagnosticsClient) ListSiteDetectorsSlotComplete(ctx context.Contex return } -// ListSiteDiagnosticCategories get Diagnostics Categories +// ListSiteDiagnosticCategories description for Get Diagnostics Categories // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // siteName - site Name @@ -2310,7 +2234,7 @@ func (client DiagnosticsClient) ListSiteDiagnosticCategoriesPreparer(ctx context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -2380,7 +2304,7 @@ func (client DiagnosticsClient) ListSiteDiagnosticCategoriesComplete(ctx context return } -// ListSiteDiagnosticCategoriesSlot get Diagnostics Categories +// ListSiteDiagnosticCategoriesSlot description for Get Diagnostics Categories // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // siteName - site Name @@ -2435,7 +2359,7 @@ func (client DiagnosticsClient) ListSiteDiagnosticCategoriesSlotPreparer(ctx con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/web/mgmt/2019-08-01/web/domainregistrationprovider.go b/services/web/mgmt/2019-08-01/web/domainregistrationprovider.go index b289d1585171..b886fa4fde2d 100644 --- a/services/web/mgmt/2019-08-01/web/domainregistrationprovider.go +++ b/services/web/mgmt/2019-08-01/web/domainregistrationprovider.go @@ -40,7 +40,8 @@ func NewDomainRegistrationProviderClientWithBaseURI(baseURI string, subscription return DomainRegistrationProviderClient{NewWithBaseURI(baseURI, subscriptionID)} } -// ListOperations implements Csm operations Api to exposes the list of available Csm Apis under the resource provider +// ListOperations description for Implements Csm operations Api to exposes the list of available Csm Apis under the +// resource provider func (client DomainRegistrationProviderClient) ListOperations(ctx context.Context) (result CsmOperationCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/DomainRegistrationProviderClient.ListOperations") @@ -76,7 +77,7 @@ func (client DomainRegistrationProviderClient) ListOperations(ctx context.Contex // ListOperationsPreparer prepares the ListOperations request. func (client DomainRegistrationProviderClient) ListOperationsPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/web/mgmt/2019-08-01/web/domains.go b/services/web/mgmt/2019-08-01/web/domains.go index 1f6c3b749419..29a4fbec2377 100644 --- a/services/web/mgmt/2019-08-01/web/domains.go +++ b/services/web/mgmt/2019-08-01/web/domains.go @@ -41,10 +41,10 @@ func NewDomainsClientWithBaseURI(baseURI string, subscriptionID string) DomainsC return DomainsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CheckAvailability check if a domain is available for registration. +// CheckAvailability description for Check if a domain is available for registration. // Parameters: // identifier - name of the domain. -func (client DomainsClient) CheckAvailability(ctx context.Context, identifier NameIdentifier) (result DomainAvailablilityCheckResult, err error) { +func (client DomainsClient) CheckAvailability(ctx context.Context, identifier NameIdentifier) (result DomainAvailabilityCheckResult, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/DomainsClient.CheckAvailability") defer func() { @@ -82,7 +82,7 @@ func (client DomainsClient) CheckAvailabilityPreparer(ctx context.Context, ident "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -106,7 +106,7 @@ func (client DomainsClient) CheckAvailabilitySender(req *http.Request) (*http.Re // CheckAvailabilityResponder handles the response to the CheckAvailability request. The method always // closes the http.Response Body. -func (client DomainsClient) CheckAvailabilityResponder(resp *http.Response) (result DomainAvailablilityCheckResult, err error) { +func (client DomainsClient) CheckAvailabilityResponder(resp *http.Response) (result DomainAvailabilityCheckResult, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -117,7 +117,7 @@ func (client DomainsClient) CheckAvailabilityResponder(resp *http.Response) (res return } -// CreateOrUpdate creates or updates a domain. +// CreateOrUpdate description for Creates or updates a domain. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // domainName - name of the domain. @@ -222,7 +222,7 @@ func (client DomainsClient) CreateOrUpdatePreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -263,8 +263,8 @@ func (client DomainsClient) CreateOrUpdateResponder(resp *http.Response) (result return } -// CreateOrUpdateOwnershipIdentifier creates an ownership identifier for a domain or updates identifier details for an -// existing identifer +// CreateOrUpdateOwnershipIdentifier description for Creates an ownership identifier for a domain or updates identifier +// details for an existing identifer // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // domainName - name of domain. @@ -319,7 +319,7 @@ func (client DomainsClient) CreateOrUpdateOwnershipIdentifierPreparer(ctx contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -354,7 +354,7 @@ func (client DomainsClient) CreateOrUpdateOwnershipIdentifierResponder(resp *htt return } -// Delete delete a domain. +// Delete description for Delete a domain. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // domainName - name of the domain. @@ -408,7 +408,7 @@ func (client DomainsClient) DeletePreparer(ctx context.Context, resourceGroupNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -443,7 +443,7 @@ func (client DomainsClient) DeleteResponder(resp *http.Response) (result autores return } -// DeleteOwnershipIdentifier delete ownership identifier for domain +// DeleteOwnershipIdentifier description for Delete ownership identifier for domain // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // domainName - name of domain. @@ -497,7 +497,7 @@ func (client DomainsClient) DeleteOwnershipIdentifierPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -529,7 +529,7 @@ func (client DomainsClient) DeleteOwnershipIdentifierResponder(resp *http.Respon return } -// Get get a domain. +// Get description for Get a domain. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // domainName - name of the domain. @@ -581,7 +581,7 @@ func (client DomainsClient) GetPreparer(ctx context.Context, resourceGroupName s "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -614,7 +614,7 @@ func (client DomainsClient) GetResponder(resp *http.Response) (result Domain, er return } -// GetControlCenterSsoRequest generate a single sign-on request for the domain management portal. +// GetControlCenterSsoRequest description for Generate a single sign-on request for the domain management portal. func (client DomainsClient) GetControlCenterSsoRequest(ctx context.Context) (result DomainControlCenterSsoRequest, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/DomainsClient.GetControlCenterSsoRequest") @@ -653,7 +653,7 @@ func (client DomainsClient) GetControlCenterSsoRequestPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -686,7 +686,7 @@ func (client DomainsClient) GetControlCenterSsoRequestResponder(resp *http.Respo return } -// GetOwnershipIdentifier get ownership identifier for domain +// GetOwnershipIdentifier description for Get ownership identifier for domain // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // domainName - name of domain. @@ -740,7 +740,7 @@ func (client DomainsClient) GetOwnershipIdentifierPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -773,7 +773,7 @@ func (client DomainsClient) GetOwnershipIdentifierResponder(resp *http.Response) return } -// List get all domains in a subscription. +// List description for Get all domains in a subscription. func (client DomainsClient) List(ctx context.Context) (result DomainCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/DomainsClient.List") @@ -813,7 +813,7 @@ func (client DomainsClient) ListPreparer(ctx context.Context) (*http.Request, er "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -883,7 +883,7 @@ func (client DomainsClient) ListComplete(ctx context.Context) (result DomainColl return } -// ListByResourceGroup get all domains in a resource group. +// ListByResourceGroup description for Get all domains in a resource group. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. func (client DomainsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result DomainCollectionPage, err error) { @@ -934,7 +934,7 @@ func (client DomainsClient) ListByResourceGroupPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1004,7 +1004,7 @@ func (client DomainsClient) ListByResourceGroupComplete(ctx context.Context, res return } -// ListOwnershipIdentifiers lists domain ownership identifiers. +// ListOwnershipIdentifiers description for Lists domain ownership identifiers. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // domainName - name of domain. @@ -1057,7 +1057,7 @@ func (client DomainsClient) ListOwnershipIdentifiersPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1127,7 +1127,7 @@ func (client DomainsClient) ListOwnershipIdentifiersComplete(ctx context.Context return } -// ListRecommendations get domain name recommendations based on keywords. +// ListRecommendations description for Get domain name recommendations based on keywords. // Parameters: // parameters - search parameters for domain name recommendations. func (client DomainsClient) ListRecommendations(ctx context.Context, parameters DomainRecommendationSearchParameters) (result NameIdentifierCollectionPage, err error) { @@ -1169,7 +1169,7 @@ func (client DomainsClient) ListRecommendationsPreparer(ctx context.Context, par "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1241,7 +1241,7 @@ func (client DomainsClient) ListRecommendationsComplete(ctx context.Context, par return } -// Renew renew a domain. +// Renew description for Renew a domain. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // domainName - name of the domain. @@ -1293,7 +1293,7 @@ func (client DomainsClient) RenewPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1319,13 +1319,13 @@ func (client DomainsClient) RenewResponder(resp *http.Response) (result autorest err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent, http.StatusBadRequest, http.StatusInternalServerError), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp return } -// Update creates or updates a domain. +// Update description for Creates or updates a domain. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // domainName - name of the domain. @@ -1380,7 +1380,7 @@ func (client DomainsClient) UpdatePreparer(ctx context.Context, resourceGroupNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1415,8 +1415,8 @@ func (client DomainsClient) UpdateResponder(resp *http.Response) (result Domain, return } -// UpdateOwnershipIdentifier creates an ownership identifier for a domain or updates identifier details for an existing -// identifer +// UpdateOwnershipIdentifier description for Creates an ownership identifier for a domain or updates identifier details +// for an existing identifer // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // domainName - name of domain. @@ -1471,7 +1471,7 @@ func (client DomainsClient) UpdateOwnershipIdentifierPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/web/mgmt/2019-08-01/web/models.go b/services/web/mgmt/2019-08-01/web/models.go index f58d71d95a8e..d06b77a42eeb 100644 --- a/services/web/mgmt/2019-08-01/web/models.go +++ b/services/web/mgmt/2019-08-01/web/models.go @@ -375,6 +375,32 @@ func PossibleComputeModeOptionsValues() []ComputeModeOptions { return []ComputeModeOptions{ComputeModeOptionsDedicated, ComputeModeOptionsDynamic, ComputeModeOptionsShared} } +// ConfigReferenceLocation enumerates the values for config reference location. +type ConfigReferenceLocation string + +const ( + // ApplicationSetting ... + ApplicationSetting ConfigReferenceLocation = "ApplicationSetting" +) + +// PossibleConfigReferenceLocationValues returns an array of possible values for the ConfigReferenceLocation const type. +func PossibleConfigReferenceLocationValues() []ConfigReferenceLocation { + return []ConfigReferenceLocation{ApplicationSetting} +} + +// ConfigReferenceSource enumerates the values for config reference source. +type ConfigReferenceSource string + +const ( + // KeyVault ... + KeyVault ConfigReferenceSource = "KeyVault" +) + +// PossibleConfigReferenceSourceValues returns an array of possible values for the ConfigReferenceSource const type. +func PossibleConfigReferenceSourceValues() []ConfigReferenceSource { + return []ConfigReferenceSource{KeyVault} +} + // ConnectionStringType enumerates the values for connection string type. type ConnectionStringType string @@ -810,15 +836,13 @@ const ( ManagedServiceIdentityTypeNone ManagedServiceIdentityType = "None" // ManagedServiceIdentityTypeSystemAssigned ... ManagedServiceIdentityTypeSystemAssigned ManagedServiceIdentityType = "SystemAssigned" - // ManagedServiceIdentityTypeSystemAssignedUserAssigned ... - ManagedServiceIdentityTypeSystemAssignedUserAssigned ManagedServiceIdentityType = "SystemAssigned, UserAssigned" // ManagedServiceIdentityTypeUserAssigned ... ManagedServiceIdentityTypeUserAssigned ManagedServiceIdentityType = "UserAssigned" ) // PossibleManagedServiceIdentityTypeValues returns an array of possible values for the ManagedServiceIdentityType const type. func PossibleManagedServiceIdentityTypeValues() []ManagedServiceIdentityType { - return []ManagedServiceIdentityType{ManagedServiceIdentityTypeNone, ManagedServiceIdentityTypeSystemAssigned, ManagedServiceIdentityTypeSystemAssignedUserAssigned, ManagedServiceIdentityTypeUserAssigned} + return []ManagedServiceIdentityType{ManagedServiceIdentityTypeNone, ManagedServiceIdentityTypeSystemAssigned, ManagedServiceIdentityTypeUserAssigned} } // MSDeployLogEntryType enumerates the values for ms deploy log entry type. @@ -1009,6 +1033,35 @@ func PossibleRenderingTypeValues() []RenderingType { return []RenderingType{NoGraph, Table, TimeSeries, TimeSeriesPerInstance} } +// ResolveStatus enumerates the values for resolve status. +type ResolveStatus string + +const ( + // AccessToKeyVaultDenied ... + AccessToKeyVaultDenied ResolveStatus = "AccessToKeyVaultDenied" + // Initialized ... + Initialized ResolveStatus = "Initialized" + // InvalidSyntax ... + InvalidSyntax ResolveStatus = "InvalidSyntax" + // MSINotEnabled ... + MSINotEnabled ResolveStatus = "MSINotEnabled" + // OtherReasons ... + OtherReasons ResolveStatus = "OtherReasons" + // Resolved ... + Resolved ResolveStatus = "Resolved" + // SecretNotFound ... + SecretNotFound ResolveStatus = "SecretNotFound" + // SecretVersionNotFound ... + SecretVersionNotFound ResolveStatus = "SecretVersionNotFound" + // VaultNotFound ... + VaultNotFound ResolveStatus = "VaultNotFound" +) + +// PossibleResolveStatusValues returns an array of possible values for the ResolveStatus const type. +func PossibleResolveStatusValues() []ResolveStatus { + return []ResolveStatus{AccessToKeyVaultDenied, Initialized, InvalidSyntax, MSINotEnabled, OtherReasons, Resolved, SecretNotFound, SecretVersionNotFound, VaultNotFound} +} + // ResourceScopeType enumerates the values for resource scope type. type ResourceScopeType string @@ -1073,11 +1126,13 @@ const ( ScmTypeTfs ScmType = "Tfs" // ScmTypeVSO ... ScmTypeVSO ScmType = "VSO" + // ScmTypeVSTSRM ... + ScmTypeVSTSRM ScmType = "VSTSRM" ) // PossibleScmTypeValues returns an array of possible values for the ScmType const type. func PossibleScmTypeValues() []ScmType { - return []ScmType{ScmTypeBitbucketGit, ScmTypeBitbucketHg, ScmTypeCodePlexGit, ScmTypeCodePlexHg, ScmTypeDropbox, ScmTypeExternalGit, ScmTypeExternalHg, ScmTypeGitHub, ScmTypeLocalGit, ScmTypeNone, ScmTypeOneDrive, ScmTypeTfs, ScmTypeVSO} + return []ScmType{ScmTypeBitbucketGit, ScmTypeBitbucketHg, ScmTypeCodePlexGit, ScmTypeCodePlexHg, ScmTypeDropbox, ScmTypeExternalGit, ScmTypeExternalHg, ScmTypeGitHub, ScmTypeLocalGit, ScmTypeNone, ScmTypeOneDrive, ScmTypeTfs, ScmTypeVSO, ScmTypeVSTSRM} } // SiteAvailabilityState enumerates the values for site availability state. @@ -1133,6 +1188,23 @@ func PossibleSiteLoadBalancingValues() []SiteLoadBalancing { return []SiteLoadBalancing{LeastRequests, LeastResponseTime, RequestHash, WeightedRoundRobin, WeightedTotalTraffic} } +// SiteRuntimeState enumerates the values for site runtime state. +type SiteRuntimeState string + +const ( + // READY ... + READY SiteRuntimeState = "READY" + // STOPPED ... + STOPPED SiteRuntimeState = "STOPPED" + // UNKNOWN ... + UNKNOWN SiteRuntimeState = "UNKNOWN" +) + +// PossibleSiteRuntimeStateValues returns an array of possible values for the SiteRuntimeState const type. +func PossibleSiteRuntimeStateValues() []SiteRuntimeState { + return []SiteRuntimeState{READY, STOPPED, UNKNOWN} +} + // SkuName enumerates the values for sku name. type SkuName string @@ -1310,13 +1382,15 @@ const ( WorkerSizeOptionsLarge WorkerSizeOptions = "Large" // WorkerSizeOptionsMedium ... WorkerSizeOptionsMedium WorkerSizeOptions = "Medium" + // WorkerSizeOptionsNestedSmall ... + WorkerSizeOptionsNestedSmall WorkerSizeOptions = "NestedSmall" // WorkerSizeOptionsSmall ... WorkerSizeOptionsSmall WorkerSizeOptions = "Small" ) // PossibleWorkerSizeOptionsValues returns an array of possible values for the WorkerSizeOptions const type. func PossibleWorkerSizeOptionsValues() []WorkerSizeOptions { - return []WorkerSizeOptions{WorkerSizeOptionsD1, WorkerSizeOptionsD2, WorkerSizeOptionsD3, WorkerSizeOptionsDefault, WorkerSizeOptionsLarge, WorkerSizeOptionsMedium, WorkerSizeOptionsSmall} + return []WorkerSizeOptions{WorkerSizeOptionsD1, WorkerSizeOptionsD2, WorkerSizeOptionsD3, WorkerSizeOptionsDefault, WorkerSizeOptionsLarge, WorkerSizeOptionsMedium, WorkerSizeOptionsNestedSmall, WorkerSizeOptionsSmall} } // AbnormalTimePeriod class representing Abnormal Time Period identified in diagnosis @@ -1350,6 +1424,92 @@ type Address struct { // AddressResponse describes main public IP address and any extra virtual IPs. type AddressResponse struct { autorest.Response `json:"-"` + // AddressResponseProperties - AddressResponse resource specific properties + *AddressResponseProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AddressResponse. +func (ar AddressResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ar.AddressResponseProperties != nil { + objectMap["properties"] = ar.AddressResponseProperties + } + if ar.Kind != nil { + objectMap["kind"] = ar.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AddressResponse struct. +func (ar *AddressResponse) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var addressResponseProperties AddressResponseProperties + err = json.Unmarshal(*v, &addressResponseProperties) + if err != nil { + return err + } + ar.AddressResponseProperties = &addressResponseProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ar.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ar.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ar.Type = &typeVar + } + } + } + + return nil +} + +// AddressResponseProperties addressResponse resource specific properties +type AddressResponseProperties struct { // ServiceIPAddress - Main public virtual IP. ServiceIPAddress *string `json:"serviceIpAddress,omitempty"` // InternalIPAddress - Virtual Network internal IP address of the App Service Environment if it is in internal load-balancing mode. @@ -1376,6 +1536,7 @@ type AnalysisData struct { // AnalysisDefinition definition of Analysis type AnalysisDefinition struct { + autorest.Response `json:"-"` // AnalysisDefinitionProperties - AnalysisDefinition resource specific properties *AnalysisDefinitionProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource Id. @@ -1472,6 +1633,29 @@ type APIDefinitionInfo struct { URL *string `json:"url,omitempty"` } +// APIKVReference description of site key vault references. +type APIKVReference struct { + Reference *string `json:"reference,omitempty"` + // Status - Possible values include: 'Initialized', 'Resolved', 'InvalidSyntax', 'MSINotEnabled', 'VaultNotFound', 'SecretNotFound', 'SecretVersionNotFound', 'AccessToKeyVaultDenied', 'OtherReasons' + Status ResolveStatus `json:"status,omitempty"` + VaultName *string `json:"vaultName,omitempty"` + SecretName *string `json:"secretName,omitempty"` + SecretVersion *string `json:"secretVersion,omitempty"` + // IdentityType - Possible values include: 'ManagedServiceIdentityTypeNone', 'ManagedServiceIdentityTypeSystemAssigned', 'ManagedServiceIdentityTypeUserAssigned' + IdentityType ManagedServiceIdentityType `json:"identityType,omitempty"` + Details *string `json:"details,omitempty"` + // Source - Possible values include: 'KeyVault' + Source ConfigReferenceSource `json:"source,omitempty"` + // Location - Possible values include: 'ApplicationSetting' + Location ConfigReferenceLocation `json:"location,omitempty"` +} + +// APIManagementConfig azure API management (APIM) configuration linked to the app. +type APIManagementConfig struct { + // ID - APIM-Api Identifier. + ID *string `json:"id,omitempty"` +} + // AppCollection collection of App Service apps. type AppCollection struct { autorest.Response `json:"-"` @@ -1792,12 +1976,13 @@ type ApplicationStack struct { type ApplicationStackCollection struct { autorest.Response `json:"-"` // Value - Collection of resources. - Value *[]ApplicationStack `json:"value,omitempty"` + Value *[]ApplicationStackResource `json:"value,omitempty"` // NextLink - READ-ONLY; Link to next page of resources. NextLink *string `json:"nextLink,omitempty"` } -// ApplicationStackCollectionIterator provides access to a complete listing of ApplicationStack values. +// ApplicationStackCollectionIterator provides access to a complete listing of ApplicationStackResource +// values. type ApplicationStackCollectionIterator struct { i int page ApplicationStackCollectionPage @@ -1848,9 +2033,9 @@ func (iter ApplicationStackCollectionIterator) Response() ApplicationStackCollec // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. -func (iter ApplicationStackCollectionIterator) Value() ApplicationStack { +func (iter ApplicationStackCollectionIterator) Value() ApplicationStackResource { if !iter.page.NotDone() { - return ApplicationStack{} + return ApplicationStackResource{} } return iter.page.Values()[iter.i] } @@ -1877,7 +2062,7 @@ func (asc ApplicationStackCollection) applicationStackCollectionPreparer(ctx con autorest.WithBaseURL(to.String(asc.NextLink))) } -// ApplicationStackCollectionPage contains a page of ApplicationStack values. +// ApplicationStackCollectionPage contains a page of ApplicationStackResource values. type ApplicationStackCollectionPage struct { fn func(context.Context, ApplicationStackCollection) (ApplicationStackCollection, error) asc ApplicationStackCollection @@ -1922,7 +2107,7 @@ func (page ApplicationStackCollectionPage) Response() ApplicationStackCollection } // Values returns the slice of values for the current page or nil if there are no values. -func (page ApplicationStackCollectionPage) Values() []ApplicationStack { +func (page ApplicationStackCollectionPage) Values() []ApplicationStackResource { if page.asc.IsEmpty() { return nil } @@ -1934,6 +2119,138 @@ func NewApplicationStackCollectionPage(getNextPage func(context.Context, Applica return ApplicationStackCollectionPage{fn: getNextPage} } +// ApplicationStackResource ARM resource for a ApplicationStack. +type ApplicationStackResource struct { + // ApplicationStack - Core resource properties + *ApplicationStack `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ApplicationStackResource. +func (asr ApplicationStackResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asr.ApplicationStack != nil { + objectMap["properties"] = asr.ApplicationStack + } + if asr.Kind != nil { + objectMap["kind"] = asr.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ApplicationStackResource struct. +func (asr *ApplicationStackResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var applicationStack ApplicationStack + err = json.Unmarshal(*v, &applicationStack) + if err != nil { + return err + } + asr.ApplicationStack = &applicationStack + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + asr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + asr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + asr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + asr.Type = &typeVar + } + } + } + + return nil +} + +// AppsCopyProductionSlotFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type AppsCopyProductionSlotFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *AppsCopyProductionSlotFuture) Result(client AppsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCopyProductionSlotFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("web.AppsCopyProductionSlotFuture") + return + } + ar.Response = future.Response() + return +} + +// AppsCopySlotSlotFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type AppsCopySlotSlotFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *AppsCopySlotSlotFuture) Result(client AppsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCopySlotSlotFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("web.AppsCopySlotSlotFuture") + return + } + ar.Response = future.Response() + return +} + // AppsCreateFunctionFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type AppsCreateFunctionFuture struct { @@ -6194,6 +6511,8 @@ type CertificatePatchResourceProperties struct { KeyVaultSecretStatus KeyVaultSecretStatus `json:"keyVaultSecretStatus,omitempty"` // ServerFarmID - Resource ID of the associated App Service plan, formatted as: "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". ServerFarmID *string `json:"serverFarmId,omitempty"` + // CanonicalName - CNAME of the certificate to be issued via free certificate + CanonicalName *string `json:"canonicalName,omitempty"` } // CertificateProperties certificate resource specific properties @@ -6236,6 +6555,8 @@ type CertificateProperties struct { KeyVaultSecretStatus KeyVaultSecretStatus `json:"keyVaultSecretStatus,omitempty"` // ServerFarmID - Resource ID of the associated App Service plan, formatted as: "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". ServerFarmID *string `json:"serverFarmId,omitempty"` + // CanonicalName - CNAME of the certificate to be issued via free certificate + CanonicalName *string `json:"canonicalName,omitempty"` } // CloningInfo information needed for cloning operation. @@ -6377,6 +6698,60 @@ type Contact struct { Phone *string `json:"phone,omitempty"` } +// ContainerCPUStatistics ... +type ContainerCPUStatistics struct { + CPUUsage *ContainerCPUUsage `json:"cpuUsage,omitempty"` + SystemCPUUsage *int64 `json:"systemCpuUsage,omitempty"` + OnlineCPUCount *int32 `json:"onlineCpuCount,omitempty"` + ThrottlingData *ContainerThrottlingData `json:"throttlingData,omitempty"` +} + +// ContainerCPUUsage ... +type ContainerCPUUsage struct { + TotalUsage *int64 `json:"totalUsage,omitempty"` + PerCPUUsage *[]int64 `json:"perCpuUsage,omitempty"` + KernelModeUsage *int64 `json:"kernelModeUsage,omitempty"` + UserModeUsage *int64 `json:"userModeUsage,omitempty"` +} + +// ContainerInfo ... +type ContainerInfo struct { + CurrentTimeStamp *date.Time `json:"currentTimeStamp,omitempty"` + PreviousTimeStamp *date.Time `json:"previousTimeStamp,omitempty"` + CurrentCPUStats *ContainerCPUStatistics `json:"currentCpuStats,omitempty"` + PreviousCPUStats *ContainerCPUStatistics `json:"previousCpuStats,omitempty"` + MemoryStats *ContainerMemoryStatistics `json:"memoryStats,omitempty"` + Name *string `json:"name,omitempty"` + ID *string `json:"id,omitempty"` + Eth0 *ContainerNetworkInterfaceStatistics `json:"eth0,omitempty"` +} + +// ContainerMemoryStatistics ... +type ContainerMemoryStatistics struct { + Usage *int64 `json:"usage,omitempty"` + MaxUsage *int64 `json:"maxUsage,omitempty"` + Limit *int64 `json:"limit,omitempty"` +} + +// ContainerNetworkInterfaceStatistics ... +type ContainerNetworkInterfaceStatistics struct { + RxBytes *int64 `json:"rxBytes,omitempty"` + RxPackets *int64 `json:"rxPackets,omitempty"` + RxErrors *int64 `json:"rxErrors,omitempty"` + RxDropped *int64 `json:"rxDropped,omitempty"` + TxBytes *int64 `json:"txBytes,omitempty"` + TxPackets *int64 `json:"txPackets,omitempty"` + TxErrors *int64 `json:"txErrors,omitempty"` + TxDropped *int64 `json:"txDropped,omitempty"` +} + +// ContainerThrottlingData ... +type ContainerThrottlingData struct { + Periods *int32 `json:"periods,omitempty"` + ThrottledPeriods *int32 `json:"throttledPeriods,omitempty"` + ThrottledTime *int32 `json:"throttledTime,omitempty"` +} + // ContinuousWebJob continuous Web Job Information. type ContinuousWebJob struct { autorest.Response `json:"-"` @@ -6681,6 +7056,17 @@ type CorsSettings struct { SupportCredentials *bool `json:"supportCredentials,omitempty"` } +// CsmCopySlotEntity copy deployment slot parameters. +type CsmCopySlotEntity struct { + // TargetSlot - Destination deployment slot during copy operation. + TargetSlot *string `json:"targetSlot,omitempty"` + // SiteConfig - The site object which will be merged with the source slot site + // to produce new destination slot site object. + // null to just copy source slot content. Otherwise a Site + // object with properties to override source slot site. + SiteConfig *SiteConfig `json:"siteConfig,omitempty"` +} + // CsmMoveResourceEnvelope object with a list of the resources that need to be moved and the resource group // they should be moved to. type CsmMoveResourceEnvelope struct { @@ -7858,6 +8244,7 @@ type DetectorAbnormalTimePeriod struct { // DetectorDefinition class representing detector definition type DetectorDefinition struct { + autorest.Response `json:"-"` // DetectorDefinitionProperties - DetectorDefinition resource specific properties *DetectorDefinitionProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource Id. @@ -9113,8 +9500,8 @@ func (d *Domain) UnmarshalJSON(body []byte) error { return nil } -// DomainAvailablilityCheckResult domain availability check result. -type DomainAvailablilityCheckResult struct { +// DomainAvailabilityCheckResult domain availability check result. +type DomainAvailabilityCheckResult struct { autorest.Response `json:"-"` // Name - Name of the domain. Name *string `json:"name,omitempty"` @@ -9767,8 +10154,8 @@ type EndpointDetail struct { Port *int32 `json:"port,omitempty"` // Latency - The time in milliseconds it takes for a TCP connection to be created from the App Service Environment to this IpAddress at this Port. Latency *float64 `json:"latency,omitempty"` - // IsAccessable - Whether it is possible to create a TCP connection from the App Service Environment to this IpAddress at this Port. - IsAccessable *bool `json:"isAccessable,omitempty"` + // IsAccessible - Whether it is possible to create a TCP connection from the App Service Environment to this IpAddress at this Port. + IsAccessible *bool `json:"isAccessible,omitempty"` } // ErrorEntity body of the error response returned from the API. @@ -9813,7 +10200,7 @@ type FileSystemHTTPLogsConfig struct { Enabled *bool `json:"enabled,omitempty"` } -// FunctionEnvelope web Job Information. +// FunctionEnvelope function information. type FunctionEnvelope struct { autorest.Response `json:"-"` // FunctionEnvelopeProperties - FunctionEnvelope resource specific properties @@ -10056,6 +10443,8 @@ type FunctionEnvelopeProperties struct { ScriptHref *string `json:"script_href,omitempty"` // ConfigHref - Config URI. ConfigHref *string `json:"config_href,omitempty"` + // TestDataHref - Test data URI. + TestDataHref *string `json:"test_data_href,omitempty"` // SecretsFileHref - Secrets file URI. SecretsFileHref *string `json:"secrets_file_href,omitempty"` // Href - Function URI. @@ -10066,6 +10455,12 @@ type FunctionEnvelopeProperties struct { Files map[string]*string `json:"files"` // TestData - Test data used when testing via the Azure Portal. TestData *string `json:"test_data,omitempty"` + // InvokeURLTemplate - The invocation URL + InvokeURLTemplate *string `json:"invoke_url_template,omitempty"` + // Language - The function language + Language *string `json:"language,omitempty"` + // IsDisabled - Gets or sets a value indicating whether the function is disabled + IsDisabled *bool `json:"isDisabled,omitempty"` } // MarshalJSON is the custom marshaler for FunctionEnvelopeProperties. @@ -10083,6 +10478,9 @@ func (fe FunctionEnvelopeProperties) MarshalJSON() ([]byte, error) { if fe.ConfigHref != nil { objectMap["config_href"] = fe.ConfigHref } + if fe.TestDataHref != nil { + objectMap["test_data_href"] = fe.TestDataHref + } if fe.SecretsFileHref != nil { objectMap["secrets_file_href"] = fe.SecretsFileHref } @@ -10098,6 +10496,15 @@ func (fe FunctionEnvelopeProperties) MarshalJSON() ([]byte, error) { if fe.TestData != nil { objectMap["test_data"] = fe.TestData } + if fe.InvokeURLTemplate != nil { + objectMap["invoke_url_template"] = fe.InvokeURLTemplate + } + if fe.Language != nil { + objectMap["language"] = fe.Language + } + if fe.IsDisabled != nil { + objectMap["isDisabled"] = fe.IsDisabled + } return json.Marshal(objectMap) } @@ -10196,14 +10603,6 @@ type FunctionSecretsProperties struct { TriggerURL *string `json:"trigger_url,omitempty"` } -// GeoDistribution a global distribution definition. -type GeoDistribution struct { - // Location - Location. - Location *string `json:"location,omitempty"` - // NumberOfWorkers - NumberOfWorkers. - NumberOfWorkers *int32 `json:"numberOfWorkers,omitempty"` -} - // GeoRegion geographical region. type GeoRegion struct { // GeoRegionProperties - GeoRegion resource specific properties @@ -10442,6 +10841,8 @@ type GeoRegionProperties struct { Description *string `json:"description,omitempty"` // DisplayName - READ-ONLY; Display name for region. DisplayName *string `json:"displayName,omitempty"` + // OrgDomain - READ-ONLY; Display name for region. + OrgDomain *string `json:"orgDomain,omitempty"` } // GlobalCsmSkuDescription a Global SKU Description. @@ -10488,8 +10889,8 @@ type HostingEnvironmentDiagnostics struct { autorest.Response `json:"-"` // Name - Name/identifier of the diagnostics. Name *string `json:"name,omitempty"` - // DiagnosicsOutput - Diagnostics output. - DiagnosicsOutput *string `json:"diagnosicsOutput,omitempty"` + // DiagnosticsOutput - Diagnostics output. + DiagnosticsOutput *string `json:"diagnosticsOutput,omitempty"` } // HostingEnvironmentProfile specification for an App Service Environment to use for this resource. @@ -11478,8 +11879,8 @@ func NewIdentifierCollectionPage(getNextPage func(context.Context, IdentifierCol // IdentifierProperties identifier resource specific properties type IdentifierProperties struct { - // ID - String representation of the identity. - ID *string `json:"id,omitempty"` + // Value - String representation of the identity. + Value *string `json:"id,omitempty"` } // InboundEnvironmentEndpoint the IP Addresses and Ports that require inbound network access to and within @@ -11945,120 +12346,112 @@ func (j JobProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// ListCapability ... -type ListCapability struct { - autorest.Response `json:"-"` - Value *[]Capability `json:"value,omitempty"` -} - -// ListCertificateEmail ... -type ListCertificateEmail struct { +// KeyVaultReferenceCollection web app key vault reference and status ARM resource. +type KeyVaultReferenceCollection struct { autorest.Response `json:"-"` - Value *[]CertificateEmail `json:"value,omitempty"` + // KeyVaultReferenceCollectionProperties - KeyVaultReferenceCollection resource specific properties + *KeyVaultReferenceCollectionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` } -// ListCertificateOrderAction ... -type ListCertificateOrderAction struct { - autorest.Response `json:"-"` - Value *[]CertificateOrderAction `json:"value,omitempty"` +// MarshalJSON is the custom marshaler for KeyVaultReferenceCollection. +func (kvrc KeyVaultReferenceCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if kvrc.KeyVaultReferenceCollectionProperties != nil { + objectMap["properties"] = kvrc.KeyVaultReferenceCollectionProperties + } + if kvrc.Kind != nil { + objectMap["kind"] = kvrc.Kind + } + return json.Marshal(objectMap) } -// ListHostingEnvironmentDiagnostics ... -type ListHostingEnvironmentDiagnostics struct { - autorest.Response `json:"-"` - Value *[]HostingEnvironmentDiagnostics `json:"value,omitempty"` -} - -// ListNetworkTrace ... -type ListNetworkTrace struct { - autorest.Response `json:"-"` - Value *[]NetworkTrace `json:"value,omitempty"` -} - -// ListOperation ... -type ListOperation struct { - autorest.Response `json:"-"` - Value *[]Operation `json:"value,omitempty"` -} - -// ListVnetInfo ... -type ListVnetInfo struct { - autorest.Response `json:"-"` - Value *[]VnetInfo `json:"value,omitempty"` -} - -// ListVnetRoute ... -type ListVnetRoute struct { - autorest.Response `json:"-"` - Value *[]VnetRoute `json:"value,omitempty"` -} - -// LocalizableString localizable string object containing the name and a localized value. -type LocalizableString struct { - // Value - Non-localized name. - Value *string `json:"value,omitempty"` - // LocalizedValue - Localized name. - LocalizedValue *string `json:"localizedValue,omitempty"` -} +// UnmarshalJSON is the custom unmarshaler for KeyVaultReferenceCollection struct. +func (kvrc *KeyVaultReferenceCollection) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var keyVaultReferenceCollectionProperties KeyVaultReferenceCollectionProperties + err = json.Unmarshal(*v, &keyVaultReferenceCollectionProperties) + if err != nil { + return err + } + kvrc.KeyVaultReferenceCollectionProperties = &keyVaultReferenceCollectionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + kvrc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + kvrc.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + kvrc.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + kvrc.Type = &typeVar + } + } + } -// LogSpecification log Definition of a single resource metric. -type LogSpecification struct { - Name *string `json:"name,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - BlobDuration *string `json:"blobDuration,omitempty"` + return nil } -// ManagedServiceIdentity managed service identity. -type ManagedServiceIdentity struct { - // Type - Type of managed service identity. Possible values include: 'ManagedServiceIdentityTypeSystemAssigned', 'ManagedServiceIdentityTypeUserAssigned', 'ManagedServiceIdentityTypeSystemAssignedUserAssigned', 'ManagedServiceIdentityTypeNone' - Type ManagedServiceIdentityType `json:"type,omitempty"` - // TenantID - READ-ONLY; Tenant of managed service identity. - TenantID *string `json:"tenantId,omitempty"` - // PrincipalID - READ-ONLY; Principal Id of managed service identity. - PrincipalID *string `json:"principalId,omitempty"` - // UserAssignedIdentities - The list of user assigned identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName} - UserAssignedIdentities map[string]*ManagedServiceIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` +// KeyVaultReferenceCollectionProperties keyVaultReferenceCollection resource specific properties +type KeyVaultReferenceCollectionProperties struct { + KeyToReferenceStatuses map[string]*APIKVReference `json:"keyToReferenceStatuses"` } -// MarshalJSON is the custom marshaler for ManagedServiceIdentity. -func (msi ManagedServiceIdentity) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for KeyVaultReferenceCollectionProperties. +func (kvrc KeyVaultReferenceCollectionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if msi.Type != "" { - objectMap["type"] = msi.Type - } - if msi.UserAssignedIdentities != nil { - objectMap["userAssignedIdentities"] = msi.UserAssignedIdentities + if kvrc.KeyToReferenceStatuses != nil { + objectMap["keyToReferenceStatuses"] = kvrc.KeyToReferenceStatuses } return json.Marshal(objectMap) } -// ManagedServiceIdentityUserAssignedIdentitiesValue ... -type ManagedServiceIdentityUserAssignedIdentitiesValue struct { - // PrincipalID - READ-ONLY; Principal Id of user assigned identity - PrincipalID *string `json:"principalId,omitempty"` - // ClientID - READ-ONLY; Client Id of user assigned identity - ClientID *string `json:"clientId,omitempty"` -} - -// MetricAvailabilily metric availability and retention. -type MetricAvailabilily struct { - // TimeGrain - Time grain. - TimeGrain *string `json:"timeGrain,omitempty"` - // Retention - Retention period for the current time grain. - Retention *string `json:"retention,omitempty"` -} - -// MetricAvailability retention policy of a resource metric. -type MetricAvailability struct { - TimeGrain *string `json:"timeGrain,omitempty"` - BlobDuration *string `json:"blobDuration,omitempty"` -} - -// MetricDefinition metadata for a metric. -type MetricDefinition struct { +// KeyVaultReferenceResource web app key vault reference and status ARM resource. +type KeyVaultReferenceResource struct { autorest.Response `json:"-"` - // MetricDefinitionProperties - MetricDefinition resource specific properties - *MetricDefinitionProperties `json:"properties,omitempty"` + // APIKVReference - Core resource properties + *APIKVReference `json:"properties,omitempty"` // ID - READ-ONLY; Resource Id. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource Name. @@ -12069,20 +12462,20 @@ type MetricDefinition struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for MetricDefinition. -func (md MetricDefinition) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for KeyVaultReferenceResource. +func (kvrr KeyVaultReferenceResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if md.MetricDefinitionProperties != nil { - objectMap["properties"] = md.MetricDefinitionProperties + if kvrr.APIKVReference != nil { + objectMap["properties"] = kvrr.APIKVReference } - if md.Kind != nil { - objectMap["kind"] = md.Kind + if kvrr.Kind != nil { + objectMap["kind"] = kvrr.Kind } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for MetricDefinition struct. -func (md *MetricDefinition) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for KeyVaultReferenceResource struct. +func (kvrr *KeyVaultReferenceResource) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -12092,12 +12485,12 @@ func (md *MetricDefinition) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var metricDefinitionProperties MetricDefinitionProperties - err = json.Unmarshal(*v, &metricDefinitionProperties) + var aPIKVReference APIKVReference + err = json.Unmarshal(*v, &aPIKVReference) if err != nil { return err } - md.MetricDefinitionProperties = &metricDefinitionProperties + kvrr.APIKVReference = &aPIKVReference } case "id": if v != nil { @@ -12106,7 +12499,7 @@ func (md *MetricDefinition) UnmarshalJSON(body []byte) error { if err != nil { return err } - md.ID = &ID + kvrr.ID = &ID } case "name": if v != nil { @@ -12115,7 +12508,7 @@ func (md *MetricDefinition) UnmarshalJSON(body []byte) error { if err != nil { return err } - md.Name = &name + kvrr.Name = &name } case "kind": if v != nil { @@ -12124,7 +12517,7 @@ func (md *MetricDefinition) UnmarshalJSON(body []byte) error { if err != nil { return err } - md.Kind = &kind + kvrr.Kind = &kind } case "type": if v != nil { @@ -12133,7 +12526,7 @@ func (md *MetricDefinition) UnmarshalJSON(body []byte) error { if err != nil { return err } - md.Type = &typeVar + kvrr.Type = &typeVar } } } @@ -12141,16 +12534,105 @@ func (md *MetricDefinition) UnmarshalJSON(body []byte) error { return nil } -// MetricDefinitionProperties metricDefinition resource specific properties -type MetricDefinitionProperties struct { - // Unit - READ-ONLY; Unit of the metric. - Unit *string `json:"unit,omitempty"` - // PrimaryAggregationType - READ-ONLY; Primary aggregation type. - PrimaryAggregationType *string `json:"primaryAggregationType,omitempty"` - // MetricAvailabilities - READ-ONLY; List of time grains supported for the metric together with retention period. - MetricAvailabilities *[]MetricAvailabilily `json:"metricAvailabilities,omitempty"` - // DisplayName - READ-ONLY; Friendly name shown in the UI. - DisplayName *string `json:"displayName,omitempty"` +// ListCapability ... +type ListCapability struct { + autorest.Response `json:"-"` + Value *[]Capability `json:"value,omitempty"` +} + +// ListCertificateEmail ... +type ListCertificateEmail struct { + autorest.Response `json:"-"` + Value *[]CertificateEmail `json:"value,omitempty"` +} + +// ListCertificateOrderAction ... +type ListCertificateOrderAction struct { + autorest.Response `json:"-"` + Value *[]CertificateOrderAction `json:"value,omitempty"` +} + +// ListHostingEnvironmentDiagnostics ... +type ListHostingEnvironmentDiagnostics struct { + autorest.Response `json:"-"` + Value *[]HostingEnvironmentDiagnostics `json:"value,omitempty"` +} + +// ListNetworkTrace ... +type ListNetworkTrace struct { + autorest.Response `json:"-"` + Value *[]NetworkTrace `json:"value,omitempty"` +} + +// ListOperation ... +type ListOperation struct { + autorest.Response `json:"-"` + Value *[]Operation `json:"value,omitempty"` +} + +// ListVnetInfo ... +type ListVnetInfo struct { + autorest.Response `json:"-"` + Value *[]VnetInfo `json:"value,omitempty"` +} + +// ListVnetRoute ... +type ListVnetRoute struct { + autorest.Response `json:"-"` + Value *[]VnetRoute `json:"value,omitempty"` +} + +// LocalizableString localizable string object containing the name and a localized value. +type LocalizableString struct { + // Value - Non-localized name. + Value *string `json:"value,omitempty"` + // LocalizedValue - Localized name. + LocalizedValue *string `json:"localizedValue,omitempty"` +} + +// LogSpecification log Definition of a single resource metric. +type LogSpecification struct { + Name *string `json:"name,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + BlobDuration *string `json:"blobDuration,omitempty"` +} + +// ManagedServiceIdentity managed service identity. +type ManagedServiceIdentity struct { + // Type - Type of managed service identity. Possible values include: 'ManagedServiceIdentityTypeNone', 'ManagedServiceIdentityTypeSystemAssigned', 'ManagedServiceIdentityTypeUserAssigned' + Type ManagedServiceIdentityType `json:"type,omitempty"` + // TenantID - READ-ONLY; Tenant of managed service identity. + TenantID *string `json:"tenantId,omitempty"` + // PrincipalID - READ-ONLY; Principal Id of managed service identity. + PrincipalID *string `json:"principalId,omitempty"` + // UserAssignedIdentities - The list of user assigned identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName} + UserAssignedIdentities map[string]*ManagedServiceIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` +} + +// MarshalJSON is the custom marshaler for ManagedServiceIdentity. +func (msi ManagedServiceIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if msi.Type != "" { + objectMap["type"] = msi.Type + } + if msi.UserAssignedIdentities != nil { + objectMap["userAssignedIdentities"] = msi.UserAssignedIdentities + } + return json.Marshal(objectMap) +} + +// ManagedServiceIdentityUserAssignedIdentitiesValue ... +type ManagedServiceIdentityUserAssignedIdentitiesValue struct { + // PrincipalID - READ-ONLY; Principal Id of user assigned identity + PrincipalID *string `json:"principalId,omitempty"` + // ClientID - READ-ONLY; Client Id of user assigned identity + ClientID *string `json:"clientId,omitempty"` +} + +// MetricAvailability retention policy of a resource metric. +type MetricAvailability struct { + TimeGrain *string `json:"timeGrain,omitempty"` + BlobDuration *string `json:"blobDuration,omitempty"` } // MetricSpecification definition of a single resource metric. @@ -12170,6 +12652,7 @@ type MetricSpecification struct { Dimensions *[]Dimension `json:"dimensions,omitempty"` Category *string `json:"category,omitempty"` Availabilities *[]MetricAvailability `json:"availabilities,omitempty"` + SupportedTimeGrainTypes *[]string `json:"supportedTimeGrainTypes,omitempty"` } // MigrateMySQLRequest mySQL migration request. @@ -14622,7 +15105,6 @@ type ProcessModuleInfoProperties struct { // ProcessThreadInfo process Thread Information. type ProcessThreadInfo struct { - autorest.Response `json:"-"` // ProcessThreadInfoProperties - ProcessThreadInfo resource specific properties *ProcessThreadInfoProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource Id. @@ -14875,8 +15357,6 @@ type ProcessThreadInfoProperties struct { TotalProcessorTime *string `json:"total_processor_time,omitempty"` // UserProcessorTime - User processor time. UserProcessorTime *string `json:"user_processor_time,omitempty"` - // PriviledgedProcessorTime - Privileged processor time. - PriviledgedProcessorTime *string `json:"priviledged_processor_time,omitempty"` // State - Thread state. State *string `json:"state,omitempty"` // WaitReason - Wait reason. @@ -15247,9 +15727,9 @@ type RampUpRule struct { ActionHostName *string `json:"actionHostName,omitempty"` // ReroutePercentage - Percentage of the traffic which will be redirected to ActionHostName. ReroutePercentage *float64 `json:"reroutePercentage,omitempty"` - // ChangeStep - In auto ramp up scenario this is the step to add/remove from ReroutePercentage until it reaches - // MinReroutePercentage or MaxReroutePercentage. Site metrics are checked every N minutes specified in ChangeIntervalInMinutes. - // Custom decision algorithm can be provided in TiPCallback site extension which URL can be specified in ChangeDecisionCallbackUrl. + // ChangeStep - In auto ramp up scenario this is the step to add/remove from ReroutePercentage until it reaches \nMinReroutePercentage or + // MaxReroutePercentage. Site metrics are checked every N minutes specified in ChangeIntervalInMinutes.\nCustom decision algorithm + // can be provided in TiPCallback site extension which URL can be specified in ChangeDecisionCallbackUrl. ChangeStep *float64 `json:"changeStep,omitempty"` // ChangeIntervalInMinutes - Specifies interval in minutes to reevaluate ReroutePercentage. ChangeIntervalInMinutes *int32 `json:"changeIntervalInMinutes,omitempty"` @@ -16399,28 +16879,6 @@ type ResourceHealthMetadataProperties struct { SignalAvailability *bool `json:"signalAvailability,omitempty"` } -// ResourceMetric object representing a metric for any resource . -type ResourceMetric struct { - // Name - READ-ONLY; Name of metric. - Name *ResourceMetricName `json:"name,omitempty"` - // Unit - READ-ONLY; Metric unit. - Unit *string `json:"unit,omitempty"` - // TimeGrain - READ-ONLY; Metric granularity. E.g PT1H, PT5M, P1D - TimeGrain *string `json:"timeGrain,omitempty"` - // StartTime - READ-ONLY; Metric start time. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - READ-ONLY; Metric end time. - EndTime *date.Time `json:"endTime,omitempty"` - // ResourceID - READ-ONLY; Metric resource Id. - ResourceID *string `json:"resourceId,omitempty"` - // ID - READ-ONLY; Resource Id. - ID *string `json:"id,omitempty"` - // MetricValues - READ-ONLY; Metric values. - MetricValues *[]ResourceMetricValue `json:"metricValues,omitempty"` - // Properties - READ-ONLY; Resource metric properties collection. - Properties *[]ResourceMetricProperty `json:"properties,omitempty"` -} - // ResourceMetricAvailability metrics availability and retention. type ResourceMetricAvailability struct { // TimeGrain - READ-ONLY; Time grain . @@ -16429,152 +16887,6 @@ type ResourceMetricAvailability struct { Retention *string `json:"retention,omitempty"` } -// ResourceMetricCollection collection of metric responses. -type ResourceMetricCollection struct { - autorest.Response `json:"-"` - // Value - Collection of resources. - Value *[]ResourceMetric `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to next page of resources. - NextLink *string `json:"nextLink,omitempty"` -} - -// ResourceMetricCollectionIterator provides access to a complete listing of ResourceMetric values. -type ResourceMetricCollectionIterator struct { - i int - page ResourceMetricCollectionPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ResourceMetricCollectionIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceMetricCollectionIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ResourceMetricCollectionIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ResourceMetricCollectionIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ResourceMetricCollectionIterator) Response() ResourceMetricCollection { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ResourceMetricCollectionIterator) Value() ResourceMetric { - if !iter.page.NotDone() { - return ResourceMetric{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ResourceMetricCollectionIterator type. -func NewResourceMetricCollectionIterator(page ResourceMetricCollectionPage) ResourceMetricCollectionIterator { - return ResourceMetricCollectionIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rmc ResourceMetricCollection) IsEmpty() bool { - return rmc.Value == nil || len(*rmc.Value) == 0 -} - -// resourceMetricCollectionPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rmc ResourceMetricCollection) resourceMetricCollectionPreparer(ctx context.Context) (*http.Request, error) { - if rmc.NextLink == nil || len(to.String(rmc.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rmc.NextLink))) -} - -// ResourceMetricCollectionPage contains a page of ResourceMetric values. -type ResourceMetricCollectionPage struct { - fn func(context.Context, ResourceMetricCollection) (ResourceMetricCollection, error) - rmc ResourceMetricCollection -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ResourceMetricCollectionPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceMetricCollectionPage.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.rmc) - if err != nil { - return err - } - page.rmc = 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 *ResourceMetricCollectionPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ResourceMetricCollectionPage) NotDone() bool { - return !page.rmc.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ResourceMetricCollectionPage) Response() ResourceMetricCollection { - return page.rmc -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ResourceMetricCollectionPage) Values() []ResourceMetric { - if page.rmc.IsEmpty() { - return nil - } - return *page.rmc.Value -} - -// Creates a new instance of the ResourceMetricCollectionPage type. -func NewResourceMetricCollectionPage(getNextPage func(context.Context, ResourceMetricCollection) (ResourceMetricCollection, error)) ResourceMetricCollectionPage { - return ResourceMetricCollectionPage{fn: getNextPage} -} - // ResourceMetricDefinition metadata for the metrics. type ResourceMetricDefinition struct { // ResourceMetricDefinitionProperties - ResourceMetricDefinition resource specific properties @@ -16828,40 +17140,6 @@ func (rmd ResourceMetricDefinitionProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// ResourceMetricName name of a metric for any resource . -type ResourceMetricName struct { - // Value - READ-ONLY; metric name value. - Value *string `json:"value,omitempty"` - // LocalizedValue - READ-ONLY; Localized metric name value. - LocalizedValue *string `json:"localizedValue,omitempty"` -} - -// ResourceMetricProperty resource metric property. -type ResourceMetricProperty struct { - // Key - Key for resource metric property. - Key *string `json:"key,omitempty"` - // Value - Value of pair. - Value *string `json:"value,omitempty"` -} - -// ResourceMetricValue value of resource metric. -type ResourceMetricValue struct { - // Timestamp - READ-ONLY; Value timestamp. - Timestamp *string `json:"timestamp,omitempty"` - // Average - READ-ONLY; Value average. - Average *float64 `json:"average,omitempty"` - // Minimum - READ-ONLY; Value minimum. - Minimum *float64 `json:"minimum,omitempty"` - // Maximum - READ-ONLY; Value maximum. - Maximum *float64 `json:"maximum,omitempty"` - // Total - READ-ONLY; Value total. - Total *float64 `json:"total,omitempty"` - // Count - READ-ONLY; Value count. - Count *float64 `json:"count,omitempty"` - // Properties - READ-ONLY; Resource metric properties collection. - Properties *[]ResourceMetricProperty `json:"properties,omitempty"` -} - // ResourceNameAvailability information regarding availability of a resource name. type ResourceNameAvailability struct { autorest.Response `json:"-"` @@ -17385,8 +17663,6 @@ type SiteConfig struct { PublishingUsername *string `json:"publishingUsername,omitempty"` // AppSettings - Application settings. AppSettings *[]NameValuePair `json:"appSettings,omitempty"` - // AzureStorageAccounts - User-provided Azure storage accounts. - AzureStorageAccounts map[string]*AzureStorageInfoValue `json:"azureStorageAccounts"` // ConnectionStrings - Connection strings. ConnectionStrings *[]ConnStringInfo `json:"connectionStrings,omitempty"` // MachineKey - READ-ONLY; Site MachineKey. @@ -17395,7 +17671,7 @@ type SiteConfig struct { HandlerMappings *[]HandlerMapping `json:"handlerMappings,omitempty"` // DocumentRoot - Document root. DocumentRoot *string `json:"documentRoot,omitempty"` - // ScmType - SCM type. Possible values include: 'ScmTypeNone', 'ScmTypeDropbox', 'ScmTypeTfs', 'ScmTypeLocalGit', 'ScmTypeGitHub', 'ScmTypeCodePlexGit', 'ScmTypeCodePlexHg', 'ScmTypeBitbucketGit', 'ScmTypeBitbucketHg', 'ScmTypeExternalGit', 'ScmTypeExternalHg', 'ScmTypeOneDrive', 'ScmTypeVSO' + // ScmType - SCM type. Possible values include: 'ScmTypeNone', 'ScmTypeDropbox', 'ScmTypeTfs', 'ScmTypeLocalGit', 'ScmTypeGitHub', 'ScmTypeCodePlexGit', 'ScmTypeCodePlexHg', 'ScmTypeBitbucketGit', 'ScmTypeBitbucketHg', 'ScmTypeExternalGit', 'ScmTypeExternalHg', 'ScmTypeOneDrive', 'ScmTypeVSO', 'ScmTypeVSTSRM' ScmType ScmType `json:"scmType,omitempty"` // Use32BitWorkerProcess - true to use 32-bit worker process; otherwise, false. Use32BitWorkerProcess *bool `json:"use32BitWorkerProcess,omitempty"` @@ -17435,6 +17711,8 @@ type SiteConfig struct { Push *PushSettings `json:"push,omitempty"` // APIDefinition - Information about the formal API definition for the app. APIDefinition *APIDefinitionInfo `json:"apiDefinition,omitempty"` + // APIManagementConfig - Azure API management settings linked to the app. + APIManagementConfig *APIManagementConfig `json:"apiManagementConfig,omitempty"` // AutoSwapSlotName - Auto-swap slot name. AutoSwapSlotName *string `json:"autoSwapSlotName,omitempty"` // LocalMySQLEnabled - true to enable local MySQL; otherwise, false. @@ -17455,171 +17733,11 @@ type SiteConfig struct { MinTLSVersion SupportedTLSVersions `json:"minTlsVersion,omitempty"` // FtpsState - State of FTP / FTPS service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' FtpsState FtpsState `json:"ftpsState,omitempty"` - // ReservedInstanceCount - Number of reserved instances. - // This setting only applies to the Consumption Plan - ReservedInstanceCount *int32 `json:"reservedInstanceCount,omitempty"` -} - -// MarshalJSON is the custom marshaler for SiteConfig. -func (sc SiteConfig) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sc.NumberOfWorkers != nil { - objectMap["numberOfWorkers"] = sc.NumberOfWorkers - } - if sc.DefaultDocuments != nil { - objectMap["defaultDocuments"] = sc.DefaultDocuments - } - if sc.NetFrameworkVersion != nil { - objectMap["netFrameworkVersion"] = sc.NetFrameworkVersion - } - if sc.PhpVersion != nil { - objectMap["phpVersion"] = sc.PhpVersion - } - if sc.PythonVersion != nil { - objectMap["pythonVersion"] = sc.PythonVersion - } - if sc.NodeVersion != nil { - objectMap["nodeVersion"] = sc.NodeVersion - } - if sc.LinuxFxVersion != nil { - objectMap["linuxFxVersion"] = sc.LinuxFxVersion - } - if sc.WindowsFxVersion != nil { - objectMap["windowsFxVersion"] = sc.WindowsFxVersion - } - if sc.RequestTracingEnabled != nil { - objectMap["requestTracingEnabled"] = sc.RequestTracingEnabled - } - if sc.RequestTracingExpirationTime != nil { - objectMap["requestTracingExpirationTime"] = sc.RequestTracingExpirationTime - } - if sc.RemoteDebuggingEnabled != nil { - objectMap["remoteDebuggingEnabled"] = sc.RemoteDebuggingEnabled - } - if sc.RemoteDebuggingVersion != nil { - objectMap["remoteDebuggingVersion"] = sc.RemoteDebuggingVersion - } - if sc.HTTPLoggingEnabled != nil { - objectMap["httpLoggingEnabled"] = sc.HTTPLoggingEnabled - } - if sc.LogsDirectorySizeLimit != nil { - objectMap["logsDirectorySizeLimit"] = sc.LogsDirectorySizeLimit - } - if sc.DetailedErrorLoggingEnabled != nil { - objectMap["detailedErrorLoggingEnabled"] = sc.DetailedErrorLoggingEnabled - } - if sc.PublishingUsername != nil { - objectMap["publishingUsername"] = sc.PublishingUsername - } - if sc.AppSettings != nil { - objectMap["appSettings"] = sc.AppSettings - } - if sc.AzureStorageAccounts != nil { - objectMap["azureStorageAccounts"] = sc.AzureStorageAccounts - } - if sc.ConnectionStrings != nil { - objectMap["connectionStrings"] = sc.ConnectionStrings - } - if sc.HandlerMappings != nil { - objectMap["handlerMappings"] = sc.HandlerMappings - } - if sc.DocumentRoot != nil { - objectMap["documentRoot"] = sc.DocumentRoot - } - if sc.ScmType != "" { - objectMap["scmType"] = sc.ScmType - } - if sc.Use32BitWorkerProcess != nil { - objectMap["use32BitWorkerProcess"] = sc.Use32BitWorkerProcess - } - if sc.WebSocketsEnabled != nil { - objectMap["webSocketsEnabled"] = sc.WebSocketsEnabled - } - if sc.AlwaysOn != nil { - objectMap["alwaysOn"] = sc.AlwaysOn - } - if sc.JavaVersion != nil { - objectMap["javaVersion"] = sc.JavaVersion - } - if sc.JavaContainer != nil { - objectMap["javaContainer"] = sc.JavaContainer - } - if sc.JavaContainerVersion != nil { - objectMap["javaContainerVersion"] = sc.JavaContainerVersion - } - if sc.AppCommandLine != nil { - objectMap["appCommandLine"] = sc.AppCommandLine - } - if sc.ManagedPipelineMode != "" { - objectMap["managedPipelineMode"] = sc.ManagedPipelineMode - } - if sc.VirtualApplications != nil { - objectMap["virtualApplications"] = sc.VirtualApplications - } - if sc.LoadBalancing != "" { - objectMap["loadBalancing"] = sc.LoadBalancing - } - if sc.Experiments != nil { - objectMap["experiments"] = sc.Experiments - } - if sc.Limits != nil { - objectMap["limits"] = sc.Limits - } - if sc.AutoHealEnabled != nil { - objectMap["autoHealEnabled"] = sc.AutoHealEnabled - } - if sc.AutoHealRules != nil { - objectMap["autoHealRules"] = sc.AutoHealRules - } - if sc.TracingOptions != nil { - objectMap["tracingOptions"] = sc.TracingOptions - } - if sc.VnetName != nil { - objectMap["vnetName"] = sc.VnetName - } - if sc.Cors != nil { - objectMap["cors"] = sc.Cors - } - if sc.Push != nil { - objectMap["push"] = sc.Push - } - if sc.APIDefinition != nil { - objectMap["apiDefinition"] = sc.APIDefinition - } - if sc.AutoSwapSlotName != nil { - objectMap["autoSwapSlotName"] = sc.AutoSwapSlotName - } - if sc.LocalMySQLEnabled != nil { - objectMap["localMySqlEnabled"] = sc.LocalMySQLEnabled - } - if sc.ManagedServiceIdentityID != nil { - objectMap["managedServiceIdentityId"] = sc.ManagedServiceIdentityID - } - if sc.XManagedServiceIdentityID != nil { - objectMap["xManagedServiceIdentityId"] = sc.XManagedServiceIdentityID - } - if sc.IPSecurityRestrictions != nil { - objectMap["ipSecurityRestrictions"] = sc.IPSecurityRestrictions - } - if sc.ScmIPSecurityRestrictions != nil { - objectMap["scmIpSecurityRestrictions"] = sc.ScmIPSecurityRestrictions - } - if sc.ScmIPSecurityRestrictionsUseMain != nil { - objectMap["scmIpSecurityRestrictionsUseMain"] = sc.ScmIPSecurityRestrictionsUseMain - } - if sc.HTTP20Enabled != nil { - objectMap["http20Enabled"] = sc.HTTP20Enabled - } - if sc.MinTLSVersion != "" { - objectMap["minTlsVersion"] = sc.MinTLSVersion - } - if sc.FtpsState != "" { - objectMap["ftpsState"] = sc.FtpsState - } - if sc.ReservedInstanceCount != nil { - objectMap["reservedInstanceCount"] = sc.ReservedInstanceCount - } - return json.Marshal(objectMap) + // PreWarmedInstanceCount - Number of preWarmed instances. + // This setting only applies to the Consumption and Elastic Plans + PreWarmedInstanceCount *int32 `json:"preWarmedInstanceCount,omitempty"` + // HealthCheckPath - Health check path + HealthCheckPath *string `json:"healthCheckPath,omitempty"` } // SiteConfigResource web app configuration ARM resource. @@ -18465,6 +18583,127 @@ type SiteInstanceProperties struct { SiteInstanceName *string `json:"siteInstanceName,omitempty"` } +// SiteInstanceStatus ... +type SiteInstanceStatus struct { + autorest.Response `json:"-"` + // SiteInstanceStatusProperties - WebSiteInstanceStatus resource specific properties + *SiteInstanceStatusProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SiteInstanceStatus. +func (sis SiteInstanceStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sis.SiteInstanceStatusProperties != nil { + objectMap["properties"] = sis.SiteInstanceStatusProperties + } + if sis.Kind != nil { + objectMap["kind"] = sis.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SiteInstanceStatus struct. +func (sis *SiteInstanceStatus) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var siteInstanceStatusProperties SiteInstanceStatusProperties + err = json.Unmarshal(*v, &siteInstanceStatusProperties) + if err != nil { + return err + } + sis.SiteInstanceStatusProperties = &siteInstanceStatusProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sis.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sis.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + sis.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sis.Type = &typeVar + } + } + } + + return nil +} + +// SiteInstanceStatusProperties webSiteInstanceStatus resource specific properties +type SiteInstanceStatusProperties struct { + // State - Possible values include: 'READY', 'STOPPED', 'UNKNOWN' + State SiteRuntimeState `json:"state,omitempty"` + // StatusURL - Link to the GetStatusApi in Kudu + StatusURL *string `json:"statusUrl,omitempty"` + // DetectorURL - Link to the Diagnose and Solve Portal + DetectorURL *string `json:"detectorUrl,omitempty"` + // ConsoleURL - Link to the Diagnose and Solve Portal + ConsoleURL *string `json:"consoleUrl,omitempty"` + Containers map[string]*ContainerInfo `json:"containers"` +} + +// MarshalJSON is the custom marshaler for SiteInstanceStatusProperties. +func (sis SiteInstanceStatusProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sis.State != "" { + objectMap["state"] = sis.State + } + if sis.StatusURL != nil { + objectMap["statusUrl"] = sis.StatusURL + } + if sis.DetectorURL != nil { + objectMap["detectorUrl"] = sis.DetectorURL + } + if sis.ConsoleURL != nil { + objectMap["consoleUrl"] = sis.ConsoleURL + } + if sis.Containers != nil { + objectMap["containers"] = sis.Containers + } + return json.Marshal(objectMap) +} + // SiteLimits metric limits set on an app. type SiteLimits struct { // MaxPercentageCPU - Maximum allowed CPU usage percentage. @@ -18735,7 +18974,7 @@ type SitePatchResourceProperties struct { HostNamesDisabled *bool `json:"hostNamesDisabled,omitempty"` // OutboundIPAddresses - READ-ONLY; List of IP addresses that the app uses for outbound connections (e.g. database access). Includes VIPs from tenants that site can be hosted with current settings. Read-only. OutboundIPAddresses *string `json:"outboundIpAddresses,omitempty"` - // PossibleOutboundIPAddresses - READ-ONLY; List of IP addresses that the app uses for outbound connections (e.g. database access). Includes VIPs from all tenants. Read-only. + // PossibleOutboundIPAddresses - READ-ONLY; List of IP addresses that the app uses for outbound connections (e.g. database access). Includes VIPs from all tenants except dataComponent. Read-only. PossibleOutboundIPAddresses *string `json:"possibleOutboundIpAddresses,omitempty"` // ContainerSize - Size of the function container. ContainerSize *int32 `json:"containerSize,omitempty"` @@ -18763,8 +19002,6 @@ type SitePatchResourceProperties struct { RedundancyMode RedundancyMode `json:"redundancyMode,omitempty"` // InProgressOperationID - READ-ONLY; Specifies an operation id if this site has a pending operation. InProgressOperationID *uuid.UUID `json:"inProgressOperationId,omitempty"` - // GeoDistributions - GeoDistributions for this site - GeoDistributions *[]GeoDistribution `json:"geoDistributions,omitempty"` } // SitePhpErrorLogFlag used for getting PHP error logging flag. @@ -18916,7 +19153,7 @@ type SiteProperties struct { HostNamesDisabled *bool `json:"hostNamesDisabled,omitempty"` // OutboundIPAddresses - READ-ONLY; List of IP addresses that the app uses for outbound connections (e.g. database access). Includes VIPs from tenants that site can be hosted with current settings. Read-only. OutboundIPAddresses *string `json:"outboundIpAddresses,omitempty"` - // PossibleOutboundIPAddresses - READ-ONLY; List of IP addresses that the app uses for outbound connections (e.g. database access). Includes VIPs from all tenants. Read-only. + // PossibleOutboundIPAddresses - READ-ONLY; List of IP addresses that the app uses for outbound connections (e.g. database access). Includes VIPs from all tenants except dataComponent. Read-only. PossibleOutboundIPAddresses *string `json:"possibleOutboundIpAddresses,omitempty"` // ContainerSize - Size of the function container. ContainerSize *int32 `json:"containerSize,omitempty"` @@ -18944,8 +19181,6 @@ type SiteProperties struct { RedundancyMode RedundancyMode `json:"redundancyMode,omitempty"` // InProgressOperationID - READ-ONLY; Specifies an operation id if this site has a pending operation. InProgressOperationID *uuid.UUID `json:"inProgressOperationId,omitempty"` - // GeoDistributions - GeoDistributions for this site - GeoDistributions *[]GeoDistribution `json:"geoDistributions,omitempty"` } // SiteSeal site seal @@ -20258,6 +20493,12 @@ type StackMajorVersion struct { MinorVersions *[]StackMinorVersion `json:"minorVersions,omitempty"` // ApplicationInsights - true if this supports Application Insights; otherwise, false. ApplicationInsights *bool `json:"applicationInsights,omitempty"` + // IsPreview - true if this stack is in Preview, otherwise false. + IsPreview *bool `json:"isPreview,omitempty"` + // IsDeprecated - true if this stack has been deprecated, otherwise false. + IsDeprecated *bool `json:"isDeprecated,omitempty"` + // IsHidden - true if this stack should be hidden for new customers on portal, otherwise false. + IsHidden *bool `json:"isHidden,omitempty"` } // StackMinorVersion application stack minor version. @@ -20284,7 +20525,7 @@ type StampCapacity struct { Unit *string `json:"unit,omitempty"` // ComputeMode - Shared/dedicated workers. Possible values include: 'ComputeModeOptionsShared', 'ComputeModeOptionsDedicated', 'ComputeModeOptionsDynamic' ComputeMode ComputeModeOptions `json:"computeMode,omitempty"` - // WorkerSize - Size of the machines. Possible values include: 'WorkerSizeOptionsSmall', 'WorkerSizeOptionsMedium', 'WorkerSizeOptionsLarge', 'WorkerSizeOptionsD1', 'WorkerSizeOptionsD2', 'WorkerSizeOptionsD3', 'WorkerSizeOptionsDefault' + // WorkerSize - Size of the machines. Possible values include: 'WorkerSizeOptionsSmall', 'WorkerSizeOptionsMedium', 'WorkerSizeOptionsLarge', 'WorkerSizeOptionsD1', 'WorkerSizeOptionsD2', 'WorkerSizeOptionsD3', 'WorkerSizeOptionsNestedSmall', 'WorkerSizeOptionsDefault' WorkerSize WorkerSizeOptions `json:"workerSize,omitempty"` // WorkerSizeID - Size ID of machines: // 0 - Small @@ -22185,22 +22426,6 @@ type UserProperties struct { ScmURI *string `json:"scmUri,omitempty"` } -// ValidateContainerSettingsRequest container settings validation request context -type ValidateContainerSettingsRequest struct { - // BaseURL - Base URL of the container registry - BaseURL *string `json:"baseUrl,omitempty"` - // Username - Username for to access the container registry - Username *string `json:"username,omitempty"` - // Password - Password for to access the container registry - Password *string `json:"password,omitempty"` - // Repository - Repository name (image name) - Repository *string `json:"repository,omitempty"` - // Tag - Image tag - Tag *string `json:"tag,omitempty"` - // Platform - Platform (windows or linux) - Platform *string `json:"platform,omitempty"` -} - // ValidateProperties app properties used for validation. type ValidateProperties struct { // ServerFarmID - ARM resource ID of an App Service plan that would host the app. @@ -22217,6 +22442,18 @@ type ValidateProperties struct { HostingEnvironment *string `json:"hostingEnvironment,omitempty"` // IsXenon - true if App Service plan is running as a windows container IsXenon *bool `json:"isXenon,omitempty"` + // ContainerRegistryBaseURL - Base URL of the container registry + ContainerRegistryBaseURL *string `json:"containerRegistryBaseUrl,omitempty"` + // ContainerRegistryUsername - Username for to access the container registry + ContainerRegistryUsername *string `json:"containerRegistryUsername,omitempty"` + // ContainerRegistryPassword - Password for to access the container registry + ContainerRegistryPassword *string `json:"containerRegistryPassword,omitempty"` + // ContainerImageRepository - Repository name (image name) + ContainerImageRepository *string `json:"containerImageRepository,omitempty"` + // ContainerImageTag - Image tag + ContainerImageTag *string `json:"containerImageTag,omitempty"` + // ContainerImagePlatform - Platform (windows or linux) + ContainerImagePlatform *string `json:"containerImagePlatform,omitempty"` } // ValidateRequest resource validation request content. @@ -22347,6 +22584,8 @@ type VirtualIPMapping struct { InternalHTTPSPort *int32 `json:"internalHttpsPort,omitempty"` // InUse - Is virtual IP mapping in use. InUse *bool `json:"inUse,omitempty"` + // ServiceName - name of the service that virtual IP is assigned to + ServiceName *string `json:"serviceName,omitempty"` } // VirtualNetworkProfile specification for using a Virtual Network. diff --git a/services/web/mgmt/2019-08-01/web/provider.go b/services/web/mgmt/2019-08-01/web/provider.go index c24ca0866e5c..bcbf208112cd 100644 --- a/services/web/mgmt/2019-08-01/web/provider.go +++ b/services/web/mgmt/2019-08-01/web/provider.go @@ -40,7 +40,7 @@ func NewProviderClientWithBaseURI(baseURI string, subscriptionID string) Provide return ProviderClient{NewWithBaseURI(baseURI, subscriptionID)} } -// GetAvailableStacks get available application frameworks and their versions +// GetAvailableStacks description for Get available application frameworks and their versions func (client ProviderClient) GetAvailableStacks(ctx context.Context, osTypeSelected string) (result ApplicationStackCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ProviderClient.GetAvailableStacks") @@ -76,7 +76,7 @@ func (client ProviderClient) GetAvailableStacks(ctx context.Context, osTypeSelec // GetAvailableStacksPreparer prepares the GetAvailableStacks request. func (client ProviderClient) GetAvailableStacksPreparer(ctx context.Context, osTypeSelected string) (*http.Request, error) { - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -149,7 +149,7 @@ func (client ProviderClient) GetAvailableStacksComplete(ctx context.Context, osT return } -// GetAvailableStacksOnPrem get available application frameworks and their versions +// GetAvailableStacksOnPrem description for Get available application frameworks and their versions func (client ProviderClient) GetAvailableStacksOnPrem(ctx context.Context, osTypeSelected string) (result ApplicationStackCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ProviderClient.GetAvailableStacksOnPrem") @@ -189,7 +189,7 @@ func (client ProviderClient) GetAvailableStacksOnPremPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -262,8 +262,8 @@ func (client ProviderClient) GetAvailableStacksOnPremComplete(ctx context.Contex return } -// ListOperations gets all available operations for the Microsoft.Web resource provider. Also exposes resource metric -// definitions +// ListOperations description for Gets all available operations for the Microsoft.Web resource provider. Also exposes +// resource metric definitions func (client ProviderClient) ListOperations(ctx context.Context) (result CsmOperationCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ProviderClient.ListOperations") @@ -299,7 +299,7 @@ func (client ProviderClient) ListOperations(ctx context.Context) (result CsmOper // ListOperationsPreparer prepares the ListOperations request. func (client ProviderClient) ListOperationsPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/web/mgmt/2019-08-01/web/recommendations.go b/services/web/mgmt/2019-08-01/web/recommendations.go index 89c4e3421530..e97d6099b247 100644 --- a/services/web/mgmt/2019-08-01/web/recommendations.go +++ b/services/web/mgmt/2019-08-01/web/recommendations.go @@ -41,7 +41,7 @@ func NewRecommendationsClientWithBaseURI(baseURI string, subscriptionID string) return RecommendationsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// DisableAllForHostingEnvironment disable all recommendations for an app. +// DisableAllForHostingEnvironment description for Disable all recommendations for an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // environmentName - name of the app. @@ -93,7 +93,7 @@ func (client RecommendationsClient) DisableAllForHostingEnvironmentPreparer(ctx "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, "environmentName": autorest.Encode("query", environmentName), @@ -126,7 +126,7 @@ func (client RecommendationsClient) DisableAllForHostingEnvironmentResponder(res return } -// DisableAllForWebApp disable all recommendations for an app. +// DisableAllForWebApp description for Disable all recommendations for an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // siteName - name of the app. @@ -178,7 +178,7 @@ func (client RecommendationsClient) DisableAllForWebAppPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -210,7 +210,7 @@ func (client RecommendationsClient) DisableAllForWebAppResponder(resp *http.Resp return } -// DisableRecommendationForHostingEnvironment disables the specific rule for a web site permanently. +// DisableRecommendationForHostingEnvironment description for Disables the specific rule for a web site permanently. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // environmentName - site name @@ -264,7 +264,7 @@ func (client RecommendationsClient) DisableRecommendationForHostingEnvironmentPr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, "environmentName": autorest.Encode("query", environmentName), @@ -297,7 +297,7 @@ func (client RecommendationsClient) DisableRecommendationForHostingEnvironmentRe return } -// DisableRecommendationForSite disables the specific rule for a web site permanently. +// DisableRecommendationForSite description for Disables the specific rule for a web site permanently. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // siteName - site name @@ -351,7 +351,7 @@ func (client RecommendationsClient) DisableRecommendationForSitePreparer(ctx con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -383,8 +383,8 @@ func (client RecommendationsClient) DisableRecommendationForSiteResponder(resp * return } -// DisableRecommendationForSubscription disables the specified rule so it will not apply to a subscription in the -// future. +// DisableRecommendationForSubscription description for Disables the specified rule so it will not apply to a +// subscription in the future. // Parameters: // name - rule name func (client RecommendationsClient) DisableRecommendationForSubscription(ctx context.Context, name string) (result autorest.Response, err error) { @@ -426,7 +426,7 @@ func (client RecommendationsClient) DisableRecommendationForSubscriptionPreparer "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -458,7 +458,7 @@ func (client RecommendationsClient) DisableRecommendationForSubscriptionResponde return } -// GetRuleDetailsByHostingEnvironment get a recommendation rule for an app. +// GetRuleDetailsByHostingEnvironment description for Get a recommendation rule for an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // hostingEnvironmentName - name of the hosting environment. @@ -515,7 +515,7 @@ func (client RecommendationsClient) GetRuleDetailsByHostingEnvironmentPreparer(c "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -554,7 +554,7 @@ func (client RecommendationsClient) GetRuleDetailsByHostingEnvironmentResponder( return } -// GetRuleDetailsByWebApp get a recommendation rule for an app. +// GetRuleDetailsByWebApp description for Get a recommendation rule for an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // siteName - name of the app. @@ -611,7 +611,7 @@ func (client RecommendationsClient) GetRuleDetailsByWebAppPreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -650,7 +650,7 @@ func (client RecommendationsClient) GetRuleDetailsByWebAppResponder(resp *http.R return } -// List list all recommendations for a subscription. +// List description for List all recommendations for a subscription. // Parameters: // featured - specify true to return only the most critical recommendations. The default is // false, which returns all recommendations. @@ -696,7 +696,7 @@ func (client RecommendationsClient) ListPreparer(ctx context.Context, featured * "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -772,7 +772,8 @@ func (client RecommendationsClient) ListComplete(ctx context.Context, featured * return } -// ListHistoryForHostingEnvironment get past recommendations for an app, optionally specified by the time range. +// ListHistoryForHostingEnvironment description for Get past recommendations for an app, optionally specified by the +// time range. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // hostingEnvironmentName - name of the hosting environment. @@ -830,7 +831,7 @@ func (client RecommendationsClient) ListHistoryForHostingEnvironmentPreparer(ctx "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -906,7 +907,7 @@ func (client RecommendationsClient) ListHistoryForHostingEnvironmentComplete(ctx return } -// ListHistoryForWebApp get past recommendations for an app, optionally specified by the time range. +// ListHistoryForWebApp description for Get past recommendations for an app, optionally specified by the time range. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // siteName - name of the app. @@ -964,7 +965,7 @@ func (client RecommendationsClient) ListHistoryForWebAppPreparer(ctx context.Con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1040,7 +1041,7 @@ func (client RecommendationsClient) ListHistoryForWebAppComplete(ctx context.Con return } -// ListRecommendedRulesForHostingEnvironment get all recommendations for an app. +// ListRecommendedRulesForHostingEnvironment description for Get all recommendations for an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // hostingEnvironmentName - name of the app. @@ -1097,7 +1098,7 @@ func (client RecommendationsClient) ListRecommendedRulesForHostingEnvironmentPre "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1173,7 +1174,7 @@ func (client RecommendationsClient) ListRecommendedRulesForHostingEnvironmentCom return } -// ListRecommendedRulesForWebApp get all recommendations for an app. +// ListRecommendedRulesForWebApp description for Get all recommendations for an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // siteName - name of the app. @@ -1230,7 +1231,7 @@ func (client RecommendationsClient) ListRecommendedRulesForWebAppPreparer(ctx co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1306,7 +1307,7 @@ func (client RecommendationsClient) ListRecommendedRulesForWebAppComplete(ctx co return } -// ResetAllFilters reset all recommendation opt-out settings for a subscription. +// ResetAllFilters description for Reset all recommendation opt-out settings for a subscription. func (client RecommendationsClient) ResetAllFilters(ctx context.Context) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/RecommendationsClient.ResetAllFilters") @@ -1345,7 +1346,7 @@ func (client RecommendationsClient) ResetAllFiltersPreparer(ctx context.Context) "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1377,7 +1378,7 @@ func (client RecommendationsClient) ResetAllFiltersResponder(resp *http.Response return } -// ResetAllFiltersForHostingEnvironment reset all recommendation opt-out settings for an app. +// ResetAllFiltersForHostingEnvironment description for Reset all recommendation opt-out settings for an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // environmentName - name of the app. @@ -1429,7 +1430,7 @@ func (client RecommendationsClient) ResetAllFiltersForHostingEnvironmentPreparer "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, "environmentName": autorest.Encode("query", environmentName), @@ -1462,7 +1463,7 @@ func (client RecommendationsClient) ResetAllFiltersForHostingEnvironmentResponde return } -// ResetAllFiltersForWebApp reset all recommendation opt-out settings for an app. +// ResetAllFiltersForWebApp description for Reset all recommendation opt-out settings for an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // siteName - name of the app. @@ -1514,7 +1515,7 @@ func (client RecommendationsClient) ResetAllFiltersForWebAppPreparer(ctx context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/web/mgmt/2019-08-01/web/resourcehealthmetadata.go b/services/web/mgmt/2019-08-01/web/resourcehealthmetadata.go index b43c6e5f64c0..ff89c6a5f2e9 100644 --- a/services/web/mgmt/2019-08-01/web/resourcehealthmetadata.go +++ b/services/web/mgmt/2019-08-01/web/resourcehealthmetadata.go @@ -41,7 +41,7 @@ func NewResourceHealthMetadataClientWithBaseURI(baseURI string, subscriptionID s return ResourceHealthMetadataClient{NewWithBaseURI(baseURI, subscriptionID)} } -// GetBySite gets the category of ResourceHealthMetadata to use for the given site +// GetBySite description for Gets the category of ResourceHealthMetadata to use for the given site // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of web app @@ -93,7 +93,7 @@ func (client ResourceHealthMetadataClient) GetBySitePreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -126,7 +126,7 @@ func (client ResourceHealthMetadataClient) GetBySiteResponder(resp *http.Respons return } -// GetBySiteSlot gets the category of ResourceHealthMetadata to use for the given site +// GetBySiteSlot description for Gets the category of ResourceHealthMetadata to use for the given site // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of web app @@ -180,7 +180,7 @@ func (client ResourceHealthMetadataClient) GetBySiteSlotPreparer(ctx context.Con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -213,7 +213,7 @@ func (client ResourceHealthMetadataClient) GetBySiteSlotResponder(resp *http.Res return } -// List list all ResourceHealthMetadata for all sites in the subscription. +// List description for List all ResourceHealthMetadata for all sites in the subscription. func (client ResourceHealthMetadataClient) List(ctx context.Context) (result ResourceHealthMetadataCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ResourceHealthMetadataClient.List") @@ -253,7 +253,7 @@ func (client ResourceHealthMetadataClient) ListPreparer(ctx context.Context) (*h "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -323,7 +323,8 @@ func (client ResourceHealthMetadataClient) ListComplete(ctx context.Context) (re return } -// ListByResourceGroup list all ResourceHealthMetadata for all sites in the resource group in the subscription. +// ListByResourceGroup description for List all ResourceHealthMetadata for all sites in the resource group in the +// subscription. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. func (client ResourceHealthMetadataClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ResourceHealthMetadataCollectionPage, err error) { @@ -374,7 +375,7 @@ func (client ResourceHealthMetadataClient) ListByResourceGroupPreparer(ctx conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -444,7 +445,7 @@ func (client ResourceHealthMetadataClient) ListByResourceGroupComplete(ctx conte return } -// ListBySite gets the category of ResourceHealthMetadata to use for the given site as a collection +// ListBySite description for Gets the category of ResourceHealthMetadata to use for the given site as a collection // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of web app. @@ -497,7 +498,7 @@ func (client ResourceHealthMetadataClient) ListBySitePreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -567,7 +568,7 @@ func (client ResourceHealthMetadataClient) ListBySiteComplete(ctx context.Contex return } -// ListBySiteSlot gets the category of ResourceHealthMetadata to use for the given site as a collection +// ListBySiteSlot description for Gets the category of ResourceHealthMetadata to use for the given site as a collection // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of web app. @@ -622,7 +623,7 @@ func (client ResourceHealthMetadataClient) ListBySiteSlotPreparer(ctx context.Co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/web/mgmt/2019-08-01/web/topleveldomains.go b/services/web/mgmt/2019-08-01/web/topleveldomains.go index 969de2a398a6..c06f49a25cb4 100644 --- a/services/web/mgmt/2019-08-01/web/topleveldomains.go +++ b/services/web/mgmt/2019-08-01/web/topleveldomains.go @@ -40,7 +40,7 @@ func NewTopLevelDomainsClientWithBaseURI(baseURI string, subscriptionID string) return TopLevelDomainsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// Get get details of a top-level domain. +// Get description for Get details of a top-level domain. // Parameters: // name - name of the top-level domain. func (client TopLevelDomainsClient) Get(ctx context.Context, name string) (result TopLevelDomain, err error) { @@ -82,7 +82,7 @@ func (client TopLevelDomainsClient) GetPreparer(ctx context.Context, name string "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -115,7 +115,7 @@ func (client TopLevelDomainsClient) GetResponder(resp *http.Response) (result To return } -// List get all top-level domains supported for registration. +// List description for Get all top-level domains supported for registration. func (client TopLevelDomainsClient) List(ctx context.Context) (result TopLevelDomainCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TopLevelDomainsClient.List") @@ -155,7 +155,7 @@ func (client TopLevelDomainsClient) ListPreparer(ctx context.Context) (*http.Req "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -225,7 +225,7 @@ func (client TopLevelDomainsClient) ListComplete(ctx context.Context) (result To return } -// ListAgreements gets all legal agreements that user needs to accept before purchasing a domain. +// ListAgreements description for Gets all legal agreements that user needs to accept before purchasing a domain. // Parameters: // name - name of the top-level domain. // agreementOption - domain agreement options. @@ -269,7 +269,7 @@ func (client TopLevelDomainsClient) ListAgreementsPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/web/mgmt/2019-08-01/web/version.go b/services/web/mgmt/2019-08-01/web/version.go index 596623e11a99..21f486dc5341 100644 --- a/services/web/mgmt/2019-08-01/web/version.go +++ b/services/web/mgmt/2019-08-01/web/version.go @@ -21,7 +21,7 @@ import "github.com/Azure/azure-sdk-for-go/version" // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/" + version.Number + " web/2018-02-01" + return "Azure-SDK-For-Go/" + version.Number + " web/2019-08-01" } // Version returns the semantic version (see http://semver.org) of the client. diff --git a/services/web/mgmt/2019-08-01/web/webapi/interfaces.go b/services/web/mgmt/2019-08-01/web/webapi/interfaces.go index 2a38b29638d2..c08650cfe8a3 100644 --- a/services/web/mgmt/2019-08-01/web/webapi/interfaces.go +++ b/services/web/mgmt/2019-08-01/web/webapi/interfaces.go @@ -40,7 +40,6 @@ type BaseClientAPI interface { UpdatePublishingUser(ctx context.Context, userDetails web.User) (result web.User, err error) UpdateSourceControl(ctx context.Context, sourceControlType string, requestMessage web.SourceControl) (result web.SourceControl, err error) Validate(ctx context.Context, resourceGroupName string, validateRequest web.ValidateRequest) (result web.ValidateResponse, err error) - ValidateContainerSettings(ctx context.Context, validateContainerSettingsRequest web.ValidateContainerSettingsRequest, resourceGroupName string) (result web.SetObject, err error) ValidateMove(ctx context.Context, resourceGroupName string, moveResourceEnvelope web.CsmMoveResourceEnvelope) (result autorest.Response, err error) VerifyHostingEnvironmentVnet(ctx context.Context, parameters web.VnetParameters) (result web.VnetValidationFailureDetails, err error) } @@ -82,7 +81,7 @@ var _ CertificateRegistrationProviderClientAPI = (*web.CertificateRegistrationPr // DomainsClientAPI contains the set of methods on the DomainsClient type. type DomainsClientAPI interface { - CheckAvailability(ctx context.Context, identifier web.NameIdentifier) (result web.DomainAvailablilityCheckResult, err error) + CheckAvailability(ctx context.Context, identifier web.NameIdentifier) (result web.DomainAvailabilityCheckResult, err error) CreateOrUpdate(ctx context.Context, resourceGroupName string, domainName string, domain web.Domain) (result web.DomainsCreateOrUpdateFuture, err error) CreateOrUpdateOwnershipIdentifier(ctx context.Context, resourceGroupName string, domainName string, name string, domainOwnershipIdentifier web.DomainOwnershipIdentifier) (result web.DomainOwnershipIdentifier, err error) Delete(ctx context.Context, resourceGroupName string, domainName string, forceHardDeleteDomain *bool) (result autorest.Response, err error) @@ -145,12 +144,12 @@ type DiagnosticsClientAPI interface { ExecuteSiteDetector(ctx context.Context, resourceGroupName string, siteName string, detectorName string, diagnosticCategory string, startTime *date.Time, endTime *date.Time, timeGrain string) (result web.DiagnosticDetectorResponse, err error) ExecuteSiteDetectorSlot(ctx context.Context, resourceGroupName string, siteName string, detectorName string, diagnosticCategory string, slot string, startTime *date.Time, endTime *date.Time, timeGrain string) (result web.DiagnosticDetectorResponse, err error) GetHostingEnvironmentDetectorResponse(ctx context.Context, resourceGroupName string, name string, detectorName string, startTime *date.Time, endTime *date.Time, timeGrain string) (result web.DetectorResponse, err error) - GetSiteAnalysis(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, analysisName string) (result web.DiagnosticAnalysis, err error) - GetSiteAnalysisSlot(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, analysisName string, slot string) (result web.DiagnosticAnalysis, err error) - GetSiteDetector(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, detectorName string) (result web.DiagnosticDetectorCollectionPage, err error) + GetSiteAnalysis(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, analysisName string) (result web.AnalysisDefinition, err error) + GetSiteAnalysisSlot(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, analysisName string, slot string) (result web.AnalysisDefinition, err error) + GetSiteDetector(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, detectorName string) (result web.DetectorDefinition, err error) GetSiteDetectorResponse(ctx context.Context, resourceGroupName string, siteName string, detectorName string, startTime *date.Time, endTime *date.Time, timeGrain string) (result web.DetectorResponse, err error) GetSiteDetectorResponseSlot(ctx context.Context, resourceGroupName string, siteName string, detectorName string, slot string, startTime *date.Time, endTime *date.Time, timeGrain string) (result web.DetectorResponse, err error) - GetSiteDetectorSlot(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, detectorName string, slot string) (result web.DiagnosticDetectorCollectionPage, err error) + GetSiteDetectorSlot(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, detectorName string, slot string) (result web.DetectorDefinition, err error) GetSiteDiagnosticCategory(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string) (result web.DiagnosticCategory, err error) GetSiteDiagnosticCategorySlot(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, slot string) (result web.DiagnosticCategory, err error) ListHostingEnvironmentDetectorResponses(ctx context.Context, resourceGroupName string, name string) (result web.DetectorResponseCollectionPage, err error) @@ -206,6 +205,8 @@ type AppsClientAPI interface { ApplySlotConfigurationSlot(ctx context.Context, resourceGroupName string, name string, slotSwapEntity web.CsmSlotEntity, slot string) (result autorest.Response, err error) Backup(ctx context.Context, resourceGroupName string, name string, request web.BackupRequest) (result web.BackupItem, err error) BackupSlot(ctx context.Context, resourceGroupName string, name string, request web.BackupRequest, slot string) (result web.BackupItem, err error) + CopyProductionSlot(ctx context.Context, resourceGroupName string, name string, copySlotEntity web.CsmCopySlotEntity) (result web.AppsCopyProductionSlotFuture, err error) + CopySlotSlot(ctx context.Context, resourceGroupName string, name string, copySlotEntity web.CsmCopySlotEntity, slot string) (result web.AppsCopySlotSlotFuture, err error) CreateDeployment(ctx context.Context, resourceGroupName string, name string, ID string, deployment web.Deployment) (result web.Deployment, err error) CreateDeploymentSlot(ctx context.Context, resourceGroupName string, name string, ID string, slot string, deployment web.Deployment) (result web.Deployment, err error) CreateFunction(ctx context.Context, resourceGroupName string, name string, functionName string, functionEnvelope web.FunctionEnvelope) (result web.AppsCreateFunctionFuture, err error) @@ -279,6 +280,8 @@ type AppsClientAPI interface { GenerateNewSitePublishingPassword(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) GenerateNewSitePublishingPasswordSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) Get(ctx context.Context, resourceGroupName string, name string) (result web.Site, err error) + GetAppSettingKeyVaultReference(ctx context.Context, resourceGroupName string, name string, appSettingKey string) (result web.KeyVaultReferenceResource, err error) + GetAppSettingsKeyVaultReferences(ctx context.Context, resourceGroupName string, name string) (result web.KeyVaultReferenceCollection, err error) GetAuthSettings(ctx context.Context, resourceGroupName string, name string) (result web.SiteAuthSettings, err error) GetAuthSettingsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.SiteAuthSettings, err error) GetBackupConfiguration(ctx context.Context, resourceGroupName string, name string) (result web.BackupRequest, err error) @@ -307,6 +310,8 @@ type AppsClientAPI interface { GetHybridConnection(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string) (result web.HybridConnection, err error) GetHybridConnectionSlot(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, slot string) (result web.HybridConnection, err error) GetInstanceFunctionSlot(ctx context.Context, resourceGroupName string, name string, functionName string, slot string) (result web.FunctionEnvelope, err error) + GetInstanceInfo(ctx context.Context, resourceGroupName string, name string, instanceID string) (result web.SiteInstanceStatus, err error) + GetInstanceInfoSlot(ctx context.Context, resourceGroupName string, name string, instanceID string, slot string) (result web.SiteInstanceStatus, err error) GetInstanceMSDeployLog(ctx context.Context, resourceGroupName string, name string, instanceID string) (result web.MSDeployLog, err error) GetInstanceMSDeployLogSlot(ctx context.Context, resourceGroupName string, name string, slot string, instanceID string) (result web.MSDeployLog, err error) GetInstanceMsDeployStatus(ctx context.Context, resourceGroupName string, name string, instanceID string) (result web.MSDeployStatus, err error) @@ -317,8 +322,6 @@ type AppsClientAPI interface { GetInstanceProcessModule(ctx context.Context, resourceGroupName string, name string, processID string, baseAddress string, instanceID string) (result web.ProcessModuleInfo, err error) GetInstanceProcessModuleSlot(ctx context.Context, resourceGroupName string, name string, processID string, baseAddress string, slot string, instanceID string) (result web.ProcessModuleInfo, err error) GetInstanceProcessSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string) (result web.ProcessInfo, err error) - GetInstanceProcessThread(ctx context.Context, resourceGroupName string, name string, processID string, threadID string, instanceID string) (result web.ProcessThreadInfo, err error) - GetInstanceProcessThreadSlot(ctx context.Context, resourceGroupName string, name string, processID string, threadID string, slot string, instanceID string) (result web.ProcessThreadInfo, err error) GetMigrateMySQLStatus(ctx context.Context, resourceGroupName string, name string) (result web.MigrateMySQLStatus, err error) GetMigrateMySQLStatusSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.MigrateMySQLStatus, err error) GetMSDeployLog(ctx context.Context, resourceGroupName string, name string) (result web.MSDeployLog, err error) @@ -343,8 +346,6 @@ type AppsClientAPI interface { GetProcessModule(ctx context.Context, resourceGroupName string, name string, processID string, baseAddress string) (result web.ProcessModuleInfo, err error) GetProcessModuleSlot(ctx context.Context, resourceGroupName string, name string, processID string, baseAddress string, slot string) (result web.ProcessModuleInfo, err error) GetProcessSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string) (result web.ProcessInfo, err error) - GetProcessThread(ctx context.Context, resourceGroupName string, name string, processID string, threadID string) (result web.ProcessThreadInfo, err error) - GetProcessThreadSlot(ctx context.Context, resourceGroupName string, name string, processID string, threadID string, slot string) (result web.ProcessThreadInfo, err error) GetPublicCertificate(ctx context.Context, resourceGroupName string, name string, publicCertificateName string) (result web.PublicCertificate, err error) GetPublicCertificateSlot(ctx context.Context, resourceGroupName string, name string, slot string, publicCertificateName string) (result web.PublicCertificate, err error) GetRelayServiceConnection(ctx context.Context, resourceGroupName string, name string, entityName string) (result web.RelayServiceConnectionEntity, err error) @@ -403,8 +404,6 @@ type AppsClientAPI interface { ListFunctionSecretsSlot(ctx context.Context, resourceGroupName string, name string, functionName string, slot string) (result web.FunctionSecrets, err error) ListHostNameBindings(ctx context.Context, resourceGroupName string, name string) (result web.HostNameBindingCollectionPage, err error) ListHostNameBindingsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.HostNameBindingCollectionPage, err error) - ListHybridConnectionKeys(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string) (result web.HybridConnectionKey, err error) - ListHybridConnectionKeysSlot(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, slot string) (result web.HybridConnectionKey, err error) ListHybridConnections(ctx context.Context, resourceGroupName string, name string) (result web.HybridConnection, err error) ListHybridConnectionsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.HybridConnection, err error) ListInstanceFunctionsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.FunctionEnvelopeCollectionPage, err error) @@ -418,10 +417,6 @@ type AppsClientAPI interface { ListInstanceProcessThreadsSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string) (result web.ProcessThreadInfoCollectionPage, err error) ListMetadata(ctx context.Context, resourceGroupName string, name string) (result web.StringDictionary, err error) ListMetadataSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.StringDictionary, err error) - ListMetricDefinitions(ctx context.Context, resourceGroupName string, name string) (result web.ResourceMetricDefinitionCollectionPage, err error) - ListMetricDefinitionsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.ResourceMetricDefinitionCollectionPage, err error) - ListMetrics(ctx context.Context, resourceGroupName string, name string, details *bool, filter string) (result web.ResourceMetricCollectionPage, err error) - ListMetricsSlot(ctx context.Context, resourceGroupName string, name string, slot string, details *bool, filter string) (result web.ResourceMetricCollectionPage, err error) ListNetworkFeatures(ctx context.Context, resourceGroupName string, name string, view string) (result web.NetworkFeatures, err error) ListNetworkFeaturesSlot(ctx context.Context, resourceGroupName string, name string, view string, slot string) (result web.NetworkFeatures, err error) ListPerfMonCounters(ctx context.Context, resourceGroupName string, name string, filter string) (result web.PerfMonCounterCollectionPage, err error) @@ -442,6 +437,8 @@ type AppsClientAPI interface { ListPublishingProfileXMLWithSecretsSlot(ctx context.Context, resourceGroupName string, name string, publishingProfileOptions web.CsmPublishingProfileOptions, slot string) (result web.ReadCloser, err error) ListRelayServiceConnections(ctx context.Context, resourceGroupName string, name string) (result web.RelayServiceConnectionEntity, err error) ListRelayServiceConnectionsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.RelayServiceConnectionEntity, err error) + ListSiteBackups(ctx context.Context, resourceGroupName string, name string) (result web.BackupItemCollectionPage, err error) + ListSiteBackupsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.BackupItemCollectionPage, err error) ListSiteExtensions(ctx context.Context, resourceGroupName string, name string) (result web.SiteExtensionInfoCollectionPage, err error) ListSiteExtensionsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.SiteExtensionInfoCollectionPage, err error) ListSitePushSettings(ctx context.Context, resourceGroupName string, name string) (result web.PushSettings, err error) @@ -563,30 +560,24 @@ type AppServiceEnvironmentsClientAPI interface { GetInboundNetworkDependenciesEndpoints(ctx context.Context, resourceGroupName string, name string) (result web.InboundEnvironmentEndpointCollectionPage, err error) GetMultiRolePool(ctx context.Context, resourceGroupName string, name string) (result web.WorkerPoolResource, err error) GetOutboundNetworkDependenciesEndpoints(ctx context.Context, resourceGroupName string, name string) (result web.OutboundEnvironmentEndpointCollectionPage, err error) + GetVipInfo(ctx context.Context, resourceGroupName string, name string) (result web.AddressResponse, err error) GetWorkerPool(ctx context.Context, resourceGroupName string, name string, workerPoolName string) (result web.WorkerPoolResource, err error) List(ctx context.Context) (result web.AppServiceEnvironmentCollectionPage, err error) ListAppServicePlans(ctx context.Context, resourceGroupName string, name string) (result web.AppServicePlanCollectionPage, err error) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result web.AppServiceEnvironmentCollectionPage, err error) ListCapacities(ctx context.Context, resourceGroupName string, name string) (result web.StampCapacityCollectionPage, err error) ListDiagnostics(ctx context.Context, resourceGroupName string, name string) (result web.ListHostingEnvironmentDiagnostics, err error) - ListMetricDefinitions(ctx context.Context, resourceGroupName string, name string) (result web.MetricDefinition, err error) - ListMetrics(ctx context.Context, resourceGroupName string, name string, details *bool, filter string) (result web.ResourceMetricCollectionPage, err error) ListMultiRoleMetricDefinitions(ctx context.Context, resourceGroupName string, name string) (result web.ResourceMetricDefinitionCollectionPage, err error) - ListMultiRoleMetrics(ctx context.Context, resourceGroupName string, name string, startTime string, endTime string, timeGrain string, details *bool, filter string) (result web.ResourceMetricCollectionPage, err error) ListMultiRolePoolInstanceMetricDefinitions(ctx context.Context, resourceGroupName string, name string, instance string) (result web.ResourceMetricDefinitionCollectionPage, err error) - ListMultiRolePoolInstanceMetrics(ctx context.Context, resourceGroupName string, name string, instance string, details *bool) (result web.ResourceMetricCollectionPage, err error) ListMultiRolePools(ctx context.Context, resourceGroupName string, name string) (result web.WorkerPoolCollectionPage, err error) ListMultiRolePoolSkus(ctx context.Context, resourceGroupName string, name string) (result web.SkuInfoCollectionPage, err error) ListMultiRoleUsages(ctx context.Context, resourceGroupName string, name string) (result web.UsageCollectionPage, err error) ListOperations(ctx context.Context, resourceGroupName string, name string) (result web.ListOperation, err error) ListUsages(ctx context.Context, resourceGroupName string, name string, filter string) (result web.CsmUsageQuotaCollectionPage, err error) - ListVips(ctx context.Context, resourceGroupName string, name string) (result web.AddressResponse, err error) ListWebApps(ctx context.Context, resourceGroupName string, name string, propertiesToInclude string) (result web.AppCollectionPage, err error) ListWebWorkerMetricDefinitions(ctx context.Context, resourceGroupName string, name string, workerPoolName string) (result web.ResourceMetricDefinitionCollectionPage, err error) - ListWebWorkerMetrics(ctx context.Context, resourceGroupName string, name string, workerPoolName string, details *bool, filter string) (result web.ResourceMetricCollectionPage, err error) ListWebWorkerUsages(ctx context.Context, resourceGroupName string, name string, workerPoolName string) (result web.UsageCollectionPage, err error) ListWorkerPoolInstanceMetricDefinitions(ctx context.Context, resourceGroupName string, name string, workerPoolName string, instance string) (result web.ResourceMetricDefinitionCollectionPage, err error) - ListWorkerPoolInstanceMetrics(ctx context.Context, resourceGroupName string, name string, workerPoolName string, instance string, details *bool, filter string) (result web.ResourceMetricCollectionPage, err error) ListWorkerPools(ctx context.Context, resourceGroupName string, name string) (result web.WorkerPoolCollectionPage, err error) ListWorkerPoolSkus(ctx context.Context, resourceGroupName string, name string, workerPoolName string) (result web.SkuInfoCollectionPage, err error) Reboot(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) @@ -618,8 +609,6 @@ type AppServicePlansClientAPI interface { ListCapabilities(ctx context.Context, resourceGroupName string, name string) (result web.ListCapability, err error) ListHybridConnectionKeys(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string) (result web.HybridConnectionKey, err error) ListHybridConnections(ctx context.Context, resourceGroupName string, name string) (result web.HybridConnectionCollectionPage, err error) - ListMetricDefintions(ctx context.Context, resourceGroupName string, name string) (result web.ResourceMetricDefinitionCollectionPage, err error) - ListMetrics(ctx context.Context, resourceGroupName string, name string, details *bool, filter string) (result web.ResourceMetricCollectionPage, err error) ListRoutesForVnet(ctx context.Context, resourceGroupName string, name string, vnetName string) (result web.ListVnetRoute, err error) ListUsages(ctx context.Context, resourceGroupName string, name string, filter string) (result web.CsmUsageQuotaCollectionPage, err error) ListVnets(ctx context.Context, resourceGroupName string, name string) (result web.ListVnetInfo, err error) diff --git a/version/version.go b/version/version.go index 3cf3e821410e..38c89d8f8d54 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 = "v34.4.0" +const Number = "v35.0.0"